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

Mike Peachey mike.peachey at jennic.com
Thu Feb 21 07:58:48 EST 2008


Patterson, Craig wrote:
> I'm having a similar issue.  I call $UserObj->Update(....) after setting
> my args.  Is there some type of Commit function I need to call
> afterwards?
> 
> Robert, is this similar to the way you do it?


The problem is almost certainly permissions, and I've suddenly come a 
cropper on it too.

Make this change to your User_Local.pm:

Replace:
         $self->$method($args{$key});

With:
         my ($method_success,$method_msg) = $self->$method($args{$key});
         if (!$method_success) {
             $RT::Logger->debug("$method Failed. $method_msg");
         }

And for each field it can't update it will log a debug message about it.

For me, at the moment, it works with a privileged user because they are 
allowed to edit their user information, but it doesn't work for an 
unprivileged user because they are not.

Since you are calling the Set$method methods on the User Object itself, 
if that user doesn't have permission to change their own details, you 
can't do it.

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->SetDisabled(1);
-- 
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