login improvements
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1321 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
f0110c70dc
commit
03daa6c8e2
4 changed files with 11 additions and 9 deletions
|
@ -22,7 +22,6 @@
|
||||||
name="ajax.inner.html"
|
name="ajax.inner.html"
|
||||||
template="../innerHtml.pt"
|
template="../innerHtml.pt"
|
||||||
permission="zope.ManageContent"
|
permission="zope.ManageContent"
|
||||||
menu="zmi_views" title="Contents"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</configure>
|
</configure>
|
||||||
|
|
|
@ -43,6 +43,8 @@ class LoopsSessionCredentialsPlugin(SessionCredentialsPlugin):
|
||||||
site = hooks.getSite()
|
site = hooks.getSite()
|
||||||
#camefrom = request.getURL() # wrong when object is not viewable
|
#camefrom = request.getURL() # wrong when object is not viewable
|
||||||
camefrom = request.getApplicationURL() + request['PATH_INFO']
|
camefrom = request.getApplicationURL() + request['PATH_INFO']
|
||||||
|
if 'login' in camefrom:
|
||||||
|
camefrom = '/'.join(camefrom.split('/')[:-1])
|
||||||
url = '%s/@@%s?%s' % (zapi.absoluteURL(site, request),
|
url = '%s/@@%s?%s' % (zapi.absoluteURL(site, request),
|
||||||
self.loginpagename,
|
self.loginpagename,
|
||||||
urllib.urlencode({'camefrom': camefrom}))
|
urllib.urlencode({'camefrom': camefrom}))
|
||||||
|
|
|
@ -23,11 +23,12 @@
|
||||||
<p i18n:translate="" tal:condition="python: principal != 'zope.anybody'">
|
<p i18n:translate="" tal:condition="python: principal != 'zope.anybody'">
|
||||||
You are not authorized to perform this action. However, you may login as a
|
You are not authorized to perform this action. However, you may login as a
|
||||||
different user who is authorized.</p>
|
different user who is authorized.</p>
|
||||||
<form action="" method="post">
|
<form action="." method="post"
|
||||||
|
tal:attributes="action request/URL">
|
||||||
<div tal:omit-tag=""
|
<div tal:omit-tag=""
|
||||||
tal:condition="python:principal != 'zope.anybody' and 'SUBMIT' in request">
|
tal:condition="python:principal != 'zope.anybody' and 'SUBMIT' in request">
|
||||||
<span tal:define="dummy python:
|
<span tal:define="dummy python:
|
||||||
request.response.redirect(request.get('camefrom', ''))" />
|
request.response.redirect(request.get('camefrom', request.URL[-1]))" />
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="label" i18n:translate="">User Name</div>
|
<div class="label" i18n:translate="">User Name</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue