projects
/
matthijs
/
projects
/
wipi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b2c8c55
)
Add a hint option to the mysql_login auth backend.
author
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 2 Jul 2009 15:01:14 +0000
(17:01 +0200)
committer
Matthijs Kooijman
<matthijs@stdin.nl>
Thu, 2 Jul 2009 15:01:14 +0000
(17:01 +0200)
conf/auth/mysql_login.py
patch
|
blob
|
history
diff --git
a/conf/auth/mysql_login.py
b/conf/auth/mysql_login.py
index 274abcd76d83397287e5f532a71b6eee560b3b17..1e3558fdebe39f69d2fb092d2d90bab39b9cb7cd 100644
(file)
--- a/
conf/auth/mysql_login.py
+++ b/
conf/auth/mysql_login.py
@@
-15,9
+15,13
@@
class mysql_login(BaseAuth):
logout_possible = True
login_inputs = ['username', 'password']
logout_possible = True
login_inputs = ['username', 'password']
- def __init__(self, name='mysql', dbhost=None, dbuser=None, dbpass=None, dbname=None, dbport=None, verbose=False):
+ def __init__(self, name='mysql', dbhost=None, dbuser=None, dbpass=None, dbname=None, dbport=None, verbose=False
, hint=None
):
"""
Authenticate using credentials from a mysql database
"""
Authenticate using credentials from a mysql database
+
+ The name parameter should be unique among all authentication methods.
+
+ The hint parameter is a snippet of HTML that is displayed below the login form.
"""
self.verbose = verbose
self.dbhost = dbhost
"""
self.verbose = verbose
self.dbhost = dbhost
@@
-26,6
+30,7
@@
class mysql_login(BaseAuth):
self.dbname = dbname
self.dbport = dbport
self.name = name
self.dbname = dbname
self.dbport = dbport
self.name = name
+ self.hint = hint
def check_login(self, request, username, password):
""" Checks the given username password combination. Returns the
def check_login(self, request, username, password):
""" Checks the given username password combination. Returns the
@@
-127,4
+132,8
@@
class mysql_login(BaseAuth):
request.log(''.join(traceback.format_exception(*info)))
return ContinueLogin(user_obj)
request.log(''.join(traceback.format_exception(*info)))
return ContinueLogin(user_obj)
+ def login_hint(self, request):
+ """ Return a snippet of HTML that is displayed with the login form. """
+ return self.hint
+
# vim: set sw=4 expandtab sts=4:vim
# vim: set sw=4 expandtab sts=4:vim