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

Enable basic auth for ical export

parent eefab03a
......@@ -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)
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
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