diff --git a/db_schema.sql b/db_schema.sql index 65b7cf8c2c5199133c70371f2dac65d56ea66c6f..7a5313930e63b90ed78681624908dc86ecc04032 100644 --- a/db_schema.sql +++ b/db_schema.sql @@ -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, diff --git a/server.py b/server.py index 39af4c4f33a0c1086bc3368b73f8272536df3699..7e4da7cab7f779d6e27ef81324b3ffc64e39ce6b 100644 --- a/server.py +++ b/server.py @@ -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