login improvements

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1321 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2006-08-23 11:04:49 +00:00
parent f0110c70dc
commit 03daa6c8e2
4 changed files with 11 additions and 9 deletions

View file

@ -22,7 +22,6 @@
name="ajax.inner.html"
template="../innerHtml.pt"
permission="zope.ManageContent"
menu="zmi_views" title="Contents"
/>
</configure>

View file

@ -43,6 +43,8 @@ class LoopsSessionCredentialsPlugin(SessionCredentialsPlugin):
site = hooks.getSite()
#camefrom = request.getURL() # wrong when object is not viewable
camefrom = request.getApplicationURL() + request['PATH_INFO']
if 'login' in camefrom:
camefrom = '/'.join(camefrom.split('/')[:-1])
url = '%s/@@%s?%s' % (zapi.absoluteURL(site, request),
self.loginpagename,
urllib.urlencode({'camefrom': camefrom}))

View file

@ -23,11 +23,12 @@
<p i18n:translate="" tal:condition="python: principal != 'zope.anybody'">
You are not authorized to perform this action. However, you may login as a
different user who is authorized.</p>
<form action="" method="post">
<form action="." method="post"
tal:attributes="action request/URL">
<div tal:omit-tag=""
tal:condition="python:principal != 'zope.anybody' and 'SUBMIT' in request">
<span tal:define="dummy python:
request.response.redirect(request.get('camefrom', ''))" />
request.response.redirect(request.get('camefrom', request.URL[-1]))" />
</div>
<div class="row">
<div class="label" i18n:translate="">User Name</div>