mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 14:17:49 +02:00
getperms() can now check for multiple perms at once eg. getperms("5|J");
This commit is contained in:
19
class2.php
19
class2.php
@@ -9,9 +9,9 @@
|
||||
* General purpose file
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/class2.php,v $
|
||||
* $Revision: 1.118 $
|
||||
* $Date: 2009-08-03 21:12:44 $
|
||||
* $Author: marj_nl_fr $
|
||||
* $Revision: 1.119 $
|
||||
* $Date: 2009-08-05 14:18:09 $
|
||||
* $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
//
|
||||
@@ -1332,10 +1332,23 @@ function getperms($arg, $ap = ADMINPERMS)
|
||||
$arg='P'.$row[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (strpos($ap, '.'.$arg.'.') !== false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
elseif(strpos($arg,"|")) // check for multiple perms - separated by '|'.
|
||||
{
|
||||
$tmp = explode("|",$arg);
|
||||
foreach($tmp as $val)
|
||||
{
|
||||
if (strpos($ap, '.'.$val.'.') !== false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user