-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Killing of jCourse. :( Goodbye old friend
- Loading branch information
Showing
6 changed files
with
86 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
import sys | ||
import os | ||
import requests | ||
|
||
from twill import commands | ||
_UNIVERSITY_LOGINS = [ | ||
{ | ||
"name": "Jacobs University Bremen", | ||
"url": 'https://campusnet.jacobs-university.de/scripts/mgrqispi.dll', | ||
"domain": 'jacobs-university.de', | ||
"payload": { | ||
'usrname': "", | ||
'pass': "", | ||
"APPNAME": "CampusNet", | ||
"PRGNAME": "LOGINCHECK", | ||
"ARGUMENTS": "clino,usrname,pass,menuno,persno,browser,platform", | ||
"clino": "000000000000001", | ||
"menuno": "000084", | ||
"persno": "00000000", | ||
"browser": "", | ||
"platform": "" | ||
} | ||
} | ||
|
||
def login_success(login_user, login_pass): | ||
commands.go('https://campusnet.jacobs-university.de/scripts/mgrqispi.dll?APPNAME=CampusNet&PRGNAME=ACTION&ARGUMENTS=-A9PnS7.Eby4LCWWmmtOcbYKUQ-so-sF48wtHtVNWX9aIeYmoSh5mej--SCbT.jubdlAouHy3dHzwyr-O.ufj3NVAYCNiJr0CFcBNwA3xADclRCTyqC0Oip8drT0F=') | ||
commands.fv('1', 'usrname', login_user) | ||
commands.fv('1', 'pass', login_pass) | ||
commands.submit('3') | ||
] | ||
|
||
out = sys.stdout | ||
bin = open(os.devnull, 'w') | ||
sys.stdout = bin | ||
login_result = commands.show() | ||
sys.stdout = out | ||
|
||
return (login_result.find('Wrong username or password') == -1) | ||
def login_success(username, password): | ||
for university in _UNIVERSITY_LOGINS: | ||
payload = university['payload'] | ||
payload["usrname"] = username | ||
payload["pass"] = password | ||
response = requests.post(university['url'], data=payload) | ||
|
||
if response.content.find('Wrong username or password') == -1 and response.content.find('Access denied') == -1: | ||
return True | ||
|
||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
Django==1.6.1 | ||
PIL==1.1.7 | ||
Pillow==2.3.0 | ||
South==0.8.4 | ||
argparse==1.2.1 | ||
boto==2.23.0 | ||
certifi==14.05.14 | ||
dj-database-url==0.2.2 | ||
dj-static==0.0.5 | ||
django-storages==1.1.8 | ||
django-toolbelt==0.0.1 | ||
gunicorn==18.0 | ||
psycopg2==2.5.2 | ||
pystache==0.5.3 | ||
requests==2.4.0 | ||
static==1.0.2 | ||
twill==0.9 | ||
wsgiref==0.1.2 |