From 8a9960f830344c01cd1d156f4d858af0bae2f0da Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 24 Oct 2017 16:56:46 -0700 Subject: [PATCH] Fixed missing break that would override password requirement --- app/Http/Requests/SaveUserRequest.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Requests/SaveUserRequest.php b/app/Http/Requests/SaveUserRequest.php index 32a8a3d80a..5f42033681 100644 --- a/app/Http/Requests/SaveUserRequest.php +++ b/app/Http/Requests/SaveUserRequest.php @@ -27,15 +27,17 @@ class SaveUserRequest extends Request $rules = []; + \Log::debug($this->method()); switch($this->method()) { - // Brand new asset + // Brand new user case 'POST': { $rules['first_name'] = 'required|string|min:1'; $rules['username'] = 'required_unless:ldap_import,1|string|min:1'; $rules['password'] = Setting::passwordComplexityRulesSaving('store'); + break; } // Save all fields @@ -43,11 +45,13 @@ class SaveUserRequest extends Request $rules['first_name'] = 'required|string|min:1'; $rules['username'] = 'required_unless:ldap_import,1|string|min:1'; $rules['password'] = Setting::passwordComplexityRulesSaving('update'); + break; // Save only what's passed case 'PATCH': { $rules['password'] = Setting::passwordComplexityRulesSaving('update'); + break; } default:break;