Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/inc/utils/UserUtils.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down