News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Verifying password hash

Started by Mike Bobbitt, September 26, 2017, 06:14:39 AM

Previous topic - Next topic

Mike Bobbitt

Upgraded a test forum to the nightly build this morning, and everything looks great.

However, I use an external script to authenticate board users and regulate access to non-SMF areas. (So you can't access some pages unless you are logged in.) In this script, I read the username/password from the local cookie, and compare it against the db password hash for that user using the good old SHA1 hashing:

$passhash = sha1(strtolower($username) . $password);

I'm not sure what mechanism is in use under 2.1, but am looking for the equivalent process.


Thanks!
Mike

Arantor

Because including SSI.php and having SMF entirely do it for you isn't an option?

Mike Bobbitt

Good point, I will now simply check $context['user']['is_logged'] for the user's authentication status. Thanks.

Advertisement: