[Mpuls-commits] r4595 - base/trunk/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 9 10:11:19 CET 2011


Author: torsten
Date: 2011-02-09 10:11:17 +0100 (Wed, 09 Feb 2011)
New Revision: 4595

Modified:
   base/trunk/mpulsweb/controllers/usersettings.py
Log:
* mpulsweb/controllers/usersettings.py
	(UsersettingsController.changePasswordAction): Issue1319: "Disable"
	controller function to set user password to prevent users to be able
	to set their userpasswords.


Modified: base/trunk/mpulsweb/controllers/usersettings.py
===================================================================
--- base/trunk/mpulsweb/controllers/usersettings.py	2011-02-08 14:31:05 UTC (rev 4594)
+++ base/trunk/mpulsweb/controllers/usersettings.py	2011-02-09 09:11:17 UTC (rev 4595)
@@ -34,7 +34,7 @@
 
 from mpulsweb.lib.translation import _
 
-from mpulsweb.lib.base import BaseController, c, h, render, request, session, _
+from mpulsweb.lib.base import BaseController, c, h, g, render, request, session, _
 
 from mpulsweb.lib.validators import BaseFormValidator, NewPasswordForm
 from mpulsweb.lib.security import checkRole
@@ -76,6 +76,11 @@
 
     @checkRole(('admin_ka', 'cm_ka', 'pt_dlr', 'pb_ka'))
     def changePasswordAction(self):
+
+        # Disable changing passwords if administration module is disabled
+        if not g.mpuls_config.is_enabled('module', 'administration'):
+            return self.changePassword()
+
         validator = NewPasswordForm()
         try:
             uid = request.params['uid']



More information about the Mpuls-commits mailing list