diff --git a/trac/web/auth.py b/trac/web/auth.py
|
a
|
b
|
|
| 35 | 35 | from trac.web.api import IAuthenticator, IRequestHandler |
| 36 | 36 | from trac.web.chrome import INavigationContributor |
| 37 | 37 | from trac.util import hex_entropy, md5, md5crypt |
| | 38 | from trac.util.text import unicode_urlencode |
| 38 | 39 | |
| 39 | 40 | |
| 40 | 41 | class LoginModule(Component): |
| … |
… |
|
| 94 | 95 | # IRequestHandler methods |
| 95 | 96 | |
| 96 | 97 | def match_request(self, req): |
| 97 | | return re.match('/(login|logout)/?$', req.path_info) |
| | 98 | return re.match('/(?:login(?:/.*|$)|logout/?$)', req.path_info) |
| 98 | 99 | |
| 99 | 100 | def process_request(self, req): |
| 100 | 101 | if req.path_info.startswith('/login'): |
| 101 | 102 | self._do_login(req) |
| | 103 | if len(req.path_info) > 7: |
| | 104 | self._redirect_args(req, req.path_info[6:], req.args) |
| 102 | 105 | elif req.path_info.startswith('/logout'): |
| 103 | 106 | self._do_logout(req) |
| 104 | 107 | self._redirect_back(req) |
| … |
… |
|
| 195 | 198 | |
| 196 | 199 | return row[0] |
| 197 | 200 | |
| | 201 | def _redirect_args(self, req, dest, args): |
| | 202 | """Redirect to the given URL with the given arguments.""" |
| | 203 | dest = req.base_path + dest |
| | 204 | if args: |
| | 205 | dest += "?" + unicode_urlencode((k, v) |
| | 206 | for k in args.iterkeys() for v in args.getlist(k)) |
| | 207 | req.redirect(dest) |
| | 208 | |
| 198 | 209 | def _redirect_back(self, req): |
| 199 | 210 | """Redirect the user back to the URL she came from.""" |
| 200 | 211 | referer = req.get_header('Referer') |