[rt-users] RT3.6.5 / LDAP / User Fields not updated
ROBERT David
drobert at generix.fr
Fri Feb 22 06:07:40 EST 2008
Mike,
I changed my User_Local.pm the way you advised. For fields not needing any change, I get lines like this
[Fri Feb 22 11:03:44 2008] [debug]: SetAddress1 Failed. Ceci est déjà la valeur actuelle (/opt/rt3/lib/RT/User_Local.pm:614) (french for "This is already current value")
But when it comes to fields needing an update that's another story:
[Fri Feb 22 11:03:44 2008] [debug]: SetExternalAuthId Failed. Accès refusé (/opt/rt3/lib/RT/User_Local.pm:614) (french for "Acces Denied").
____________________________________________________________________
David ROBERT * Responsable Département IT
Direction Support et Hébergement GENERIX Group
Tel : +33 (0)3 20 41 48 35 * Mob : +33 (0)6 19 73 00 13
Ext : 1835 * drobert at generix.fr
-----Message d'origine-----
De : rt-users-bounces at lists.bestpractical.com [mailto:rt-users-bounces at lists.bestpractical.com] De la part de Mike Peachey
Envoyé : jeudi 21 février 2008 13:59
À : Patterson, Craig; RT Users
Objet : Re: [rt-users] RT3.6.5 / LDAP / User Fields not updated
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
__________________________________________________
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com
Commercial support: sales at bestpractical.com
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com
More information about the rt-users
mailing list