diff options
author | Marian Sigler <m@qjym.de> | 2012-09-21 20:15:17 +0200 |
---|---|---|
committer | Marian Sigler <m@qjym.de> | 2012-09-21 20:15:17 +0200 |
commit | eda695239430f65ee198b7185e99619a5a080a34 (patch) | |
tree | 7a0e78e71154055152aad16a95a90e0f728c6484 /app.py | |
parent | 2bdceb1209a081e9ccb80a35dd605c120aaf32e9 (diff) | |
download | web-eda695239430f65ee198b7185e99619a5a080a34.tar.gz web-eda695239430f65ee198b7185e99619a5a080a34.tar.bz2 web-eda695239430f65ee198b7185e99619a5a080a34.zip |
settings: start with service management
Diffstat (limited to 'app.py')
-rw-r--r-- | app.py | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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>') |