From 5eb0d7e8e2aa027906b601672eb6c69bd3c900a4 Mon Sep 17 00:00:00 2001 From: Michael Save Date: Thu, 16 Feb 2012 23:32:28 +1100 Subject: moved hasPermission() to functions.php --- inc/functions.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 3d4b837b..ea050066 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -404,6 +404,26 @@ return $ret; } + function hasPermission($action = null, $board = null, $_mod = null) { + global $config; + + if(isset($_mod)) + $mod = &$_mod; + else + global $mod; + + if(isset($action) && $mod['type'] < $action) + return false; + + if(!isset($board)) + return true; + + if(!$config['mod']['skip_per_board'] && !in_array('*', $mod['boards']) && !in_array($board, $mod['boards'])) + return false; + + return true; + } + function listBoards() { global $config; -- cgit v1.3