From 48e6208214206b26b1859dfaa5c8c8b747a728dc Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 31 Aug 2017 10:43:36 -0700 Subject: [PATCH] Fixes #3907 - do not require username on user if LDAP import --- app/Http/Requests/SaveUserRequest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/SaveUserRequest.php b/app/Http/Requests/SaveUserRequest.php index 076c3115db..32a8a3d80a 100644 --- a/app/Http/Requests/SaveUserRequest.php +++ b/app/Http/Requests/SaveUserRequest.php @@ -34,14 +34,14 @@ class SaveUserRequest extends Request case 'POST': { $rules['first_name'] = 'required|string|min:1'; - $rules['username'] = 'required|string|min:1'; + $rules['username'] = 'required_unless:ldap_import,1|string|min:1'; $rules['password'] = Setting::passwordComplexityRulesSaving('store'); } // Save all fields case 'PUT': $rules['first_name'] = 'required|string|min:1'; - $rules['username'] = 'required|string|min:1'; + $rules['username'] = 'required_unless:ldap_import,1|string|min:1'; $rules['password'] = Setting::passwordComplexityRulesSaving('update'); // Save only what's passed