El domingo, 16 de septiembre de 2012 11:30:32 UTC-3, Massimo Di Pierro 
escribió:
>
> I agree. Can you send me a patch?
>
>
A patch for the two issues mentioned. Now impersonate looks for args before 
returning a form.
On impersonation, it returns a readonly form with the user data

The book should read "... request.args[1] is the id..."

-- 



diff -r c02922c38910 gluon/tools.py
--- a/gluon/tools.py	Sat Sep 15 15:42:44 2012 -0500
+++ b/gluon/tools.py	Sun Sep 16 12:30:36 2012 -0300
@@ -1191,7 +1191,10 @@
                        'reset_password','request_reset_password',
                        'change_password','profile','groups',
                        'impersonate','not_authorized'):
-            return getattr(self,args[0])()
+            if len(request.args) >= 2:
+                return getattr(self,args[0])(request.args[1])
+            else:
+                return getattr(self,args[0])()
         elif args[0]=='cas' and not self.settings.cas_provider:
             if args(1) == self.settings.cas_actions['login']:
                 return self.cas_login(version=2)
@@ -2723,7 +2726,7 @@
             self.user = session.auth.user
         if requested_id is DEFAULT and not request.post_vars:
             return SQLFORM.factory(Field('user_id', 'integer'))
-        return self.user
+        return SQLFORM(table_user, user.id, readonly=True)
 
     def update_groups(self):
         if not self.user:

Reply via email to