Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
1dc3eb46
Commit
1dc3eb46
authored
Jul 20, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 579797: Restore ValidateGroupName in Bugzilla::Group, because it is
still in use by the whining system r=LpSolit, a=LpSolit
parent
ce4cf086
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
Group.pm
Bugzilla/Group.pm
+33
-0
No files found.
Bugzilla/Group.pm
View file @
1dc3eb46
...
...
@@ -420,6 +420,25 @@ sub create {
return
$group
;
}
sub
ValidateGroupName
{
my
(
$name
,
@users
)
=
(
@_
);
my
$dbh
=
Bugzilla
->
dbh
;
my
$query
=
"SELECT id FROM groups "
.
"WHERE name = ?"
;
if
(
Bugzilla
->
params
->
{
'usevisibilitygroups'
})
{
my
@visible
=
(
-
1
);
foreach
my
$user
(
@users
)
{
$user
&&
push
@visible
,
@
{
$user
->
visible_groups_direct
};
}
my
$visible
=
join
(
', '
,
@visible
);
$query
.=
" AND id IN($visible)"
;
}
my
$sth
=
$dbh
->
prepare
(
$query
);
$sth
->
execute
(
$name
);
my
(
$ret
)
=
$sth
->
fetchrow_array
();
return
$ret
;
}
###############################
### Validators ###
###############################
...
...
@@ -480,6 +499,7 @@ Bugzilla::Group - Bugzilla group class.
my $icon_url = $group->icon_url;
my $is_active_bug_group = $group->is_active_bug_group;
my $group_id = Bugzilla::Group::ValidateGroupName('admin', @users);
my @groups = Bugzilla::Group->get_all;
=head1 DESCRIPTION
...
...
@@ -499,8 +519,21 @@ normally does, this function also makes the new group be inherited
by the C<admin> group. That is, the C<admin> group will automatically
be a member of this group.
=item C<ValidateGroupName($name, @users)>
Description: ValidateGroupName checks to see if ANY of the users
in the provided list of user objects can see the
named group.
Params: $name - String with the group name.
@users - An array with Bugzilla::User objects.
Returns: It returns the group id if successful
and undef otherwise.
=back
=head1 METHODS
=over
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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