[rt-users] Batch user add to group

Giuseppe Sollazzo gsollazz at sgul.ac.uk
Thu Aug 23 08:06:18 EDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 20/08/12 15:44, Kevin Falcone wrote:
> On Wed, Aug 15, 2012 at 12:12:21PM +0100, Giuseppe Sollazzo wrote:
>
> There is no existing command line utility, but it's mostly a matter of
> a small perl script to load the user, calling SetPrivileged on it and
> then calling AddMember on the relevant group object.
>
> -kevin

Hi Kevin,
I can't find much docs about the use of RT::User especially on RT4. Any
link, if you have it handy?

What I'm trying to do is something like what follows (edit of scripts
found on the wiki):


#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
BEGIN { die "You must define \$RT_HOME\n"
          unless exists $ENV{RT_HOME} };
use lib "$ENV{RT_HOME}/lib";

use RT;

RT::LoadConfig();
RT::Init();

use RT::Interface::CLI qw(GetCurrentUser loc);
use RT::Tickets;

die "We need exactly 2 Arguments, Name & Email\n" unless ($#ARGV==1);

my $UserName=shift @ARGV;
my $Email=shift @ARGV;

my $User = RT::User->new($Email);
*
#my
($id,$Message)=$User->Create(Name=>$UserName,EmailAddress=>$Email,Privileged=>1,Password=>'apassword');*
#if ($id){
#        print $Message."\n";
#        }
#else{
#       print"This is a error!\n$Message\n";
#}

Except I don't want to create a user, I want to load a user from the RT
user database. Is that possible? I've been searching for a couple of
days now without much success...

Thanks,
G

- -- 
____________________________________

Giuseppe Sollazzo
Senior Systems Analyst
Computing Services
Information Services
St. George's, University Of London
Cranmer Terrace
London SW17 0RE

Email: gsollazz at sgul.ac.uk
Direct Dial: +44 20 8725 5160
Fax: +44 20 8725 3583

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJQNhy5AAoJEAqigArPBfJXRDkH/i9YBY2XHDHqB8hZIP/hZXdD
jx+oqJfoxQa2+QtgbZu+24SZ8XPhqcFmAIhxMaJFrSGrMVD34V0JE1IHWq8mCq1v
XFpj19QHwW2vxAQu5DB6CYX2+DuyYDCJ8/RgAnPmT/ZB7y8mNldmpp8IDAxznPZW
+AtxcJFNAhZDsp+vC6/XJdnQwh67c9tzHGI1tpT66soIsu4RppGNiH9GHMmlaGid
xZnNPlDU6HH6516bWMFC2/+CeZPjEEjqJiNwAXguigzGf3l/67GfTCarAOgVfcAR
JO+oOnFIBOvXaLNPLdDoUeJpVm8KOYauydY+IXxhq2Ay80a2VSiEuA8stP9R+5c=
=R4tq
-----END PGP SIGNATURE-----

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120823/37ddf0dc/attachment.htm>


More information about the rt-users mailing list