RStraub wrote:Glad it helped, you are very welcome
Spoke to soon :p
So, I have made the following changes in the custom User.pm file:-
Code: Select all
=item UserAdd()
to add new users
my $UserID = $UserObject->UserAdd(
UserFirstname => 'Huber',
UserLastname => 'Manfred',
UserLogin => 'mhuber',
UserPw => 'some-pass', # not required
UserEmail => 'email@example.com',
UserMobile => '1234567890', # not required
UserMyFieldTelephone => '01234567890', # not required
ValidID => 1,
ChangeUserID => 123,
);
.....
.....
# set user telephone
$Self->SetPreferences(
UserID => $Param{UserID},
Key => 'UserMyFieldTelephone',
Value => $Param{UserMyFieldTelephone} || '',
);
.....
.....
=item UserUpdate()
to update users
$UserObject->UserUpdate(
UserID => 4321,
UserFirstname => 'Huber',
UserLastname => 'Manfred',
UserLogin => 'mhuber',
UserPw => 'some-pass', # not required
UserEmail => 'email@example.com',
UserMobile => '1234567890', # not required
UserMyFieldTelephone => '01234567890', # not required
ValidID => 1,
ChangeUserID => 123,
);
.....
.....
# set user telephone
$Self->SetPreferences(
UserID => $Param{UserID},
Key => 'UserMyFieldTelephone',
Value => $Param{UserMyFieldTelephone} || '',
);
.....
.....
Also I have added the UserMyFieldTelephone field into UserSyncMap as follows:-
Code: Select all
$Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
# DB -> LDAP
UserFirstname => 'givenName',
UserLastname => 'sn',
UserEmail => 'mail',
UserMobile => 'mobile',
UserMyFieldTelephone => 'ipPhone',
};
I have also created an additional field in Agent Preferences to show the UserMyFieldTelephone field in the Preferences section.
Everything syncs perfectly!!.......however, I am seeing the following come up in the apache error log:-
Code: Select all
[Thu Mar 23 09:30:36 2017] -e: Use of uninitialized value $SyncUser{"UserMyFieldTelephone"} in string eq at /opt/otrs//Kernel/System/Auth/Sync/LDAP.pm line 335.
[Thu Mar 23 09:30:36 2017] -e: Use of uninitialized value in string eq at /opt/otrs//Kernel/System/Auth/Sync/LDAP.pm line 335.
[Thu Mar 23 09:30:36 2017] -e: Use of uninitialized value $SyncUser{"UserMobile"} in string eq at /opt/otrs//Kernel/System/Auth/Sync/LDAP.pm line 335.
[Thu Mar 23 09:30:36 2017] -e: Use of uninitialized value in string eq at /opt/otrs//Kernel/System/Auth/Sync/LDAP.pm line 335.
We have a customer control panel that allows users to submit tickets which does involve quite a heavy integration with OTRS via the API. This error only appears when an API call is made, and if I comment out "UserMyFieldTelephone => 'ipPhone'," under UserSyncMap then the error goes away.
Is there anything I could have missed whilst doing this....?
Thank you in advance for your help...