PDA

View Full Version : VB Password md5 check on non VB page.


scifi-meshes
Wed 22nd Dec '04, 9:30am
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:

/* password correct? */
$query = "SELECT salt, password FROM user WHERE username='$username'";
$result = mysql_query($query) or die("The information you entered does not match our records.");
$row=mysql_fetch_array($result);

$dbpassword = $row['password'];
$salt = $row['salt'];

if ($dbpassword == md5(md5($password). $salt)) {
print "Password correct<br><br>";
}
else {
die("password not correct!");
}


This compares what the user entered with that is stored in the Vbulletin forums MySQL database. However, I am ALWAYS getting "Password not correct!" and I have changed my password a few times to see if something wasn't set properly.

Can anyone help me? This code WAS working perfectly.

Floris
Wed 22nd Dec '04, 12:41pm
vBulletin source code customizations are to be discussed on vBulletin.org

scifi-meshes
Wed 22nd Dec '04, 1:41pm
Thanks for reopening the thread.

Folks...this is a PHP question and is not an attempt to modify Vbulletin. I'm merely trying to compare variables held in the database (password) and after my upgrade to PHP 4.3.10 on the server it appears the code above no longer works.

Scifi