array('default' => 0))); // // Include preprocessing file // ========================== require $preBasePath.'functions/prepend_adm.php'; $strCommandLine = ' '; $intCount = 0; // // Get database values // =================== if ($chkShow == 1) { $versionfeed = 'http://api.wizonet.ch/nagiosql/versioncheck.php?myversion=' .urlencode($setFileVersion); $strError = ''; if ((isset($SETS['network']['proxy']) && ($SETS['network']['proxy'] == '1')) && (isset($SETS['network']['proxyserver']) && ($SETS['network']['proxyserver'] != ''))) { if ((isset($SETS['network']['proxyuser']) && ($SETS['network']['proxyuser'] != '')) && (isset($SETS['network']['proxypasswd']) && ($SETS['network']['proxypasswd'] != ''))) { $strProxyAuth = base64_encode($SETS['network']['proxyuser']. ':' .$SETS['network']['proxypasswd']); $aContext = array( 'http' => array( 'proxy' => 'tcp://'.$SETS['network']['proxyserver'], 'request_fulluri' => true, 'header' => "Proxy-Authorization: Basic $strProxyAuth", 'timeout' => 1, ), ); } else { $aContext = array( 'http' => array( 'proxy' => 'tcp://'.$SETS['network']['proxyserver'], 'request_fulluri' => true, 'timeout' => 1, ), ); } $intErrorReporting = error_reporting(); error_reporting(0); $cxContext = stream_context_create($aContext); $arrFile = file($versionfeed, false, $cxContext); $arrError = error_get_last(); error_reporting($intErrorReporting); if ($arrError['message'] != '') { $strError .= utf8_encode($arrError['message']). ' (' .translate('check proxy settings'). ')'; } } else { $intErrorReporting = error_reporting(); error_reporting(0); $cxContext = stream_context_create(array('http' => array('timeout' => 1))); $arrFile = file($versionfeed, false, $cxContext); $arrError = error_get_last(); error_reporting($intErrorReporting); if ($arrError['message'] != '') { $strError .= utf8_encode($arrError['message']). ' (' .translate('check proxy settings'). ')'; } } $strInstalled = translate('Installed'); $strAvailable = translate('Available'); $strInformation = translate('Information'); $strVersion = ''; $strRelease = ''; $strRelInfo = ''; if (is_array($arrFile) && count($arrFile) != 0) { foreach ($arrFile as $elem) { if (substr_count($elem, 'version') != 0) { $strVersion = trim(strip_tags($elem)); } if (substr_count($elem, 'release_date') != 0) { $strRelease = trim(strip_tags($elem)); } if (substr_count($elem, 'error') != 0) { $strError = trim(strip_tags($elem)); } if (substr_count($elem, 'information') != 0) { $strRelInfo = trim(strip_tags($elem)); } } } $setFileAvailable = $strVersion; if (version_compare($strVersion, $setFileVersion, '==')) { $setFileInformation = "".translate('You already have the latest version installed'). ''; } elseif (version_compare($strVersion, $setFileVersion, '>=')) { $setFileInformation = "".translate('You are using an old NagiosQL version. Please '. 'update to the latest stable version'). ': '; $setFileInformation .= '' . 'NagiosQL on Sourceforge'; } elseif (version_compare($strVersion, $setFileVersion, '<=')) { $setFileInformation = "".translate('You are using a newer development version '. 'without official support'). ''; } if (($strError != 'none') && ($strError != '')) { $setFileInformation = "".$strError. ''; } ?> Version check
Commandline


Loading...