diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccount.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccount.xml index 0aeb0d9d47012921c2b1c291960449aa205a08fa..e887eec32adec782a6d1e7797be86614db881597 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccount.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccount.xml @@ -90,7 +90,7 @@ except (FormValidationError, ValidationError,), validation_errors:\n return form()\n \n # extract only user details\n -kw = context.REQUEST.form\n +kw = context.REQUEST\n filtered_kw = {}\n prefix = \'field_your_\'\n for key in kw.keys():\n @@ -107,6 +107,8 @@ person_role = \'internal\'\n person_module = context.getPortalObject().person_module\n person = person_module.newContent(portal_type = \'Person\', \n **filtered_kw)\n +person.validate()\n +person.immediateReindexObject()\n \n # create default career\n career = person.newContent(portal_type = \'Career\', \n @@ -119,8 +121,7 @@ assignment = person.newContent(portal_type = \'Assignment\', \n group = person_group, \n function = person_function, \n site = person_site)\n -# submit it for review\n -person.submit()\n +assignment.open()\n \n translateString = context.Base_translateString\n msg = translateString("Your account was successfully created.")\n @@ -155,7 +156,9 @@ return website.Base_redirect(\'view\', \n <item> <key> <string>_proxy_roles</string> </key> <value> - <tuple/> + <tuple> + <string>Manager</string> + </tuple> </value> </item> <item> diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm.xml index f7cef93163420ee1ffc96fd8e3ac356c4d271c1b..763cbfb35f81cfba767f3a63ed2548133fc9f5ac 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm.xml @@ -105,7 +105,7 @@ <string>your_default_address_region</string> <string>your_reference</string> <string>your_password</string> - <string>password_confirm</string> + <string>your_password_confirm</string> <string>submit</string> </list> </value> diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm/your_password.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm/your_password.xml index d5e7a8f6ad4e4414f370781cea11c660f70b5e66..644d2671da35f55d99c41940896116890293d66b 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm/your_password.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm/your_password.xml @@ -279,7 +279,7 @@ <dictionary> <item> <key> <string>method_name</string> </key> - <value> <string>Person_validatePasswordsMatch</string> </value> + <value> <string>WebSite_validatePasswordsMatch</string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm/password_confirm.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm/your_password_confirm.xml similarity index 98% rename from bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm/password_confirm.xml rename to bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm/your_password_confirm.xml index bf632fd0f7133fb4aa964e6c6673f546b0f2fef0..75a727e010f85e17d41da5cc7e83d4ec75d19c04 100644 --- a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm/password_confirm.xml +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_createWebSiteAccountForm/your_password_confirm.xml @@ -14,7 +14,7 @@ <dictionary> <item> <key> <string>id</string> </key> - <value> <string>password_confirm</string> </value> + <value> <string>your_password_confirm</string> </value> </item> <item> <key> <string>message_values</string> </key> @@ -279,7 +279,7 @@ <dictionary> <item> <key> <string>method_name</string> </key> - <value> <string>Person_validatePasswordsMatch</string> </value> + <value> <string>WebSite_validatePasswordsMatch</string> </value> </item> </dictionary> </pickle> diff --git a/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_validatePasswordsMatch.xml b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_validatePasswordsMatch.xml new file mode 100644 index 0000000000000000000000000000000000000000..55faad127c15eb46e85919a87ecb94c5d44620dc --- /dev/null +++ b/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSite_validatePasswordsMatch.xml @@ -0,0 +1,158 @@ +<?xml version="1.0"?> +<ZopeData> + <record id="1" aka="AAAAAAAAAAE="> + <pickle> + <tuple> + <tuple> + <string>Products.PythonScripts.PythonScript</string> + <string>PythonScript</string> + </tuple> + <none/> + </tuple> + </pickle> + <pickle> + <dictionary> + <item> + <key> <string>Python_magic</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>Script_magic</string> </key> + <value> <int>3</int> </value> + </item> + <item> + <key> <string>__ac_local_roles__</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_bind_names</string> </key> + <value> + <object> + <klass> + <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>_asgns</string> </key> + <value> + <dictionary> + <item> + <key> <string>name_container</string> </key> + <value> <string>container</string> </value> + </item> + <item> + <key> <string>name_context</string> </key> + <value> <string>context</string> </value> + </item> + <item> + <key> <string>name_m_self</string> </key> + <value> <string>script</string> </value> + </item> + <item> + <key> <string>name_subpath</string> </key> + <value> <string>traverse_subpath</string> </value> + </item> + </dictionary> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>_body</string> </key> + <value> <string>"""\n + External Validator for WebSite_createWebSiteAccountForm/your_password\n + that checks that password and password confimation matches.\n +"""\n +password_confirm = request.get(\'field_your_password_confirm\', request.get(\'password_confirm\'))\n +if password_confirm == editor:\n + return 1\n +return 0\n +</string> </value> + </item> + <item> + <key> <string>_code</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_filepath</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_owner</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>_params</string> </key> + <value> <string>editor, request</string> </value> + </item> + <item> + <key> <string>errors</string> </key> + <value> + <tuple/> + </value> + </item> + <item> + <key> <string>func_code</string> </key> + <value> + <object> + <klass> + <global name="FuncCode" module="Shared.DC.Scripts.Signature"/> + </klass> + <tuple/> + <state> + <dictionary> + <item> + <key> <string>co_argcount</string> </key> + <value> <int>2</int> </value> + </item> + <item> + <key> <string>co_varnames</string> </key> + <value> + <tuple> + <string>editor</string> + <string>request</string> + <string>_getattr_</string> + <string>password_confirm</string> + </tuple> + </value> + </item> + </dictionary> + </state> + </object> + </value> + </item> + <item> + <key> <string>func_defaults</string> </key> + <value> + <none/> + </value> + </item> + <item> + <key> <string>id</string> </key> + <value> <string>WebSite_validatePasswordsMatch</string> </value> + </item> + <item> + <key> <string>warnings</string> </key> + <value> + <tuple/> + </value> + </item> + </dictionary> + </pickle> + </record> +</ZopeData> diff --git a/bt5/erp5_web/bt/revision b/bt5/erp5_web/bt/revision index 551f8ca3741888943950cd46ff62c222e4452aba..2bf5aee89b296f1ae29c84268398a1fe3539d3e3 100644 --- a/bt5/erp5_web/bt/revision +++ b/bt5/erp5_web/bt/revision @@ -1 +1 @@ -562 \ No newline at end of file +567 \ No newline at end of file