]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix attempt to insert user with null pwd_hash when auto creating (fixes #412)
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 30 Dec 2011 18:49:41 +0000 (22:49 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 30 Dec 2011 18:49:41 +0000 (22:49 +0400)
include/functions.php

index 3e926b1a3648b7f801300ed7bbeea0ef5dcd2ff7..fa16bf8bffd2ea169db99e86d6f8ed0c2d54194f 100644 (file)
 
                                        // 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);
                                        }
                                }