[Erp5-report] r39129 fx.algrain - in /experimental/bt5/erp5_credential: SkinTemplateItem/po...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Oct 14 13:23:46 CEST 2010


Author: fx.algrain
Date: Thu Oct 14 13:23:43 2010
New Revision: 39129

URL: http://svn.erp5.org?rev=39129&view=rev
Log:
Use good variable : run Person_* on person not on context.
After create global account we should valid it

Add proxy Manager : needed to set password and set reference. Event if we define roles for staff, we define never Manager role by role definition on portal type

Prevent call by url because we have Manager proxy

Modified:
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createUser.xml
    experimental/bt5/erp5_credential/bt/revision

Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createUser.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createUser.xml?rev=39129&r1=39128&r2=39129&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createUser.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialRequest_createUser.xml [utf8] Thu Oct 14 13:23:43 2010
@@ -53,6 +53,10 @@
             <value> <string>"""Set reference and password to create a user. Create a global user if SSO enable.\n
 Proxy:\n
 Manager -- allow to set password on all account"""\n
+#Don\'t allow to call from url\n
+if REQUEST:\n
+  raise ValueError, "You can not call this script from the url"\n
+\n
 person = context.getDestinationDecisionValue(portal_type="Person")\n
 \n
 #Create user of the person only if not exist\n
@@ -85,12 +89,13 @@ if not person.getPassword() :\n
   # create a global account\n
   if context.ERP5Site_isSingleSignOnEnable():\n
     #The master manage encoded password and clear password\n
-    context.Person_createNewGlobalUserAccount(password=password)\n
+    person.Person_createNewGlobalUserAccount(password=password)\n
+    person.Person_validateGlobalUserAccount()\n
 else:\n
   #Person has an already an account\n
   if context.ERP5Site_isSingleSignOnEnable():\n
     #Check assignment for the current instance\n
-    context.Person_validateGlobalUserAccount()\n
+    person.Person_validateGlobalUserAccount()\n
 \n
 if password.startswith(\'{SSHA}\'):\n
   #password is encoded, set it to None to script witch send the password to user\n
@@ -107,12 +112,14 @@ return login, password\n
         </item>
         <item>
             <key> <string>_params</string> </key>
-            <value> <string></string> </value>
+            <value> <string>REQUEST=None</string> </value>
         </item>
         <item>
             <key> <string>_proxy_roles</string> </key>
             <value>
-              <tuple/>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
             </value>
         </item>
         <item>
@@ -133,18 +140,19 @@ return login, password\n
                   <dictionary>
                     <item>
                         <key> <string>co_argcount</string> </key>
-                        <value> <int>0</int> </value>
+                        <value> <int>1</int> </value>
                     </item>
                     <item>
                         <key> <string>co_varnames</string> </key>
                         <value>
                           <tuple>
+                            <string>REQUEST</string>
+                            <string>ValueError</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>person</string>
                             <string>None</string>
                             <string>login</string>
-                            <string>ValueError</string>
                             <string>password</string>
                           </tuple>
                         </value>
@@ -157,7 +165,9 @@ return login, password\n
         <item>
             <key> <string>func_defaults</string> </key>
             <value>
-              <none/>
+              <tuple>
+                <none/>
+              </tuple>
             </value>
         </item>
         <item>

Modified: experimental/bt5/erp5_credential/bt/revision
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/bt/revision?rev=39129&r1=39128&r2=39129&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/bt/revision [utf8] (original)
+++ experimental/bt5/erp5_credential/bt/revision [utf8] Thu Oct 14 13:23:43 2010
@@ -1 +1 @@
-304
\ No newline at end of file
+305
\ No newline at end of file




More information about the Erp5-report mailing list