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

Enable basic auth for ical export

parent eefab03a
Branches
No related tags found
No related merge requests found
......@@ -35,11 +35,14 @@ def calperm(func):
for net in config['FSMPI_IP_RANGES']:
if ip in ip_network(net):
permission = True
if request.authorization:
userinfo, groups = ldapauth(request.authorization.username, request.authorization.password)
if check_mod(userinfo.get('uid'), groups):
permission = True
if permission:
return func(*args, **kwargs)
else:
flash('Diese Funktion ist nur aus dem FSMPI-Netz(für SOGO-Import) oder eingeloggt verfügbar!')
return redirect(url_for('index'))
return Response("Login required", 401, {'WWW-Authenticate': 'Basic realm="FS-Login required"'})
return decorator
@app.route('/internal/ical/all')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment