From: Andrew Dolgov Date: Fri, 30 Dec 2011 18:49:41 +0000 (+0400) Subject: fix attempt to insert user with null pwd_hash when auto creating (fixes #412) X-Git-Tag: 1.5.9~14 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=b840a74a1db4c87afd96da4df9d3f4d92f1459f3;p=tt-rss.git fix attempt to insert user with null pwd_hash when auto creating (fixes #412) --- diff --git a/include/functions.php b/include/functions.php index 3e926b1a..fa16bf8b 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); } }