[Mpuls-commits] r1257 - wasko/branches/2.0/waskaweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 4 18:13:38 CET 2010


Author: torsten
Date: 2010-02-04 18:13:38 +0100 (Thu, 04 Feb 2010)
New Revision: 1257

Modified:
   wasko/branches/2.0/waskaweb/controllers/waska.py
Log:
* waskaweb/controllers/waska.py: Is now inherited from MpulsController


Modified: wasko/branches/2.0/waskaweb/controllers/waska.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/waska.py	2010-02-04 17:13:17 UTC (rev 1256)
+++ wasko/branches/2.0/waskaweb/controllers/waska.py	2010-02-04 17:13:38 UTC (rev 1257)
@@ -32,10 +32,12 @@
 import logging
 import md5
 
+from mpulsweb.controllers.mpuls import MpulsController
+from mpulsweb.controllers.auth  import AuthController
+
 from waskaweb.lib.base import BaseController, c, g, h, redirect_to, render, \
      request, response, session
-from mpulsweb.lib.security import checkLogin, userIdentity, generateID, \
-     checkRole
+from mpulsweb.lib.security import checkRole
 from waskaweb.model.user import UserObject
 from waskaweb.model.news import NewsList
 from waskaweb.model.appointment import MaxSaveTimeReminderOverview, \
@@ -72,7 +74,7 @@
 Sie wird dadurch dauerhaft aus der Übersicht entfernt."""
 
 
-class WaskaController(BaseController):
+class WaskaController(MpulsController):
 
     def index(self):
         redirect_to(action='start')
@@ -130,36 +132,4 @@
     def info(self):
         return render('/start/responsible.mako')
 
-    def logout(self):
-        # XXX: invalidate() does not delete backend data :-/
-        session.delete()
-        session.save()
-        session.invalidate()
-        response.delete_cookie('waska_auth')
-        return render('/logout.mako')
-
-    def login(self):
-        return render('/login.mako')
-
-    def loginAction(self):
-        try:
-            login = request.params.getone('username')
-            passwd = request.params.getone('password')
-            user = checkLogin(login, passwd)
-            if user:
-                c.login_failed = False
-                shared = generateID()
-                session['USER_AUTHORIZED'] = user
-                session['AUTH'] = md5.new(shared + userIdentity()).digest()
-                session.save()
-                #response.set_cookie('waska_auth', shared, secure=True)
-                response.set_cookie('waska_auth', shared)
-                redirect_to(action="start")
-            else:
-                c.login_failed = True
-                return self.login()
-        except KeyError:
-            log.error('Error while fetching username and password')
-        return self.login()
-
 # vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:



More information about the Mpuls-commits mailing list