[rt-users] cycling through usernames in RT::Users

darren chamberlain darren at boston.com
Tue Feb 19 17:42:55 EST 2002


Quoting matthew zeier <mrz at intelenet.net> [17 Feb-02 17:46]:
> > matthew zeier wrote:
> > > Does anyone have any code snippet to cycle through all
> > > users in a certain group ?
> >
> > Users->MemberOfGroup() looks like it should do what you want.
> 
> I was hoping to find something more complete than that.  What I
> have right now, which isn't working (I don't get anything on
> dumpValue()):
> 
> use lib "/opt/rt2/lib";
> use lib "/opt/rt2/etc";
> 
> use RT::Interface::CLI  qw(CleanEnv LoadConfig DBConnect
>                GetCurrentUser GetMessageContent);
> 
> CleanEnv();
> LoadConfig();
> DBConnect();
> 
> use RT::Date;
> use RT::Queue;
> use RT::Tickets;
> use RT::Users;
> 
> my $users_obj    = new RT::Users($RT::SystemUser);
> $users_obj->MemberOfGroup('6');
> 
> while (my $user = $users_obj->Next) {
>     dumpValue($user);
> }
> 
> $RT::Handle->Disconnect();
> 
> I don't appear to enter the while() loop.

I think if you ran this under strict you'd find that there is no
dumpValue() defined.

(darren)

-- 
If Jesus Christ were to come today, people would not even crucify
him.  They would ask him to dinner, and hear what he had to say,
and make fun of it.
    -- Thomas Carlyle




More information about the rt-users mailing list