From 074a578110cefcd658b1c491491757478bf7907e Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Fri, 17 Oct 2014 09:29:31 -0400
Subject: [PATCH] Fixed: FS#3705 - openvz container wont boot after new mounts added to fstab -Added a new option "Network Filesystem" under System > Server config > Web to toggle on / off the _netdev option for the bind mounts in /etc/fstab

---
 interface/lib/classes/auth.inc.php |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/interface/lib/classes/auth.inc.php b/interface/lib/classes/auth.inc.php
index 5be11cb..70c1722 100644
--- a/interface/lib/classes/auth.inc.php
+++ b/interface/lib/classes/auth.inc.php
@@ -46,7 +46,7 @@
 	}
 	
 	public function is_superadmin() {
-		if($_SESSION['s']['user']['typ'] == 'admin' && $_SESSION['s']['user']['userid'] === 1) {
+		if($_SESSION['s']['user']['typ'] == 'admin' && $_SESSION['s']['user']['userid'] == 1) {
 			return true;
 		} else {
 			return false;
@@ -136,6 +136,22 @@
 			exit;
 		}
 	}
+	
+	public function check_security_permissions($permission) {
+		
+		global $app;
+		
+		$app->uses('getconf');
+		$security_config = $app->getconf->get_security_config('permissions');
+
+		$security_check = false;
+		if($security_config[$permission] == 'yes') $security_check = true;
+		if($security_config[$permission] == 'superadmin' && $app->auth->is_superadmin()) $security_check = true;
+		if($security_check !== true) {
+			$app->error($app->lng('security_check1_txt').' '.$permission.' '.$app->lng('security_check2_txt'));
+		}
+		
+	}
 
 	public function get_random_password($length = 8) {
 		$base64_alphabet='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

--
Gitblit v1.9.1