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