Added comments

This commit is contained in:
snipe 2020-11-02 20:07:39 -08:00
parent a55694da2f
commit 296655542d

View file

@ -157,6 +157,14 @@ class ProfileController extends Controller
$validator->errors()->add('current_password', trans('validation.hashed_pass')); $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) || if (($request->input('password') == $user->username) ||
($request->input('password') == $user->email) || ($request->input('password') == $user->email) ||
($request->input('password') == $user->first_name) || ($request->input('password') == $user->first_name) ||