starting to move authentication to cco.member package; allow special characters in logout's nextUrl

This commit is contained in:
Helmut Merz 2015-11-12 15:45:29 +01:00
parent 9ec755ecd3
commit babb222868
3 changed files with 10 additions and 4 deletions

View file

@ -539,13 +539,13 @@
<!-- query views -->
<zope:adapter
<!--<zope:adapter
name="login.html"
for="loops.interfaces.IConcept
zope.publisher.interfaces.browser.IBrowserRequest"
provides="zope.interface.Interface"
factory="loops.browser.auth.LoginConcept"
permission="zope.View" />
permission="zope.View" />-->
<zope:adapter
name="list_children.html"

View file

@ -20,6 +20,7 @@
View class for Node objects.
"""
import urllib
from urlparse import urlparse, urlunparse
from zope import component, interface, schema
from zope.cachedescriptors.property import Lazy
@ -418,6 +419,12 @@ class NodeView(BaseView):
def active(self, item):
return item.context == self.context or item.context in self.parents
@Lazy
def logoutUrl(self):
nextUrl = urllib.urlencode(dict(nextUrl=self.menu.url))
return 'logout.html?' + nextUrl
# virtual target support
@Lazy

View file

@ -327,8 +327,7 @@
<metal:actions define-macro="personal">
<div><a href="logout.html?nextURL=login.html"
tal:attributes="href string:logout.html?nextURL=${view/menu/url}"
<div><a tal:attributes="href view/logoutUrl"
i18n:translate="">Log out</a></div>
<tal:actions repeat="action python:view.getAllowedActions('personal')">
<metal:action use-macro="action/macro" />