adding clarity
This commit is contained in:
parent
b51e210af5
commit
b6fce85c04
1 changed files with 19 additions and 16 deletions
|
|
@ -256,23 +256,26 @@ A boolean value to determine whether the method should return the groups directl
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
||||||
sub getGroupsInGroup {
|
sub getGroupsInGroup {
|
||||||
return undef unless $_[0];
|
my $groupId = shift;
|
||||||
my $groups = WebGUI::SQL->buildArrayRef("select groupId from groupGroupings where inGroup=$_[0]");
|
my $isRecursive = shift;
|
||||||
if ($_[1]) {
|
my $loopCount = shift;
|
||||||
my $loopCount = $_[2]++ || 1;
|
my $groups = WebGUI::SQL->buildArrayRef("select groupId from groupGroupings where inGroup=$groupId");
|
||||||
if ($loopCount > 99) {
|
if ($isRecursive) {
|
||||||
WebGUI::ErrorHandler::fatalError("Endless recursive loop detected while determinating".
|
$loopCount++;
|
||||||
" groups in group.\nRequested groupId: ".$_[0]."\nGroups in that group: ".join(",",@$groups));
|
if ($loopCount > 99) {
|
||||||
}
|
WebGUI::ErrorHandler::fatalError("Endless recursive loop detected while determining".
|
||||||
my @groupsOfGroups = @$groups;
|
" groups in group.\nRequested groupId: ".$groupId."\nGroups in that group: ".join(",",@$groups));
|
||||||
foreach my $group (@$groups) {
|
}
|
||||||
my $gog = getGroupsInGroup($group,1,$loopCount);
|
my @groupsOfGroups = @$groups;
|
||||||
push(@groupsOfGroups, @$gog);
|
foreach my $group (@$groups) {
|
||||||
}
|
my $gog = getGroupsInGroup($group,1,$loopCount);
|
||||||
return \@groupsOfGroups;
|
push(@groupsOfGroups, @$gog);
|
||||||
}
|
}
|
||||||
return $groups;
|
return \@groupsOfGroups;
|
||||||
|
}
|
||||||
|
return $groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue