64 |
|
|
65 |
Some notes: |
Some notes: |
66 |
|
|
67 |
1) GNUe-Common will expect to see to two objects in your handler's |
1) Almost the only restriction placed on getLogin's functionality is |
|
namespace: LoginHandler (from the import statement) and |
|
|
MyLoginHandler (your customized login class) |
|
|
|
|
|
For this reason, do NOT change the import statement to read: |
|
|
from gnue.common import GLoginHandler |
|
|
and then change the class' parent to be GLoginHandler.LoginHandler. |
|
|
If you do, your customized handler will probably not work the way |
|
|
you expect. |
|
|
|
|
|
2) Almost the only restriction placed on getLogin's functionality is |
|
68 |
that it must return a hash containing at least the values requested |
that it must return a hash containing at least the values requested |
69 |
when getLogin was called, using the value id's supplied. Your code, |
when getLogin was called, using the value id's supplied. Your code, |
70 |
in theory, can do whatever it needs in order to return these values. |
in theory, can do whatever it needs in order to return these values. |
154 |
'select 1 from users where username=%s and password=%s', |
'select 1 from users where username=%s and password=%s', |
155 |
(loginData['_username'], |
(loginData['_username'], |
156 |
loginData['_password']) ) |
loginData['_password']) ) |
157 |
if not results.fetchone(): |
if not cursor.fetchone(): |
158 |
raise LoginError |
raise LoginError |
159 |
else: |
else: |
160 |
loginData['_username'] = 'dbLogin' |
loginData['_username'] = 'dbLogin' |
161 |
loginData['_password'] = 'dbPassword' |
loginData['_password'] = 'dbPassword' |
162 |
|
|
163 |
|
return loginData |
164 |
=============================================================================== |
=============================================================================== |
165 |
|
|
166 |
Note: there are no hard and fast rules about what can go into the |
Note: there are no hard and fast rules about what can go into the |