Skip to content

A free open source IT asset/license management system

Added comments

snipe296655542dd1
diff --git a/app/Http/Controllers/ProfileController.php b/app/Http/Controllers/ProfileController.php
index d1a6306b69..ae283cd25a 100755
--- a/app/Http/Controllers/ProfileController.php
+++ b/app/Http/Controllers/ProfileController.php
@@ -157,6 +157,14 @@ class ProfileController extends Controller
$validator->errors()->add('current_password', trans('validation.hashed_pass'));
}
+ // This checks to make sure that the user's password isn't the same as their username,
+ // email address, first name or last name (see https://github.com/snipe/snipe-it/issues/8661)
+ // While this is handled via SaveUserRequest form request in other places, we have to do this manually
+ // here because we don't have the username, etc form fields available in the profile password change
+ // form.
+
+ // There may be a more elegant way to do this in the future.
+
if (($request->input('password') == $user->username) ||
($request->input('password') == $user->email) ||
($request->input('password') == $user->first_name) ||