Module: check_mk
Branch: master
Commit: 3dde4354abe29e6a9eb406e1fdded799c871e23a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3dde4354abe29e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 13 10:54:28 2012 +0100
userdb: Preventing user profile password changes when the password is locked
---
web/htdocs/wato.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index f3f308e..6aa950b 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -11143,14 +11143,20 @@ def page_user_profile():
html.footer()
return
+ # Returns true if an attribute is locked and should be read only. Is only
+ # checked when modifying an existing user
+ locked_attributes = userdb.locked_attributes(user.get('connector'))
+ def is_locked(attr):
+ return attr in locked_attributes
+
html.begin_form("profile", method="POST")
html.write('<div class=wato>')
-
+
forms.header(_("Personal Settings"))
forms.section(_("Name"), simple=True)
html.write(user["alias"])
- if config.may('general.change_password'):
+ if config.may('general.change_password') and not
is_locked('password'):
forms.section(_("Password"))
html.password_input('password')