From 2f0c69c9ef93046d12939089117bf9d9b2b46cef Mon Sep 17 00:00:00 2001 From: Tom Laermans Date: Sun, 20 Mar 2011 21:13:59 +0000 Subject: [PATCH] only update password to salted if database field is long enough git-svn-id: http://www.observium.org/svn/observer/trunk@1939 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/includes/authentication/mysql.inc.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/html/includes/authentication/mysql.inc.php b/html/includes/authentication/mysql.inc.php index 4d1ee77e26..bf8846be32 100644 --- a/html/includes/authentication/mysql.inc.php +++ b/html/includes/authentication/mysql.inc.php @@ -11,7 +11,12 @@ function authenticate($username,$password) // Migrate from old, unhashed password if ($row['password'] == $encrypted_old) { - changepassword($username,$password); + $query = mysql_query("DESCRIBE users password"); + $row = mysql_fetch_assoc($query); + if ($row['Type'] == 'varchar(34)') + { + changepassword($username,$password); + } return 1; } if ($row['password'] == crypt($password,$row['password']))