Mercurial > kallithea
comparison pylons_app/lib/auth.py @ 508:fdb78a140ae4
fixes #35 hg-app does not respect SCRIPT_NAME
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 28 Sep 2010 02:31:10 +0200 |
parents | a3d9d24acbec |
children |
comparison
equal
deleted
inserted
replaced
507:f420e86db893 | 508:fdb78a140ae4 |
---|---|
253 if user.is_authenticated: | 253 if user.is_authenticated: |
254 log.debug('user %s is authenticated', user.username) | 254 log.debug('user %s is authenticated', user.username) |
255 return func(*fargs, **fkwargs) | 255 return func(*fargs, **fkwargs) |
256 else: | 256 else: |
257 log.warn('user %s not authenticated', user.username) | 257 log.warn('user %s not authenticated', user.username) |
258 | 258 |
259 p = request.environ.get('PATH_INFO') | 259 p = '' |
260 if request.environ.get('SCRIPT_NAME') != '/': | |
261 p += request.environ.get('SCRIPT_NAME') | |
262 | |
263 p += request.environ.get('PATH_INFO') | |
260 if request.environ.get('QUERY_STRING'): | 264 if request.environ.get('QUERY_STRING'): |
261 p += '?' + request.environ.get('QUERY_STRING') | 265 p += '?' + request.environ.get('QUERY_STRING') |
266 | |
262 log.debug('redirecting to login page with %s', p) | 267 log.debug('redirecting to login page with %s', p) |
263 return redirect(url('login_home', came_from=p)) | 268 return redirect(url('login_home', came_from=p)) |
264 | 269 |
265 class PermsDecorator(object): | 270 class PermsDecorator(object): |
266 """Base class for decorators""" | 271 """Base class for decorators""" |