brandx
Posts: 29
|
| Posted: 03/16/2005, 1:32 PM |
|
Could anyone tell me how i could disable a user account to prevent them from loggin in?
CCS 2.3
MS Access / ASP
|
 |
 |
peterr
Posts: 5971
|
| Posted: 03/16/2005, 1:50 PM |
|
There are several simple ways:
- change their password to something random
or
- delete their user record
or
- Add "AND active = True" (or similar) to the SQL statement in the CCLoginUser function in Common.asp
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
Joe
|
| Posted: 03/18/2005, 12:53 PM |
|
I have the same thing on my site. I just added the Bolded Part following code to my common.asp file.
******************************************************
common.asp
line: 2069
SQL = "SELECT [UsrID], [Usr_Group] FROM [Users] WHERE [Usr_Name]='" & Replace(Login, "'", "''") & "' AND [Usr_Pass]='" & Replace(Password, "'", "''") & "' and [Status] = 'Open'"
******************************************************
I have 3 different acct. status: Open, Closed, and New. The user can only get access if their staus is set to Open.
|
|
|
 |
DonB
|
| Posted: 03/18/2005, 5:47 PM |
|
If using Access (or other database that implements queries), use a query as
the datasource instead of a table. Put a WHERE term in the query that
excludes disabled or otherwise disallowed UserIDs. No code changes are
needed.
--
DonB
http://www.gotodon.com/ccbth
|
|
|
 |
S_A
Posts: 29
|
| Posted: 03/18/2005, 11:19 PM |
|
Brandx,
I agree with Don on this one as you do not have to change any code.
In my user tables in the various apps I have, there is a checkbox to indficate whether that the user is active or not. If the box is unchecked the query does not return the record and therefore the user cannot login.
You could go one step further and have expiry dates as well and only return records where the date is > those dates. I guess it depends how much control you need and how you will administer the users.
Scott.
|
 |
 |
|