X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=rt3%2Fadduserstort.pl;h=dc64899116de64152c63fcd973dec4e7a4f76dff;hb=4b97eb6c50faeeaa40660b73cd70c17cc572a2c9;hp=7037ca60d346a93cf56ef364b67e2c4254f71d04;hpb=12145cbd4358ca9e495bf60c6fffc2a5709ba47d;p=monitor.git diff --git a/rt3/adduserstort.pl b/rt3/adduserstort.pl index 7037ca6..dc64899 100644 --- a/rt3/adduserstort.pl +++ b/rt3/adduserstort.pl @@ -25,8 +25,15 @@ my $organization = ''; my $address1 = ''; my $city = ''; my $country = ''; +my $priv = 0; -open(USERS_DATA, "./users_data.csv") || die("Could not open file!"); +if ( $ARGV[0] =~ /priv/ ) +{ + shift @ARGV; + $priv = 1; +} + +open(USERS_DATA, $ARGV[0]) || die("Could not open file!"); @raw_data=; close(USERS_DATA); foreach $bc_user (@raw_data) @@ -35,12 +42,13 @@ foreach $bc_user (@raw_data) ($email_address,$realname,$organization)=split(/\,/,$bc_user); my $UserObj = new RT::User(RT::SystemUser); + # print "adding user: $email_address\n"; $UserObj->Create(Name => $email_address, RealName => $realname, EmailAddress => $email_address, Password => 'Passw0rd', - Organization => $organization, - Privileged => 1); + Organization => $organization, + Privileged => $priv); #Address1 => $address1, #City => $city, #Country => country,