Commit f45e693a authored by Julian Rother's avatar Julian Rother
Browse files

Added l2p and rwth-intern auth checks

parent 86d71023
......@@ -112,6 +112,7 @@ CREATE TABLE IF NOT EXISTS `auth_data` (
`lecture_id` INTEGER,
`video_id` INTEGER,
`auth_type` varchar(10),
`auth_param` varchar(127),
`auth_user` varchar(127),
`auth_passwd` varchar(127),
`time_created` datetime NOT NULL,
......@@ -388,6 +388,14 @@ def auth(): # For use with nginx auth_request
if auth and video['auth_user'] == auth.username and video['auth_passwd'] == auth.password:
allowed = True
elif video['auth_type'] == 'l2p':
if video['auth_param'] in session.get('l2p_courses', []):
allowed = True
elif video['auth_type'] == 'rwth':
if session.get('rwthintern', False):
allowed = True
if not types[0] or allowed or ismod() or \
(auth and check_mod(*ldapauth(auth.username, auth.password))):
return 'OK', 200
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment