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

Added support for multiple LDAP groups

parent cb456c91
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@ SQLITE_INIT_DATA = True
#LDAP_HOST = 'rumo.fsmpi.rwth-aachen.de'
LDAP_PORT = 636
LDAP_GROUPS = ['users']
#ICAL_URL = 'https://user:password@mail.fsmpi.rwth-aachen.de/SOGo/....ics'
ERROR_PAGE = 'static/500.html'
RWTH_IP_RANGES = ['134.130.0.0/16', '137.226.0.0/16', '134.61.0.0/16', '192.35.229.0/24', '2a00:8a60::/32']
......@@ -502,7 +502,12 @@ def search():
return render_template('search.html', searchtext=request.args['q'], courses=courses, lectures=lectures)
def check_mod(user, groups):
return user and 'fachschaft' in groups
if not user:
return False
for group in config['LDAP_GROUPS']:
if group in groups:
return True
return False
@app.route('/internal/login', methods=['GET', 'POST'])
def login():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment