mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-06 15:15:25 +00:00
Added validation to disallow password to be the same as username, email, etc
This commit is contained in:
@ -156,6 +156,16 @@ class ProfileController extends Controller
|
||||
if (!Hash::check($request->input('current_password'), $user->password)) {
|
||||
$validator->errors()->add('current_password', trans('validation.hashed_pass'));
|
||||
}
|
||||
|
||||
if (($request->input('password') == $user->username) ||
|
||||
($request->input('password') == $user->email) ||
|
||||
($request->input('password') == $user->first_name) ||
|
||||
($request->input('password') == $user->last_name))
|
||||
{
|
||||
$validator->errors()->add('password', trans('validation.disallow_same_pwd_as_user_fields'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user