Commit 14f15be3 authored by Łukasz Nowak's avatar Łukasz Nowak

Implement came_from.

Reuse cookie on client side in order to avoid need to pass thru parameters to
authorisation servers.
parent 354de802
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<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>
<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>if not context.portal_membership.isAnonymousUser() and context.REQUEST.get(\'redirect_after_login\') is not None:\n
context.REQUEST.RESPONSE.expireCookie(\'redirect_after_login\', path=\'/\')\n
return context.REQUEST.RESPONSE.redirect( context.REQUEST.get(\'redirect_after_login\') ) \n
else:\n
return context.WebSection_viewVifibKVMOrder()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>WebSection_redirectAfterLogin</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -60,12 +60,15 @@ ...@@ -60,12 +60,15 @@
<tal:block tal:condition="python: request.get(\'form_id\', None) is not None">\n <tal:block tal:condition="python: request.get(\'form_id\', None) is not None">\n
<tal:block tal:define="came_from python: request.set(\'came_from\', \'/\'.join([here.getWebSiteValue().absolute_url(), request.get(\'form_id\', None)]))"></tal:block>\n <tal:block tal:define="came_from python: request.set(\'came_from\', \'/\'.join([here.getWebSiteValue().absolute_url(), request.get(\'form_id\', None)]))"></tal:block>\n
</tal:block>\n </tal:block>\n
<tal:block tal:condition="python: request.get(\'came_from\', None) is not None">\n
<tal:block tal:define="dummy python: request.RESPONSE.setCookie(\'redirect_after_login\', request.get(\'came_from\'), path=\'/\')"></tal:block>\n
</tal:block>\n
<input tal:condition="exists: request/came_from"\n <input tal:condition="exists: request/came_from"\n
type="hidden" name="came_from"\n type="hidden" name="came_from"\n
tal:attributes="value request/came_from" />\n tal:attributes="value request/came_from" />\n
<fieldset>\n <fieldset>\n
<script src="https://browserid.org/include.js" type="text/javascript"></script> \n <script src="https://browserid.org/include.js" type="text/javascript"></script> \n
<div class="field nolabel validate widthAuto forgotten_password">\n <div class="field nolabel validate widthAuto forgotten_password" tal:define="facebook_login python: \'./login_with_facebook?came_from=\' + request.get(\'came_from\', \'\'); google_login python: \'./login_with_google?came_from=\' + request.get(\'came_from\', \'\')">\n
You can login with with <a href="./login_with_facebook"><img width="25px" src="./vifib_image/facebook_logo.png" alt="Facebook" title="Facebook"></a>,\n You can login with with <a href="./login_with_facebook"><img width="25px" src="./vifib_image/facebook_logo.png" alt="Facebook" title="Facebook"></a>,\n
with <a href="./login_with_google"><img src="./vifib_image/google_logo.png" alt="Google" title="Google"></a>, BrowserID \n with <a href="./login_with_google"><img src="./vifib_image/google_logo.png" alt="Google" title="Google"></a>, BrowserID \n
<a href="#" id="browserid" title="Sign-in with BrowserID"> <img src="./vifib_image/browser_id_logo.png" alt="Sign-in with BrowserID" title="Sign-in with BrowserID"></a>\n <a href="#" id="browserid" title="Sign-in with BrowserID"> <img src="./vifib_image/browser_id_logo.png" alt="Sign-in with BrowserID" title="Sign-in with BrowserID"></a>\n
......
398 400
\ 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