Skip to content
Snippets Groups Projects
Commit f45e693a authored by Julian Rother's avatar Julian Rother
Browse files

Added l2p and rwth-intern auth checks

parent 86d71023
No related branches found
No related tags found
No related merge requests found
......@@ -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
break
elif video['auth_type'] == 'l2p':
if video['auth_param'] in session.get('l2p_courses', []):
allowed = True
break
elif video['auth_type'] == 'rwth':
if session.get('rwthintern', False):
allowed = True
break
if not types[0] or allowed or ismod() or \
(auth and check_mod(*ldapauth(auth.username, auth.password))):
return 'OK', 200
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment