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

matthew zeier mrz at intelenet.net
Sun Feb 17 17:41:30 EST 2002


> 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.

- mz





More information about the rt-users mailing list