Added comments
This commit is contained in:
parent
a55694da2f
commit
296655542d
1 changed files with 8 additions and 0 deletions
|
@ -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) ||
|
||||||
|
|
Loading…
Add table
Reference in a new issue