TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-08-2007, 04:23 PM   #1 (permalink)
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default 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!!
Attached Files
File Type: zip authclass.zip (4.3 KB, 1225 views)

Last edited by Sam Granger : 09-08-2007 at 04:58 PM.
Sam Granger is offline  
Reply With Quote
The Following 3 Users Say Thank You to Sam Granger For This Useful Post:
Filipe Costa (03-12-2008), subman (03-29-2008), Y.P.Y (01-22-2009)
Old 09-08-2007, 04:53 PM   #2 (permalink)
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 360
Thanks: 24
Haris is on a distinguished road
Default

You forgot to attach the script.
Haris is offline  
Reply With Quote
Old 09-08-2007, 05:26 PM   #3 (permalink)
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default

Thanks for letting me know, attachment added. Also can be downloaded off SourceForge soon! GNU license.

Link:
Sam Granger is offline  
Reply With Quote
Old 09-08-2007, 07:26 PM   #4 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Is this the same one as over at TalkFreelance? (I can't seem to download the attachment)
Salathe is offline  
Reply With Quote
Old 09-08-2007, 07:31 PM   #5 (permalink)
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default

Yes, however I have decided to release under GNU license in the end. Source is exactly the same.
Sam Granger is offline  
Reply With Quote
Old 09-10-2007, 11:24 AM   #6 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Thanks a lot for uploading the script, Sam. It's much appreciated!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 02-05-2008, 09:19 PM   #7 (permalink)
The Wanderer
 
autehonker's Avatar
 
Join Date: Feb 2008
Posts: 8
Thanks: 9
autehonker is on a distinguished road
Default

Hi
Hello
Hallo
Ciao
talkphp.com and sup Wildhoney

i am realy new php coder amd onlt learning and i am puting Secure login script in my web site and that right good working but i wanna made register.php and i dont noe making that :( what can i do?
Any one give me this secure login script register.php code
thank you
autehonker is offline  
Reply With Quote
Old 02-05-2008, 10:02 PM   #8 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Quote:
Originally Posted by autehonker View Post
Hi
Hello
Hallo
Ciao
talkphp.com and sup Wildhoney

i am realy new php coder amd onlt learning and i am puting Secure login script in my web site and that right good working but i wanna made register.php and i dont noe making that :( what can i do?
Any one give me this secure login script register.php code
thank you
English please.
__________________

Village Idiot is offline  
Reply With Quote
Old 02-05-2008, 10:16 PM   #9 (permalink)
The Wanderer
 
autehonker's Avatar
 
Join Date: Feb 2008
Posts: 8
Thanks: 9
autehonker is on a distinguished road
Default

sorry but this is english words, and mine english is not good,but i can speaks alots of people,And why u arnt noe that post? am i only changed some words if u arnt knowe mine word i am wrighting that descriptions here,
noe = knowe
u = you
ur = your
wanna = want to

Sup Village Idiot; i hopso ur understand mine post and please help 4 making registery.php
autehonker is offline  
Reply With Quote
Old 02-05-2008, 10:32 PM   #10 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

Sorry, didn't realize English isn't your first language. I'm afraid I don't have the time to type up a register script for that.

It will take some modifying, but I have a full login script as a part of this
JustAnotherPortfolio - Coding Example
__________________

Village Idiot is offline  
Reply With Quote
Old 02-06-2008, 05:05 PM   #11 (permalink)
The Wanderer
 
autehonker's Avatar
 
Join Date: Feb 2008
Posts: 8
Thanks: 9
autehonker is on a distinguished road
Default

Thank u sup
autehonker is offline  
Reply With Quote
Old 02-16-2008, 04:27 PM   #12 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default

What can we use this for? What is its liscence?
Gareth is offline  
Reply With Quote
Old 02-16-2008, 05:44 PM   #13 (permalink)
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default

You can use this for whatever you want. You can add it into a clients project, a commercial script etc... However, you may not claim it as your own work. Ie. if someone askes you if you programmed it all, you can't say yes. You don't need to mention me in any way, it just doesnt seem right if you say its your work. Have fun with it.
Sam Granger is offline  
Reply With Quote
The Following 2 Users Say Thank You to Sam Granger For This Useful Post:
Gareth (02-16-2008), NathanH (02-20-2008)
Old 02-16-2008, 05:54 PM   #14 (permalink)
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default

Ps. Please use the "Say thanks" button if you like this script!
Sam Granger is offline  
Reply With Quote
Old 02-16-2008, 06:05 PM   #15 (permalink)
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default

And I'll hire the programmer to upgrade this to PHP5 and to add a registration page.
Sam Granger is offline  
Reply With Quote
Old 02-16-2008, 10:23 PM   #16 (permalink)
The Acquainted
 
Gareth's Avatar
 
Join Date: Jan 2008
Posts: 136
Thanks: 4
Gareth is on a distinguished road
Default

Wow, thank you! I will certainly be using this and will give credit to you!

Gareth
Gareth is offline  
Reply With Quote
Old 03-12-2008, 11:09 PM   #17 (permalink)
The Visitor
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
dizzhead is on a distinguished road
Default

Quote:
Originally Posted by Sam Granger View Post
And I'll hire the programmer to upgrade this to PHP5 and to add a registration page.
i like this script, it is very nice and simple, i did change it to conform to php5 and i also changed the password encryption to sha1 instead of md5. thanks for the class it saved me some time.
dizzhead is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 10:45 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design