Fixes #3907 - do not require username on user if LDAP import

This commit is contained in:
snipe 2017-08-31 10:43:36 -07:00
parent 22233e3ba6
commit 48e6208214

View file

@ -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