On 17 Sep 2012, at 22:54, aaronr <[email protected]> wrote: > > I am looking for this same information. > > I found this program from a few years ago, which is supposed to disable a > user: > > --------- > #! /usr/bin/perl -w > > use lib '/srv/www/rt4/lib'; > > > use RT::Base; > use RT::Config; > use RT::User; > > > my $UserId = "sgeadmin"; > my $user = RT::User->new($RT::SystemUser); > $user->Load($UserId); > $user->SetDisabled(); > ---------
It's missing some preamble needed to initialise the RT perl API. Something like this: #! /usr/bin/perl -w use lib '/srv/www/rt4/lib'; use RT; use RT::User; RT::LoadConfig; RT::Init; my $UserId = "sgeadmin"; my $user = RT::User->new($RT::SystemUser); $user->Load($UserId); $user->SetDisabled(); Should work. Tim -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE. -------- Final RT training for 2012 in Atlanta, GA - October 23 & 24 http://bestpractical.com/training We're hiring! http://bestpractical.com/jobs
