summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2011-12-30 22:49:41 +0400
committerAndrew Dolgov <[email protected]>2011-12-30 22:49:41 +0400
commitb840a74a1db4c87afd96da4df9d3f4d92f1459f3 (patch)
treeacf92bc067663335fe2e400413502e538c49fa6c /include
parent4046fc59d80c87496c598a71ad7419a93b2bbb0c (diff)
fix attempt to insert user with null pwd_hash when auto creating (fixes #412)
Diffstat (limited to 'include')
-rw-r--r--include/functions.php6
1 files 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);
}
}