| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Trac
Revision: 7494
Author: rblank
Date: 22 Aug 2008 17:30:44
Diff at Trac: http://trac.edgewall.org/changeset/7494
Changes:0.11-stable: Added a notice to the "403 Forbidden" error page for unauthenticated users suggesting that the user should log in.
Closes #5340 as per [GoogleGroups:trac-dev:2e8be2a89307f7ce this message].
Files:| ... | ...@@ -43,6 +43,7 @@ | |
| 43 | 43 | from trac.util.compat import partial, reversed |
| 44 | 44 | from trac.util.datefmt import format_datetime, http_date, localtz, timezone |
| 45 | 45 | from trac.util.text import shorten_line, to_unicode |
| 46 | from trac.util.translation import _ | |
| 46 | 47 | from trac.web.api import * |
| 47 | 48 | from trac.web.chrome import Chrome |
| 48 | 49 | from trac.web.clearsilver import HDFWrapper |
| ... | ...@@ -436,6 +437,11 @@ | |
| 436 | 437 | title = 'Error: %s' % e.reason |
| 437 | 438 | data = {'title': title, 'type': 'TracError', 'message': e.detail, |
| 438 | 439 | 'frames': [], 'traceback': None} |
| 440 | if e.code == 403 and req.authname == 'anonymous': | |
| 441 | req.chrome['notices'].append(Markup( | |
| 442 | _('You are currently not logged in. You may want to ' | |
| 443 | '<a href="%(href)s">do so</a> now.', | |
| 444 | href=req.href.login()))) | |
| 439 | 445 | try: |
| 440 | 446 | req.send_error(sys.exc_info(), status=e.code, env=env, data=data) |
| 441 | 447 | except RequestDone: |