summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-01-31 14:06:36 +0000
committerartem <artem@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2008-01-31 14:06:36 +0000
commit217de40b505ac934176227535eb67e2b5bfdb4c6 (patch)
tree33e338abb5ab292f0e3fb24cfdb263780ff6c325 /frontends/php/include
parentfa96bd3f54454a541668d187d5c028a2a93febbe (diff)
- [DEV-104] added maintenance mode (Artem)
git-svn-id: svn://svn.zabbix.com/trunk@5296 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/config.inc.php22
-rw-r--r--frontends/php/include/defines.inc.php2
2 files changed, 19 insertions, 5 deletions
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index d0226ae7..23646067 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -27,7 +27,8 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!!
require_once "include/defines.inc.php";
require_once "include/html.inc.php";
require_once "include/copt.lib.php";
-
+ require_once "conf/maintenance.inc.php";
+
// GLOBALS
global $USER_DETAILS, $USER_RIGHTS;
@@ -100,8 +101,19 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!!
$ZBX_CONFIGURATION_FILE = realpath(dirname($ZBX_CONFIGURATION_FILE)).'/'.basename($ZBX_CONFIGURATION_FILE);
unset($show_setup);
+
+
+ if(defined('ZBX_DENY_GUI_ACCESS')){
+ if(isset($ZBX_GUI_ACCESS_IP_RANGE) && is_array($ZBX_GUI_ACCESS_IP_RANGE)){
+ $user_ip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']))?($_SERVER['HTTP_X_FORWARDED_FOR']):($_SERVER['REMOTE_ADDR']);
+ if(!str_in_array($user_ip,$ZBX_GUI_ACCESS_IP_RANGE)) $DENY_GUI = TRUE;
+ }
+ else{
+ $DENY_GUI = TRUE;
+ }
+ }
- if(file_exists($ZBX_CONFIGURATION_FILE) && !isset($_COOKIE['ZBX_CONFIG'])){
+ if(file_exists($ZBX_CONFIGURATION_FILE) && !isset($_COOKIE['ZBX_CONFIG']) && !isset($DENY_GUI)){
include $ZBX_CONFIGURATION_FILE;
require_once "include/db.inc.php";
@@ -170,6 +182,11 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!!
}
//*/
+ if(isset($DENY_GUI)){
+ unset($show_warning);
+ include_once "warning.php";
+ }
+
if(isset($show_setup)){
unset($show_setup);
include_once "setup.php";
@@ -191,7 +208,6 @@ function TODO($msg) { echo "TODO: ".$msg.SBR; } // DEBUG INFO!!!
$ZBX_CURRENT_SUBNODES = array();
$ZBX_NODES = array();
-
if(!defined('ZBX_PAGE_NO_AUTHERIZATION') && ZBX_DISTRIBUTED)
{
$ZBX_CURRENT_NODEID = get_cookie('zbx_current_nodeid', $ZBX_LOCALNODEID); // Selected node
diff --git a/frontends/php/include/defines.inc.php b/frontends/php/include/defines.inc.php
index 8bbceb64..77939cd8 100644
--- a/frontends/php/include/defines.inc.php
+++ b/frontends/php/include/defines.inc.php
@@ -494,8 +494,6 @@ if((ini_get('mbstring.func_overload') > 5)){
define('ZBX_HAVE_IPV6', 1);
- global $_GET, $_POST, $_COOKIE, $_REQUEST;
-
/* Support for PHP5. PHP5 does not have $HTTP_..._VARS */
if (!function_exists('version_compare'))
{