On Thu, Jan 24, 2008 at 03:29:16PM +0100, Krieg, Alexander wrote:
> Hi,
>
> i just created a script to add existing users to existing groups, that
> works fine.
> I also can create queues, groups and set rights for all of them.
>
> But i cannot create a simple user and find him than over the web-gui, i
> think it cannot be so hard, but i do not see my mistake.
> here the code i use, and i do not get any error messages or warnings.
>
> use lib ("/opt/rt3/local/lib", "/opt/rt3/lib", "/opt/rt3/etc/");
> use warnings;
>
> use RT::User;
> use RT::Group;
> use Getopt::Long;
> use RT::Interface::CLI qw(CleanEnv GetCurrentUser GetMessageContent loc);
>
> CleanEnv();
> RT::LoadConfig();
> RT::Init();
>
> my $user = RT::User->new($RT::SystemUser);
> $user->Create(Name => 'foo',
> EmailAddress => '[EMAIL PROTECTED]',
> Privileged => 1,
> Password => 'foo',
> RealName => 'foo test');
>
> i think it should work !?
>
It looks ok to me (I use some similar code in my scripts), try to catch an
error:
my ($code, $msg) = $user->Create ...
if ( ! $code )
{
print STDERR "Error creating user: $msg\n";
}
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com