mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 06:38:00 +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
|
* General purpose file
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/class2.php,v $
|
* $Source: /cvs_backup/e107_0.8/class2.php,v $
|
||||||
* $Revision: 1.118 $
|
* $Revision: 1.119 $
|
||||||
* $Date: 2009-08-03 21:12:44 $
|
* $Date: 2009-08-05 14:18:09 $
|
||||||
* $Author: marj_nl_fr $
|
* $Author: e107coders $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
//
|
//
|
||||||
@@ -1332,10 +1332,23 @@ function getperms($arg, $ap = ADMINPERMS)
|
|||||||
$arg='P'.$row[0];
|
$arg='P'.$row[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (strpos($ap, '.'.$arg.'.') !== false)
|
if (strpos($ap, '.'.$arg.'.') !== false)
|
||||||
{
|
{
|
||||||
return true;
|
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
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user