Fixing a bug where isInGroup always returns false when no gid is passed. Now defaults to gid=3.
This commit is contained in:
parent
517fca6410
commit
a249540ebf
1 changed files with 5 additions and 2 deletions
|
|
@ -240,7 +240,7 @@ sub insufficient {
|
|||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 isInGroup ( groupId [ , userId ] )
|
||||
=head2 isInGroup ( [ groupId [ , userId ] ] )
|
||||
|
||||
Returns a boolean (0|1) value signifying that the user has the required privileges. Always returns true for Admins.
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ Returns a boolean (0|1) value signifying that the user has the required privileg
|
|||
|
||||
=item groupId
|
||||
|
||||
The group that you wish to verify against the user.
|
||||
The group that you wish to verify against the user. Defaults to group with Id 3 (the Admin group).
|
||||
|
||||
=item userId
|
||||
|
||||
|
|
@ -263,6 +263,9 @@ sub isInGroup {
|
|||
($gid, $uid) = @_;
|
||||
$uid = $session{user}{userId} if ($uid eq "");
|
||||
|
||||
unless (defined $gid) {
|
||||
$gid = 3;
|
||||
}
|
||||
|
||||
### The following several checks are to increase performance. If this section were removed, everything would continue to work as normal.
|
||||
if ($gid == 7) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue