login improvement: strip virtual host stuff

git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1665 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2007-03-25 17:10:08 +00:00
parent 9ddadfa7a5
commit a09dd3008b

View file

@ -41,8 +41,12 @@ class LoopsSessionCredentialsPlugin(SessionCredentialsPlugin):
if not IHTTPRequest.providedBy(request):
return False
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']
path = request['PATH_INFO'].split('/++/')[-1] # strip virtual host stuff
if not path.startswith('/'):
path = '/' + path
camefrom = request.getApplicationURL() + path
if 'login' in camefrom:
camefrom = '/'.join(camefrom.split('/')[:-1])
url = '%s/@@%s?%s' % (zapi.absoluteURL(site, request),