09-08-2007, 05:23 PM
|
#1 (permalink)
|
|
The Contributor
Join Date: Sep 2007
Posts: 91
Thanks: 1
|
Secure login script.
Had this coded for me by one of my programmers, thought it might come in handy for some of you guys!
Notes:
Quote:
Authentication Class - AuthClass
Syed Imran Moinuddin
23rd September 2006
=================================
General Notes
-> All passwords in the DB must be stored as MD5 hashed.
-> The AuthClass object offers two key functions (not including internal functions):
- authentication($username,$password)
The function will accept the username and password as provided by the user and then proceed to compare the md5 hashed
value of the password with the encrypted password in the database.
- verify()
The function will check the browser session and compare against active sessions in the database and return a boolean to
the caller on the validity of the session. verify can be called on the top of all pages which require security. It is
better to place it in a consistently present include to avoid code repetition.
- logout()
This will destroy session variables associated with the existing login and should be triggered such as when the user clicks
a logout button as well.
|
Enjoy!!
Last edited by Sam Granger : 09-08-2007 at 05:58 PM.
|
|
|
|