Using SQL to change password in G2

martijntijn

Joined: 2005-12-02
Posts: 12
Posted: Tue, 2008-02-26 14:57

I`m running a pivot website and i want a user to change his Gallery2 password with a simple form. Therefor i use this:

$sql_password = "UPDATE g2_User SET g_hashedPassword = '".md5($_POST['new_password'])."' WHERE g_userName = '$username'";
			$result = mysql_query($sql_password) or die(mysql_error());

As for the result the database is changed and the new password is stored for the right user in a md5 format. Yes, i know the md5 format isn`t used in Gallery2, but this will be fixed when the user logs in. This is also used by the Gallery1 -> Gallery2 convertion. So this is not the problem.

However, when the password in the database is changed, i cant login with this new password, but i can login with the previous password, although the database has changed.

So the previous password must be store elsewhere somehow. Does anyone knows where? Or is there another explaination?