Bug 283581 : Move UserInGroup out of globals.pl

Patch by Colin Ogilvie <colin.ogilvie@gmail.com>   r=mkanat  a=justdave


git-svn-id: svn://10.0.0.236/trunk@170734 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
travis%sedsystems.ca
2005-03-15 22:10:14 +00:00
parent 9eba92a5b1
commit 7351a5b76b
27 changed files with 43 additions and 21 deletions

View File

@@ -45,6 +45,7 @@ use Bugzilla::Auth;
use base qw(Exporter);
@Bugzilla::User::EXPORT = qw(insert_new_user is_available_username
login_to_id
UserInGroup
);
################################################################################
@@ -1058,6 +1059,10 @@ sub login_to_id ($) {
}
}
sub UserInGroup ($) {
return defined Bugzilla->user->groups->{$_[0]} ? 1 : 0;
}
1;
__END__
@@ -1335,8 +1340,6 @@ Params: $username (scalar, string) - The full login name of the username
can change his username to $username. (That is, this function
will return a boolean true value).
=back
=item C<login_to_id($login)>
Takes a login name of a Bugzilla user and changes that into a numeric
@@ -1351,6 +1354,12 @@ of a user, but you don't want the full weight of Bugzilla::User.
However, consider using a Bugzilla::User object instead of this function
if you need more information about the user than just their ID.
=item C<UserInGroup($groupname)>
Takes a name of a group, and returns 1 if a user is in the group, 0 otherwise.
=back
=head1 SEE ALSO
L<Bugzilla|Bugzilla>