[rt-users] RT3.6.5 / LDAP / User Fields not updated

Mike Peachey mike.peachey at jennic.com
Fri Feb 22 09:25:46 EST 2008


ROBERT David wrote:
> Ahem...
> Sorry if I seem to be rather thickheaded but...
> Where do you want me to put those lines of code? In my User_Local.pm?
 >
>> You can get around it by doing something like this which is to create an 
>> RT::SystemUser object, and then load the user inside it.
>>
>>              my $UserObj = RT::User->new($RT::SystemUser);
>>              $UserObj->Load($name_to_update);
>>              my ($val, $message) = $UserObj->Set$method($value);
> 
> 

Wherever you are actually calling the Set$method or Update on the user 
objects, whether that's inside the modified User_Local.pm, or in your 
own external code.

Replace:

$user->update();

with:

$power_user = RT::User->new($RT::SystemUser);
$power_user->Load($user->Name);
my ($success, $reason) = $power_user->Update/Set$method;
-- 
Kind Regards,

__________________________________________________

Mike Peachey, IT
Tel: +44 114 281 2655
Fax: +44 114 281 2951
Jennic Ltd, Furnival Street, Sheffield, S1 4QT, UK
Comp Reg No: 3191371 - Registered In England
http://www.jennic.com
__________________________________________________



More information about the rt-users mailing list