![]() |
(PHP) Check VB md5 password on non-vb page
I have a header system on my forums that has an upload area that ONLY staff (mods and admins) can get too and upload new headers for the forums home page.
http://www.scifi-meshes.com/forums Now.. prior to my update to PHP 4.3.10 (on saturday) this header system was working fine. However after that update (which I assume is part of the problem) I've discovered that I can no longer log into my header management page (self created). The code for checking the password is as follows: Code:
/* password correct? */ Can anyone help me? This code WAS working perfectly. |
PHP Code:
|
The change from:
if ($dbpassword == md5(md5($password). $salt)) { to This: if ($dbpassword == md5($password. $salt)) { Apprently does not work. |
I believe the license # has something to do with it too. There are a few topics around like this, you'll find the answer there :)
|
I've done this before, $user[password]==md5(md5($unencrypted).$user[salt])) should've worked.
I would start echoing variables and seeing what's not matching up. |
or you could just use the same if vbulletin uses for checking login information:
taken from function_login.php, verify_authentication function: if ( $bbuserinfo['password'] != iif($password AND !$md5password, md5(md5($password) . $bbuserinfo['salt']), '') AND $bbuserinfo['password'] != md5($md5password . $bbuserinfo['salt']) AND $bbuserinfo['password'] != iif($md5password_utf, md5($md5password_utf . $bbuserinfo['salt']), '') ) |
Hold on a second, if you're doing this from within vBulletin anyway, just check to see if a user is logged in using if(!$bbuserinfo['userid']) and then use is_moderator() function :)
|
i don't think he's using vbulletin. in the first snippet of code he's using mysql_query.
|
the title fo the thread also includes "on non-vb page"...
|
All times are GMT. The time now is 06:22 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|