summaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-rw-r--r--app.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/app.py b/app.py
index e07c853..bb54487 100644
--- a/app.py
+++ b/app.py
@@ -16,10 +16,12 @@ app.config.from_object('default_settings')
if 'SPLINE_ACCOUNT_WEB_SETTINGS' in os.environ:
app.config.from_envvar('SPLINE_ACCOUNT_WEB_SETTINGS')
+app.all_services = account.SERVICES #TODO: take that from our json file or so
+
@app.before_request
def ldap_connect():
g.ldap = account.AccountService(account.LDAP_HOST, account.LDAP_BASE_DN,
- account.LDAP_ADMIN_USER, account.LDAP_ADMIN_PASS, account.SERVICES)
+ account.LDAP_ADMIN_USER, account.LDAP_ADMIN_PASS, app.all_services)
g.user = None
@@ -135,7 +137,14 @@ def settings():
else:
flash(u'Nichts geƤndert')
- return {'form': form}
+
+ # (name, changed)
+ services = [(name, name in g.user.services) for name in app.all_services]
+
+ return {
+ 'form': form,
+ 'services': services,
+ }
@login_required
@app.route('/settings/change_mail/<token>')