Software error:
Can't use string ("wheel") as a HASH ref while "strict refs" in use at /usr/local/share/perl/5.8.7/DBIx/UserDB.pm line 410.
####
New UserDB object created.
The $session ID is:
77540362YTIvQiAaOS7yA942A153i62p32351f159U25f59k22l181r1112198r113k146y85A21O160w104393P643515121S122n190n96A21067w174n66c98l100j95w174e13j125g293123n96B60G9EPZdZYJ4zjW1.
About to enter dispatch code.
$function is NewGroup.
[Thu Feb 2 22:29:32 2006] test-auth5.cgi: Odd number of elements in hash assignment at /var/wwwssl/auth-test/test-auth5.cgi line 379.
GroupCreate received these arguments:
$userdb is DBIx::UserDB=HASH(0x84febec).
The new group name is: wheel.
$group is HASH(0x84fecac).
Creating a new group called: wheel.
ref of group = ref(HASH(0x84fecac))
ref of groupname = ref(wheel)
[Thu Feb 2 22:29:32 2006] test-auth5.cgi: Can't use string ("wheel") as a HASH ref while "strict refs" in use at /usr/local/share/perl/5.8.7/DBIx/UserDB.pm line 410.
####
&GroupCreate($userdb,\%group);
####
sub GroupCreate() {
my($userdb,%group) = @_;
print STDERR "GroupCreate received these arguments: \n\t\$userdb is $userdb. \n\tThe new group name is: $group->{groupname}.\n\t\$group is $group.\n";
return p("Groupname required to create new group.") unless defined($group->{groupname});
my($status,$gid);
print STDERR "Creating a new group called: $group->{groupname}.\n";
print STDERR "\tref of group = ref($group) \n\tref of groupname = ref($groupname) \n";
{
no strict 'refs';
my $result = $userdb->group_create ( $group->{groupname} );
}
if($result) {
$status = p("A New Group, called $group{groupname} has been successfully created, with GID: $group->{'gid
'}.");
} else {
$status = p("The creation of a new Group, called $group{groupname} failed.");
}
return $status;
} # END GroupCreate
####
sub group_create {
my ( $self, $group ) = @_;
my $DB = $self->{DB};
# Check for group with same name
my $old_group = $DB->record_search( $self->{group_profile},
{ groupname => $group->{groupname} }
);
return undef if @$old_group;
$DB->record_insert( $self->{group_profile}, $group );
my $new_group = $DB->record_search( $self->{group_profile},
{ groupname => $group->{groupname} }
);
die "Failed to find newly created group\n" unless @$new_group == 1;
# Copy the fields of the new user back in this one
while ( my ($name,$value) = each %{$new_group->[0]} ) {
$group->{$name} = $value;
}
return $group;
}