Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-9138

Maintenance mode constant ZBX_DENY_GUI_ACCESS does not work the described way

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • 2.5.0
    • 2.2.6, 2.4.2
    • Frontend (F)
    • Zabbix 2.2.6 and 2.4.2, extracted from sources.

      Documentation describes we need to set to 1 the parameter ZBX_DENY_GUI_ACCESS, but setting it to whatever still enables the maintenance mode.

      Parameter Details
      ZBX_DENY_GUI_ACCESS Enable maintenance mode:
      1 – maintenance mode is enabled, disabled otherwise

      A quick patch (2.4.2) to this goes below:

      --- include/classes/core/ZBase.php.orig	2014-12-12 14:56:17.000000000 -0200
      +++ include/classes/core/ZBase.php	2014-12-12 14:56:45.000000000 -0200
      @@ -291,7 +291,7 @@
       	protected function setMaintenanceMode() {
       		require_once $this->getRootDir().'/conf/maintenance.inc.php';
       
      -		if (defined('ZBX_DENY_GUI_ACCESS')) {
      +		if (defined('ZBX_DENY_GUI_ACCESS') and (ZBX_DENY_GUI_ACCESS == 1) ) {
       			$user_ip = (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && !empty($_SERVER['HTTP_X_FORWARDED_FOR']))
       					? $_SERVER['HTTP_X_FORWARDED_FOR']
       					: $_SERVER['REMOTE_ADDR'];
      

            Unassigned Unassigned
            fpaternot Filipe Paternot
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: