Skip to content

Commit

Permalink
OAuth Login Implementation (#116 #50)
Browse files Browse the repository at this point in the history
  • Loading branch information
dqwiki committed Jan 31, 2017
1 parent afce507 commit e819f74
Show file tree
Hide file tree
Showing 32 changed files with 928 additions and 404 deletions.
Empty file modified .gitignore 100755 → 100644
Empty file.
Empty file modified UTRSBot.php 100755 → 100644
Empty file.
60 changes: 0 additions & 60 deletions VERSION 2 REQS.txt

This file was deleted.

Empty file modified appealsPublic.py 100755 → 100644
Empty file.
Empty file modified config.inc.php 100755 → 100644
Empty file.
Empty file modified mysql_schema.sql 100755 → 100644
Empty file.
30 changes: 30 additions & 0 deletions public_html/.codeclimate.yml
@@ -0,0 +1,30 @@
---
engines:
csslint:
enabled: true
duplication:
enabled: true
config:
languages:
- ruby
- javascript
- python
- php
fixme:
enabled: true
phpmd:
enabled: true
radon:
enabled: true
ratings:
paths:
- "**.css"
- "**.inc"
- "**.js"
- "**.jsx"
- "**.module"
- "**.php"
- "**.py"
- "**.rb"
exclude_paths:
- tests/
2 changes: 2 additions & 0 deletions public_html/.csslintrc
@@ -0,0 +1,2 @@
--exclude-exts=.min.css
--ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes
36 changes: 36 additions & 0 deletions public_html/.gitignore
@@ -0,0 +1,36 @@
# Eclipse files
.project
.buildpath

# VIM swap files
*.swp

# Config files
config.js
config.inc.php

#do not upload beta
beta/*
alpha/*

#ignore bootstrap js/css/etc.
js/*
css/*
fonts/*

.settings/*

#ignore potential htaccess
*.htaccess
*.jsdtscope

#any config

config*

#includes files
*includes/*
.idea/

*peachy*
public_html/status.php
11 changes: 11 additions & 0 deletions public_html/.pullapprove.yml
@@ -0,0 +1,11 @@
approve_by_comment: true
approve_regex: '^(Approved|:shipit:|:\+1:|\+1|Code Certified)'
reject_regex: '^(Rejected|:shipit:|:\-1:|\-1|Needs developer)'
reset_on_push: false
reviewers:
name: UTRS Architects
members:
- 'TParis'
- dqwiki
name: default
required: 1
12 changes: 12 additions & 0 deletions public_html/.travis.phplint.sh
@@ -0,0 +1,12 @@
#!/bin/bash
#Author Addshore

find ../ -type f -name \*.php -exec php -l {} \; | grep "Errors parsing ";

#Flip the exit code
if [ $? -ne 0 ]
then
exit 0
else
exit 1
fi
44 changes: 44 additions & 0 deletions public_html/.travis.yml
@@ -0,0 +1,44 @@
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language: php

# list any PHP version you want to test against
php:
# using major version aliases

# aliased to a recent 5.5.x version
- 5.5
# aliased to a recent 5.6.x version
- 5.6
# aliased to a recent 7.x version
- 7.0

# optionally specify a list of environments, for example to test different RDBMS
env:

# execute any number of scripts before the test run, custom env's are available as variables
before_script:
- pip install --user codecov

script:
- bash travis.sh
- bash .travis.phplint.sh
- phpunit --coverage-clover=coverage.xml
- codecov

sudo: false

matrix:
allow_failures:
- php: 7.0

after_success:
- codecov

notifications:
irc:
channels:
- "chat.freenode.net#wikipedia-en-utrs-dev"
on_success: change
on_failure: always
template:
- "%{repository}/%{branch}/%{commit} - %{author} %{message} %{build_url}"
128 changes: 64 additions & 64 deletions public_html/accepttos.php 100755 → 100644
@@ -1,64 +1,64 @@
<?php
//Created by the unblock-en-l dev team (test commit)
error_reporting(E_ALL);
ini_set('display_errors', 'On');
ini_set('session.use_cookies', '1');

require_once('src/unblocklib.php');
require_once('src/exceptions.php');
require_once('src/appealObject.php');
require_once('src/statsLib.php');
require_once('src/hooks.php');
require_once('template.php');
require_once('sitemaintain.php');

checkOnline();

// make sure user is logged in, if not, kick them out
verifyLogin('home.php');

$secure = getCurrentUser()->getUseSecure();

$errorMessages = '';

//Template header()
skinHeader();

//Welcome message
echo '<p>Welcome, ' . $_SESSION['user'] . '.</p>';

if (isset($_POST['acceptToS'])) {

getCurrentUser()->setAcceptToS();

echo "Thank you, your account has been updated. Click <a href=\"home.php\">here</a> to go to the homepage.";

} else {
?>
With the development of UTRS, this project occasionally requires a modified terms of service than when you initially registered. To continue to participate in this
system, for which your time is greatly appreciated, we require you to first accept these new terms.<br />
<br />
Please review the following policies and click "I accept" below to continue:
<ul>
<li><a href="admin_privacy.php" target="_new">UTRS Member Privacy Policy and Duties</a>
<li><a href="https://wikitech.wikimedia.org/wiki/Wikitech:Labs_Terms_of_use" target="_new">Wikimedia Labs terms of service</a>
</ul>

<p><b>Warning: Do not use the Labs Project (this site) if you do not agree to the following: information shared with the Labs Project, including usernames and passwords, will be made available to volunteer administrators and may not be treated confidentially.</b>
<p>Volunteers may have full access to the systems hosting the projects, allowing them access to any data or other information you submit.
<p>As a result, use of your real Wikimedia credentials is highly discouraged in wmflabs.org projects. You should use a different password for your account than you would on projects like Wikipedia, Commons, etc.
<p>By creating an account in this project and/or using other Wikimedia Labs Services, you agree that the volunteer administrators of this project will have access to any data you submit.
<p>Since access to this information by volunteers is fundamental to the operation of Labs, these terms regarding use of your data expressly override the Wikimedia Foundation's Privacy Policy as it relates to the use and access of your personal information.

If you agree check here and click submit:
<form action="accepttos.php" method="post">
<input type="checkbox" name="acceptToS" />I Accept
<input type="submit" value="Submit" />
</form>

<?php
}
//Template footer()
skinFooter();

?>
<?php
//Created by the unblock-en-l dev team (test commit)
error_reporting(E_ALL);
ini_set('display_errors', 'On');
ini_set('session.use_cookies', '1');

require_once('src/unblocklib.php');
require_once('src/exceptions.php');
require_once('src/appealObject.php');
require_once('src/statsLib.php');
require_once('src/hooks.php');
require_once('template.php');
require_once('sitemaintain.php');

checkOnline();

// make sure user is logged in, if not, kick them out
verifyLogin('home.php');

$secure = getCurrentUser()->getUseSecure();

$errorMessages = '';

//Template header()
skinHeader();

//Welcome message
echo '<p>Welcome, ' . $_SESSION['user'] . '.</p>';

if (isset($_POST['acceptToS'])) {

getCurrentUser()->setAcceptToS();

echo "Thank you, your account has been updated. Click <a href=\"home.php\">here</a> to go to the homepage.";

} else {
?>
With the development of UTRS, this project occasionally requires a modified terms of service than when you initially registered. To continue to participate in this
system, for which your time is greatly appreciated, we require you to first accept these new terms.<br />
<br />
Please review the following policies and click "I accept" below to continue:
<ul>
<li><a href="admin_privacy.php" target="_new">UTRS Member Privacy Policy and Duties</a>
<li><a href="https://wikitech.wikimedia.org/wiki/Wikitech:Labs_Terms_of_use" target="_new">Wikimedia Labs terms of service</a>
</ul>

<p><b>Warning: Do not use the Labs Project (this site) if you do not agree to the following: information shared with the Labs Project, including usernames and passwords, will be made available to volunteer administrators and may not be treated confidentially.</b>
<p>Volunteers may have full access to the systems hosting the projects, allowing them access to any data or other information you submit.
<p>As a result, use of your real Wikimedia credentials is highly discouraged in wmflabs.org projects. You should use a different password for your account than you would on projects like Wikipedia, Commons, etc.
<p>By creating an account in this project and/or using other Wikimedia Labs Services, you agree that the volunteer administrators of this project will have access to any data you submit.
<p>Since access to this information by volunteers is fundamental to the operation of Labs, these terms regarding use of your data expressly override the Wikimedia Foundation's Privacy Policy as it relates to the use and access of your personal information.

If you agree check here and click submit:
<form action="accepttos.php" method="post">
<input type="checkbox" name="acceptToS" />I Accept
<input type="submit" value="Submit" />
</form>

<?php
}
//Template footer()
skinFooter();

?>
Empty file modified public_html/admin_privacy.php 100755 → 100644
Empty file.

0 comments on commit e819f74

Please sign in to comment.