From 736b3209bf1e655d491f668e6a9c36bc1185d772 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Thu, 18 Jul 2024 20:16:27 +0700 Subject: [PATCH] Update User.php --- src/Legacy/Common/User.php | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/Legacy/Common/User.php b/src/Legacy/Common/User.php index 2d31b0138..0cb742890 100644 --- a/src/Legacy/Common/User.php +++ b/src/Legacy/Common/User.php @@ -627,24 +627,6 @@ class User public function mark_read($type) { if ($type === 'all_forums') { - // Update session time - DB()->query(" - UPDATE " . BB_SESSIONS . " SET - session_time = " . TIMENOW . " - WHERE session_id = '{$this->data['session_id']}' - LIMIT 1 - "); - - // Update userdata - $this->data['session_time'] = TIMENOW; - $this->data['user_lastvisit'] = TIMENOW; - - // Update lastvisit - Sessions::db_update_userdata($this->data, [ - 'user_session_time' => $this->data['session_time'], - 'user_lastvisit' => $this->data['user_lastvisit'], - ]); - // Delete cookies bb_setcookie(COOKIE_TOPIC, null); bb_setcookie(COOKIE_FORUM, null); @@ -787,6 +769,13 @@ class User } return true; + } else { + if (md5(md5($enteredPassword)) === $userdata['user_password']) { + // Update old md5 password + DB()->query("UPDATE " . BB_USERS . " SET user_password = '" . $this->password_hash($enteredPassword) . "' WHERE user_id = '" . $userdata['user_id'] . "' AND user_password = '" . $userdata['user_password'] . "' LIMIT 1"); + + return true; + } } return false;