Commit 6b1da00e authored by Mayoro Diagne's avatar Mayoro Diagne

2010-06-22 mayoro

* Allow anonymous procedure to login
* after captcha test use the desired portal_type to create new procedure (previous one was hardcoded)
* remove form_action in WebSite_viewCaptchaRenderer it's no longer used

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36526 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5446fd18
......@@ -59,7 +59,7 @@ request=context.REQUEST\n
\n
if context.portal_membership.isAnonymousUser() and not captcha_ok:\n
absolute_url = context.absolute_url()\n
new_url = \'captcha/CheckCaptcha/view\'\n
new_url = \'captcha/CheckCaptcha/view?portal_type=%s\' % new_application_procedure\n
redirect_url = "%s/%s" % (absolute_url, new_url)\n
else:\n
portal_type = new_application_procedure\n
......
......@@ -57,19 +57,27 @@
request=context.REQUEST\n
\n
\n
# check captcha\n
if not context.isCaptchaTextCorrect(captcha_text):\n
message = "text entered at the right of the picture is wrong"\n
translated_message = context.Base_translateString(message)\n
return request[\'RESPONSE\'].redirect(\n
"%s?portal_status_message=%s" %\n
"%s/view?portal_status_message=%s" %\n
(context.absolute_url(), translated_message))\n
\n
# create a new subscription form\n
module = context.getDefaultModule(portal_type=\'Subscription Form\')\n
form = module.newContent(portal_type=\'Subscription Form\')\n
\n
web_site_url = context.getWebSiteValue().absolute_url()\n
\n
portal_type = request.get(\'portal_type\',\'\')\n
\n
if portal_type == \'\': \n
return request[\'RESPONSE\'].redirect(web_site_url) \n
\n
\n
# create a new anonymous procedure\n
module = context.getDefaultModule(portal_type=portal_type)\n
form = module.newContent(portal_type=portal_type)\n
\n
module_id = module.getId()\n
new_object_id = form.getId()\n
\n
......@@ -146,9 +154,10 @@ return result\n
<string>message</string>
<string>translated_message</string>
<string>_getitem_</string>
<string>web_site_url</string>
<string>portal_type</string>
<string>module</string>
<string>form</string>
<string>web_site_url</string>
<string>module_id</string>
<string>new_object_id</string>
<string>redirect_url</string>
......
......@@ -63,16 +63,19 @@ Description:\n
to generate a new image.\n
</tal:block>\n
</div>\n
\n
\n
<div class="next_step_action" tal:define="object_uid here/getUid | nothing;\n
object_path here/getPath | nothing;\n
form nocall: form | nothing;\n
form_id form/id | template/title_or_id | nothing;\n
portal here/getPortalObject;\n
form_action python: form and form.action not in (\'\', None) and portal.portal_membership.checkPermission(\'Modify portal content\', here) and form.action or nothing;\n
local_parameter_list local_parameter_list | python: {};\n
">\n
<input type="hidden" name="form_action" value=""\n
tal:attributes="value request/form_action" />\n
\n
<input type="hidden" name="portal_type" value=""\n
tal:attributes="value python: request.get(\'portal_type\', \'\')" />\n
\n
<input type="hidden" name="edit_document_url" value=""\n
tal:attributes="value python:\'%s/%s\' % (here.absolute_url(), form_id)" />\n
<input type="hidden" name="view_document_url" value=""\n
......@@ -86,7 +89,7 @@ Description:\n
<img src="Captcha_getCaptchaFile?display=thumbnail&amp;format=&amp;resolution=75" alt="captcha"/>\n
<input class="captcha_text" type="text" size="6" name="captcha_text"/>\n
</div>\n
<a class="onright" href="" OnClick="javascript:window.history.go(0)">\n
<a class="onright" href="" tal:attributes="href python:\'%s/%s?portal_type=%s\' % (here.absolute_url(), \'view\', request.get(\'portal_type\',\'\'))" OnClick="javascript:window.history.go()">\n
<img src="img/reload.png" alt="Refresh"/>\n
</a>\n
<div class="clear">\n
......
......@@ -206,6 +206,11 @@ module_object.setIdGenerator(\'_generatePerDayId\') \n
## initialize security on the module\n
\n
module_object.EGov_setPermissionsOnEGovModule(procedure_request)\n
\n
# Allow anonymous procedure to login\n
\n
if not procedure.getStepAuthentication():\n
procedure_request.EGov_enableProcedureLogin(portal_type_name)\n
</string> </value>
</item>
<item>
......@@ -274,6 +279,7 @@ module_object.EGov_setPermissionsOnEGovModule(procedure_request)\n
<string>module_object</string>
<string>portal_type_module_object</string>
<string>allowed_content_type_list</string>
<string>procedure</string>
</tuple>
</value>
</item>
......
2010-06-22 mayoro
* Allow anonymous procedure to login
* after captcha test use the desired portal_type to create new procedure (previous one was hardcoded)
* remove form_action in WebSite_viewCaptchaRenderer it's no longer used
2010-06-22 mayoro
* add view as default view of web page captcha
......
584
\ No newline at end of file
589
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment