MichaelMcDonald
Posts: 640
|
| Posted: 05/06/2009, 10:16 PM |
|
Has anyone a method for disabling a user account so that it will not respond at the Login screen? - say for example I add a field to the user account - a checkbox makes it either active = "Y" or inactive = "N" . Inactive would fail at the login screen.
I wish to preserve user account data even after the user is no longer with the organisation for historical logging and retrieval purposes. If I delete an account entirely then any future live references to transactions made using it will not return other associated user data such as user name, contractor organisation, address, DOB , etc...
_________________
Central Coast, NSW, Australia.
|
 |
 |
melvyn
Posts: 333
|
| Posted: 05/06/2009, 10:54 PM |
|
Yes. I use a field called active with value 0 or 1.
In the common.php search for the function CCLoginUser and find the line 1974:
$SQL = "SELECT id, group, password FROM users WHERE Login=" . $db->ToSQL($login, ccsText) .
" AND Password=" . $db->ToSQL($password, ccsText);
Or something so, according to the fields you defined.
Well, let's modify it to let it as:
$SQL = "SELECT id, group, password FROM users WHERE active = 1 AND Login=" . $db->ToSQL($login, ccsText) .
" AND Password=" . $db->ToSQL($password, ccsText);
So you can change the field from checked (active = 1) to unchecked (active = 0) and avoid login with the above line.
Mel
_________________
Melvyn Perez
Puro Codigo
http://purocodigo.com |
 |
 |
damian
Posts: 838
|
| Posted: 05/06/2009, 11:28 PM |
|
i just have a group level (1) that is disabled
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
|