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"
|
||||
template="../innerHtml.pt"
|
||||
permission="zope.ManageContent"
|
||||
menu="zmi_views" title="Contents"
|
||||
/>
|
||||
|
||||
</configure>
|
||||
|
|
|
@ -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}))
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<skin name="Loops"
|
||||
layers="loops rotterdam default" />
|
||||
|
||||
|
||||
<resource name="zope3_tablelayout.css" file="loops_layout.css" layer="loops" />
|
||||
<resource name="site_management_tablelayout.css"
|
||||
file="loops_management_layout.css" layer="loops" />
|
||||
|
@ -26,7 +26,7 @@
|
|||
layer="loops"
|
||||
allowed_interface="zope.app.publisher.interfaces.browser.IMenuAccessView"
|
||||
/>
|
||||
|
||||
|
||||
<!-- login/logout stuff -->
|
||||
|
||||
<zope:adapter factory="zope.app.security.LogoutSupported" />
|
||||
|
@ -50,7 +50,7 @@
|
|||
provides="zope.app.authentication.interfaces.ICredentialsPlugin"
|
||||
factory=".auth.LoopsSessionCredentialsPlugin"
|
||||
/>
|
||||
|
||||
|
||||
<zope:localUtility class=".auth.LoopsSessionCredentialsPlugin">
|
||||
|
||||
<zope:require
|
||||
|
@ -59,5 +59,5 @@
|
|||
set_schema="zope.app.authentication.session.IBrowserFormChallenger" />
|
||||
|
||||
</zope:localUtility>
|
||||
|
||||
|
||||
</configure>
|
||||
|
|
|
@ -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>
|
||||
|
@ -42,9 +43,9 @@
|
|||
<input type="password" name="password"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<input class="form-element" type="submit"
|
||||
<input class="form-element" type="submit"
|
||||
name="SUBMIT" value="Log in" i18n:attributes="value login-button" />
|
||||
</div>
|
||||
<input type="hidden" name="camefrom"
|
||||
|
|
Loading…
Add table
Reference in a new issue