work in progress: make cybertools package work with BlueBream 1.0

This commit is contained in:
Helmut Merz 2011-09-29 18:40:47 +02:00
parent f0e789d844
commit b327062492
4 changed files with 6 additions and 6 deletions

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2006 Helmut Merz helmutm@cy55.de # Copyright (c) 2011 Helmut Merz helmutm@cy55.de
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -23,7 +23,6 @@ $Id$
""" """
import urllib import urllib
from zope.app import zapi
from zope.app.authentication.session import SessionCredentialsPlugin from zope.app.authentication.session import SessionCredentialsPlugin
from zope.app.component import hooks from zope.app.component import hooks
from zope.app.i18n import ZopeMessageFactory as _ from zope.app.i18n import ZopeMessageFactory as _
@ -33,6 +32,7 @@ from zope.app.security.interfaces import ILogoutSupported
from zope.cachedescriptors.property import Lazy from zope.cachedescriptors.property import Lazy
from zope.i18n import translate from zope.i18n import translate
from zope.publisher.interfaces.http import IHTTPRequest from zope.publisher.interfaces.http import IHTTPRequest
from zope.traversing.browser import absoluteURL
class LoopsSessionCredentialsPlugin(SessionCredentialsPlugin): class LoopsSessionCredentialsPlugin(SessionCredentialsPlugin):
@ -49,7 +49,7 @@ class LoopsSessionCredentialsPlugin(SessionCredentialsPlugin):
camefrom = request.getApplicationURL() + path camefrom = request.getApplicationURL() + path
if 'login' in camefrom: if 'login' in camefrom:
camefrom = '/'.join(camefrom.split('/')[:-1]) camefrom = '/'.join(camefrom.split('/')[:-1])
url = '%s/@@%s?%s' % (zapi.absoluteURL(site, request), url = '%s/@@%s?%s' % (absoluteURL(site, request),
self.loginpagename, self.loginpagename,
urllib.urlencode({'camefrom': camefrom})) urllib.urlencode({'camefrom': camefrom}))
request.response.redirect(url) request.response.redirect(url)

View file

@ -61,13 +61,13 @@
factory=".auth.LoopsSessionCredentialsPlugin" factory=".auth.LoopsSessionCredentialsPlugin"
/> />
<zope:localUtility class=".auth.LoopsSessionCredentialsPlugin"> <zope:class class=".auth.LoopsSessionCredentialsPlugin">
<zope:require <zope:require
permission="zope.ManageServices" permission="zope.ManageServices"
interface="zope.app.authentication.session.IBrowserFormChallenger" interface="zope.app.authentication.session.IBrowserFormChallenger"
set_schema="zope.app.authentication.session.IBrowserFormChallenger" /> set_schema="zope.app.authentication.session.IBrowserFormChallenger" />
</zope:localUtility> </zope:class>
</configure> </configure>

View file

@ -29,7 +29,6 @@
template="../ajax/innerHtml.pt" template="../ajax/innerHtml.pt"
class="cybertools.container.base.ContainerView" class="cybertools.container.base.ContainerView"
permission="zope.ManageContent" permission="zope.ManageContent"
menu="zmi_views" title="Contents"
/> />
</configure> </configure>

View file

@ -23,6 +23,7 @@ setup(name='cybertools',
'PIL', 'PIL',
'zope.app.catalog', 'zope.app.catalog',
'zope.app.file', 'zope.app.file',
'zope.app.preview',
'zope.app.session', 'zope.app.session',
'zope.sendmail', 'zope.sendmail',
], ],