Commit b86a7355 authored by Julien Muchembled's avatar Julien Muchembled

erp5_xhtml_style: rewrite logged_in ZPT in Python script

parent a69c49ec
...@@ -2,10 +2,14 @@ ...@@ -2,10 +2,14 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>_bind_names</string> </key>
<value> <value>
...@@ -20,6 +24,18 @@ ...@@ -20,6 +24,18 @@
<key> <string>_asgns</string> </key> <key> <string>_asgns</string> </key>
<value> <value>
<dictionary> <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> <item>
<key> <string>name_subpath</string> </key> <key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value> <value> <string>traverse_subpath</string> </value>
...@@ -33,52 +49,34 @@ ...@@ -33,52 +49,34 @@
</value> </value>
</item> </item>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_body</string> </key>
<value> <unicode encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"\n portal = context.getPortalObject()\n
xmlns:metal="http://xml.zope.org/namespaces/metal"\n if portal.portal_skins.updateSkinCookie():\n
xmlns:i18n="http://xml.zope.org/namespaces/i18n">\n portal.setupCurrentSkin()\n
<tal:block tal:condition="here/portal_skins/updateSkinCookie | nothing"\n url = REQUEST.get("came_from")\n
tal:define="dummy here/setupCurrentSkin;" />\n if portal.portal_membership.isAnonymousUser():\n
<tal:block tal:define="response request/RESPONSE;\n RESPONSE.expireCookie("__ac", path="/")\n
mtool here/portal_membership;\n url = "%s/login_form?portal_status_message=%s" % (\n
isAnon mtool/isAnonymousUser|nothing;">\n context.absolute_url(),\n
<tal:block tal:condition="isAnon">\n context.Base_translateString("Login and/or password is incorrect.")\n
<tal:block tal:define="dummy python: response.expireCookie(\'__ac\', path=\'/\');\n + ("&amp;came_from=" + url if url else ""))\n
url python: \'%s/login_form?portal_status_message=%s\' % (here.absolute_url(), here.Base_translateString(\'Login and/or password is incorrect.\'));\n elif not url:\n
url python: request.get(\'came_from\') and \'%s&amp;came_from=%s\' % (url, request[\'came_from\']) or url;\n url = context.absolute_url()\n
dummy python: response.redirect(url);" />\n return RESPONSE.redirect(url)\n
</tal:block>\n
<tal:block tal:condition="not: isAnon">\n
<tal:block tal:define="came_from python: request.get(\'came_from\') or here.absolute_url();\n
dummy python: response.redirect(came_from);" />\n
</tal:block>\n
</tal:block>\n
</tal:block>
]]></unicode> </value>
</item> ]]></string> </value>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_params</string> </key>
<value> <int>0</int> </value> <value> <string>REQUEST, RESPONSE</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>logged_in</string> </value> <value> <string>logged_in</string> </value>
</item> </item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
......
1112 1113
\ No newline at end of file \ 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