CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Disabling User Logins

Print topic Send  topic

Author Message
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.

View profile  Send private message
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
View profile  Send private message
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.... :)
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.