From 25baea76c055433f68b6c2447f543e931099acd9 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Wed, 5 Aug 2009 14:18:09 +0000 Subject: [PATCH] getperms() can now check for multiple perms at once eg. getperms("5|J"); --- class2.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/class2.php b/class2.php index 6157e770d..8523fd670 100644 --- a/class2.php +++ b/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;