From f8d70b5390e07fea39ebd7036b660bfd98f13d32 Mon Sep 17 00:00:00 2001 From: jessevz Date: Wed, 20 Aug 2025 14:50:50 +0200 Subject: [PATCH] Changed status code of updating password --- src/inc/utils/UserUtils.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/inc/utils/UserUtils.class.php b/src/inc/utils/UserUtils.class.php index 538b85b77..a66eb3e67 100644 --- a/src/inc/utils/UserUtils.class.php +++ b/src/inc/utils/UserUtils.class.php @@ -137,16 +137,16 @@ public static function setRights($userId, $groupId, $adminUser) { */ public static function changePassword($user, $oldPassword, $newPassword, $confirmPassword) { if (!Encryption::passwordVerify($oldPassword, $user->getPasswordSalt(), $user->getPasswordHash())) { - throw new HTException("Your old password is wrong!"); + throw new HttpError("Your old password is wrong!"); } else if (strlen($newPassword) < 4) { - throw new HTException("Your password is too short!"); + throw new HttpError("Your password is too short!"); } else if ($newPassword != $confirmPassword) { - throw new HTException("Your new passwords do not match!"); + throw new HttpError("Your new passwords do not match!"); } else if ($newPassword == $oldPassword) { - throw new HTException("Your new password is the same as the old one!"); + throw new HttpError("Your new password is the same as the old one!"); } $newSalt = Util::randomString(20); $newHash = Encryption::passwordHash($newPassword, $newSalt);