| | |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public function is_superadmin() { |
| | | if($_SESSION['s']['user']['typ'] == 'admin' && $_SESSION['s']['user']['userid'] === 1) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public function has_clients($userid) { |
| | | global $app, $conf; |
| | | |
| | | $userid = $app->functions->intval($userid); |
| | | $client = $app->db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id"); |
| | | if($client['limit_client'] > 0) { |
| | | if($client['limit_client'] != 0) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | global $app; |
| | | |
| | | $userid = $app->functions->intval($userid); |
| | | if(!preg_match('/^[a-zA-Z0-9\-\_]{1,64}$/',$limitname)) $app->error('Invalid limit name '.$limitname); |
| | | |
| | | // simple query cache |
| | | if($this->client_limits===null) |
| | |
| | | |
| | | public function check_module_permissions($module) { |
| | | // Check if the current user has the permissions to access this module |
| | | if(!stristr($_SESSION["s"]["user"]["modules"], $module)) { |
| | | $user_modules = explode(',',$_SESSION["s"]["user"]["modules"]); |
| | | if(!in_array($module,$user_modules)) { |
| | | // echo "LOGIN_REDIRECT:/index.php"; |
| | | header("Location: /index.php"); |
| | | exit; |