Skip to content

A free open source IT asset/license management system

fixes conflicts

Godfrey Md1efca2ae117
diff --cc app/Console/Commands/LdapSync.php
index 136a81f62e,d92bc1023b..c72de8cb72
--- a/app/Console/Commands/LdapSync.php
+++ b/app/Console/Commands/LdapSync.php
@@@ -234,35 -234,17 +234,39 @@@ class LdapSync extends Comman
$item['createorupdate'] = 'created';
}
- $user->first_name = $item['firstname'];
- $user->last_name = $item['lastname'];
+ //If a sync option is not filled in on the LDAP settings don't populate the user field
+ if($ldap_result_username != null){
$user->username = $item['username'];
- $user->email = $item['email'];
+ }
+ if($ldap_result_last_name != null){
+ $user->last_name = $item['lastname'];
+ }
+ if($ldap_result_first_name != null){
+ $user->first_name = $item['firstname'];
+ }
+ if($ldap_result_emp_num != null){
$user->employee_num = e($item['employee_number']);
+ }
+ if($ldap_result_email != null){
+ $user->email = $item['email'];
+ }
+ if($ldap_result_phone != null){
$user->phone = $item['telephone'];
+ }
+ if($ldap_result_jobtitle != null){
$user->jobtitle = $item['jobtitle'];
+ }
+ if($ldap_result_country != null){
$user->country = $item['country'];
+ }
+ if($ldap_result_dept != null){
$user->department_id = $department->id;
+ }
++ if($ldap_result_location != null){
+ $user->location_id = $location ? $location->id : null;
++ }
+
+ if($ldap_result_manager != null){
if($item['manager'] != null) {
// Check Cache first
if (isset($manager_cache[$item['manager']])) {