changeset 2030:00f52826b5df

allow unattended login (for xmlrpc)
author Johannes Berg <johannes AT sipsolutions DOT net>
date Thu, 26 Apr 2007 13:08:29 +0200
parents 6f9e71e8bf26
children 56d8a8a14114
files MoinMoin/auth/__init__.py MoinMoin/request/__init__.py
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/auth/__init__.py	Thu Apr 26 13:08:02 2007 +0200
+++ b/MoinMoin/auth/__init__.py	Thu Apr 26 13:08:29 2007 +0200
@@ -9,6 +9,9 @@
       * request(request, user_obj, **kw)
     
     The kw arguments that are passed in are currently:
+       attended: boolean indicating whether a user (attended=True) or
+                 a machine is requesting login, multistage auth is not
+                 currently possible for machine logins [login only]
        username: the value of the 'username' form field (or None)
                  [login only]
        password: the value of the 'password' form field (or None)
--- a/MoinMoin/request/__init__.py	Thu Apr 26 13:08:02 2007 +0200
+++ b/MoinMoin/request/__init__.py	Thu Apr 26 13:08:29 2007 +0200
@@ -601,10 +601,11 @@
         login = 'login' in self.form
         logout = 'logout' in self.form
         stage = self.form.get('stage', [None])[0]
-        return self.handle_auth(user_obj, username=username, password=password,
-                                login=login, logout=logout, stage=stage)
+        return self.handle_auth(user_obj, attended=True, username=username,
+                                password=password, login=login, logout=logout,
+                                stage=stage)
 
-    def handle_auth(self, user_obj, **kw):
+    def handle_auth(self, user_obj, attended=False, **kw):
         username = kw.get('username')
         password = kw.get('password')
         login = kw.get('login')
@@ -612,6 +613,7 @@
         stage = kw.get('stage')
         extra = {}
         if login:
+            extra['attended'] = attended
             extra['username'] = username
             extra['password'] = password
             if stage: