diff options
Diffstat (limited to 'classes/pref')
-rw-r--r-- | classes/pref/users.php | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/classes/pref/users.php b/classes/pref/users.php index 45c4b82b8..67daa884f 100644 --- a/classes/pref/users.php +++ b/classes/pref/users.php @@ -237,22 +237,14 @@ class Pref_Users extends Handler_Protected { if (!$login) return; // no blank usernames - $sth = $this->pdo->prepare("SELECT id FROM ttrss_users WHERE - LOWER(login) = LOWER(?)"); - $sth->execute([$login]); - - if (!$sth->fetch()) { + if (!UserHelper::find_user_by_login($login)) { $sth = $this->pdo->prepare("INSERT INTO ttrss_users (login,pwd_hash,access_level,last_login,created, salt) VALUES (LOWER(?), ?, 0, null, NOW(), ?)"); $sth->execute([$login, $pwd_hash, $salt]); - $sth = $this->pdo->prepare("SELECT id FROM ttrss_users WHERE - LOWER(login) = LOWER(?) AND pwd_hash = ?"); - $sth->execute([$login, $pwd_hash]); - - if ($row = $sth->fetch()) { + if ($new_uid = UserHelper::find_user_by_login($login)) { $new_uid = $row['id']; |