Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stefan Wuebbe
  Where is Stefan Wuebbe?
 Hamburg
 Germany
 Stefan Wuebbe
 To: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 Tags
Subject: RE: how to stop user from Re-Login
Thread ID: 330907 Message ID: 331059 # Views: 53 # Ratings: 1
Version: Visual FoxPro 9 SP2 Category: Projects and Design
Date: Monday, December 26, 2011 10:43:52 AM         
   


> a. Just create another table called onlines.dbf where names or primary key of every user who logs in is recorded. So when a user tries to login, check if his/her name or PK is already there, if not, allow him/her in; then log the name or PL. If it is already there, block and inform user that another login will not be possible unless the previous instance exit. During exit, delete the name or PK from that login list.
>
> b. Or if you want a simpler way, create a logical field in your users' table (where passwords are kept), let us say name it isUsed. When user logs in, switch the value to .T. and when user logs out, switch it to .F.. When same user attempts to log in, seek his name or PK, check the value of the isUsed field. If it is already set to true, block user.
>
> There are cases though where an improper shutdown may happen thereby leaving the name or PK (in a above) intact or the isused value to remain .T. (b above); which will result to the user not be able to log in again. To counter that, use a timer that will reset, at certain interval, those things.
>


How would the timer decide what to reset, what will a starting instance do to know whether certain values are intentional vs being left over from crashes, or that had or had not been reset by the hypothetical timer?
I'd say The RLock() approach is easier and safer, and FCreate() file handles work well too.



hth
-Stefan

ENTIRE THREAD

how to stop user from Re-Login Posted by mk sharma @ 12/24/2011 11:22:10 AM
RE: how to stop user from Re-Login Posted by Vivek Deodhar @ 12/24/2011 12:20:24 PM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/24/2011 12:31:54 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/26/2011 3:27:48 AM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 7:13:14 AM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/26/2011 10:43:52 AM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 12:04:10 PM
RE: how to stop user from Re-Login Posted by Anil Sharma @ 12/26/2011 12:09:51 PM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 12:23:46 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 5:56:27 AM
RE: how to stop user from Re-Login Posted by Anil Sharma @ 12/27/2011 8:40:33 AM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 11:30:17 PM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/26/2011 6:29:48 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 5:34:38 AM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/27/2011 10:10:50 AM
RE: how to stop user from Re-Login Posted by Vivek Deodhar @ 12/27/2011 10:37:58 AM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 11:27:56 PM
RE: how to stop user from Re-Login Posted by Jun Tangunan @ 12/27/2011 11:19:20 PM
RE: how to stop user from Re-Login Posted by anand kulkarni @ 12/26/2011 3:57:11 AM
RE: how to stop user from Re-Login Posted by Stefan Wuebbe @ 12/26/2011 10:38:35 AM
RE: how to stop user from Re-Login Posted by mk sharma @ 12/26/2011 12:02:01 PM