Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 9th, 2006, 04:38 AM
Authorized User
 
Join Date: Mar 2006
Location: Doha, , Qatar.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inactivate User Account

Inactivate User Account

If a user is already logged in and the administrator closed or inactivate his account
and the user clicked on a button, he will get an error message.

so, is there away to prevent the administrator from inactivating users accounts while
they are loggedin?

Nina

Happy Programming :)
__________________
Happy Programming :)
 
Old March 10th, 2006, 11:43 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In the user db make a field like 'inactivate' or 'close' and set that value to true when the administrator inactivate or close user's account. In your login method/module check for the value 'inactivate' or 'close' and if it is 'true' don't let the user login, you can also display a proper error message based on the values set.

Regards,
Puli.
 
Old March 12th, 2006, 12:55 AM
Authorized User
 
Join Date: Mar 2006
Location: Doha, , Qatar.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

okay how can i disable the inactive button for the logged in user.. i mean can i write a code that checks who is logged in and who is not? and how?

Happy Programming :)
 
Old March 12th, 2006, 01:14 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sure you can. but I need a little detail about how you login the user, I mean are you using session variables or updating databse on login or using cookies etc.

Regards,
Puli
 
Old March 12th, 2006, 05:59 AM
Authorized User
 
Join Date: Mar 2006
Location: Doha, , Qatar.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

am using session variable to store username..

Happy Programming :)
 
Old March 13th, 2006, 10:13 AM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Since you can't read the session variable of the client, you have to go with the method I mentioned. Let the admin inactivte the user, and store the decision in a column and check for it on the next login. The other option is to write the login information to session variable as well as a database table which can be accessed by both admin and client. To record logout, on events logout click or session_end (available in Global.asax.{vb/cs} of your application) update the info in database as logout. This way you can check if the user is logged in or not by looking up the database.

I hope this will work for you.
Regards,
Sai Puli




Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 15 -create user account melania BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 15 December 5th, 2008 05:53 PM
TO retrieive all user account name vinothsiva General .NET 1 June 15th, 2007 05:29 PM
How to creat an user account prad_a PHP Databases 1 May 12th, 2007 03:25 AM
Create User Account casselj ASP.NET 1.0 and 1.1 Professional 1 June 20th, 2005 08:34 AM
creating new user(object name) for IIS account joshil Access ASP 1 April 18th, 2004 01:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.