From 56395aa91bcdc8521b47cbf6ac601890216adcaf Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 15 Jun 2023 13:14:01 +0200 Subject: [PATCH] refs #5489 Account.sync(): bcryptPassword not used, removed --- rest/user/account.php | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 rest/user/account.php diff --git a/rest/user/account.php b/rest/user/account.php deleted file mode 100644 index dc39a4b1..00000000 --- a/rest/user/account.php +++ /dev/null @@ -1,40 +0,0 @@ -getValue( - 'SELECT COUNT(*) > 0 FROM account.userSync WHERE name = #', - [$userName] - ); - - if ($sync) - self::sync($db, $userName, $password); - } - - static function sync($db, $userName, $password = NULL) { - $bcryptPassword = password_hash($password, PASSWORD_BCRYPT); - - $userId = $db->getValue( - 'SELECT id FROM account.user WHERE `name` = #', - [$userName] - ); - $db->query( - 'UPDATE account.user SET - bcryptPassword = # - WHERE id = #', - [$bcryptPassword, $userId] - ); - - $hasAccount = $db->getValue( - 'SELECT COUNT(*) > 0 - FROM account.user u - JOIN account.account a ON u.id = a.id - WHERE u.name = #', - [$userName] - ); - if (!$hasAccount) - $db->query('DELETE FROM account.userSync WHERE name = #', - [$userName] - ); - } -}