From 89e4329a8068e3631d3f64f6896fa3907c687cf5 Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Thu, 08 Jan 2015 09:08:50 -0500
Subject: [PATCH] Layout fix: tab toggle and monitor tables

---
 interface/web/admin/system_config_edit.php |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/interface/web/admin/system_config_edit.php b/interface/web/admin/system_config_edit.php
index 3c54fc2..7108f27 100644
--- a/interface/web/admin/system_config_edit.php
+++ b/interface/web/admin/system_config_edit.php
@@ -43,6 +43,7 @@
 
 //* Check permissions for module
 $app->auth->check_module_permissions('admin');
+$app->auth->check_security_permissions('admin_allow_system_config');
 
 // Loading classes
 $app->uses('tpl,tform,tform_actions');
@@ -64,6 +65,9 @@
 			$server_id = $this->id;
 
 			$this->dataRecord = $app->getconf->get_global_config($section);
+			if (is_null($this->dataRecord)) {
+				$this->dataRecord = array();
+			}
 			if ($section == 'domains'){
 				if (isset($this->dataRecord['use_domain_module'])){
 					$_SESSION['use_domain_module_old_value'] = $this->dataRecord['use_domain_module'];
@@ -147,6 +151,12 @@
 			if($check['cnt'] > 0) {
 				$new_config['vhost_subdomains'] = 'y';
 			}
+		} elseif($section == 'sites' && $new_config['vhost_aliasdomains'] != 'y' && $server_config_array['vhost_aliasdomains'] == 'y') {
+			// check for existing vhost aliasdomains, if found the mode cannot be disabled
+			$check = $app->db->queryOneRecord("SELECT COUNT(*) as `cnt` FROM `web_domain` WHERE `type` = 'vhostalias'");
+			if($check['cnt'] > 0) {
+				$new_config['vhost_aliasdomains'] = 'y';
+			}
 		} elseif($section == 'mail') {
 			if($new_config['smtp_pass'] == '') $new_config['smtp_pass'] = $server_config_array['mail']['smtp_pass'];
 		} elseif($section == 'misc' && $new_config['session_timeout'] != $server_config_array['misc']['session_timeout']) {

--
Gitblit v1.9.1