Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Laurent S
erp5
Commits
b86a7355
Commit
b86a7355
authored
Feb 18, 2014
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_xhtml_style: rewrite logged_in ZPT in Python script
parent
a69c49ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
39 deletions
+37
-39
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/logged_in.xml
...nTemplateItem/portal_skins/erp5_xhtml_style/logged_in.xml
+36
-38
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
+1
-1
No files found.
product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/logged_in.xml
View file @
b86a7355
...
...
@@ -2,10 +2,14 @@
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"
ZopePageTemplate"
module=
"Products.PageTemplates.ZopePageTemplate
"
/>
<global
name=
"
PythonScript"
module=
"Products.PythonScripts.PythonScript
"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
...
...
@@ -20,6 +24,18 @@
<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>
...
...
@@ -33,52 +49,34 @@
</value>
</item>
<item>
<key>
<string>
_
text
</string>
</key>
<value>
<
unicode
encoding=
"cdata"
>
<![CDATA[
<key>
<string>
_
body
</string>
</key>
<value>
<
string
encoding=
"cdata"
>
<![CDATA[
<tal:block xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal"\n
xmlns:i18n="http://xml.zope.org/namespaces/i18n">
\n
<tal:block
tal:condition=
"here/portal_skins/updateSkinCookie | nothing"
\n
tal:define=
"dummy here/setupCurrentSkin;"
/>
\n
<tal:block
tal:define=
"response request/RESPONSE;\n
mtool here/portal_membership;\n
isAnon mtool/isAnonymousUser|nothing;"
>
\n
<tal:block
tal:condition=
"isAnon"
>
\n
<tal:block
tal:define=
"dummy python: response.expireCookie(\'__ac\', path=\'/\');\n
url python: \'%s/login_form?portal_status_message=%s\' % (here.absolute_url(), here.Base_translateString(\'Login and/or password is incorrect.\'));\n
url python: request.get(\'came_from\') and \'%s&came_from=%s\' % (url, request[\'came_from\']) or url;\n
dummy python: 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>
portal = context.getPortalObject()\n
if portal.portal_skins.updateSkinCookie():\n
portal.setupCurrentSkin()\n
url = REQUEST.get("came_from")\n
if portal.portal_membership.isAnonymousUser():\n
RESPONSE.expireCookie("__ac", path="/")\n
url = "%s/login_form?portal_status_message=%s" % (\n
context.absolute_url(),\n
context.Base_translateString("Login and/or password is incorrect.")\n
+ ("&came_from=" + url if url else ""))\n
elif not url:\n
url = context.absolute_url()\n
return RESPONSE.redirect(url)\n
]]>
</unicode>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
]]>
</string>
</value>
</item>
<item>
<key>
<string>
expand
</string>
</key>
<value>
<
int>
0
</int
>
</value>
<key>
<string>
_params
</string>
</key>
<value>
<
string>
REQUEST, RESPONSE
</string
>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
logged_in
</string>
</value>
</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>
</pickle>
</record>
...
...
product/ERP5/bootstrap/erp5_xhtml_style/bt/revision
View file @
b86a7355
1112
\ No newline at end of file
1113
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment