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:
parent
9ddadfa7a5
commit
a09dd3008b
1 changed files with 5 additions and 1 deletions
|
@ -41,8 +41,12 @@ class LoopsSessionCredentialsPlugin(SessionCredentialsPlugin):
|
||||||
if not IHTTPRequest.providedBy(request):
|
if not IHTTPRequest.providedBy(request):
|
||||||
return False
|
return False
|
||||||
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']
|
||||||
|
path = request['PATH_INFO'].split('/++/')[-1] # strip virtual host stuff
|
||||||
|
if not path.startswith('/'):
|
||||||
|
path = '/' + 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' % (zapi.absoluteURL(site, request),
|
||||||
|
|
Loading…
Add table
Reference in a new issue