moved hasPermission() to functions.php

This commit is contained in:
Michael Save 2012-02-16 23:32:28 +11:00
parent 56821eb375
commit 5eb0d7e8e2
2 changed files with 20 additions and 20 deletions

View File

@ -404,6 +404,26 @@
return $ret; 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() { function listBoards() {
global $config; global $config;

View File

@ -25,26 +25,6 @@
return $hash; return $hash;
} }
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 login($username, $password, $makehash=true) { function login($username, $password, $makehash=true) {
global $mod; global $mod;