Mercurial > p > roundup > code
comparison roundup/cgi/actions.py @ 2657:534f78a2e400
less specific messages for login failures (thanks Chris Withers)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sat, 07 Aug 2004 22:18:41 +0000 |
| parents | 1df7d4a41da4 |
| children | 9ecca789544f |
comparison
equal
deleted
inserted
replaced
| 2655:edaa8ba86bd0 | 2657:534f78a2e400 |
|---|---|
| 1 #$Id: actions.py,v 1.36 2004-07-28 02:29:45 richard Exp $ | 1 #$Id: actions.py,v 1.37 2004-08-07 22:17:11 richard Exp $ |
| 2 | 2 |
| 3 import re, cgi, StringIO, urllib, Cookie, time, random | 3 import re, cgi, StringIO, urllib, Cookie, time, random |
| 4 | 4 |
| 5 from roundup import hyperdb, token, date, password, rcsv, exceptions | 5 from roundup import hyperdb, token, date, password, rcsv, exceptions |
| 6 from roundup.i18n import _ | 6 from roundup.i18n import _ |
| 841 # make sure the user exists | 841 # make sure the user exists |
| 842 try: | 842 try: |
| 843 self.client.userid = self.db.user.lookup(self.client.user) | 843 self.client.userid = self.db.user.lookup(self.client.user) |
| 844 except KeyError: | 844 except KeyError: |
| 845 name = self.client.user | 845 name = self.client.user |
| 846 self.client.error_message.append(self._('No such user "%(name)s"') | 846 self.client.error_message.append(self._('Ivalid login')) |
| 847 %locals()) | |
| 848 self.client.make_user_anonymous() | 847 self.client.make_user_anonymous() |
| 849 return | 848 return |
| 850 | 849 |
| 851 # verify the password | 850 # verify the password |
| 852 if not self.verifyPassword(self.client.userid, password): | 851 if not self.verifyPassword(self.client.userid, password): |
| 853 self.client.make_user_anonymous() | 852 self.client.make_user_anonymous() |
| 854 self.client.error_message.append(self._('Incorrect password')) | 853 self.client.error_message.append(self._('Invalid login')) |
| 855 return | 854 return |
| 856 | 855 |
| 857 # Determine whether the user has permission to log in. | 856 # Determine whether the user has permission to log in. |
| 858 # Base behaviour is to check the user has "Web Access". | 857 # Base behaviour is to check the user has "Web Access". |
| 859 if not self.hasPermission("Web Access"): | 858 if not self.hasPermission("Web Access"): |
