Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
e79d0dbe
Commit
e79d0dbe
authored
Mar 07, 2007
by
Leigh B. Stoller
Browse files
Add method to return subgroup list of a project.
parent
0568e72b
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/Project.pm.in
View file @
e79d0dbe
...
...
@@ -526,5 +526,39 @@ sub DeleteUser($$;$)
return
0
;
}
#
#
List
of
subgroups
for
a
project
member
(
not
including
default
group
).
#
sub
GroupList
($$)
{
my
($
self
,
$
plist
)
=
@
_
;
my
@
grouplist
=
();
#
Must
be
a
real
reference
.
return
-
1
if
(
! (ref($self)));
my
$
pid_idx
=
$
self
->
pid_idx
();
my
$
query_result
=
DBQueryWarn
(
"select gid_idx from groups "
.
"where pid_idx=$pid_idx and pid_idx!=gid_idx"
);
return
-
1
if
(
! $query_result);
return
0
if
(
! $query_result->numrows);
while
(
my
($
idx
)
=
$
query_result
->
fetchrow_array
())
{
my
$
group
=
Group
->
Lookup
($
idx
);
return
-
1
if
(
!defined($group));
push
(@
grouplist
,
$
group
);
}
@$
plist
=
@
grouplist
;
return
0
;
}
#
_Always_
make
sure
that
this
1
is
at
the
end
of
the
file
...
1
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment