web/views/basecontrollers.py
changeset 8311 76a44a0d7f4b
parent 8267 486386d9f836
child 8444 7a861620f64f
--- a/web/views/basecontrollers.py	Thu Mar 01 12:08:35 2012 +0100
+++ b/web/views/basecontrollers.py	Thu Mar 15 17:42:31 2012 +0100
@@ -84,6 +84,17 @@
             # Cookie authentication
             return self.appli.need_login_content(self._cw)
 
+class LoginControllerForAuthed(Controller):
+    __regid__ = 'login'
+    __select__ = ~anonymous_user()
+
+    def publish(self, rset=None):
+        """log in the instance"""
+        path = self._cw.form.get('postlogin_path')
+        if not path:
+            path = '/'
+        raise Redirect(path)
+
 
 class LogoutController(Controller):
     __regid__ = 'logout'