[Rt-devel] Adding new users in command line
Hamed Malek
hamed at farsiweb.info
Wed Jul 26 12:47:08 EDT 2006
Hello,
I've written a small script that adds new users in command line to RT3,
which run by my other web applications for having central login system.
I put my script in /usr/lib/perl5/vendor_perl/5.8.7/RT and it works
correctly when I run it as root, but running it by Apache or other UNIX
users I get some errors.
Would someone tell me where should I add this file to @INC? or should I
import anything else in my script?
Here is my script:
use RT;
use RT::User;
# Load the RT configuration
RT::LoadConfig();
# Initialise RT
RT::Init();
my $u1 = RT::User->new($RT::SystemUser);
my ($id, $msg) = $u1->Create(Name => $ARGV[0], Password => $ARGV[1],
EmailAddress => $ARGV[2]);
print $msg."\n"
and the error message I get:
Can't locate /etc/rt3/RT_Config.pm in @INC (@INC
contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7
/usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5
/usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3
/usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7
/usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5
/usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3
/usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi
/usr/lib/perl5/5.8.8 .) at /usr/lib/perl5/vendor_perl/5.8.7/RT.pm line
134.
Thanks,
Hamed
More information about the Rt-devel
mailing list