[Mpuls-commits] r1450 - wasko/branches/2.0/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 10 12:22:26 CET 2010


Author: torsten
Date: 2010-02-10 12:22:24 +0100 (Wed, 10 Feb 2010)
New Revision: 1450

Modified:
   wasko/branches/2.0/mpulsweb/lib/base.py
Log:
* mpulsweb/lib/base.py (BaseController.__before__): Fixed Issue935 (wasko).
  Redirecting the user to an infopage if the account is deactivated.


Modified: wasko/branches/2.0/mpulsweb/lib/base.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/base.py	2010-02-10 10:37:37 UTC (rev 1449)
+++ wasko/branches/2.0/mpulsweb/lib/base.py	2010-02-10 11:22:24 UTC (rev 1450)
@@ -47,6 +47,7 @@
 from mpulsweb.lib.security import getDbName, userIdentity
 
 
+
 # These names are exported from this module largely for historical
 # reasons.  Ideally the module should probably only export
 # BaseController and render which are customarily imported from this
@@ -99,21 +100,17 @@
             db.enter(self.db)
 
             # Is the user activated?
-            if (not user.isActivated()
-                and not request.path_info in
-                ('/auth/accountDeactivated', '/styles/web.css',
-                 '/styles/all.css')):
-                redirect_to(controller="/auth",
-                            action="accountDeactivated")
+            log.debug('User accound activated: %s' % user.isActivated())
+            log.debug('User needs new pass: %s' % user.needsNewPass())
+            if (not user.isActivated() and \
+                request.path not in ['/auth/accountDeactivated']):
+                redirect_to('/auth/accountDeactivated')
 
             # Do the user needs to change his passwort?
-            if (user.needsNewPass() \
-                and not request.path_info in
-                ('/usersettings/changePasswordOnLogin',
-                 '/usersettings/changePasswordOnLoginAction',
-                 '/styles/web.css', '/styles/all.css')):
-                redirect_to(controller="usersettings",
-                            action="changePasswordOnLogin")
+            elif (user.needsNewPass() and \
+                request.path not in ['/usersettings/changePasswordOnLogin', 
+                    '/usersettings/changePasswordOnLoginAction']):
+                redirect_to('/usersettings/changePasswordOnLogin')
 
         except KeyError:
             p = str(request.path_info)



More information about the Mpuls-commits mailing list