mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -08:00
Do not update users who already exist since that locale may have been overirrden manually
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
f91ad6b2db
commit
24e58d1455
|
@ -232,7 +232,6 @@ class LdapSync extends Command
|
||||||
$item['department'] = $results[$i][$ldap_result_dept][0] ?? '';
|
$item['department'] = $results[$i][$ldap_result_dept][0] ?? '';
|
||||||
$item['manager'] = $results[$i][$ldap_result_manager][0] ?? '';
|
$item['manager'] = $results[$i][$ldap_result_manager][0] ?? '';
|
||||||
$item['location'] = $results[$i][$ldap_result_location][0] ?? '';
|
$item['location'] = $results[$i][$ldap_result_location][0] ?? '';
|
||||||
$item['locale'] = app()->getLocale();
|
|
||||||
|
|
||||||
// ONLY if you are using the "ldap_location" option *AND* you have an actual result
|
// ONLY if you are using the "ldap_location" option *AND* you have an actual result
|
||||||
if ($ldap_result_location && $item['location']) {
|
if ($ldap_result_location && $item['location']) {
|
||||||
|
@ -252,6 +251,7 @@ class LdapSync extends Command
|
||||||
// Creating a new user.
|
// Creating a new user.
|
||||||
$user = new User;
|
$user = new User;
|
||||||
$user->password = $user->noPassword();
|
$user->password = $user->noPassword();
|
||||||
|
$item['locale'] = app()->getLocale();
|
||||||
$user->activated = 1; // newly created users can log in by default, unless AD's UAC is in use, or an active flag is set (below)
|
$user->activated = 1; // newly created users can log in by default, unless AD's UAC is in use, or an active flag is set (below)
|
||||||
$item['createorupdate'] = 'created';
|
$item['createorupdate'] = 'created';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue