Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: delete usersby DaWolf (Curate) |
on Dec 06, 2004 at 12:18 UTC ( [id://412633]=note: print w/replies, xml ) | Need Help?? |
Hi.
This looks as a flat text file to me, so I don't know if I exactly understood your question, but I really wanna help you, so let's start. If you were just representing a database, this would be easy, just do a simple SQL query: DELETE FROM your_table_name WHERE USERNAME = 'desired_user'; If I was right at the first time and you just use a flat text file, take a look at Deleting a line out of text file for a start. That sould guide you fine. For your second question the answer is a little bit longer: Since your developing a system that has a web interface, a problem arise: What if the user just close the browser (by pressing ALT F4 or just clicking on that dreaded top right 'X' ;))? Since it's a hard thing to trigger an event when the user does this (I won't expand too much here since this is more a JavaScript thing) the user session (assuming that there is one) would remain opened and this is a security breach. So, the solution I've found out (and IMHO is the most used out there) is to do the following:
Your logout routine (for the logout link) should just destroy the user session and delete his data from the database. There are a lot of issues on this question, but I hope I helped a little. Feel free to contact me if you have any questions. Best regards,
In Section
Seekers of Perl Wisdom
|
|