From b840a74a1db4c87afd96da4df9d3f4d92f1459f3 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 30 Dec 2011 22:49:41 +0400 Subject: [PATCH] fix attempt to insert user with null pwd_hash when auto creating (fixes #412) --- include/functions.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/functions.php b/include/functions.php index 3e926b1a3..fa16bf8bf 100644 --- a/include/functions.php +++ b/include/functions.php @@ -701,9 +701,11 @@ // First login ? if (db_num_rows($result) == 0) { + $pwd_hash = encrypt_password(make_password(), $login); + $query2 = "INSERT INTO ttrss_users - (login,access_level,last_login,created) - VALUES ('$login', 0, null, NOW())"; + (login,access_level,last_login,created,pwd_hash) + VALUES ('$login', 0, null, NOW(), '$pwd_hash')"; db_query($link, $query2); } }