diff --git a/admin.php b/admin.php index b605af6..7ff5f2d 100644 --- a/admin.php +++ b/admin.php @@ -5,42 +5,47 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin main site -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$preRelPath = strstr(filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING), 'admin.php', true); +$preBasePath = strstr(filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING), 'admin.php', true); +// // Define common variables // ======================= -$prePageId = 1; -$preContent = "admin/mainpages.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 1; +$preContent = 'admin/mainpages.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("functions/prepend_adm.php"); -require("functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Include Content // =============== -$conttp->setVariable("TITLE",translate('NagiosQL Administration')); -$conttp->parse("header"); -$conttp->show("header"); -$conttp->setVariable("DESC",translate('Welcome to NagiosQL, the administration module that can be used to easily create, modify and delete configuration files for Nagios. The data is stored in a database and can be written directly to the standard files at any time you want.')); -$conttp->parse("main"); -$conttp->show("main"); +$conttp->setVariable('TITLE', translate('NagiosQL Administration')); +$conttp->parse('header'); +$conttp->show('header'); +$conttp->setVariable('DESC', translate('Welcome to NagiosQL, the administration module that can be used to easily ' + . 'create, modify and delete configuration files for Nagios. The data is stored in a database ' + . 'and can be written directly to the standard files at any time you want.')); +$conttp->parse('main'); +$conttp->show('main'); // // Include footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/administration.php b/admin/administration.php index 30d4fbb..12f35c6 100644 --- a/admin/administration.php +++ b/admin/administration.php @@ -5,39 +5,43 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Administration overview -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 7; -$preContent = "admin/mainpages.tpl.htm"; +$prePageId = 7; +$preContent = 'admin/mainpages.htm.tpl'; // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); +require $preBasePath. 'functions/prepend_adm.php'; // // Include content // =============== -$conttp->setVariable("TITLE",translate('Administration')); -$conttp->parse("header"); -$conttp->show("header"); -$conttp->setVariable("DESC",translate('Functions to administrate NagiosQL V3')); -$conttp->parse("main"); -$conttp->show("main"); +$conttp->setVariable('TITLE', translate('Administration')); +$conttp->parse('header'); +$conttp->show('header'); +$conttp->setVariable('DESC', translate('Functions to administrate NagiosQL V3')); +$conttp->parse('main'); +$conttp->show('main'); // // Include Footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/alarming.php b/admin/alarming.php index 8897e9d..f35dda0 100644 --- a/admin/alarming.php +++ b/admin/alarming.php @@ -5,73 +5,88 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Alarming overview -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 3; -$preContent = "admin/mainpages.tpl.htm"; +$prePageId = 3; +$preContent = 'admin/mainpages.htm.tpl'; // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); +require $preBasePath.'functions/prepend_adm.php'; // // Include content // =============== -$conttp->setVariable("TITLE",translate('Alarming')); -$conttp->parse("header"); -$conttp->show("header"); -$conttp->setVariable("DESC",translate('To define contact data, contact templates and contact groups and time periods.')); -$conttp->setVariable("STATISTICS",translate('Statistical datas')); -$conttp->setVariable("TYPE",translate('Group')); -$conttp->setVariable("ACTIVE",translate('Active')); -$conttp->setVariable("INACTIVE",translate('Inactive')); +$conttp->setVariable('TITLE', translate('Alarming')); +$conttp->setVariable('DESC', translate('To define contact data, contact templates and contact groups and time ' + . 'periods.')); +$conttp->setVariable('STATISTICS', translate('Statistical datas')); +$conttp->setVariable('TYPE', translate('Group')); +$conttp->setVariable('ACTIVE', translate('Active')); +$conttp->setVariable('INACTIVE', translate('Inactive')); // // Include statistical data // ======================== // Get read access groups -$strAccess = $myVisClass->getAccGroups('read'); -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=14")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Contact data')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM tbl_contact WHERE active='1' AND config_id=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM tbl_contact WHERE active='0' AND config_id=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +$strAccess = $myVisClass->getAccessGroups('read'); +$intGroupId14 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=14'); +$intGroupId15 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=15'); +$intGroupId16 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=16'); +$intGroupId17 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=17'); +if ($myVisClass->checkAccountGroup($intGroupId14, 'read') == 0) { + $conttp->setVariable('NAME', translate('Contact data')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_contact` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_contact` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=15")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Contact groups')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM tbl_contactgroup WHERE active='1' AND config_id=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM tbl_contactgroup WHERE active='0' AND config_id=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intGroupId15, 'read') == 0) { + $conttp->setVariable('NAME', translate('Contact groups')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_contactgroup` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_contactgroup` ' + . "WHERE active='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=16")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Time periods')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM tbl_timeperiod WHERE active='1' AND config_id=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM tbl_timeperiod WHERE active='0' AND config_id=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intGroupId16, 'read') == 0) { + $conttp->setVariable('NAME', translate('Time periods')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_timeperiod` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_timeperiod` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=17")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Contact templates')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM tbl_contacttemplate WHERE active='1' AND config_id=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM tbl_contacttemplate WHERE active='0' AND config_id=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intGroupId17, 'read') == 0) { + $conttp->setVariable('NAME', translate('Contact templates')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_contacttemplate` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_contacttemplate` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -$conttp->parse("statistics"); -$conttp->parse("main"); -$conttp->show("main"); +$conttp->parse('statistics'); +$conttp->parse('main'); +$conttp->show('main'); // // Include Footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/cgicfg.php b/admin/cgicfg.php index 55abf97..ff6b214 100644 --- a/admin/cgicfg.php +++ b/admin/cgicfg.php @@ -5,149 +5,162 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : File editor cgi.cfg -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 29; -$preContent = "admin/nagioscfg.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; -$intRemoveTmp = 0; -$strConfig = ""; +$prePageId = 29; +$preContent = 'admin/nagioscfg.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; +$intRemoveTmp = 0; +$strConfig = ''; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Get configuration set ID // ======================== -$arrConfigSet = $myConfigClass->getConfigSets(); +$myConfigClass->getConfigTargets($arrConfigSet); $intConfigId = $arrConfigSet[0]; -$myConfigClass->getConfigData($intConfigId,"method",$intMethod); -$myConfigClass->getConfigData($intConfigId,"nagiosbasedir",$strBaseDir); -$strConfigfile = str_replace("//","/",$strBaseDir."/cgi.cfg"); -$strLocalBackup = str_replace("//","/",$strBaseDir."/cgi.cfg_old_").date("YmdHis",time()); +$myConfigClass->getConfigValues($intConfigId, 'method', $intMethod); +$myConfigClass->getConfigValues($intConfigId, 'nagiosbasedir', $strBaseDir); +$strConfigfile = str_replace('//', '/', $strBaseDir. '/cgi.cfg'); +$strLocalBackup = str_replace('//', '/', $strBaseDir. '/cgi.cfg_old_').date('YmdHis'); // -// Convert Windows to UNIX +// Convert Windows to UNIX // ======================= -$chkTaFileText = str_replace("\r\n","\n",$chkTaFileText); +$chkTaFileText = str_replace("\r\n", "\n", $chkTaFileText); // // Process data // ============ -if ($chkTaFileText != "") { - if ($intMethod == 1) { - if (file_exists($strBaseDir) && (is_writable($strBaseDir) && (is_writable($strConfigfile)))) { - // Backup config file - $intReturn = $myConfigClass->moveFile("nagiosbasic","cgi.cfg",$intConfigId); - if ($intReturn == 1) { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } - // Write configuration - $resFile = fopen($strConfigfile,"w"); - fputs($resFile,$chkTaFileText); - fclose($resFile); - $myVisClass->processMessage("".translate('Configuration file successfully written!')."",$strInfoMessage); - $myDataClass->writeLog(translate('Configuration successfully written:')." ".$strConfigfile); - } else { - $myVisClass->processMessage(translate('Cannot open/overwrite the configuration file (check the permissions)!'),$strErrorMessage); - $myDataClass->writeLog(translate('Configuration write failed:')." ".$strConfigfile); - } - } else if (($intMethod == 2) || ($intMethod == 3)) { - // Backup config file - $intReturn = $myConfigClass->moveFile("nagiosbasic","cgi.cfg",$intConfigId); - if ($intReturn == 1) { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } - // Write file to temporary - $strFileName = tempnam($_SESSION['SETS']['path']['tempdir'], 'nagiosql_cgi'); - $resFile = fopen($strFileName,"w"); - fputs($resFile,$chkTaFileText); - fclose($resFile); - // Copy configuration to remoty system - $intReturn = $myConfigClass->configCopy($strConfigfile,$intConfigId,$strFileName,1); - if ($intReturn == 0) { - $myVisClass->processMessage("".translate('Configuration file successfully written!')."",$strInfoMessage); - $myDataClass->writeLog(translate('Configuration successfully written:')." ".$strConfigfile); - unlink($strFileName); - } else { - $myVisClass->processMessage(translate('Cannot open/overwrite the configuration file (check the permissions on remote system)!'),$strErrorMessage); - $myDataClass->writeLog(translate('Configuration write failed (remote):')." ".$strConfigfile); - unlink($strFileName); - } - } +if (($chkTaFileText != '') && ($arrConfigSet[0] != 0)) { + if ($intMethod == 1) { + if (file_exists($strBaseDir) && (is_writable($strBaseDir) && is_writable($strConfigfile))) { + // Backup config file + $intReturn = $myConfigClass->moveFile('nagiosbasic', 'cgi.cfg', $intConfigId); + if ($intReturn == 1) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + // Write configuration + $resFile = fopen($strConfigfile, 'wb'); + fwrite($resFile, $chkTaFileText); + fclose($resFile); + $myVisClass->processMessage('' .translate('Configuration file successfully ' + . 'written!'). '', $strInfoMessage); + $myDataClass->writeLog(translate('Configuration successfully written:'). ' ' .$strConfigfile); + } else { + $myVisClass->processMessage(translate('Cannot open/overwrite the configuration file (check the ' + . 'permissions)!'), $strErrorMessage); + $myDataClass->writeLog(translate('Configuration write failed:'). ' ' .$strConfigfile); + } + } elseif (($intMethod == 2) || ($intMethod == 3)) { + // Backup config file + $intReturn1 = $myConfigClass->moveFile('nagiosbasic', 'cgi.cfg', $intConfigId); + if ($intReturn1 == 1) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + // Write file to temporary + $strFileName = tempnam($_SESSION['SETS']['path']['tempdir'], 'nagiosql_cgi'); + $resFile = fopen($strFileName, 'wb'); + fwrite($resFile, $chkTaFileText); + fclose($resFile); + // Copy configuration to remoty system + $intReturn2 = $myConfigClass->remoteFileCopy($strConfigfile, $intConfigId, $strFileName, 1); + if ($intReturn2 == 0) { + $myVisClass->processMessage('' .translate('Configuration file successfully ' + . 'written!'). '', $strInfoMessage); + $myDataClass->writeLog(translate('Configuration successfully written:'). ' ' .$strConfigfile); + unlink($strFileName); + } else { + $myVisClass->processMessage(translate('Cannot open/overwrite the configuration file (check the permissions ' + . 'on remote system)!'), $strErrorMessage); + $myDataClass->writeLog(translate('Configuration write failed (remote):'). ' ' .$strConfigfile); + unlink($strFileName); + } + } +} elseif ($arrConfigSet[0] == 0) { + $myVisClass->processMessage(translate('There are no nagios configuration files in common domain, please select a '. + 'valid domain to edit this files!'), $strErrorMessage); } // // Include content // =============== -$conttp->setVariable("TITLE",translate('CGI configuration file')); -$conttp->parse("header"); -$conttp->show("header"); -// -// Include input form -// =================== -$conttp->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); -$conttp->setVariable("MAINSITE",$_SESSION['SETS']['path']['base_url']."admin.php"); -foreach($arrDescription AS $elem) { - $conttp->setVariable($elem['name'],$elem['string']); -} +$conttp->setVariable('TITLE', translate('CGI configuration file')); +$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$conttp->setVariable('MAINSITE', $_SESSION['SETS']['path']['base_url']. 'admin.php'); +foreach ($arrDescription as $elem) { + $conttp->setVariable($elem['name'], $elem['string']); +} // // Open configuration // ================== if ($intMethod == 1) { - if (file_exists($strConfigfile) && is_readable($strConfigfile)) { - $resFile = fopen($strConfigfile,"r"); - if ($resFile) { - while(!feof($resFile)) { - $strConfig .= fgets($resFile,1024); - } - } - } else { - $myVisClass->processMessage(translate('Cannot open the data file (check the permissions)!'),$strErrorMessage); - } -} else if (($intMethod == 2) || ($intMethod == 3)) { - // Write file to temporary - $strFileName = tempnam($_SESSION['SETS']['path']['tempdir'], 'nagiosql_cgi'); - // Copy configuration from remoty system - $intReturn = $myConfigClass->configCopy($strConfigfile,$intConfigId,$strFileName,0); - if ($intReturn == 0) { - $resFile = fopen($strFileName,"r"); - if (is_resource($resFile)) { - while(!feof($resFile)) { - $strConfig .= fgets($resFile,1024); - } - unlink($strFileName); - } else { - $myVisClass->processMessage(translate('Cannot open the temporary file'),$strErrorMessage); - } - } else { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - $myDataClass->writeLog(translate('Configuration read failed (remote):')." ".$strErrorMessage); - if (file_exists($strFileName)) unlink($strFileName); - } + if (file_exists($strConfigfile) && is_readable($strConfigfile)) { + $resFile = fopen($strConfigfile, 'rb'); + if ($resFile) { + while (!feof($resFile)) { + $strConfig .= fgets($resFile, 1024); + } + } + } else { + $myVisClass->processMessage(translate('Cannot open the data file (check the permissions)!'), $strErrorMessage); + } +} elseif (($intMethod == 2) || ($intMethod == 3)) { + // Write file to temporary + $strFileName = tempnam($_SESSION['SETS']['path']['tempdir'], 'nagiosql_cgi'); + // Copy configuration from remoty system + $myConfigClass->strErrorMessage = ''; + $intReturn = $myConfigClass->remoteFileCopy($strConfigfile, $intConfigId, $strFileName, 0); + if ($intReturn == 0) { + $resFile = fopen($strFileName, 'rb'); + if (is_resource($resFile)) { + while (!feof($resFile)) { + $strConfig .= fgets($resFile, 1024); + } + unlink($strFileName); + } else { + $myVisClass->processMessage(translate('Cannot open the temporary file'), $strErrorMessage); + } + } else { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + $myDataClass->writeLog(translate('Configuration read failed (remote):'). ' ' .$strErrorMessage); + if (file_exists($strFileName)) { + unlink($strFileName); + } + } } -$conttp->setVariable("DAT_NAGIOS_CONFIG",$strConfig); -if ($strErrorMessage != "") $conttp->setVariable("ERRORMESSAGE",$strErrorMessage); -$conttp->setVariable("INFOMESSAGE",$strInfoMessage); +$conttp->setVariable('DAT_NAGIOS_CONFIG', $strConfig); +if ($strErrorMessage != '') { + $conttp->setVariable('ERRORMESSAGE', $strErrorMessage); +} +$conttp->setVariable('INFOMESSAGE', $strInfoMessage); // Check access rights for adding new objects -if ($myVisClass->checkAccGroup($prePageKey,'write') != 0) $conttp->setVariable("ADD_CONTROL","disabled=\"disabled\""); -$conttp->parse("naginsert"); -$conttp->show("naginsert"); +if ($myVisClass->checkAccountGroup($prePageKey, 'write') != 0) { + $conttp->setVariable('ADD_CONTROL', 'disabled="disabled"'); +} +$conttp->parse('naginsert'); +$conttp->show('naginsert'); // // Process footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/checkcommands.php b/admin/checkcommands.php index 25a1eef..69ca44a 100644 --- a/admin/checkcommands.php +++ b/admin/checkcommands.php @@ -5,148 +5,192 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Command definitions -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 18; -$preContent = "admin/checkcommands.tpl.htm"; -$preSearchSession = 'checkcommand'; -$preTableName = 'tbl_command'; -$preKeyField = 'command_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 18; +$preContent = 'admin/checkcommands.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'checkcommand'; +$preTableName = 'tbl_command'; +$preKeyField = 'command_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); -// +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `command_line`='$chkTfValue2', `command_type`=$chkSelValue1, $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && ($chkTfValue2 != "")) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New command inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Command modified:')." ".$chkTfValue1); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `command_line`='$chkTfValue2', " + . "`command_type`=$chkSelValue1, $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && ($chkTfValue2 != '')) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New command inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Command modified:'). ' ' .$chkTfValue1); + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Command definitions')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion != 3) $conttp->setVariable("VERSION_20_VALUE_MUST","mselValue1,"); - $conttp->setVariable("NO_TYPE",translate('unclassified')); - $conttp->setVariable("CHECK_TYPE",translate('check command')); - $conttp->setVariable("MISC_TYPE",translate('misc command')); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo); - // Insert command type - if ($arrModifyData['command_type'] == 1) {$conttp->setVariable("CHECK_TYPE_SELECTED","selected");} - if ($arrModifyData['command_type'] == 2) {$conttp->setVariable("MISC_TYPE_SELECTED","selected");} - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + // Do not show modified time list + $intNoTime = 1; + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion < 3) { + $conttp->setVariable('VERSION_20_VALUE_MUST', 'mselValue1,'); + } + $conttp->setVariable('TITLE', translate('Command definitions')); + $conttp->setVariable('NO_TYPE', translate('unclassified')); + $conttp->setVariable('CHECK_TYPE', translate('check command')); + $conttp->setVariable('MISC_TYPE', translate('misc command')); + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo); + // Insert command type + if ($arrModifyData['command_type'] == 1) { + $conttp->setVariable('CHECK_TYPE_SELECTED', 'selected'); + } + if ($arrModifyData['command_type'] == 2) { + $conttp->setVariable('MISC_TYPE_SELECTED', 'selected'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Command name')); - $mastertp->setVariable("FIELD_2",translate('Command line')); - // Process search string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `command_line` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `command_line` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:')); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `command_line`, `register`, `active`, `config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere - AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:')); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'command_line',40); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Command definitions')); + $mastertp->setVariable('FIELD_1', translate('Command name')); + $mastertp->setVariable('FIELD_2', translate('Command line')); + // Process search string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' " + . "OR `command_line` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `command_line` $hidSortDir"; + } + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` " + . "WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `id`, `$preKeyField`, `command_line`, `register`, `active`, `config_id`, `access_group` " + . "FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere " + . "AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'command_line', 40); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/commandline.php b/admin/commandline.php index 7bc4995..2ea41f0 100644 --- a/admin/commandline.php +++ b/admin/commandline.php @@ -5,82 +5,86 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Command line visualization -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$preNoMain = 1; +$preNoMain = 1; // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); -$strCommandLine = " "; -$intCount = 0; +require $preBasePath. 'functions/prepend_adm.php'; +$strCommandLine = ' '; +$intCount = 0; // // Get database values // =================== -if (isset($_GET['cname']) && ($_GET['cname'] != "")) { - $strResult = $myDBClass->getFieldData("SELECT command_line FROM tbl_command WHERE id='".filter_var($_GET['cname'], FILTER_SANITIZE_NUMBER_INT)."'"); - if (($strResult != false) && ($strResult != "")) { - $strCommandLine = $strResult; - $intCount = substr_count($strCommandLine,"ARG"); - if (substr_count($strCommandLine,"ARG8") != 0) { - $intCount = 8; - } else if (substr_count($strCommandLine,"ARG7") != 0) { - $intCount = 7; - } else if (substr_count($strCommandLine,"ARG6") != 0) { - $intCount = 6; - } else if (substr_count($strCommandLine,"ARG5") != 0) { - $intCount = 5; - } else if (substr_count($strCommandLine,"ARG4") != 0) { - $intCount = 4; - } else if (substr_count($strCommandLine,"ARG3") != 0) { - $intCount = 3; - } else if (substr_count($strCommandLine,"ARG2") != 0) { - $intCount = 2; - } else if (substr_count($strCommandLine,"ARG1") != 0) { - $intCount = 1; - } else { - $intCount = 0; - } - - } +if (isset($_GET['cname']) && ($_GET['cname'] != '')) { + $strResult = $myDBClass->getFieldData("SELECT command_line FROM tbl_command WHERE id='". + filter_var($_GET['cname'], FILTER_SANITIZE_NUMBER_INT)."'"); + if (($strResult != false) && ($strResult != '')) { + $strCommandLine = $strResult; + $intCount = substr_count($strCommandLine, 'ARG'); + if (substr_count($strCommandLine, 'ARG8') != 0) { + $intCount = 8; + } elseif (substr_count($strCommandLine, 'ARG7') != 0) { + $intCount = 7; + } elseif (substr_count($strCommandLine, 'ARG6') != 0) { + $intCount = 6; + } elseif (substr_count($strCommandLine, 'ARG5') != 0) { + $intCount = 5; + } elseif (substr_count($strCommandLine, 'ARG4') != 0) { + $intCount = 4; + } elseif (substr_count($strCommandLine, 'ARG3') != 0) { + $intCount = 3; + } elseif (substr_count($strCommandLine, 'ARG2') != 0) { + $intCount = 2; + } elseif (substr_count($strCommandLine, 'ARG1') != 0) { + $intCount = 1; + } else { + $intCount = 0; + } + } } ?> - - Commandline - - - - - - - + + Commandline + + + + + + + \ No newline at end of file diff --git a/admin/commands.php b/admin/commands.php index 5c90b88..e5a1702 100644 --- a/admin/commands.php +++ b/admin/commands.php @@ -5,55 +5,61 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Commands overview -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 4; -$preContent = "admin/mainpages.tpl.htm"; +$prePageId = 4; +$preContent = 'admin/mainpages.htm.tpl'; // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); +require $preBasePath.'functions/prepend_adm.php'; // // Include content // =============== -$conttp->setVariable("TITLE",translate('Check commands')); -$conttp->parse("header"); -$conttp->show("header"); -$conttp->setVariable("DESC",translate('To define check and misc commands, notification commands and special commands.')); -$conttp->setVariable("STATISTICS",translate('Statistical datas')); -$conttp->setVariable("TYPE",translate('Group')); -$conttp->setVariable("ACTIVE",translate('Active')); -$conttp->setVariable("INACTIVE",translate('Inactive')); +$conttp->setVariable('TITLE', translate('Check commands')); +$conttp->setVariable('DESC', translate('To define check and misc commands, notification commands and special ' + . 'commands.')); +$conttp->setVariable('STATISTICS', translate('Statistical datas')); +$conttp->setVariable('TYPE', translate('Group')); +$conttp->setVariable('ACTIVE', translate('Active')); +$conttp->setVariable('INACTIVE', translate('Inactive')); // // Include statistical data // ======================== // Get read access groups -$strAccess = $myVisClass->getAccGroups('read'); -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=18")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Check commands')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM tbl_command WHERE active='1' AND config_id=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM tbl_command WHERE active='0' AND config_id=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +$strAccess = $myVisClass->getAccessGroups('read'); +$intGroupId = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=18'); +if ($myVisClass->checkAccountGroup($intGroupId, 'read') == 0) { + $conttp->setVariable('NAME', translate('Check commands')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_command` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_command` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -$conttp->parse("statistics"); -$conttp->parse("main"); -$conttp->show("main"); +$conttp->parse('statistics'); +$conttp->parse('main'); +$conttp->show('main'); // // Include Footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/configtargets.php b/admin/configtargets.php index 8f29968..409e069 100644 --- a/admin/configtargets.php +++ b/admin/configtargets.php @@ -5,33 +5,38 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin configuration target administration -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 36; -$preContent = "admin/configtargets.tpl.htm"; -$preTableName = 'tbl_configtarget'; -$preKeyField = 'target'; -$preAccess = 1; -$preFieldvars = 1; -$intIsError = 0; -$strPathMessage = ""; +$prePageId = 36; +$preContent = 'admin/configtargets.htm.tpl'; +$preListTpl = 'admin/datalist_common.htm.tpl'; +$preTableName = 'tbl_configtarget'; +$preKeyField = 'target'; +$preAccess = 1; +$preFieldvars = 1; +$intIsError = 0; +$strPathMessage = ''; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Process path values (add slashes) // ================================= @@ -47,241 +52,295 @@ $chkTfValue16 = $myVisClass->addSlash($chkTfValue16); // // Check if the permissions and other parameters // ============================================= -if (($chkModus == "modify" || $chkModus == "insert")) { - if ($chkDataId != 0) { - if ($chkSelValue1 == 1) { - $arrPaths = array($chkTfValue8,$chkTfValue9,$chkTfValue10,$chkTfValue11,$chkTfValue12,$chkTfValue13); - foreach ($arrPaths AS $elem) { - if (!$myConfigClass->dir_is_writable($elem)) { - $myVisClass->processMessage($elem." ".translate("is not writeable"),$strPathMessage); - $intIsError = 1; - } - } - // Nagios base configuration files - if (!is_writable($chkTfValue20)) { - $myVisClass->processMessage(str_replace(" "," ",translate("Nagios config file")." ".$chkTfValue20." ".translate("is not writeable")),$strPathMessage); - $intIsError = 1; - } else { - $intCheck = 0; - if (file_exists($chkTfValue20) && is_readable($chkTfValue20)) { - $resFile = fopen($chkTfValue20,'r'); - while (!feof($resFile)) { - $strLine = trim(fgets($resFile)); - if ((substr_count($strLine,'cfg_dir') != 0) || (substr_count($strLine,'cfg_file') != 0)) { - $intCheck = 1; - } - } - fclose($resFile); - } - if ($intCheck == 0) { - $myVisClass->processMessage(str_replace(" "," ",translate("Nagios config file")." ".$chkTfValue20." ".translate("is not a valid configuration file!")),$strPathMessage); - $intIsError = 1; - } - } - if (!is_writable($chkTfValue14."cgi.cfg")) { - $myVisClass->processMessage(str_replace(" "," ",translate("Cgi config file")." ".$chkTfValue14."cgi.cfg"." ".translate("is not writeable")),$strPathMessage); - $intIsError = 1; - } - - } - // Check SSH Method - if (($chkSelValue1 == 3) && !function_exists('ssh2_connect')) { - $myVisClass->processMessage(translate('SSH module not loaded!'),$strPathMessage); - $intIsError = 1; - } - // Check FTP Method - if (($chkSelValue1 == 2) && !function_exists('ftp_connect')) { - $myVisClass->processMessage(translate('FTP module not loaded!'),$strPathMessage); - $intIsError = 1; - } - if ($intIsError == 1) { - $chkModus = "add"; - $chkSelModify = "errormodify"; - } - } +if (($chkModus == 'modify' || $chkModus == 'insert') && $chkDataId != 0) { + if ($chkSelValue1 == 1) { + $arrPaths = array($chkTfValue8,$chkTfValue9,$chkTfValue10,$chkTfValue11,$chkTfValue12,$chkTfValue13); + foreach ($arrPaths as $elem) { + if ($myConfigClass->isDirWriteable($elem) == 1) { + $myVisClass->processMessage($elem. ' ' .translate('is not writeable'), $strPathMessage); + $intIsError = 1; + } + } + // Nagios base configuration files + if (!is_writable($chkTfValue20)) { + $myVisClass->processMessage(str_replace(' ', ' ', translate('Nagios config file'). ' ' .$chkTfValue20 + . ' ' .translate('is not writeable')), $strPathMessage); + $intIsError = 1; + } else { + $intCheck = 0; + if (file_exists($chkTfValue20) && is_readable($chkTfValue20)) { + $resFile = fopen($chkTfValue20, 'rb'); + while (!feof($resFile)) { + $strLine = trim(fgets($resFile)); + if ((substr_count($strLine, 'cfg_dir') != 0) || (substr_count($strLine, 'cfg_file') != 0)) { + $intCheck = 1; + } + } + fclose($resFile); + } + if ($intCheck == 0) { + $myVisClass->processMessage(str_replace(' ', ' ', translate('Nagios config file'). ' ' . + $chkTfValue20. ' ' .translate('is not a valid configuration file!')), $strPathMessage); + $intIsError = 1; + } + } + if (!is_writable($chkTfValue14)) { + $myVisClass->processMessage(str_replace(' ', ' ', translate('Nagios base directory'). ' ' . + $chkTfValue14. ' ' .translate('is not writeable')), $strPathMessage); + $intIsError = 1; + } + if (!is_writable($chkTfValue21)) { + $myVisClass->processMessage(str_replace(' ', ' ', translate('Nagios cgi config file'). ' ' . + $chkTfValue21. ' ' .translate('is not writeable')), $strPathMessage); + $intIsError = 1; + } + if (!is_readable($chkTfValue22)) { + $myVisClass->processMessage(str_replace(' ', ' ', translate('Nagios resource config file'). ' ' . + $chkTfValue22. ' ' .translate('is not readable')), $strPathMessage); + $intIsError = 1; + } + } + // Check SSH Method + if (($chkSelValue1 == 3) && !function_exists('ssh2_connect')) { + $myVisClass->processMessage(translate('SSH module not loaded!'), $strPathMessage); + $intIsError = 1; + } + // Check FTP Method + if (($chkSelValue1 == 2) && !function_exists('ftp_connect')) { + $myVisClass->processMessage(translate('FTP module not loaded!'), $strPathMessage); + $intIsError = 1; + } + if ($intIsError == 1) { + $chkModus = 'add'; + $chkSelModify = 'errormodify'; + } } -// +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `server`='$chkTfValue4', `method`='$chkSelValue1', - `user`='$chkTfValue5', `password`='$chkTfValue6', `ssh_key_path`='$chkTfValue7', `basedir`='$chkTfValue8', - `hostconfig`='$chkTfValue9', `serviceconfig`='$chkTfValue10', `backupdir`='$chkTfValue11', - `hostbackup`='$chkTfValue12', `servicebackup`='$chkTfValue13', `nagiosbasedir`='$chkTfValue14', - `importdir`='$chkTfValue15', `picturedir`='$chkTfValue16', `commandfile`='$chkTfValue17', - `binaryfile`='$chkTfValue18', `pidfile`='$chkTfValue19', `conffile`='$chkTfValue20', `version`=$chkSelValue2, - `access_group`=$chkSelAccGr, `active`='$chkActive', - `last_modified`=NOW()"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && ($chkTfValue2 != "") && (($chkTfValue4 != "") || ($chkDataId == 0))) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New Domain inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Domain modified:')." ".$chkTfValue1); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `server`='$chkTfValue4', " + . "`method`='$chkSelValue1', `user`='$chkTfValue5', `password`='$chkTfValue6', " + . "`ssh_key_path`='$chkTfValue7', `ftp_secure`=$chkChbValue1, `basedir`='$chkTfValue8', " + . "`hostconfig`='$chkTfValue9', `serviceconfig`='$chkTfValue10', `backupdir`='$chkTfValue11', " + . "`hostbackup`='$chkTfValue12', `servicebackup`='$chkTfValue13', `nagiosbasedir`='$chkTfValue14', " + . "`importdir`='$chkTfValue15', `picturedir`='$chkTfValue16', `commandfile`='$chkTfValue17', " + . "`binaryfile`='$chkTfValue18', `pidfile`='$chkTfValue19', `conffile`='$chkTfValue20', " + . "`cgifile`='$chkTfValue21', `resourcefile`='$chkTfValue22',`version`=$chkSelValue2, " + . "`access_group`=$chkSelAccGr, `active`='$chkActive',`last_modified`=NOW()"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && ($chkTfValue2 != '') && (($chkTfValue4 != '') || ($chkDataId == 0))) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New Domain inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Domain modified:'). ' ' .$chkTfValue1); + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Configuration domain administration')); -if ($intIsError == 1) $conttp->setVariable("PATHMESSAGE","

".translate("Warning, at least one error occured, please check!")."

".$strPathMessage); -$conttp->parse("header"); -$conttp->show("header"); // // Single view // =========== -if ($chkModus == "add") { - // Process acces group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - $conttp->setVariable("CLASS_NAME_1","elementHide"); - $conttp->setVariable("CLASS_NAME_2","elementHide"); - $conttp->setVariable("FILL_ALLFIELDS",translate('Please fill in all fields marked with an *')); - $conttp->setVariable("FILL_ILLEGALCHARS",translate('The following field contains not permitted characters:')); - // Insert data from database in "modify" mode - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,0,''); - // Connection method - if ($arrModifyData['method'] == 1) $conttp->setVariable("FILE_SELECTED","selected"); - if ($arrModifyData['method'] == 2) { - $conttp->setVariable("FTP_SELECTED","selected"); - $conttp->setVariable("CLASS_NAME_1","elementShow"); - } - if ($arrModifyData['method'] == 3) { - $conttp->setVariable("SFTP_SELECTED","selected"); - $conttp->setVariable("CLASS_NAME_1","elementShow"); - $conttp->setVariable("CLASS_NAME_2","elementShow"); - } - // Nagios version - if ($arrModifyData['version'] == 1) $conttp->setVariable("VER_SELECTED_1","selected"); - if ($arrModifyData['version'] == 2) $conttp->setVariable("VER_SELECTED_2","selected"); - if ($arrModifyData['version'] == 3) $conttp->setVariable("VER_SELECTED_3","selected"); - // Domain localhost cant' be renamed - if ($arrModifyData[$preKeyField] == "localhost") { - $conttp->setVariable("DOMAIN_DISABLE","readonly"); - $conttp->setVariable("LOCKCLASS","inputlock"); - } else if ($arrModifyData[$preKeyField] == "common") { - $conttp->setVariable("DOMAIN_DISABLE","readonly"); - $conttp->setVariable("COMMON_INVISIBLE","class=\"elementHide\""); - $conttp->setVariable("LOCKCLASS","inputlock"); - } - } - if ($chkSelModify == "errormodify") { - $conttp->setVariable("DAT_TARGET",$chkTfValue1); - // Domain localhost cant' be renamed - if ($chkTfValue1 == "localhost") { - $conttp->setVariable("DOMAIN_DISABLE","readonly"); - $conttp->setVariable("LOCKCLASS","inputlock"); - } else if ($chkTfValue1 == "common") { - $conttp->setVariable("DOMAIN_DISABLE","readonly"); - $conttp->setVariable("COMMON_INVISIBLE","class=\"elementHide\""); - $conttp->setVariable("LOCKCLASS","inputlock"); - } else { - $conttp->setVariable("LOCKCLASS","inpmust"); - } - $conttp->setVariable("DAT_ALIAS",$chkTfValue2); - $conttp->setVariable("DAT_SERVER",$chkTfValue4); - // Connection method - if ($chkSelValue1 == 1) $conttp->setVariable("FILE_SELECTED","selected"); - if ($chkSelValue1 == 2) { - $conttp->setVariable("FTP_SELECTED","selected"); - $conttp->setVariable("CLASS_NAME_1","elementShow"); - } - if ($chkSelValue1 == 3) { - $conttp->setVariable("SFTP_SELECTED","selected"); - $conttp->setVariable("CLASS_NAME_1","elementShow"); - $conttp->setVariable("CLASS_NAME_2","elementShow"); - } - $conttp->setVariable("DAT_USER",$chkTfValue5); - $conttp->setVariable("DAT_SSH_KEY_PATH",$chkTfValue7); - $conttp->setVariable("DAT_BASEDIR",$chkTfValue8); - $conttp->setVariable("DAT_HOSTCONFIG",$chkTfValue9); - $conttp->setVariable("DAT_SERVICECONFIG",$chkTfValue10); - $conttp->setVariable("DAT_BACKUPDIR",$chkTfValue11); - $conttp->setVariable("DAT_HOSTBACKUP",$chkTfValue12); - $conttp->setVariable("DAT_SERVICEBACKUP",$chkTfValue13); - $conttp->setVariable("DAT_NAGIOSBASEDIR",$chkTfValue14); - $conttp->setVariable("DAT_IMPORTDIR",$chkTfValue15); - $conttp->setVariable("DAT_COMMANDFILE",$chkTfValue17); - $conttp->setVariable("DAT_BINARYFILE",$chkTfValue18); - $conttp->setVariable("DAT_PIDFILE",$chkTfValue19); - $conttp->setVariable("DAT_CONFFILE",$chkTfValue20); - $conttp->setVariable("DAT_PICTUREDIR",$chkTfValue16); - // NagiosQL version - if ($chkSelValue2 == 1) $conttp->setVariable("VER_SELECTED_1","selected"); - if ($chkSelValue2 == 2) $conttp->setVariable("VER_SELECTED_2","selected"); - if ($chkSelValue2 == 3) $conttp->setVariable("VER_SELECTED_3","selected"); - // Hidden variables - $conttp->setVariable("MODUS",$_POST['modus']); - $conttp->setVariable("DAT_ID",$_POST['hidId']); - $conttp->setVariable("LIMIT",$_POST['hidLimit']); - // Active - if (isset ($_POST['chbActive'])) { - $conttp->setVariable("ACT_CHECKED","checked"); - } else { - $conttp->setVariable("ACT_CHECKED",""); - } - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + // Process acces group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + $conttp->setVariable('TITLE', translate('Configuration domain administration')); + if ($intIsError == 1) { + $conttp->setVariable('PATHMESSAGE', '

' .translate('Warning, at least one ' . + 'error occured, please check!'). '

' .$strPathMessage); + } + $conttp->setVariable('CLASS_NAME_1', 'elementHide'); + $conttp->setVariable('CLASS_NAME_2', 'elementHide'); + $conttp->setVariable('CLASS_NAME_3', 'elementHide'); + $conttp->setVariable('FILL_ALLFIELDS', translate('Please fill in all fields marked with an *')); + $conttp->setVariable('FILL_ILLEGALCHARS', translate('The following field contains illegal characters:')); + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, 0, ''); + // Connection method + if ($arrModifyData['method'] == 1) { + $conttp->setVariable('FILE_SELECTED', 'selected'); + } + if ($arrModifyData['method'] == 2) { + $conttp->setVariable('FTP_SELECTED', 'selected'); + $conttp->setVariable('CLASS_NAME_1', 'elementShow'); + $conttp->setVariable('CLASS_NAME_2', 'elementHide'); + $conttp->setVariable('CLASS_NAME_3', 'elementShow'); + } + if ($arrModifyData['method'] == 3) { + $conttp->setVariable('SFTP_SELECTED', 'selected'); + $conttp->setVariable('CLASS_NAME_1', 'elementShow'); + $conttp->setVariable('CLASS_NAME_2', 'elementShow'); + $conttp->setVariable('CLASS_NAME_3', 'elementHide'); + } + if ($arrModifyData['ftp_secure'] == 1) { + $conttp->setVariable('FTPS_CHECKED', 'checked'); + } + // Nagios version + $conttp->setVariable('VER_SELECTED_' .$arrModifyData['version'], 'selected'); + // Domain localhost cant' be renamed + if ($arrModifyData[$preKeyField] == 'localhost') { + $conttp->setVariable('DOMAIN_DISABLE', 'readonly'); + $conttp->setVariable('LOCKCLASS', 'inputlock'); + } elseif ($arrModifyData[$preKeyField] == 'common') { + $conttp->setVariable('DOMAIN_DISABLE', 'readonly'); + $conttp->setVariable('COMMON_INVISIBLE', 'class="elementHide"'); + $conttp->setVariable('LOCKCLASS', 'inputlock'); + } + } + if ($chkSelModify == 'errormodify') { + $conttp->setVariable('DAT_TARGET', $chkTfValue1); + // Domain localhost cant' be renamed + if ($chkTfValue1 == 'localhost') { + $conttp->setVariable('DOMAIN_DISABLE', 'readonly'); + $conttp->setVariable('LOCKCLASS', 'inputlock'); + } elseif ($chkTfValue1 == 'common') { + $conttp->setVariable('DOMAIN_DISABLE', 'readonly'); + $conttp->setVariable('COMMON_INVISIBLE', 'class="elementHide"'); + $conttp->setVariable('LOCKCLASS', 'inputlock'); + } else { + $conttp->setVariable('LOCKCLASS', 'inpmust'); + } + $conttp->setVariable('DAT_ALIAS', $chkTfValue2); + $conttp->setVariable('DAT_SERVER', $chkTfValue4); + // Connection method + if ($chkSelValue1 == 1) { + $conttp->setVariable('FILE_SELECTED', 'selected'); + $conttp->setVariable('CLASS_NAME_1', 'elementHide'); + $conttp->setVariable('CLASS_NAME_2', 'elementHide'); + $conttp->setVariable('CLASS_NAME_3', 'elementHide'); + } + if ($chkSelValue1 == 2) { + $conttp->setVariable('FTP_SELECTED', 'selected'); + $conttp->setVariable('CLASS_NAME_1', 'elementShow'); + $conttp->setVariable('CLASS_NAME_2', 'elementHide'); + $conttp->setVariable('CLASS_NAME_3', 'elementShow'); + } + if ($chkSelValue1 == 3) { + $conttp->setVariable('SFTP_SELECTED', 'selected'); + $conttp->setVariable('CLASS_NAME_1', 'elementShow'); + $conttp->setVariable('CLASS_NAME_2', 'elementShow'); + $conttp->setVariable('CLASS_NAME_3', 'elementHide'); + } + $conttp->setVariable('DAT_USER', $chkTfValue5); + $conttp->setVariable('DAT_SSH_KEY_PATH', $chkTfValue7); + if ($chkChbValue1== 1) { + $conttp->setVariable('FTPS_CHECKED', 'checked'); + } + $conttp->setVariable('DAT_BASEDIR', $chkTfValue8); + $conttp->setVariable('DAT_HOSTCONFIG', $chkTfValue9); + $conttp->setVariable('DAT_SERVICECONFIG', $chkTfValue10); + $conttp->setVariable('DAT_BACKUPDIR', $chkTfValue11); + $conttp->setVariable('DAT_HOSTBACKUP', $chkTfValue12); + $conttp->setVariable('DAT_SERVICEBACKUP', $chkTfValue13); + $conttp->setVariable('DAT_NAGIOSBASEDIR', $chkTfValue14); + $conttp->setVariable('DAT_IMPORTDIR', $chkTfValue15); + $conttp->setVariable('DAT_COMMANDFILE', $chkTfValue17); + $conttp->setVariable('DAT_BINARYFILE', $chkTfValue18); + $conttp->setVariable('DAT_PIDFILE', $chkTfValue19); + $conttp->setVariable('DAT_CONFFILE', $chkTfValue20); + $conttp->setVariable('DAT_CGIFILE', $chkTfValue21); + $conttp->setVariable('DAT_RESOURCEFILE', $chkTfValue22); + $conttp->setVariable('DAT_PICTUREDIR', $chkTfValue16); + // NagiosQL version + if ($chkSelValue2 == 1) { + $conttp->setVariable('VER_SELECTED_1', 'selected'); + } + if ($chkSelValue2 == 2) { + $conttp->setVariable('VER_SELECTED_2', 'selected'); + } + if ($chkSelValue2 == 3) { + $conttp->setVariable('VER_SELECTED_3', 'selected'); + } + // Hidden variables + $conttp->setVariable('MODUS', filter_input(INPUT_POST, 'modus', FILTER_SANITIZE_STRING)); + $conttp->setVariable('DAT_ID', filter_input(INPUT_POST, 'hidId', FILTER_VALIDATE_INT)); + $conttp->setVariable('LIMIT', filter_input(INPUT_POST, 'hidLimit', FILTER_VALIDATE_INT)); + // Active + if (filter_input(INPUT_POST, 'chbActive')) { + $conttp->setVariable('ACT_CHECKED', 'checked'); + } else { + $conttp->setVariable('ACT_CHECKED', ''); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Configuration target')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Row sorting - $strOrderString = "ORDER BY `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `alias` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `active`, `nodelete`, `access_group` FROM `$preTableName` WHERE `access_group` IN ($strAccess) - $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'alias'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Configuration domain administration')); + $mastertp->setVariable('FIELD_1', translate('Configuration target')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Row sorting + $strOrderString = "ORDER BY `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `alias` $hidSortDir"; + } + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE `access_group` IN ($strAccess)"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `active`, `nodelete`, `access_group` " + . "FROM `$preTableName` WHERE `access_group` IN ($strAccess) $strOrderString " + . "LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'alias'); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,'','',1); +$myContentClass->showMessages($mastertp, $strErrorMessage, $strInfoMessage, $strConsistMessage, array(), '', 1); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/contactgroups.php b/admin/contactgroups.php index b656e5e..033e7e5 100644 --- a/admin/contactgroups.php +++ b/admin/contactgroups.php @@ -5,178 +5,271 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Contactgroup definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 15; -$preContent = "admin/contactgroups.tpl.htm"; -$preSearchSession = 'contactgroup'; -$preTableName = 'tbl_contactgroup'; -$preKeyField = 'contactgroup_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 15; +$preContent = 'admin/contactgroups.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'contactgroup'; +$preTableName = 'tbl_contactgroup'; +$preKeyField = 'contactgroup_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); -// +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `members`=$intMselValue1, `contactgroup_members`=$intMselValue2, $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && ($chkTfValue2 != "") && ($intMselValue1 != 0)) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New contact group inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Contact group modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkContactgroupToContact",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkContactgroupToContactgroup",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkContactgroupToContact",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkContactgroupToContact",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkContactgroupToContactgroup",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkContactgroupToContactgroup",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2) != 0) $strInfoMessage = ""; - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `members`=$intMselValue1, " + . "`contactgroup_members`=$intMselValue2, $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && ($chkTfValue2 != '') && ($intMselValue1 != 0)) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New contact group inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Contact group modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkContactgroupToContact', + $chkDataId, + $chkMselValue1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkContactgroupToContactgroup', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkContactgroupToContact', + $chkDataId, + $chkMselValue1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkContactgroupToContact', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkContactgroupToContactgroup', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkContactgroupToContactgroup', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2) != 0) { + $strInfoMessage = ''; + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define contact groups (contactgroups.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process contact member selection fields - $intReturn = 0; - if (isset($arrModifyData['members'])) {$intFieldId = $arrModifyData['members'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_contact','contact_name','contacts','tbl_lnkContactgroupToContact',2,$intFieldId); - if ($intReturn != 0) { - $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - $myVisClass->processMessage(translate('Attention, no contacts defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process contactgroup member selection fields - if (isset($arrModifyData['contactgroup_members'])) {$intFieldId = $arrModifyData['contactgroup_members'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti($preTableName,$preKeyField,'contactgroups','tbl_lnkContactgroupToContactgroup',0,$intFieldId,$chkListId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process acces group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion != 3) $conttp->setVariable("VERSION_20_VALUE_MUST","mselValue1,"); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo); - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Define contact groups (contactgroups.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process contact member selection fields + if (isset($arrModifyData['members'])) { + $intFieldId = $arrModifyData['members']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_contact', + 'contact_name', + 'contacts', + 'tbl_lnkContactgroupToContact', + 2, + $intFieldId + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + $myVisClass->processMessage(translate('Attention, no contacts defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process contactgroup member selection fields + if (isset($arrModifyData['contactgroup_members'])) { + $intFieldId = $arrModifyData['contactgroup_members']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectMulti( + $preTableName, + $preKeyField, + 'contactgroups', + 'tbl_lnkContactgroupToContactgroup', + 0, + $intFieldId, + $chkListId + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process acces group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn3 = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion < 3) { + $conttp->setVariable('VERSION_20_VALUE_MUST', 'mselValue1,'); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo); + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Contact group')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Process filter string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:')); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere - AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:')); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'alias'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define contact groups (contactgroups.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Contact group')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Process filter string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; + } + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` " + . "WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `config_id`, `access_group` " + . "FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess) " + . "$strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'alias'); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/contacts.php b/admin/contacts.php index 0dd9819..4244079 100644 --- a/admin/contacts.php +++ b/admin/contacts.php @@ -5,338 +5,506 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Contact definitions -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 14; -$preContent = "admin/contacts.tpl.htm"; -$preSearchSession = 'contact'; -$preTableName = 'tbl_contact'; -$preKeyField = 'contact_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 14; +$preContent = 'admin/contacts.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'contact'; +$preTableName = 'tbl_contact'; +$preKeyField = 'contact_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Checkbox data processing // ======================== -if ($intVersion == 3) { - $strHO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e.$chkChbGr1f,0,-1); - $strSO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e.$chkChbGr2f.$chkChbGr2g,0,-1); +if (($intVersion == 3) || ($intVersion == 4)) { + $strHO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e.$chkChbGr1f, 0, -1); + $strSO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e.$chkChbGr2f.$chkChbGr2g, 0, -1); } else { - $strHO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1f,0,-1); - $strSO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e.$chkChbGr2g,0,-1); + $strHO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1f, 0, -1); + $strSO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e.$chkChbGr2g, 0, -1); } -// +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `contactgroups`=$intMselValue1, `contactgroups_tploptions`=$chkRadValue1, - `host_notifications_enabled`='$chkRadValue2', `service_notifications_enabled`='$chkRadValue3', `host_notification_period`='$chkSelValue1', - `service_notification_period`='$chkSelValue2', `host_notification_options`='$strHO', `host_notification_commands_tploptions`=$chkRadValue4, - `service_notification_options`='$strSO', `host_notification_commands`=$intMselValue2, `service_notification_commands`=$intMselValue3, - `service_notification_commands_tploptions`=$chkRadValue5, `can_submit_commands`='$chkRadValue8', `retain_status_information`='$chkRadValue6', - `retain_nonstatus_information`='$chkRadValue7', `email`='$chkTfValue3', `pager`='$chkTfValue4', `address1`='$chkTfValue5', `address2`='$chkTfValue6', - `address3`='$chkTfValue7', `address4`='$chkTfValue8', `address5`='$chkTfValue9', `address6`='$chkTfValue10', `name`='$chkTfValue11', - `use_variables`='$intVariables', `use_template`=$intTemplates, $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if ($chkTfValue1 != "") { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New contact inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Contact modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkContactToContactgroup",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkContactToCommandHost",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) $intRet3 = $myDataClass->dataInsertRelation("tbl_lnkContactToCommandService",$chkDataId,$chkMselValue3); - if (isset($intRet3) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkContactToContactgroup",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkContactToContactgroup",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkContactToCommandHost",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkContactToCommandHost",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) { - $intRet3 = $myDataClass->dataUpdateRelation("tbl_lnkContactToCommandService",$chkDataId,$chkMselValue3); - } else { - $intRet3 = $myDataClass->dataDeleteRelation("tbl_lnkContactToCommandService",$chkDataId); - } - if ($intRet3 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2 + $intRet3) != 0) $strInfoMessage = ""; - // - // Insert/update templates from session data - // ========================================= - if ($chkModus == "modify") { - $strSQL = "DELETE FROM `tbl_lnkContactToContacttemplate` WHERE `idMaster`=$chkDataId"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && (count($_SESSION['templatedefinition']) != 0)) { - $intSortId = 1; - foreach($_SESSION['templatedefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_lnkContactToContacttemplate` (`idMaster`,`idSlave`,`idTable`,`idSort`) - VALUES ($chkDataId,".$elem['idSlave'].",".$elem['idTable'].",".$intSortId.")"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - $intSortId++; - } - } - // - // Insert/update variables from session data - // ========================================= - if ($chkModus == "modify") { - $strSQL = "SELECT * FROM `tbl_lnkContactToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intDataCount != 0) { - foreach ($arrData AS $elem) { - $strSQL = "DELETE FROM `tbl_variabledefinition` WHERE `id`=".$elem['idSlave']; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - $strSQL = "DELETE FROM `tbl_lnkContactToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && (count($_SESSION['variabledefinition']) != 0)) { - foreach($_SESSION['variabledefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) - VALUES ('".$elem['definition']."','".$elem['range']."',now())"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - $strSQL = "INSERT INTO `tbl_lnkContactToVariabledefinition` (`idMaster`,`idSlave`) - VALUES ($chkDataId,$intInsertId)"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - } - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', " + . "`contactgroups`=$intMselValue1, `contactgroups_tploptions`=$chkRadValue1, " + . "`minimum_importance`=$chkTfNullVal1, " + . "`host_notifications_enabled`='$chkRadValue2', `service_notifications_enabled`='$chkRadValue3', " + . "`host_notification_period`='$chkSelValue1', `service_notification_period`='$chkSelValue2', " + . "`host_notification_options`='$strHO', `host_notification_commands_tploptions`=$chkRadValue4, " + . "`service_notification_options`='$strSO', `host_notification_commands`=$intMselValue2, " + . "`service_notification_commands`=$intMselValue3, " + . "`service_notification_commands_tploptions`=$chkRadValue5, `can_submit_commands`='$chkRadValue8', " + . "`retain_status_information`='$chkRadValue6', `retain_nonstatus_information`='$chkRadValue7', " + . "`email`='$chkTfValue3', `pager`='$chkTfValue4', `address1`='$chkTfValue5', `address2`='$chkTfValue6', " + . "`address3`='$chkTfValue7', `address4`='$chkTfValue8', `address5`='$chkTfValue9', " + . "`address6`='$chkTfValue10', `name`='$chkTfValue11', `use_variables`='$intVariables', " + . "`use_template`=$intTemplates, $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if ($chkTfValue1 != '') { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New contact inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Contact modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkContactToContactgroup', + $chkDataId, + $chkMselValue1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkContactToCommandHost', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataInsertRelation( + 'tbl_lnkContactToCommandService', + $chkDataId, + $chkMselValue3 + ); + } + if (isset($intRet3) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkContactToContactgroup', + $chkDataId, + $chkMselValue1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkContactToContactgroup', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkContactToCommandHost', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkContactToCommandHost', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataUpdateRelation( + 'tbl_lnkContactToCommandService', + $chkDataId, + $chkMselValue3 + ); + } else { + $intRet3 = $myDataClass->dataDeleteRelation('tbl_lnkContactToCommandService', $chkDataId); + } + if ($intRet3 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + //if (($intRet1 + $intRet2 + $intRet3) != 0) { + //$strInfoMessage = ""; + //} + // + // Insert/update templates from session data + // ========================================= + if ($chkModus == 'modify') { + $strSQL = "DELETE FROM `tbl_lnkContactToContacttemplate` WHERE `idMaster`=$chkDataId"; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && + (count($_SESSION['templatedefinition']) != 0)) { + $intSortId = 1; + /** @noinspection ForeachSourceInspection */ + foreach ($_SESSION['templatedefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL = 'INSERT INTO `tbl_lnkContactToContacttemplate` (`idMaster`,`idSlave`,' + . "`idTable`,`idSort`) VALUES ($chkDataId,".$elem['idSlave']. ', ' + . $elem['idTable']. ',' .$intSortId. ')'; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + $intSortId++; + } + } + // + // Insert/update variables from session data + // ========================================= + if ($chkModus == 'modify') { + $strSQL1 = "SELECT * FROM `tbl_lnkContactToVariabledefinition` WHERE `idMaster`=$chkDataId"; + $booReturn = $myDBClass->hasDataArray($strSQL1, $arrData, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCount != 0) { + foreach ($arrData as $elem) { + $strSQL = 'DELETE FROM `tbl_variabledefinition` WHERE `id`=' .$elem['idSlave']; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + $strSQL = "DELETE FROM `tbl_lnkContactToVariabledefinition` WHERE `idMaster`=$chkDataId"; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && + (count($_SESSION['variabledefinition']) != 0)) { + foreach ($_SESSION['variabledefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL = 'INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) ' + . "VALUES ('".$elem['definition']."','".$elem['range']."',now())"; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + $strSQL = 'INSERT INTO `tbl_lnkContactToVariabledefinition` (`idMaster`,`idSlave`) ' + . "VALUES ($chkDataId,$intInsertId)"; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate("Define contacts (contacts.cfg)")); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process template selection fields (Spezial) - $strWhere = ""; - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - $strWhere = "AND `id` <> ".$arrModifyData['id']; - } - $strSQL = "SELECT `id`,`template_name`, `active` FROM `tbl_contacttemplate` WHERE $strDomainWhere2 ORDER BY `template_name`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataTpl,$intDataCountTpl); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDataCountTpl != 0) { - foreach ($arrDataTpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem['template_name'],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::1"); - $conttp->parse("template"); - } - } - $strSQL = "SELECT `id`, `name`, `active` FROM `$preTableName` WHERE `name` <> '' $strWhere AND $strDomainWhere ORDER BY `name`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataHpl,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($arrDataHpl != 0) { - foreach ($arrDataHpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem['name'],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::2"); - $conttp->parse("template"); - } - } - // Process timeperiod selection fields - $intReturn = 0; - if (isset($arrModifyData['host_notification_period'])) {$intFieldId = $arrModifyData['host_notification_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','host_time',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['service_notification_period'])) {$intFieldId = $arrModifyData['service_notification_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','service_time',1,$intFieldId); - if ($intReturn != 0) { - $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - $myVisClass->processMessage(translate('Attention, no time periods defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process command selection fields - if (isset($arrModifyData['host_notification_commands'])) {$intFieldId = $arrModifyData['host_notification_commands'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_command','command_name','host_command','tbl_lnkContactToCommandHost',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['service_notification_commands'])) {$intFieldId = $arrModifyData['service_notification_commands'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_command','command_name','service_command','tbl_lnkContactToCommandService',0,$intFieldId); - if ($intReturn != 0) { - $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - $myVisClass->processMessage(translate('Attention, no commands defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process contactgroup selection field - if (isset($arrModifyData['contactgroups'])) {$intFieldId = $arrModifyData['contactgroups'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_contactgroup','contactgroup_name','contactgroup','tbl_lnkContactToContactgroup',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $strChbFields = "HNE,SNE,RSI,CSC,RNS,TPL,SEC,HOC,COG"; - $myContentClass->addFormInit($conttp,$strChbFields); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion == 3) { - $conttp->setVariable("HOST_OPTION_FIELDS","chbGr1a,chbGr1b,chbGr1c,chbGr1d,chbGr1e,chbGr1f"); - $conttp->setVariable("SERVICE_OPTION_FIELDS","chbGr2a,chbGr2b,chbGr2c,chbGr2d,chbGr2e,chbGr2f,chbGr2g"); - } else { - $conttp->setVariable("HOST_OPTION_FIELDS","chbGr1a,chbGr1b,chbGr1c,chbGr1d,chbGr1f"); - $conttp->setVariable("SERVICE_OPTION_FIELDS","chbGr2a,chbGr2b,chbGr2c,chbGr2d,chbGr2e,chbGr2g"); - $conttp->setVariable("VERSION_20_VALUE_MUST",",tfValue2"); - } - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo,$strChbFields); - // Process radio fields - $conttp->setVariable("DAT_HNE".$arrModifyData['host_notifications_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_SNE".$arrModifyData['service_notifications_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_RSI".$arrModifyData['retain_status_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_CSC".$arrModifyData['can_submit_commands']."_CHECKED","checked"); - $conttp->setVariable("DAT_RNS".$arrModifyData['retain_nonstatus_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_TPL".$arrModifyData['use_template_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_SEC".$arrModifyData['service_notification_commands_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_HOC".$arrModifyData['host_notification_commands_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_COG".$arrModifyData['contactgroups_tploptions']."_CHECKED","checked"); - // Process option fields - foreach(explode(",",$arrModifyData['host_notification_options']) AS $elem) { - $conttp->setVariable("DAT_HO".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['service_notification_options']) AS $elem) { - $conttp->setVariable("DAT_SO".strtoupper($elem)."_CHECKED","checked"); - } - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Define contacts (contacts.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process template selection fields (Spezial) + $strWhere = ''; + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + $strWhere = 'AND `id` <> ' .$arrModifyData['id']; + } + $strSQL5 = 'SELECT `id`,`template_name`, `active` ' + . "FROM `tbl_contacttemplate` WHERE $strDomainWhere2 ORDER BY `template_name`"; + $booReturn5 = $myDBClass->hasDataArray($strSQL5, $arrDataTpl, $intDataCountTpl); + if ($booReturn5 == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCountTpl != 0) { + /** @var array $arrDataTpl */ + foreach ($arrDataTpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem['template_name'], ENT_QUOTES, 'UTF-8'). + $strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::1'); + $conttp->parse('template'); + } + } + $strSQL6 = 'SELECT `id`, `name`, `active` ' + . "FROM `$preTableName` WHERE `name` <> '' $strWhere AND $strDomainWhere ORDER BY `name`"; + $booReturn6 = $myDBClass->hasDataArray($strSQL6, $arrDataHpl, $intDataCount); + if ($booReturn6 == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCount != 0) { + /** @var array $arrDataHpl */ + foreach ($arrDataHpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem['name'], ENT_QUOTES, 'UTF-8').$strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::2'); + $conttp->parse('template'); + } + } + // Process timeperiod selection fields + if (isset($arrModifyData['host_notification_period'])) { + $intFieldId = $arrModifyData['host_notification_period']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'host_time', 1, $intFieldId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['service_notification_period'])) { + $intFieldId = $arrModifyData['service_notification_period']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'service_time', 1, $intFieldId); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + $myVisClass->processMessage(translate('Attention, no time periods defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process command selection fields + if (isset($arrModifyData['host_notification_commands'])) { + $intFieldId = $arrModifyData['host_notification_commands']; + } else { + $intFieldId = 0; + } + $intReturn3 = $myVisClass->parseSelectMulti( + 'tbl_command', + 'command_name', + 'host_command', + 'tbl_lnkContactToCommandHost', + 0, + $intFieldId + ); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['service_notification_commands'])) { + $intFieldId = $arrModifyData['service_notification_commands']; + } else { + $intFieldId = 0; + } + $intReturn4 = $myVisClass->parseSelectMulti( + 'tbl_command', + 'command_name', + 'service_command', + 'tbl_lnkContactToCommandService', + 0, + $intFieldId + ); + if ($intReturn4 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + $myVisClass->processMessage(translate('Attention, no commands defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process contactgroup selection field + if (isset($arrModifyData['contactgroups'])) { + $intFieldId = $arrModifyData['contactgroups']; + } else { + $intFieldId = 0; + } + $intReturn5 = $myVisClass->parseSelectMulti( + 'tbl_contactgroup', + 'contactgroup_name', + 'contactgroup', + 'tbl_lnkContactToContactgroup', + 2, + $intFieldId + ); + if ($intReturn5 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn6 = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn6 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $strChbFields = 'HNE,SNE,RSI,CSC,RNS,TPL,SEC,HOC,COG'; + $myContentClass->addFormInit($conttp, $strChbFields); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + $conttp->setVariable('DISABLE_SAVE', 'disabled'); + } + if ($intVersion == 4) { + $conttp->setVariable('HOST_OPTION_FIELDS', 'chbGr1a,chbGr1b,chbGr1c,chbGr1d,chbGr1e,chbGr1f'); + $conttp->setVariable('SERVICE_OPTION_FIELDS', 'chbGr2a,chbGr2b,chbGr2c,chbGr2d,chbGr2e,chbGr2f,chbGr2g'); + } + if ($intVersion == 3) { + $conttp->setVariable('HOST_OPTION_FIELDS', 'chbGr1a,chbGr1b,chbGr1c,chbGr1d,chbGr1e,chbGr1f'); + $conttp->setVariable('SERVICE_OPTION_FIELDS', 'chbGr2a,chbGr2b,chbGr2c,chbGr2d,chbGr2e,chbGr2f,chbGr2g'); + } + if ($intVersion < 3) { + $conttp->setVariable('HOST_OPTION_FIELDS', 'chbGr1a,chbGr1b,chbGr1c,chbGr1d,chbGr1f'); + $conttp->setVariable('SERVICE_OPTION_FIELDS', 'chbGr2a,chbGr2b,chbGr2c,chbGr2d,chbGr2e,chbGr2g'); + $conttp->setVariable('VERSION_20_VALUE_MUST', ',tfValue2'); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo, $strChbFields); + // Process radio fields + $conttp->setVariable('DAT_HNE' .$arrModifyData['host_notifications_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_SNE' .$arrModifyData['service_notifications_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_RSI' .$arrModifyData['retain_status_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_CSC' .$arrModifyData['can_submit_commands']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_RNS' .$arrModifyData['retain_nonstatus_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_TPL' .$arrModifyData['use_template_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable( + 'DAT_SEC' .$arrModifyData['service_notification_commands_tploptions']. '_CHECKED', + 'checked' + ); + $conttp->setVariable('DAT_HOC' .$arrModifyData['host_notification_commands_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_COG' .$arrModifyData['contactgroups_tploptions']. '_CHECKED', 'checked'); + // Process option fields + foreach (explode(',', $arrModifyData['host_notification_options']) as $elem) { + $conttp->setVariable('DAT_HO' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['service_notification_options']) as $elem) { + $conttp->setVariable('DAT_SO' .strtoupper($elem). '_CHECKED', 'checked'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Contact name')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Process search string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' OR - `email` LIKE '%".$strSearchTxt."%' OR `pager` LIKE '%".$strSearchTxt."%' OR - `address1` LIKE '%".$strSearchTxt."%' OR `address2` LIKE '%".$strSearchTxt."%' OR - `address3` LIKE '%".$strSearchTxt."%' OR `address4` LIKE '%".$strSearchTxt."%' OR - `address5` LIKE '%".$strSearchTxt."%' OR `address6` LIKE '%".$strSearchTxt."%' OR - `name` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `active`, `register`, `config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere - AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'alias'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define contacts (contacts.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Contact name')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Process search string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' OR " + . "`email` LIKE '%".$strSearchTxt."%' OR `pager` LIKE '%".$strSearchTxt."%' OR " + . "`address1` LIKE '%".$strSearchTxt."%' OR `address2` LIKE '%".$strSearchTxt."%' OR " + . "`address3` LIKE '%".$strSearchTxt."%' OR `address4` LIKE '%".$strSearchTxt."%' OR " + . "`address5` LIKE '%".$strSearchTxt."%' OR `address6` LIKE '%".$strSearchTxt."%' OR " + . "`name` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; + } + // Count datasets + $strSQL7 = 'SELECT count(*) AS `number` ' + . "FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; + $booReturn7 = $myDBClass->hasSingleDataset($strSQL7, $arrDataLinesCount); + if ($booReturn7 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL8 = "SELECT `id`, `$preKeyField`, `alias`, `active`, `register`, `config_id`, `access_group` " + . "FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` " + . "IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn8 = $myDBClass->hasDataArray($strSQL8, $arrDataLines, $intDataCount); + if ($booReturn8 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'alias'); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/contacttemplates.php b/admin/contacttemplates.php index a54f100..81b3117 100644 --- a/admin/contacttemplates.php +++ b/admin/contacttemplates.php @@ -5,330 +5,504 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Contact template definitions -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 17; -$preContent = "admin/contacttemplates.tpl.htm"; -$preSearchSession = 'contacttemplate'; -$preTableName = 'tbl_contacttemplate'; -$preKeyField = 'template_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 17; +$preContent = 'admin/contacttemplates.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'contacttemplate'; +$preTableName = 'tbl_contacttemplate'; +$preKeyField = 'template_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Checkbox data processing // ======================== -if ($intVersion == 3) { - $strHO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e.$chkChbGr1f,0,-1); - $strSO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e.$chkChbGr2f.$chkChbGr2g,0,-1); +if (($intVersion == 3) || ($intVersion == 4)) { + $strHO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e.$chkChbGr1f, 0, -1); + $strSO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e.$chkChbGr2f.$chkChbGr2g, 0, -1); } else { - $strHO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1f,0,-1); - $strSO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e.$chkChbGr2g,0,-1); + $strHO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1f, 0, -1); + $strSO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e.$chkChbGr2g, 0, -1); } -// +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `contactgroups`=$intMselValue1, `contactgroups_tploptions`=$chkRadValue1, - `host_notifications_enabled`='$chkRadValue2', `service_notifications_enabled`='$chkRadValue3', `host_notification_period`='$chkSelValue1', - `service_notification_period`='$chkSelValue2', `host_notification_options`='$strHO', `host_notification_commands_tploptions`=$chkRadValue4, - `service_notification_options`='$strSO', `host_notification_commands`=$intMselValue2, `service_notification_commands`=$intMselValue3, - `service_notification_commands_tploptions`=$chkRadValue5, `can_submit_commands`='$chkRadValue8', `retain_status_information`='$chkRadValue6', - `retain_nonstatus_information`='$chkRadValue7', `email`='$chkTfValue3', `pager`='$chkTfValue4', `address1`='$chkTfValue5', `address2`='$chkTfValue6', - `address3`='$chkTfValue7', `address4`='$chkTfValue8', `address5`='$chkTfValue9', `address6`='$chkTfValue10', - `use_variables`='$intVariables', `use_template`=$intTemplates, $preSQLCommon2"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if ($chkTfValue1 != "") { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New contact template inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Contact template modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkContacttemplateToContactgroup",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkContacttemplateToCommandHost",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) $intRet3 = $myDataClass->dataInsertRelation("tbl_lnkContacttemplateToCommandService",$chkDataId,$chkMselValue3); - if (isset($intRet3) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkContacttemplateToContactgroup",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkContacttemplateToContactgroup",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkContacttemplateToCommandHost",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkContacttemplateToCommandHost",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) { - $intRet3 = $myDataClass->dataUpdateRelation("tbl_lnkContacttemplateToCommandService",$chkDataId,$chkMselValue3); - } else { - $intRet3 = $myDataClass->dataDeleteRelation("tbl_lnkContacttemplateToCommandService",$chkDataId); - } - if ($intRet3 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2 + $intRet3) != 0) $strInfoMessage = ""; - // - // Insert/update templates from session data - // ========================================= - if ($chkModus == "modify") { - $strSQL = "DELETE FROM `tbl_lnkContacttemplateToContacttemplate` WHERE `idMaster`=$chkDataId"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && (count($_SESSION['templatedefinition']) != 0)) { - $intSortId = 1; - foreach($_SESSION['templatedefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_lnkContacttemplateToContacttemplate` (`idMaster`,`idSlave`,`idTable`,`idSort`) - VALUES ($chkDataId,".$elem['idSlave'].",".$elem['idTable'].",".$intSortId.")"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - $intSortId++; - } - } - // - // Insert/update variables from session data - // ========================================= - if ($chkModus == "modify") { - $strSQL = "SELECT * FROM `tbl_lnkContacttemplateToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intDataCount != 0) { - foreach ($arrData AS $elem) { - $strSQL = "DELETE FROM `tbl_variabledefinition` WHERE `id`=".$elem['idSlave']; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - $strSQL = "DELETE FROM `tbl_lnkContacttemplateToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && (count($_SESSION['variabledefinition']) != 0)) { - foreach($_SESSION['variabledefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) - VALUES ('".$elem['definition']."','".$elem['range']."',now())"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - $strSQL = "INSERT INTO `tbl_lnkContacttemplateToVariabledefinition` (`idMaster`,`idSlave`) - VALUES ($chkDataId,$intInsertId)"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - } - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', " + . "`contactgroups`=$intMselValue1, `contactgroups_tploptions`=$chkRadValue1, " + . "`minimum_importance`=$chkTfNullVal1, " + . "`host_notifications_enabled`='$chkRadValue2', `service_notifications_enabled`='$chkRadValue3', " + . "`host_notification_period`='$chkSelValue1', `service_notification_period`='$chkSelValue2', " + . "`host_notification_options`='$strHO', `host_notification_commands_tploptions`=$chkRadValue4, " + . "`service_notification_options`='$strSO', `host_notification_commands`=$intMselValue2, " + . "`service_notification_commands`=$intMselValue3, " + . "`service_notification_commands_tploptions`=$chkRadValue5, `can_submit_commands`='$chkRadValue8', " + . "`retain_status_information`='$chkRadValue6', `retain_nonstatus_information`='$chkRadValue7', " + . "`email`='$chkTfValue3', `pager`='$chkTfValue4', `address1`='$chkTfValue5', `address2`='$chkTfValue6', " + . "`address3`='$chkTfValue7', `address4`='$chkTfValue8', `address5`='$chkTfValue9', " + . "`address6`='$chkTfValue10', `use_variables`='$intVariables', `use_template`=$intTemplates, " + . $preSQLCommon2; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if ($chkTfValue1 != '') { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New contact template inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Contact template modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkContacttemplateToContactgroup', + $chkDataId, + $chkMselValue1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkContacttemplateToCommandHost', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataInsertRelation( + 'tbl_lnkContacttemplateToCommandService', + $chkDataId, + $chkMselValue3 + ); + } + if (isset($intRet3) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkContacttemplateToContactgroup', + $chkDataId, + $chkMselValue1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkContacttemplateToContactgroup', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkContacttemplateToCommandHost', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkContacttemplateToCommandHost', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataUpdateRelation( + 'tbl_lnkContacttemplateToCommandService', + $chkDataId, + $chkMselValue3 + ); + } else { + $intRet3 = $myDataClass->dataDeleteRelation( + 'tbl_lnkContacttemplateToCommandService', + $chkDataId + ); + } + if ($intRet3 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + //if (($intRet1 + $intRet2 + $intRet3) != 0) { + //$strInfoMessage = ""; + //} + // + // Insert/update templates from session data + // ========================================= + if ($chkModus == 'modify') { + $strSQL = 'DELETE FROM `tbl_lnkContacttemplateToContacttemplate` WHERE `idMaster`=' .$chkDataId; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && + (count($_SESSION['templatedefinition']) != 0)) { + $intSortId = 1; + /** @noinspection ForeachSourceInspection */ + foreach ($_SESSION['templatedefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL = 'INSERT INTO `tbl_lnkContacttemplateToContacttemplate` (`idMaster`, ' + . "`idSlave`,`idTable`,`idSort`) VALUES ($chkDataId,".$elem['idSlave']. ', ' + . $elem['idTable']. ',' .$intSortId. ')'; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + $intSortId++; + } + } + // + // Insert/update variables from session data + // ========================================= + if ($chkModus == 'modify') { + $strSQL = 'SELECT * ' + . 'FROM `tbl_lnkContacttemplateToVariabledefinition` WHERE `idMaster`=' .$chkDataId; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCount != 0) { + foreach ($arrData as $elem) { + $strSQL = 'DELETE FROM `tbl_variabledefinition` WHERE `id`=' .$elem['idSlave']; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + $strSQL = 'DELETE FROM `tbl_lnkContacttemplateToVariabledefinition` ' + . 'WHERE `idMaster`=' .$chkDataId; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && + (count($_SESSION['variabledefinition']) != 0)) { + foreach ($_SESSION['variabledefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL = 'INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) ' + . "VALUES ('".$elem['definition']."','".$elem['range']."',now())"; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + $strSQL = 'INSERT INTO `tbl_lnkContacttemplateToVariabledefinition` (`idMaster`, ' + . "`idSlave`) VALUES ($chkDataId,$intInsertId)"; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate("Define contact templates (contacttemplates.cfg)")); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process template selection fields (Spezial) - $strWhere = ""; - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - $strWhere = "AND `id` <> ".$arrModifyData['id']; - } - $strSQL = "SELECT `id`,`$preKeyField`, `active` FROM `$preTableName` WHERE $strDomainWhere $strWhere ORDER BY `$preKeyField`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataTpl,$intDataCountTpl); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDataCountTpl != 0) { - foreach ($arrDataTpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem[$preKeyField],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::1"); - $conttp->parse("template"); - } - } - $strSQL = "SELECT `id`, `name`, `active` FROM `tbl_contact` WHERE `name` <> '' AND $strDomainWhere2 ORDER BY name"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataHpl,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($arrDataHpl != 0) { - foreach ($arrDataHpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem['name'],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::2"); - $conttp->parse("template"); - } - } - // Process timeperiod selection fields - $intReturn = 0; - if (isset($arrModifyData['host_notification_period'])) {$intFieldId = $arrModifyData['host_notification_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','host_time',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['service_notification_period'])) {$intFieldId = $arrModifyData['service_notification_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','service_time',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process command selection fields - if (isset($arrModifyData['host_notification_commands'])) {$intFieldId = $arrModifyData['host_notification_commands'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_command','command_name','host_command','tbl_lnkContacttemplateToCommandHost',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['service_notification_commands'])) {$intFieldId = $arrModifyData['service_notification_commands'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_command','command_name','service_command','tbl_lnkContacttemplateToCommandService',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process contactgroup selection field - if (isset($arrModifyData['contactgroups'])) {$intFieldId = $arrModifyData['contactgroups'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_contactgroup','contactgroup_name','contactgroup','tbl_lnkContacttemplateToContactgroup',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process acces group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $strChbFields = "HNE,SNE,RSI,CSC,RNS,TPL,SEC,HOC,COG"; - $myContentClass->addFormInit($conttp,$strChbFields); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion == 3) { - $conttp->setVariable("HOST_OPTION_FIELDS","chbHOd3,chbHOu3,chbHOr3,chbHOf3,chbHOs3,chbHOn3"); - $conttp->setVariable("SERVICE_OPTION_FIELDS","chbSOw3,chbSOu3,chbSOc3,chbSOr3,chbSOf3,chbSOs3,chbSOn3"); - } else { - $conttp->setVariable("HOST_OPTION_FIELDS","chbHOd2,chbHOu2,chbHOr2,chbHOf2,chbHOn2"); - $conttp->setVariable("SERVICE_OPTION_FIELDS","chbSOw2,chbSOu2,chbSOc2,chbSOr2,chbSOf2,chbSOn2"); - $conttp->setVariable("VERSION_20_VALUE_MUST",",tfFriendly"); - } - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo,$strChbFields); - // Process radio fields - $conttp->setVariable("DAT_HNE".$arrModifyData['host_notifications_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_SNE".$arrModifyData['service_notifications_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_RSI".$arrModifyData['retain_status_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_CSC".$arrModifyData['can_submit_commands']."_CHECKED","checked"); - $conttp->setVariable("DAT_RNS".$arrModifyData['retain_nonstatus_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_TPL".$arrModifyData['use_template_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_SEC".$arrModifyData['service_notification_commands_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_HOC".$arrModifyData['host_notification_commands_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_COG".$arrModifyData['contactgroups_tploptions']."_CHECKED","checked"); - // Process option fields - foreach(explode(",",$arrModifyData['host_notification_options']) AS $elem) { - $conttp->setVariable("DAT_HO".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['service_notification_options']) AS $elem) { - $conttp->setVariable("DAT_SO".strtoupper($elem)."_CHECKED","checked"); - } - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Define contact templates (contacttemplates.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process template selection fields (Spezial) + $strWhere = ''; + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + $strWhere = 'AND `id` <> ' .$arrModifyData['id']; + } + $strSQL1 = "SELECT `id`,`$preKeyField`, `active` FROM `$preTableName` " + . "WHERE $strDomainWhere $strWhere ORDER BY `$preKeyField`"; + $booReturn1 = $myDBClass->hasDataArray($strSQL1, $arrDataTpl, $intDataCountTpl); + if ($booReturn1 == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCountTpl != 0) { + /** @var array $arrDataTpl */ + foreach ($arrDataTpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem[$preKeyField], ENT_QUOTES, 'UTF-8').$strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::1'); + $conttp->parse('template'); + } + } + $strSQL2 = 'SELECT `id`, `name`, `active` FROM `tbl_contact` ' + . "WHERE `name` <> '' AND $strDomainWhere2 ORDER BY name"; + $booReturn2 = $myDBClass->hasDataArray($strSQL2, $arrDataHpl, $intDataCountHpl); + if ($booReturn2 == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCountHpl != 0) { + /** @var array $arrDataHpl */ + foreach ($arrDataHpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem['name'], ENT_QUOTES, 'UTF-8').$strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::2'); + $conttp->parse('template'); + } + } + // Process timeperiod selection fields + if (isset($arrModifyData['host_notification_period'])) { + $intFieldId = $arrModifyData['host_notification_period']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'host_time', 1, $intFieldId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['service_notification_period'])) { + $intFieldId = $arrModifyData['service_notification_period']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'service_time', 1, $intFieldId); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process command selection fields + if (isset($arrModifyData['host_notification_commands'])) { + $intFieldId = $arrModifyData['host_notification_commands']; + } else { + $intFieldId = 0; + } + $intReturn3 = $myVisClass->parseSelectMulti( + 'tbl_command', + 'command_name', + 'host_command', + 'tbl_lnkContacttemplateToCommandHost', + 0, + $intFieldId + ); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['service_notification_commands'])) { + $intFieldId = $arrModifyData['service_notification_commands']; + } else { + $intFieldId = 0; + } + $intReturn4 = $myVisClass->parseSelectMulti( + 'tbl_command', + 'command_name', + 'service_command', + 'tbl_lnkContacttemplateToCommandService', + 0, + $intFieldId + ); + if ($intReturn4 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process contactgroup selection field + if (isset($arrModifyData['contactgroups'])) { + $intFieldId = $arrModifyData['contactgroups']; + } else { + $intFieldId = 0; + } + $intReturn5 = $myVisClass->parseSelectMulti( + 'tbl_contactgroup', + 'contactgroup_name', + 'contactgroup', + 'tbl_lnkContacttemplateToContactgroup', + 2, + $intFieldId + ); + if ($intReturn5 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process acces group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn6 = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn6 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $strChbFields = 'HNE,SNE,RSI,CSC,RNS,TPL,SEC,HOC,COG'; + $myContentClass->addFormInit($conttp, $strChbFields); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion == 4) { + $conttp->setVariable('HOST_OPTION_FIELDS', 'chbGr1a,chbGr1b,chbGr1c,chbGr1d,chbGr1e,chbGr1f'); + $conttp->setVariable('SERVICE_OPTION_FIELDS', 'chbGr2a,chbGr2b,chbGr2c,chbGr2d,chbGr2e,chbGr2f,chbGr2g'); + } + if ($intVersion == 3) { + $conttp->setVariable('HOST_OPTION_FIELDS', 'chbGr1a,chbGr1b,chbGr1c,chbGr1d,chbGr1e,chbGr1f'); + $conttp->setVariable('SERVICE_OPTION_FIELDS', 'chbGr2a,chbGr2b,chbGr2c,chbGr2d,chbGr2e,chbGr2f,chbGr2g'); + } + if ($intVersion < 3) { + $conttp->setVariable('HOST_OPTION_FIELDS', 'chbGr1a,chbGr1b,chbGr1c,chbGr1d,chbGr1f'); + $conttp->setVariable('SERVICE_OPTION_FIELDS', 'chbGr2a,chbGr2b,chbGr2c,chbGr2d,chbGr2e,chbGr2g'); + $conttp->setVariable('VERSION_20_VALUE_MUST', ',tfValue2'); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo, $strChbFields); + // Process radio fields + $conttp->setVariable('DAT_HNE' .$arrModifyData['host_notifications_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_SNE' .$arrModifyData['service_notifications_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_RSI' .$arrModifyData['retain_status_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_CSC' .$arrModifyData['can_submit_commands']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_RNS' .$arrModifyData['retain_nonstatus_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_TPL' .$arrModifyData['use_template_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable( + 'DAT_SEC' .$arrModifyData['service_notification_commands_tploptions']. '_CHECKED', + 'checked' + ); + $conttp->setVariable('DAT_HOC' .$arrModifyData['host_notification_commands_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_COG' .$arrModifyData['contactgroups_tploptions']. '_CHECKED', 'checked'); + // Process option fields + foreach (explode(',', $arrModifyData['host_notification_options']) as $elem) { + $conttp->setVariable('DAT_HO' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['service_notification_options']) as $elem) { + $conttp->setVariable('DAT_SO' .strtoupper($elem). '_CHECKED', 'checked'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Contact name')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Process filter string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' OR - `email` LIKE '%".$strSearchTxt."%' OR `pager` LIKE '%".$strSearchTxt."%' OR - `address1` LIKE '%".$strSearchTxt."%' OR `address2` LIKE '%".$strSearchTxt."%' OR - `address3` LIKE '%".$strSearchTxt."%' OR `address4` LIKE '%".$strSearchTxt."%' OR - `address5` LIKE '%".$strSearchTxt."%' OR `address6` LIKE '%".$strSearchTxt."%')"; - - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `active`, `register`, `config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere - AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'alias'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define contact templates (contacttemplates.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Contact name')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Process filter string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' OR " + . "`email` LIKE '%".$strSearchTxt."%' OR `pager` LIKE '%".$strSearchTxt."%' OR " + . "`address1` LIKE '%".$strSearchTxt."%' OR `address2` LIKE '%".$strSearchTxt."%' OR " + . "`address3` LIKE '%".$strSearchTxt."%' OR `address4` LIKE '%".$strSearchTxt."%' OR " + . "`address5` LIKE '%".$strSearchTxt."%' OR `address6` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; + } + // Count datasets + $strSQL = 'SELECT count(*) AS `number` ' + . "FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `active`, `register`, `config_id`, `access_group` " + . "FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess) " + . "$strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'alias'); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/datadomain.php b/admin/datadomain.php index 2e1f62b..da1a485 100644 --- a/admin/datadomain.php +++ b/admin/datadomain.php @@ -5,156 +5,183 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin domain administration -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 35; -$preContent = "admin/datadomain.tpl.htm"; -$preTableName = 'tbl_datadomain'; -$preKeyField = 'domain'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 35; +$preContent = 'admin/datadomain.htm.tpl'; +$preListTpl = 'admin/datalist_common.htm.tpl'; +$preTableName = 'tbl_datadomain'; +$preKeyField = 'domain'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); -// +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - if ($chkTfValue1 == 'common') $chkSelValue1 = 0; - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `targets`=$chkSelValue1, `version`=$chkSelValue2, - `access_group`=$chkSelAccGr, `enable_common`=$chkSelValue3, `active`='$chkActive', - `last_modified`=NOW()"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && ($chkTfValue2 != "") && (($chkTfValue1 == 'common') || ($chkSelValue1 != 0))) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New Domain inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Domain modified:')." ".$chkTfValue1); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + if ($chkTfValue1 == 'common') { + $chkSelValue1 = 0; + } + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `targets`=$chkSelValue1, " + . "`version`=$chkSelValue2, `access_group`=$chkSelAccGr, `enable_common`=$chkSelValue3, " + . "`active`='$chkActive', `last_modified`=NOW()"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && ($chkTfValue2 != '') && (($chkTfValue1 == 'common') || ($chkSelValue1 != 0))) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New Domain inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Domain modified:'). ' ' .$chkTfValue1); + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Data domain administration')); -$conttp->parse("header"); -$conttp->show("header"); // // Single view // =========== -if ($chkModus == "add") { - // Process configuration target selection fields - $intReturn = 0; - if (isset($arrModifyData['targets'])) {$intFieldId = $arrModifyData['targets'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_configtarget','target','target',0,$intFieldId); - if ($intReturn != 0) { - $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - $myVisClass->processMessage(translate('Attention, no configuration targets defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process acces group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - $conttp->setVariable("FILL_ALLFIELDS",translate('Please fill in all fields marked with an *')); - $conttp->setVariable("FILL_ILLEGALCHARS",translate('The following field contains not permitted characters:')); - $conttp->setVariable("ENABLE",translate('Enable')); - $conttp->setVariable("DISABLE",translate('Disable')); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,0,''); - // Nagios version - if ($arrModifyData['version'] == 1) $conttp->setVariable("VER_SELECTED_1","selected"); - if ($arrModifyData['version'] == 2) $conttp->setVariable("VER_SELECTED_2","selected"); - if ($arrModifyData['version'] == 3) $conttp->setVariable("VER_SELECTED_3","selected"); - // Enable common domain - if ($arrModifyData['enable_common'] == 0) $conttp->setVariable("ENA_COMMON_SELECTED_0","selected"); - if ($arrModifyData['enable_common'] == 1) $conttp->setVariable("ENA_COMMON_SELECTED_1","selected"); - // Domain localhost cant' be renamed - if ($arrModifyData['domain'] == "localhost") { - $conttp->setVariable("DOMAIN_DISABLE","readonly"); - $conttp->setVariable("LOCKCLASS","inputlock"); - } else if ($arrModifyData['domain'] == "common") { - $conttp->setVariable("DOMAIN_DISABLE","readonly"); - $conttp->setVariable("COMMON_INVISIBLE","class=\"elementHide\""); - $conttp->setVariable("LOCKCLASS","inputlock"); - } else { - $conttp->setVariable("CHECK_TARGETS",",selValue1"); - } - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + // Process configuration target selection fields + + if (isset($arrModifyData['targets'])) { + $intFieldId = $arrModifyData['targets']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectSimple('tbl_configtarget', 'target', 'target', 0, $intFieldId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + $myVisClass->processMessage(translate('Attention, no configuration targets defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process acces group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + $conttp->setVariable('TITLE', translate('Data domain administration')); + $conttp->setVariable('FILL_ALLFIELDS', translate('Please fill in all fields marked with an *')); + $conttp->setVariable('FILL_ILLEGALCHARS', translate('The following field contains illegal characters:')); + $conttp->setVariable('ENABLE', translate('Enable')); + $conttp->setVariable('DISABLE', translate('Disable')); + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, 0, ''); + // Nagios version + $conttp->setVariable('VER_SELECTED_' .$arrModifyData['version'], 'selected'); + // Enable common domain + $conttp->setVariable('ENA_COMMON_SELECTED_' .$arrModifyData['enable_common'], 'selected'); + // Domain localhost cant' be renamed + if ($arrModifyData['domain'] == 'localhost') { + $conttp->setVariable('DOMAIN_DISABLE', 'readonly'); + $conttp->setVariable('LOCKCLASS', 'inputlock'); + } elseif ($arrModifyData['domain'] == 'common') { + $conttp->setVariable('DOMAIN_DISABLE', 'readonly'); + $conttp->setVariable('COMMON_INVISIBLE', 'class="elementHide"'); + $conttp->setVariable('LOCKCLASS', 'inputlock'); + } else { + $conttp->setVariable('CHECK_TARGETS', ',selValue1'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Data domain')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Row sorting - $strOrderString = "ORDER BY `domain` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `alias` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `domain`, `alias`, `active`, `nodelete`, `access_group` FROM `$preTableName` WHERE `access_group` IN ($strAccess) - $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'alias'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Data domain administration')); + $mastertp->setVariable('FIELD_1', translate('Data domain')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Row sorting + $strOrderString = "ORDER BY `domain` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `alias` $hidSortDir"; + } + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE `access_group` IN ($strAccess)"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = 'SELECT `id`, `domain`, `alias`, `active`, `nodelete`, `access_group` ' + . "FROM `$preTableName` WHERE `access_group` IN ($strAccess) $strOrderString " + . "LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'alias'); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,'','',1); +$myContentClass->showMessages($mastertp, $strErrorMessage, $strInfoMessage, $strConsistMessage, array(), '', 1); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/delbackup.php b/admin/delbackup.php index c087631..4e6cd26 100644 --- a/admin/delbackup.php +++ b/admin/delbackup.php @@ -5,145 +5,176 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin file deletion -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 26; -$preContent = "admin/delbackup.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 26; +$preContent = 'admin/delbackup.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Get configuration set ID // ======================== -$arrConfigSet = $myConfigClass->getConfigSets(); +$myConfigClass->getConfigTargets($arrConfigSet); $intConfigId = $arrConfigSet[0]; -$myConfigClass->getConfigData($intConfigId,"method",$intMethod); -$myConfigClass->getConfigData($intConfigId,"backupdir",$strBackupDir); -$myConfigClass->getConfigData($intConfigId,"hostbackup",$strHostBackupDir); -$myConfigClass->getConfigData($intConfigId,"servicebackup",$strServiceBackupDir); +$myConfigClass->getConfigValues($intConfigId, 'method', $intMethod); +$myConfigClass->getConfigValues($intConfigId, 'backupdir', $strBackupDir); +$myConfigClass->getConfigValues($intConfigId, 'hostbackup', $strHostBackupDir); +$myConfigClass->getConfigValues($intConfigId, 'servicebackup', $strServiceBackupDir); // // Process form inputs // =================== -if (($chkMselValue1[0] != "") && ($chkStatus == 1)) { - foreach($chkMselValue1 AS $elem) { - $intCheck = $myConfigClass->removeFile(trim($elem),$intConfigId); - $strFile = str_replace($strServiceBackupDir,"",$elem); - $strFile = str_replace($strHostBackupDir,"",$strFile); - $strFile = str_replace($strBackupDir,"",$strFile); - if ($intCheck == 0) { - $myDataClass->writeLog(translate("File deleted").": ".trim($strFile)); - $myVisClass->processMessage($strFile." ".translate("successfully deleted")."!",$strInfoMessage); - } else { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } - } +if (($chkMselValue1[0] != '') && ($chkStatus == 1)) { + /** @var array $chkMselValue1 */ + foreach ($chkMselValue1 as $elem) { + $intCheck = $myConfigClass->removeFile(trim($elem), $intConfigId); + $strFileTmp1 = str_replace($strServiceBackupDir, '', $elem); + $strFileTmp2 = str_replace($strHostBackupDir, '', $strFileTmp1); + $strFile = str_replace($strBackupDir, '', $strFileTmp2); + if ($intCheck == 0) { + $myDataClass->writeLog(translate('File deleted'). ': ' .trim($strFile)); + $myVisClass->processMessage($strFile. ' ' .translate('successfully deleted'). '!', $strInfoMessage); + } else { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + } } // // Include content // =============== -$conttp->setVariable("TITLE",translate("Delete backup files")); -$conttp->parse("header"); -$conttp->show("header"); -$conttp->setVariable("LANG_SEARCH_STRING",translate('Filter string')); -$conttp->setVariable("LANG_SEARCH",translate('Search')); -$conttp->setVariable("LANG_DELETE",translate('Delete')); -$conttp->setVariable("LANG_DELETE_SEARCH",translate("Reset filter")); -$conttp->setVariable("DAT_SEARCH",$chkTfSearch); -$conttp->setVariable("BACKUPFILE",translate("Backup file")); -$conttp->setVariable("LANG_REQUIRED",translate("required")); -$conttp->setVariable("MAKE",translate("Delete")); -$conttp->setVariable("ABORT",translate("Abort")); -$conttp->setVariable("CTRL_INFO",translate("Hold CTRL to select
more than one entry")); -$conttp->setVariable("IMAGE_PATH",$_SESSION['SETS']['path']['base_url']."images/"); -$conttp->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); +$conttp->setVariable('TITLE', translate('Delete backup files')); +$conttp->parse('header'); +$conttp->show('header'); +$conttp->setVariable('LANG_SEARCH_STRING', translate('Filter string')); +$conttp->setVariable('LANG_SEARCH', translate('Search')); +$conttp->setVariable('LANG_DELETE', translate('Delete')); +$conttp->setVariable('LANG_DELETE_SEARCH', translate('Reset filter')); +$conttp->setVariable('DAT_SEARCH', $chkTfSearch); +$conttp->setVariable('BACKUPFILE', translate('Backup file')); +$conttp->setVariable('LANG_REQUIRED', translate('required')); +$conttp->setVariable('MAKE', translate('Delete')); +$conttp->setVariable('ABORT', translate('Abort')); +$conttp->setVariable('CTRL_INFO', translate('Hold CTRL to select
more than one entry')); +$conttp->setVariable('IMAGE_PATH', $_SESSION['SETS']['path']['base_url']. 'images/'); +$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); // Build a local file list if ($intMethod == 1) { - $output = array(); - $temp=$myConfigClass->DirToArray($strBackupDir, "\.cfg_", "",$output,$strErrorMessage); - if (is_array($output) && (count($output) != 0)) { - foreach ($output AS $elem) { - if (($chkTfSearch == "") || (substr_count($elem,$chkTfSearch) != 0)) { - $conttp->setVariable("DAT_BACKUPFILE",$elem); - $conttp->parse("filelist"); - } - } - } -} else if ($intMethod == 2) { - // Set up basic connection - if ($myConfigClass->getFTPConnection($intConfigId) == "0") { - $arrFiles = array(); - $arrFiles1 = ftp_nlist($myConfigClass->resConnectId,$strBackupDir); - if (is_array($arrFiles1)) $arrFiles = array_merge($arrFiles,$arrFiles1); - $arrFiles2 = ftp_nlist($myConfigClass->resConnectId,$strHostBackupDir); - if (is_array($arrFiles2)) $arrFiles = array_merge($arrFiles,$arrFiles2); - $arrFiles1 = ftp_nlist($myConfigClass->resConnectId,$strServiceBackupDir); - if (is_array($arrFiles1)) $arrFiles = array_merge($arrFiles,$arrFiles1); - if (is_array($arrFiles) && (count($arrFiles) != 0)) { - foreach ($arrFiles AS $elem) { - if (!substr_count($elem,"cfg")) continue; - if (($chkTfSearch == "") || (substr_count($elem,$chkTfSearch) != 0)) { - $conttp->setVariable("DAT_BACKUPFILE",$elem); - $conttp->parse("filelist"); - } - } - } else { - $myVisClass->processMessage(translate("No backup files or no permission to read the backup files"),$strErrorMessage); - } - ftp_close($myConfigClass->resConnectId); - } else { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } -} else if ($intMethod == 3) { - // Set up basic connection - if ($myConfigClass->getSSHConnection($intConfigId) == "0") { - $arrFiles = array(); - $arrFiles1 = $myConfigClass->sendSSHCommand("ls ".$strBackupDir."*.cfg_old*"); - if (is_array($arrFiles1)) $arrFiles = array_merge($arrFiles,$arrFiles1); - $arrFiles2 = $myConfigClass->sendSSHCommand("ls ".$strHostBackupDir."*.cfg_old*"); - if (is_array($arrFiles2)) $arrFiles = array_merge($arrFiles,$arrFiles2); - $arrFiles3 = $myConfigClass->sendSSHCommand("ls ".$strServiceBackupDir."*.cfg_old*"); - if (is_array($arrFiles3)) $arrFiles = array_merge($arrFiles,$arrFiles3); - if (is_array($arrFiles) && (count($arrFiles) != 0)) { - foreach ($arrFiles AS $elem) { - if (!substr_count($elem,"cfg_old")) continue; - if (($chkTfSearch == "") || (substr_count($elem,$chkTfSearch) != 0)) { - $conttp->setVariable("DAT_BACKUPFILE",str_replace("//","/",$elem)); - $conttp->parse("filelist"); - } - } - } else { - $myVisClass->processMessage(translate("No backup files or no permission to read the backup files"),$strErrorMessage); - } - } else { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } + $output = array(); + $myConfigClass->storeDirToArray($strBackupDir, "\.cfg_old", '', $output, $strErrorMessage); + if (is_array($output) && (count($output) != 0)) { + foreach ($output as $elem) { + if (($chkTfSearch == '') || (substr_count($elem, $chkTfSearch) != 0)) { + $conttp->setVariable('DAT_BACKUPFILE', $elem); + $conttp->parse('filelist'); + } + } + } +} elseif ($intMethod == 2) { + // Set up basic connection + if ($myConfigClass->getFTPConnection($intConfigId) == '0') { + $arrFiles = array(); + $arrFiles1 = ftp_nlist($myConfigClass->resConnectId, $strBackupDir); + if (is_array($arrFiles1)) { + $arrFiles = array_merge($arrFiles, $arrFiles1); + } + $arrFiles2 = ftp_nlist($myConfigClass->resConnectId, $strHostBackupDir); + if (is_array($arrFiles2)) { + $arrFiles = array_merge($arrFiles, $arrFiles2); + } + $arrFiles3 = ftp_nlist($myConfigClass->resConnectId, $strServiceBackupDir); + if (is_array($arrFiles3)) { + $arrFiles = array_merge($arrFiles, $arrFiles3); + } + if (is_array($arrFiles) && (count($arrFiles) != 0)) { + foreach ($arrFiles as $elem) { + if (!substr_count($elem, 'cfg')) { + continue; + } + if (($chkTfSearch == '') || (substr_count($elem, $chkTfSearch) != 0)) { + $conttp->setVariable('DAT_BACKUPFILE', $elem); + $conttp->parse('filelist'); + } + } + } else { + $myVisClass->processMessage( + translate('No backup files or no permission to read the backup files'), + $strErrorMessage + ); + } + ftp_close($myConfigClass->resConnectId); + } else { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } +} elseif ($intMethod == 3) { + // Set up basic connection + if ($myConfigClass->getSSHConnection($intConfigId) == '0') { + $arrFiles = array(); + $intReturn = $myConfigClass->sendSSHCommand('ls ' .$strBackupDir. '*.cfg_old*', $arrFiles1); + if (($intReturn == 0) && is_array($arrFiles1)) { + $arrFiles = array_merge($arrFiles, $arrFiles1); + } + $intReturn = $myConfigClass->sendSSHCommand('ls ' .$strHostBackupDir. '*.cfg_old*', $arrFiles2); + if (($intReturn == 0) && is_array($arrFiles2)) { + $arrFiles = array_merge($arrFiles, $arrFiles2); + } + $intReturn = $myConfigClass->sendSSHCommand('ls ' .$strServiceBackupDir. '*.cfg_old*', $arrFiles3); + if (($intReturn == 0) && is_array($arrFiles3)) { + $arrFiles = array_merge($arrFiles, $arrFiles3); + } + if (is_array($arrFiles) && (count($arrFiles) != 0)) { + foreach ($arrFiles as $elem) { + if (!substr_count($elem, 'cfg_old')) { + continue; + } + if (($chkTfSearch == '') || (substr_count($elem, $chkTfSearch) != 0)) { + $conttp->setVariable('DAT_BACKUPFILE', str_replace('//', '/', $elem)); + $conttp->parse('filelist'); + } + } + } else { + $myVisClass->processMessage( + translate('No backup files or no permission to read the backup files'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } } -if ($strErrorMessage != "") $conttp->setVariable("ERRORMESSAGE",$strErrorMessage); -$conttp->setVariable("INFOMESSAGE",$strInfoMessage); +if ($strErrorMessage != '') { + $conttp->setVariable('ERRORMESSAGE', $strErrorMessage); +} +$conttp->setVariable('INFOMESSAGE', $strInfoMessage); // Check access rights for adding new objects -if ($myVisClass->checkAccGroup($prePageKey,'write') != 0) $conttp->setVariable("ADD_CONTROL","disabled=\"disabled\""); -$conttp->parse("main"); -$conttp->show("main"); +if ($myVisClass->checkAccountGroup($prePageKey, 'write') != 0) { + $conttp->setVariable('ADD_CONTROL', 'disabled="disabled"'); +} +$conttp->parse('main'); +$conttp->show('main'); // // Footer ausgeben // =============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/delconfig.php b/admin/delconfig.php index 73b6c07..f724bd1 100644 --- a/admin/delconfig.php +++ b/admin/delconfig.php @@ -5,160 +5,187 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin file deletion -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 27; -$preContent = "admin/delbackup.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 27; +$preContent = 'admin/delbackup.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Get configuration set ID // ======================== -$arrConfigSet = $myConfigClass->getConfigSets(); + $myConfigClass->getConfigTargets($arrConfigSet); $intConfigId = $arrConfigSet[0]; -$myConfigClass->getConfigData($intConfigId,"method",$intMethod); -$myConfigClass->getConfigData($intConfigId,"basedir",$strBaseDir); -$myConfigClass->getConfigData($intConfigId,"hostconfig",$strHostDir); -$myConfigClass->getConfigData($intConfigId,"serviceconfig",$strServiceDir); +$myConfigClass->getConfigValues($intConfigId, 'method', $intMethod); +$myConfigClass->getConfigValues($intConfigId, 'basedir', $strBaseDir); +$myConfigClass->getConfigValues($intConfigId, 'hostconfig', $strHostDir); +$myConfigClass->getConfigValues($intConfigId, 'serviceconfig', $strServiceDir); // // Process form inputs // =================== -if (($chkMselValue1[0] != "") && ($chkStatus == 1)) { - foreach($chkMselValue1 AS $elem) { - $intCheck = $myConfigClass->removeFile(trim($elem),$intConfigId); - $strFile = str_replace($strServiceDir,"",$elem); - $strFile = str_replace($strHostDir,"",$strFile); - $strFile = str_replace($strBaseDir,"",$strFile); - if ($intCheck == 0) { - $myDataClass->writeLog(translate("File deleted").": ".trim($strFile)); - $myVisClass->processMessage($strFile." ".translate("successfully deleted")."!",$strInfoMessage); - } else { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } - } +/** @var array $chkMselValue1 */ +if (($chkMselValue1[0] != '') && ($chkStatus == 1)) { + foreach ($chkMselValue1 as $elem) { + $intCheck = $myConfigClass->removeFile(trim($elem), $intConfigId); + $strFileTmp1 = str_replace($strServiceDir, '', $elem); + $strFileTmp2 = str_replace($strHostDir, '', $strFileTmp1); + $strFile = str_replace($strBaseDir, '', $strFileTmp2); + if ($intCheck == 0) { + $myDataClass->writeLog(translate('File deleted'). ': ' .trim($strFile)); + $myVisClass->processMessage($strFile. ' ' .translate('successfully deleted'). '!', $strInfoMessage); + } else { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + } } // // Include content // =============== -$conttp->setVariable("TITLE",translate("Delete config files")); -$conttp->parse("header"); -$conttp->show("header"); -$conttp->setVariable("LANG_SEARCH_STRING",translate('Filter string')); -$conttp->setVariable("LANG_SEARCH",translate('Search')); -$conttp->setVariable("LANG_DELETE",translate('Delete')); -$conttp->setVariable("LANG_DELETE_SEARCH",translate("Reset filter")); -$conttp->setVariable("DAT_SEARCH",$chkTfSearch); -$conttp->setVariable("BACKUPFILE",translate("Configuration file")); -$conttp->setVariable("LANG_REQUIRED",translate("required")); -$conttp->setVariable("MAKE",translate("Delete")); -$conttp->setVariable("ABORT",translate("Abort")); -$conttp->setVariable("CTRL_INFO",translate("Hold CTRL to select
more than one entry")); -$conttp->setVariable("IMAGE_PATH",$_SESSION['SETS']['path']['base_url']."images/"); -$conttp->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); +$conttp->setVariable('TITLE', translate('Delete config files')); +$conttp->parse('header'); +$conttp->show('header'); +$conttp->setVariable('LANG_SEARCH_STRING', translate('Filter string')); +$conttp->setVariable('LANG_SEARCH', translate('Search')); +$conttp->setVariable('LANG_DELETE', translate('Delete')); +$conttp->setVariable('LANG_DELETE_SEARCH', translate('Reset filter')); +$conttp->setVariable('DAT_SEARCH', $chkTfSearch); +$conttp->setVariable('BACKUPFILE', translate('Configuration file')); +$conttp->setVariable('LANG_REQUIRED', translate('required')); +$conttp->setVariable('MAKE', translate('Delete')); +$conttp->setVariable('ABORT', translate('Abort')); +$conttp->setVariable('CTRL_INFO', translate('Hold CTRL to select
more than one entry')); +$conttp->setVariable('IMAGE_PATH', $_SESSION['SETS']['path']['base_url']. 'images/'); +$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); // Build a local file list if ($intMethod == 1) { - $output = array(); - $temp=$myConfigClass->DirToArray($strBaseDir, "\.cfg", "",$output,$strErrorMessage); - if (is_array($output) && (count($output) != 0)) { - foreach ($output AS $elem2) { - if (($chkTfSearch == "") || (substr_count($elem2,$chkTfSearch) != 0)) { - $conttp->setVariable("DAT_BACKUPFILE",$elem2); - $conttp->parse("filelist"); - } - } - } -} else if ($intMethod == 2) { - // Open ftp connection - if ($myConfigClass->getFTPConnection($intConfigId) == "0") { - $arrFiles = array(); - $arrFiles1 = ftp_nlist($myConfigClass->resConnectId,$strBaseDir); - if (is_array($arrFiles1)) $arrFiles = array_merge($arrFiles,$arrFiles1); - $arrFiles2 = ftp_nlist($myConfigClass->resConnectId,$strHostDir); - if (is_array($arrFiles2)) $arrFiles = array_merge($arrFiles,$arrFiles2); - $arrFiles3 = ftp_nlist($myConfigClass->resConnectId,$strServiceDir); - if (is_array($arrFiles3)) $arrFiles = array_merge($arrFiles,$arrFiles3); - if (is_array($arrFiles) && (count($arrFiles) != 0)) { - foreach ($arrFiles AS $elem) { - if (!substr_count($elem,"cfg")) continue; - if (($chkTfSearch == "") || (substr_count($elem,$chkTfSearch) != 0)) { - $conttp->setVariable("DAT_BACKUPFILE",str_replace("//","/",$elem)); - $conttp->parse("filelist"); - } - } - } - ftp_close($myConfigClass->resConnectId); - } else { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } -} else if ($intMethod == 3) { - // Open ssh connection - if ($myConfigClass->getSSHConnection($intConfigId) == "0") { - $arrFiles1 = $myConfigClass->sendSSHCommand('ls '.$strBaseDir); - if (is_array($arrFiles1) && (count($arrFiles1) != 0)) { - foreach ($arrFiles1 AS $elem) { - if (!substr_count($elem,"cfg")) continue; - if (substr_count($elem,"cgi.cfg") != 0) continue; - if (substr_count($elem,"nagios.cfg") != 0) continue; - if (($chkTfSearch == "") || (substr_count($elem,$chkTfSearch) != 0)) { - $conttp->setVariable("DAT_BACKUPFILE",str_replace("//","/",$strBaseDir."/".$elem)); - $conttp->setVariable("DAT_BACKUPFILE_FULL",str_replace("//","/",$strBaseDir."/".$elem)); - $conttp->parse("filelist"); - } - } - } - $arrFiles2 = $myConfigClass->sendSSHCommand('ls '.$strHostDir); - if (is_array($arrFiles2) && (count($arrFiles2) != 0)) { - foreach ($arrFiles2 AS $elem) { - if (!substr_count($elem,"cfg")) continue; - if (($chkTfSearch == "") || (substr_count($elem,$chkTfSearch) != 0)) { - $conttp->setVariable("DAT_BACKUPFILE",str_replace("//","/",$strHostDir."/".$elem)); - $conttp->setVariable("DAT_BACKUPFILE_FULL",str_replace("//","/",$strHostDir."/".$elem)); - $conttp->parse("filelist"); - } - } - } - $arrFiles3 = $myConfigClass->sendSSHCommand('ls '.$strServiceDir); - if (is_array($arrFiles3) && (count($arrFiles3) != 0)) { - foreach ($arrFiles3 AS $elem) { - if (!substr_count($elem,"cfg")) continue; - if (($chkTfSearch == "") || (substr_count($elem,$chkTfSearch) != 0)) { - $conttp->setVariable("DAT_BACKUPFILE",str_replace("//","/",$strServiceDir."/".$elem)); - $conttp->setVariable("DAT_BACKUPFILE_FULL",str_replace("//","/",$strServiceDir."/".$elem)); - $conttp->parse("filelist"); - } - } - } - } else { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } + $output = array(); + $myConfigClass->storeDirToArray($strBaseDir, "\.cfg", '\.cfg_old', $output, $strErrorMessage); + if (is_array($output) && (count($output) != 0)) { + foreach ($output as $elem2) { + if (($chkTfSearch == '') || (substr_count($elem2, $chkTfSearch) != 0)) { + $conttp->setVariable('DAT_BACKUPFILE', $elem2); + $conttp->parse('filelist'); + } + } + } +} elseif ($intMethod == 2) { + // Open ftp connection + if ($myConfigClass->getFTPConnection($intConfigId) == '0') { + $arrFiles = array(); + $arrFiles1 = ftp_nlist($myConfigClass->resConnectId, $strBaseDir); + if (is_array($arrFiles1)) { + $arrFiles = array_merge($arrFiles, $arrFiles1); + } + $arrFiles2 = ftp_nlist($myConfigClass->resConnectId, $strHostDir); + if (is_array($arrFiles2)) { + $arrFiles = array_merge($arrFiles, $arrFiles2); + } + $arrFiles3 = ftp_nlist($myConfigClass->resConnectId, $strServiceDir); + if (is_array($arrFiles3)) { + $arrFiles = array_merge($arrFiles, $arrFiles3); + } + if (is_array($arrFiles) && (count($arrFiles) != 0)) { + foreach ($arrFiles as $elem) { + if (!substr_count($elem, 'cfg')) { + continue; + } + if (($chkTfSearch == '') || (substr_count($elem, $chkTfSearch) != 0)) { + $conttp->setVariable('DAT_BACKUPFILE', str_replace('//', '/', $elem)); + $conttp->parse('filelist'); + } + } + } + ftp_close($myConfigClass->resConnectId); + } else { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } +} elseif ($intMethod == 3) { + // Open ssh connection + if ($myConfigClass->getSSHConnection($intConfigId) == '0') { + $intReturn = $myConfigClass->sendSSHCommand('ls '.$strBaseDir, $arrFiles1); + if (($intReturn == 0) && is_array($arrFiles1) && (count($arrFiles1) != 0)) { + foreach ($arrFiles1 as $elem) { + if (!substr_count($elem, 'cfg')) { + continue; + } + if (substr_count($elem, 'cgi.cfg') != 0) { + continue; + } + if (substr_count($elem, 'nagios.cfg') != 0) { + continue; + } + if (($chkTfSearch == '') || (substr_count($elem, $chkTfSearch) != 0)) { + $conttp->setVariable('DAT_BACKUPFILE', str_replace('//', '/', $strBaseDir. '/' .$elem)); + $conttp->setVariable('DAT_BACKUPFILE_FULL', str_replace('//', '/', $strBaseDir. '/' .$elem)); + $conttp->parse('filelist'); + } + } + } + $intReturn = $myConfigClass->sendSSHCommand('ls '.$strHostDir, $arrFiles2); + if (($intReturn == 0) && is_array($arrFiles2) && (count($arrFiles2) != 0)) { + foreach ($arrFiles2 as $elem) { + if (!substr_count($elem, 'cfg')) { + continue; + } + if (($chkTfSearch == '') || (substr_count($elem, $chkTfSearch) != 0)) { + $conttp->setVariable('DAT_BACKUPFILE', str_replace('//', '/', $strHostDir. '/' .$elem)); + $conttp->setVariable('DAT_BACKUPFILE_FULL', str_replace('//', '/', $strHostDir. '/' .$elem)); + $conttp->parse('filelist'); + } + } + } + $intReturn = $myConfigClass->sendSSHCommand('ls '.$strServiceDir, $arrFiles3); + if (($intReturn == 0) && is_array($arrFiles3) && (count($arrFiles3) != 0)) { + foreach ($arrFiles3 as $elem) { + if (!substr_count($elem, 'cfg')) { + continue; + } + if (($chkTfSearch == '') || (substr_count($elem, $chkTfSearch) != 0)) { + $conttp->setVariable('DAT_BACKUPFILE', str_replace('//', '/', $strServiceDir. '/' .$elem)); + $conttp->setVariable('DAT_BACKUPFILE_FULL', str_replace('//', '/', $strServiceDir. '/' .$elem)); + $conttp->parse('filelist'); + } + } + } + } else { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } } -if ($strErrorMessage != "") $conttp->setVariable("ERRORMESSAGE",$strErrorMessage); -$conttp->setVariable("INFOMESSAGE",$strInfoMessage); +if ($strErrorMessage != '') { + $conttp->setVariable('ERRORMESSAGE', $strErrorMessage); +} +$conttp->setVariable('INFOMESSAGE', $strInfoMessage); // Check access rights for adding new objects -if ($myVisClass->checkAccGroup($prePageKey,'write') != 0) $conttp->setVariable("ADD_CONTROL","disabled=\"disabled\""); -$conttp->parse("main"); -$conttp->show("main"); +if ($myVisClass->checkAccountGroup($prePageKey, 'write') != 0) { + $conttp->setVariable('ADD_CONTROL', 'disabled="disabled"'); +} +$conttp->parse('main'); +$conttp->show('main'); // // Footer ausgeben // =============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/download.php b/admin/download.php index c78e611..1677275 100644 --- a/admin/download.php +++ b/admin/download.php @@ -5,18 +5,22 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Download config file -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Version control // =============== session_cache_limiter('private_no_expire'); @@ -25,44 +29,33 @@ session_cache_limiter('private_no_expire'); // ========================== $preNoMain = 1; $preNoLogin = 1; -require("../functions/prepend_adm.php"); +require $preBasePath.'functions/prepend_adm.php'; // // Process post parameters // ======================= -$chkTable = isset($_GET['table']) ? htmlspecialchars($_GET['table'], ENT_QUOTES, 'utf-8') : ""; -$chkConfig = isset($_GET['config']) ? htmlspecialchars($_GET['config'], ENT_QUOTES, 'utf-8') : ""; -$chkLine = isset($_GET['line']) ? htmlspecialchars($_GET['line'], ENT_QUOTES, 'utf-8') : 0; +$chkTable = filter_input(INPUT_GET, 'table', FILTER_SANITIZE_STRING); +$chkConfig = filter_input(INPUT_GET, 'config', FILTER_SANITIZE_STRING); +$chkLine = filter_input(INPUT_GET, 'line', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); // // Header output // =============== -switch($chkTable) { - case "tbl_timeperiod": $strFile = "timeperiods.cfg"; break; - case "tbl_command": $strFile = "commands.cfg"; break; - case "tbl_contact": $strFile = "contacts.cfg"; break; - case "tbl_contacttemplate": $strFile = "contacttemplates.cfg"; break; - case "tbl_contactgroup": $strFile = "contactgroups.cfg"; break; - case "tbl_hosttemplate": $strFile = "hosttemplates.cfg"; break; - case "tbl_servicetemplate": $strFile = "servicetemplates.cfg"; break; - case "tbl_hostgroup": $strFile = "hostgroups.cfg"; break; - case "tbl_servicegroup": $strFile = "servicegroups.cfg"; break; - case "tbl_servicedependency": $strFile = "servicedependencies.cfg"; break; - case "tbl_hostdependency": $strFile = "hostdependencies.cfg"; break; - case "tbl_serviceescalation": $strFile = "serviceescalations.cfg"; break; - case "tbl_hostescalation": $strFile = "hostescalations.cfg"; break; - case "tbl_hostextinfo": $strFile = "hostextinfo.cfg"; break; - case "tbl_serviceextinfo": $strFile = "serviceextinfo.cfg"; break; - default: $strFile = $chkConfig.".cfg"; +$arrConfig = $myConfigClass->getConfData(); +if (isset($arrConfig[$chkTable])) { + $strFile = $arrConfig[$chkTable]['filename']; +} else { + $strFile = $chkConfig. '.cfg'; } -if ($strFile == ".cfg") exit; -header("Content-Disposition: attachment; filename=".$strFile); -header("Content-Type: text/plain"); +if ($strFile == '.cfg') { + exit; +} +header('Content-Disposition: attachment; filename=' .$strFile); +header('Content-Type: text/plain'); // // Get data // ======== if ($chkLine == 0) { - $myConfigClass->createConfig($chkTable,1); + $myConfigClass->createConfig($chkTable, 1); } else { - $myConfigClass->createConfigSingle($chkTable,$chkLine,1); + $myConfigClass->createConfigSingle($chkTable, $chkLine, 1); } -$myDataClass->writeLog(translate('Download')." ".$strFile); -?> \ No newline at end of file +$myDataClass->writeLog(translate('Download'). ' ' .$strFile); diff --git a/admin/group.php b/admin/group.php index ea8e043..14ecf77 100644 --- a/admin/group.php +++ b/admin/group.php @@ -5,161 +5,197 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Group administration -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 33; -$preContent = "admin/group.tpl.htm"; -$preSearchSession = 'group'; -$preTableName = 'tbl_group'; -$preKeyField = 'groupname'; -$preAccess = 1; -$preFieldvars = 1; -$preNoAccessGrp = 1; +$prePageId = 33; +$preContent = 'admin/group.htm.tpl'; +$preListTpl = 'admin/datalist_common.htm.tpl'; +$preSearchSession = 'group'; +$preTableName = 'tbl_group'; +$preKeyField = 'groupname'; +$preAccess = 1; +$preFieldvars = 1; +$preNoAccessGrp = 1; +$arrDataLines = array(); // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); -// +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; +// // Add or modify data // ================== -if (($chkModus == "insert") || ($chkModus == "modify")) { - $strSQLx = "`$preTableName` SET `groupname`='$chkTfValue1', `description`='$chkTfValue2', `active`='$chkActive', `last_modified`=NOW()"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && ($chkTfValue2 != "")) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - if ($chkModus == "insert") $myDataClass->writeLog(translate('A new group added:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('User modified:')." ".$chkTfValue1); - // - // Insert/update user/group data from session data - // =============================================== - if ($chkModus == "modify") { - $strSQL = "DELETE FROM `tbl_lnkGroupToUser` WHERE `idMaster`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['groupuser']) && is_array($_SESSION['groupuser']) && (count($_SESSION['groupuser']) != 0)) { - foreach($_SESSION['groupuser'] AS $elem) { - if ($elem['status'] == 0) { - $intRead = 0; $intWrite = 0; $intLink = 0; - if (substr_count($elem['rights'],"READ") != 0) $intRead = 1; - if (substr_count($elem['rights'],"WRITE") != 0) $intWrite = 1; - if (substr_count($elem['rights'],"LINK") != 0) $intLink = 1; - if ($intWrite == 1) {$intRead = 1;$intLink = 1;} - if ($intRead == 1) {$intLink = 1;} - // if ($intLink == 1) $intRead = 1; - $strSQL = "INSERT INTO `tbl_lnkGroupToUser` (`idMaster`,`idSlave`,`read`,`write`,`link`) - VALUES ($chkDataId,".$elem['user'].",'$intRead','$intWrite','$intLink')"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - } - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - - } - $chkModus = "display"; +if (($chkModus == 'insert') || ($chkModus == 'modify')) { + $strSQLx = "`$preTableName` SET `groupname`='$chkTfValue1', `description`='$chkTfValue2', `active`='$chkActive', " + . '`last_modified`=NOW()'; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && ($chkTfValue2 != '')) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('A new group added:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('User modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update user/group data from session data + // =============================================== + if ($chkModus == 'modify') { + $strSQL = "DELETE FROM `tbl_lnkGroupToUser` WHERE `idMaster`=$chkDataId"; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['groupuser']) && is_array($_SESSION['groupuser']) && + (count($_SESSION['groupuser']) != 0)) { + foreach ($_SESSION['groupuser'] as $elem) { + if ($elem['status'] == 0) { + $intRead = 0; + $intWrite = 0; + $intLink = 0; + if (substr_count($elem['rights'], 'READ') != 0) { + $intRead = 1; + } + if (substr_count($elem['rights'], 'WRITE') != 0) { + $intWrite = 1; + } + if (substr_count($elem['rights'], 'LINK') != 0) { + $intLink = 1; + } + if ($intWrite == 1) { + $intRead = 1; + $intLink = 1; + } + if ($intRead == 1) { + $intLink = 1; + } + // if ($intLink == 1) $intRead = 1; + $strSQL = 'INSERT INTO `tbl_lnkGroupToUser` (`idMaster`,`idSlave`,`read`,`write`,' + . "`link`) VALUES ($chkDataId,".$elem['user'].",'$intRead','$intWrite'," + . "'$intLink')"; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Group administration')); -$conttp->parse("header"); -$conttp->show("header"); // // Singe data form // =============== -if ($chkModus == "add") { - // Process data fields - $strSQL = "SELECT * FROM tbl_user WHERE id <> 1 ORDER BY username"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($booReturn && ($intDataCount != 0)) { - foreach($arrDataLines AS $elem) { - $conttp->setVariable("DAT_USER_ID",$elem['id']); - $conttp->setVariable("DAT_USER",$elem['username']); - $conttp->parse("users"); - } - } - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - $conttp->setVariable("LANG_READ",translate("Read")); - $conttp->setVariable("LANG_WRITE",translate("Write")); - $conttp->setVariable("LANG_LINK",translate("Link")); - $conttp->setVariable("DAT_ID",$chkListId); - $conttp->setVariable("FILL_ALLFIELDS",translate('Please fill in all fields marked with an *')); - $conttp->setVariable("FILL_ILLEGALCHARS",translate('The following field contains not permitted characters:')); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,0,''); - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + // Process data fields + $strSQL = 'SELECT * FROM `tbl_user` WHERE `id`<>1 ORDER BY `username`'; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrDataLines as $elem) { + $conttp->setVariable('DAT_USER_ID', $elem['id']); + $conttp->setVariable('DAT_USER', $elem['username']); + $conttp->parse('users'); + } + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + $conttp->setVariable('TITLE', translate('Group administration')); + $conttp->setVariable('LANG_READ', translate('Read')); + $conttp->setVariable('LANG_WRITE', translate('Write')); + $conttp->setVariable('LANG_LINK', translate('Link')); + $conttp->setVariable('DAT_ID', $chkListId); + $conttp->setVariable('FILL_ALLFIELDS', translate('Please fill in all fields marked with an *')); + $conttp->setVariable('FILL_ILLEGALCHARS', translate('The following field contains illegal characters:')); + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, 0, ''); + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Groupname')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Row sorting - $strOrderString = "ORDER BY `groupname` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `description` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName`"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `groupname`, `description`, `active` FROM `$preTableName` $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'description'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Group administration')); + $mastertp->setVariable('FIELD_1', translate('Groupname')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Row sorting + $strOrderString = "ORDER BY `groupname` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `description` $hidSortDir"; + } + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName`"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = 'SELECT `id`, `groupname`, `description`, `active` ' + . "FROM `$preTableName` $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'description'); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,'','',1); +$myContentClass->showMessages($mastertp, $strErrorMessage, $strInfoMessage, $strConsistMessage, array(), '', 1); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/groupusers.php b/admin/groupusers.php index b33b215..a4896ad 100644 --- a/admin/groupusers.php +++ b/admin/groupusers.php @@ -5,146 +5,171 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin time definition list -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= $preAccess = 1; -//$prePageId = 33; $preNoMain = 1; -require("../functions/prepend_adm.php"); +require $preBasePath.'functions/prepend_adm.php'; // // Process get parameters // ====================== -$chkDataId = isset($_GET['dataId']) ? htmlspecialchars($_GET['dataId'], ENT_QUOTES, 'utf-8') : 0; -$chkMode = isset($_GET['mode']) ? htmlspecialchars($_GET['mode'], ENT_QUOTES, 'utf-8') : ""; -$chkUser = isset($_GET['user']) ? htmlspecialchars($_GET['user'], ENT_QUOTES, 'utf-8') : ""; -$chkRights = isset($_GET['rights']) ? htmlspecialchars($_GET['rights'], ENT_QUOTES, 'utf-8') : ""; -$chkId = isset($_GET['id']) ? htmlspecialchars($_GET['id'], ENT_QUOTES, 'utf-8') : ""; -$chkVersion = isset($_GET['version']) ? htmlspecialchars($_GET['version'], ENT_QUOTES, 'utf-8') : 0; -$chkLinkTab = isset($_GET['linktab']) ? htmlspecialchars($_GET['linktab'], ENT_QUOTES, 'utf-8') : ""; -if (substr_count($chkRights,"-")) { - $arrRights = explode("-",$chkRights); - $strRights = ""; - if ($arrRights[0] == 1) $strRights .= "READ,"; - if ($arrRights[1] == 1) $strRights .= "WRITE,"; - if ($arrRights[2] == 1) $strRights .= "LINK,"; - if ($strRights != "") $strRights = substr($strRights,0,-1); - $chkRights = $strRights; +$chkDataId = filter_input(INPUT_GET, 'dataId', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkVersion = filter_input(INPUT_GET, 'version', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkMode = filter_input(INPUT_GET, 'mode', FILTER_SANITIZE_STRING); +$chkUser = filter_input(INPUT_GET, 'user', FILTER_SANITIZE_STRING); +$chkRights = filter_input(INPUT_GET, 'rights', FILTER_SANITIZE_STRING); +$chkId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); +$chkLinkTab = filter_input(INPUT_GET, 'linktab', FILTER_SANITIZE_STRING); +if (substr_count($chkRights, '-')) { + $arrRights = explode('-', $chkRights); + $strRights = ''; + if ($arrRights[0] == 1) { + $strRights .= 'READ,'; + } + if ($arrRights[1] == 1) { + $strRights .= 'WRITE,'; + } + if ($arrRights[2] == 1) { + $strRights .= 'LINK,'; + } + if ($strRights != '') { + $strRights = substr($strRights, 0, -1); + } + $chkRights = $strRights; } if (get_magic_quotes_gpc() == 0) { - $chkUser = addslashes($chkUser); - $chkRights = addslashes($chkRights); + $chkUser = addslashes($chkUser); + $chkRights = addslashes($chkRights); } // // Get datasets // ============ -if ($chkLinkTab != "") { - $strSQL = "SELECT * FROM `tbl_user` LEFT JOIN `".$chkLinkTab."` ON `id`=`idSlave` WHERE `idMaster`=$chkDataId ORDER BY `username`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - // - // Write data to session - // ===================== - if ($chkMode == "") { - $_SESSION['groupuser'] = ""; - if ($intDataCount != 0) { - foreach ($arrDataLines AS $elem) { - $arrTemp['id'] = $elem['id']; - $arrTemp['user'] = $elem['id']; - $strRights = ""; - if ($elem['read'] == 1) $strRights .= "READ,"; - if ($elem['write'] == 1) $strRights .= "WRITE,"; - if ($elem['link'] == 1) $strRights .= "LINK,"; - if ($strRights != "") $strRights = substr($strRights,0,-1); - $arrTemp['rights'] = $strRights; - $arrTemp['status'] = 0; - $_SESSION['groupuser'][] = $arrTemp; - } - } - } +if ($chkLinkTab != '') { + $strSQL = 'SELECT * FROM `tbl_user` LEFT JOIN `' .$chkLinkTab. '` ON `id`=`idSlave` ' + . "WHERE `idMaster`=$chkDataId ORDER BY `username`"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + // + // Write data to session + // ===================== + if ($chkMode == '') { + $_SESSION['groupuser'] = array(); + if ($intDataCount != 0) { + foreach ($arrDataLines as $elem) { + $arrTemp['id'] = $elem['id']; + $arrTemp['user'] = $elem['id']; + $strRights = ''; + if ($elem['read'] == 1) { + $strRights .= 'READ,'; + } + if ($elem['write'] == 1) { + $strRights .= 'WRITE,'; + } + if ($elem['link'] == 1) { + $strRights .= 'LINK,'; + } + if ($strRights != '') { + $strRights = substr($strRights, 0, -1); + } + $arrTemp['rights'] = $strRights; + $arrTemp['status'] = 0; + $_SESSION['groupuser'][] = $arrTemp; + } + } + } } // // Add mode // ======== -if ($chkMode == "add") { - if (isset($_SESSION['groupuser']) && is_array($_SESSION['groupuser'])) { - $intCheck = 0; - foreach ($_SESSION['groupuser'] AS $key => $elem) { - if (($elem['user'] == $chkUser) && ($elem['status'] == 0)) { - $_SESSION['groupuser'][$key]['user'] = $chkUser; - $_SESSION['groupuser'][$key]['rights'] = $chkRights; - $intCheck = 1; - } - } - if ($intCheck == 0) { - $arrTemp['id'] = 0; - $arrTemp['user'] = $chkUser; - $arrTemp['rights'] = $chkRights; - $arrTemp['status'] = 0; - $_SESSION['groupuser'][] = $arrTemp; - } - } else { - $arrTemp['id'] = 0; - $arrTemp['user'] = $chkUser; - $arrTemp['rights'] = $chkRights; - $arrTemp['status'] = 0; - $_SESSION['groupuser'][] = $arrTemp; - } +if ($chkMode == 'add') { + if (isset($_SESSION['groupuser']) && is_array($_SESSION['groupuser'])) { + $intCheck = 0; + foreach ($_SESSION['groupuser'] as $key => $elem) { + if (($elem['user'] == $chkUser) && ($elem['status'] == 0)) { + $_SESSION['groupuser'][$key]['user'] = $chkUser; + $_SESSION['groupuser'][$key]['rights'] = $chkRights; + $intCheck = 1; + } + } + if ($intCheck == 0) { + $arrTemp['id'] = 0; + $arrTemp['user'] = $chkUser; + $arrTemp['rights'] = $chkRights; + $arrTemp['status'] = 0; + $_SESSION['groupuser'][] = $arrTemp; + } + } else { + $arrTemp['id'] = 0; + $arrTemp['user'] = $chkUser; + $arrTemp['rights'] = $chkRights; + $arrTemp['status'] = 0; + $_SESSION['groupuser'] = array(); + $_SESSION['groupuser'][] = $arrTemp; + } } // // Deletion mode // ============= -if ($chkMode == "del") { - if (isset($_SESSION['groupuser']) && is_array($_SESSION['groupuser'])) { - foreach ($_SESSION['groupuser'] AS $key => $elem) { - if (($elem['user'] == $chkUser) && ($elem['status'] == 0)) { - $_SESSION['groupuser'][$key]['status'] = 1; - } - } - } +if ($chkMode == 'del' && isset($_SESSION['groupuser']) && is_array($_SESSION['groupuser'])) { + foreach ($_SESSION['groupuser'] as $key => $elem) { + if (($elem['user'] == $chkUser) && ($elem['status'] == 0)) { + $_SESSION['groupuser'][$key]['status'] = 1; + } + } } ?> - - + + None - - - - - + + + + +
getFieldData("SELECT username FROM tbl_user WHERE id=".$elem['user']); -?> +if (isset($_SESSION['groupuser']) && is_array($_SESSION['groupuser']) && (count($_SESSION['groupuser']) != 0)) { + foreach ($_SESSION['groupuser'] as $elem) { + if ($elem['status'] == 0) { + $strUser = $myDBClass->getFieldData('SELECT `username` FROM `tbl_user` WHERE `id`=' .$elem['user']); ?> - - + + @@ -152,8 +177,8 @@ if ($chkMode == "del") { -
<?php echo translate('Delete'); ?><?php
+                    echo translate('Delete'); ?>
 
- + + \ No newline at end of file diff --git a/admin/helpedit.php b/admin/helpedit.php index 1046209..40b7cc1 100644 --- a/admin/helpedit.php +++ b/admin/helpedit.php @@ -5,149 +5,174 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Help text editor -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 39; -$preContent = "admin/helpedit.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; -$setSaveLangId = "private"; +$prePageId = 39; +$preContent = 'admin/helpedit.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; +$setSaveLangId = 'private'; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Process post parameters // ======================= -$chkHidVersion = isset($_POST['hidVersion']) ? $_POST['hidVersion'] : "all"; -$chkKey1 = isset($_POST['selInfoKey1']) ? $_POST['selInfoKey1'] : ""; -$chkKey2 = isset($_POST['selInfoKey2']) ? $_POST['selInfoKey2'] : ""; -$chkVersion = isset($_POST['selInfoVersion']) ? $_POST['selInfoVersion'] : ""; -// -// Add or modify data -// ================== -if (($chkTaValue1 != "") && ($chkTfValue3 == "1")) { - $strSQL = "SELECT `infotext` FROM `tbl_info` - WHERE `key1` = '$chkTfValue1' AND `key2` = '$chkTfValue2' AND `version` = '$chkHidVersion' - AND `language` = '$setSaveLangId'"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($intDataCount == 0) { - $strSQL = "INSERT INTO `tbl_info` (`key1`,`key2`,`version`,`language`,`infotext`) - VALUES ('$chkTfValue1','$chkTfValue2','$chkHidVersion','$setSaveLangId','$chkTaValue1')"; - } else { - $strSQL = "UPDATE `tbl_info` SET `infotext` = '$chkTaValue1' - WHERE `key1` = '$chkTfValue1' AND `key2` = '$chkTfValue2' AND `version` = '$chkHidVersion' - AND `language` = '$setSaveLangId'"; - } - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - } +$chkHidVersion = filter_input(INPUT_POST, 'hidVersion', 513, array('options' => array('default' => 'all'))); +$chkKey1 = filter_input(INPUT_POST, 'selInfoKey1', FILTER_SANITIZE_STRING); +$chkKey2 = filter_input(INPUT_POST, 'selInfoKey2', FILTER_SANITIZE_STRING); +$chkVersion = filter_input(INPUT_POST, 'selInfoVersion', FILTER_SANITIZE_STRING); +// +// Quote special characters +// ========================== +if (get_magic_quotes_gpc() == 0) { + $chkHidVersion = addslashes($chkHidVersion); + $chkKey1 = addslashes($chkKey1); + $chkKey2 = addslashes($chkKey2); + $chkVersion = addslashes($chkVersion); } // -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Help text editor')); -$conttp->parse("header"); -$conttp->show("header"); +// Security function for text fields +// ================================= +$chkHidVersion = $myVisClass->tfSecure($chkHidVersion); +$chkKey1 = $myVisClass->tfSecure($chkKey1); +$chkKey2 = $myVisClass->tfSecure($chkKey2); +$chkVersion = $myVisClass->tfSecure($chkVersion); +// +// Add or modify data +// ================== +if (($chkTaFileTextRaw != '') && ($chkTfValue3 == '1')) { + $strSQL = "SELECT `infotext` FROM `tbl_info` WHERE `key1`='$chkTfValue1' AND `key2`='$chkTfValue2' " + . "AND `version`='$chkHidVersion' AND `language`='$setSaveLangId'"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($intDataCount == 0) { + $strSQL = 'INSERT INTO `tbl_info` (`key1`,`key2`,`version`,`language`,`infotext`) ' + . "VALUES ('$chkTfValue1','$chkTfValue2','$chkHidVersion','$setSaveLangId','$chkTaFileTextRaw')"; + } else { + $strSQL = "UPDATE `tbl_info` SET `infotext` = '$chkTaFileTextRaw' WHERE `key1` = '$chkTfValue1' " + . "AND `key2` = '$chkTfValue2' AND `version` = '$chkHidVersion' AND `language` = '$setSaveLangId'"; + } + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + } +} // // Singe data form // =============== -$conttp->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); -$conttp->setVariable("MAINSITE",$_SESSION['SETS']['path']['base_url']."admin.php"); -foreach($arrDescription AS $elem) { - $conttp->setVariable($elem['name'],$elem['string']); +$conttp->setVariable('TITLE', translate('Help text editor')); +$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$conttp->setVariable('MAINSITE', $_SESSION['SETS']['path']['base_url']. 'admin.php'); +foreach ($arrDescription as $elem) { + $conttp->setVariable($elem['name'], $elem['string']); +} +$conttp->setVariable('INFOKEY_1', translate('Main key')); +$conttp->setVariable('INFOKEY_2', translate('Sub key')); +$conttp->setVariable('INFO_LANG', translate('Language')); +$conttp->setVariable('INFO_VERSION', translate('Nagios version')); +$conttp->setVariable('LOAD_DEFAULT', translate('Load default text')); +if ($chkChbValue1 == '1') { + $conttp->setVariable('DEFAULT_CHECKED', 'checked'); } -$conttp->setVariable("INFOKEY_1",translate('Main key')); -$conttp->setVariable("INFOKEY_2",translate('Sub key')); -$conttp->setVariable("INFO_LANG",translate('Language')); -$conttp->setVariable("INFO_VERSION",translate('Nagios version')); -$conttp->setVariable("LOAD_DEFAULT",translate('Load default text')); -if ($chkChbValue1 == "1") $conttp->setVariable("DEFAULT_CHECKED","checked"); // // Get Key // ======= -$strSQL = "SELECT DISTINCT `key1` FROM `tbl_info` ORDER BY `key1`"; -$booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); +$arrData = array(); +$strSQL = 'SELECT DISTINCT `key1` FROM `tbl_info` ORDER BY `key1`'; +$booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); if ($intDataCount != 0) { - foreach ($arrData AS $elem) { - $conttp->setVariable("INFOKEY_1_VAL",$elem['key1']); - if ($chkKey1 == $elem['key1']) { - $conttp->setVariable("INFOKEY_1_SEL","selected"); - $conttp->setVariable("INFOKEY_1_SEL_VAL",$elem['key1']); - } - $conttp->parse("infokey1"); - } + foreach ($arrData as $elem) { + $conttp->setVariable('INFOKEY_1_VAL', $elem['key1']); + if ($chkKey1 == $elem['key1']) { + $conttp->setVariable('INFOKEY_1_SEL', 'selected'); + $conttp->setVariable('INFOKEY_1_SEL_VAL', $elem['key1']); + } + $conttp->parse('infokey1'); + } } -if ($chkKey1 != "") { - $strSQL = "SELECT DISTINCT `key2` FROM `tbl_info` WHERE `key1` = '$chkKey1' ORDER BY `key1`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($intDataCount != 0) { - foreach ($arrData AS $elem) { - $conttp->setVariable("INFOKEY_2_VAL",$elem['key2']); - if ($chkKey2 == $elem['key2']) { - $conttp->setVariable("INFOKEY_2_SEL","selected"); - $conttp->setVariable("INFOKEY_2_SEL_VAL",$elem['key2']); - } - $conttp->parse("infokey2"); - } - } +if ($chkKey1 != '') { + $strSQL = "SELECT DISTINCT `key2` FROM `tbl_info` WHERE `key1` = '$chkKey1' ORDER BY `key1`"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($intDataCount != 0) { + foreach ($arrData as $elem) { + $conttp->setVariable('INFOKEY_2_VAL', $elem['key2']); + if ($chkKey2 == $elem['key2']) { + $conttp->setVariable('INFOKEY_2_SEL', 'selected'); + $conttp->setVariable('INFOKEY_2_SEL_VAL', $elem['key2']); + } + $conttp->parse('infokey2'); + } + } } -if (($chkKey1 != "") && ($chkKey2 != "")) { - $strSQL = "SELECT DISTINCT `version` FROM `tbl_info` WHERE `key1` = '$chkKey1' AND `key2` = '$chkKey2' ORDER BY `version`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($intDataCount != 0) { - if (($intDataCount == 1) && ($chkVersion == "")) $chkVersion = $arrData[0]['version']; - foreach ($arrData AS $elem) { - $conttp->setVariable("INFOVERSION_2_VAL",$elem['version']); - if ($chkVersion == $elem['version']) { - $conttp->setVariable("INFOVERSION_2_SEL","selected"); - $conttp->setVariable("INFOVERSION_2_SEL_VAL",$elem['version']); - } - $conttp->parse("infoversion"); - } - } +if (($chkKey1 != '') && ($chkKey2 != '')) { + $strSQL = 'SELECT DISTINCT `version` FROM `tbl_info` ' + . "WHERE `key1` = '$chkKey1' AND `key2` = '$chkKey2' ORDER BY `version`"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($intDataCount != 0) { + if (($intDataCount == 1) && ($chkVersion == '')) { + $chkVersion = $arrData[0]['version']; + } + foreach ($arrData as $elem) { + $conttp->setVariable('INFOVERSION_2_VAL', $elem['version']); + if ($chkVersion == $elem['version']) { + $conttp->setVariable('INFOVERSION_2_SEL', 'selected'); + $conttp->setVariable('INFOVERSION_2_SEL_VAL', $elem['version']); + } + $conttp->parse('infoversion'); + } + } } // // Insert content // ============== -if (($chkKey1 != "") && ($chkKey2 != "") && ($chkVersion != "")) { - $strSQL = "SELECT `infotext` FROM `tbl_info` - WHERE `key1` = '$chkKey1' AND `key2` = '$chkKey2' AND `version` = '$chkVersion' AND `language` = '$setSaveLangId'"; - $strContentDB = $myDBClass->getFieldData($strSQL); - if (($chkChbValue1 == 1) || ($strContentDB == "")) { - $strSQL = "SELECT `infotext` FROM `tbl_info` - WHERE `key1` = '$chkKey1' AND `key2` = '$chkKey2' AND `version` = '$chkVersion' AND `language` = 'default'"; - $strContentDB = $myDBClass->getFieldData($strSQL); - } - $conttp->setVariable("DAT_HELPTEXT",$strContentDB); +if (($chkKey1 != '') && ($chkKey2 != '') && ($chkVersion != '')) { + $strSQL = "SELECT `infotext` FROM `tbl_info` WHERE `key1`='$chkKey1' AND `key2`='$chkKey2' " + . "AND `version`='$chkVersion' AND `language`='$setSaveLangId'"; + $strContentDB = $myDBClass->getFieldData($strSQL); + if (($chkChbValue1 == 1) || ($strContentDB == '')) { + $strSQL = "SELECT `infotext` FROM `tbl_info` WHERE `key1`='$chkKey1' AND `key2`='$chkKey2' " + . "AND `version`='$chkVersion' AND `language`='default'"; + $strContentDB = $myDBClass->getFieldData($strSQL); + } + $conttp->setVariable('DAT_HELPTEXT', $strContentDB); } // Messages -if ($strErrorMessage != "") $conttp->setVariable("ERRORMESSAGE",$strErrorMessage); -if ($strInfoMessage != "") $conttp->setVariable("INFOMESSAGE",$strInfoMessage); +if ($strErrorMessage != '') { + $conttp->setVariable('ERRORMESSAGE', $strErrorMessage); +} +if ($strInfoMessage != '') { + $conttp->setVariable('INFOMESSAGE', $strInfoMessage); +} // Check access rights for adding new objects -if ($myVisClass->checkAccGroup($prePageKey,'write') != 0) $conttp->setVariable("ADD_CONTROL","disabled=\"disabled\""); -$conttp->parse("helpedit"); -$conttp->show("helpedit"); +if ($myVisClass->checkAccountGroup($prePageKey, 'write') != 0) { + $conttp->setVariable('ADD_CONTROL', 'disabled="disabled"'); +} +$conttp->parse('helpedit'); +$conttp->show('helpedit'); // // Process footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/hostdependencies.php b/admin/hostdependencies.php index a15e91a..63d8df4 100644 --- a/admin/hostdependencies.php +++ b/admin/hostdependencies.php @@ -5,225 +5,389 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Host dependencies definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 19; -$preContent = "admin/hostdependencies.tpl.htm"; -$preSearchSession = 'hostdependencies'; -$preTableName = 'tbl_hostdependency'; -$preKeyField = 'config_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 19; +$preContent = 'admin/hostdependencies.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'hostdependencies'; +$preTableName = 'tbl_hostdependency'; +$preKeyField = 'config_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Data processing // =============== -$strEO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e,0,-1); -$strNO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e,0,-1); -// +$strEO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e, 0, -1); +$strNO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e, 0, -1); +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `dependent_host_name`=$intMselValue1, `host_name`=$intMselValue2, `dependent_hostgroup_name`=$intMselValue3, - `hostgroup_name`=$intMselValue4, `inherits_parent`='$chkChbValue1', `execution_failure_criteria`='$strEO', `notification_failure_criteria`='$strNO', - `dependency_period`=$chkSelValue1, $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if ((($intMselValue1 != 0) && ($intMselValue2 != 0)) || (($intMselValue3 != 0) && ($intMselValue4 != 0)) || - (($intMselValue1 != 0) && ($intMselValue4 != 0)) || (($intMselValue3 != 0) && ($intMselValue2 != 0))) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New host dependency inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Host dependency modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkHostdependencyToHost_DH",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkHostdependencyToHost_H",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) $intRet3 = $myDataClass->dataInsertRelation("tbl_lnkHostdependencyToHostgroup_DH",$chkDataId,$chkMselValue3); - if (isset($intRet3) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) $intRet4 = $myDataClass->dataInsertRelation("tbl_lnkHostdependencyToHostgroup_H",$chkDataId,$chkMselValue4); - if (isset($intRet4) && ($intRet4 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkHostdependencyToHost_DH",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkHostdependencyToHost_DH",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkHostdependencyToHost_H",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkHostdependencyToHost_H",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) { - $intRet3 = $myDataClass->dataUpdateRelation("tbl_lnkHostdependencyToHostgroup_DH",$chkDataId,$chkMselValue3); - } else { - $intRet3 = $myDataClass->dataDeleteRelation("tbl_lnkHostdependencyToHostgroup_DH",$chkDataId); - } - if ($intRet3 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) { - $intRet4 = $myDataClass->dataUpdateRelation("tbl_lnkHostdependencyToHostgroup_H",$chkDataId,$chkMselValue4); - } else { - $intRet4 = $myDataClass->dataDeleteRelation("tbl_lnkHostdependencyToHostgroup_H",$chkDataId); - } - if ($intRet4 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2 + $intRet3 + $intRet4) != 0) $strInfoMessage = ""; - // - // Update Import HASH - // ================== - $booReturn = $myDataClass->updateHash($preTableName,$chkDataId); - if ($booReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `dependent_host_name`=$intMselValue1, " + . "`host_name`=$intMselValue2, `dependent_hostgroup_name`=$intMselValue3, `hostgroup_name`=$intMselValue4, " + . "`inherits_parent`='$chkChbValue1', `execution_failure_criteria`='$strEO', " + . "`notification_failure_criteria`='$strNO', `dependency_period`=$chkSelValue1, $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if ((($intMselValue1 != 0) && ($intMselValue2 != 0)) || (($intMselValue3 != 0) && ($intMselValue4 != 0)) || + (($intMselValue1 != 0) && ($intMselValue4 != 0)) || (($intMselValue3 != 0) && ($intMselValue2 != 0))) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New host dependency inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Host dependency modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostdependencyToHost_DH', + $chkDataId, + $chkMselValue1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostdependencyToHost_H', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostdependencyToHostgroup_DH', + $chkDataId, + $chkMselValue3 + ); + } + if (isset($intRet3) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostdependencyToHostgroup_H', + $chkDataId, + $chkMselValue4 + ); + } + if (isset($intRet4) && ($intRet4 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostdependencyToHost_DH', + $chkDataId, + $chkMselValue1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkHostdependencyToHost_DH', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostdependencyToHost_H', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkHostdependencyToHost_H', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostdependencyToHostgroup_DH', + $chkDataId, + $chkMselValue3 + ); + } else { + $intRet3 = $myDataClass->dataDeleteRelation('tbl_lnkHostdependencyToHostgroup_DH', $chkDataId); + } + if ($intRet3 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostdependencyToHostgroup_H', + $chkDataId, + $chkMselValue4 + ); + } else { + $intRet4 = $myDataClass->dataDeleteRelation('tbl_lnkHostdependencyToHostgroup_H', $chkDataId); + } + if ($intRet4 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2 + $intRet3 + $intRet4) != 0) { + $strInfoMessage = ''; + } + // + // Update Import HASH + // ================== + $booReturn = $myDataClass->updateHash($preTableName, $chkDataId); + if ($booReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define host dependencies (hostdependencies.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process host selection field - if (isset($arrModifyData['dependent_host_name'])) {$intFieldId = $arrModifyData['dependent_host_name'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_host','host_name','depend_host','tbl_lnkHostdependencyToHost_DH',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['host_name'])) {$intFieldId = $arrModifyData['host_name'];} else {$intFieldId = 0;} - $intReturn1 = $myVisClass->parseSelectMulti('tbl_host','host_name','host','tbl_lnkHostdependencyToHost_H',2,$intFieldId); - if ($intReturn1 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process time period selection field - if (isset($arrModifyData['dependency_period'])) {$intFieldId = $arrModifyData['dependency_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','timeperiod',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process host group selection field - if (isset($arrModifyData['dependent_hostgroup_name'])) {$intFieldId = $arrModifyData['dependent_hostgroup_name'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_hostgroup','hostgroup_name','depend_hostgroup','tbl_lnkHostdependencyToHostgroup_DH',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['hostgroup_name'])) {$intFieldId = $arrModifyData['hostgroup_name'];} else {$intFieldId = 0;} - $intReturn2 = $myVisClass->parseSelectMulti('tbl_hostgroup','hostgroup_name','hostgroup','tbl_lnkHostdependencyToHostgroup_H',2,$intFieldId); - if ($intReturn2 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (($intReturn1 != 0) && ($intReturn2 != 0)) { - $myVisClass->processMessage(translate('Attention, no hosts and hostgroups defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo); - if ($arrModifyData['inherits_parent'] == 1) $conttp->setVariable("ACT_INHERIT","checked"); - foreach(explode(",",$arrModifyData['execution_failure_criteria']) AS $elem) { - $conttp->setVariable("DAT_EO".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['notification_failure_criteria']) AS $elem) { - $conttp->setVariable("DAT_NO".strtoupper($elem)."_CHECKED","checked"); - } - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Define host dependencies (hostdependencies.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process host selection field + if (isset($arrModifyData['dependent_host_name'])) { + $intFieldId = $arrModifyData['dependent_host_name']; + } else { + $intFieldId = 0; + } + $intReturn = $myVisClass->parseSelectMulti( + 'tbl_host', + 'host_name', + 'depend_host', + 'tbl_lnkHostdependencyToHost_DH', + 2, + $intFieldId + ); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['host_name'])) { + $intFieldId = $arrModifyData['host_name']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_host', + 'host_name', + 'host', + 'tbl_lnkHostdependencyToHost_H', + 2, + $intFieldId + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process time period selection field + if (isset($arrModifyData['dependency_period'])) { + $intFieldId = $arrModifyData['dependency_period']; + } else { + $intFieldId = 0; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'timeperiod', 1, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process host group selection field + if (isset($arrModifyData['dependent_hostgroup_name'])) { + $intFieldId = $arrModifyData['dependent_hostgroup_name']; + } else { + $intFieldId = 0; + } + $intReturn = $myVisClass->parseSelectMulti( + 'tbl_hostgroup', + 'hostgroup_name', + 'depend_hostgroup', + 'tbl_lnkHostdependencyToHostgroup_DH', + 2, + $intFieldId + ); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['hostgroup_name'])) { + $intFieldId = $arrModifyData['hostgroup_name']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectMulti( + 'tbl_hostgroup', + 'hostgroup_name', + 'hostgroup', + 'tbl_lnkHostdependencyToHostgroup_H', + 2, + $intFieldId + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn1 != 0) && ($intReturn2 != 0)) { + $myVisClass->processMessage(translate('Attention, no hosts and hostgroups defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo); + if ($arrModifyData['inherits_parent'] == 1) { + $conttp->setVariable('ACT_INHERIT', 'checked'); + } + foreach (explode(',', $arrModifyData['execution_failure_criteria']) as $elem) { + $conttp->setVariable('DAT_EO' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['notification_failure_criteria']) as $elem) { + $conttp->setVariable('DAT_NO' .strtoupper($elem). '_CHECKED', 'checked'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Config name')); - $mastertp->setVariable("FIELD_2",translate('Dependent hosts')." / ".translate('Dependent hostgroups')); - $mastertp->setVariable("DISABLE_SORT_2","disable"); - // Process search string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - $mastertp->setVariable("DISABLE_SORT_2","disable"); - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `dependent_host_name`, `dependent_hostgroup_name`, `register`, `active`, `config_id`, `access_group` - FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess) - $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'process_field',40); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define host dependencies (hostdependencies.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Config name')); + $mastertp->setVariable('FIELD_2', translate('Dependent hosts'). ' / ' .translate('Dependent hostgroups')); + $mastertp->setVariable('DISABLE_SORT_2', 'disable'); + // Process search string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + } + $mastertp->setVariable('DISABLE_SORT_2', 'disable'); + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` " + . "WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; + $booReturn = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `id`, `$preKeyField`, `dependent_host_name`, `dependent_hostgroup_name`, `register`, " + . "`active`, `config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND " + . "`access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData( + $mastertp, + $arrDataLines, + $intDataCount, + $intLineCount, + $preKeyField, + 'process_field', + 40 + ); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/hostescalations.php b/admin/hostescalations.php index 3b2daf8..1b2d063 100644 --- a/admin/hostescalations.php +++ b/admin/hostescalations.php @@ -5,222 +5,386 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Host escalation definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 20; -$preContent = "admin/hostescalations.tpl.htm"; -$preSearchSession = 'hostescalation'; -$preTableName = 'tbl_hostescalation'; -$preKeyField = 'config_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 20; +$preContent = 'admin/hostescalations.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'hostescalation'; +$preTableName = 'tbl_hostescalation'; +$preKeyField = 'config_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Data processing // =============== -$strEO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c,0,-1); -// +$strEO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c, 0, -1); +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `host_name`=$intMselValue3, `hostgroup_name`=$intMselValue4, `contacts`=$intMselValue1, - `contact_groups`=$intMselValue2, `first_notification`=$chkTfNullVal1, `last_notification`=$chkTfNullVal2, `notification_interval`=$chkTfNullVal3, - `escalation_period`='$chkSelValue1', `escalation_options`='$strEO', $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if ((($intMselValue3 != 0) || ($chkMselValue4 != 0)) && (($intMselValue1 != 0) || ($intMselValue2 != 0)) && - ($chkTfNullVal1 != "NULL") && ($chkTfNullVal2 != "NULL") && ($chkTfNullVal3 != "NULL")) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New host escalation inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Host escalation modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkHostescalationToContact",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkHostescalationToContactgroup",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) $intRet3 = $myDataClass->dataInsertRelation("tbl_lnkHostescalationToHost",$chkDataId,$chkMselValue3); - if (isset($intRet3) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) $intRet4 = $myDataClass->dataInsertRelation("tbl_lnkHostescalationToHostgroup",$chkDataId,$chkMselValue4); - if (isset($intRet4) && ($intRet4 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkHostescalationToContact",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkHostescalationToContact",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkHostescalationToContactgroup",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkHostescalationToContactgroup",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) { - $intRet3 = $myDataClass->dataUpdateRelation("tbl_lnkHostescalationToHost",$chkDataId,$chkMselValue3); - } else { - $intRet3 = $myDataClass->dataDeleteRelation("tbl_lnkHostescalationToHost",$chkDataId); - } - if ($intRet3 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) { - $intRet4 = $myDataClass->dataUpdateRelation("tbl_lnkHostescalationToHostgroup",$chkDataId,$chkMselValue4); - } else { - $intRet4 = $myDataClass->dataDeleteRelation("tbl_lnkHostescalationToHostgroup",$chkDataId); - } - if ($intRet4 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2 + $intRet3 + $intRet4) != 0) $strInfoMessage = ""; - // - // Update Import HASH - // ================== - $booReturn = $myDataClass->updateHash($preTableName,$chkDataId); - if ($booReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `host_name`=$intMselValue3, " + . "`hostgroup_name`=$intMselValue4, `contacts`=$intMselValue1, `contact_groups`=$intMselValue2, " + . "`first_notification`=$chkTfNullVal1, `last_notification`=$chkTfNullVal2, " + . "`notification_interval`=$chkTfNullVal3, `escalation_period`='$chkSelValue1', " + . "`escalation_options`='$strEO', $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if ((($intMselValue3 != 0) || ($chkMselValue4 != 0)) && (($intMselValue1 != 0) || ($intMselValue2 != 0)) && + ($chkTfNullVal1 != 'NULL') && ($chkTfNullVal2 != 'NULL') && ($chkTfNullVal3 != 'NULL')) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New host escalation inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Host escalation modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostescalationToContact', + $chkDataId, + $chkMselValue1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostescalationToContactgroup', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostescalationToHost', + $chkDataId, + $chkMselValue3 + ); + } + if (isset($intRet3) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostescalationToHostgroup', + $chkDataId, + $chkMselValue4 + ); + } + if (isset($intRet4) && ($intRet4 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostescalationToContact', + $chkDataId, + $chkMselValue1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkHostescalationToContact', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostescalationToContactgroup', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkHostescalationToContactgroup', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostescalationToHost', + $chkDataId, + $chkMselValue3 + ); + } else { + $intRet3 = $myDataClass->dataDeleteRelation('tbl_lnkHostescalationToHost', $chkDataId); + } + if ($intRet3 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostescalationToHostgroup', + $chkDataId, + $chkMselValue4 + ); + } else { + $intRet4 = $myDataClass->dataDeleteRelation('tbl_lnkHostescalationToHostgroup', $chkDataId); + } + if ($intRet4 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2 + $intRet3 + $intRet4) != 0) { + $strInfoMessage = ''; + } + // + // Update Import HASH + // ================== + $booReturn = $myDataClass->updateHash($preTableName, $chkDataId); + if ($booReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define host escalation (hostescalations.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process host and host group selection field - if (isset($arrModifyData['host_name'])) {$intFieldId = $arrModifyData['host_name'];} else {$intFieldId = 0;} - $intReturn1 = $myVisClass->parseSelectMulti('tbl_host','host_name','host','tbl_lnkHostescalationToHost',2,$intFieldId); - if ($intReturn1 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['hostgroup_name'])) {$intFieldId = $arrModifyData['hostgroup_name'];} else {$intFieldId = 0;} - $intReturn2 = $myVisClass->parseSelectMulti('tbl_hostgroup','hostgroup_name','hostgroup','tbl_lnkHostescalationToHostgroup',2,$intFieldId); - if ($intReturn2 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (($intReturn1 != 0) && ($intReturn2 != 0)) { - $myVisClass->processMessage(translate('Attention, no hosts and hostgroups defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process timeperiod selection field - if (isset($arrModifyData['escalation_period'])) {$intFieldId = $arrModifyData['escalation_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','escperiod',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process contact and contact group selection field - if (isset($arrModifyData['contacts'])) {$intFieldId = $arrModifyData['contacts'];} else {$intFieldId = 0;} - $intReturn1 = $myVisClass->parseSelectMulti('tbl_contact','contact_name','contact','tbl_lnkHostescalationToContact',2,$intFieldId); - if ($intReturn1 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['contact_groups'])) {$intFieldId = $arrModifyData['contact_groups'];} else {$intFieldId = 0;} - $intReturn2 = $myVisClass->parseSelectMulti('tbl_contactgroup','contactgroup_name','contactgroup','tbl_lnkHostescalationToContactgroup',2,$intFieldId); - if ($intReturn2 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (($intReturn1 != 0) && ($intReturn2 != 0)) { - $myVisClass->processMessage(translate('Attention, no contacts and contactgroups defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo); - foreach(explode(",",$arrModifyData['escalation_options']) AS $elem) { - $conttp->setVariable("DAT_EO".strtoupper($elem)."_CHECKED","checked"); - } - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Define host escalation (hostescalations.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process host and host group selection field + if (isset($arrModifyData['host_name'])) { + $intFieldId = $arrModifyData['host_name']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_host', + 'host_name', + 'host', + 'tbl_lnkHostescalationToHost', + 2, + $intFieldId + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['hostgroup_name'])) { + $intFieldId = $arrModifyData['hostgroup_name']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectMulti( + 'tbl_hostgroup', + 'hostgroup_name', + 'hostgroup', + 'tbl_lnkHostescalationToHostgroup', + 2, + $intFieldId + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn1 != 0) && ($intReturn2 != 0)) { + $myVisClass->processMessage(translate('Attention, no hosts and hostgroups defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process timeperiod selection field + if (isset($arrModifyData['escalation_period'])) { + $intFieldId = $arrModifyData['escalation_period']; + } else { + $intFieldId = 0; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'escperiod', 1, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process contact and contact group selection field + if (isset($arrModifyData['contacts'])) { + $intFieldId = $arrModifyData['contacts']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_contact', + 'contact_name', + 'contact', + 'tbl_lnkHostescalationToContact', + 2, + $intFieldId + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['contact_groups'])) { + $intFieldId = $arrModifyData['contact_groups']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectMulti( + 'tbl_contactgroup', + 'contactgroup_name', + 'contactgroup', + 'tbl_lnkHostescalationToContactgroup', + 2, + $intFieldId + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn1 != 0) && ($intReturn2 != 0)) { + $myVisClass->processMessage(translate('Attention, no contacts and contactgroups defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo); + foreach (explode(',', $arrModifyData['escalation_options']) as $elem) { + $conttp->setVariable('DAT_EO' .strtoupper($elem). '_CHECKED', 'checked'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Config name')); - $mastertp->setVariable("FIELD_2",translate('Hosts')." / ".translate('Host groups')); - // Process search string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - $mastertp->setVariable("DISABLE_SORT_2","disable"); - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `host_name`, `hostgroup_name`, `register`, `active`, `config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere - $strSearchWhere AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'process_field',40); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define host escalation (hostescalations.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Config name')); + $mastertp->setVariable('FIELD_2', translate('Hosts'). ' / ' .translate('Host groups')); + // Process search string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + } + $mastertp->setVariable('DISABLE_SORT_2', 'disable'); + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` " + . "WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; + $booReturn = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `id`, `$preKeyField`, `host_name`, `hostgroup_name`, `register`, `active`, `config_id`, " + . "`access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` " + . "IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData( + $mastertp, + $arrDataLines, + $intDataCount, + $intLineCount, + $preKeyField, + 'process_field', + 40 + ); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/hostextinfo.php b/admin/hostextinfo.php index 15d47b8..b98aca3 100644 --- a/admin/hostextinfo.php +++ b/admin/hostextinfo.php @@ -5,155 +5,198 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Host extended information definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 21; -$preContent = "admin/hostextinfo.tpl.htm"; -$preSearchSession = 'hostextinfo'; -$preTableName = 'tbl_hostextinfo'; -$preKeyField = 'host_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 21; +$preContent = 'admin/hostextinfo.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'hostextinfo'; +$preTableName = 'tbl_hostextinfo'; +$preKeyField = 'host_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); -// +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`=$chkSelValue1, `notes`='$chkTfValue1', `notes_url`='$chkTfValue2', `action_url`='$chkTfValue3', `icon_image`='$chkTfValue4', - `icon_image_alt`='$chkTfValue5', `vrml_image`='$chkTfValue6', `statusmap_image`='$chkTfValue7', `2d_coords`='$chkTfValue8', `3d_coords`='$chkTfValue9', - $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if ($chkSelValue1 != 0) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New host extended information inserted:')." ".$chkSelValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Host extended information modified:')." ".$chkSelValue1); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`=$chkSelValue1, `notes`='$chkTfValue1', `notes_url`='$chkTfValue2', " + . "`action_url`='$chkTfValue3', `icon_image`='$chkTfValue4', `icon_image_alt`='$chkTfValue5', " + . "`vrml_image`='$chkTfValue6', `statusmap_image`='$chkTfValue7', `2d_coords`='$chkTfValue8', " + . "`3d_coords`='$chkTfValue9', $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if ($chkSelValue1 != 0) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New host extended information inserted:'). ' ' .$chkSelValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Host extended information modified:'). ' ' .$chkSelValue1); + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define host extended information (hostextinfo.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - if (isset($arrModifyData[$preKeyField])) {$intFieldId = $arrModifyData[$preKeyField];} else {$intFieldId = 0;} - $intReturn1 = $myVisClass->parseSelectSimple('tbl_host',$preKeyField,'host',0,$intFieldId); - if ($intReturn1 != 0) { - $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - $myVisClass->processMessage(translate('Attention, no hosts defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion != 3) $conttp->setVariable("VERSION_20_VALUE_MUST","mselValue1,"); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo); - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Define host extended information (hostextinfo.cfg)')); + // Do not show modified time list + $intNoTime = 1; + if (isset($arrModifyData[$preKeyField])) { + $intFieldId = $arrModifyData[$preKeyField]; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectSimple('tbl_host', $preKeyField, 'host', 0, $intFieldId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + $myVisClass->processMessage(translate('Attention, no hosts defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion < 3) { + $conttp->setVariable('VERSION_20_VALUE_MUST', 'mselValue1,'); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo); + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Host name')); - $mastertp->setVariable("FIELD_2",translate('Notes')); - // Process search string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`tbl_host`.`$preKeyField` LIKE '%".$strSearchTxt."%' OR `$preTableName`.`notes` LIKE '%".$strSearchTxt."%' - OR `$preTableName`.`notes_url` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `$preTableName`.`config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `$preTableName`.`config_id`, `notes` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` LEFT JOIN `tbl_host` ON `$preTableName`.`$preKeyField`=`tbl_host`.`id` - WHERE $strDomainWhere $strSearchWhere AND `$preTableName`.`access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `$preTableName`.`id`, `tbl_host`.`$preKeyField`, `$preTableName`.`notes`, `$preTableName`.`register`, `$preTableName`.`active`, - `$preTableName`.`config_id`, `$preTableName`.`access_group` - FROM `$preTableName` LEFT JOIN `tbl_host` ON `$preTableName`.`$preKeyField` = `tbl_host`.`id` - WHERE $strDomainWhere $strSearchWhere AND `$preTableName`.`access_group` IN ($strAccess) - $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'notes'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define host extended information (hostextinfo.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Host name')); + $mastertp->setVariable('FIELD_2', translate('Notes')); + // Process search string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`tbl_host`.`$preKeyField` LIKE '%".$strSearchTxt."%' OR `$preTableName`.`notes` " + . "LIKE '%".$strSearchTxt."%' OR `$preTableName`.`notes_url` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `$preTableName`.`config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `$preTableName`.`config_id`, `notes` $hidSortDir"; + } + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` " + . "LEFT JOIN `tbl_host` ON `$preTableName`.`$preKeyField`=`tbl_host`.`id` " + . "WHERE $strDomainWhere $strSearchWhere AND `$preTableName`.`access_group` IN ($strAccess)"; + $booReturn = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `$preTableName`.`id`, `tbl_host`.`$preKeyField`, `$preTableName`.`notes`, " + . "`$preTableName`.`register`, `$preTableName`.`active`, `$preTableName`.`config_id`, " + . "`$preTableName`.`access_group` FROM `$preTableName` " + . "LEFT JOIN `tbl_host` ON `$preTableName`.`$preKeyField` = `tbl_host`.`id` " + . "WHERE $strDomainWhere $strSearchWhere AND `$preTableName`.`access_group` IN ($strAccess) $strOrderString " + . "LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'notes'); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/hostgroups.php b/admin/hostgroups.php index 0400047..6971795 100644 --- a/admin/hostgroups.php +++ b/admin/hostgroups.php @@ -5,178 +5,275 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Hostgroup definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 10; -$preContent = "admin/hostgroups.tpl.htm"; -$preSearchSession = 'hostgroup'; -$preTableName = 'tbl_hostgroup'; -$preKeyField = 'hostgroup_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 10; +$preContent = 'admin/hostgroups.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'hostgroup'; +$preTableName = 'tbl_hostgroup'; +$preKeyField = 'hostgroup_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); -// +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `members`=$intMselValue1, `hostgroup_members`=$intMselValue2, - `notes`='$chkTfValue3', `notes_url`='$chkTfValue4', `action_url`='$chkTfValue5', $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && ($chkTfValue2 != "") && (($intMselValue1 != 0) || ($intVersion == 3))) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New host group inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Host group modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkHostgroupToHost",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkHostgroupToHostgroup",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkHostgroupToHost",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkHostgroupToHost",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkHostgroupToHostgroup",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkHostgroupToHostgroup",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2) != 0) $strInfoMessage = ""; - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `members`=$intMselValue1, " + . "`hostgroup_members`=$intMselValue2, `notes`='$chkTfValue3', `notes_url`='$chkTfValue4', " + . "`action_url`='$chkTfValue5', $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && ($chkTfValue2 != '') && (($intMselValue1 != 0) || ($intVersion >= 3))) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New host group inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Host group modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostgroupToHost', + $chkDataId, + $chkMselValue1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostgroupToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostgroupToHost', + $chkDataId, + $chkMselValue1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkHostgroupToHost', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostgroupToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkHostgroupToHostgroup', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2) != 0) { + $strInfoMessage = ''; + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define host groups (hostgroups.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process host selection field - if (isset($arrModifyData['members'])) {$intFieldId = $arrModifyData['members'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_host','host_name','host_members','tbl_lnkHostgroupToHost',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (($intReturn != 0) && ($intVersion != 3)) { - $myVisClass->processMessage(translate('Attention, no hosts defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process host group selection field - if (isset($arrModifyData['hostgroup_members'])) {$intFieldId = $arrModifyData['hostgroup_members'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti($preTableName,$preKeyField,'hostgroups','tbl_lnkHostgroupToHostgroup',0,$intFieldId,$chkListId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion != 3) $conttp->setVariable("VERSION_20_VALUE_MUST","mselValue1,"); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo); - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Define host groups (hostgroups.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process host selection field + if (isset($arrModifyData['members'])) { + $intFieldId = $arrModifyData['members']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_host', + 'host_name', + 'host_members', + 'tbl_lnkHostgroupToHost', + 2, + $intFieldId + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn1 != 0) && ($intVersion < 3)) { + $myVisClass->processMessage(translate('Attention, no hosts defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process host group selection field + if (isset($arrModifyData['hostgroup_members'])) { + $intFieldId = $arrModifyData['hostgroup_members']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectMulti( + $preTableName, + $preKeyField, + 'hostgroups', + 'tbl_lnkHostgroupToHostgroup', + 0, + $intFieldId, + $chkListId + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn3 = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion < 3) { + $conttp->setVariable('VERSION_20_VALUE_MUST', 'mselValue1,'); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo); + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Host group')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Process search string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' OR `notes` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere - AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'alias'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define host groups (hostgroups.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Host group')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Process search string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' " + . "OR `notes` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; + } + // Count datasets + $strSQL1 = "SELECT count(*) AS `number` FROM `$preTableName` " + . "WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL1, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL2 = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `config_id`, `access_group` " + . "FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` " + . "IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL2, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'alias'); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/hosts.php b/admin/hosts.php index 3733be5..9a4d9b1 100644 --- a/admin/hosts.php +++ b/admin/hosts.php @@ -5,490 +5,726 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Host definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 8; -$preContent = "admin/hosts.tpl.htm"; -$preSearchSession = 'host'; -$preTableName = 'tbl_host'; -$preKeyField = 'host_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 8; +$preContent = 'admin/hosts.htm.tpl'; +$preListTpl = 'admin/datalist_hosts.htm.tpl'; +$preSearchSession = 'host'; +$preTableName = 'tbl_host'; +$preKeyField = 'host_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Data processing // =============== -$strNO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e,0,-1); -$strIS = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c,0,-1); -$strFL = substr($chkChbGr3a.$chkChbGr3b.$chkChbGr3c,0,-1); -$strST = substr($chkChbGr4a.$chkChbGr4b.$chkChbGr4c,0,-1); -if ($chkSelValue1 != "") { - for ($i=1;$i<=8;$i++) { - ${"chkTfArg$i"} = str_replace("!","::bang::",${"chkTfArg$i"}); - if (${"chkTfArg$i"} != "") $chkSelValue1 .= "!".${"chkTfArg$i"}; - } +$strNO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e, 0, -1); +$strIS = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c, 0, -1); +$strFL = substr($chkChbGr3a.$chkChbGr3b.$chkChbGr3c, 0, -1); +$strST = substr($chkChbGr4a.$chkChbGr4b.$chkChbGr4c, 0, -1); +if ($chkSelValue1 != '') { + for ($i = 1; $i <= 8; $i++) { + $tmpVar = 'chkTfArg'.$i; + $$tmpVar = str_replace('!', '::bang::', $$tmpVar); + if ($$tmpVar != '') { + $chkSelValue1 .= '!' .$$tmpVar; + } + } } -// +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue3', `display_name`='$chkTfValue4', `address`='$chkTfValue5', - `name`='$chkTfValue6', `parents`=$intMselValue1, `parents_tploptions`=$chkRadValue1, `hostgroups`=$intMselValue2, `hostgroups_tploptions`=$chkRadValue2, - `check_command`='$chkSelValue1', `use_template`=$intTemplates, `initial_state`='$strIS', `max_check_attempts`=$chkTfNullVal2, `check_interval`=$chkTfNullVal3, - `retry_interval`=$chkTfNullVal1, `active_checks_enabled`=$chkRadValue5, `passive_checks_enabled`=$chkRadValue6, `check_period`=$chkSelValue2, - `obsess_over_host`=$chkRadValue8, `check_freshness`=$chkRadValue7, `freshness_threshold`=$chkTfNullVal4, `event_handler`=$chkSelValue3, - `event_handler_enabled`=$chkRadValue9, `low_flap_threshold`=$chkTfNullVal5, `high_flap_threshold`=$chkTfNullVal6, `flap_detection_enabled`=$chkRadValue10, - `flap_detection_options`='$strFL', `process_perf_data`=$chkRadValue13, `retain_status_information`=$chkRadValue11, `retain_nonstatus_information`=$chkRadValue12, - `contacts`=$intMselValue3, `contacts_tploptions`=$chkRadValue3, `contact_groups`=$intMselValue4, `contact_groups_tploptions`=$chkRadValue4, - `notification_interval`=$chkTfNullVal7, `notification_period`=$chkSelValue4, `first_notification_delay`=$chkTfNullVal8, `notification_options`='$strNO', - `notifications_enabled`=$chkRadValue14, `stalking_options`='$strST', `notes`='$chkTfValue7', `notes_url`='$chkTfValue9', `action_url`='$chkTfValue11', - `icon_image`='$chkTfValue12', `icon_image_alt`='$chkTfValue13', `vrml_image`='$chkTfValue8', `statusmap_image`='$chkTfValue10', `2d_coords`='$chkTfValue14', - `3d_coords`='$chkTfValue15', $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && ($chkTfValue5 != "")) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New host inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Host modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkHostToHost",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkHostToHostgroup",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) $intRet3 = $myDataClass->dataInsertRelation("tbl_lnkHostToContact",$chkDataId,$chkMselValue3); - if (isset($intRet3) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) $intRet4 = $myDataClass->dataInsertRelation("tbl_lnkHostToContactgroup",$chkDataId,$chkMselValue4); - if (isset($intRet4) && ($intRet4 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkHostToHost",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkHostToHost",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkHostToHostgroup",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkHostToHostgroup",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) { - $intRet3 = $myDataClass->dataUpdateRelation("tbl_lnkHostToContact",$chkDataId,$chkMselValue3); - } else { - $intRet3 = $myDataClass->dataDeleteRelation("tbl_lnkHostToContact",$chkDataId); - } - if ($intRet3 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) { - $intRet4 = $myDataClass->dataUpdateRelation("tbl_lnkHostToContactgroup",$chkDataId,$chkMselValue4); - } else { - $intRet4 = $myDataClass->dataDeleteRelation("tbl_lnkHostToContactgroup",$chkDataId); - } - if ($intRet4 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2 + $intRet3 + $intRet4) != 0) $strInfoMessage = ""; - // - // Removing the config file if an entry was deleted or renamed - // =========================================================== - if (($chkModus == "modify") && ($chkTfValue2 != $chkTfValue1) && ($chkDomainId != 0)) { - $arrConfigID = $myConfigClass->getConfigSets(); - if (($arrConfigID != 1) && is_array($arrConfigID)) { - $intReturn = 0; - foreach($arrConfigID AS $intConfigID) { - $intReturn += $myConfigClass->moveFile("host",$chkTfValue2.".cfg",$intConfigID); - } - if ($intReturn == 0) { - $myVisClass->processMessage(translate('The assigned, no longer used configuration files were deleted successfully!'),$strInfoMessage); - $myDataClass->writeLog(translate('Host file deleted:')." ".$chkTfValue2.".cfg"); - } else { - if ($chkDomainId == 0) { - $myVisClass->processMessage(translate('Common files cannot be removed from target systems - please check manually'),$strErrorMessage); - } else { - $myVisClass->processMessage(translate('Errors while deleting the old configuration file - please check!:'),$strErrorMessage); - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } - } - } - } - // - // Removing the config file if an entry was dectivated - // =================================================== - if (($chkModus == "modify") && ($chkActive == 0)) { - $arrConfigID = $myConfigClass->getConfigSets(); - if (($arrConfigID != 1) && is_array($arrConfigID)) { - $intReturn = 0; - foreach($arrConfigID AS $intConfigID) { - $intReturn += $myConfigClass->moveFile("host",$chkTfValue2.".cfg",$intConfigID); - } - if ($intReturn == 0) { - $myVisClass->processMessage(translate('The assigned, no longer used configuration files were deleted successfully!'),$strInfoMessage); - $myDataClass->writeLog(translate('Host file deleted:')." ".$chkTfValue1.".cfg"); - } else { - if ($chkDomainId == 0) { - $myVisClass->processMessage(translate('Common files cannot be removed from target systems - please check manually'),$strErrorMessage); - } else { - $myVisClass->processMessage(translate('Errors while deleting the old configuration file - please check!:'),$strErrorMessage); - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } - } - } - } - // - // Insert/update session data for templates - // ======================================== - if ($chkModus == "modify") { - $strSQL = "DELETE FROM `tbl_lnkHostToHosttemplate` WHERE `idMaster`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && (count($_SESSION['templatedefinition']) != 0)) { - $intSortId = 1; - foreach($_SESSION['templatedefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_lnkHostToHosttemplate` (`idMaster`,`idSlave`,`idTable`,`idSort`) - VALUES ($chkDataId,".$elem['idSlave'].",".$elem['idTable'].",".$intSortId.")"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - $intSortId++; - } - } - // - // Insert/update session data for free variables - // ============================================= - if ($chkModus == "modify") { - $strSQL = "SELECT * FROM `tbl_lnkHostToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDataCount != 0) { - foreach ($arrData AS $elem) { - $strSQL = "DELETE FROM `tbl_variabledefinition` WHERE `id`=".$elem['idSlave']; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - $strSQL = "DELETE FROM `tbl_lnkHostToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - $strSQL = "UPDATE `tbl_host` SET `use_variables`=0 WHERE `id`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && (count($_SESSION['variabledefinition']) != 0)) { - $intCountVariable = 0; - foreach($_SESSION['variabledefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) - VALUES ('".$elem['definition']."','".$elem['range']."',now())"; - $intReturn1 = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - $strSQL = "INSERT INTO `tbl_lnkHostToVariabledefinition` (`idMaster`,`idSlave`) - VALUES ($chkDataId,$intInsertId)"; - $intReturn2 = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if (($intReturn1 == 0) && ($intReturn2 == 0)) $intCountVariable++; - } - } - if ($intCountVariable != 0) { - $strSQL = "UPDATE `tbl_host` SET `use_variables`=1 WHERE `id`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - // - // Insert/Update service <-> host relations - // ======================================== - // Update service table last modified date - $strSQL = "SELECT `idMaster` FROM `tbl_lnkServiceToHost` WHERE `idSlave`=$chkDataId"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDataCount != 0) { - foreach ($arrData AS $elem) { - $strSQL = "UPDATE `tbl_service` SET `last_modified` = NOW() WHERE `id`=".$elem['idMaster']; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - // Remove any link data from host to service - $strSQL = "DELETE FROM `tbl_lnkServiceToHost` WHERE `idSlave`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - foreach ($chkMselValue5 AS $elem) { - if ($elem != "") { - $intExclude = 0; - if (substr($elem,0,1) == "e") { - $intExclude = 1; - $elem = substr_replace($elem,"",0,1); - } - $strSQL = "INSERT INTO `tbl_lnkServiceToHost` (`idMaster`,`idSlave`,`exclude`) - VALUES ($elem,$chkDataId,$intExclude)"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - // Update service table last modified date - $strSQL = "UPDATE `tbl_service` SET `last_modified` = NOW() WHERE `id`=".$elem; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - // Check if Service ID is not 0 - $strSQL = "SELECT `$preKeyField` FROM `tbl_service` WHERE `id`=$elem"; - $strResult = $myDBClass->getFieldData($strSQL); - if ($strResult == 0) { - $strSQL = "UPDATE `tbl_service` SET `$preKeyField`=1 WHERE `id`=$elem"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - - } - } - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue3', " + . "`display_name`='$chkTfValue4', `address`='$chkTfValue5', `name`='$chkTfValue6', " + . "`parents`=$intMselValue1, `importance`=$chkTfNullVal9, `parents_tploptions`=$chkRadValue1, " + . "`hostgroups`=$intMselValue2, " + . "`hostgroups_tploptions`=$chkRadValue2, `check_command`='$chkSelValue1', `use_template`=$intTemplates, " + . "`initial_state`='$strIS', `max_check_attempts`=$chkTfNullVal2, `check_interval`=$chkTfNullVal3, " + . "`retry_interval`=$chkTfNullVal1, `active_checks_enabled`=$chkRadValue5, " + . "`passive_checks_enabled`=$chkRadValue6, `check_period`=$chkSelValue2, " + . "`obsess_over_host`=$chkRadValue8, `check_freshness`=$chkRadValue7, " + . "`freshness_threshold`=$chkTfNullVal4, `event_handler`=$chkSelValue3, " + . "`event_handler_enabled`=$chkRadValue9, `low_flap_threshold`=$chkTfNullVal5, " + . "`high_flap_threshold`=$chkTfNullVal6, `flap_detection_enabled`=$chkRadValue10, " + . "`flap_detection_options`='$strFL', `process_perf_data`=$chkRadValue13, " + . "`retain_status_information`=$chkRadValue11, `retain_nonstatus_information`=$chkRadValue12, " + . "`contacts`=$intMselValue3, `contacts_tploptions`=$chkRadValue3, `contact_groups`=$intMselValue4, " + . "`contact_groups_tploptions`=$chkRadValue4, `notification_interval`=$chkTfNullVal7, " + . "`notification_period`=$chkSelValue4, `first_notification_delay`=$chkTfNullVal8, " + . "`notification_options`='$strNO', `notifications_enabled`=$chkRadValue14, `stalking_options`='$strST', " + . "`notes`='$chkTfValue7', `notes_url`='$chkTfValue9', `action_url`='$chkTfValue11', " + . "`icon_image`='$chkTfValue12', `icon_image_alt`='$chkTfValue13', `vrml_image`='$chkTfValue8', " + . "`statusmap_image`='$chkTfValue10', `2d_coords`='$chkTfValue14', `3d_coords`='$chkTfValue15', " + . $preSQLCommon1; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && ($chkTfValue5 != '')) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New host inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Host modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation('tbl_lnkHostToHost', $chkDataId, $chkMselValue1); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataInsertRelation('tbl_lnkHostToContact', $chkDataId, $chkMselValue3); + } + if (isset($intRet3) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataInsertRelation( + 'tbl_lnkHostToContactgroup', + $chkDataId, + $chkMselValue4 + ); + } + if (isset($intRet4) && ($intRet4 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation('tbl_lnkHostToHost', $chkDataId, $chkMselValue1); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkHostToHost', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkHostToHostgroup', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataUpdateRelation('tbl_lnkHostToContact', $chkDataId, $chkMselValue3); + } else { + $intRet3 = $myDataClass->dataDeleteRelation('tbl_lnkHostToContact', $chkDataId); + } + if ($intRet3 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHostToContactgroup', + $chkDataId, + $chkMselValue4 + ); + } else { + $intRet4 = $myDataClass->dataDeleteRelation('tbl_lnkHostToContactgroup', $chkDataId); + } + if ($intRet4 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2 + $intRet3 + $intRet4) != 0) { + $strInfoMessage = ''; + } + // + // Removing the config file if an entry was deleted or renamed + // =========================================================== + if (($chkModus == 'modify') && ($chkTfValue2 != $chkTfValue1) && ($chkDomainId != 0)) { + $myConfigClass->getConfigTargets($arrConfigID); + if (($arrConfigID != 1) && is_array($arrConfigID)) { + $intReturn = 0; + foreach ($arrConfigID as $intConfigID) { + $intReturn += $myConfigClass->moveFile('host', $chkTfValue2. '.cfg', $intConfigID); + } + if ($intReturn == 0) { + $myVisClass->processMessage(translate('The assigned, no longer used configuration files ' + . 'were deleted successfully!'), $strInfoMessage); + $myDataClass->writeLog(translate('Host file deleted:'). ' ' .$chkTfValue2. '.cfg'); + } else { + if ($chkDomainId == 0) { + $myVisClass->processMessage(translate('Common files cannot be removed from target ' + . 'systems - please check manually'), $strErrorMessage); + } else { + $myVisClass->processMessage(translate('Errors while deleting the old configuration ' + . 'file - please check!:'), $strErrorMessage); + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + } + } + } + // + // Removing the config file if an entry was dectivated + // =================================================== + if (($chkModus == 'modify') && ($chkActive == 0)) { + $myConfigClass->getConfigTargets($arrConfigID); + if (($arrConfigID != 1) && is_array($arrConfigID)) { + $intReturn = 0; + foreach ($arrConfigID as $intConfigID) { + $intReturn += $myConfigClass->moveFile('host', $chkTfValue2. '.cfg', $intConfigID); + } + if ($intReturn == 0) { + $myVisClass->processMessage(translate('The assigned, no longer used configuration files ' + . 'were deleted successfully!'), $strInfoMessage); + $myDataClass->writeLog(translate('Host file deleted:'). ' ' .$chkTfValue1. '.cfg'); + } else { + if ($chkDomainId == 0) { + $myVisClass->processMessage(translate('Common files cannot be removed from target ' + . 'systems - please check manually'), $strErrorMessage); + } else { + $myVisClass->processMessage(translate('Errors while deleting the old configuration ' + . 'file - please check!:'), $strErrorMessage); + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + } + } + } + // + // Insert/update session data for templates + // ======================================== + if ($chkModus == 'modify') { + $strSQL = 'DELETE FROM `tbl_lnkHostToHosttemplate` WHERE `idMaster`=' .$chkDataId; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && + (count($_SESSION['templatedefinition']) != 0)) { + $intSortId = 1; + /** @noinspection ForeachSourceInspection */ + foreach ($_SESSION['templatedefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL = 'INSERT INTO `tbl_lnkHostToHosttemplate` (`idMaster`,`idSlave`,`idTable`, ' + . "`idSort`) VALUES ($chkDataId,".$elem['idSlave']. ',' .$elem['idTable']. ', ' + . $intSortId. ')'; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + $intSortId++; + } + } + // + // Insert/update session data for free variables + // ============================================= + if ($chkModus == 'modify') { + $strSQL = 'SELECT * FROM `tbl_lnkHostToVariabledefinition` WHERE `idMaster`=' .$chkDataId; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCount != 0) { + foreach ($arrData as $elem) { + $strSQL = 'DELETE FROM `tbl_variabledefinition` WHERE `id`=' .$elem['idSlave']; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + $strSQL = 'DELETE FROM `tbl_lnkHostToVariabledefinition` WHERE `idMaster`=' .$chkDataId; + $intReturn1 = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + $strSQL = 'UPDATE `tbl_host` SET `use_variables`=0 WHERE `id`=' .$chkDataId; + $intReturn2 = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && + (count($_SESSION['variabledefinition']) != 0)) { + $intCountVariable = 0; + /** @noinspection ForeachSourceInspection */ + foreach ($_SESSION['variabledefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL = 'INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) ' + . "VALUES ('".$elem['definition']."','".$elem['range']."',now())"; + $intReturn1 = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + $strSQL = 'INSERT INTO `tbl_lnkHostToVariabledefinition` (`idMaster`,`idSlave`) ' + . "VALUES ($chkDataId,$intInsertId)"; + $intReturn2 = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn1 == 0) && ($intReturn2 == 0)) { + $intCountVariable++; + } + } + } + if ($intCountVariable != 0) { + $strSQL = 'UPDATE `tbl_host` SET `use_variables`=1 WHERE `id`=' .$chkDataId; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + // + // Insert/Update service <-> host relations + // ======================================== + // Update service table last modified date + $strSQL = 'SELECT `idMaster` FROM `tbl_lnkServiceToHost` WHERE `idSlave`=' .$chkDataId; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCount != 0) { + foreach ($arrData as $elem) { + $strSQL = 'UPDATE `tbl_service` SET `last_modified` = NOW() WHERE `id`=' .$elem['idMaster']; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + // Remove any link data from host to service + $strSQL = 'DELETE FROM `tbl_lnkServiceToHost` WHERE `idSlave`=' .$chkDataId; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if (is_array($chkMselValue5)) { + foreach ($chkMselValue5 as $elem) { + if ($elem != '') { + $intExclude = 0; + if (0 === strpos($elem, 'e')) { + $intExclude = 1; + $elem = substr_replace($elem, '', 0, 1); + } + $strSQL1 = 'INSERT INTO `tbl_lnkServiceToHost` (`idMaster`,`idSlave`,`exclude`) ' + . "VALUES ($elem,$chkDataId,$intExclude)"; + $intReturn1 = $myDataClass->dataInsert($strSQL1, $intInsertId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + // Update service table last modified date + $strSQL2 = 'UPDATE `tbl_service` SET `last_modified` = NOW() WHERE `id`=' . $elem; + $intReturn2 = $myDataClass->dataInsert($strSQL2, $intInsertId); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + // Check if Service ID is not 0 + $strSQL3 = "SELECT `$preKeyField` FROM `tbl_service` WHERE `id`=$elem"; + $strResult3 = $myDBClass->getFieldData($strSQL3); + if ($strResult3 == 0) { + $strSQL = "UPDATE `tbl_service` SET `$preKeyField`=1 WHERE `id`=$elem"; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + } + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define hosts (hosts.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process template fields - $strWhere = ""; - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - $strWhere = "AND `id` <> ".$arrModifyData['id']; - } - $strSQL = "SELECT `id`,`template_name`, `active` FROM `tbl_hosttemplate` WHERE $strDomainWhere2 ORDER BY `template_name`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataTpl,$intDataCountTpl); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDataCountTpl != 0) { - foreach ($arrDataTpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem['template_name'],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::1"); - $conttp->parse("template"); - } - } - $strSQL = "SELECT `id`, `name`, `active` FROM `$preTableName` WHERE `name` <> '' $strWhere AND $strDomainWhere ORDER BY `name`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataHpl,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($arrDataHpl != 0) { - foreach ($arrDataHpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem['name'],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::2"); - $conttp->parse("template"); - } - } - // Process host selection field - if (isset($arrModifyData['parents'])) {$intFieldId = $arrModifyData['parents'];} else {$intFieldId = 0;} - if (isset($arrModifyData['id'])) {$intKeyId = $arrModifyData['id'];} else {$intKeyId = 0;} - $intReturn = $myVisClass->parseSelectMulti($preTableName,$preKeyField,'host_parents','tbl_lnkHostToHost',0,$intFieldId,$intKeyId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process hostgroup selection field - if (isset($arrModifyData['hostgroups'])) {$intFieldId = $arrModifyData['hostgroups'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_hostgroup','hostgroup_name','hostgroup','tbl_lnkHostToHostgroup',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process check command selection field - if (isset($arrModifyData['check_command']) && ($arrModifyData['check_command'] != "")) { - $arrCommand = explode("!",$arrModifyData['check_command']); - $intFieldId = $arrCommand[0]; - } else { - $intFieldId = 0; - } - $intReturn = $myVisClass->parseSelectSimple('tbl_command','command_name','hostcommand',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process check period selection field - if (isset($arrModifyData['check_period'])) {$intFieldId = $arrModifyData['check_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','checkperiod',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['notification_period'])) {$intFieldId = $arrModifyData['notification_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','notifyperiod',1,$intFieldId); - if ($intReturn != 0) { - $myVisClass->processMessage(translate('Attention, no time periods defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process event handler selection field - if (isset($arrModifyData['event_handler'])) {$intFieldId = $arrModifyData['event_handler'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_command','command_name','eventhandler',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process contact and contact group selection field - if (isset($arrModifyData['contacts'])) {$intFieldId = $arrModifyData['contacts'];} else {$intFieldId = 0;} - $intReturn1 = $myVisClass->parseSelectMulti('tbl_contact','contact_name','host_contacts','tbl_lnkHostToContact',2,$intFieldId); - if ($intReturn1 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['contact_groups'])) {$intFieldId = $arrModifyData['contact_groups'];} else {$intFieldId = 0;} - $intReturn2 = $myVisClass->parseSelectMulti('tbl_contactgroup','contactgroup_name','host_contactgroups','tbl_lnkHostToContactgroup',2,$intFieldId); - if ($intReturn2 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (($intReturn != 0) && ($intReturn2 != 0)) { - $myVisClass->processMessage(translate('Attention, no contact groups defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process service selection field - if (isset($arrModifyData['contacts'])) {$intFieldId = $arrModifyData['id'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_service','service_description','host_services','tbl_lnkServiceToHost',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $strChbFields = "ACE,PCE,FRE,OBS,EVH,FLE,STI,NSI,PED,NOE,PAR,HOG,COT,COG,TPL"; - $myContentClass->addFormInit($conttp,$strChbFields); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion != 3) $conttp->setVariable("VERSION_20_VALUE_MUST","mselValue1,"); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo,$strChbFields); - $conttp->setVariable("DAT_ACE".$arrModifyData['active_checks_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_PCE".$arrModifyData['passive_checks_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_FRE".$arrModifyData['check_freshness']."_CHECKED","checked"); - $conttp->setVariable("DAT_OBS".$arrModifyData['obsess_over_host']."_CHECKED","checked"); - $conttp->setVariable("DAT_EVH".$arrModifyData['event_handler_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_FLE".$arrModifyData['flap_detection_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_STI".$arrModifyData['retain_status_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_NSI".$arrModifyData['retain_nonstatus_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_PED".$arrModifyData['process_perf_data']."_CHECKED","checked"); - $conttp->setVariable("DAT_NOE".$arrModifyData['notifications_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_PAR".$arrModifyData['parents_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_HOG".$arrModifyData['hostgroups_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_COT".$arrModifyData['contacts_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_COG".$arrModifyData['contact_groups_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_TPL".$arrModifyData['use_template_tploptions']."_CHECKED","checked"); - // Special processing for -1 values - write 'null' to integer fields - $strIntegerfelder = "max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,high_flap_threshold,"; - $strIntegerfelder .= "notification_interval,first_notification_delay"; - foreach(explode(",",$strIntegerfelder) AS $elem) { - if ($arrModifyData[$elem] == -1) { - $conttp->setVariable("DAT_".strtoupper($elem),"null"); - } - } - if ($arrModifyData['check_command'] != "") { - $arrArgument = explode("!",$arrModifyData['check_command']); - foreach ($arrArgument AS $key => $value) { - if ($key == 0) { - $conttp->setVariable("IFRAME_SRC",$_SESSION['SETS']['path']['base_url']."admin/commandline.php?cname=".$value); - } else { - $value = str_replace("::bang::","!",$value); - $value = str_replace("::back::","\\",$value); - $conttp->setVariable("DAT_ARG".$key,htmlentities($value,ENT_QUOTES,'UTF-8')); - } - } - } - // Process option fields - foreach(explode(",",$arrModifyData['initial_state']) AS $elem) { - $conttp->setVariable("DAT_IS".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['flap_detection_options']) AS $elem) { - $conttp->setVariable("DAT_FL".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['notification_options']) AS $elem) { - $conttp->setVariable("DAT_NO".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['stalking_options']) AS $elem) { - $conttp->setVariable("DAT_ST".strtoupper($elem)."_CHECKED","checked"); - } - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Define hosts (hosts.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process template fields + $strWhere = ''; + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + $strWhere = 'AND `id` <> ' .$arrModifyData['id']; + } + $strSQL1 = 'SELECT `id`,`template_name`, `active` ' . + "FROM `tbl_hosttemplate` WHERE $strDomainWhere2 ORDER BY `template_name`"; + $booReturn1 = $myDBClass->hasDataArray($strSQL1, $arrDataTpl, $intDataCountTpl); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCountTpl != 0) { + /** @var array $arrDataTpl */ + foreach ($arrDataTpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem['template_name'], ENT_QUOTES, 'UTF-8'). + $strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::1'); + $conttp->parse('template'); + } + } + $strSQL2 = 'SELECT `id`, `name`, `active` ' + . "FROM `$preTableName` WHERE `name` <> '' $strWhere AND $strDomainWhere ORDER BY `name`"; + $booReturn2 = $myDBClass->hasDataArray($strSQL2, $arrDataHpl, $intDataCountHpl); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCountHpl != 0) { + /** @var array $arrDataHpl */ + foreach ($arrDataHpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem['name'], ENT_QUOTES, 'UTF-8').$strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::2'); + $conttp->parse('template'); + } + } + // Process host selection field + if (isset($arrModifyData['parents'])) { + $intFieldId = $arrModifyData['parents']; + } else { + $intFieldId = 0; + } + if (isset($arrModifyData['id'])) { + $intKeyId = $arrModifyData['id']; + } else { + $intKeyId = 0; + } + $intReturn3 = $myVisClass->parseSelectMulti( + $preTableName, + $preKeyField, + 'host_parents', + 'tbl_lnkHostToHost', + 0, + $intFieldId, + $intKeyId + ); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process hostgroup selection field + if (isset($arrModifyData['hostgroups'])) { + $intFieldId = $arrModifyData['hostgroups']; + } else { + $intFieldId = 0; + } + $intReturn4 = $myVisClass->parseSelectMulti( + 'tbl_hostgroup', + 'hostgroup_name', + 'hostgroup', + 'tbl_lnkHostToHostgroup', + 0, + $intFieldId + ); + if ($intReturn4 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process check command selection field + if (isset($arrModifyData['check_command']) && ($arrModifyData['check_command'] != '')) { + $arrCommand = explode('!', $arrModifyData['check_command']); + $intFieldId = $arrCommand[0]; + } else { + $intFieldId = 0; + } + $intReturn5 = $myVisClass->parseSelectSimple('tbl_command', 'command_name', 'hostcommand', 2, $intFieldId); + if ($intReturn5 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process check period selection field + if (isset($arrModifyData['check_period'])) { + $intFieldId = $arrModifyData['check_period']; + } else { + $intFieldId = 0; + } + $intReturn6 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'checkperiod', 1, $intFieldId); + if ($intReturn6 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['notification_period'])) { + $intFieldId = $arrModifyData['notification_period']; + } else { + $intFieldId = 0; + } + $intReturn7 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'notifyperiod', 1, $intFieldId); + if ($intReturn7 != 0) { + $myVisClass->processMessage(translate('Attention, no time periods defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process event handler selection field + if (isset($arrModifyData['event_handler'])) { + $intFieldId = $arrModifyData['event_handler']; + } else { + $intFieldId = 0; + } + $intReturn8 = $myVisClass->parseSelectSimple('tbl_command', 'command_name', 'eventhandler', 1, $intFieldId); + if ($intReturn8 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process contact and contact group selection field + if (isset($arrModifyData['contacts'])) { + $intFieldId = $arrModifyData['contacts']; + } else { + $intFieldId = 0; + } + $intReturn9 = $myVisClass->parseSelectMulti( + 'tbl_contact', + 'contact_name', + 'host_contacts', + 'tbl_lnkHostToContact', + 2, + $intFieldId + ); + if ($intReturn9 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['contact_groups'])) { + $intFieldId = $arrModifyData['contact_groups']; + } else { + $intFieldId = 0; + } + $intReturn10 = $myVisClass->parseSelectMulti( + 'tbl_contactgroup', + 'contactgroup_name', + 'host_contactgroups', + 'tbl_lnkHostToContactgroup', + 2, + $intFieldId + ); + if ($intReturn10 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn8 != 0) && ($intReturn10 != 0)) { + $myVisClass->processMessage(translate('Attention, no contact groups defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn11 = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn11 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process service selection field + if (isset($arrModifyData['contacts'])) { + $intFieldId = $arrModifyData['id']; + } else { + $intFieldId = 0; + } + $intReturn12 = $myVisClass->parseSelectMulti( + 'tbl_service', + 'service_description', + 'host_services', + 'tbl_lnkServiceToHost', + 0, + $intFieldId + ); + if ($intReturn12 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $strChbFields = 'ACE,PCE,FRE,OBS,EVH,FLE,STI,NSI,PED,NOE,PAR,HOG,COT,COG,TPL'; + $myContentClass->addFormInit($conttp, $strChbFields); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion < 3) { + $conttp->setVariable('VERSION_20_VALUE_MUST', 'mselValue1,'); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo, $strChbFields); + $conttp->setVariable('DAT_ACE' .$arrModifyData['active_checks_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PCE' .$arrModifyData['passive_checks_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_FRE' .$arrModifyData['check_freshness']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_OBS' .$arrModifyData['obsess_over_host']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_EVH' .$arrModifyData['event_handler_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_FLE' .$arrModifyData['flap_detection_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_STI' .$arrModifyData['retain_status_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_NSI' .$arrModifyData['retain_nonstatus_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PED' .$arrModifyData['process_perf_data']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_NOE' .$arrModifyData['notifications_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PAR' .$arrModifyData['parents_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_HOG' .$arrModifyData['hostgroups_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_COT' .$arrModifyData['contacts_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_COG' .$arrModifyData['contact_groups_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_TPL' .$arrModifyData['use_template_tploptions']. '_CHECKED', 'checked'); + // Special processing for -1 values - write 'null' to integer fields + $strIntegerfelder = 'max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,' + . 'high_flap_threshold,'; + $strIntegerfelder .= 'notification_interval,first_notification_delay'; + foreach (explode(',', $strIntegerfelder) as $elem) { + if ($arrModifyData[$elem] == -1) { + $conttp->setVariable('DAT_' .strtoupper($elem), 'null'); + } + } + if ($arrModifyData['check_command'] != '') { + $arrArgument = explode('!', $arrModifyData['check_command']); + foreach ($arrArgument as $key => $value) { + if ($key == 0) { + $conttp->setVariable('IFRAME_SRC', $_SESSION['SETS']['path']['base_url']. + 'admin/commandline.php?cname=' .$value); + } else { + $value1 = str_replace('::bang::', '!', $value); + $value2 = str_replace('::back::', "\\", $value1); + $conttp->setVariable('DAT_ARG' .$key, htmlentities($value2, ENT_QUOTES, 'UTF-8')); + } + } + } + // Process option fields + foreach (explode(',', $arrModifyData['initial_state']) as $elem) { + $conttp->setVariable('DAT_IS' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['flap_detection_options']) as $elem) { + $conttp->setVariable('DAT_FL' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['notification_options']) as $elem) { + $conttp->setVariable('DAT_NO' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['stalking_options']) as $elem) { + $conttp->setVariable('DAT_ST' .strtoupper($elem). '_CHECKED', 'checked'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Host name')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Process filter string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' OR - `display_name` LIKE '%".$strSearchTxt."%' OR `address` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `last_modified`, `config_id`, `access_group` FROM `$preTableName` - WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'alias',0); - if ($myContentClass->strErrorMessage != "") $myVisClass->processMessage($myContentClass->strErrorMessage,$strErrorMessage); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define hosts (hosts.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Host name')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Process filter string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' OR " + . "`display_name` LIKE '%".$strSearchTxt."%' OR `address` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; + } + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere " + . "AND `access_group` IN ($strAccess)"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `last_modified`, `config_id`, " + . "`access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` " + . "IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'alias', 0); + if ($myContentClass->strErrorMessage != '') { + $myVisClass->processMessage($myContentClass->strErrorMessage, $strErrorMessage); + } } // Show messages -$arrTimeData = array(); -$strTimeInfoString = ""; -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$arrTimeData = array(); +$strTimeInfoString = ''; +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/hosttemplates.php b/admin/hosttemplates.php index ee1e30e..82dd6bd 100644 --- a/admin/hosttemplates.php +++ b/admin/hosttemplates.php @@ -5,378 +5,590 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Hosttemplate definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 12; -$preContent = "admin/hosttemplates.tpl.htm"; -$preSearchSession = 'hosttemplate'; -$preTableName = 'tbl_hosttemplate'; -$preKeyField = 'template_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 12; +$preContent = 'admin/hosttemplates.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'hosttemplate'; +$preTableName = 'tbl_hosttemplate'; +$preKeyField = 'template_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Data processing // =============== -$strNO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e,0,-1); -$strIS = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c,0,-1); -$strFL = substr($chkChbGr3a.$chkChbGr3b.$chkChbGr3c,0,-1); -$strST = substr($chkChbGr4a.$chkChbGr4b.$chkChbGr4c,0,-1); -if ($chkSelValue1 != "") { - for ($i=1;$i<=8;$i++) { - if (${"chkTfArg$i"} != "") $chkSelValue1 .= "!".${"chkTfArg$i"}; - } +$strNO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e, 0, -1); +$strIS = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c, 0, -1); +$strFL = substr($chkChbGr3a.$chkChbGr3b.$chkChbGr3c, 0, -1); +$strST = substr($chkChbGr4a.$chkChbGr4b.$chkChbGr4c, 0, -1); +if ($chkSelValue1 != '') { + for ($i = 1; $i <= 8; $i++) { + $tmpVar = 'chkTfArg'.$i; + $$tmpVar = str_replace('!', '::bang::', $$tmpVar); + if ($$tmpVar != '') { + $chkSelValue1 .= '!' .$$tmpVar; + } + } } -// +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `parents`=$intMselValue1, `parents_tploptions`=$chkRadValue1, - `hostgroups`=$intMselValue2, `hostgroups_tploptions`=$chkRadValue2, `check_command`='$chkSelValue1', `use_template`=$intTemplates, `initial_state`='$strIS', - `max_check_attempts`=$chkTfNullVal2, `check_interval`=$chkTfNullVal3, `retry_interval`=$chkTfNullVal1, `active_checks_enabled`=$chkRadValue5, - `passive_checks_enabled`=$chkRadValue6, `check_period`=$chkSelValue2, `obsess_over_host`=$chkRadValue8, `check_freshness`=$chkRadValue7, - `freshness_threshold`=$chkTfNullVal4, `event_handler`=$chkSelValue3, `event_handler_enabled`=$chkRadValue9, `low_flap_threshold`=$chkTfNullVal5, - `high_flap_threshold`=$chkTfNullVal6, `flap_detection_enabled`=$chkRadValue10, `flap_detection_options`='$strFL', `process_perf_data`=$chkRadValue13, - `retain_status_information`=$chkRadValue11, `retain_nonstatus_information`=$chkRadValue12, `contacts`=$intMselValue3, `contacts_tploptions`=$chkRadValue3, - `contact_groups`=$intMselValue4, `contact_groups_tploptions`=$chkRadValue4, `notification_interval`=$chkTfNullVal7, `notification_period`=$chkSelValue4, - `first_notification_delay`=$chkTfNullVal8, `notification_options`='$strNO', `notifications_enabled`=$chkRadValue14, `stalking_options`='$strST', - `notes`='$chkTfValue3', `notes_url`='$chkTfValue5', `action_url`='$chkTfValue7', `icon_image`='$chkTfValue8', `icon_image_alt`='$chkTfValue10', - `vrml_image`='$chkTfValue4', `statusmap_image`='$chkTfValue6', `2d_coords`='$chkTfValue9', `3d_coords`='$chkTfValue11', `use_variables`=$intVariables, - $preSQLCommon2"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if ($chkTfValue1 != "") { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New host template inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Host template modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkHosttemplateToHost",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkHosttemplateToHostgroup",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) $intRet3 = $myDataClass->dataInsertRelation("tbl_lnkHosttemplateToContact",$chkDataId,$chkMselValue3); - if (isset($intRet3) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) $intRet4 = $myDataClass->dataInsertRelation("tbl_lnkHosttemplateToContactgroup",$chkDataId,$chkMselValue4); - if (isset($intRet4) && ($intRet4 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkHosttemplateToHost",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkHosttemplateToHost",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkHosttemplateToHostgroup",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkHosttemplateToHostgroup",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) { - $intRet3 = $myDataClass->dataUpdateRelation("tbl_lnkHosttemplateToContact",$chkDataId,$chkMselValue3); - } else { - $intRet3 = $myDataClass->dataDeleteRelation("tbl_lnkHosttemplateToContact",$chkDataId); - } - if ($intRet3 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) { - $intRet4 = $myDataClass->dataUpdateRelation("tbl_lnkHosttemplateToContactgroup",$chkDataId,$chkMselValue4); - } else { - $intRet4 = $myDataClass->dataDeleteRelation("tbl_lnkHosttemplateToContactgroup",$chkDataId); - } - if ($intRet4 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2 + $intRet3 + $intRet4) != 0) $strInfoMessage = ""; - // - // Insert/update session data for templates - // ======================================== - if ($chkModus == "modify") { - $strSQL = "DELETE FROM `tbl_lnkHosttemplateToHosttemplate` WHERE `idMaster`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && (count($_SESSION['templatedefinition']) != 0)) { - $intSortId = 1; - foreach($_SESSION['templatedefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_lnkHosttemplateToHosttemplate` (`idMaster`,`idSlave`,`idTable`,`idSort`) - VALUES ($chkDataId,".$elem['idSlave'].",".$elem['idTable'].",".$intSortId.")"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - $intSortId++; - } - } - // - // Insert/update session data for free variables - // ============================================= - if ($chkModus == "modify") { - $strSQL = "SELECT * FROM `tbl_lnkHosttemplateToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDataCount != 0) { - foreach ($arrData AS $elem) { - $strSQL = "DELETE FROM `tbl_variabledefinition` WHERE `id`=".$elem['idSlave']; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - $strSQL = "DELETE FROM `tbl_lnkHosttemplateToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && (count($_SESSION['variabledefinition']) != 0)) { - foreach($_SESSION['variabledefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) - VALUES ('".$elem['definition']."','".$elem['range']."',now())"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - $strSQL = "INSERT INTO `tbl_lnkHosttemplateToVariabledefinition` (`idMaster`,`idSlave`) - VALUES ($chkDataId,$intInsertId)"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - } - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `parents`=$intMselValue1, " + . "`parents_tploptions`=$chkRadValue1, `importance`=$chkTfNullVal9, `hostgroups`=$intMselValue2, " + . "`hostgroups_tploptions`=$chkRadValue2, `check_command`='$chkSelValue1', `use_template`=$intTemplates, " + . "`initial_state`='$strIS', `max_check_attempts`=$chkTfNullVal2, `check_interval`=$chkTfNullVal3, " + . "`retry_interval`=$chkTfNullVal1, `active_checks_enabled`=$chkRadValue5, " + . "`passive_checks_enabled`=$chkRadValue6, `check_period`=$chkSelValue2, " + . "`obsess_over_host`=$chkRadValue8, `check_freshness`=$chkRadValue7, " + . "`freshness_threshold`=$chkTfNullVal4, `event_handler`=$chkSelValue3, " + . "`event_handler_enabled`=$chkRadValue9, `low_flap_threshold`=$chkTfNullVal5, " + . "`high_flap_threshold`=$chkTfNullVal6, `flap_detection_enabled`=$chkRadValue10, " + . "`flap_detection_options`='$strFL', `process_perf_data`=$chkRadValue13, " + . "`retain_status_information`=$chkRadValue11, `retain_nonstatus_information`=$chkRadValue12, " + . "`contacts`=$intMselValue3, `contacts_tploptions`=$chkRadValue3, `contact_groups`=$intMselValue4, " + . "`contact_groups_tploptions`=$chkRadValue4, `notification_interval`=$chkTfNullVal7, " + . "`notification_period`=$chkSelValue4, `first_notification_delay`=$chkTfNullVal8, " + . "`notification_options`='$strNO', `notifications_enabled`=$chkRadValue14, `stalking_options`='$strST', " + . "`notes`='$chkTfValue3', `notes_url`='$chkTfValue5', `action_url`='$chkTfValue7', " + . "`icon_image`='$chkTfValue8', `icon_image_alt`='$chkTfValue10', `vrml_image`='$chkTfValue4', " + . "`statusmap_image`='$chkTfValue6', `2d_coords`='$chkTfValue9', `3d_coords`='$chkTfValue11', " + . "`use_variables`=$intVariables, $preSQLCommon2"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if ($chkTfValue1 != '') { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New host template inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Host template modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkHosttemplateToHost', + $chkDataId, + $chkMselValue1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkHosttemplateToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataInsertRelation( + 'tbl_lnkHosttemplateToContact', + $chkDataId, + $chkMselValue3 + ); + } + if (isset($intRet3) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataInsertRelation( + 'tbl_lnkHosttemplateToContactgroup', + $chkDataId, + $chkMselValue4 + ); + } + if (isset($intRet4) && ($intRet4 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHosttemplateToHost', + $chkDataId, + $chkMselValue1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkHosttemplateToHost', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHosttemplateToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkHosttemplateToHostgroup', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHosttemplateToContact', + $chkDataId, + $chkMselValue3 + ); + } else { + $intRet3 = $myDataClass->dataDeleteRelation('tbl_lnkHosttemplateToContact', $chkDataId); + } + if ($intRet3 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataUpdateRelation( + 'tbl_lnkHosttemplateToContactgroup', + $chkDataId, + $chkMselValue4 + ); + } else { + $intRet4 = $myDataClass->dataDeleteRelation('tbl_lnkHosttemplateToContactgroup', $chkDataId); + } + if ($intRet4 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2 + $intRet3 + $intRet4) != 0) { + $strInfoMessage = ''; + } + // + // Insert/update session data for templates + // ======================================== + if ($chkModus == 'modify') { + $strSQL = 'DELETE FROM `tbl_lnkHosttemplateToHosttemplate` WHERE `idMaster`=' .$chkDataId; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && + (count($_SESSION['templatedefinition']) != 0)) { + $intSortId = 1; + /** @noinspection ForeachSourceInspection */ + foreach ($_SESSION['templatedefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL = 'INSERT INTO `tbl_lnkHosttemplateToHosttemplate` (`idMaster`,`idSlave`, ' + . "`idTable`,`idSort`) VALUES ($chkDataId,".$elem['idSlave']. ', ' + . $elem['idTable']. ',' .$intSortId. ')'; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + $intSortId++; + } + } + // + // Insert/update session data for free variables + // ============================================= + if ($chkModus == 'modify') { + $strSQL = 'SELECT * FROM `tbl_lnkHosttemplateToVariabledefinition` WHERE `idMaster`=' + . $chkDataId; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCount != 0) { + foreach ($arrData as $elem) { + $strSQL = 'DELETE FROM `tbl_variabledefinition` WHERE `id`=' .$elem['idSlave']; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + $strSQL = 'DELETE FROM `tbl_lnkHosttemplateToVariabledefinition` WHERE `idMaster`=' .$chkDataId; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && + (count($_SESSION['variabledefinition']) != 0)) { + foreach ($_SESSION['variabledefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL = 'INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) ' + . "VALUES ('".$elem['definition']."','".$elem['range']."',now())"; + $intReturn1 = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + $strSQL = 'INSERT INTO `tbl_lnkHosttemplateToVariabledefinition` (`idMaster`, ' + . "`idSlave`) VALUES ($chkDataId,$intInsertId)"; + $intReturn2 = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Host template definition (hosttemplates.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process template fields - $strWhere = ""; - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - $strWhere = "AND `id` <> ".$arrModifyData['id']; - } - $strSQL = "SELECT `id`,`$preKeyField`, `active` FROM `$preTableName` WHERE `config_id` = $chkDomainId $strWhere ORDER BY `$preKeyField`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataTpl,$intDataCountTpl); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDataCountTpl != 0) { - foreach ($arrDataTpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem[$preKeyField],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::1"); - $conttp->parse("template"); - } - } - $strSQL = "SELECT `id`, `name`, `active` FROM `tbl_host` WHERE `name` <> '' AND `config_id` = $chkDomainId ORDER BY `name`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataHpl,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($arrDataHpl != 0) { - foreach ($arrDataHpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem['name'],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::2"); - $conttp->parse("template"); - } - } - // Process host selection field - if (isset($arrModifyData['parents'])) {$intFieldId = $arrModifyData['parents'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_host','host_name','host_parents','tbl_lnkHosttemplateToHost',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process hostgroup selection field - if (isset($arrModifyData['hostgroups'])) {$intFieldId = $arrModifyData['hostgroups'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_hostgroup','hostgroup_name','hostgroup','tbl_lnkHosttemplateToHostgroup',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process check command selection field - if (isset($arrModifyData['check_command']) && ($arrModifyData['check_command'] != "")) { - $arrCommand = explode("!",$arrModifyData['check_command']); - $intFieldId = $arrCommand[0]; - } else { - $intFieldId = 0; - } - $intReturn = $myVisClass->parseSelectSimple('tbl_command','command_name','hostcommand',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process check period selection field - $intReturn = 0; - if (isset($arrModifyData['check_period'])) {$intFieldId = $arrModifyData['check_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','checkperiod',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['notification_period'])) {$intFieldId = $arrModifyData['notification_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','notifyperiod',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process event handler selection field - if (isset($arrModifyData['event_handler'])) {$intFieldId = $arrModifyData['event_handler'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_command','command_name','eventhandler',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process contact and contact group selection field - if (isset($arrModifyData['contacts'])) {$intFieldId = $arrModifyData['contacts'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_contact','contact_name','host_contacts','tbl_lnkHosttemplateToContact',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['contact_groups'])) {$intFieldId = $arrModifyData['contact_groups'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_contactgroup','contactgroup_name','host_contactgroups','tbl_lnkHosttemplateToContactgroup',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $strChbFields = "ACE,PCE,FRE,OBS,EVH,FLE,STI,NSI,PED,NOE,PAR,HOG,COT,COG,TPL"; - $myContentClass->addFormInit($conttp,$strChbFields); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion != 3) $conttp->setVariable("VERSION_20_VALUE_MUST","mselValue1,"); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo,$strChbFields); - $conttp->setVariable("DAT_ACE".$arrModifyData['active_checks_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_PCE".$arrModifyData['passive_checks_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_FRE".$arrModifyData['check_freshness']."_CHECKED","checked"); - $conttp->setVariable("DAT_OBS".$arrModifyData['obsess_over_host']."_CHECKED","checked"); - $conttp->setVariable("DAT_EVH".$arrModifyData['event_handler_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_FLE".$arrModifyData['flap_detection_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_STI".$arrModifyData['retain_status_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_NSI".$arrModifyData['retain_nonstatus_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_PED".$arrModifyData['process_perf_data']."_CHECKED","checked"); - $conttp->setVariable("DAT_NOE".$arrModifyData['notifications_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_PAR".$arrModifyData['parents_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_HOG".$arrModifyData['hostgroups_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_COT".$arrModifyData['contacts_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_COG".$arrModifyData['contact_groups_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_TPL".$arrModifyData['use_template_tploptions']."_CHECKED","checked"); - // Special processing for -1 values - write 'null' to integer fields - $strIntegerfelder = "max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,high_flap_threshold,"; - $strIntegerfelder .= "notification_interval,first_notification_delay"; - foreach(explode(",",$strIntegerfelder) AS $elem) { - if ($arrModifyData[$elem] == -1) { - $conttp->setVariable("DAT_".strtoupper($elem),"null"); - } - } - if ($arrModifyData['check_command'] != "") { - $arrArgument = explode("!",$arrModifyData['check_command']); - foreach ($arrArgument AS $key => $value) { - if ($key == 0) { - $conttp->setVariable("IFRAME_SRC",$_SESSION['SETS']['path']['base_url']."admin/commandline.php?cname=".$value); - } else { - $conttp->setVariable("DAT_ARG".$key,htmlentities($value,ENT_QUOTES,'UTF-8')); - } - } - } - // Process option fields - foreach(explode(",",$arrModifyData['initial_state']) AS $elem) { - $conttp->setVariable("DAT_IS".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['flap_detection_options']) AS $elem) { - $conttp->setVariable("DAT_FL".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['notification_options']) AS $elem) { - $conttp->setVariable("DAT_NO".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['stalking_options']) AS $elem) { - $conttp->setVariable("DAT_ST".strtoupper($elem)."_CHECKED","checked"); - } - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Host template definition (hosttemplates.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process template fields + $strWhere = ''; + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + $strWhere = 'AND `id` <> ' .$arrModifyData['id']; + } + $strSQL1 = "SELECT `id`,`$preKeyField`, `active` FROM `$preTableName` " + . "WHERE `config_id` = $chkDomainId $strWhere ORDER BY `$preKeyField`"; + $booReturn1 = $myDBClass->hasDataArray($strSQL1, $arrDataTpl, $intDataCountTpl); + if ($booReturn1 == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCountTpl != 0) { + /** @var array $arrDataTpl */ + foreach ($arrDataTpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem[$preKeyField], ENT_QUOTES, 'UTF-8').$strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::1'); + $conttp->parse('template'); + } + } + $strSQL2 = 'SELECT `id`, `name`, `active` FROM `tbl_host` ' + . "WHERE `name` <> '' AND `config_id` = $chkDomainId ORDER BY `name`"; + $booReturn2 = $myDBClass->hasDataArray($strSQL2, $arrDataHpl, $intDataCountHpl); + if ($booReturn2 == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCountHpl != 0) { + /** @var array $arrDataHpl */ + foreach ($arrDataHpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem['name'], ENT_QUOTES, 'UTF-8').$strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::2'); + $conttp->parse('template'); + } + } + // Process host selection field + if (isset($arrModifyData['parents'])) { + $intFieldId = $arrModifyData['parents']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_host', + 'host_name', + 'host_parents', + 'tbl_lnkHosttemplateToHost', + 0, + $intFieldId + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process hostgroup selection field + if (isset($arrModifyData['hostgroups'])) { + $intFieldId = $arrModifyData['hostgroups']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectMulti( + 'tbl_hostgroup', + 'hostgroup_name', + 'hostgroup', + 'tbl_lnkHosttemplateToHostgroup', + 0, + $intFieldId + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process check command selection field + if (isset($arrModifyData['check_command']) && ($arrModifyData['check_command'] != '')) { + $arrCommand = explode('!', $arrModifyData['check_command']); + $intFieldId = $arrCommand[0]; + } else { + $intFieldId = 0; + } + $intReturn3 = $myVisClass->parseSelectSimple('tbl_command', 'command_name', 'hostcommand', 1, $intFieldId); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process check period selection field + if (isset($arrModifyData['check_period'])) { + $intFieldId = $arrModifyData['check_period']; + } else { + $intFieldId = 0; + } + $intReturn4 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'checkperiod', 1, $intFieldId); + if ($intReturn4 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['notification_period'])) { + $intFieldId = $arrModifyData['notification_period']; + } else { + $intFieldId = 0; + } + $intReturn5 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'notifyperiod', 1, $intFieldId); + if ($intReturn5 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process event handler selection field + if (isset($arrModifyData['event_handler'])) { + $intFieldId = $arrModifyData['event_handler']; + } else { + $intFieldId = 0; + } + $intReturn6 = $myVisClass->parseSelectSimple('tbl_command', 'command_name', 'eventhandler', 1, $intFieldId); + if ($intReturn6 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process contact and contact group selection field + if (isset($arrModifyData['contacts'])) { + $intFieldId = $arrModifyData['contacts']; + } else { + $intFieldId = 0; + } + $intReturn7 = $myVisClass->parseSelectMulti( + 'tbl_contact', + 'contact_name', + 'host_contacts', + 'tbl_lnkHosttemplateToContact', + 2, + $intFieldId + ); + if ($intReturn7 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['contact_groups'])) { + $intFieldId = $arrModifyData['contact_groups']; + } else { + $intFieldId = 0; + } + $intReturn8 = $myVisClass->parseSelectMulti( + 'tbl_contactgroup', + 'contactgroup_name', + 'host_contactgroups', + 'tbl_lnkHosttemplateToContactgroup', + 2, + $intFieldId + ); + if ($intReturn8 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn9 = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn9 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $strChbFields = 'ACE,PCE,FRE,OBS,EVH,FLE,STI,NSI,PED,NOE,PAR,HOG,COT,COG,TPL'; + $myContentClass->addFormInit($conttp, $strChbFields); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion < 3) { + $conttp->setVariable('VERSION_20_VALUE_MUST', 'mselValue1,'); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo, $strChbFields); + $conttp->setVariable('DAT_ACE' .$arrModifyData['active_checks_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PCE' .$arrModifyData['passive_checks_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_FRE' .$arrModifyData['check_freshness']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_OBS' .$arrModifyData['obsess_over_host']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_EVH' .$arrModifyData['event_handler_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_FLE' .$arrModifyData['flap_detection_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_STI' .$arrModifyData['retain_status_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_NSI' .$arrModifyData['retain_nonstatus_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PED' .$arrModifyData['process_perf_data']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_NOE' .$arrModifyData['notifications_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PAR' .$arrModifyData['parents_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_HOG' .$arrModifyData['hostgroups_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_COT' .$arrModifyData['contacts_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_COG' .$arrModifyData['contact_groups_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_TPL' .$arrModifyData['use_template_tploptions']. '_CHECKED', 'checked'); + // Special processing for -1 values - write 'null' to integer fields + $strIntegerfelder = 'max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,'; + $strIntegerfelder .= 'high_flap_threshold,notification_interval,first_notification_delay'; + foreach (explode(',', $strIntegerfelder) as $elem) { + if ($arrModifyData[$elem] == -1) { + $conttp->setVariable('DAT_' .strtoupper($elem), 'null'); + } + } + if ($arrModifyData['check_command'] != '') { + $arrArgument = explode('!', $arrModifyData['check_command']); + foreach ($arrArgument as $key => $value) { + if ($key == 0) { + $conttp->setVariable('IFRAME_SRC', $_SESSION['SETS']['path']['base_url']. + 'admin/commandline.php?cname=' .$value); + } else { + $value1 = str_replace('::bang::', '!', $value); + $value2 = str_replace('::back::', "\\", $value1); + $conttp->setVariable('DAT_ARG' .$key, htmlentities($value, ENT_QUOTES, 'UTF-8')); + } + } + } + // Process option fields + foreach (explode(',', $arrModifyData['initial_state']) as $elem) { + $conttp->setVariable('DAT_IS' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['flap_detection_options']) as $elem) { + $conttp->setVariable('DAT_FL' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['notification_options']) as $elem) { + $conttp->setVariable('DAT_NO' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['stalking_options']) as $elem) { + $conttp->setVariable('DAT_ST' .strtoupper($elem). '_CHECKED', 'checked'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Host template name')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Process search string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `last_modified`, `config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere - $strSearchWhere AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'alias'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Host template definition (hosttemplates.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Host template name')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Process search string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; + } + // Count datasets + $strSQL1 = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere " + . "AND `access_group` IN ($strAccess)"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL1, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL2 = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `last_modified`, `config_id`, " + . "`access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` " + . "IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL2, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'alias'); + if ($myContentClass->strErrorMessage != '') { + $myVisClass->processMessage($myContentClass->strErrorMessage, $strErrorMessage); + } } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/import.php b/admin/import.php index 4564663..9e5ac1f 100644 --- a/admin/import.php +++ b/admin/import.php @@ -5,216 +5,294 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin configuration verification -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 25; -$preContent = "admin/import.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; -$intModus = 0; +$prePageId = 25; +$preContent = 'admin/import.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; +$intModus = 0; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Initialize import class // ======================= -include("../functions/import_class.php"); -$myImportClass = new nagimport; -$myImportClass->myDataClass =& $myDataClass; -$myImportClass->myDBClass =& $myDBClass; -$myImportClass->myConfigClass =& $myConfigClass; +$myImportClass = new functions\NagImportClass($_SESSION); +$myImportClass->myDBClass =& $myDBClass; +$myImportClass->myDataClass =& $myDataClass; +$myImportClass->myConfigClass =& $myConfigClass; // // Get configuration set ID // ======================== -$arrConfigSet = $myConfigClass->getConfigSets(); +$myConfigClass->getConfigTargets($arrConfigSet); $intConfigId = $arrConfigSet[0]; // // Process form variables // ====================== -if (isset($_FILES['datValue1']) && ($_FILES['datValue1']['name'] != "") && ($chkStatus == 1)) { - // Upload Error - if ($_FILES['datValue1']['error'] !== UPLOAD_ERR_OK) { - $myVisClass->processMessage(translate('File upload error:')." ".$_FILES['filMedia']['error'],$strErrorMessage); - } else { - $intModus = 1; - $strFileName = tempnam($_SESSION['SETS']['path']['tempdir'], 'nagiosql_local_imp'); +if (isset($_FILES['datValue1']) && ($_FILES['datValue1']['name'] != '') && ($chkStatus == 1)) { + // Upload Error + if ($_FILES['datValue1']['error'] !== UPLOAD_ERR_OK) { + $myVisClass->processMessage( + translate('File upload error:'). ' ' .$_FILES['filMedia']['error'], + $strErrorMessage + ); + } else { + $intModus = 1; + $strFileName = tempnam($_SESSION['SETS']['path']['tempdir'], 'nagiosql_local_imp'); move_uploaded_file($_FILES['datValue1']['tmp_name'], $strFileName); - $intReturn = $myImportClass->fileImport($strFileName,$intConfigId,$chkChbValue1); - if ($intReturn != 0) { - $myVisClass->processMessage($myImportClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myImportClass->strInfoMessage,$strInfoMessage); - $myDataClass->writeLog(translate('File imported - File [overwite flag]:')." ".$_FILES['datValue1']['name']." [".$chkChbValue1."]"); - } - } + $intReturn = $myImportClass->fileImport($strFileName, $intConfigId, $chkChbValue1); + if ($intReturn != 0) { + $myVisClass->processMessage($myImportClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myImportClass->strInfoMessage, $strInfoMessage); + $myDataClass->writeLog(translate('File imported - File [overwrite flag]:'). ' ' . + $_FILES['datValue1']['name']. ' [' .$chkChbValue1. ']'); + } + } } -if (($chkMselValue1[0] != "") && ($chkStatus == 1)) { - foreach($chkMselValue1 AS $elem) { - $intModus = 1; - $myImportClass->strErrorMessage = ""; - $myImportClass->strInfoMessage = ""; - $intReturn = $myImportClass->fileImport($elem,$intConfigId,$chkChbValue1); - if ($intReturn != 0) { - $myVisClass->processMessage($myImportClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myImportClass->strInfoMessage,$strInfoMessage); - $myDataClass->writeLog(translate('File imported - File [overwite flag]:')." ".$elem." [".$chkChbValue1."]"); - } - } +if (($chkMselValue1[0] != '') && ($chkStatus == 1)) { + /** @var array $chkMselValue1 */ + foreach ($chkMselValue1 as $elem) { + $intModus = 1; + $myImportClass->strErrorMessage = ''; + $myImportClass->strInfoMessage = ''; + $intReturn = $myImportClass->fileImport($elem, $intConfigId, $chkChbValue1); + if ($intReturn != 0) { + $myVisClass->processMessage($myImportClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myImportClass->strInfoMessage, $strInfoMessage); + $myDataClass->writeLog(translate('File imported - File [overwrite flag]:'). ' ' .$elem. ' [' + .$chkChbValue1. ']'); + } + } } // // Start content // ============= -$conttp->setVariable("TITLE",translate('Configuration import')); -$conttp->parse("header"); -$conttp->show("header"); -$conttp->setVariable("LANG_SEARCH_STRING",translate('Filter string')); -$conttp->setVariable("LANG_SEARCH",translate('Search')); -$conttp->setVariable("LANG_DELETE",translate('Delete')); -$conttp->setVariable("LANG_DELETE_SEARCH",translate("Reset filter")); -$conttp->setVariable("DAT_SEARCH",$chkTfSearch); -$conttp->setVariable("TEMPLATE",translate('Template definition')); -$conttp->setVariable("IMPORTFILE",translate('Import file')); -$conttp->setVariable("LOCAL_FILE",translate('Local import file')); -$conttp->setVariable("OVERWRITE",translate('Overwrite database')); -$conttp->setVariable("MAKE",translate('Import')); -$conttp->setVariable("ABORT",translate('Abort')); -$conttp->setVariable("CTRL_INFO",translate('Hold CTRL to select
more than one')); -$conttp->setVariable("IMAGE_PATH",$_SESSION['SETS']['path']['base_url']."images/"); -$conttp->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); -$conttp->setVariable("DAT_IMPORTFILE_1",""); -$conttp->setVariable("IMPORT_INFO_1",translate("To prevent errors or misconfigurations, you should import your configurations in an useful order. We recommend to do it like this:

commands -> timeperiods -> contacttemplates -> contacts -> contactgroups -> hosttemplates -> hosts -> hostgroups -> servicetemplates -> services -> servicegroups

")); -$conttp->setVariable("IMPORT_INFO_2","".translate("Check your configuration after import!
In cause of an error or an uncomplete configuration, re-importing the wrong configuration can solve the problem.")."
"); -$conttp->parse("filelist1"); +$conttp->setVariable('TITLE', translate('Configuration import')); +$conttp->parse('header'); +$conttp->show('header'); +$conttp->setVariable('LANG_SEARCH_STRING', translate('Filter string')); +$conttp->setVariable('LANG_SEARCH', translate('Search')); +$conttp->setVariable('LANG_DELETE', translate('Delete')); +$conttp->setVariable('LANG_DELETE_SEARCH', translate('Reset filter')); +$conttp->setVariable('DAT_SEARCH', $chkTfSearch); +$conttp->setVariable('TEMPLATE', translate('Template definition')); +$conttp->setVariable('IMPORTFILE', translate('Import file')); +$conttp->setVariable('LOCAL_FILE', translate('Local import file')); +$conttp->setVariable('OVERWRITE', translate('Overwrite database')); +$conttp->setVariable('MAKE', translate('Import')); +$conttp->setVariable('ABORT', translate('Abort')); +$conttp->setVariable('CTRL_INFO', translate('Hold CTRL to select
more than one')); +$conttp->setVariable('IMAGE_PATH', $_SESSION['SETS']['path']['base_url']. 'images/'); +$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$conttp->setVariable('DAT_IMPORTFILE_1', ''); +$conttp->setVariable('IMPORT_INFO_1', translate('To prevent errors or misconfigurations, you should import your ' + . 'configurations in an useful order. We recommend to do it like this:

commands -> ' + . 'timeperiods -> contacttemplates -> contacts -> contactgroups -> hosttemplates -> hosts -> ' + . 'hostgroups -> servicetemplates -> services -> servicegroups

')); +$conttp->setVariable('IMPORT_INFO_2', '' .translate('Check your configuration after ' + . 'import!
In cause of an error or an uncomplete configuration, re-importing the wrong configuration ' + . 'can solve the problem.'). '
'); +$conttp->parse('filelist1'); // Get settings -$myConfigClass->getConfigData($intConfigId,"method",$intMethod); -$myConfigClass->getConfigData($intConfigId,"basedir",$strBaseDir); -$myConfigClass->getConfigData($intConfigId,"hostconfig",$strHostDir); -$myConfigClass->getConfigData($intConfigId,"serviceconfig",$strServiceDir); -$myConfigClass->getConfigData($intConfigId,"backupdir",$strBackupDir); -$myConfigClass->getConfigData($intConfigId,"hostbackup",$strHostBackupDir); -$myConfigClass->getConfigData($intConfigId,"servicebackup",$strServiceBackupDir); -$myConfigClass->getConfigData($intConfigId,"importdir",$strImportDir); -$myConfigClass->getConfigData($intConfigId,"nagiosbasedir",$strNagiosBaseDir); +$myConfigClass->getConfigValues($intConfigId, 'method', $intMethod); +$myConfigClass->getConfigValues($intConfigId, 'basedir', $strBaseDir); +$myConfigClass->getConfigValues($intConfigId, 'hostconfig', $strHostDir); +$myConfigClass->getConfigValues($intConfigId, 'serviceconfig', $strServiceDir); +$myConfigClass->getConfigValues($intConfigId, 'backupdir', $strBackupDir); +$myConfigClass->getConfigValues($intConfigId, 'hostbackup', $strHostBackupDir); +$myConfigClass->getConfigValues($intConfigId, 'servicebackup', $strServiceBackupDir); +$myConfigClass->getConfigValues($intConfigId, 'importdir', $strImportDir); +$myConfigClass->getConfigValues($intConfigId, 'nagiosbasedir', $strNagiosBaseDir); if ($intMethod == 1) { - // Building local file list - $output = array(); - $temp=$myConfigClass->DirToArray($strBaseDir, "\.cfg", "cgi.cfg|nagios.cfg|nrpe.cfg|nsca.cfg",$output,$strErrorMessage); - if ($strNagiosBaseDir != $strBaseDir) { - $temp=$myConfigClass->DirToArray($strNagiosBaseDir, "\.cfg", "cgi.cfg|nagios.cfg|nrpe.cfg|nsca.cfg",$output,$strErrorMessage); - } - $temp=$myConfigClass->DirToArray($strHostDir, "\.cfg", "",$output,$strErrorMessage); - $temp=$myConfigClass->DirToArray($strServiceDir, "\.cfg", "",$output,$strErrorMessage); - $temp=$myConfigClass->DirToArray($strHostBackupDir, "\.cfg_", "",$output,$strErrorMessage); - $temp=$myConfigClass->DirToArray($strServiceBackupDir, "\.cfg_", "",$output,$strErrorMessage); - if (($strImportDir != "") && ($strImportDir != $strBaseDir) && ($strImportDir != $strNagiosBaseDir)) { - $temp=$myConfigClass->DirToArray($strImportDir, "\.cfg", "",$output,$strErrorMessage); - } - $output=array_unique($output); - if (is_array($output) && (count($output) != 0)) { - foreach ($output AS $elem) { - if (($chkTfSearch == "") || (substr_count($elem,$chkTfSearch) != 0)) { - $conttp->setVariable("DAT_IMPORTFILE_2",$elem); - $conttp->parse("filelist2"); - } - } - } -} else if ($intMethod == 2) { - // Set up basic connection - if ($myConfigClass->getFTPConnection($intConfigId) == "0") { - $arrFiles = array(); - $arrFiles1 = ftp_nlist($myConfigClass->resConnectId,$strBaseDir); - if (is_array($arrFiles1)) $arrFiles = array_merge($arrFiles,$arrFiles1); - $arrFiles2 = ftp_nlist($myConfigClass->resConnectId,$strHostDir); - if (is_array($arrFiles2)) $arrFiles = array_merge($arrFiles,$arrFiles2); - $arrFiles3 = ftp_nlist($myConfigClass->resConnectId,$strServiceDir); - if (is_array($arrFiles3)) $arrFiles = array_merge($arrFiles,$arrFiles3); - $arrFiles4 = ftp_nlist($myConfigClass->resConnectId,$strHostBackupDir); - if (is_array($arrFiles4)) $arrFiles = array_merge($arrFiles,$arrFiles4); - $arrFiles5 = ftp_nlist($myConfigClass->resConnectId,$strServiceBackupDir); - if (is_array($arrFiles5)) $arrFiles = array_merge($arrFiles,$arrFiles5); - if ($strImportDir != "" ) { - $arrFiles6 = ftp_nlist($myConfigClass->resConnectId,$strImportDir); - if (is_array($arrFiles6)) $arrFiles = array_merge($arrFiles,$arrFiles6); - } - if (is_array($arrFiles) && (count($arrFiles) != 0)) { - foreach ($arrFiles AS $elem) { - if (!substr_count($elem,"cfg")) continue; - if (substr_count($elem,"resource.cfg")) continue; - if (substr_count($elem,"nagios.cfg")) continue; - if (substr_count($elem,"cgi.cfg")) continue; - if (substr_count($elem,"nrpe.cfg")) continue; - if (substr_count($elem,"nsca.cfg")) continue; - if (($chkTfSearch == "") || (substr_count($elem,$chkTfSearch) != 0)) { - $conttp->setVariable("DAT_IMPORTFILE_2",str_replace("//","/",$elem)); - $conttp->parse("filelist2"); - } - } - } - ftp_close($myConfigClass->resConnectId); - } else { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } -} else if ($intMethod == 3) { - // Set up basic connection - if ($myConfigClass->getSSHConnection($intConfigId) == "0") { - $arrFiles = array(); - $arrFiles1 = $myConfigClass->sendSSHCommand("ls ".$strBaseDir."*.cfg"); - if ($arrFiles1 && is_array($arrFiles1)) $arrFiles = array_merge($arrFiles,$arrFiles1); - $arrFiles2 = $myConfigClass->sendSSHCommand("ls ".$strHostDir."*.cfg"); - if (is_array($arrFiles2)) $arrFiles = array_merge($arrFiles,$arrFiles2); - $arrFiles3 = $myConfigClass->sendSSHCommand("ls ".$strServiceDir."*.cfg"); - if (is_array($arrFiles3)) $arrFiles = array_merge($arrFiles,$arrFiles3); - $arrFiles4 = $myConfigClass->sendSSHCommand("ls ".$strHostBackupDir."*.cfg*"); - if (is_array($arrFiles4)) $arrFiles = array_merge($arrFiles,$arrFiles4); - $arrFiles5 = $myConfigClass->sendSSHCommand("ls ".$strServiceBackupDir."*.cfg*"); - if (is_array($arrFiles5)) $arrFiles = array_merge($arrFiles,$arrFiles5); - if ($strImportDir != "" ) { - $arrFiles6 = $myConfigClass->sendSSHCommand("ls ".$strImportDir."*.cfg"); - if (is_array($arrFiles6)) $arrFiles = array_merge($arrFiles,$arrFiles6); - } - if (is_array($arrFiles) && (count($arrFiles) != 0)) { - foreach ($arrFiles AS $elem) { - if (!substr_count($elem,"cfg")) continue; - if (substr_count($elem,"resource.cfg")) continue; - if (substr_count($elem,"nagios.cfg")) continue; - if (substr_count($elem,"cgi.cfg")) continue; - if (substr_count($elem,"nrpe.cfg")) continue; - if (substr_count($elem,"nsca.cfg")) continue; - if (($chkTfSearch == "") || (substr_count($elem,$chkTfSearch) != 0)) { - $conttp->setVariable("DAT_IMPORTFILE_2",str_replace("//","/",$elem)); - $conttp->parse("filelist2"); - } - } - } - } else { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } + // Building local file list + $arrOutput1 = array(); + $myConfigClass->storeDirToArray( + $strBaseDir, + "\.cfg", + 'cgi.cfg|nagios.cfg|nrpe.cfg|nsca.cfg', + $arrOutput1, + $strErrorMessage + ); + if ($strNagiosBaseDir != $strBaseDir) { + $myConfigClass->storeDirToArray( + $strNagiosBaseDir, + "\.cfg", + 'cgi.cfg|nagios.cfg|nrpe.cfg|nsca.cfg', + $arrOutput1, + $strErrorMessage + ); + } + $myConfigClass->storeDirToArray($strHostDir, "\.cfg", '', $arrOutput1, $strErrorMessage); + $myConfigClass->storeDirToArray($strServiceDir, "\.cfg", '', $arrOutput1, $strErrorMessage); + $myConfigClass->storeDirToArray($strHostBackupDir, "\.cfg_", '', $arrOutput1, $strErrorMessage); + $myConfigClass->storeDirToArray($strServiceBackupDir, "\.cfg_", '', $arrOutput1, $strErrorMessage); + if (($strImportDir != '') && ($strImportDir != $strBaseDir) && ($strImportDir != $strNagiosBaseDir)) { + $myConfigClass->storeDirToArray($strImportDir, "\.cfg", '', $arrOutput1, $strErrorMessage); + } + $arrOutput2=array_unique($arrOutput1); + if (is_array($arrOutput2) && (count($arrOutput2) != 0)) { + foreach ($arrOutput2 as $elem) { + if (($chkTfSearch == '') || (substr_count($elem, $chkTfSearch) != 0)) { + $conttp->setVariable('DAT_IMPORTFILE_2', $elem); + $conttp->parse('filelist2'); + } + } + } +} elseif ($intMethod == 2) { + // Set up basic connection + if ($myConfigClass->getFTPConnection($intConfigId) == '0') { + $arrFiles = array(); + $arrFiles1 = ftp_nlist($myConfigClass->resConnectId, $strBaseDir); + if (is_array($arrFiles1)) { + $arrFiles = array_merge($arrFiles, $arrFiles1); + } + $arrFiles2 = ftp_nlist($myConfigClass->resConnectId, $strHostDir); + if (is_array($arrFiles2)) { + $arrFiles = array_merge($arrFiles, $arrFiles2); + } + $arrFiles3 = ftp_nlist($myConfigClass->resConnectId, $strServiceDir); + if (is_array($arrFiles3)) { + $arrFiles = array_merge($arrFiles, $arrFiles3); + } + $arrFiles4 = ftp_nlist($myConfigClass->resConnectId, $strHostBackupDir); + if (is_array($arrFiles4)) { + $arrFiles = array_merge($arrFiles, $arrFiles4); + } + $arrFiles5 = ftp_nlist($myConfigClass->resConnectId, $strServiceBackupDir); + if (is_array($arrFiles5)) { + $arrFiles = array_merge($arrFiles, $arrFiles5); + } + if ($strImportDir != '') { + $arrFiles6 = ftp_nlist($myConfigClass->resConnectId, $strImportDir); + if (is_array($arrFiles6)) { + $arrFiles = array_merge($arrFiles, $arrFiles6); + } + } + if (is_array($arrFiles) && (count($arrFiles) != 0)) { + foreach ($arrFiles as $elem) { + if (!substr_count($elem, 'cfg')) { + continue; + } + if (substr_count($elem, 'resource.cfg')) { + continue; + } + if (substr_count($elem, 'nagios.cfg')) { + continue; + } + if (substr_count($elem, 'cgi.cfg')) { + continue; + } + if (substr_count($elem, 'nrpe.cfg')) { + continue; + } + if (substr_count($elem, 'nsca.cfg')) { + continue; + } + if (($chkTfSearch == '') || (substr_count($elem, $chkTfSearch) != 0)) { + $conttp->setVariable('DAT_IMPORTFILE_2', str_replace('//', '/', $elem)); + $conttp->parse('filelist2'); + } + } + } + ftp_close($myConfigClass->resConnectId); + } else { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } +} elseif ($intMethod == 3) { + // Set up basic connection + if ($myConfigClass->getSSHConnection($intConfigId) == '0') { + $arrFiles = array(); + $intReturn = $myConfigClass->sendSSHCommand('ls ' .$strBaseDir. '*.cfg', $arrFiles1); + if (($intReturn == 0) && is_array($arrFiles1)) { + $arrFiles = array_merge($arrFiles, $arrFiles1); + } + $intReturn = $myConfigClass->sendSSHCommand('ls ' .$strHostDir. '*.cfg', $arrFiles2); + if (($intReturn == 0) && is_array($arrFiles2)) { + $arrFiles = array_merge($arrFiles, $arrFiles2); + } + $intReturn = $myConfigClass->sendSSHCommand('ls ' .$strServiceDir. '*.cfg', $arrFiles3); + if (($intReturn == 0) && is_array($arrFiles3)) { + $arrFiles = array_merge($arrFiles, $arrFiles3); + } + $intReturn = $myConfigClass->sendSSHCommand('ls ' .$strHostBackupDir. '*.cfg*', $arrFiles4); + if (($intReturn == 0) && is_array($arrFiles4)) { + $arrFiles = array_merge($arrFiles, $arrFiles4); + } + $intReturn = $myConfigClass->sendSSHCommand('ls ' .$strServiceBackupDir. '*.cfg*', $arrFiles5); + if (($intReturn == 0) && is_array($arrFiles5)) { + $arrFiles = array_merge($arrFiles, $arrFiles5); + } + if ($strImportDir != '') { + $intReturn = $myConfigClass->sendSSHCommand('ls ' .$strImportDir. '*.cfg', $arrFiles6); + if (($intReturn == 0) && is_array($arrFiles6)) { + $arrFiles = array_merge($arrFiles, $arrFiles6); + } + } + if (is_array($arrFiles) && (count($arrFiles) != 0)) { + foreach ($arrFiles as $elem) { + if (!substr_count($elem, 'cfg')) { + continue; + } + if (substr_count($elem, 'resource.cfg')) { + continue; + } + if (substr_count($elem, 'nagios.cfg')) { + continue; + } + if (substr_count($elem, 'cgi.cfg')) { + continue; + } + if (substr_count($elem, 'nrpe.cfg')) { + continue; + } + if (substr_count($elem, 'nsca.cfg')) { + continue; + } + if (($chkTfSearch == '') || (substr_count($elem, $chkTfSearch) != 0)) { + $conttp->setVariable('DAT_IMPORTFILE_2', str_replace('//', '/', $elem)); + $conttp->parse('filelist2'); + } + } + } + } else { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } } // Check access rights for adding new objects -if ($myVisClass->checkAccGroup($prePageKey,'write') != 0) $conttp->setVariable("ADD_CONTROL","disabled=\"disabled\""); -if ($strErrorMessage != "") $conttp->setVariable("ERRORMESSAGE",$strErrorMessage); -$conttp->setVariable("INFOMESSAGE",$strInfoMessage); -$conttp->parse("main"); -$conttp->show("main"); +if ($myVisClass->checkAccountGroup($prePageKey, 'write') != 0) { + $conttp->setVariable('ADD_CONTROL', 'disabled="disabled"'); +} +if ($strErrorMessage != '') { + $conttp->setVariable('ERRORMESSAGE', $strErrorMessage); +} +$conttp->setVariable('INFOMESSAGE', $strInfoMessage); +$conttp->parse('main'); +$conttp->show('main'); // // Process footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/index.html b/admin/index.html index e69de29..2c37267 100644 --- a/admin/index.html +++ b/admin/index.html @@ -0,0 +1,10 @@ + + + + NagiosQL + + + + + \ No newline at end of file diff --git a/admin/info.php b/admin/info.php index d920e07..6ead80a 100644 --- a/admin/info.php +++ b/admin/info.php @@ -5,91 +5,105 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL -// Component : Admin information dialog -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Component : Admin information dialog +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Include preprocessing file // ========================== -$preNoMain = 1; -require("../functions/prepend_adm.php"); +$preNoMain = 1; +require $preBasePath.'functions/prepend_adm.php'; // // Process get parameters // ====================== -$chkKey1 = isset($_GET['key1']) ? htmlspecialchars($_GET['key1'], ENT_QUOTES, 'utf-8') : ""; -$chkKey2 = isset($_GET['key2']) ? htmlspecialchars($_GET['key2'], ENT_QUOTES, 'utf-8') : ""; -$chkVersion = isset($_GET['version']) ? htmlspecialchars($_GET['version'], ENT_QUOTES, 'utf-8') : ""; +$chkKey1 = filter_input(INPUT_GET, 'key1', FILTER_SANITIZE_STRING); +$chkKey2 = filter_input(INPUT_GET, 'key2', FILTER_SANITIZE_STRING); +$chkVersion = filter_input(INPUT_GET, 'version', FILTER_SANITIZE_STRING); // // Get information data // =================================================== -if ($chkKey1 == "admin" and isset($_SESSION['updInfo'])) { - // Exception for version check at admin.php - $strContentDB = $_SESSION['updInfo']; -} elseif ($chkKey1 == "settings") { - // Exception for settings page to have gettext translated text - $arrTrans = array ( - "txtRootPath" => translate("This is relative path of your NagiosQL Installation"), - "txtBasePath" => translate("This is the absolut path to your NagiosQL Installation"), - "selProtocol" => translate("If you need a secure connection, select HTTPS instead of HTTP"), - "txtTempdir" => translate("Please choose a temporary directory with write permissions. The default is the temp directory provided by your OS"), - "selLanguage" => translate("Please choose your application language"), - "txtEncoding" => translate("Encoding should be set to nothing else than utf-8. Any changes at your own risk"), - "txtDBserver" => translate("IP-Address or hostname of the database server
e.g. localhost"), - "txtDBport" => translate("MySQL Server Port, default is 3306"), - "txtDBname" => translate("Name of the NagiosQL database
e.g. db_nagiosql_v3"), - "txtDBuser" => translate("User with sufficient permission for the NagiosQL database
At least this user should have SELECT, INSERT, UPDATE, DELETE permissions"), - "txtDBpass" => translate("Password for the above mentioned user"), - "txtLogoff" => translate("After the defined amount of seconds the session will terminate for security reasons"), - "selWSAuth" => translate("Decide between authentication based on your Webserver
e.g. Apache configuration (config file or htaccess) or NagiosQL"), - "txtLines" => translate("How many entries per side should be visibile (e.g. services or hosts)"), - "selSeldisable" => translate("Selection of multiple entries by using the new dialog or by holding CTRL + left click like in NagiosQL2"), - "templatecheck" => translate("Enable or disable the warning if a required field contains no data in objects with templates"), - "updatecheck" => translate("Enable or disable the automatic online version check."), - "chkUpdProxy" => translate("If you require a Proxyserver to connect to the Internet (Port 80), please define one."), - "txtProxyServer"=> translate("Address of your Proxyserver e.g. proxy.yourdomain.com:3128"), - "txtProxyUser" => translate("Username to connect through your proxy (optional)"), - "txtProxyPasswd"=> translate("Password to connect through your proxy (optional)"), - ); - $strContentDB = $arrTrans[$chkKey2]; +if ($chkKey1 == 'admin' and isset($_SESSION['updInfo'])) { + // Exception for version check at admin.php + $strContentDB = $_SESSION['updInfo']; +} elseif ($chkKey1 == 'settings') { + // Exception for settings page to have gettext translated text + $arrTrans = array( + 'txtRootPath' => translate('This is relative path of your NagiosQL Installation'), + 'txtBasePath' => translate('This is the absolut path to your NagiosQL Installation'), + 'selProtocol' => translate('If you need a secure connection, select HTTPS instead of HTTP'), + 'txtTempdir' => translate('Please choose a temporary directory with write permissions. The default is the ' . + 'temp directory provided by your OS'), + 'selLanguage' => translate('Please choose your application language for new users and login portal'), + 'txtEncoding' => translate('Encoding should be set to nothing else than utf-8. Any changes at your own risk'), + 'txtDBserver' => translate('IP-Address or hostname of the database server
e.g. localhost'), + 'txtDBport' => translate('MySQL Server Port, default is 3306'), + 'txtDBname' => translate('Name of the NagiosQL database
e.g. db_nagiosql_v3'), + 'txtDBuser' => translate('User with sufficient permission for the NagiosQL database
At least this user ' . + 'should have SELECT, INSERT, UPDATE, DELETE permissions'), + 'txtDBpass' => translate('Password for the above mentioned user'), + 'txtLogoff' => translate('After the defined amount of seconds the session will terminate for security ' . + 'reasons'), + 'selWSAuth' => translate('Decide between authentication based on your Webserver
e.g. Apache ' . + 'configuration (config file or htaccess) or NagiosQL'), + 'txtLines' => translate('Number of entries per side that should be visible (e.g. services or hosts)'), + 'selSeldisable' => translate('Method of selection of multiple entries by using the new dialog or by holding ' . + 'CTRL + left mouse button, as in NagiosQL 2'), + 'templatecheck' => translate('Enable or disable the warning if a required field contains no data in objects ' . + 'with templates'), + 'updatecheck' => translate('Enable or disable the automatic online version check.'), + 'chkUpdProxy' => translate('If you require a Proxyserver to connect to the Internet (Port 80), please ' . + 'define one.'), + 'txtProxyServer' => translate('Address of your Proxyserver e.g. proxy.yourdomain.com:3128'), + 'txtProxyUser' => translate('Username to connect through your proxy (optional)'), + 'txtProxyPasswd' => translate('Password to connect through your proxy (optional)'), + ); + $strContentDB = $arrTrans[$chkKey2]; } else { - // Get information from tbl_info - $strSQL = "SELECT `infotext` FROM `tbl_info` - WHERE `key1` = '$chkKey1' AND `key2` = '$chkKey2' AND `version` = '$chkVersion' AND `language` = 'private'"; - $strContentDB = $myDBClass->getFieldData($strSQL); - if ($strContentDB == "") { - $strSQL = "SELECT `infotext` FROM `tbl_info` - WHERE `key1` = '$chkKey1' AND `key2` = '$chkKey2' AND `version` = '$chkVersion' AND `language` = 'default'"; - $strContentDB = $myDBClass->getFieldData($strSQL); - } + // Get information from tbl_info + $strSQL = 'SELECT `infotext` FROM `tbl_info` ' . + "WHERE `key1` = '$chkKey1' AND `key2` = '$chkKey2' AND `version` = '$chkVersion' ". + "AND `language` = 'private'"; + $strContentDB = $myDBClass->getFieldData($strSQL); + if ($strContentDB == '') { + $strSQL = 'SELECT `infotext` FROM `tbl_info` ' . + "WHERE `key1` = '$chkKey1' AND `key2` = '$chkKey2' AND `version` = '$chkVersion' ". + "AND `language` = 'default'"; + $strContentDB = $myDBClass->getFieldData($strSQL); + } } ?> - + - - - <?php echo translate("Information PopUp");?> - - - + + + <?php echo translate('Information PopUp');?> + + + - + \ No newline at end of file diff --git a/admin/logbook.php b/admin/logbook.php index b68f65f..0c73ce8 100644 --- a/admin/logbook.php +++ b/admin/logbook.php @@ -5,120 +5,136 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin logbook -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 37; -$preContent = "admin/admin_master.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 37; +$preContent = 'admin/logbook.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Delete log entries // ================== -if (isset($_POST['tfValue1']) && (($chkTfValue1 != "") || ($chkTfValue2 != ""))) { - $strWhere = ""; - if ($chkTfValue1 != "") { - $strWhere .= "AND `time` > '$chkTfValue1 00:00:00'"; - } - if ($chkTfValue2 != "") { - $strWhere .= "AND `time` < '$chkTfValue2 23:59:59'"; - } - $strSQL = "DELETE FROM `tbl_logbook` WHERE 1=1 $strWhere"; - $booReturn = $myDBClass->insertData($strSQL); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage(translate('Dataset successfully deleted. Affected rows:')." ".$myDBClass->intAffectedRows,$strInfoMessage); - } +$strWhere = ''; +if ($chkTfValue1 != '') { + $strWhere .= "AND `time` > '$chkTfValue1 00:00:00'"; +} +if ($chkTfValue2 != '') { + $strWhere .= "AND `time` < '$chkTfValue2 23:59:59'"; +} +if ($strWhere != '') { + $strSQL = 'DELETE FROM `tbl_logbook` WHERE 1=1 '; + $strSQL .= $strWhere; + $booReturn = $myDBClass->insertData($strSQL); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage(translate('Dataset successfully deleted. Affected rows:'). ' ' . + $myDBClass->intAffectedRows, $strInfoMessage); + } } // // Search data // =========== -if ($chkTfSearch != "") { - $strWhere = "WHERE `user` LIKE '%$chkTfSearch%' OR `ipadress` LIKE '%$chkTfSearch%' OR `domain` LIKE '%$chkTfSearch%' OR `entry` LIKE '%$chkTfSearch%'"; +if ($chkTfSearch != '') { + $strWhere = "WHERE `user` LIKE '%$chkTfSearch%' OR `ipadress` LIKE '%$chkTfSearch%' " + . "OR `domain` LIKE '%$chkTfSearch%' OR `entry` LIKE '%$chkTfSearch%'"; } else { - $strWhere = ""; + $strWhere = ''; } // // Get data // ======== $intNumRows = $myDBClass->getFieldData("SELECT count(*) FROM `tbl_logbook` $strWhere"); -if ($intNumRows <= $chkFromLine) $chkFromLine = 0; -$strSQL = "SELECT DATE_FORMAT(time,'%Y-%m-%d %H:%i:%s') AS `time`, `user`, `ipadress`, `domain`, `entry` - FROM `tbl_logbook` $strWhere ORDER BY `time` DESC LIMIT $chkFromLine,".$SETS['common']['pagelines']; -$booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); +if ($intNumRows <= $chkFromLine) { + $chkFromLine = 0; +} +$strSQL = "SELECT DATE_FORMAT(time,'%Y-%m-%d %H:%i:%s') AS `time`, `user`, `ipadress`, `domain`, `entry` " + . "FROM `tbl_logbook` $strWhere ORDER BY `time` DESC LIMIT $chkFromLine,".$SETS['common']['pagelines']; +$booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); } // // Start content // ============= -$conttp->setVariable("TITLE",translate('View logbook')); -foreach($arrDescription AS $elem) { - $conttp->setVariable($elem['name'],$elem['string']); +$conttp->setVariable('TITLE', translate('View logbook')); +foreach ($arrDescription as $elem) { + $conttp->setVariable($elem['name'], $elem['string']); } -$conttp->setVariable("LANG_ENTRIES_BEFORE",translate('Delete logentries between:')); -$conttp->setVariable("LOCALE",$SETS['data']['locale']); -$conttp->setVariable("LANG_SELECT_DATE",translate('Please at least fill in a start or a stop time')); -$conttp->setVariable("LANG_DELETELOG",translate('Do you really want to delete all log entries between the selected dates?')); -$conttp->setVariable("DAT_SEARCH",$chkTfSearch); +$conttp->setVariable('LANG_ENTRIES_BEFORE', translate('Delete logentries between:')); +$conttp->setVariable('LOCALE', $SETS['data']['locale']); +$conttp->setVariable('LANG_SELECT_DATE', translate('Please supply a start or a stop time at least')); +$conttp->setVariable('LANG_DELETELOG', translate('Do you really want to delete all log entries between the ' + . 'selected dates?')); +$conttp->setVariable('DAT_SEARCH', $chkTfSearch); // Legende einblenden if ($chkFromLine > 1) { - $intPrevNumber = $chkFromLine - 20; - $conttp->setVariable("LANG_PREVIOUS", "<< ".translate('previous 20 entries').""); + $intPrevNumber = $chkFromLine - 20; + $conttp->setVariable('LANG_PREVIOUS', '<< ' .translate('previous 20 entries'). ''); } else { - $conttp->setVariable("LANG_PREVIOUS", ""); + $conttp->setVariable('LANG_PREVIOUS', ''); } if ($chkFromLine < $intNumRows-20) { - $intNextNumber = $chkFromLine + 20; - $conttp->setVariable("LANG_NEXT", "".translate('next 20 entries')." >>"); + $intNextNumber = $chkFromLine + 20; + $conttp->setVariable('LANG_NEXT', '' .translate('next 20 entries'). ' >>'); } else { - $conttp->setVariable("LANG_NEXT", ""); + $conttp->setVariable('LANG_NEXT', ''); } -// +// // Output log data // =============== if ($intDataCount != 0) { - for ($i=0;$i<$intDataCount;$i++) { - // Set default values - if ($arrDataLines[$i]['ipadress'] == "") $arrDataLines[$i]['ipadress'] = " "; - // Insert data values - $conttp->setVariable("DAT_TIME", $arrDataLines[$i]['time']); - $conttp->setVariable("DAT_ACCOUNT", $arrDataLines[$i]['user']); - $conttp->setVariable("DAT_ACTION", $arrDataLines[$i]['entry']); - $conttp->setVariable("DAT_IPADRESS", $arrDataLines[$i]['ipadress']); - $conttp->setVariable("DAT_DOMAIN", $arrDataLines[$i]['domain']); - $conttp->parse("logdatacell"); - } + for ($i = 0; $i < $intDataCount; $i++) { + // Set default values + if ($arrDataLines[$i]['ipadress'] == '') { + $arrDataLines[$i]['ipadress'] = ' '; + } + // Insert data values + $conttp->setVariable('DAT_TIME', $arrDataLines[$i]['time']); + $conttp->setVariable('DAT_ACCOUNT', $arrDataLines[$i]['user']); + $conttp->setVariable('DAT_ACTION', $arrDataLines[$i]['entry']); + $conttp->setVariable('DAT_IPADRESS', $arrDataLines[$i]['ipadress']); + $conttp->setVariable('DAT_DOMAIN', $arrDataLines[$i]['domain']); + $conttp->parse('logdatacell'); + } } -$conttp->setVariable("ERRORMESSAGE","
".$strErrorMessage); -$conttp->setVariable("INFOMESSAGE","
".$strInfoMessage); +$conttp->setVariable('ERRORMESSAGE', '
' .$strErrorMessage); +$conttp->setVariable('INFOMESSAGE', '
' .$strInfoMessage); // Check access rights for adding new objects -if ($myVisClass->checkAccGroup($prePageKey,'write') != 0) $conttp->setVariable("ADD_CONTROL","disabled=\"disabled\""); -$conttp->parse("logbooksite"); -$conttp->show("logbooksite"); +if ($myVisClass->checkAccountGroup($prePageKey, 'write') != 0) { + $conttp->setVariable('ADD_CONTROL', 'disabled="disabled"'); +} +$conttp->parse('logbooksite'); +$conttp->show('logbooksite'); // // Process footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/menuaccess.php b/admin/menuaccess.php index c35aac8..3daac5d 100644 --- a/admin/menuaccess.php +++ b/admin/menuaccess.php @@ -5,95 +5,104 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Menu access administration -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 34; -$preContent = "admin/admin_master.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; -$preNoAccessGrp = 1; -$intFieldId = 0; +$prePageId = 34; +$preContent = 'admin/menuaccess.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; +$preNoAccessGrp = 1; +$intFieldId = 0; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Process data // ============ -if (isset($_POST['subSave']) && ($chkSelValue1 != 0)) { - $strSQL = "UPDATE `tbl_menu` SET `mnuGrpId`='$chkSelValue2' WHERE `mnuId`=$chkSelValue1"; - $booReturn = $myDBClass->insertData($strSQL); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while inserting the data to the data base:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage(translate('Data were successfully inserted to the data base!'),$strInfoMessage); - $myDataClass->writeLog(translate('Access group set for menu item:')." ".$myDBClass->getFieldData("SELECT `mnuName` FROM `tbl_menu` WHERE `mnuId`=$chkSelValue1")); - } +if (filter_input(INPUT_POST, 'subSave') && ($chkSelValue1 != 0)) { + $strSQL = "UPDATE `tbl_menu` SET `mnuGrpId`='$chkSelValue2' WHERE `mnuId`=$chkSelValue1"; + $booReturn = $myDBClass->insertData($strSQL); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while inserting the data into the database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage(translate('Data were successfully inserted to the data base!'), $strInfoMessage); + $myDataClass->writeLog(translate('Access group set for menu item:'). ' ' . + $myDBClass->getFieldData("SELECT `mnuName` FROM `tbl_menu` WHERE `mnuId`=$chkSelValue1")); + } } // // Include content // =============== -$conttp->setVariable("TITLE",translate('Define Menu Accessrights')); -foreach($arrDescription AS $elem) { - $conttp->setVariable($elem['name'],$elem['string']); +$conttp->setVariable('TITLE', translate('Define Menu Access Rights')); +foreach ($arrDescription as $elem) { + $conttp->setVariable($elem['name'], $elem['string']); } -$conttp->setVariable("LANG_ACCESSDESCRIPTION",translate('In order for a user to get access, he needs to be member of the group selected here.')); +$conttp->setVariable('LANG_ACCESSDESCRIPTION', translate('In order for a user to get access, he needs to be member ' + . 'of the group selected here.')); // // Auswahlfeld einlesen // ==================== -$strSQL = "SELECT A.`mnuId` , B.`mnuName` AS `mainitem`, A.`mnuName` AS `subitem`, A.`mnuGrpId` - FROM `tbl_menu` AS A - LEFT JOIN `tbl_menu` AS B ON A.`mnuTopId` = B.`mnuId` - ORDER BY A.`mnuTopId`, A.`mnuOrderId`"; -$booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); +$strSQL = 'SELECT A.`mnuId` , B.`mnuName` AS `mainitem`, A.`mnuName` AS `subitem`, A.`mnuGrpId` ' + . 'FROM `tbl_menu` AS A LEFT JOIN `tbl_menu` AS B ON A.`mnuTopId` = B.`mnuId` ' + . 'ORDER BY A.`mnuTopId`, A.`mnuOrderId`'; +$booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); } else { - $conttp->setVariable("SUBMENU_VALUE","0"); - $conttp->setVariable("SUBMENU_NAME"," "); - $conttp->parse("submenu"); - foreach($arrDataLines AS $elem) { - $conttp->setVariable("SUBMENU_VALUE",$elem['mnuId']); - if ($elem['mainitem'] != '') { - $conttp->setVariable("SUBMENU_NAME",translate($elem['mainitem'])." - ".translate($elem['subitem'])); - } else { - $conttp->setVariable("SUBMENU_NAME",translate($elem['subitem'])); - } - if ($chkSelValue1 == $elem['mnuId']) { - $conttp->setVariable("SUBMENU_SELECTED","selected"); - $intFieldId = $elem['mnuGrpId']; - } - // Bypass main site - if ($elem['mnuId'] != 1) $conttp->parse("submenu"); - } - // Process access group selection field - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); + $conttp->setVariable('SUBMENU_VALUE', '0'); + $conttp->setVariable('SUBMENU_NAME', ' '); + $conttp->parse('submenu'); + foreach ($arrDataLines as $elem) { + $conttp->setVariable('SUBMENU_VALUE', $elem['mnuId']); + if ($elem['mainitem'] != '') { + $conttp->setVariable('SUBMENU_NAME', translate($elem['mainitem']). ' - ' .translate($elem['subitem'])); + } else { + $conttp->setVariable('SUBMENU_NAME', translate($elem['subitem'])); + } + if ($chkSelValue1 == $elem['mnuId']) { + $conttp->setVariable('SUBMENU_SELECTED', 'selected'); + $intFieldId = $elem['mnuGrpId']; + } + // Bypass main site + if ($elem['mnuId'] != 1) { + $conttp->parse('submenu'); + } + } + // Process access group selection field + $intReturn = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); } -$conttp->setVariable("ERRORMESSAGE",$strErrorMessage); -$conttp->setVariable("INFOMESSAGE",$strInfoMessage); +$conttp->setVariable('ERRORMESSAGE', $strErrorMessage); +$conttp->setVariable('INFOMESSAGE', $strInfoMessage); // Check access rights for adding new objects -if ($intGlobalWriteAccess == 1) $conttp->setVariable("DISABLE_SAVE","disabled=\"disabled\""); -$conttp->parse("menuaccesssite"); -$conttp->show("menuaccesssite"); +if ($intGlobalWriteAccess == 1) { + $conttp->setVariable('DISABLE_SAVE', 'disabled="disabled"'); +} +$conttp->parse('menuaccesssite'); +$conttp->show('menuaccesssite'); // // Process footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/monitoring.php b/admin/monitoring.php index aacf13c..c7b7023 100644 --- a/admin/monitoring.php +++ b/admin/monitoring.php @@ -5,86 +5,108 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin specials overview -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 2; -$preContent = "admin/mainpages.tpl.htm"; +$prePageId = 2; +$preContent = 'admin/mainpages.htm.tpl'; // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Include content // =============== -$conttp->setVariable("TITLE",translate('Monitoring')); -$conttp->parse("header"); -$conttp->show("header"); -$conttp->setVariable("DESC",translate('To define host and service supervisions as well as host and service groups.')); -$conttp->setVariable("STATISTICS",translate('Statistical datas')); -$conttp->setVariable("TYPE",translate('Group')); -$conttp->setVariable("ACTIVE",translate('Active')); -$conttp->setVariable("INACTIVE",translate('Inactive')); +$conttp->setVariable('TITLE', translate('Monitoring')); +$conttp->parse('header'); +$conttp->show('header'); +$conttp->setVariable('DESC', translate('Define host and service supervisions as well as host and service groups.')); +$conttp->setVariable('STATISTICS', translate('Statistical datas')); +$conttp->setVariable('TYPE', translate('Group')); +$conttp->setVariable('ACTIVE', translate('Active')); +$conttp->setVariable('INACTIVE', translate('Inactive')); // // Include statistical data // ======================== // Get read access groups -$strAccess = $myVisClass->getAccGroups('read'); -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=8")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Hosts')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_host` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_host` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +$strAccess = $myVisClass->getAccessGroups('read'); +$intAccessGrp8 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=8'); +$intAccessGrp9 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=9'); +$intAccessGrp10 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=10'); +$intAccessGrp11 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=11'); +$intAccessGrp12 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=12'); +$intAccessGrp13 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=13'); +if ($myVisClass->checkAccountGroup($intAccessGrp8, 'read') == 0) { + $conttp->setVariable('NAME', translate('Hosts')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_host` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_host` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=9")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Services')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_service` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_service` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intAccessGrp9, 'read') == 0) { + $conttp->setVariable('NAME', translate('Services')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_service` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_service` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=10")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Host groups')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_hostgroup` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_hostgroup` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intAccessGrp10, 'read') == 0) { + $conttp->setVariable('NAME', translate('Host groups')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_hostgroup` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_hostgroup` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=11")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Service groups')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_servicegroup` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_servicegroup` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intAccessGrp11, 'read') == 0) { + $conttp->setVariable('NAME', translate('Service groups')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_servicegroup` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_servicegroup` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=12")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Host templates')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_hosttemplate` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_hosttemplate` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intAccessGrp12, 'read') == 0) { + $conttp->setVariable('NAME', translate('Host templates')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_hosttemplate` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_hosttemplate` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=13")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Service templates')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_servicetemplate` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_servicetemplate` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intAccessGrp13, 'read') == 0) { + $conttp->setVariable('NAME', translate('Service templates')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_servicetemplate` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_servicetemplate` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -$conttp->parse("statistics"); -$conttp->parse("main"); -$conttp->show("main"); +$conttp->parse('statistics'); +$conttp->parse('main'); +$conttp->show('main'); // // Include Footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/mutdialog.php b/admin/mutdialog.php index 75d3e72..c8db35c 100644 --- a/admin/mutdialog.php +++ b/admin/mutdialog.php @@ -5,55 +5,60 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin timeperiod definitions -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Date : $LastChangedDate: 2018-04-10 10:48:30 +0200 (Tue, 10 Apr 2018) $ // Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$preContent = "admin/mutdialog.tpl.htm"; +$preContent = 'admin/mutdialog.htm.tpl'; // // Process post parameters // ======================= -$chkObject = isset($_GET['object']) ? htmlspecialchars($_GET['object'], ENT_QUOTES, 'utf-8') : ""; -$intExclude = isset($_GET['exclude']) ? htmlspecialchars($_GET['exclude'], ENT_QUOTES, 'utf-8') : 0; +$intExclude = filter_input(INPUT_GET, 'exclude', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkObject = filter_input(INPUT_GET, 'object', FILTER_SANITIZE_STRING); // // Include preprocessing file // ========================== $preAccess = 1; $preFieldvars = 1; $preNoMain = 1; -require("../functions/prepend_adm.php"); +require $preBasePath.'functions/prepend_adm.php'; // // Include content // =============== -$conttp->setVariable("BASE_PATH",$_SESSION['SETS']['path']['base_url']); -$conttp->setVariable("OPENER_FIELD",$chkObject); -$conttp->parse("header"); -$conttp->show("header"); +$conttp->setVariable('BASE_PATH', $_SESSION['SETS']['path']['base_url']); +$conttp->setVariable('OPENER_FIELD', $chkObject); +$conttp->parse('header'); +$conttp->show('header'); // // Form // ==== -foreach($arrDescription AS $elem) { - $conttp->setVariable($elem['name'],$elem['string']); +foreach ($arrDescription as $elem) { + $conttp->setVariable($elem['name'], $elem['string']); } -$conttp->setVariable("OPENER_FIELD",$chkObject); -$conttp->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); -$conttp->setVariable("IMAGE_PATH",$_SESSION['SETS']['path']['base_url']."images/"); -$conttp->setVariable("AVAILABLE",translate('Available')); -$conttp->setVariable("SELECTED",translate('Selected')); +$conttp->setVariable('OPENER_FIELD', $chkObject); +$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$conttp->setVariable('IMAGE_PATH', $_SESSION['SETS']['path']['base_url']. 'images/'); +$conttp->setVariable('AVAILABLE', translate('Available')); +$conttp->setVariable('SELECTED', translate('Selected')); if (($intExclude == 1) || ($intVersion < 3)) { - $conttp->setVariable("DISABLE_HTML_BEGIN",""); + $conttp->setVariable('DISABLE_HTML_BEGIN', ''); } -$conttp->parse("datainsert"); -$conttp->show("datainsert"); -?> \ No newline at end of file +$conttp->parse('datainsert'); +$conttp->show('datainsert'); diff --git a/admin/nagioscfg.php b/admin/nagioscfg.php index 3d12bb5..9603f7c 100644 --- a/admin/nagioscfg.php +++ b/admin/nagioscfg.php @@ -5,149 +5,161 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin timeperiod definitions -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 28; -$preContent = "admin/nagioscfg.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; -$intRemoveTmp = 0; -$strConfig = ""; +$prePageId = 28; +$preContent = 'admin/nagioscfg.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; +$intRemoveTmp = 0; +$strConfig = ''; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Get configuration set ID // ======================== -$arrConfigSet = $myConfigClass->getConfigSets(); +$myConfigClass->getConfigTargets($arrConfigSet); $intConfigId = $arrConfigSet[0]; -$myConfigClass->getConfigData($intConfigId,"method",$intMethod); -$myConfigClass->getConfigData($intConfigId,"nagiosbasedir",$strBaseDir); -$myConfigClass->getConfigData($intConfigId,"conffile",$strConfigfile); -$strLocalBackup = $strConfigfile."_old_".date("YmdHis",time()); +$myConfigClass->getConfigValues($intConfigId, 'method', $intMethod); +$myConfigClass->getConfigValues($intConfigId, 'nagiosbasedir', $strBaseDir); +$myConfigClass->getConfigValues($intConfigId, 'conffile', $strConfigfile); +$strLocalBackup = $strConfigfile. '_old_' .date('YmdHis'); // -// Convert Windows to UNIX +// Convert Windows to UNIX // ======================= -$chkTaFileText = str_replace("\r\n","\n",$chkTaFileText); +$chkTaFileText = str_replace("\r\n", "\n", $chkTaFileText); // // Process data // ============ -if ($chkTaFileText != "") { - if ($intMethod == 1) { - if (file_exists($strBaseDir) && (is_writable($strBaseDir) && (is_writable($strConfigfile)))) { - // Backup config file - $intReturn = $myConfigClass->moveFile("nagiosbasic",basename($strConfigfile),$intConfigId); - if ($intReturn == 1) { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } - // Write configuration - $resFile = fopen($strConfigfile,"w"); - fputs($resFile,$chkTaFileText); - fclose($resFile); - $myVisClass->processMessage("".translate('Configuration file successfully written!')."",$strInfoMessage); - $myDataClass->writeLog(translate('Configuration successfully written:')." ".$strConfigfile); - } else { - $myVisClass->processMessage(translate('Cannot open/overwrite the configuration file (check the permissions)!'),$strErrorMessage); - $myDataClass->writeLog(translate('Configuration write failed:')." ".$strConfigfile); - } - } else if (($intMethod == 2) || ($intMethod == 3)) { - // Backup config file - $intReturn = $myConfigClass->moveFile("nagiosbasic",basename($strConfigfile),$intConfigId); - if ($intReturn == 1) { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } - // Write file to temporary - $strFileName = tempnam($_SESSION['SETS']['path']['tempdir'], 'nagiosql_conf'); - $resFile = fopen($strFileName,"w"); - fputs($resFile,$chkTaFileText); - fclose($resFile); - // Copy configuration to remoty system - $intReturn = $myConfigClass->configCopy($strConfigfile,$intConfigId,$strFileName,1); - if ($intReturn == 0) { - $myVisClass->processMessage("".translate('Configuration file successfully written!')."",$strInfoMessage); - $myDataClass->writeLog(translate('Configuration successfully written:')." ".$strConfigfile); - unlink($strFileName); - } else { - $myVisClass->processMessage(translate('Cannot open/overwrite the configuration file (check the permissions on remote system)!'),$strErrorMessage); - $myDataClass->writeLog(translate('Configuration write failed (remote):')." ".$strConfigfile); - unlink($strFileName); - } - } +if (($chkTaFileText != '') && ($arrConfigSet[0] != 0)) { + if ($intMethod == 1) { + if (file_exists($strBaseDir) && (is_writable($strBaseDir) && is_writable($strConfigfile))) { + // Backup config file + $intReturn = $myConfigClass->moveFile('nagiosbasic', basename($strConfigfile), $intConfigId); + if ($intReturn == 1) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + // Write configuration + $resFile = fopen($strConfigfile, 'wb'); + fwrite($resFile, $chkTaFileText); + fclose($resFile); + $myVisClass->processMessage('' .translate('Configuration file successfully ' + . 'written!'). '', $strInfoMessage); + $myDataClass->writeLog(translate('Configuration successfully written:'). ' ' .$strConfigfile); + } else { + $myVisClass->processMessage(translate('Cannot open/overwrite the configuration file (check the ' + . 'permissions)!'), $strErrorMessage); + $myDataClass->writeLog(translate('Configuration write failed:'). ' ' .$strConfigfile); + } + } elseif (($intMethod == 2) || ($intMethod == 3)) { + // Backup config file + $intReturn1 = $myConfigClass->moveFile('nagiosbasic', basename($strConfigfile), $intConfigId); + if ($intReturn1 == 1) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + // Write file to temporary + $strFileName = tempnam($_SESSION['SETS']['path']['tempdir'], 'nagiosql_conf'); + $resFile = fopen($strFileName, 'wb'); + fwrite($resFile, $chkTaFileText); + fclose($resFile); + // Copy configuration to remoty system + $intReturn2 = $myConfigClass->remoteFileCopy($strConfigfile, $intConfigId, $strFileName, 1); + if ($intReturn2 == 0) { + $myVisClass->processMessage('' .translate('Configuration file successfully ' + . 'written!'). '', $strInfoMessage); + $myDataClass->writeLog(translate('Configuration successfully written:'). ' ' .$strConfigfile); + unlink($strFileName); + } else { + $myVisClass->processMessage(translate('Cannot open/overwrite the configuration file (check the permissions ' + . 'on remote system)!'), $strErrorMessage); + $myDataClass->writeLog(translate('Configuration write failed (remote):'). ' ' .$strConfigfile); + unlink($strFileName); + } + } +} elseif ($arrConfigSet[0] == 0) { + $myVisClass->processMessage(translate('There are no nagios configuration files in common domain, please select a '. + 'valid domain to edit this files!'), $strErrorMessage); } // // Include content // =============== -$conttp->setVariable("TITLE",translate('Nagios main configuration file')); -$conttp->parse("header"); -$conttp->show("header"); -// -// Include input form -// =================== -$conttp->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); -$conttp->setVariable("MAINSITE",$_SESSION['SETS']['path']['base_url']."admin.php"); -foreach($arrDescription AS $elem) { - $conttp->setVariable($elem['name'],$elem['string']); +$conttp->setVariable('TITLE', translate('Nagios main configuration file')); +$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$conttp->setVariable('MAINSITE', $_SESSION['SETS']['path']['base_url']. 'admin.php'); +foreach ($arrDescription as $elem) { + $conttp->setVariable($elem['name'], $elem['string']); } // // Open configuration // ================== if ($intMethod == 1) { - if (file_exists($strConfigfile) && is_readable($strConfigfile)) { - $resFile = fopen($strConfigfile,"r"); - if ($resFile) { - while(!feof($resFile)) { - $strConfig .= fgets($resFile,1024); - } - } - } else { - $myVisClass->processMessage(translate('Cannot open the data file (check the permissions)!'),$strErrorMessage); - } -} else if (($intMethod == 2) || ($intMethod == 3)) { - // Write file to temporary - $strFileName = tempnam($_SESSION['SETS']['path']['tempdir'], 'nagiosql_conf'); - // Copy configuration from remoty system - $intReturn = $myConfigClass->configCopy($strConfigfile,$intConfigId,$strFileName,0); - if ($intReturn == 0) { - $resFile = fopen($strFileName,"r"); - if (is_resource($resFile)) { - while(!feof($resFile)) { - $strConfig .= fgets($resFile,1024); - } - unlink($strFileName); - } else { - $myVisClass->processMessage(translate('Cannot open the temporary file'),$strErrorMessage); - } - } else { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - $myDataClass->writeLog(translate('Configuration read failed (remote):')." ".$strErrorMessage); - if (file_exists($strFileName)) unlink($strFileName); - } + if (file_exists($strConfigfile) && is_readable($strConfigfile)) { + $resFile = fopen($strConfigfile, 'rb'); + if ($resFile) { + while (!feof($resFile)) { + $strConfig .= fgets($resFile, 1024); + } + } + } else { + $myVisClass->processMessage(translate('Cannot open the data file (check the permissions)!'), $strErrorMessage); + } +} elseif (($intMethod == 2) || ($intMethod == 3)) { + // Write file to temporary + $strFileName = tempnam($_SESSION['SETS']['path']['tempdir'], 'nagiosql_conf'); + // Copy configuration from remoty system + $intReturn = $myConfigClass->remoteFileCopy($strConfigfile, $intConfigId, $strFileName, 0); + if ($intReturn == 0) { + $resFile = fopen($strFileName, 'rb'); + if (is_resource($resFile)) { + while (!feof($resFile)) { + $strConfig .= fgets($resFile, 1024); + } + unlink($strFileName); + } else { + $myVisClass->processMessage(translate('Cannot open the temporary file'), $strErrorMessage); + } + } else { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + $myDataClass->writeLog(translate('Configuration read failed (remote):'). ' ' .$strErrorMessage); + if (file_exists($strFileName)) { + unlink($strFileName); + } + } } -$conttp->setVariable("DAT_NAGIOS_CONFIG",$strConfig); -if ($strErrorMessage != "") $conttp->setVariable("ERRORMESSAGE",$strErrorMessage); -$conttp->setVariable("INFOMESSAGE",$strInfoMessage); +$conttp->setVariable('DAT_NAGIOS_CONFIG', $strConfig); +if ($strErrorMessage != '') { + $conttp->setVariable('ERRORMESSAGE', $strErrorMessage); +} +$conttp->setVariable('INFOMESSAGE', $strInfoMessage); // Check access rights for adding new objects -if ($myVisClass->checkAccGroup($prePageKey,'write') != 0) $conttp->setVariable("ADD_CONTROL","disabled=\"disabled\""); -$conttp->parse("naginsert"); -$conttp->show("naginsert"); +if ($myVisClass->checkAccountGroup($prePageKey, 'write') != 0) { + $conttp->setVariable('ADD_CONTROL', 'disabled="disabled"'); +} +$conttp->parse('naginsert'); +$conttp->show('naginsert'); // // Process footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/password.php b/admin/password.php index 34b36bd..06b2805 100644 --- a/admin/password.php +++ b/admin/password.php @@ -5,71 +5,84 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Password administration -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 31; -$preContent = "admin/admin_master.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; -$preShowHeader = 0; +$prePageId = 31; +$preContent = 'admin/password.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; +$preShowHeader = 0; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Change password // ======================= -if (($chkTfValue1 != "") && ($chkTfValue2 != "")) { - // Check old password - $strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".$_SESSION['username']."' AND `password`=MD5('$chkTfValue1')"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else if ($intDataCount == 1) { - // Check equality and password length - if (($chkTfValue2 === $chkTfValue3) && (strlen($chkTfValue2) >=5)) { - // Update database - $strSQLUpdate = "UPDATE `tbl_user` SET `password`=MD5('$chkTfValue2'), - `last_login`=NOW() WHERE `username`='".$_SESSION['username']."'"; - $booReturn = $myDBClass->insertData($strSQLUpdate); - if ($booReturn == true) { - $myDataClass->writeLog(translate('Password successfully modified')); - // Force new login - $_SESSION['logged_in'] = 0; - $_SESSION['username'] = ""; - $_SESSION['userid'] = 0; - $_SESSION['groupadm'] = 0; - $_SESSION['domain'] = 0; - header("Location: ".$SETS['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['SETS']['path']['base_url']."index.php"); - } else { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - } else { - // New password wrong - $myVisClass->processMessage(translate('Password too short or password fields unequally!'),$strErrorMessage); - } - } else { - // Old password wrong - $myVisClass->processMessage(translate('Old password is wrong'),$strErrorMessage); - } -} else if (isset($_POST['submit'])) { - // Wrong data - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); +if (($chkTfValue1 != '') && ($chkTfValue2 != '')) { + // Check old password + $strSQL = 'SELECT * FROM `tbl_user` ' + . "WHERE `username`='".$_SESSION['username']."' AND `password`=MD5('$chkTfValue1')"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } elseif ($intDataCount == 1) { + // Check equality and password length + if (($chkTfValue2 === $chkTfValue3) && (strlen($chkTfValue2) >=5)) { + // Update database + $strSQLUpdate = "UPDATE `tbl_user` SET `password`=MD5('$chkTfValue2'), `last_login`=NOW() " + . "WHERE `username`='".$_SESSION['username']."'"; + $booReturn = $myDBClass->insertData($strSQLUpdate); + if ($booReturn == true) { + $myDataClass->writeLog(translate('Password successfully modified')); + // Force new login + $_SESSION['logged_in'] = 0; + $_SESSION['username'] = ''; + $_SESSION['userid'] = 0; + $_SESSION['groupadm'] = 0; + $_SESSION['domain'] = 0; + header('Location: ' .$SETS['path']['protocol']. '://' . + filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING). + $_SESSION['SETS']['path']['base_url']. 'index.php'); + } else { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + } else { + // New password wrong + $myVisClass->processMessage( + translate('Password too short or password fields do not match!'), + $strErrorMessage + ); + } + } else { + // Old password wrong + $myVisClass->processMessage(translate('The old password is invalid'), $strErrorMessage); + } +} elseif (filter_input(INPUT_POST, 'submit')) { + // Wrong data + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); } // // Output header variable @@ -78,25 +91,29 @@ echo $tplHeaderVar; // // Include content // =============== -foreach($arrDescription AS $elem) { - $conttp->setVariable($elem['name'],$elem['string']); +foreach ($arrDescription as $elem) { + $conttp->setVariable($elem['name'], $elem['string']); } -$conttp->setVariable("LANG_SAVE",translate('Save')); -$conttp->setVariable("LANG_ABORT",translate('Abort')); -$conttp->setVariable("FILL_ALLFIELDS",translate('Please fill in all fields marked with an *')); -$conttp->setVariable("FILL_NEW_PASSWD_NOT_EQUAL",translate('The new passwords are not equal!')); -$conttp->setVariable("FILL_NEW_PWDSHORT",translate('The new password is too short - use at least 6 characters!')); -if ($strErrorMessage != "") $conttp->setVariable("ERRORMESSAGE",$strErrorMessage); -$conttp->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); -$conttp->setVariable("IMAGE_PATH",$_SESSION['SETS']['path']['base_url']."images/"); +$conttp->setVariable('LANG_SAVE', translate('Save')); +$conttp->setVariable('LANG_ABORT', translate('Abort')); +$conttp->setVariable('FILL_ALLFIELDS', translate('Please fill in all fields marked with an *')); +$conttp->setVariable('FILL_NEW_PASSWD_NOT_EQUAL', translate('The new passwords don not match!')); +$conttp->setVariable('FILL_NEW_PWDSHORT', translate('The new password is too short - use at least 6 characters!')); +if ($strErrorMessage != '') { + $conttp->setVariable('ERRORMESSAGE', $strErrorMessage); +} +$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$conttp->setVariable('IMAGE_PATH', $_SESSION['SETS']['path']['base_url']. 'images/'); // Check access rights for adding new objects -if ($myVisClass->checkAccGroup($prePageKey,'write') != 0) $conttp->setVariable("ADD_CONTROL","disabled=\"disabled\""); -$conttp->parse("passwordsite"); -$conttp->show("passwordsite"); +if ($myVisClass->checkAccountGroup($prePageKey, 'write') != 0) { + $conttp->setVariable('ADD_CONTROL', 'disabled="disabled"'); +} +$conttp->parse('passwordsite'); +$conttp->show('passwordsite'); // // Include footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/servicedependencies.php b/admin/servicedependencies.php index adef4a0..4f5db58 100644 --- a/admin/servicedependencies.php +++ b/admin/servicedependencies.php @@ -5,384 +5,760 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Service dependencies definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 22; -$preContent = "admin/servicedependencies.tpl.htm"; -$preSearchSession = 'servicedependencies'; -$preTableName = 'tbl_servicedependency'; -$preKeyField = 'config_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 22; +$preContent = 'admin/servicedependencies.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'servicedependencies'; +$preTableName = 'tbl_servicedependency'; +$preKeyField = 'config_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Data processing // =============== -$strEO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e.$chkChbGr1f,0,-1); -$strNO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e.$chkChbGr2f,0,-1); -// +$strEO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e.$chkChbGr1f, 0, -1); +$strNO = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d.$chkChbGr2e.$chkChbGr2f, 0, -1); +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `dependent_host_name`=$intMselValue2, `dependent_hostgroup_name`=$intMselValue4, `dependent_service_description`=$intMselValue6, - `dependent_servicegroup_name`=$intMselValue8, `host_name`=$intMselValue1, `hostgroup_name`=$intMselValue3, `service_description`=$intMselValue5, - `servicegroup_name`=$intMselValue7,`$preKeyField`='$chkTfValue1', `inherits_parent`='$chkChbValue1', `execution_failure_criteria`='$strEO', - `notification_failure_criteria`='$strNO', `dependency_period`=$chkSelValue1, $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && (($intMselValue5 != 0) || ($intMselValue7 != 0)) && (($intMselValue6 != 0) || ($intMselValue8 != 0))) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New service dependency inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Service dependency modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkServicedependencyToHost_H",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkServicedependencyToHost_DH",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) $intRet3 = $myDataClass->dataInsertRelation("tbl_lnkServicedependencyToHostgroup_H",$chkDataId,$chkMselValue3); - if (isset($intRet3) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) $intRet4 = $myDataClass->dataInsertRelation("tbl_lnkServicedependencyToHostgroup_DH",$chkDataId,$chkMselValue4); - if (isset($intRet4) && ($intRet4 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue5 != 0) $intRet5 = $myDataClass->dataInsertRelation("tbl_lnkServicedependencyToService_S",$chkDataId,$chkMselValue5); - if (isset($intRet5) && ($intRet5 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue6 != 0) $intRet6 = $myDataClass->dataInsertRelation("tbl_lnkServicedependencyToService_DS",$chkDataId,$chkMselValue6); - if (isset($intRet6) && ($intRet6 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue7 != 0) $intRet7 = $myDataClass->dataInsertRelation("tbl_lnkServicedependencyToServicegroup_S",$chkDataId,$chkMselValue7); - if (isset($intRet7) && ($intRet7 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue8 != 0) $intRet8 = $myDataClass->dataInsertRelation("tbl_lnkServicedependencyToServicegroup_DS",$chkDataId,$chkMselValue8); - if (isset($intRet8) && ($intRet8 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkServicedependencyToHost_H",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkServicedependencyToHost_H",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkServicedependencyToHost_DH",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkServicedependencyToHost_DH",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) { - $intRet3 = $myDataClass->dataUpdateRelation("tbl_lnkServicedependencyToHostgroup_H",$chkDataId,$chkMselValue3); - } else { - $intRet3 = $myDataClass->dataDeleteRelation("tbl_lnkServicedependencyToHostgroup_H",$chkDataId); - } - if ($intRet3 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) { - $intRet4 = $myDataClass->dataUpdateRelation("tbl_lnkServicedependencyToHostgroup_DH",$chkDataId,$chkMselValue4); - } else { - $intRet4 = $myDataClass->dataDeleteRelation("tbl_lnkServicedependencyToHostgroup_DH",$chkDataId); - } - if ($intRet4 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue5 != 0) { - $intRet5 = $myDataClass->dataUpdateRelation("tbl_lnkServicedependencyToService_S",$chkDataId,$chkMselValue5); - } else { - $intRet5 = $myDataClass->dataDeleteRelation("tbl_lnkServicedependencyToService_S",$chkDataId); - } - if ($intRet5 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue6 != 0) { - $intRet6 = $myDataClass->dataUpdateRelation("tbl_lnkServicedependencyToService_DS",$chkDataId,$chkMselValue6); - } else { - $intRet6 = $myDataClass->dataDeleteRelation("tbl_lnkServicedependencyToService_DS",$chkDataId); - } - if ($intRet6 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue7 != 0) { - $intRet7 = $myDataClass->dataUpdateRelation("tbl_lnkServicedependencyToServicegroup_S",$chkDataId,$chkMselValue7); - } else { - $intRet7 = $myDataClass->dataDeleteRelation("tbl_lnkServicedependencyToServicegroup_S",$chkDataId); - } - if ($intRet7 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue8 != 0) { - $intRet8 = $myDataClass->dataUpdateRelation("tbl_lnkServicedependencyToServicegroup_DS",$chkDataId,$chkMselValue8); - } else { - $intRet8 = $myDataClass->dataDeleteRelation("tbl_lnkServicedependencyToServicegroup_DS",$chkDataId); - } - if ($intRet8 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2 + $intRet3 + $intRet4 + $intRet5 + $intRet6 + $intRet7 + $intRet8) != 0) $strInfoMessage = ""; - // - // Update Import HASH - // ================== - $booReturn = $myDataClass->updateHash($preTableName,$chkDataId); - if ($booReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `dependent_host_name`=$intMselValue2, `dependent_hostgroup_name`=$intMselValue4, " + . "`dependent_service_description`=$intMselValue6, `dependent_servicegroup_name`=$intMselValue8, " + . "`host_name`=$intMselValue1, `hostgroup_name`=$intMselValue3, `service_description`=$intMselValue5, " + . "`servicegroup_name`=$intMselValue7, `$preKeyField`='$chkTfValue1', `inherits_parent`='$chkChbValue1', " + . "`execution_failure_criteria`='$strEO', `notification_failure_criteria`='$strNO', " + . "`dependency_period`=$chkSelValue1, $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && (($intMselValue5 != 0) || ($intMselValue7 != 0)) && + (($intMselValue6 != 0) || ($intMselValue8 != 0))) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New service dependency inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Service dependency modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicedependencyToHost_H', + $chkDataId, + $chkMselValue1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicedependencyToHost_DH', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicedependencyToHostgroup_H', + $chkDataId, + $chkMselValue3 + ); + } + if (isset($intRet3) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicedependencyToHostgroup_DH', + $chkDataId, + $chkMselValue4 + ); + } + if (isset($intRet4) && ($intRet4 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue5 != 0) { + $intRet5 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicedependencyToService_S', + $chkDataId, + $chkMselValue5 + ); + } + if (isset($intRet5) && ($intRet5 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue6 != 0) { + $intRet6 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicedependencyToService_DS', + $chkDataId, + $chkMselValue6 + ); + } + if (isset($intRet6) && ($intRet6 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue7 != 0) { + $intRet7 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicedependencyToServicegroup_S', + $chkDataId, + $chkMselValue7 + ); + } + if (isset($intRet7) && ($intRet7 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue8 != 0) { + $intRet8 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicedependencyToServicegroup_DS', + $chkDataId, + $chkMselValue8 + ); + } + if (isset($intRet8) && ($intRet8 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicedependencyToHost_H', + $chkDataId, + $chkMselValue1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkServicedependencyToHost_H', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicedependencyToHost_DH', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkServicedependencyToHost_DH', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicedependencyToHostgroup_H', + $chkDataId, + $chkMselValue3 + ); + } else { + $intRet3 = $myDataClass->dataDeleteRelation( + 'tbl_lnkServicedependencyToHostgroup_H', + $chkDataId + ); + } + if ($intRet3 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicedependencyToHostgroup_DH', + $chkDataId, + $chkMselValue4 + ); + } else { + $intRet4 = $myDataClass->dataDeleteRelation( + 'tbl_lnkServicedependencyToHostgroup_DH', + $chkDataId + ); + } + if ($intRet4 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue5 != 0) { + $intRet5 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicedependencyToService_S', + $chkDataId, + $chkMselValue5 + ); + } else { + $intRet5 = $myDataClass->dataDeleteRelation( + 'tbl_lnkServicedependencyToService_S', + $chkDataId + ); + } + if ($intRet5 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue6 != 0) { + $intRet6 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicedependencyToService_DS', + $chkDataId, + $chkMselValue6 + ); + } else { + $intRet6 = $myDataClass->dataDeleteRelation( + 'tbl_lnkServicedependencyToService_DS', + $chkDataId + ); + } + if ($intRet6 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue7 != 0) { + $intRet7 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicedependencyToServicegroup_S', + $chkDataId, + $chkMselValue7 + ); + } else { + $intRet7 = $myDataClass->dataDeleteRelation( + 'tbl_lnkServicedependencyToServicegroup_S', + $chkDataId + ); + } + if ($intRet7 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue8 != 0) { + $intRet8 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicedependencyToServicegroup_DS', + $chkDataId, + $chkMselValue8 + ); + } else { + $intRet8 = $myDataClass->dataDeleteRelation( + 'tbl_lnkServicedependencyToServicegroup_DS', + $chkDataId + ); + } + if ($intRet8 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2 + $intRet3 + $intRet4 + $intRet5 + $intRet6 + $intRet7 + $intRet8) != 0) { + $strInfoMessage = ''; + } + // + // Update Import HASH + // ================== + $booReturn = $myDataClass->updateHash($preTableName, $chkDataId); + if ($booReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if (($chkModus != 'add') && ($chkModus != 'refresh')) { + $chkModus = 'display'; } -if (($chkModus != "add") && ($chkModus != "refresh")) $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define service dependencies (servicedependencies.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if (($chkModus == "add") || ($chkModus == "refresh")) { - if ($chkModus == "refresh") { - $_SESSION['refresh']['sd_host'] = $chkMselValue1; - $_SESSION['refresh']['sd_dependent_host'] = $chkMselValue2; - $_SESSION['refresh']['sd_hostgroup'] = $chkMselValue3; - $_SESSION['refresh']['sd_dependent_hostgroup'] = $chkMselValue4; - $_SESSION['refresh']['sd_service'] = $chkMselValue5; - $_SESSION['refresh']['sd_dependent_service'] = $chkMselValue6; - $_SESSION['refresh']['sd_servicegroup'] = $chkMselValue7; - $_SESSION['refresh']['sd_dependent_servicegroup'] = $chkMselValue8; - } else { - $_SESSION['refresh']['sd_host'] = $chkMselValue1; - $_SESSION['refresh']['sd_dependent_host'] = $chkMselValue2; - $_SESSION['refresh']['sd_hostgroup'] = $chkMselValue3; - $_SESSION['refresh']['sd_dependent_hostgroup'] = $chkMselValue4; - $_SESSION['refresh']['sd_service'] = $chkMselValue5; - $_SESSION['refresh']['sd_dependent_service'] = $chkMselValue6; - $_SESSION['refresh']['sd_servicegroup'] = $chkMselValue7; - $_SESSION['refresh']['sd_dependent_servicegroup'] = $chkMselValue8; - if (isset($arrModifyData['dependent_host_name']) && ($arrModifyData['dependent_host_name'] > 0 )) { - $arrTemp = array(); - $strSQL = "SELECT `idSlave`, `exclude` FROM `tbl_lnkServicedependencyToHost_DH` WHERE `idMaster` = ".$arrModifyData['id']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($booReturn && ($intDC != 0)) { - foreach ($arrData AS $elem) { - if ($elem['exclude'] == 1) { - $arrTemp[] = "e".$elem['idSlave']; - } else { - $arrTemp[] = $elem['idSlave']; - } - } - } - if ($arrModifyData['dependent_host_name'] == 2) $arrTemp[] = '*'; - $_SESSION['refresh']['sd_dependent_host'] = $arrTemp; - } - if (isset($arrModifyData['host_name']) && ($arrModifyData['host_name'] > 0 )){ - $arrTemp = array(); - $strSQL = "SELECT `idSlave`, `exclude` FROM `tbl_lnkServicedependencyToHost_H` WHERE `idMaster` = ".$arrModifyData['id']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDC != 0) { - foreach ($arrData AS $elem) { - if ($elem['exclude'] == 1) { - $arrTemp[] = "e".$elem['idSlave']; - } else { - $arrTemp[] = $elem['idSlave']; - } - } - } - if ($arrModifyData['host_name'] == 2) $arrTemp[] = '*'; - $_SESSION['refresh']['sd_host'] = $arrTemp; - } - if (isset($arrModifyData['dependent_hostgroup_name']) && ($arrModifyData['dependent_hostgroup_name'] > 0 )){ - $arrTemp = array(); - $strSQL = "SELECT `idSlave`, `exclude` FROM `tbl_lnkServicedependencyToHostgroup_DH` WHERE `idMaster` = ".$arrModifyData['id']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDC != 0) { - foreach ($arrData AS $elem) { - if ($elem['exclude'] == 1) { - $arrTemp[] = "e".$elem['idSlave']; - } else { - $arrTemp[] = $elem['idSlave']; - } - } - } - if ($arrModifyData['dependent_hostgroup_name'] == 2) $arrTemp[] = '*'; - $_SESSION['refresh']['sd_dependent_hostgroup'] = $arrTemp; - } - if (isset($arrModifyData['hostgroup_name']) && ($arrModifyData['hostgroup_name'] > 0 )){ - $arrTemp = array(); - $strSQL = "SELECT `idSlave`, `exclude` FROM `tbl_lnkServicedependencyToHostgroup_H` WHERE `idMaster` = ".$arrModifyData['id']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDC != 0) { - foreach ($arrData AS $elem) { - if ($elem['exclude'] == 1) { - $arrTemp[] = "e".$elem['idSlave']; - } else { - $arrTemp[] = $elem['idSlave']; - } - } - } - if ($arrModifyData['hostgroup_name'] == 2) $arrTemp[] = '*'; - $_SESSION['refresh']['sd_hostgroup'] = $arrTemp; - } - } - // Do not show modified time list - $intNoTime = 1; - // Process host selection field - if (isset($arrModifyData['dependent_host_name'])) {$intFieldId = $arrModifyData['dependent_host_name'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue2) != 0)) {$strRefresh = 'sd_dependent_host';} else {$strRefresh = '';} - $intReturn1 = $myVisClass->parseSelectMulti('tbl_host','host_name','dependent_host','tbl_lnkServicedependencyToHost_DH',0,$intFieldId,-9,$strRefresh); - if ($intReturn1 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['host_name'])) {$intFieldId = $arrModifyData['host_name'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue1) != 0)) {$strRefresh = 'sd_host';} else {$strRefresh = '';} - $intReturn1 = $myVisClass->parseSelectMulti('tbl_host','host_name','host','tbl_lnkServicedependencyToHost_H',0,$intFieldId,-9,$strRefresh); - if ($intReturn1 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process time period selection field - if (isset($arrModifyData['dependency_period'])) {$intFieldId = $arrModifyData['dependency_period'];} else {$intFieldId = 0;} - if ($chkModus == "refresh") {$intFieldId = $chkSelValue1;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','timeperiod',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process host group selection field - if (isset($arrModifyData['dependent_hostgroup_name'])) {$intFieldId = $arrModifyData['dependent_hostgroup_name'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue4) != 0)) {$strRefresh = 'sd_dependent_hostgroup';} else {$strRefresh = '';} - $intReturn2 = $myVisClass->parseSelectMulti('tbl_hostgroup','hostgroup_name','dependent_hostgroup','tbl_lnkServicedependencyToHostgroup_DH',0,$intFieldId,-9,$strRefresh); - if ($intReturn2 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['hostgroup_name'])) {$intFieldId = $arrModifyData['hostgroup_name'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue3) != 0)) {$strRefresh = 'sd_hostgroup';} else {$strRefresh = '';} - $intReturn2 = $myVisClass->parseSelectMulti('tbl_hostgroup','hostgroup_name','hostgroup','tbl_lnkServicedependencyToHostgroup_H',0,$intFieldId,-9,$strRefresh); - if ($intReturn2 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (($intReturn1 != 0) && ($intReturn2 != 0)) { - $myVisClass->processMessage(translate('Attention, no hosts and hostgroups defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process services selection field - if (isset($arrModifyData['dependent_service_description'])) {$intFieldId = $arrModifyData['dependent_service_description'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue6) != 0)) {$strRefresh = 'sd_dependent_service';} else {$strRefresh = '';} - $intReturn = $myVisClass->parseSelectMulti('tbl_service','service_description','dependent_service','tbl_lnkServicedependencyToService_DS',2,$intFieldId,-9,$strRefresh); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['service_description'])) {$intFieldId = $arrModifyData['service_description'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue5) != 0)) {$strRefresh = 'sd_service';} else {$strRefresh = '';} - $intReturn = $myVisClass->parseSelectMulti('tbl_service','service_description','service','tbl_lnkServicedependencyToService_S',2,$intFieldId,-9,$strRefresh); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process servicegroup selection field - if (isset($arrModifyData['dependent_servicegroup_name'])) {$intFieldId = $arrModifyData['dependent_servicegroup_name'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue8) != 0)) {$strRefresh = 'sd_dependent_servicegroup';} else {$strRefresh = '';} - $intReturn = $myVisClass->parseSelectMulti('tbl_servicegroup','servicegroup_name','dependent_servicegroup','tbl_lnkServicedependencyToServicegroup_DS',0,$intFieldId,-9,$strRefresh); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['servicegroup_name'])) {$intFieldId = $arrModifyData['servicegroup_name'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue7) != 0)) {$strRefresh = 'sd_servicegroup';} else {$strRefresh = '';} - $intReturn = $myVisClass->parseSelectMulti('tbl_servicegroup','servicegroup_name','servicegroup','tbl_lnkServicedependencyToServicegroup_S',0,$intFieldId,-9,$strRefresh); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - if ($chkModus == "refresh") {$intFieldId = $chkSelAccGr;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion != 3) $conttp->setVariable("VERSION_20_VALUE_MUST","mselValue1,"); - if ($chkModus == "refresh") { - if ($chkTfValue1 != "") $conttp->setVariable("DAT_CONFIG_NAME",$chkTfValue1); - foreach(explode(",",$strEO) AS $elem) { - $conttp->setVariable("DAT_EO".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$strNO) AS $elem) { - $conttp->setVariable("DAT_NO".strtoupper($elem)."_CHECKED","checked"); - } - if ($chkActive != 1) $conttp->setVariable("ACT_CHECKED",""); - if ($chkRegister != 1) $conttp->setVariable("REG_CHECKED",""); - if ($chkChbValue1 == 1) $conttp->setVariable("ACT_INHERIT","checked"); - if ($chkDataId != 0) { - $conttp->setVariable("DAT_ID",$chkDataId); - $conttp->setVariable("MODUS","modify"); - } - // Insert data from database in "modify" mode - } else if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo); - // Setting special data - if ($arrModifyData['inherits_parent'] == 1) $conttp->setVariable("ACT_INHERIT","checked"); - foreach(explode(",",$arrModifyData['execution_failure_criteria']) AS $elem) { - $conttp->setVariable("DAT_EO".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['notification_failure_criteria']) AS $elem) { - $conttp->setVariable("DAT_NO".strtoupper($elem)."_CHECKED","checked"); - } - - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if (($chkModus == 'add') || ($chkModus == 'refresh')) { + $conttp->setVariable('TITLE', translate('Define service dependencies (servicedependencies.cfg)')); + if ($chkModus == 'refresh') { + $_SESSION['refresh']['sd_host'] = $chkMselValue1; + $_SESSION['refresh']['sd_dependent_host'] = $chkMselValue2; + $_SESSION['refresh']['sd_hostgroup'] = $chkMselValue3; + $_SESSION['refresh']['sd_dependent_hostgroup'] = $chkMselValue4; + $_SESSION['refresh']['sd_service'] = $chkMselValue5; + $_SESSION['refresh']['sd_dependent_service'] = $chkMselValue6; + $_SESSION['refresh']['sd_servicegroup'] = $chkMselValue7; + $_SESSION['refresh']['sd_dependent_servicegroup'] = $chkMselValue8; + $myVisClass->arrSession = $_SESSION; + } else { + $_SESSION['refresh']['sd_host'] = $chkMselValue1; + $_SESSION['refresh']['sd_dependent_host'] = $chkMselValue2; + $_SESSION['refresh']['sd_hostgroup'] = $chkMselValue3; + $_SESSION['refresh']['sd_dependent_hostgroup'] = $chkMselValue4; + $_SESSION['refresh']['sd_service'] = $chkMselValue5; + $_SESSION['refresh']['sd_dependent_service'] = $chkMselValue6; + $_SESSION['refresh']['sd_servicegroup'] = $chkMselValue7; + $_SESSION['refresh']['sd_dependent_servicegroup'] = $chkMselValue8; + if (isset($arrModifyData['dependent_host_name']) && ($arrModifyData['dependent_host_name'] > 0)) { + $arrTemp = array(); + $strSQL = 'SELECT `idSlave`, `exclude` FROM `tbl_lnkServicedependencyToHost_DH` ' + . 'WHERE `idMaster` = ' .$arrModifyData['id']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($booReturn && ($intDC != 0)) { + foreach ($arrData as $elem) { + if ($elem['exclude'] == 1) { + $arrTemp[] = 'e' .$elem['idSlave']; + } else { + $arrTemp[] = $elem['idSlave']; + } + } + } + if ($arrModifyData['dependent_host_name'] == 2) { + $arrTemp[] = '*'; + } + $_SESSION['refresh']['sd_dependent_host'] = $arrTemp; + } + if (isset($arrModifyData['host_name']) && ($arrModifyData['host_name'] > 0)) { + $arrTemp = array(); + $strSQL = 'SELECT `idSlave`, `exclude` FROM `tbl_lnkServicedependencyToHost_H` ' + . 'WHERE `idMaster` = ' .$arrModifyData['id']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDC != 0) { + foreach ($arrData as $elem) { + if ($elem['exclude'] == 1) { + $arrTemp[] = 'e' .$elem['idSlave']; + } else { + $arrTemp[] = $elem['idSlave']; + } + } + } + if ($arrModifyData['host_name'] == 2) { + $arrTemp[] = '*'; + } + $_SESSION['refresh']['sd_host'] = $arrTemp; + } + if (isset($arrModifyData['dependent_hostgroup_name']) && ($arrModifyData['dependent_hostgroup_name'] > 0)) { + $arrTemp = array(); + $strSQL = 'SELECT `idSlave`, `exclude` FROM `tbl_lnkServicedependencyToHostgroup_DH` ' + . 'WHERE `idMaster` = ' .$arrModifyData['id']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDC != 0) { + foreach ($arrData as $elem) { + if ($elem['exclude'] == 1) { + $arrTemp[] = 'e' .$elem['idSlave']; + } else { + $arrTemp[] = $elem['idSlave']; + } + } + } + if ($arrModifyData['dependent_hostgroup_name'] == 2) { + $arrTemp[] = '*'; + } + $_SESSION['refresh']['sd_dependent_hostgroup'] = $arrTemp; + } + if (isset($arrModifyData['hostgroup_name']) && ($arrModifyData['hostgroup_name'] > 0)) { + $arrTemp = array(); + $strSQL = 'SELECT `idSlave`, `exclude` FROM `tbl_lnkServicedependencyToHostgroup_H` ' + . 'WHERE `idMaster` = ' .$arrModifyData['id']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDC != 0) { + foreach ($arrData as $elem) { + if ($elem['exclude'] == 1) { + $arrTemp[] = 'e' .$elem['idSlave']; + } else { + $arrTemp[] = $elem['idSlave']; + } + } + } + if ($arrModifyData['hostgroup_name'] == 2) { + $arrTemp[] = '*'; + } + $_SESSION['refresh']['sd_hostgroup'] = $arrTemp; + } + $myVisClass->arrSession = $_SESSION; + } + // Do not show modified time list + $intNoTime = 1; + // Process host selection field + if (isset($arrModifyData['dependent_host_name'])) { + $intFieldId = $arrModifyData['dependent_host_name']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue2) && (count($chkMselValue2) != 0)) { + $strRefresh = 'sd_dependent_host'; + } else { + $strRefresh = ''; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_host', + 'host_name', + 'dependent_host', + 'tbl_lnkServicedependencyToHost_DH', + 0, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['host_name'])) { + $intFieldId = $arrModifyData['host_name']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue1) && (count($chkMselValue1) != 0)) { + $strRefresh = 'sd_host'; + } else { + $strRefresh = ''; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_host', + 'host_name', + 'host', + 'tbl_lnkServicedependencyToHost_H', + 0, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process time period selection field + if (isset($arrModifyData['dependency_period'])) { + $intFieldId = $arrModifyData['dependency_period']; + } else { + $intFieldId = 0; + } + if ($chkModus == 'refresh') { + $intFieldId = $chkSelValue1; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'timeperiod', 1, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process host group selection field + if (isset($arrModifyData['dependent_hostgroup_name'])) { + $intFieldId = $arrModifyData['dependent_hostgroup_name']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue4) && (count($chkMselValue4) != 0)) { + $strRefresh = 'sd_dependent_hostgroup'; + } else { + $strRefresh = ''; + } + $intReturn2 = $myVisClass->parseSelectMulti( + 'tbl_hostgroup', + 'hostgroup_name', + 'dependent_hostgroup', + 'tbl_lnkServicedependencyToHostgroup_DH', + 0, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['hostgroup_name'])) { + $intFieldId = $arrModifyData['hostgroup_name']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue3) && (count($chkMselValue3) != 0)) { + $strRefresh = 'sd_hostgroup'; + } else { + $strRefresh = ''; + } + $intReturn2 = $myVisClass->parseSelectMulti( + 'tbl_hostgroup', + 'hostgroup_name', + 'hostgroup', + 'tbl_lnkServicedependencyToHostgroup_H', + 0, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn1 != 0) && ($intReturn2 != 0)) { + $myVisClass->processMessage(translate('Attention, no hosts and hostgroups defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process services selection field + if (isset($arrModifyData['dependent_service_description'])) { + $intFieldId = $arrModifyData['dependent_service_description']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue6) && (count($chkMselValue6) != 0)) { + $strRefresh = 'sd_dependent_service'; + } else { + $strRefresh = ''; + } + $intReturn = $myVisClass->parseSelectMulti( + 'tbl_service', + 'service_description', + 'dependent_service', + 'tbl_lnkServicedependencyToService_DS', + 2, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['service_description'])) { + $intFieldId = $arrModifyData['service_description']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue5) && (count($chkMselValue5) != 0)) { + $strRefresh = 'sd_service'; + } else { + $strRefresh = ''; + } + $intReturn = $myVisClass->parseSelectMulti( + 'tbl_service', + 'service_description', + 'service', + 'tbl_lnkServicedependencyToService_S', + 2, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process servicegroup selection field + if (isset($arrModifyData['dependent_servicegroup_name'])) { + $intFieldId = $arrModifyData['dependent_servicegroup_name']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue8) && (count($chkMselValue8) != 0)) { + $strRefresh = 'sd_dependent_servicegroup'; + } else { + $strRefresh = ''; + } + $intReturn = $myVisClass->parseSelectMulti( + 'tbl_servicegroup', + 'servicegroup_name', + 'dependent_servicegroup', + 'tbl_lnkServicedependencyToServicegroup_DS', + 0, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['servicegroup_name'])) { + $intFieldId = $arrModifyData['servicegroup_name']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue7) && (count($chkMselValue7) != 0)) { + $strRefresh = 'sd_servicegroup'; + } else { + $strRefresh = ''; + } + $intReturn = $myVisClass->parseSelectMulti( + 'tbl_servicegroup', + 'servicegroup_name', + 'servicegroup', + 'tbl_lnkServicedependencyToServicegroup_S', + 0, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + if ($chkModus == 'refresh') { + $intFieldId = $chkSelAccGr; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion < 3) { + $conttp->setVariable('VERSION_20_VALUE_MUST', 'mselValue1,'); + } + if ($chkModus == 'refresh') { + if ($chkTfValue1 != '') { + $conttp->setVariable('DAT_CONFIG_NAME', $chkTfValue1); + } + foreach (explode(',', $strEO) as $elem) { + $conttp->setVariable('DAT_EO' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $strNO) as $elem) { + $conttp->setVariable('DAT_NO' .strtoupper($elem). '_CHECKED', 'checked'); + } + if ($chkActive != 1) { + $conttp->setVariable('ACT_CHECKED', ''); + } + if ($chkRegister != 1) { + $conttp->setVariable('REG_CHECKED', ''); + } + if ($chkChbValue1 == 1) { + $conttp->setVariable('ACT_INHERIT', 'checked'); + } + if ($chkDataId != 0) { + $conttp->setVariable('DAT_ID', $chkDataId); + $conttp->setVariable('MODUS', 'modify'); + } + // Insert data from database in "modify" mode + } elseif (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo); + // Setting special data + if ($arrModifyData['inherits_parent'] == 1) { + $conttp->setVariable('ACT_INHERIT', 'checked'); + } + foreach (explode(',', $arrModifyData['execution_failure_criteria']) as $elem) { + $conttp->setVariable('DAT_EO' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['notification_failure_criteria']) as $elem) { + $conttp->setVariable('DAT_NO' .strtoupper($elem). '_CHECKED', 'checked'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Config name')); - $mastertp->setVariable("FIELD_2",translate('Dependent services')); - // Process search string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - $mastertp->setVariable("DISABLE_SORT_2","disable"); - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `dependent_service_description`, `register`, `active`, `config_id`, `access_group` FROM `$preTableName`WHERE $strDomainWhere - $strSearchWhere AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'process_field',40); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define service dependencies (servicedependencies.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Config name')); + $mastertp->setVariable('FIELD_2', translate('Dependent services')); + // Process search string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + } + $mastertp->setVariable('DISABLE_SORT_2', 'disable'); + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` " + . "WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; + $booReturn = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasetsk + $strSQL = "SELECT `id`, `$preKeyField`, `dependent_service_description`, `register`, `active`, `config_id`, " + . "`access_group` FROM `$preTableName`WHERE $strDomainWhere $strSearchWhere AND `access_group` " + . "IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData( + $mastertp, + $arrDataLines, + $intDataCount, + $intLineCount, + $preKeyField, + 'process_field', + 40 + ); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/serviceescalations.php b/admin/serviceescalations.php index d7e8382..7412fc5 100644 --- a/admin/serviceescalations.php +++ b/admin/serviceescalations.php @@ -5,322 +5,611 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Service escalation definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 23; -$preContent = "admin/serviceescalations.tpl.htm"; -$preSearchSession = 'serviceescalation'; -$preTableName = 'tbl_serviceescalation'; -$preKeyField = 'config_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 23; +$preContent = 'admin/serviceescalations.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'serviceescalation'; +$preTableName = 'tbl_serviceescalation'; +$preKeyField = 'config_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Data processing // =============== -$strEO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d,0,-1); -// +$strEO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d, 0, -1); +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `host_name`=$intMselValue1, `service_description`=$intMselValue3, `hostgroup_name`=$intMselValue2, - `contacts`=$intMselValue4, `contact_groups`=$intMselValue5, `servicegroup_name`=$intMselValue6, `first_notification`=$chkTfNullVal1, - `last_notification`=$chkTfNullVal2, `notification_interval`=$chkTfNullVal3, `escalation_period`='$chkSelValue1', `escalation_options`='$strEO', - $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if ((($intMselValue1 != 0) || ($intMselValue2 != 0) || ($intMselValue6 != 0)) && (($intMselValue3 != 0) || ($intMselValue6 != 0)) && - (($intMselValue5 != 0) || ($intMselValue4 != 0)) && ($chkTfNullVal1 != "NULL") && ($chkTfNullVal2 != "NULL") && ($chkTfNullVal3 != "NULL")) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New service escalation inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Service escalation modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkServiceescalationToHost",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkServiceescalationToHostgroup",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) $intRet3 = $myDataClass->dataInsertRelation("tbl_lnkServiceescalationToService",$chkDataId,$chkMselValue3); - if (isset($intRet3) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) $intRet4 = $myDataClass->dataInsertRelation("tbl_lnkServiceescalationToContact",$chkDataId,$chkMselValue4); - if (isset($intRet4) && ($intRet4 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue5 != 0) $intRet5 = $myDataClass->dataInsertRelation("tbl_lnkServiceescalationToContactgroup",$chkDataId,$chkMselValue5); - if (isset($intRet5) && ($intRet5 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue6 != 0) $intRet6 = $myDataClass->dataInsertRelation("tbl_lnkServiceescalationToServicegroup",$chkDataId,$chkMselValue6); - if (isset($intRet6) && ($intRet6 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkServiceescalationToHost",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkServiceescalationToHost",$chkDataId); - } - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkServiceescalationToHostgroup",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkServiceescalationToHostgroup",$chkDataId); - } - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) { - $intRet3 = $myDataClass->dataUpdateRelation("tbl_lnkServiceescalationToService",$chkDataId,$chkMselValue3); - } else { - $intRet3 = $myDataClass->dataDeleteRelation("tbl_lnkServiceescalationToService",$chkDataId); - } - if (isset($intRet3) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) { - $intRet4 = $myDataClass->dataUpdateRelation("tbl_lnkServiceescalationToContact",$chkDataId,$chkMselValue4); - } else { - $intRet4 = $myDataClass->dataDeleteRelation("tbl_lnkServiceescalationToContact",$chkDataId); - } - if (isset($intRet4) && ($intRet4 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue5 != 0) { - $intRet5 = $myDataClass->dataUpdateRelation("tbl_lnkServiceescalationToContactgroup",$chkDataId,$chkMselValue5); - } else { - $intRet5 = $myDataClass->dataDeleteRelation("tbl_lnkServiceescalationToContactgroup",$chkDataId); - } - if (isset($intRet5) && ($intRet5 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue6 != 0) { - $intRet6 = $myDataClass->dataUpdateRelation("tbl_lnkServiceescalationToServicegroup",$chkDataId,$chkMselValue6); - } else { - $intRet6 = $myDataClass->dataDeleteRelation("tbl_lnkServiceescalationToServicegroup",$chkDataId); - } - if (isset($intRet6) && ($intRet6 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2 + $intRet3 + $intRet4 + $intRet5 + $intRet6) != 0) $strInfoMessage = ""; - // - // Update Import HASH - // ================== - $booReturn = $myDataClass->updateHash($preTableName,$chkDataId); - if ($booReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `host_name`=$intMselValue1, " + . "`service_description`=$intMselValue3, `hostgroup_name`=$intMselValue2, `contacts`=$intMselValue4, " + . "`contact_groups`=$intMselValue5, `servicegroup_name`=$intMselValue6, `first_notification`=$chkTfNullVal1, " + . "`last_notification`=$chkTfNullVal2, `notification_interval`=$chkTfNullVal3, " + . "`escalation_period`='$chkSelValue1', `escalation_options`='$strEO', $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if ((($intMselValue1 != 0) || ($intMselValue2 != 0) || ($intMselValue6 != 0)) && (($intMselValue3 != 0) || + ($intMselValue6 != 0)) && (($intMselValue5 != 0) || ($intMselValue4 != 0)) && ($chkTfNullVal1 != 'NULL') && + ($chkTfNullVal2 != 'NULL') && ($chkTfNullVal3 != 'NULL')) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New service escalation inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Service escalation modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkServiceescalationToHost', + $chkDataId, + $chkMselValue1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkServiceescalationToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataInsertRelation( + 'tbl_lnkServiceescalationToService', + $chkDataId, + $chkMselValue3 + ); + } + if (isset($intRet3) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataInsertRelation( + 'tbl_lnkServiceescalationToContact', + $chkDataId, + $chkMselValue4 + ); + } + if (isset($intRet4) && ($intRet4 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue5 != 0) { + $intRet5 = $myDataClass->dataInsertRelation( + 'tbl_lnkServiceescalationToContactgroup', + $chkDataId, + $chkMselValue5 + ); + } + if (isset($intRet5) && ($intRet5 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue6 != 0) { + $intRet6 = $myDataClass->dataInsertRelation( + 'tbl_lnkServiceescalationToServicegroup', + $chkDataId, + $chkMselValue6 + ); + } + if (isset($intRet6) && ($intRet6 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServiceescalationToHost', + $chkDataId, + $chkMselValue1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkServiceescalationToHost', $chkDataId); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServiceescalationToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkServiceescalationToHostgroup', $chkDataId); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServiceescalationToService', + $chkDataId, + $chkMselValue3 + ); + } else { + $intRet3 = $myDataClass->dataDeleteRelation('tbl_lnkServiceescalationToService', $chkDataId); + } + if (isset($intRet3) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServiceescalationToContact', + $chkDataId, + $chkMselValue4 + ); + } else { + $intRet4 = $myDataClass->dataDeleteRelation('tbl_lnkServiceescalationToContact', $chkDataId); + } + if (isset($intRet4) && ($intRet4 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue5 != 0) { + $intRet5 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServiceescalationToContactgroup', + $chkDataId, + $chkMselValue5 + ); + } else { + $intRet5 = $myDataClass->dataDeleteRelation( + 'tbl_lnkServiceescalationToContactgroup', + $chkDataId + ); + } + if (isset($intRet5) && ($intRet5 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue6 != 0) { + $intRet6 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServiceescalationToServicegroup', + $chkDataId, + $chkMselValue6 + ); + } else { + $intRet6 = $myDataClass->dataDeleteRelation( + 'tbl_lnkServiceescalationToServicegroup', + $chkDataId + ); + } + if (isset($intRet6) && ($intRet6 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2 + $intRet3 + $intRet4 + $intRet5 + $intRet6) != 0) { + $strInfoMessage = ''; + } + // + // Update Import HASH + // ================== + $booReturn = $myDataClass->updateHash($preTableName, $chkDataId); + if ($booReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if (($chkModus != 'add') && ($chkModus != 'refresh')) { + $chkModus = 'display'; } -if (($chkModus != "add") && ($chkModus != "refresh")) $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define service escalation (serviceescalations.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if (($chkModus == "add") || ($chkModus == "refresh")) { - // Do not show modified time list - $intNoTime = 1; - // Refresh mode - if ($chkModus == "refresh") { - $_SESSION['refresh']['se_host'] = $chkMselValue1; - $_SESSION['refresh']['se_hostgroup'] = $chkMselValue2; - $_SESSION['refresh']['se_service'] = $chkMselValue3; - $_SESSION['refresh']['se_contact'] = $chkMselValue4; - $_SESSION['refresh']['se_contactgroup'] = $chkMselValue5; - $_SESSION['refresh']['se_servicegroup'] = $chkMselValue6; - } else { - $_SESSION['refresh']['se_host'] = $chkMselValue1; - $_SESSION['refresh']['se_hostgroup'] = $chkMselValue2; - $_SESSION['refresh']['se_service'] = $chkMselValue3; - $_SESSION['refresh']['se_contact'] = $chkMselValue4; - $_SESSION['refresh']['se_contactgroup'] = $chkMselValue5; - $_SESSION['refresh']['se_servicegroup'] = $chkMselValue6; - if (isset($arrModifyData['host_name']) && ($arrModifyData['host_name'] > 0 )){ - $arrTemp = array(); - $strSQL = "SELECT `idSlave`, `exclude` FROM `tbl_lnkServiceescalationToHost` WHERE `idMaster` = ".$arrModifyData['id']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDC != 0) { - foreach ($arrData AS $elem) { - if ($elem['exclude'] == 1) { - $arrTemp[] = "e".$elem['idSlave']; - } else { - $arrTemp[] = $elem['idSlave']; - } - } - } - if ($arrModifyData['host_name'] == 2) $arrTemp[] = '*'; - $_SESSION['refresh']['se_host'] = $arrTemp; - } - if (isset($arrModifyData['hostgroup_name']) && ($arrModifyData['hostgroup_name'] > 0 )){ - $arrTemp = array(); - $strSQL = "SELECT `idSlave`, `exclude` FROM `tbl_lnkServiceescalationToHostgroup` WHERE `idMaster` = ".$arrModifyData['id']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDC != 0) { - - foreach ($arrData AS $elem) { - if ($elem['exclude'] == 1) { - $arrTemp[] = "e".$elem['idSlave']; - } else { - $arrTemp[] = $elem['idSlave']; - } - } - } - if ($arrModifyData['hostgroup_name'] == 2) $arrTemp[] = '*'; - $_SESSION['refresh']['se_hostgroup'] = $arrTemp; - } - } - // Process host selection field - if (isset($arrModifyData['host_name'])) {$intFieldId = $arrModifyData['host_name'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue1) != 0)) {$strRefresh = 'se_host';} else {$strRefresh = '';} - $intReturn1 = $myVisClass->parseSelectMulti('tbl_host','host_name','host','tbl_lnkServiceescalationToHost',2,$intFieldId,-9,$strRefresh); - if ($intReturn1 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['hostgroup_name'])) {$intFieldId = $arrModifyData['hostgroup_name'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue2) != 0)) {$strRefresh = 'se_hostgroup';} else {$strRefresh = '';} - $intReturn2 = $myVisClass->parseSelectMulti('tbl_hostgroup','hostgroup_name','hostgroup','tbl_lnkServiceescalationToHostgroup',2,$intFieldId,-9,$strRefresh); - if ($intReturn2 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (($intReturn1 != 0) && ($intReturn2 != 0)) { - $myVisClass->processMessage(translate('Attention, no hosts and hostgroups defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process time period selection field - if (isset($arrModifyData['escalation_period'])) {$intFieldId = $arrModifyData['escalation_period'];} else {$intFieldId = 0;} - if ($chkModus == "refresh") $intFieldId = $chkSelValue1; - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','timeperiod',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process contact and contact group selection field - if (isset($arrModifyData['contacts'])) {$intFieldId = $arrModifyData['contacts'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue4) != 0)) {$strRefresh = 'se_contact';} else {$strRefresh = '';} - $intReturn1 = $myVisClass->parseSelectMulti('tbl_contact','contact_name','contact','tbl_lnkServiceescalationToContact',2,$intFieldId,-9,$strRefresh); - if ($intReturn1 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['contact_groups'])) {$intFieldId = $arrModifyData['contact_groups'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue5) != 0)) {$strRefresh = 'se_contactgroup';} else {$strRefresh = '';} - $intReturn2 = $myVisClass->parseSelectMulti('tbl_contactgroup','contactgroup_name','contactgroup','tbl_lnkServiceescalationToContactgroup',2,$intFieldId,-9,$strRefresh); - if ($intReturn2 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (($intReturn1 != 0) && ($intReturn2 != 0)) { - $myVisClass->processMessage(translate('Attention, no contacts and contactgroups defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process services selection field - if (isset($arrModifyData['service_description'])) {$intFieldId = $arrModifyData['service_description'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue3) != 0)) {$strRefresh = 'se_service';} else {$strRefresh = '';} - $intReturn = $myVisClass->parseSelectMulti('tbl_service','service_description','service','tbl_lnkServiceescalationToService',2,$intFieldId,-9,$strRefresh); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process servicegroup selection field - if (isset($arrModifyData['servicegroup_name'])) {$intFieldId = $arrModifyData['servicegroup_name'];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && (count($chkMselValue6) != 0)) {$strRefresh = 'se_servicegroup';} else {$strRefresh = '';} - $intReturn = $myVisClass->parseSelectMulti('tbl_servicegroup','servicegroup_name','servicegroup','tbl_lnkServiceescalationToServicegroup',0,$intFieldId,-9,$strRefresh); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - if ($chkModus == "refresh") $intFieldId = $chkSelAccGr; - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion != 3) $conttp->setVariable("VERSION_20_VALUE_MUST","mselValue1,"); - if ($chkModus == "refresh") { - if ($chkTfNullVal1 != "NULL") $conttp->setVariable("DAT_FIRST_NOTIFICATION",$chkTfNullVal1); - if ($chkTfNullVal2 != "NULL") $conttp->setVariable("DAT_LAST_NOTIFICATION",$chkTfNullVal2); - if ($chkTfNullVal3 != "NULL") $conttp->setVariable("DAT_NOTIFICATION_INTERVAL",$chkTfNullVal3); - if ($chkTfValue1 != "") $conttp->setVariable("DAT_CONFIG_NAME",$chkTfValue1); - foreach(explode(",",$strEO) AS $elem) { - $conttp->setVariable("DAT_EO".strtoupper($elem)."_CHECKED","checked"); - } - if ($chkActive != 1) $conttp->setVariable("ACT_CHECKED",""); - if ($chkRegister != 1) $conttp->setVariable("REG_CHECKED",""); - if ($chkDataId != 0) { - $conttp->setVariable("MODUS","modify"); - $conttp->setVariable("DAT_ID",$chkDataId); - } - // Insert data from database in "modify" mode - } else if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo); - // Process option fields - foreach(explode(",",$arrModifyData['escalation_options']) AS $elem) { - $conttp->setVariable("DAT_EO".strtoupper($elem)."_CHECKED","checked"); - } - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if (($chkModus == 'add') || ($chkModus == 'refresh')) { + $conttp->setVariable('TITLE', translate('Define service escalation (serviceescalations.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Refresh mode + if ($chkModus == 'refresh') { + $_SESSION['refresh']['se_host'] = $chkMselValue1; + $_SESSION['refresh']['se_hostgroup'] = $chkMselValue2; + $_SESSION['refresh']['se_service'] = $chkMselValue3; + $_SESSION['refresh']['se_contact'] = $chkMselValue4; + $_SESSION['refresh']['se_contactgroup'] = $chkMselValue5; + $_SESSION['refresh']['se_servicegroup'] = $chkMselValue6; + $myVisClass->arrSession = $_SESSION; + } else { + $_SESSION['refresh']['se_host'] = $chkMselValue1; + $_SESSION['refresh']['se_hostgroup'] = $chkMselValue2; + $_SESSION['refresh']['se_service'] = $chkMselValue3; + $_SESSION['refresh']['se_contact'] = $chkMselValue4; + $_SESSION['refresh']['se_contactgroup'] = $chkMselValue5; + $_SESSION['refresh']['se_servicegroup'] = $chkMselValue6; + if (isset($arrModifyData['host_name']) && ($arrModifyData['host_name'] > 0)) { + $arrTemp = array(); + $strSQL = 'SELECT `idSlave`, `exclude` ' + . 'FROM `tbl_lnkServiceescalationToHost` WHERE `idMaster` = ' .$arrModifyData['id']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDC != 0) { + foreach ($arrData as $elem) { + if ($elem['exclude'] == 1) { + $arrTemp[] = 'e' .$elem['idSlave']; + } else { + $arrTemp[] = $elem['idSlave']; + } + } + } + if ($arrModifyData['host_name'] == 2) { + $arrTemp[] = '*'; + } + $_SESSION['refresh']['se_host'] = $arrTemp; + } + if (isset($arrModifyData['hostgroup_name']) && ($arrModifyData['hostgroup_name'] > 0)) { + $arrTemp = array(); + $strSQL = 'SELECT `idSlave`, `exclude` ' + . 'FROM `tbl_lnkServiceescalationToHostgroup` WHERE `idMaster` = ' .$arrModifyData['id']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDC != 0) { + foreach ($arrData as $elem) { + if ($elem['exclude'] == 1) { + $arrTemp[] = 'e' .$elem['idSlave']; + } else { + $arrTemp[] = $elem['idSlave']; + } + } + } + if ($arrModifyData['hostgroup_name'] == 2) { + $arrTemp[] = '*'; + } + $_SESSION['refresh']['se_hostgroup'] = $arrTemp; + } + $myVisClass->arrSession = $_SESSION; + } + // Process host selection field + if (isset($arrModifyData['host_name'])) { + $intFieldId = $arrModifyData['host_name']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue1) && (count($chkMselValue1) != 0)) { + $strRefresh = 'se_host'; + } else { + $strRefresh = ''; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_host', + 'host_name', + 'host', + 'tbl_lnkServiceescalationToHost', + 2, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['hostgroup_name'])) { + $intFieldId = $arrModifyData['hostgroup_name']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue2) && (count($chkMselValue2) != 0)) { + $strRefresh = 'se_hostgroup'; + } else { + $strRefresh = ''; + } + $intReturn2 = $myVisClass->parseSelectMulti( + 'tbl_hostgroup', + 'hostgroup_name', + 'hostgroup', + 'tbl_lnkServiceescalationToHostgroup', + 2, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn1 != 0) && ($intReturn2 != 0)) { + $myVisClass->processMessage(translate('Attention, no hosts and hostgroups defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process time period selection field + if (isset($arrModifyData['escalation_period'])) { + $intFieldId = $arrModifyData['escalation_period']; + } else { + $intFieldId = 0; + } + if ($chkModus == 'refresh') { + $intFieldId = $chkSelValue1; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'timeperiod', 1, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process contact and contact group selection field + if (isset($arrModifyData['contacts'])) { + $intFieldId = $arrModifyData['contacts']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue4) && (count($chkMselValue4) != 0)) { + $strRefresh = 'se_contact'; + } else { + $strRefresh = ''; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_contact', + 'contact_name', + 'contact', + 'tbl_lnkServiceescalationToContact', + 2, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['contact_groups'])) { + $intFieldId = $arrModifyData['contact_groups']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue5) && (count($chkMselValue5) != 0)) { + $strRefresh = 'se_contactgroup'; + } else { + $strRefresh = ''; + } + $intReturn2 = $myVisClass->parseSelectMulti( + 'tbl_contactgroup', + 'contactgroup_name', + 'contactgroup', + 'tbl_lnkServiceescalationToContactgroup', + 2, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn1 != 0) && ($intReturn2 != 0)) { + $myVisClass->processMessage(translate('Attention, no contacts and contactgroups defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process services selection field + if (isset($arrModifyData['service_description'])) { + $intFieldId = $arrModifyData['service_description']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue3) && (count($chkMselValue3) != 0)) { + $strRefresh = 'se_service'; + } else { + $strRefresh = ''; + } + $intReturn = $myVisClass->parseSelectMulti( + 'tbl_service', + 'service_description', + 'service', + 'tbl_lnkServiceescalationToService', + 2, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process servicegroup selection field + if (isset($arrModifyData['servicegroup_name'])) { + $intFieldId = $arrModifyData['servicegroup_name']; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && is_array($chkMselValue6) && (count($chkMselValue6) != 0)) { + $strRefresh = 'se_servicegroup'; + } else { + $strRefresh = ''; + } + $intReturn = $myVisClass->parseSelectMulti( + 'tbl_servicegroup', + 'servicegroup_name', + 'servicegroup', + 'tbl_lnkServiceescalationToServicegroup', + 0, + $intFieldId, + -9, + $strRefresh + ); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + if ($chkModus == 'refresh') { + $intFieldId = $chkSelAccGr; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion < 3) { + $conttp->setVariable('VERSION_20_VALUE_MUST', 'mselValue1,'); + } + if ($chkModus == 'refresh') { + if ($chkTfNullVal1 != 'NULL') { + $conttp->setVariable('DAT_FIRST_NOTIFICATION', $chkTfNullVal1); + } + if ($chkTfNullVal2 != 'NULL') { + $conttp->setVariable('DAT_LAST_NOTIFICATION', $chkTfNullVal2); + } + if ($chkTfNullVal3 != 'NULL') { + $conttp->setVariable('DAT_NOTIFICATION_INTERVAL', $chkTfNullVal3); + } + if ($chkTfValue1 != '') { + $conttp->setVariable('DAT_CONFIG_NAME', $chkTfValue1); + } + foreach (explode(',', $strEO) as $elem) { + $conttp->setVariable('DAT_EO' .strtoupper($elem). '_CHECKED', 'checked'); + } + if ($chkActive != 1) { + $conttp->setVariable('ACT_CHECKED', ''); + } + if ($chkRegister != 1) { + $conttp->setVariable('REG_CHECKED', ''); + } + if ($chkDataId != 0) { + $conttp->setVariable('MODUS', 'modify'); + $conttp->setVariable('DAT_ID', $chkDataId); + } + // Insert data from database in "modify" mode + } elseif (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + .'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo); + // Process option fields + foreach (explode(',', $arrModifyData['escalation_options']) as $elem) { + $conttp->setVariable('DAT_EO' .strtoupper($elem). '_CHECKED', 'checked'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Config name')); - $mastertp->setVariable("FIELD_2",translate('Services')); - // Process search string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - $mastertp->setVariable("DISABLE_SORT_2","disable"); - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `service_description`, `register`, `active`, `config_id`, `access_group` FROM `$preTableName` - WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'process_field',40); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define service escalation (serviceescalations.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Config name')); + $mastertp->setVariable('FIELD_2', translate('Services')); + // Process search string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + } + $mastertp->setVariable('DISABLE_SORT_2', 'disable'); + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` " + . "WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; + $booReturn = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `id`, `$preKeyField`, `service_description`, `register`, `active`, `config_id`, " + . "`access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN " + . "($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData( + $mastertp, + $arrDataLines, + $intDataCount, + $intLineCount, + $preKeyField, + 'process_field', + 40 + ); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/serviceextinfo.php b/admin/serviceextinfo.php index ac3dac5..226c29e 100644 --- a/admin/serviceextinfo.php +++ b/admin/serviceextinfo.php @@ -5,199 +5,275 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Service extended information definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Component : Service escalation definition +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 24; -$preContent = "admin/serviceextinfo.tpl.htm"; -$preSearchSession = 'serviceextinfo'; -$preTableName = 'tbl_serviceextinfo'; -$preKeyField = 'host_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 24; +$preContent = 'admin/serviceextinfo.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'serviceextinfo'; +$preTableName = 'tbl_serviceextinfo'; +$preKeyField = 'host_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); -// +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkSelValue1', `service_description`='$chkSelValue2', `notes`='$chkTfValue1', `notes_url`='$chkTfValue2', - `action_url`='$chkTfValue3', `icon_image`='$chkTfValue4', `icon_image_alt`='$chkTfValue5', $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkSelValue1 != 0) && ($chkSelValue2 != 0)) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New service extended information inserted:')." ".$chkSelValue1."::".$chkSelValue2); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Service extended information modified:')." ".$chkSelValue1."::".$chkSelValue2); - // - // Update Import HASH - // ================== - $booReturn = $myDataClass->updateHash($preTableName,$chkDataId); - if ($booReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkSelValue1', `service_description`='$chkSelValue2', " + . "`notes`='$chkTfValue1', `notes_url`='$chkTfValue2', `action_url`='$chkTfValue3', " + . "`icon_image`='$chkTfValue4', `icon_image_alt`='$chkTfValue5', $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkSelValue1 != 0) && ($chkSelValue2 != 0)) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New service extended information inserted:'). ' ' .$chkSelValue1. + '::' .$chkSelValue2); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Service extended information modified:'). ' ' .$chkSelValue1. + '::' .$chkSelValue2); + } + // + // Update Import HASH + // ================== + $booReturn = $myDataClass->updateHash($preTableName, $chkDataId); + if ($booReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if (($chkModus != 'add') && ($chkModus != 'refresh')) { + $chkModus = 'display'; } -if (($chkModus != "add") && ($chkModus != "refresh")) $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define service extended information (serviceextinfo.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if (($chkModus == "add") || ($chkModus == "refresh")) { - // Do not show modified time list - $intNoTime = 1; - // Refresh mode - if ($chkModus == "refresh") { - $_SESSION['refresh']['se_host'] = $chkSelValue1; - } else { - $_SESSION['refresh']['se_host'] = $chkSelValue1; - if (isset($arrModifyData[$preKeyField]) && ($arrModifyData[$preKeyField] != 0 )){ - $strSQL = "SELECT `$preKeyField` FROM `$preTableName` WHERE `id` = ".$arrModifyData['id']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($intDC != 0) { - $_SESSION['refresh']['se_host'] = $arrData[0][$preKeyField]; - } - } else { - $strSQL = "SELECT `id` FROM `tbl_host` WHERE `active`='1' AND `config_id`=$chkDomainId ORDER BY `$preKeyField`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($intDC != 0) { - $_SESSION['refresh']['se_host'] = $arrData[0]['id']; - } - } - } - // Process host selection field - if (isset($arrModifyData[$preKeyField])) {$intFieldId = $arrModifyData[$preKeyField];} else {$intFieldId = 0;} - if (($chkModus == "refresh") && ($chkSelValue1 != 0)) $intFieldId = $chkSelValue1; - $intReturn1 = $myVisClass->parseSelectSimple('tbl_host',$preKeyField,'host',0,$intFieldId); - if ($intReturn1 != 0) { - $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - $myVisClass->processMessage(translate('Attention, no hosts defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process service selection field - if (isset($arrModifyData['service_description'])) {$intFieldId = $arrModifyData['service_description'];} else {$intFieldId = 0;} - $intReturn1 = $myVisClass->parseSelectSimple('tbl_service','service_description','service_extinfo',0,$intFieldId); - if ($intReturn1 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion != 3) $conttp->setVariable("VERSION_20_VALUE_MUST","mselValue1,"); - if ($chkModus == "refresh") { - $conttp->setVariable("DAT_NOTES",$chkTfValue1); - $conttp->setVariable("DAT_NOTES_URL",$chkTfValue2); - $conttp->setVariable("DAT_ACTION_URL",$chkTfValue3); - $conttp->setVariable("DAT_ICON_IMAGE",$chkTfValue4); - $conttp->setVariable("DAT_ICON_IMAGE_ALT",$chkTfValue5); - if ($chkActive != 1) $conttp->setVariable("ACT_CHECKED",""); - if ($chkRegister != 1) $conttp->setVariable("REG_CHECKED",""); - if ($chkDataId != 0) { - $conttp->setVariable("MODUS","modify"); - $conttp->setVariable("DAT_ID",$chkDataId); - } -// Insert data from database in "modify" mode - } else if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo); - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if (($chkModus == 'add') || ($chkModus == 'refresh')) { + $conttp->setVariable('TITLE', translate('Define service extended information (serviceextinfo.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Refresh mode + if ($chkModus == 'refresh') { + $_SESSION['refresh']['se_host'] = $chkSelValue1; + $myVisClass->arrSession = $_SESSION; + } else { + $_SESSION['refresh']['se_host'] = $chkSelValue1; + if (isset($arrModifyData[$preKeyField]) && ($arrModifyData[$preKeyField] != 0)) { + $strSQL = "SELECT `$preKeyField` FROM `$preTableName` WHERE `id` = ".$arrModifyData['id']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($intDC != 0) { + $_SESSION['refresh']['se_host'] = $arrData[0][$preKeyField]; + } + } else { + $strSQL = 'SELECT `id` FROM `tbl_host` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId ORDER BY `$preKeyField`"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($intDC != 0) { + $_SESSION['refresh']['se_host'] = $arrData[0]['id']; + } + } + $myVisClass->arrSession = $_SESSION; + } + // Process host selection field + if (isset($arrModifyData[$preKeyField])) { + $intFieldId = $arrModifyData[$preKeyField]; + } else { + $intFieldId = 0; + } + if (($chkModus == 'refresh') && ($chkSelValue1 != 0)) { + $intFieldId = $chkSelValue1; + } + $intReturn1 = $myVisClass->parseSelectSimple('tbl_host', $preKeyField, 'host', 0, $intFieldId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + $myVisClass->processMessage(translate('Attention, no hosts defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process service selection field + if (isset($arrModifyData['service_description'])) { + $intFieldId = $arrModifyData['service_description']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectSimple( + 'tbl_service', + 'service_description', + 'service_extinfo', + 0, + $intFieldId + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion < 3) { + $conttp->setVariable('VERSION_20_VALUE_MUST', 'mselValue1,'); + } + if ($chkModus == 'refresh') { + $conttp->setVariable('DAT_NOTES', $chkTfValue1); + $conttp->setVariable('DAT_NOTES_URL', $chkTfValue2); + $conttp->setVariable('DAT_ACTION_URL', $chkTfValue3); + $conttp->setVariable('DAT_ICON_IMAGE', $chkTfValue4); + $conttp->setVariable('DAT_ICON_IMAGE_ALT', $chkTfValue5); + if ($chkActive != 1) { + $conttp->setVariable('ACT_CHECKED', ''); + } + if ($chkRegister != 1) { + $conttp->setVariable('REG_CHECKED', ''); + } + if ($chkDataId != 0) { + $conttp->setVariable('MODUS', 'modify'); + $conttp->setVariable('DAT_ID', $chkDataId); + } + // Insert data from database in "modify" mode + } elseif (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + .'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo); + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Hostname')); - $mastertp->setVariable("FIELD_2",translate('Service')); - // Process search string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`tbl_host`.`$preKeyField` LIKE '%".$strSearchTxt."%' OR `$preTableName`.`notes` LIKE '%".$strSearchTxt."%' - OR `$preTableName`.`notes_url` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `$preTableName`.`config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `$preTableName`.`config_id`, `tbl_service`.`service_description` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` LEFT JOIN `tbl_host` ON `$preTableName`.`$preKeyField` = `tbl_host`.`id` - LEFT JOIN `tbl_service` ON `$preTableName`.`service_description` = `tbl_service`.`id` - WHERE $strDomainWhere $strSearchWhere AND `$preTableName`.`access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:')); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intCount = (int)$arrDataLinesCount['number']; - if ($intCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `$preTableName`.`id`, `tbl_host`.`$preKeyField`, `tbl_service`.`service_description`, `$preTableName`.`notes`, `$preTableName`.`register`, - `$preTableName`.`active`, `$preTableName`.`config_id`, `$preTableName`.`access_group` FROM `$preTableName` - LEFT JOIN `tbl_host` ON `$preTableName`.`$preKeyField` = `tbl_host`.`id` - LEFT JOIN `tbl_service` ON `$preTableName`.`service_description` = `tbl_service`.`id` - WHERE $strDomainWhere $strSearchWhere AND `$preTableName`.`access_group` IN ($strAccess) - $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:')); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'service_description'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define service extended information (serviceextinfo.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Hostname')); + $mastertp->setVariable('FIELD_2', translate('Service')); + // Process search string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`tbl_host`.`$preKeyField` LIKE '%".$strSearchTxt."%' OR `$preTableName`.`notes` " + . "LIKE '%".$strSearchTxt."%' OR `$preTableName`.`notes_url` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `$preTableName`.`config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `$preTableName`.`config_id`, `tbl_service`.`service_description` $hidSortDir"; + } + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` " + . "LEFT JOIN `tbl_host` ON `$preTableName`.`$preKeyField` = `tbl_host`.`id` " + . "LEFT JOIN `tbl_service` ON `$preTableName`.`service_description` = `tbl_service`.`id` " + . "WHERE $strDomainWhere $strSearchWhere AND `$preTableName`.`access_group` IN ($strAccess)"; + $booReturn = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `$preTableName`.`id`, `tbl_host`.`$preKeyField`, `tbl_service`.`service_description`, " + . "`$preTableName`.`notes`, `$preTableName`.`register`, `$preTableName`.`active`, `$preTableName`.`config_id`, " + . "`$preTableName`.`access_group` FROM `$preTableName` " + . "LEFT JOIN `tbl_host` ON `$preTableName`.`$preKeyField` = `tbl_host`.`id` " + . "LEFT JOIN `tbl_service` ON `$preTableName`.`service_description` = `tbl_service`.`id` " + . "WHERE $strDomainWhere $strSearchWhere AND `$preTableName`.`access_group` IN ($strAccess) $strOrderString " + . "LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData( + $mastertp, + $arrDataLines, + $intDataCount, + $intLineCount, + $preKeyField, + 'service_description' + ); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/servicegroups.php b/admin/servicegroups.php index bd1e0bb..efdccd7 100644 --- a/admin/servicegroups.php +++ b/admin/servicegroups.php @@ -5,179 +5,277 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin servicegroup definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 11; -$preContent = "admin/servicegroups.tpl.htm"; -$preSearchSession = 'servicegroup'; -$preTableName = 'tbl_servicegroup'; -$preKeyField = 'servicegroup_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 11; +$preContent = 'admin/servicegroups.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'servicegroup'; +$preTableName = 'tbl_servicegroup'; +$preKeyField = 'servicegroup_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); -// +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `members`=$intMselValue1, `servicegroup_members`=$intMselValue2, - `notes`='$chkTfValue3', `notes_url`='$chkTfValue4', `action_url`='$chkTfValue5', $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && ($chkTfValue2 != "") && (($intMselValue1 != 0) || ($intVersion == 3))) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New service group inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Service group modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkServicegroupToService",$chkDataId,$chkMselValue1,1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkServicegroupToServicegroup",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkServicegroupToService",$chkDataId,$chkMselValue1,1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkServicegroupToService",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkServicegroupToServicegroup",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkServicegroupToServicegroup",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2) != 0) $strInfoMessage = ""; - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `members`=$intMselValue1, " + . "`servicegroup_members`=$intMselValue2, `notes`='$chkTfValue3', `notes_url`='$chkTfValue4', " + . "`action_url`='$chkTfValue5', $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && ($chkTfValue2 != '') && (($intMselValue1 != 0) || ($intVersion >= 3))) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New service group inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Service group modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicegroupToService', + $chkDataId, + $chkMselValue1, + 1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicegroupToServicegroup', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicegroupToService', + $chkDataId, + $chkMselValue1, + 1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkServicegroupToService', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicegroupToServicegroup', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkServicegroupToServicegroup', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2) != 0) { + $strInfoMessage = ''; + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define service groups (servicegroups.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process service selection field - $intReturn = 0; - if (isset($arrModifyData['members'])) {$intFieldId = $arrModifyData['members'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_service','service_description','service_members','tbl_lnkServicegroupToService',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (($intReturn != 0) && ($intVersion != 3)) { - $myVisClass->processMessage(translate('Attention, no services defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process service group selection field - if (isset($arrModifyData['servicegroup_members'])) {$intFieldId = $arrModifyData['servicegroup_members'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti($preTableName,$preKeyField,'servicegroups','tbl_lnkServicegroupToServicegroup',0,$intFieldId,$chkListId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion != 3) $conttp->setVariable("VERSION_20_VALUE_MUST","mselValue1,"); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo); - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Define service groups (servicegroups.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process service selection field + if (isset($arrModifyData['members'])) { + $intFieldId = $arrModifyData['members']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_service', + 'service_description', + 'service_members', + 'tbl_lnkServicegroupToService', + 0, + $intFieldId + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn1 != 0) && ($intVersion < 3)) { + $myVisClass->processMessage(translate('Attention, no services defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process service group selection field + if (isset($arrModifyData['servicegroup_members'])) { + $intFieldId = $arrModifyData['servicegroup_members']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectMulti( + $preTableName, + $preKeyField, + 'servicegroups', + 'tbl_lnkServicegroupToServicegroup', + 0, + $intFieldId, + $chkListId + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn3 = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion < 3) { + $conttp->setVariable('VERSION_20_VALUE_MUST', 'mselValue1,'); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo); + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Service group')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Process search string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' OR `notes` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere - AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'alias'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define service groups (servicegroups.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Service group')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Process search string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' " + . "OR `notes` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; + } + // Count datasets + $strSQL1 = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere " + . "AND `access_group` IN ($strAccess)"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL1, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL2 = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `config_id`, `access_group` " + . "FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess) " + . "$strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL2, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'alias'); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/services.php b/admin/services.php index 13d4971..a0cb121 100644 --- a/admin/services.php +++ b/admin/services.php @@ -5,495 +5,789 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Service definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 9; -$preContent = "admin/services.tpl.htm"; -$preSearchSession = 'service'; -$preTableName = 'tbl_service'; -$preKeyField = 'config_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 9; +$preContent = 'admin/services.htm.tpl'; +$preListTpl = 'admin/datalist_services.htm.tpl'; +$preSearchSession = 'service'; +$preTableName = 'tbl_service'; +$preKeyField = 'config_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Data processing // =============== -$strNO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e.$chkChbGr1f,0,-1); -$strIS = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d,0,-1); -$strFL = substr($chkChbGr3a.$chkChbGr3b.$chkChbGr3c.$chkChbGr3d,0,-1); -$strST = substr($chkChbGr4a.$chkChbGr4b.$chkChbGr4c.$chkChbGr4d,0,-1); -if ($chkSelValue1 != "") { - for ($i=1;$i<=8;$i++) { - ${"chkTfArg$i"} = str_replace("!","::bang::",${"chkTfArg$i"}); - if (${"chkTfArg$i"} != "") $chkSelValue1 .= "!".${"chkTfArg$i"}; - } +$strNO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e.$chkChbGr1f, 0, -1); +$strIS = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d, 0, -1); +$strFL = substr($chkChbGr3a.$chkChbGr3b.$chkChbGr3c.$chkChbGr3d, 0, -1); +$strST = substr($chkChbGr4a.$chkChbGr4b.$chkChbGr4c.$chkChbGr4d, 0, -1); +if ($chkSelValue1 != '') { + for ($i = 1; $i <= 8; $i++) { + $tmpVar = 'chkTfArg'.$i; + $$tmpVar = str_replace('!', '::bang::', $$tmpVar); + if ($$tmpVar != '') { + $chkSelValue1 .= '!' .$$tmpVar; + } + } } -// +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `host_name`=$intMselValue1, `host_name_tploptions`=$chkRadValue1, `hostgroup_name`=$intMselValue2, - `hostgroup_name_tploptions`=$chkRadValue2, `service_description`='$chkTfValue3', `display_name`='$chkTfValue4', `servicegroups`=$intMselValue3, - `servicegroups_tploptions`=$chkRadValue3, `check_command`='$chkSelValue1', `use_template`=$intTemplates, `is_volatile`=$chkRadValue14, - `initial_state`='$strIS', `max_check_attempts`=$chkTfNullVal2, `check_interval`=$chkTfNullVal3, `retry_interval`=$chkTfNullVal1, - `active_checks_enabled`=$chkRadValue4, `passive_checks_enabled`=$chkRadValue5, `check_period`=$chkSelValue2, `parallelize_check`=$chkRadValue6, - `obsess_over_service`=$chkRadValue8, `check_freshness`=$chkRadValue7, `freshness_threshold`=$chkTfNullVal4, `event_handler`=$chkSelValue3, - `event_handler_enabled`=$chkRadValue9, `low_flap_threshold`=$chkTfNullVal5, `high_flap_threshold`=$chkTfNullVal6, `flap_detection_enabled`=$chkRadValue10, - `flap_detection_options`='$strFL', `process_perf_data`=$chkRadValue13, `retain_status_information`=$chkRadValue11, `retain_nonstatus_information`=$chkRadValue12, - `contacts`=$intMselValue4, `contacts_tploptions`=$chkRadValue15, `contact_groups`=$intMselValue5, `contact_groups_tploptions`=$chkRadValue16, - `notification_interval`=$chkTfNullVal7, `notification_period`=$chkSelValue4, `first_notification_delay`=$chkTfNullVal8, `notification_options`='$strNO', - `notifications_enabled`=$chkRadValue17, `stalking_options`='$strST', `notes`='$chkTfValue5', `notes_url`='$chkTfValue6', `action_url`='$chkTfValue7', - `icon_image`='$chkTfValue8', `icon_image_alt`='$chkTfValue9', `name`='$chkTfValue10', $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && ($chkTfValue3 != "")) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New service inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Service modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkServiceToHost",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkServiceToHostgroup",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) $intRet3 = $myDataClass->dataInsertRelation("tbl_lnkServiceToServicegroup",$chkDataId,$chkMselValue3); - if (isset($intRet3) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) $intRet4 = $myDataClass->dataInsertRelation("tbl_lnkServiceToContact",$chkDataId,$chkMselValue4); - if (isset($intRet4) && ($intRet4 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue5 != 0) $intRet5 = $myDataClass->dataInsertRelation("tbl_lnkServiceToContactgroup",$chkDataId,$chkMselValue5); - if (isset($intRet5) && ($intRet5 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkServiceToHost",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkServiceToHost",$chkDataId); - } - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkServiceToHostgroup",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkServiceToHostgroup",$chkDataId); - } - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) { - $intRet3 = $myDataClass->dataUpdateRelation("tbl_lnkServiceToServicegroup",$chkDataId,$chkMselValue3); - } else { - $intRet3 = $myDataClass->dataDeleteRelation("tbl_lnkServiceToServicegroup",$chkDataId); - } - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) { - $intRet4 = $myDataClass->dataUpdateRelation("tbl_lnkServiceToContact",$chkDataId,$chkMselValue4); - } else { - $intRet4 = $myDataClass->dataDeleteRelation("tbl_lnkServiceToContact",$chkDataId); - } - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue5 != 0) { - $intRet5 = $myDataClass->dataUpdateRelation("tbl_lnkServiceToContactgroup",$chkDataId,$chkMselValue5); - } else { - $intRet5 = $myDataClass->dataDeleteRelation("tbl_lnkServiceToContactgroup",$chkDataId); - } - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2 + $intRet3 + $intRet4 + $intRet5) != 0) $strInfoMessage = ""; - // - // Removing the config file if an entry was deleted or renamed - // =========================================================== - if (($chkModus == "modify") && ($chkTfValue2 != $chkTfValue1) && ($chkDomainId != 0)) { - $intServiceCount = $myDBClass->countRows("SELECT * FROM `$preTableName` - WHERE BINARY `$preKeyField`='$chkTfValue2' AND `config_id`=$chkDomainId AND `active`='1'"); - if ($intServiceCount == 0) { - $arrConfigID = $myConfigClass->getConfigSets(); - if (($arrConfigID != 1) && is_array($arrConfigID)) { - $intReturn = 0; - foreach($arrConfigID AS $intConfigID) { - $intReturn += $myConfigClass->moveFile("service",$chkTfValue2.".cfg",$intConfigID); - } - if ($intReturn == 0) { - $myVisClass->processMessage(translate('The assigned, no longer used configuration files were deleted successfully!'),$strInfoMessage); - $myDataClass->writeLog(translate('Service file deleted:')." ".$chkTfValue2.".cfg"); - } else { - if ($chkDomainId == 0) { - $myVisClass->processMessage(translate('Common files cannot be removed from target systems - please check manually'),$strErrorMessage); - } else { - $myVisClass->processMessage(translate('Errors while deleting the old configuration file - please check!:'),$strErrorMessage); - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } - } - } - } - } - // - // Removing the config file if an entry was dectivated - // =================================================== - if (($chkModus == "modify") && ($chkActive == 0)) { - $intServiceCount = $myDBClass->countRows("SELECT * FROM `$preTableName` WHERE `$preKeyField`='$chkTfValue2' AND `config_id`=$chkDomainId AND `active`='1'"); - if ($intServiceCount == 0) { - $arrConfigID = $myConfigClass->getConfigSets(); - if (($arrConfigID != 1) && is_array($arrConfigID)) { - $intReturn = 0; - foreach($arrConfigID AS $intConfigID) { - $intReturn += $myConfigClass->moveFile("service",$chkTfValue2.".cfg",$intConfigID); - } - if ($intReturn == 0) { - $myVisClass->processMessage(translate('The assigned, no longer used configuration files were deleted successfully!'),$strInfoMessage); - $myDataClass->writeLog(translate('Service file deleted:')." ".$chkTfValue2.".cfg"); - } else { - $myVisClass->processMessage(translate('Errors while deleting the old configuration file - please check!:'),$strErrorMessage); - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } - } - } - } - // - // Insert/update session data for templates - // ======================================== - if ($chkModus == "modify") { - $strSQL = "DELETE FROM `tbl_lnkServiceToServicetemplate` WHERE `idMaster`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && (count($_SESSION['templatedefinition']) != 0)) { - $intSortId = 1; - foreach($_SESSION['templatedefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`,`idSlave`,`idTable`,`idSort`) - VALUES ($chkDataId,".$elem['idSlave'].",".$elem['idTable'].",".$intSortId.")"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - $intSortId++; - } - } - // - // Insert/update session data for free variables - // ============================================= - if ($chkModus == "modify") { - $strSQL = "SELECT * FROM `tbl_lnkServiceToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDataCount != 0) { - foreach ($arrData AS $elem) { - $strSQL = "DELETE FROM `tbl_variabledefinition` WHERE `id`=".$elem['idSlave']; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - $strSQL = "DELETE FROM `tbl_lnkServiceToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - $strSQL = "UPDATE `tbl_service` SET `use_variables`=0 WHERE `id`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && (count($_SESSION['variabledefinition']) != 0)) { - $intCountVariable = 0; - foreach($_SESSION['variabledefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) - VALUES ('".$elem['definition']."','".$elem['range']."',now())"; - $intReturn1 = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - $strSQL = "INSERT INTO `tbl_lnkServiceToVariabledefinition` (`idMaster`,`idSlave`) - VALUES ($chkDataId,$intInsertId)"; - $intReturn2 = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if (($intReturn1 == 0) && ($intReturn2 == 0)) $intCountVariable++; - } - } - if ($intCountVariable != 0) { - $strSQL = "UPDATE `tbl_service` SET `use_variables`=1 WHERE `id`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - // - // Update Import HASH - // ================== - $intReturn = $myDataClass->updateHash($preTableName,$chkDataId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `host_name`=$intMselValue1, " + . "`host_name_tploptions`=$chkRadValue1, `hostgroup_name`=$intMselValue2, " + . "`hostgroup_name_tploptions`=$chkRadValue2, `service_description`='$chkTfValue3', " + . "`display_name`='$chkTfValue4', `parents`=$intMselValue6, `parents_tploptions`=$chkRadValue18, " + . "`importance`=$chkTfNullVal9, `servicegroups`=$intMselValue3, " + . "`servicegroups_tploptions`=$chkRadValue3, `check_command`='$chkSelValue1', " + . "`use_template`=$intTemplates, `is_volatile`=$chkRadValue14, `initial_state`='$strIS', " + . "`max_check_attempts`=$chkTfNullVal2, `check_interval`=$chkTfNullVal3, `retry_interval`=$chkTfNullVal1, " + . "`active_checks_enabled`=$chkRadValue4, `passive_checks_enabled`=$chkRadValue5, " + . "`check_period`=$chkSelValue2, `parallelize_check`=$chkRadValue6, `obsess_over_service`=$chkRadValue8, " + . "`check_freshness`=$chkRadValue7, `freshness_threshold`=$chkTfNullVal4, `event_handler`=$chkSelValue3, " + . "`event_handler_enabled`=$chkRadValue9, `low_flap_threshold`=$chkTfNullVal5, " + . "`high_flap_threshold`=$chkTfNullVal6, `flap_detection_enabled`=$chkRadValue10, " + . "`flap_detection_options`='$strFL', `process_perf_data`=$chkRadValue13, " + . "`retain_status_information`=$chkRadValue11, `retain_nonstatus_information`=$chkRadValue12, " + . "`contacts`=$intMselValue4, `contacts_tploptions`=$chkRadValue15, `contact_groups`=$intMselValue5, " + . "`contact_groups_tploptions`=$chkRadValue16, `notification_interval`=$chkTfNullVal7, " + . "`notification_period`=$chkSelValue4, `first_notification_delay`=$chkTfNullVal8, " + . "`notification_options`='$strNO', `notifications_enabled`=$chkRadValue17, `stalking_options`='$strST', " + . "`notes`='$chkTfValue5', `notes_url`='$chkTfValue6', `action_url`='$chkTfValue7', " + . "`icon_image`='$chkTfValue8', `icon_image_alt`='$chkTfValue9', `name`='$chkTfValue10', $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && ($chkTfValue3 != '')) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New service inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Service modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation('tbl_lnkServiceToHost', $chkDataId, $chkMselValue1); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkServiceToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataInsertRelation( + 'tbl_lnkServiceToServicegroup', + $chkDataId, + $chkMselValue3 + ); + } + if (isset($intRet3) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataInsertRelation( + 'tbl_lnkServiceToContact', + $chkDataId, + $chkMselValue4 + ); + } + if (isset($intRet4) && ($intRet4 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue5 != 0) { + $intRet5 = $myDataClass->dataInsertRelation( + 'tbl_lnkServiceToContactgroup', + $chkDataId, + $chkMselValue5 + ); + } + if (isset($intRet5) && ($intRet5 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue6 != 0) { + $intRet6 = $myDataClass->dataInsertRelation( + 'tbl_lnkServiceToService', + $chkDataId, + $chkMselValue6 + ); + } + if (isset($intRet6) && ($intRet6 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation('tbl_lnkServiceToHost', $chkDataId, $chkMselValue1); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkServiceToHost', $chkDataId); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServiceToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkServiceToHostgroup', $chkDataId); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServiceToServicegroup', + $chkDataId, + $chkMselValue3 + ); + } else { + $intRet3 = $myDataClass->dataDeleteRelation('tbl_lnkServiceToServicegroup', $chkDataId); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServiceToContact', + $chkDataId, + $chkMselValue4 + ); + } else { + $intRet4 = $myDataClass->dataDeleteRelation('tbl_lnkServiceToContact', $chkDataId); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue5 != 0) { + $intRet5 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServiceToContactgroup', + $chkDataId, + $chkMselValue5 + ); + } else { + $intRet5 = $myDataClass->dataDeleteRelation('tbl_lnkServiceToContactgroup', $chkDataId); + } + if (isset($intRet5) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue6 != 0) { + $intRet6 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServiceToService', + $chkDataId, + $chkMselValue6 + ); + } else { + $intRet6 = $myDataClass->dataDeleteRelation('tbl_lnkServiceToService', $chkDataId); + } + if ($intRet6 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2 + $intRet3 + $intRet4 + $intRet5 + $intRet6) != 0) { + $strInfoMessage = ''; + } + // + // Removing the config file if an entry was deleted or renamed + // =========================================================== + if (($chkModus == 'modify') && ($chkTfValue2 != $chkTfValue1) && ($chkDomainId != 0)) { + $intServiceCount = $myDBClass->countRows("SELECT * FROM `$preTableName` " + . "WHERE BINARY `$preKeyField`='$chkTfValue2' AND `config_id`=$chkDomainId " + . "AND `active`='1'"); + if ($intServiceCount == 0) { + $myConfigClass->getConfigTargets($arrConfigID); + if (($arrConfigID != 1) && is_array($arrConfigID)) { + $intReturn = 0; + foreach ($arrConfigID as $intConfigID) { + $intReturn += $myConfigClass->moveFile('service', $chkTfValue2. '.cfg', $intConfigID); + } + if ($intReturn == 0) { + $myVisClass->processMessage(translate('The assigned, no longer used configuration ' + . 'files were deleted successfully!'), $strInfoMessage); + $myDataClass->writeLog(translate('Service file deleted:'). ' ' .$chkTfValue2. '.cfg'); + } else { + if ($chkDomainId == 0) { + $myVisClass->processMessage(translate('Common files cannot be removed from target ' + . 'systems - please check manually'), $strErrorMessage); + } else { + $myVisClass->processMessage(translate('Errors while deleting the old configuration ' + . 'file - please check!:'), $strErrorMessage); + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + } + } + } + } + // + // Removing the config file if an entry was dectivated + // =================================================== + if (($chkModus == 'modify') && ($chkActive == 0)) { + $intServiceCount = $myDBClass->countRows("SELECT * FROM `$preTableName` " + . "WHERE `$preKeyField`='$chkTfValue2' AND `config_id`=$chkDomainId AND `active`='1'"); + if ($intServiceCount == 0) { + $myConfigClass->getConfigTargets($arrConfigID); + if (($arrConfigID != 1) && is_array($arrConfigID)) { + $intReturn = 0; + foreach ($arrConfigID as $intConfigID) { + $intReturn += $myConfigClass->moveFile('service', $chkTfValue2. '.cfg', $intConfigID); + } + if ($intReturn == 0) { + $myVisClass->processMessage(translate('The assigned, no longer used configuration ' + . 'files were deleted successfully!'), $strInfoMessage); + $myDataClass->writeLog(translate('Service file deleted:'). ' ' .$chkTfValue2. '.cfg'); + } else { + $myVisClass->processMessage(translate('Errors while deleting the old configuration ' + . 'file - please check!:'), $strErrorMessage); + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + } + } + } + // + // Insert/update session data for templates + // ======================================== + if ($chkModus == 'modify') { + $strSQL = 'DELETE FROM `tbl_lnkServiceToServicetemplate` WHERE `idMaster`=' .$chkDataId; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && + (count($_SESSION['templatedefinition']) != 0)) { + $intSortId = 1; + /** @noinspection ForeachSourceInspection */ + foreach ($_SESSION['templatedefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL = 'INSERT INTO `tbl_lnkServiceToServicetemplate` (`idMaster`,`idSlave`, ' + . "`idTable`,`idSort`) VALUES ($chkDataId,".$elem['idSlave']. ', ' + . $elem['idTable']. ',' .$intSortId. ')'; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + $intSortId++; + } + } + // + // Insert/update session data for free variables + // ============================================= + if ($chkModus == 'modify') { + $strSQL = 'SELECT * FROM `tbl_lnkServiceToVariabledefinition` WHERE `idMaster`=' .$chkDataId; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCount != 0) { + foreach ($arrData as $elem) { + $strSQL = 'DELETE FROM `tbl_variabledefinition` WHERE `id`=' .$elem['idSlave']; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + $strSQL1 = 'DELETE FROM `tbl_lnkServiceToVariabledefinition` WHERE `idMaster`=' .$chkDataId; + $intReturn1 = $myDataClass->dataInsert($strSQL1, $intInsertId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + $strSQL2 = 'UPDATE `tbl_service` SET `use_variables`=0 WHERE `id`=' .$chkDataId; + $intReturn2 = $myDataClass->dataInsert($strSQL2, $intInsertId); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && + (count($_SESSION['variabledefinition']) != 0)) { + $intCountVariable = 0; + /** @noinspection ForeachSourceInspection */ + foreach ($_SESSION['variabledefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL = 'INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) ' + . "VALUES ('".$elem['definition']."','".$elem['range']."',now())"; + $intReturn1 = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + $strSQL = 'INSERT INTO `tbl_lnkServiceToVariabledefinition` (`idMaster`,`idSlave`) ' + . "VALUES ($chkDataId,$intInsertId)"; + $intReturn2 = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn1 == 0) && ($intReturn2 == 0)) { + $intCountVariable++; + } + } + } + if ($intCountVariable != 0) { + $strSQL = 'UPDATE `tbl_service` SET `use_variables`=1 WHERE `id`=' .$chkDataId; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + // + // Update Import HASH + // ================== + $intReturn = $myDataClass->updateHash($preTableName, $chkDataId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define services (services.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process template fields - $strWhere = ""; - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - $strWhere = "AND `id` <> ".$arrModifyData['id']; - } - $strSQL = "SELECT `id`,`template_name`, `active` FROM `tbl_servicetemplate` WHERE $strDomainWhere2 ORDER BY `template_name`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataTpl,$intDataCountTpl); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDataCountTpl != 0) { - foreach ($arrDataTpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem['template_name'],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::1"); - $conttp->parse("template"); - } - } - $strSQL = "SELECT `id`, `name`, `active` FROM `$preTableName` WHERE `name` <> '' $strWhere AND $strDomainWhere ORDER BY `name`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataHpl,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($arrDataHpl != 0) { - foreach ($arrDataHpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem['name'],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::2"); - $conttp->parse("template"); - } - } - // Process host selection field - if (isset($arrModifyData['host_name'])) {$intFieldId = $arrModifyData['host_name'];} else {$intFieldId = 0;} - $intReturn1 = $myVisClass->parseSelectMulti('tbl_host','host_name','hosts','tbl_lnkServiceToHost',2,$intFieldId); - if ($intReturn1 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['hostgroup_name'])) {$intFieldId = $arrModifyData['hostgroup_name'];} else {$intFieldId = 0;} - $intReturn2 = $myVisClass->parseSelectMulti('tbl_hostgroup','hostgroup_name','hostgroup','tbl_lnkServiceToHostgroup',2,$intFieldId); - if ($intReturn2 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (($intReturn1 != 0) && ($intReturn2 != 0)) { - $myVisClass->processMessage(translate('Attention, no hosts or hostgroups defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process service groups selection field - if (isset($arrModifyData['servicegroups'])) {$intFieldId = $arrModifyData['servicegroups'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_servicegroup','servicegroup_name','servicegroup','tbl_lnkServiceToServicegroup',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process check command selection field - if (isset($arrModifyData['check_command']) && ($arrModifyData['check_command'] != "")) { - $arrCommand = explode("!",$arrModifyData['check_command']); - $intFieldId = $arrCommand[0]; - } else { - $intFieldId = 0; - } - $intReturn = $myVisClass->parseSelectSimple('tbl_command','command_name','servicecommand',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if ($intReturn != 0) { - $myVisClass->processMessage(translate('Attention, no check commands defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process check period selection field - if (isset($arrModifyData['check_period'])) {$intFieldId = $arrModifyData['check_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','checkperiod',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['notification_period'])) {$intFieldId = $arrModifyData['notification_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','notifyperiod',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if ($intReturn != 0) { - $myVisClass->processMessage(translate('Attention, no time periods defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process event handler selection field - if (isset($arrModifyData['event_handler'])) {$intFieldId = $arrModifyData['event_handler'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_command','command_name','eventhandler',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process contact and contact group selection field - if (isset($arrModifyData['contacts'])) {$intFieldId = $arrModifyData['contacts'];} else {$intFieldId = 0;} - $intReturn1 = $myVisClass->parseSelectMulti('tbl_contact','contact_name','service_contacts','tbl_lnkServiceToContact',2,$intFieldId); - if ($intReturn1 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['contact_groups'])) {$intFieldId = $arrModifyData['contact_groups'];} else {$intFieldId = 0;} - $intReturn2 = $myVisClass->parseSelectMulti('tbl_contactgroup','contactgroup_name','service_contactgroups','tbl_lnkServiceToContactgroup',2,$intFieldId); - if ($intReturn2 != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (($intReturn != 0) && ($intReturn2 != 0)) { - $myVisClass->processMessage(translate('Attention, no contacts or contact groups defined!'),$strDBWarning); - $intDataWarning = 1; - } - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $strChbFields = "ACE,PCE,PAC,FRE,OBS,EVH,FLE,STI,NSI,PED,ISV,NOE,HOS,HOG,SEG,COT,COG,TPL"; - $myContentClass->addFormInit($conttp,$strChbFields); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo,$strChbFields); - $conttp->setVariable("DAT_ACE".$arrModifyData['active_checks_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_PCE".$arrModifyData['passive_checks_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_PAC".$arrModifyData['parallelize_check']."_CHECKED","checked"); - $conttp->setVariable("DAT_FRE".$arrModifyData['check_freshness']."_CHECKED","checked"); - $conttp->setVariable("DAT_OBS".$arrModifyData['obsess_over_service']."_CHECKED","checked"); - $conttp->setVariable("DAT_EVH".$arrModifyData['event_handler_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_FLE".$arrModifyData['flap_detection_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_STI".$arrModifyData['retain_status_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_NSI".$arrModifyData['retain_nonstatus_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_PED".$arrModifyData['process_perf_data']."_CHECKED","checked"); - $conttp->setVariable("DAT_ISV".$arrModifyData['is_volatile']."_CHECKED","checked"); - $conttp->setVariable("DAT_NOE".$arrModifyData['notifications_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_HOS".$arrModifyData['host_name_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_HOG".$arrModifyData['hostgroup_name_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_SEG".$arrModifyData['servicegroups_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_COT".$arrModifyData['contacts_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_COG".$arrModifyData['contact_groups_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_TPL".$arrModifyData['use_template_tploptions']."_CHECKED","checked"); - // Special processing for -1 values - write 'null' to integer fields - $strIntegerfelder = "max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,high_flap_threshold,"; - $strIntegerfelder .= "notification_interval,first_notification_delay"; - foreach(explode(",",$strIntegerfelder) AS $elem) { - if ($arrModifyData[$elem] == -1) { - $conttp->setVariable("DAT_".strtoupper($elem),"null"); - } - } - if ($arrModifyData['check_command'] != "") { - $arrArgument = explode("!",$arrModifyData['check_command']); - foreach ($arrArgument AS $key => $value) { - if ($key == 0) { - $conttp->setVariable("IFRAME_SRC",$_SESSION['SETS']['path']['base_url']."admin/commandline.php?cname=".$value); - } else { - $value = str_replace("::bang::","!",$value); - $value = str_replace("::back::","\\",$value); - $conttp->setVariable("DAT_ARG".$key,htmlentities($value,ENT_QUOTES,'UTF-8')); - } - } - } - // Process option fields - foreach(explode(",",$arrModifyData['initial_state']) AS $elem) { - $conttp->setVariable("DAT_IS".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['flap_detection_options']) AS $elem) { - $conttp->setVariable("DAT_FL".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['notification_options']) AS $elem) { - $conttp->setVariable("DAT_NO".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['stalking_options']) AS $elem) { - $conttp->setVariable("DAT_ST".strtoupper($elem)."_CHECKED","checked"); - } - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Define services (services.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process template fields + $strWhere = ''; + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + $strWhere = 'AND `id` <> ' .$arrModifyData['id']; + } + $strSQL1 = 'SELECT `id`,`template_name`, `active` FROM `tbl_servicetemplate` ' + . "WHERE $strDomainWhere2 ORDER BY `template_name`"; + $booReturn1 = $myDBClass->hasDataArray($strSQL1, $arrDataTpl, $intDataCountTpl); + if ($booReturn1 == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCountTpl != 0) { + /** @var array $arrDataTpl */ + foreach ($arrDataTpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem['template_name'], ENT_QUOTES, 'UTF-8'). + $strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::1'); + $conttp->parse('template'); + } + } + $strSQL2 = "SELECT `id`, `name`, `active` FROM `$preTableName` " + . "WHERE `name` <> '' $strWhere AND $strDomainWhere ORDER BY `name`"; + $booReturn2 = $myDBClass->hasDataArray($strSQL2, $arrDataHpl, $intDataCountHpl); + if ($booReturn2 == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCountHpl != 0) { + /** @var array $arrDataHpl */ + foreach ($arrDataHpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem['name'], ENT_QUOTES, 'UTF-8').$strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::2'); + $conttp->parse('template'); + } + } + // Process host selection field + if (isset($arrModifyData['host_name'])) { + $intFieldId = $arrModifyData['host_name']; + } else { + $intFieldId = 0; + } + $intReturn3 = $myVisClass->parseSelectMulti( + 'tbl_host', + 'host_name', + 'hosts', + 'tbl_lnkServiceToHost', + 2, + $intFieldId + ); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['hostgroup_name'])) { + $intFieldId = $arrModifyData['hostgroup_name']; + } else { + $intFieldId = 0; + } + $intReturn4 = $myVisClass->parseSelectMulti( + 'tbl_hostgroup', + 'hostgroup_name', + 'hostgroup', + 'tbl_lnkServiceToHostgroup', + 2, + $intFieldId + ); + if ($intReturn4 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn3 != 0) && ($intReturn4 != 0)) { + $myVisClass->processMessage(translate('Attention, no hosts or hostgroups defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process service selection field + if (isset($arrModifyData['parents'])) { + $intFieldId = $arrModifyData['parents']; + } else { + $intFieldId = 0; + } + if (isset($arrModifyData['id'])) { + $intKeyId = $arrModifyData['id']; + } else { + $intKeyId = 0; + } + $intReturn3 = $myVisClass->parseSelectMulti( + $preTableName, + $preKeyField, + 'service_parents', + 'tbl_lnkServiceToService', + 0, + $intFieldId, + $intKeyId + ); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process service groups selection field + if (isset($arrModifyData['servicegroups'])) { + $intFieldId = $arrModifyData['servicegroups']; + } else { + $intFieldId = 0; + } + $intReturn5 = $myVisClass->parseSelectMulti( + 'tbl_servicegroup', + 'servicegroup_name', + 'servicegroup', + 'tbl_lnkServiceToServicegroup', + 0, + $intFieldId + ); + if ($intReturn5 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process check command selection field + if (isset($arrModifyData['check_command']) && ($arrModifyData['check_command'] != '')) { + $arrCommand = explode('!', $arrModifyData['check_command']); + $intFieldId = $arrCommand[0]; + } else { + $intFieldId = 0; + } + $intReturn6 = $myVisClass->parseSelectSimple('tbl_command', 'command_name', 'servicecommand', 2, $intFieldId); + if ($intReturn6 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if ($intReturn6 != 0) { + $myVisClass->processMessage(translate('Attention, no check commands defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process check period selection field + if (isset($arrModifyData['check_period'])) { + $intFieldId = $arrModifyData['check_period']; + } else { + $intFieldId = 0; + } + $intReturn7 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'checkperiod', 1, $intFieldId); + if ($intReturn7 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['notification_period'])) { + $intFieldId = $arrModifyData['notification_period']; + } else { + $intFieldId = 0; + } + $intReturn8 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'notifyperiod', 1, $intFieldId); + if ($intReturn8 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if ($intReturn8 != 0) { + $myVisClass->processMessage(translate('Attention, no time periods defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process event handler selection field + if (isset($arrModifyData['event_handler'])) { + $intFieldId = $arrModifyData['event_handler']; + } else { + $intFieldId = 0; + } + $intReturn9 = $myVisClass->parseSelectSimple('tbl_command', 'command_name', 'eventhandler', 1, $intFieldId); + if ($intReturn9 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process contact and contact group selection field + if (isset($arrModifyData['contacts'])) { + $intFieldId = $arrModifyData['contacts']; + } else { + $intFieldId = 0; + } + $intReturn10 = $myVisClass->parseSelectMulti( + 'tbl_contact', + 'contact_name', + 'service_contacts', + 'tbl_lnkServiceToContact', + 2, + $intFieldId + ); + if ($intReturn10 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['contact_groups'])) { + $intFieldId = $arrModifyData['contact_groups']; + } else { + $intFieldId = 0; + } + $intReturn12 = $myVisClass->parseSelectMulti( + 'tbl_contactgroup', + 'contactgroup_name', + 'service_contactgroups', + 'tbl_lnkServiceToContactgroup', + 2, + $intFieldId + ); + if ($intReturn12 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (($intReturn9 != 0) && ($intReturn12 != 0)) { + $myVisClass->processMessage(translate('Attention, no contacts or contact groups defined!'), $strDBWarning); + $intDataWarning = 1; + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn13 = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn13 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $strChbFields = 'ACE,PCE,PAC,FRE,OBS,EVH,FLE,STI,NSI,PED,ISV,NOE,HOS,HOG,SEG,COT,COG,TPL'; + $myContentClass->addFormInit($conttp, $strChbFields); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo, $strChbFields); + $conttp->setVariable('DAT_ACE' .$arrModifyData['active_checks_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PCE' .$arrModifyData['passive_checks_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PAC' .$arrModifyData['parallelize_check']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_FRE' .$arrModifyData['check_freshness']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_OBS' .$arrModifyData['obsess_over_service']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_EVH' .$arrModifyData['event_handler_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_FLE' .$arrModifyData['flap_detection_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_STI' .$arrModifyData['retain_status_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_NSI' .$arrModifyData['retain_nonstatus_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PED' .$arrModifyData['process_perf_data']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_ISV' .$arrModifyData['is_volatile']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_NOE' .$arrModifyData['notifications_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_HOS' .$arrModifyData['host_name_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_HOG' .$arrModifyData['hostgroup_name_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_SEG' .$arrModifyData['servicegroups_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_COT' .$arrModifyData['contacts_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_COG' .$arrModifyData['contact_groups_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_TPL' .$arrModifyData['use_template_tploptions']. '_CHECKED', 'checked'); + // Special processing for -1 values - write 'null' to integer fields + $strIntegerfelder = 'max_check_attempts,check_interval,retry_interval,freshness_threshold,'; + $strIntegerfelder .= 'low_flap_threshold,high_flap_threshold,notification_interval,first_notification_delay'; + foreach (explode(',', $strIntegerfelder) as $elem) { + if ($arrModifyData[$elem] == -1) { + $conttp->setVariable('DAT_' .strtoupper($elem), 'null'); + } + } + if ($arrModifyData['check_command'] != '') { + $arrArgument = explode('!', $arrModifyData['check_command']); + foreach ($arrArgument as $key => $value) { + if ($key == 0) { + $conttp->setVariable('IFRAME_SRC', $_SESSION['SETS']['path']['base_url']. + 'admin/commandline.php?cname=' .$value); + } else { + $value1 = str_replace('::bang::', '!', $value); + $value2 = str_replace('::back::', "\\", $value1); + $conttp->setVariable('DAT_ARG' .$key, htmlentities($value2, ENT_QUOTES, 'UTF-8')); + } + } + } + // Process option fields + foreach (explode(',', $arrModifyData['initial_state']) as $elem) { + $conttp->setVariable('DAT_IS' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['flap_detection_options']) as $elem) { + $conttp->setVariable('DAT_FL' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['notification_options']) as $elem) { + $conttp->setVariable('DAT_NO' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['stalking_options']) as $elem) { + $conttp->setVariable('DAT_ST' .strtoupper($elem). '_CHECKED', 'checked'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Config name')); - $mastertp->setVariable("FIELD_2",translate('Service name')); - // Configuration name selection - $mastertp->setVariable("DAT_CONFIGNAME",translate('All configs')); - $mastertp->parse("configlist"); - $strSQL = "SELECT DISTINCT `$preKeyField` FROM `$preTableName` WHERE $strDomainWhere ORDER BY `$preKeyField`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataConfig,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else if ($intDataCount != 0) { - for ($i=0;$i<$intDataCount;$i++) { - $mastertp->setVariable("DAT_CONFIGNAME",$arrDataConfig[$i][$preKeyField]); - if ($_SESSION['search']['config_selection'] == $arrDataConfig[$i][$preKeyField]) { - $mastertp->setVariable("DAT_CONFIGNAME_SEL","selected"); - } - $mastertp->parse("configlist"); - } - } - // Process filter string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `service_description` LIKE '%".$strSearchTxt."%' OR - `display_name` LIKE '%".$strSearchTxt."%')"; - } - if ($_SESSION['search']['config_selection'] != "") { - $strSearchTxt2 = $_SESSION['search']['config_selection']; - if ($strSearchTxt2 != translate('All configs')) { - $strSearchWhere2 = " AND `$preKeyField` = '".$strSearchTxt2."' "; - } - } - // Row sorting - $strOrderString = "ORDER BY `config_id`,`$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `service_description` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere2 $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Datensätze holen - $strSQL = "SELECT `id`, `$preKeyField`, `service_description`, `register`, `active`, `last_modified`, `config_id`, `access_group` - FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere2 $strSearchWhere AND `access_group` IN ($strAccess) $strOrderString - LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'service_description',0); - if ($myContentClass->strErrorMessage != "") $myVisClass->processMessage($myContentClass->strErrorMessage,$strErrorMessage); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define services (services.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Config name')); + $mastertp->setVariable('FIELD_2', translate('Service name')); + // Configuration name selection + $mastertp->setVariable('DAT_CONFIGNAME', translate('All configs')); + $mastertp->parse('configlist'); + $strSQL1 = "SELECT DISTINCT `$preKeyField` FROM `$preTableName` WHERE $strDomainWhere ORDER BY `$preKeyField`"; + $booReturn1 = $myDBClass->hasDataArray($strSQL1, $arrDataConfig, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } elseif ($intDataCount != 0) { + for ($i = 0; $i < $intDataCount; $i++) { + $mastertp->setVariable('DAT_CONFIGNAME', $arrDataConfig[$i][$preKeyField]); + if ($_SESSION['search']['config_selection'] == $arrDataConfig[$i][$preKeyField]) { + $mastertp->setVariable('DAT_CONFIGNAME_SEL', 'selected'); + } + $mastertp->parse('configlist'); + } + } + // Process filter string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `service_description` " + . "LIKE '%".$strSearchTxt."%' OR `display_name` LIKE '%".$strSearchTxt."%')"; + } + if ($_SESSION['search']['config_selection'] != '') { + $strSearchTxt2 = $_SESSION['search']['config_selection']; + if ($strSearchTxt2 != translate('All configs')) { + $strSearchWhere2 = " AND `$preKeyField` = '".$strSearchTxt2."' "; + } + } + // Row sorting + $strOrderString = "ORDER BY `config_id`,`$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `service_description` $hidSortDir"; + } + // Count datasets + $strSQL2 = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere2 " + . "$strSearchWhere AND `access_group` IN ($strAccess)"; + $booReturn2 = $myDBClass->hasSingleDataset($strSQL2, $arrDataLinesCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Datensätze holen + $strSQL3 = "SELECT `id`, `$preKeyField`, `service_description`, `register`, `active`, `last_modified`, " + . "`config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere2 " + . "$strSearchWhere AND `access_group` IN ($strAccess) $strOrderString " + . "LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn3 = $myDBClass->hasDataArray($strSQL3, $arrDataLines, $intDataCount); + if ($booReturn3 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData( + $mastertp, + $arrDataLines, + $intDataCount, + $intLineCount, + $preKeyField, + 'service_description', + 0 + ); + if ($myContentClass->strErrorMessage != '') { + $myVisClass->processMessage($myContentClass->strErrorMessage, $strErrorMessage); + } } // Show messages -$arrTimeData = array(); -$strTimeInfoString = ""; -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$arrTimeData = array(); +$strTimeInfoString = ''; +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/servicetemplates.php b/admin/servicetemplates.php index 0df5e81..bf38cfa 100644 --- a/admin/servicetemplates.php +++ b/admin/servicetemplates.php @@ -5,392 +5,679 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Service template definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 13; -$preContent = "admin/servicetemplates.tpl.htm"; -$preSearchSession = 'servicetemplate'; -$preTableName = 'tbl_servicetemplate'; -$preKeyField = 'template_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 13; +$preContent = 'admin/servicetemplates.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'servicetemplate'; +$preTableName = 'tbl_servicetemplate'; +$preKeyField = 'template_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Data processing // =============== -$strNO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e.$chkChbGr1f,0,-1); -$strIS = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d,0,-1); -$strFL = substr($chkChbGr3a.$chkChbGr3b.$chkChbGr3c.$chkChbGr3d,0,-1); -$strST = substr($chkChbGr4a.$chkChbGr4b.$chkChbGr4c.$chkChbGr4d,0,-1); -if ($chkSelValue1 != "") { - for ($i=1;$i<=8;$i++) { - if (${"chkTfArg$i"} != "") $chkSelValue1 .= "!".${"chkTfArg$i"}; - } +$strNO = substr($chkChbGr1a.$chkChbGr1b.$chkChbGr1c.$chkChbGr1d.$chkChbGr1e.$chkChbGr1f, 0, -1); +$strIS = substr($chkChbGr2a.$chkChbGr2b.$chkChbGr2c.$chkChbGr2d, 0, -1); +$strFL = substr($chkChbGr3a.$chkChbGr3b.$chkChbGr3c.$chkChbGr3d, 0, -1); +$strST = substr($chkChbGr4a.$chkChbGr4b.$chkChbGr4c.$chkChbGr4d, 0, -1); +if ($chkSelValue1 != '') { + for ($i = 1; $i <= 8; $i++) { + $tmpVar = 'chkTfArg'.$i; + if ($$tmpVar != '') { + $chkSelValue1 .= '!' .$$tmpVar; + } + } } -// +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `host_name`=$intMselValue1, `host_name_tploptions`=$chkRadValue1, `hostgroup_name`=$intMselValue2, - `hostgroup_name_tploptions`=$chkRadValue2, `service_description`='$chkTfValue2', `display_name`='$chkTfValue3', `servicegroups`=$intMselValue3, - `servicegroups_tploptions`=$chkRadValue3, `check_command`='$chkSelValue1', `use_template`=$intTemplates, `is_volatile`=$chkRadValue16, `initial_state`='$strIS', - `max_check_attempts`=$chkTfNullVal2, `check_interval`=$chkTfNullVal3, `retry_interval`=$chkTfNullVal1, `active_checks_enabled`=$chkRadValue6, - `passive_checks_enabled`=$chkRadValue7, `check_period`=$chkSelValue2, `parallelize_check`=$chkRadValue8, `obsess_over_service`=$chkRadValue10, - `check_freshness`=$chkRadValue9, `freshness_threshold`=$chkTfNullVal4, `event_handler`=$chkSelValue3, `event_handler_enabled`=$chkRadValue11, - `low_flap_threshold`=$chkTfNullVal5, `high_flap_threshold`=$chkTfNullVal6, `flap_detection_enabled`=$chkRadValue12, `flap_detection_options`='$strFL', - `process_perf_data`=$chkRadValue15, `retain_status_information`=$chkRadValue13, `retain_nonstatus_information`=$chkRadValue14, `contacts`=$intMselValue4, - `contacts_tploptions`=$chkRadValue4, `contact_groups`=$intMselValue5, `contact_groups_tploptions`=$chkRadValue5, `notification_interval`=$chkTfNullVal7, - `notification_period`=$chkSelValue4, `first_notification_delay`=$chkTfNullVal8, `notification_options`='$strNO', `notifications_enabled`=$chkRadValue17, - `stalking_options`='$strST', `notes`='$chkTfValue4', `notes_url`='$chkTfValue5', `action_url`='$chkTfValue6', `icon_image`='$chkTfValue7', - `icon_image_alt`='$chkTfValue8', `use_variables`=$intVariables, $preSQLCommon2"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if ($chkTfValue1 != "") { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New service template inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Service template modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkServicetemplateToHost",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkServicetemplateToHostgroup",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) $intRet3 = $myDataClass->dataInsertRelation("tbl_lnkServicetemplateToServicegroup",$chkDataId,$chkMselValue3); - if (isset($intRet3) && ($intRet3 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) $intRet4 = $myDataClass->dataInsertRelation("tbl_lnkServicetemplateToContact",$chkDataId,$chkMselValue4); - if (isset($intRet4) && ($intRet4 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue5 != 0) $intRet5 = $myDataClass->dataInsertRelation("tbl_lnkServicetemplateToContactgroup",$chkDataId,$chkMselValue5); - if (isset($intRet5) && ($intRet5 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkServicetemplateToHost",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkServicetemplateToHost",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkServicetemplateToHostgroup",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkServicetemplateToHostgroup",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue3 != 0) { - $intRet3 = $myDataClass->dataUpdateRelation("tbl_lnkServicetemplateToServicegroup",$chkDataId,$chkMselValue3); - } else { - $intRet3 = $myDataClass->dataDeleteRelation("tbl_lnkServicetemplateToServicegroup",$chkDataId); - } - if ($intRet3 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue4 != 0) { - $intRet4 = $myDataClass->dataUpdateRelation("tbl_lnkServicetemplateToContact",$chkDataId,$chkMselValue4); - } else { - $intRet4 = $myDataClass->dataDeleteRelation("tbl_lnkServicetemplateToContact",$chkDataId); - } - if ($intRet4 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue5 != 0) { - $intRet5 = $myDataClass->dataUpdateRelation("tbl_lnkServicetemplateToContactgroup",$chkDataId,$chkMselValue5); - } else { - $intRet5 = $myDataClass->dataDeleteRelation("tbl_lnkServicetemplateToContactgroup",$chkDataId); - } - if ($intRet5 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2 + $intRet3 + $intRet4 + $intRet5) != 0) $strInfoMessage = ""; - // - // Insert/update session data for templates - // ======================================== - if ($chkModus == "modify") { - $strSQL = "DELETE FROM `tbl_lnkServicetemplateToServicetemplate` WHERE `idMaster`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && (count($_SESSION['templatedefinition']) != 0)) { - $intSortId = 1; - foreach($_SESSION['templatedefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_lnkServicetemplateToServicetemplate` (`idMaster`,`idSlave`,`idTable`,`idSort`) - VALUES ($chkDataId,".$elem['idSlave'].",".$elem['idTable'].",".$intSortId.")"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - $intSortId++; - } - } - // - // Insert/update session data for free variables - // ============================================= - if ($chkModus == "modify") { - $strSQL = "SELECT * FROM `tbl_lnkServicetemplateToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDataCount != 0) { - foreach ($arrData AS $elem) { - $strSQL = "DELETE FROM `tbl_variabledefinition` WHERE `id`=".$elem['idSlave']; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - $strSQL = "DELETE FROM `tbl_lnkServicetemplateToVariabledefinition` WHERE `idMaster`=$chkDataId"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && (count($_SESSION['variabledefinition']) != 0)) { - foreach($_SESSION['variabledefinition'] AS $elem) { - if ($elem['status'] == 0) { - $strSQL = "INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) - VALUES ('".$elem['definition']."','".$elem['range']."',now())"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - $strSQL = "INSERT INTO `tbl_lnkServicetemplateToVariabledefinition` (`idMaster`,`idSlave`) - VALUES ($chkDataId,$intInsertId)"; - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - } - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `host_name`=$intMselValue1, " + . "`host_name_tploptions`=$chkRadValue1, `hostgroup_name`=$intMselValue2, " + . "`hostgroup_name_tploptions`=$chkRadValue2, `service_description`='$chkTfValue2', " + . "`display_name`='$chkTfValue3', `parents`=$intMselValue6, `parents_tploptions`=$chkRadValue18, " + . "`importance`=$chkTfNullVal9, `servicegroups`=$intMselValue3, " + . "`servicegroups_tploptions`=$chkRadValue3, `check_command`='$chkSelValue1', " + . "`use_template`=$intTemplates, `is_volatile`=$chkRadValue16, `initial_state`='$strIS', " + . "`max_check_attempts`=$chkTfNullVal2, `check_interval`=$chkTfNullVal3, `retry_interval`=$chkTfNullVal1, " + . "`active_checks_enabled`=$chkRadValue6, `passive_checks_enabled`=$chkRadValue7, " + . "`check_period`=$chkSelValue2, `parallelize_check`=$chkRadValue8, `obsess_over_service`=$chkRadValue10, " + . "`check_freshness`=$chkRadValue9, `freshness_threshold`=$chkTfNullVal4, `event_handler`=$chkSelValue3, " + . "`event_handler_enabled`=$chkRadValue11, `low_flap_threshold`=$chkTfNullVal5, " + . "`high_flap_threshold`=$chkTfNullVal6, `flap_detection_enabled`=$chkRadValue12, " + . "`flap_detection_options`='$strFL', `process_perf_data`=$chkRadValue15, " + . "`retain_status_information`=$chkRadValue13, `retain_nonstatus_information`=$chkRadValue14, " + . "`contacts`=$intMselValue4, `contacts_tploptions`=$chkRadValue4, `contact_groups`=$intMselValue5, " + . "`contact_groups_tploptions`=$chkRadValue5, `notification_interval`=$chkTfNullVal7, " + . "`notification_period`=$chkSelValue4, `first_notification_delay`=$chkTfNullVal8, " + . "`notification_options`='$strNO', `notifications_enabled`=$chkRadValue17, `stalking_options`='$strST', " + . "`notes`='$chkTfValue4', `notes_url`='$chkTfValue5', `action_url`='$chkTfValue6', " + . "`icon_image`='$chkTfValue7', `icon_image_alt`='$chkTfValue8', `use_variables`=$intVariables, " + . $preSQLCommon2; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if ($chkTfValue1 != '') { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New service template inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Service template modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicetemplateToHost', + $chkDataId, + $chkMselValue1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicetemplateToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicetemplateToServicegroup', + $chkDataId, + $chkMselValue3 + ); + } + if (isset($intRet3) && ($intRet3 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicetemplateToContact', + $chkDataId, + $chkMselValue4 + ); + } + if (isset($intRet4) && ($intRet4 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue5 != 0) { + $intRet5 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicetemplateToContactgroup', + $chkDataId, + $chkMselValue5 + ); + } + if (isset($intRet5) && ($intRet5 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue6 != 0) { + $intRet6 = $myDataClass->dataInsertRelation( + 'tbl_lnkServicetemplateToService', + $chkDataId, + $chkMselValue6 + ); + } + if (isset($intRet6) && ($intRet6 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicetemplateToHost', + $chkDataId, + $chkMselValue1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkServicetemplateToHost', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicetemplateToHostgroup', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkServicetemplateToHostgroup', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue3 != 0) { + $intRet3 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicetemplateToServicegroup', + $chkDataId, + $chkMselValue3 + ); + } else { + $intRet3 = $myDataClass->dataDeleteRelation('tbl_lnkServicetemplateToServicegroup', $chkDataId); + } + if ($intRet3 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue4 != 0) { + $intRet4 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicetemplateToContact', + $chkDataId, + $chkMselValue4 + ); + } else { + $intRet4 = $myDataClass->dataDeleteRelation('tbl_lnkServicetemplateToContact', $chkDataId); + } + if ($intRet4 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue5 != 0) { + $intRet5 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicetemplateToContactgroup', + $chkDataId, + $chkMselValue5 + ); + } else { + $intRet5 = $myDataClass->dataDeleteRelation('tbl_lnkServicetemplateToContactgroup', $chkDataId); + } + if ($intRet5 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue6 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkServicetemplateToService', + $chkDataId, + $chkMselValue6 + ); + } else { + $intRet6 = $myDataClass->dataDeleteRelation('tbl_lnkServicetemplateToService', $chkDataId); + } + if ($intRet6 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2 + $intRet3 + $intRet4 + $intRet5 + $intRet6) != 0) { + $strInfoMessage = ''; + } + // + // Insert/update session data for templates + // ======================================== + if ($chkModus == 'modify') { + $strSQL = 'DELETE FROM `tbl_lnkServicetemplateToServicetemplate` WHERE `idMaster`=' .$chkDataId; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && + (count($_SESSION['templatedefinition']) != 0)) { + $intSortId = 1; + /** @noinspection ForeachSourceInspection */ + foreach ($_SESSION['templatedefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL = 'INSERT INTO `tbl_lnkServicetemplateToServicetemplate` (`idMaster`,`idSlave`,' + . "`idTable`,`idSort`) VALUES ($chkDataId,".$elem['idSlave']. ', ' + . $elem['idTable']. ',' .$intSortId. ')'; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + $intSortId++; + } + } + // + // Insert/update session data for free variables + // ============================================= + if ($chkModus == 'modify') { + $strSQL = 'SELECT * FROM `tbl_lnkServicetemplateToVariabledefinition` ' + . 'WHERE `idMaster`=' .$chkDataId; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCount != 0) { + foreach ($arrData as $elem) { + $strSQL = 'DELETE FROM `tbl_variabledefinition` WHERE `id`=' .$elem['idSlave']; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + $strSQL = 'DELETE FROM `tbl_lnkServicetemplateToVariabledefinition` ' + . 'WHERE `idMaster`=' .$chkDataId; + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && + (count($_SESSION['variabledefinition']) != 0)) { + foreach ($_SESSION['variabledefinition'] as $elem) { + if ($elem['status'] == 0) { + $strSQL1 = 'INSERT INTO `tbl_variabledefinition` (`name`,`value`,`last_modified`) ' + . "VALUES ('".$elem['definition']."','".$elem['range']."',now())"; + $intReturn1 = $myDataClass->dataInsert($strSQL1, $intInsertId); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + $strSQL2 = 'INSERT INTO `tbl_lnkServicetemplateToVariabledefinition` (`idMaster`, ' + . "`idSlave`) VALUES ($chkDataId,$intInsertId)"; + $intReturn2 = $myDataClass->dataInsert($strSQL2, $intInsertId); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Define service templates (servicetemplates.cfg)')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process template fields - $strWhere = ""; - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - $strWhere = "AND `id` <> ".$arrModifyData['id']; - } - $strSQL = "SELECT `id`, `$preKeyField`, `active` FROM `$preTableName` WHERE $strDomainWhere $strWhere ORDER BY `$preKeyField`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataTpl,$intDataCountTpl); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($intDataCountTpl != 0) { - foreach ($arrDataTpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem[$preKeyField],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::1"); - $conttp->parse("template"); - } - } - $strSQL = "SELECT `id`, `name`, `active` FROM `tbl_service` WHERE `name` <> '' AND $strDomainWhere2 ORDER BY `name`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataHpl,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($arrDataHpl != 0) { - foreach ($arrDataHpl AS $elem) { - if ($elem['active'] == 0) { - $strActive = " [inactive]"; - $conttp->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - $conttp->setVariable("SPECIAL_STYLE",""); - } - $conttp->setVariable("DAT_TEMPLATE",htmlspecialchars($elem['name'],ENT_QUOTES,'UTF-8').$strActive); - $conttp->setVariable("DAT_TEMPLATE_ID",$elem['id']."::2"); - $conttp->parse("template"); - } - } - // Process host selection field - if (isset($arrModifyData['host_name'])) {$intFieldId = $arrModifyData['host_name'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_host','host_name','hosts','tbl_lnkServicetemplateToHost',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['hostgroup_name'])) {$intFieldId = $arrModifyData['hostgroup_name'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_hostgroup','hostgroup_name','hostgroup','tbl_lnkServicetemplateToHostgroup',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process service groups selection field - if (isset($arrModifyData['servicegroups'])) {$intFieldId = $arrModifyData['servicegroups'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_servicegroup','servicegroup_name','servicegroup','tbl_lnkServicetemplateToServicegroup',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process check command selection field - if (isset($arrModifyData['check_command']) && ($arrModifyData['check_command'] != "")) { - $arrCommand = explode("!",$arrModifyData['check_command']); - $intFieldId = $arrCommand[0]; - } else { - $intFieldId = 0; - } - $intReturn = $myVisClass->parseSelectSimple('tbl_command','command_name','servicecommand',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process check period selection field - if (isset($arrModifyData['check_period'])) {$intFieldId = $arrModifyData['check_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','checkperiod',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['notification_period'])) {$intFieldId = $arrModifyData['notification_period'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod','timeperiod_name','notifyperiod',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process event handler selection field - if (isset($arrModifyData['event_handler'])) {$intFieldId = $arrModifyData['event_handler'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_command','command_name','eventhandler',1,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process contact and contact group selection field - if (isset($arrModifyData['contacts'])) {$intFieldId = $arrModifyData['contacts'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_contact','contact_name','service_contacts','tbl_lnkServicetemplateToContact',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - if (isset($arrModifyData['contact_groups'])) {$intFieldId = $arrModifyData['contact_groups'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti('tbl_contactgroup','contactgroup_name','service_contactgroups','tbl_lnkServicetemplateToContactgroup',2,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process access group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $strChbFields = "ACE,PCE,PAC,FRE,OBS,EVH,FLE,STI,NSI,PED,ISV,NOE,HOS,HOG,SEG,COT,COG,TPL"; - $myContentClass->addFormInit($conttp,$strChbFields); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo,$strChbFields); - $conttp->setVariable("DAT_ACE".$arrModifyData['active_checks_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_PCE".$arrModifyData['passive_checks_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_PAC".$arrModifyData['parallelize_check']."_CHECKED","checked"); - $conttp->setVariable("DAT_FRE".$arrModifyData['check_freshness']."_CHECKED","checked"); - $conttp->setVariable("DAT_OBS".$arrModifyData['obsess_over_service']."_CHECKED","checked"); - $conttp->setVariable("DAT_EVH".$arrModifyData['event_handler_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_FLE".$arrModifyData['flap_detection_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_STI".$arrModifyData['retain_status_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_NSI".$arrModifyData['retain_nonstatus_information']."_CHECKED","checked"); - $conttp->setVariable("DAT_PED".$arrModifyData['process_perf_data']."_CHECKED","checked"); - $conttp->setVariable("DAT_ISV".$arrModifyData['is_volatile']."_CHECKED","checked"); - $conttp->setVariable("DAT_NOE".$arrModifyData['notifications_enabled']."_CHECKED","checked"); - $conttp->setVariable("DAT_HOS".$arrModifyData['host_name_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_HOG".$arrModifyData['hostgroup_name_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_SEG".$arrModifyData['servicegroups_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_COT".$arrModifyData['contacts_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_COG".$arrModifyData['contact_groups_tploptions']."_CHECKED","checked"); - $conttp->setVariable("DAT_TPL".$arrModifyData['use_template_tploptions']."_CHECKED","checked"); - // Special processing for -1 values - write 'null' to integer fields - $strIntegerfelder = "max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,high_flap_threshold,"; - $strIntegerfelder .= "notification_interval,first_notification_delay"; - foreach(explode(",",$strIntegerfelder) AS $elem) { - if ($arrModifyData[$elem] == -1) { - $conttp->setVariable("DAT_".strtoupper($elem),"null"); - } - } - if ($arrModifyData['check_command'] != "") { - $arrArgument = explode("!",$arrModifyData['check_command']); - foreach ($arrArgument AS $key => $value) { - if ($key == 0) { - $conttp->setVariable("IFRAME_SRC",$_SESSION['SETS']['path']['base_url']."admin/commandline.php?cname=".$value); - } else { - $conttp->setVariable("DAT_ARG".$key,htmlentities($value,ENT_QUOTES,'UTF-8')); - } - } - } - // Process option fields - foreach(explode(",",$arrModifyData['initial_state']) AS $elem) { - $conttp->setVariable("DAT_IS".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['flap_detection_options']) AS $elem) { - $conttp->setVariable("DAT_FL".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['notification_options']) AS $elem) { - $conttp->setVariable("DAT_NO".strtoupper($elem)."_CHECKED","checked"); - } - foreach(explode(",",$arrModifyData['stalking_options']) AS $elem) { - $conttp->setVariable("DAT_ST".strtoupper($elem)."_CHECKED","checked"); - } - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Define service templates (servicetemplates.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process template fields + $strWhere = ''; + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + $strWhere = 'AND `id` <> ' .$arrModifyData['id']; + } + $strSQL1 = "SELECT `id`, `$preKeyField`, `active` FROM `$preTableName` " + . "WHERE $strDomainWhere $strWhere ORDER BY `$preKeyField`"; + $booReturn1 = $myDBClass->hasDataArray($strSQL1, $arrDataTpl, $intDataCountTpl); + if ($booReturn1 == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCountTpl != 0) { + /** @var array $arrDataTpl */ + foreach ($arrDataTpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem[$preKeyField], ENT_QUOTES, 'UTF-8').$strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::1'); + $conttp->parse('template'); + } + } + $strSQL2 = 'SELECT `id`, `name`, `active` FROM `tbl_service` ' + . "WHERE `name` <> '' AND $strDomainWhere2 ORDER BY `name`"; + $booReturn2 = $myDBClass->hasDataArray($strSQL2, $arrDataHpl, $intDataCountHpl); + if ($booReturn2 == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($intDataCountHpl != 0) { + /** @var array $arrDataHpl */ + foreach ($arrDataHpl as $elem) { + if ($elem['active'] == 0) { + $strActive = ' [inactive]'; + $conttp->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + $conttp->setVariable('SPECIAL_STYLE', ''); + } + $conttp->setVariable('DAT_TEMPLATE', htmlspecialchars($elem['name'], ENT_QUOTES, 'UTF-8').$strActive); + $conttp->setVariable('DAT_TEMPLATE_ID', $elem['id']. '::2'); + $conttp->parse('template'); + } + } + // Process host selection field + if (isset($arrModifyData['host_name'])) { + $intFieldId = $arrModifyData['host_name']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectMulti( + 'tbl_host', + 'host_name', + 'hosts', + 'tbl_lnkServicetemplateToHost', + 2, + $intFieldId + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['hostgroup_name'])) { + $intFieldId = $arrModifyData['hostgroup_name']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectMulti( + 'tbl_hostgroup', + 'hostgroup_name', + 'hostgroup', + 'tbl_lnkServicetemplateToHostgroup', + 2, + $intFieldId + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process service selection field + if (isset($arrModifyData['parents'])) { + $intFieldId = $arrModifyData['parents']; + } else { + $intFieldId = 0; + } + if (isset($arrModifyData['id'])) { + $intKeyId = $arrModifyData['id']; + } else { + $intKeyId = 0; + } + $intReturn3 = $myVisClass->parseSelectMulti( + $preTableName, + $preKeyField, + 'service_parents', + 'tbl_lnkServicetemplateToService', + 0, + $intFieldId, + $intKeyId + ); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process service groups selection field + if (isset($arrModifyData['servicegroups'])) { + $intFieldId = $arrModifyData['servicegroups']; + } else { + $intFieldId = 0; + } + $intReturn3 = $myVisClass->parseSelectMulti( + 'tbl_servicegroup', + 'servicegroup_name', + 'servicegroup', + 'tbl_lnkServicetemplateToServicegroup', + 0, + $intFieldId + ); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process check command selection field + if (isset($arrModifyData['check_command']) && ($arrModifyData['check_command'] != '')) { + $arrCommand = explode('!', $arrModifyData['check_command']); + $intFieldId = $arrCommand[0]; + } else { + $intFieldId = 0; + } + $intReturn4 = $myVisClass->parseSelectSimple('tbl_command', 'command_name', 'servicecommand', 2, $intFieldId); + if ($intReturn4 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process check period selection field + if (isset($arrModifyData['check_period'])) { + $intFieldId = $arrModifyData['check_period']; + } else { + $intFieldId = 0; + } + $intReturn5 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'checkperiod', 1, $intFieldId); + if ($intReturn5 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['notification_period'])) { + $intFieldId = $arrModifyData['notification_period']; + } else { + $intFieldId = 0; + } + $intReturn6 = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'notifyperiod', 1, $intFieldId); + if ($intReturn6 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process event handler selection field + if (isset($arrModifyData['event_handler'])) { + $intFieldId = $arrModifyData['event_handler']; + } else { + $intFieldId = 0; + } + $intReturn7 = $myVisClass->parseSelectSimple('tbl_command', 'command_name', 'eventhandler', 1, $intFieldId); + if ($intReturn7 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process contact and contact group selection field + if (isset($arrModifyData['contacts'])) { + $intFieldId = $arrModifyData['contacts']; + } else { + $intFieldId = 0; + } + $intReturn8 = $myVisClass->parseSelectMulti( + 'tbl_contact', + 'contact_name', + 'service_contacts', + 'tbl_lnkServicetemplateToContact', + 2, + $intFieldId + ); + if ($intReturn8 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + if (isset($arrModifyData['contact_groups'])) { + $intFieldId = $arrModifyData['contact_groups']; + } else { + $intFieldId = 0; + } + $intReturn9 = $myVisClass->parseSelectMulti( + 'tbl_contactgroup', + 'contactgroup_name', + 'service_contactgroups', + 'tbl_lnkServicetemplateToContactgroup', + 2, + $intFieldId + ); + if ($intReturn9 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process access group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn10 = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn10 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $strChbFields = 'ACE,PCE,PAC,FRE,OBS,EVH,FLE,STI,NSI,PED,ISV,NOE,HOS,HOG,SEG,COT,COG,TPL'; + $myContentClass->addFormInit($conttp, $strChbFields); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo, $strChbFields); + $conttp->setVariable('DAT_ACE' .$arrModifyData['active_checks_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PCE' .$arrModifyData['passive_checks_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PAC' .$arrModifyData['parallelize_check']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_FRE' .$arrModifyData['check_freshness']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_OBS' .$arrModifyData['obsess_over_service']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_EVH' .$arrModifyData['event_handler_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_FLE' .$arrModifyData['flap_detection_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_STI' .$arrModifyData['retain_status_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_NSI' .$arrModifyData['retain_nonstatus_information']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_PED' .$arrModifyData['process_perf_data']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_ISV' .$arrModifyData['is_volatile']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_NOE' .$arrModifyData['notifications_enabled']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_HOS' .$arrModifyData['host_name_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_HOG' .$arrModifyData['hostgroup_name_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_SEG' .$arrModifyData['servicegroups_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_COT' .$arrModifyData['contacts_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_COG' .$arrModifyData['contact_groups_tploptions']. '_CHECKED', 'checked'); + $conttp->setVariable('DAT_TPL' .$arrModifyData['use_template_tploptions']. '_CHECKED', 'checked'); + // Special processing for -1 values - write 'null' to integer fields + $strIntegerfelder = 'max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,'; + $strIntegerfelder .= 'high_flap_threshold,notification_interval,first_notification_delay'; + foreach (explode(',', $strIntegerfelder) as $elem) { + if ($arrModifyData[$elem] == -1) { + $conttp->setVariable('DAT_' .strtoupper($elem), 'null'); + } + } + if ($arrModifyData['check_command'] != '') { + $arrArgument = explode('!', $arrModifyData['check_command']); + foreach ($arrArgument as $key => $value) { + if ($key == 0) { + $conttp->setVariable('IFRAME_SRC', $_SESSION['SETS']['path']['base_url']. + 'admin/commandline.php?cname=' .$value); + } else { + $conttp->setVariable('DAT_ARG' .$key, htmlentities($value, ENT_QUOTES, 'UTF-8')); + } + } + } + // Process option fields + foreach (explode(',', $arrModifyData['initial_state']) as $elem) { + $conttp->setVariable('DAT_IS' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['flap_detection_options']) as $elem) { + $conttp->setVariable('DAT_FL' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['notification_options']) as $elem) { + $conttp->setVariable('DAT_NO' .strtoupper($elem). '_CHECKED', 'checked'); + } + foreach (explode(',', $arrModifyData['stalking_options']) as $elem) { + $conttp->setVariable('DAT_ST' .strtoupper($elem). '_CHECKED', 'checked'); + } + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Template name')); - $mastertp->setVariable("FIELD_2",translate('Service description')); - // Process filter string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `service_description` LIKE '%".$strSearchTxt."%' OR - `display_name` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `service_description` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `service_description`, `register`, `active`, `last_modified`, `config_id`, `access_group` - FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess) - $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'service_description',0); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Define service templates (servicetemplates.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Template name')); + $mastertp->setVariable('FIELD_2', translate('Service description')); + // Process filter string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `service_description` " + . "LIKE '%".$strSearchTxt."%' OR `display_name` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `service_description` $hidSortDir"; + } + // Count datasets + $strSQL1 = "SELECT count(*) AS `number` FROM `$preTableName` " + . "WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL1, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL2 = "SELECT `id`, `$preKeyField`, `service_description`, `register`, `active`, `last_modified`, " + . "`config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere " + . "AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL2, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData( + $mastertp, + $arrDataLines, + $intDataCount, + $intLineCount, + $preKeyField, + 'service_description', + 0 + ); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/settings.php b/admin/settings.php index 28f23f9..2166921 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -5,257 +5,325 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Settings configuration -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 38; -$preContent = "admin/settings.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 38; +$preContent = 'admin/settings.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; +$arrSQL = array(); // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Process initial values // ====================== -if (!isset($_POST['tfValue1'])) $chkTfValue1 = $SETS['path']['tempdir']; -if (!isset($_POST['tfValue2'])) $chkTfValue2 = $SETS['data']['encoding']; -if (!isset($_POST['tfValue3'])) $chkTfValue3 = $SETS['db']['server']; -if (!isset($_POST['tfValue4'])) $chkTfValue4 = $SETS['db']['port']; -if (!isset($_POST['tfValue5'])) $chkTfValue5 = $SETS['db']['database']; -if (!isset($_POST['tfValue6'])) $chkTfValue6 = $SETS['db']['username']; -if (!isset($_POST['tfValue7'])) $chkTfValue7 = $SETS['db']['password']; -if (!isset($_POST['tfValue8'])) $chkTfValue8 = $SETS['security']['logofftime']; -if (!isset($_POST['tfValue9'])) $chkTfValue9 = $SETS['common']['pagelines']; -if (!isset($_POST['tfValue10'])) $chkTfValue10 = $SETS['network']['proxyserver']; -if (!isset($_POST['tfValue11'])) $chkTfValue11 = $SETS['network']['proxyuser']; -if (!isset($_POST['tfValue12'])) $chkTfValue12 = $SETS['network']['proxypasswd']; -if (!isset($_POST['selValue3'])) $chkSelValue3 = $SETS['security']['wsauth']; -if (!isset($_POST['selValue4'])) $chkSelValue4 = $SETS['common']['seldisable']; -if (!isset($_POST['radValue1'])) $chkRadValue1 = $SETS['common']['tplcheck']; -if (!isset($_POST['radValue2'])) $chkRadValue2 = $SETS['common']['updcheck']; -if (!isset($_POST['radValue3'])) $chkRadValue3 = $SETS['network']['proxy']; +if (filter_input(INPUT_POST, 'tfValue1') == null) { + $chkTfValue1 = $SETS['path']['tempdir']; +} +if (filter_input(INPUT_POST, 'tfValue2') == null) { + $chkTfValue2 = $SETS['data']['encoding']; +} +if (filter_input(INPUT_POST, 'tfValue3') == null) { + $chkTfValue3 = $SETS['db']['server']; +} +if (filter_input(INPUT_POST, 'tfValue4') == null) { + $chkTfValue4 = $SETS['db']['port']; +} +if (filter_input(INPUT_POST, 'tfValue5') == null) { + $chkTfValue5 = $SETS['db']['database']; +} +if (filter_input(INPUT_POST, 'tfValue6') == null) { + $chkTfValue6 = $SETS['db']['username']; +} +if (filter_input(INPUT_POST, 'tfValue7') == null) { + $chkTfValue7 = $SETS['db']['password']; +} +if (filter_input(INPUT_POST, 'tfValue8') == null) { + $chkTfValue8 = $SETS['security']['logofftime']; +} +if (filter_input(INPUT_POST, 'tfValue9') == null) { + $chkTfValue9 = $SETS['common']['pagelines']; +} +if (filter_input(INPUT_POST, 'tfValue10') == null) { + $chkTfValue10 = $SETS['network']['proxyserver']; +} +if (filter_input(INPUT_POST, 'tfValue11') == null) { + $chkTfValue11 = $SETS['network']['proxyuser']; +} +if (filter_input(INPUT_POST, 'tfValue12') == null) { + $chkTfValue12 = $SETS['network']['proxypasswd']; +} +if (filter_input(INPUT_POST, 'selValue3') == null) { + $chkSelValue3 = $SETS['security']['wsauth']; +} +if (filter_input(INPUT_POST, 'selValue4') == null) { + $chkSelValue4 = $SETS['common']['seldisable']; +} +if (filter_input(INPUT_POST, 'radValue1') == null) { + $chkRadValue1 = $SETS['common']['tplcheck']; +} +if (filter_input(INPUT_POST, 'radValue2') == null) { + $chkRadValue2 = $SETS['common']['updcheck']; +} +if (filter_input(INPUT_POST, 'radValue3') == null) { + $chkRadValue3 = $SETS['network']['proxy']; +} + // // Save changes // ============ -if (isset($_POST) && isset($_POST['selValue1'])) { - // - // Write settings to database - // ========================== - if ($chkSelValue1 == 2) {$strProtocol = "https";} else {$strProtocol = "http";} - $strLocale = $myDBClass->getFieldData("SELECT `locale` FROM `tbl_language` WHERE `id`='".$chkSelValue2."'"); - if ($strLocale == "") $strLocale = "en_GB"; - // Check Proxy via curl - if (!function_exists('curl_init')) { - $myVisClass->processMessage(translate('Curl module not loaded, Proxy will be deactivated!'),$strErrorMessage); - $chkRadValue3 = 0; - } - // Check base paths - $strBaseURL = str_replace("admin/settings.php","",$_SERVER["PHP_SELF"]); - $strBasePath = substr(realpath('.'),0,-5); - $arrSQL = ""; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$strProtocol."' WHERE `category` = 'path' AND `name`='protocol'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkTfValue1."' WHERE `category` = 'path' AND `name`='tempdir'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$strBaseURL."' WHERE `category` = 'path' AND `name`='base_url'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$strBasePath."' WHERE `category` = 'path' AND `name`='base_path'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$strLocale."' WHERE `category` = 'data' AND `name`='locale'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkTfValue2."' WHERE `category` = 'data' AND `name`='encoding'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkTfValue8."' WHERE `category` = 'security' AND `name`='logofftime'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkSelValue3."' WHERE `category` = 'security' AND `name`='wsauth'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkTfValue9."' WHERE `category` = 'common' AND `name`='pagelines'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkSelValue4."' WHERE `category` = 'common' AND `name`='seldisable'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkRadValue1."' WHERE `category` = 'common' AND `name`='tplcheck'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkRadValue2."' WHERE `category` = 'common' AND `name`='updcheck'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkRadValue3."' WHERE `category` = 'network' AND `name`='proxy'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkTfValue10."' WHERE `category` = 'network' AND `name`='proxyserver'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkTfValue11."' WHERE `category` = 'network' AND `name`='proxyuser'"; - $arrSQL[] = "UPDATE `tbl_settings` SET `value` = '".$chkTfValue12."' WHERE `category` = 'network' AND `name`='proxypasswd'"; - - foreach ($arrSQL AS $elem) { - $booReturn = $myDBClass->insertData($elem); - if ($booReturn == false) { - $myVisClass->processMessage(translate('An error occured while writing settings to database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - } - // Write db settings to file - if (is_writable($strBasePath."config/settings.php")) { - $filSettings = fopen($strBasePath."config/settings.php","w"); - if ($filSettings) { - fwrite($filSettings,"\n"); - fwrite($filSettings,";///////////////////////////////////////////////////////////////////////////////\n"); - fwrite($filSettings,";\n"); - fwrite($filSettings,"; NagiosQL\n"); - fwrite($filSettings,";\n"); - fwrite($filSettings,";///////////////////////////////////////////////////////////////////////////////\n"); - fwrite($filSettings,";\n"); - fwrite($filSettings,"; Project : NagiosQL\n"); - fwrite($filSettings,"; Component: Database Configuration\n"); - fwrite($filSettings,"; Website : http://www.nagiosql.org\n"); - fwrite($filSettings,"; Date : ".date("F j, Y, g:i a")."\n"); - fwrite($filSettings,"; Version : ".$setFileVersion."\n"); - fwrite($filSettings,";\n"); - fwrite($filSettings,";///////////////////////////////////////////////////////////////////////////////\n"); - fwrite($filSettings,"[db]\n"); - fwrite($filSettings,"server = ".$chkTfValue3."\n"); - fwrite($filSettings,"port = ".$chkTfValue4."\n"); - fwrite($filSettings,"database = ".$chkTfValue5."\n"); - fwrite($filSettings,"username = ".$chkTfValue6."\n"); - fwrite($filSettings,"password = ".$chkTfValue7."\n"); - fwrite($filSettings,"[path]\n"); - fwrite($filSettings,"base_url = ".$strBaseURL."\n"); - fwrite($filSettings,"base_path = ".$strBasePath."\n"); - fclose($filSettings); - // Activate new language settings - $arrLocale = explode(".",$strLocale); - $strDomain = $arrLocale[0]; - $loc = setlocale(LC_ALL, $strLocale, $strLocale.".utf-8", $strLocale.".utf-8", $strLocale.".utf8", "en_GB", "en_GB.utf-8", "en_GB.utf8"); - if (!isset($loc)) { - $myVisClass->processMessage(translate("Error in setting the correct locale, please report this error with the associated output of 'locale -a'"),$strErrorMessage); - } - putenv("LC_ALL=".$strLocale.".utf-8"); - putenv("LANG=".$strLocale.".utf-8"); - bindtextdomain($strLocale, $strBasePath."config/locale"); - bind_textdomain_codeset($strLocale, $chkTfValue2); - textdomain($strLocale); - $myVisClass->processMessage(translate("Settings were changed"),$strInfoMessage); - } else { - $myVisClass->processMessage(translate("An error occured while writing settings.php, please check permissions!"),$strErrorMessage); - } - } else { - $myVisClass->processMessage($strBasePath."config/settings.php ".translate("is not writeable, please check permissions!"),$strErrorMessage); - } +if (filter_input(INPUT_POST, 'selValue1')) { + // + // Write settings to database + // ========================== + if ($chkSelValue1 == 2) { + $strProtocol = 'https'; + } else { + $strProtocol = 'http'; + } + $strLocale = $myDBClass->getFieldData("SELECT `locale` FROM `tbl_language` WHERE `id`='".$chkSelValue2."'"); + if ($strLocale == '') { + $strLocale = 'en_GB'; + } + $SETS['path']['protocol'] = $strProtocol; + $SETS['data']['locale'] = $strLocale; + // Check Proxy via curl + if (!function_exists('curl_init')) { + $myVisClass->processMessage(translate('Curl module not loaded, Proxy will be deactivated!'), $strErrorMessage); + $chkRadValue3 = 0; + } + // Check base paths + $strSQLBase = "UPDATE `tbl_settings` SET `value`='%s' WHERE `category`='%s' AND `name`='%s'"; + $arrSQL[] = sprintf($strSQLBase, $strProtocol, 'path', 'protocol'); + $arrSQL[] = sprintf($strSQLBase, $chkTfValue1, 'path', 'tempdir'); + $arrSQL[] = sprintf($strSQLBase, $preRelPath, 'path', 'base_url'); + $arrSQL[] = sprintf($strSQLBase, $preBasePath, 'path', 'base_path'); + $arrSQL[] = sprintf($strSQLBase, $strLocale, 'data', 'locale'); + $arrSQL[] = sprintf($strSQLBase, $chkTfValue2, 'data', 'encoding'); + $arrSQL[] = sprintf($strSQLBase, $chkTfValue8, 'security', 'logofftime'); + $arrSQL[] = sprintf($strSQLBase, $chkSelValue3, 'security', 'wsauth'); + $arrSQL[] = sprintf($strSQLBase, $chkTfValue9, 'common', 'pagelines'); + $arrSQL[] = sprintf($strSQLBase, $chkSelValue4, 'common', 'seldisable'); + $arrSQL[] = sprintf($strSQLBase, $chkRadValue1, 'common', 'tplcheck'); + $arrSQL[] = sprintf($strSQLBase, $chkRadValue2, 'common', 'updcheck'); + $arrSQL[] = sprintf($strSQLBase, $chkRadValue3, 'network', 'proxy'); + $arrSQL[] = sprintf($strSQLBase, $chkTfValue10, 'network', 'proxyserver'); + $arrSQL[] = sprintf($strSQLBase, $chkTfValue11, 'network', 'proxyuser'); + $arrSQL[] = sprintf($strSQLBase, $chkTfValue12, 'network', 'proxypasswd'); + foreach ($arrSQL as $elem) { + $booReturn = $myDBClass->insertData($elem); + if ($booReturn == false) { + $myVisClass->processMessage( + translate('An error occured while writing settings to database:'), + $strErrorMessage + ); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + } + // Write db settings to file + if (is_writable($preBasePath. 'config/settings.php')) { + $filSettings = fopen($preBasePath. 'config/settings.php', 'wb'); + if ($filSettings) { + fwrite($filSettings, "\n"); + fwrite($filSettings, ";///////////////////////////////////////////////////////////////////////////////\n"); + fwrite($filSettings, ";\n"); + fwrite($filSettings, "; NagiosQL\n"); + fwrite($filSettings, ";\n"); + fwrite($filSettings, ";///////////////////////////////////////////////////////////////////////////////\n"); + fwrite($filSettings, ";\n"); + fwrite($filSettings, "; Project : NagiosQL\n"); + fwrite($filSettings, "; Component: Database Configuration\n"); + fwrite($filSettings, "; Website : https://sourceforge.net/projects/nagiosql/\n"); + fwrite($filSettings, '; Date : ' .date('F j, Y, g:i a')."\n"); + fwrite($filSettings, '; Version : ' .$setFileVersion."\n"); + fwrite($filSettings, ";\n"); + fwrite($filSettings, ";///////////////////////////////////////////////////////////////////////////////\n"); + fwrite($filSettings, "[db]\n"); + fwrite($filSettings, "type = mysqli\n"); + fwrite($filSettings, 'server = ' .$chkTfValue3."\n"); + fwrite($filSettings, 'port = ' .$chkTfValue4."\n"); + fwrite($filSettings, 'database = ' .$chkTfValue5."\n"); + fwrite($filSettings, 'username = ' .$chkTfValue6."\n"); + fwrite($filSettings, 'password = ' .$chkTfValue7."\n"); + fwrite($filSettings, "[path]\n"); + fwrite($filSettings, 'base_url = ' .$preRelPath."\n"); + fwrite($filSettings, 'base_path = ' .$preBasePath."\n"); + fclose($filSettings); + // Activate new language settings + $arrLocale = explode('.', $strLocale); + $strDomain = $arrLocale[0]; + $loc = setlocale( + LC_ALL, + $strLocale, + $strLocale. '.utf-8', + $strLocale. '.utf-8', + $strLocale. '.utf8', + 'en_GB', + 'en_GB.utf-8', + 'en_GB.utf8' + ); + if (!isset($loc)) { + $myVisClass->processMessage(translate('Error setting the correct locale. Please report this error ' + . "with the associated output of 'locale -a'"), $strErrorMessage); + } + putenv('LC_ALL=' .$strLocale. '.utf-8'); + putenv('LANG=' .$strLocale. '.utf-8'); + bindtextdomain($strLocale, $preBasePath. 'config/locale'); + bind_textdomain_codeset($strLocale, $chkTfValue2); + textdomain($strLocale); + $myVisClass->processMessage(translate('Settings were changed'), $strInfoMessage); + } else { + $myVisClass->processMessage(translate('An error occured while writing settings.php. Please ' + . 'check permissions!'), $strErrorMessage); + } + } else { + $myVisClass->processMessage($preBasePath. 'config/settings.php ' .translate('is not writeable, please ' + . 'check permissions!'), $strErrorMessage); + } } // // Start content // ============= -$conttp->setVariable("TITLE",translate('Configure Settings')); -$conttp->parse("header"); -$conttp->show("header"); -foreach($arrDescription AS $elem) { - $conttp->setVariable($elem['name'],$elem['string']); +$conttp->setVariable('TITLE', translate('Configure Settings')); +foreach ($arrDescription as $elem) { + $conttp->setVariable($elem['name'], $elem['string']); } -$conttp->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); -$conttp->setVariable("LANG_DESCRIPTION",translate('Change your current NagiosQL settings (e.g. Database user, Language).')); +$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$conttp->setVariable('LANG_DESCRIPTION', translate('Change your current NagiosQL settings (e.g. Database user, ' + . 'Language).')); // // Path settings // ============= -$conttp->setVariable("PATH",translate('Path')); -$conttp->setVariable("TEMPDIR_NAME",translate('Temporary Directory')); -$conttp->setVariable("TEMPDIR_VALUE",htmlspecialchars($chkTfValue1, ENT_QUOTES, 'utf-8')); -$conttp->setVariable("PROTOCOL_NAME",translate('Server protocol')); -$conttp->setVariable(strtoupper($SETS['path']['protocol'])."_SELECTED","selected"); +$conttp->setVariable('PATH', translate('Path')); +$conttp->setVariable('TEMPDIR_NAME', translate('Temporary Directory')); +$conttp->setVariable('TEMPDIR_VALUE', htmlspecialchars($chkTfValue1, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('PROTOCOL_NAME', translate('Server protocol')); +$conttp->setVariable(strtoupper($SETS['path']['protocol']). '_SELECTED', 'selected'); // // Data settings // ============= -$conttp->setVariable("DATA",translate('Language')); -$conttp->setVariable("LOCALE",translate('Language')); +$conttp->setVariable('DATA', translate('Language')); +$conttp->setVariable('LOCALE', translate('Language')); // Process language selection field -$strSQL = "SELECT * FROM `tbl_language` WHERE `active`='1' ORDER BY `id`"; -$booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); +$strSQL = "SELECT * FROM `tbl_language` WHERE `active`='1' ORDER BY `id`"; +$booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); if ($booReturn && ($intDataCount != 0)) { - foreach($arrData AS $elem) { - $conttp->setVariable("LANGUAGE_ID",$elem['id']); - $conttp->setVariable("LANGUAGE_NAME",translate($elem['language'])); - if ($elem['locale'] == $SETS['data']['locale']) $conttp->setVariable("LANGUAGE_SELECTED","selected"); - $conttp->parse("language"); - } + foreach ($arrData as $elem) { + $conttp->setVariable('LANGUAGE_ID', $elem['id']); + $conttp->setVariable('LANGUAGE_NAME', translate($elem['language'])); + if ($elem['locale'] == $SETS['data']['locale']) { + $conttp->setVariable('LANGUAGE_SELECTED', 'selected'); + } + $conttp->parse('language'); + } } else { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); } -$conttp->setVariable("ENCODING_NAME",translate('Encoding')); -$conttp->setVariable("ENCODING_VALUE",htmlspecialchars($chkTfValue2, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('ENCODING_NAME', translate('Encoding')); +$conttp->setVariable('ENCODING_VALUE', htmlspecialchars($chkTfValue2, ENT_QUOTES, 'utf-8')); // // Database settings // ================= -$conttp->setVariable("DB",translate('Database')); -$conttp->setVariable("SERVER_NAME",translate('MySQL Server')); -$conttp->setVariable("SERVER_VALUE",htmlspecialchars($chkTfValue3, ENT_QUOTES, 'utf-8')); -$conttp->setVariable("SERVER_PORT",translate('MySQL Server Port')); -$conttp->setVariable("PORT_VALUE",htmlspecialchars($chkTfValue4, ENT_QUOTES, 'utf-8')); -$conttp->setVariable("DATABASE_NAME",translate('Database name')); -$conttp->setVariable("DATABASE_VALUE",htmlspecialchars($chkTfValue5, ENT_QUOTES, 'utf-8')); -$conttp->setVariable("USERNAME_NAME",translate('Database user')); -$conttp->setVariable("USERNAME_VALUE",htmlspecialchars($chkTfValue6, ENT_QUOTES, 'utf-8')); -$conttp->setVariable("PASSWORD_NAME",translate('Database password')); -$conttp->setVariable("PASSWORD_VALUE",htmlspecialchars($chkTfValue7, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('DB', translate('Database')); +$conttp->setVariable('SERVER_NAME', translate('MySQL Server')); +$conttp->setVariable('SERVER_VALUE', htmlspecialchars($chkTfValue3, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('SERVER_PORT', translate('MySQL Server Port')); +$conttp->setVariable('PORT_VALUE', htmlspecialchars($chkTfValue4, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('DATABASE_NAME', translate('Database name')); +$conttp->setVariable('DATABASE_VALUE', htmlspecialchars($chkTfValue5, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('USERNAME_NAME', translate('Database user')); +$conttp->setVariable('USERNAME_VALUE', htmlspecialchars($chkTfValue6, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('PASSWORD_NAME', translate('Database password')); +$conttp->setVariable('PASSWORD_VALUE', htmlspecialchars($chkTfValue7, ENT_QUOTES, 'utf-8')); // // Security settings // ================= -$conttp->setVariable("SECURITY",translate('Security')); -$conttp->setVariable("LOGOFFTIME_NAME",translate('Session auto logoff time')); -$conttp->setVariable("LOGOFFTIME_VALUE",htmlspecialchars($chkTfValue8, ENT_QUOTES, 'utf-8')); -$conttp->setVariable("WSAUTH_NAME",translate('Authentication type')); -$conttp->setVariable("WSAUTH_".$chkSelValue3."_SELECTED","selected"); +$conttp->setVariable('SECURITY', translate('Security')); +$conttp->setVariable('LOGOFFTIME_NAME', translate('Session auto logoff time')); +$conttp->setVariable('LOGOFFTIME_VALUE', htmlspecialchars($chkTfValue8, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('WSAUTH_NAME', translate('Authentication type')); +$conttp->setVariable('WSAUTH_' .$chkSelValue3. '_SELECTED', 'selected'); // // Common settings // =============== -$conttp->setVariable("COMMON",translate('Common')); -$conttp->setVariable("PAGELINES_NAME",translate('Data lines per page')); -$conttp->setVariable("PAGELINES_VALUE",htmlspecialchars($chkTfValue9, ENT_QUOTES, 'utf-8')); -$conttp->setVariable("SELDISABLE_NAME",translate('Selection method')); -$conttp->setVariable("SELDISABLE_".$chkSelValue4."_SELECTED","selected"); +$conttp->setVariable('COMMON', translate('Common')); +$conttp->setVariable('PAGELINES_NAME', translate('Data lines per page')); +$conttp->setVariable('PAGELINES_VALUE', htmlspecialchars($chkTfValue9, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('SELDISABLE_NAME', translate('Selection method')); +$conttp->setVariable('SELDISABLE_' .$chkSelValue4. '_SELECTED', 'selected'); // // Template Check // ============== -$conttp->setVariable("TEMPLATE_CHECK", translate('Template warn message')); -$conttp->setVariable("LANG_ENABLE", translate('Enable')); -$conttp->setVariable("LANG_DISABLE", translate('Disable')); -$conttp->setVariable("TPL_CHECK_".$chkRadValue1."_CHECKED","checked"); +$conttp->setVariable('TEMPLATE_CHECK', translate('Template warn message')); +$conttp->setVariable('LANG_ENABLE', translate('Enable')); +$conttp->setVariable('LANG_DISABLE', translate('Disable')); +$conttp->setVariable('TPL_CHECK_' .$chkRadValue1. '_CHECKED', 'checked'); // // Online version check // ==================== -$conttp->setVariable("CLASS_NAME_1","elementHide"); -$conttp->setVariable("CLASS_NAME_2","elementHide"); -$conttp->setVariable("UPDATE_CHECK", translate('Online version check')); -$conttp->setVariable("UPD_CHECK_".$chkRadValue2."_CHECKED","checked"); -if ($chkRadValue2 == 1) $conttp->setVariable("CLASS_NAME_1","elementShow"); +$conttp->setVariable('CLASS_NAME_1', 'elementHide'); +$conttp->setVariable('CLASS_NAME_2', 'elementHide'); +$conttp->setVariable('UPDATE_CHECK', translate('Online version check')); +$conttp->setVariable('UPD_CHECK_' .$chkRadValue2. '_CHECKED', 'checked'); +if ($chkRadValue2 == 1) { + $conttp->setVariable('CLASS_NAME_1', 'elementShow'); +} // // Online update proxy settings // ============================ -$conttp->setVariable("UPD_PROXY_CHECK", translate('Proxyserver')); -$conttp->setVariable("UPD_PROXY_".$chkRadValue3."_CHECKED","checked"); -if (($chkRadValue3 == 1) && ($chkRadValue2 == 1)) $conttp->setVariable("CLASS_NAME_2","elementShow"); -$conttp->setVariable("UPD_PROXY_SERVER", translate('Proxy Address')); -$conttp->setVariable("UPD_PROXY_SERVER_VALUE",htmlspecialchars($chkTfValue10, ENT_QUOTES, 'utf-8')); -$conttp->setVariable("UPD_PROXY_USERNAME", translate('Proxy Username (optional)')); -$conttp->setVariable("UPD_PROXY_USERNAME_VALUE",htmlspecialchars($chkTfValue11, ENT_QUOTES, 'utf-8')); -$conttp->setVariable("UPD_PROXY_PASSWORD", translate('Proxy Password (optional)')); -$conttp->setVariable("UPD_PROXY_PASSWORD_VALUE",htmlspecialchars($chkTfValue12, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('UPD_PROXY_CHECK', translate('Proxyserver')); +$conttp->setVariable('UPD_PROXY_' .$chkRadValue3. '_CHECKED', 'checked'); +if (($chkRadValue3 == 1) && ($chkRadValue2 == 1)) { + $conttp->setVariable('CLASS_NAME_2', 'elementShow'); +} +$conttp->setVariable('UPD_PROXY_SERVER', translate('Proxy Address')); +$conttp->setVariable('UPD_PROXY_SERVER_VALUE', htmlspecialchars($chkTfValue10, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('UPD_PROXY_USERNAME', translate('Proxy Username (optional)')); +$conttp->setVariable('UPD_PROXY_USERNAME_VALUE', htmlspecialchars($chkTfValue11, ENT_QUOTES, 'utf-8')); +$conttp->setVariable('UPD_PROXY_PASSWORD', translate('Proxy Password (optional)')); +$conttp->setVariable('UPD_PROXY_PASSWORD_VALUE', htmlspecialchars($chkTfValue12, ENT_QUOTES, 'utf-8')); // // Requirements of form // ==================== -$conttp->setVariable("LANG_SAVE", translate('Save')); -$conttp->setVariable("LANG_ABORT", translate('Abort')); -$conttp->setVariable("LANG_REQUIRED", translate('required')); -$conttp->setVariable("ERRORMESSAGE",$strErrorMessage); -$conttp->setVariable("INFOMESSAGE",$strInfoMessage); +$conttp->setVariable('LANG_SAVE', translate('Save')); +$conttp->setVariable('LANG_ABORT', translate('Abort')); +$conttp->setVariable('LANG_REQUIRED', translate('required')); +$conttp->setVariable('ERRORMESSAGE', $strErrorMessage); +$conttp->setVariable('INFOMESSAGE', $strInfoMessage); // // Check access rights for adding new objects // ========================================== -if ($myVisClass->checkAccGroup($prePageKey,'write') != 0) $conttp->setVariable("ADD_CONTROL","disabled=\"disabled\""); -$conttp->parse("settingssite"); -$conttp->show("settingssite"); +if ($myVisClass->checkAccountGroup($prePageKey, 'write') != 0) { + $conttp->setVariable('ADD_CONTROL', 'disabled="disabled"'); +} +$conttp->parse('settingssite'); +$conttp->show('settingssite'); // // Footer ausgeben // =============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/specials.php b/admin/specials.php index 4f0e17f..1de5261 100644 --- a/admin/specials.php +++ b/admin/specials.php @@ -5,85 +5,108 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Specials overview -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 5; -$preContent = "admin/mainpages.tpl.htm"; +$prePageId = 5; +$preContent = 'admin/mainpages.htm.tpl'; // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); +require $preBasePath.'functions/prepend_adm.php'; // // Include content // =============== -$conttp->setVariable("TITLE",translate('Misc commands')); -$conttp->parse("header"); -$conttp->show("header"); -$conttp->setVariable("DESC",translate('To define host and service dependencies, host and service escalations as well as host and service additional data.')); -$conttp->setVariable("STATISTICS",translate('Statistical datas')); -$conttp->setVariable("TYPE",translate('Group')); -$conttp->setVariable("ACTIVE",translate('Active')); -$conttp->setVariable("INACTIVE",translate('Inactive')); +$conttp->setVariable('TITLE', translate('Misc commands')); +$conttp->parse('header'); +$conttp->show('header'); +$conttp->setVariable('DESC', translate('Define host and service dependencies, host and service escalations as well '. + 'as host and service additional data.')); +$conttp->setVariable('STATISTICS', translate('Statistical datas')); +$conttp->setVariable('TYPE', translate('Group')); +$conttp->setVariable('ACTIVE', translate('Active')); +$conttp->setVariable('INACTIVE', translate('Inactive')); // // Include statistical data // ======================== // Get read access groups -$strAccess = $myVisClass->getAccGroups('read'); -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=19")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Host dependencies')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_hostdependency` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_hostdependency` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +$strAccess = $myVisClass->getAccessGroups('read'); +$intAccessGrp19 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=19'); +$intAccessGrp20 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=20'); +$intAccessGrp21 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=21'); +$intAccessGrp22 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=22'); +$intAccessGrp23 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=23'); +$intAccessGrp24 = (int)$myDBClass->getFieldData('SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=24'); +if ($myVisClass->checkAccountGroup($intAccessGrp19, 'read') == 0) { + $conttp->setVariable('NAME', translate('Host dependencies')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_hostdependency` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_hostdependency` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=20")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Host escalations')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_hostescalation` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_hostescalation` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intAccessGrp20, 'read') == 0) { + $conttp->setVariable('NAME', translate('Host escalations')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_hostescalation` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_hostescalation` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=21")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Host ext. info')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_hostextinfo` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_hostextinfo` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intAccessGrp21, 'read') == 0) { + $conttp->setVariable('NAME', translate('Host ext. info')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_hostextinfo` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_hostextinfo` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=22")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Service dependencies')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_servicedependency` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_servicedependency` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intAccessGrp22, 'read') == 0) { + $conttp->setVariable('NAME', translate('Service dependencies')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_servicedependency` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_servicedependency` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=23")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Service escalations')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_serviceescalation` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_serviceescalation` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intAccessGrp23, 'read') == 0) { + $conttp->setVariable('NAME', translate('Service escalations')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_serviceescalation` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_serviceescalation` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -if ($myVisClass->checkAccGroup($myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=24")+0,'read') == 0) { - $conttp->setVariable("NAME",translate('Service ext. info')); - $conttp->setVariable("ACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_serviceextinfo` WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->setVariable("INACT_COUNT",$myDBClass->getFieldData("SELECT count(*) FROM `tbl_serviceextinfo` WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); - $conttp->parse("statisticrow"); +if ($myVisClass->checkAccountGroup($intAccessGrp24, 'read') == 0) { + $conttp->setVariable('NAME', translate('Service ext. info')); + $conttp->setVariable('ACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_serviceextinfo` ' + . "WHERE `active`='1' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->setVariable('INACT_COUNT', $myDBClass->getFieldData('SELECT count(*) FROM `tbl_serviceextinfo` ' + . "WHERE `active`='0' AND `config_id`=$chkDomainId AND `access_group` IN ($strAccess)")); + $conttp->parse('statisticrow'); } -$conttp->parse("statistics"); -$conttp->parse("main"); -$conttp->show("main"); +$conttp->parse('statistics'); +$conttp->parse('main'); +$conttp->show('main'); // // Include Footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/support.php b/admin/support.php index a27639c..2266c9e 100644 --- a/admin/support.php +++ b/admin/support.php @@ -5,626 +5,703 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Support page -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 40; -$preContent = "admin/support.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; -$setSaveLangId = "private"; +$prePageId = 40; +$preContent = 'admin/support.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; +$setSaveLangId = 'private'; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); -// -// Process post parameters -// ======================= -$chkHidVersion = isset($_POST['hidVersion']) ? $_POST['hidVersion'] : "all"; -$chkKey1 = isset($_POST['selInfoKey1']) ? $_POST['selInfoKey1'] : ""; -$chkKey2 = isset($_POST['selInfoKey2']) ? $_POST['selInfoKey2'] : ""; -$chkVersion = isset($_POST['selInfoVersion']) ? $_POST['selInfoVersion'] : ""; -// -// Add or modify data -// ================== -if (($chkTaValue1 != "") && ($chkTfValue3 == "1")) { - $strSQL = "SELECT `infotext` FROM `tbl_info` - WHERE `key1` = '$chkTfValue1' AND `key2` = '$chkTfValue2' AND `version` = '$chkHidVersion' - AND `language` = '$setSaveLangId'"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($intDataCount == 0) { - $strSQL = "INSERT INTO `tbl_info` (`key1`,`key2`,`version`,`language`,`infotext`) - VALUES ('$chkTfValue1','$chkTfValue2','$chkHidVersion','$setSaveLangId','$chkTaValue1')"; - } else { - $strSQL = "UPDATE `tbl_info` SET `infotext` = '$chkTaValue1' - WHERE `key1` = '$chkTfValue1' AND `key2` = '$chkTfValue2' AND `version` = '$chkHidVersion' - AND `language` = '$setSaveLangId'"; - } - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn != 0) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - } -} +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Start content // ============= -$conttp->setVariable("TITLE",translate('NagiosQL support page')); -$conttp->parse("header"); -$conttp->show("header"); +$conttp->setVariable('TITLE', translate('NagiosQL support page')); +$conttp->parse('header'); +$conttp->show('header'); // // Single data form // ================ -$conttp->setVariable("MAINSITE",$_SESSION['SETS']['path']['base_url']."admin.php"); -foreach($arrDescription AS $elem) { - $conttp->setVariable($elem['name'],$elem['string']); +$conttp->setVariable('MAINSITE', $_SESSION['SETS']['path']['base_url']. 'admin.php'); +foreach ($arrDescription as $elem) { + $conttp->setVariable($elem['name'], $elem['string']); } -$conttp->setVariable("SUBTITLE_1",translate('Support contact information')); -$conttp->setVariable("SUPPORT_TEXT_1",translate('For questions, the online support forum or contact information visit our website:')); +$conttp->setVariable('SUBTITLE_1', translate('Support contact information')); +$conttp->setVariable('SUPPORT_TEXT_1', translate('For questions, the online support forum or contact information ' + . 'visit our website:')); +$conttp->setVariable('WEBSITE_LINK', translate('NagiosQL on sourceforge')); // // Donation // ======== -$conttp->setVariable("SUBTITLE_2",translate('Donate to support NagiosQL')); -$conttp->setVariable("SUPPORT_TEXT_2",translate('If you like NagiosQL and it simplifies your daily work, then you may want to support the project by making a donation. This helps us to keep NagiosQL alive and to cover our costs. Thank you for your donation!')); -$conttp->setVariable("DONATE_LINK",translate('Donate for NagiosQL on sourceforge')); +$conttp->setVariable('SUBTITLE_2', translate('Donate to support NagiosQL')); +$conttp->setVariable('SUPPORT_TEXT_2', translate('If you like NagiosQL and it simplifies your daily work, then you ' + . 'may want to support the project by making a donation. This helps us to keep NagiosQL alive and to cover ' + . 'our costs. Thank you for your donation!')); +$conttp->setVariable('DONATE_LINK', translate('Donate for NagiosQL on sourceforge')); // // Translations // ============ -$conttp->setVariable("SUBTITLE_3",translate('Translation services')); -$conttp->setVariable("SUPPORT_TEXT_3",translate('NagiosQL was translated into various languages​​. Since some translators are no longer available in later versions, there may be untranslated words or phrases. If you want to help us complete the translation, correct them or introduce a new language​​, then sign up with us now! The translations are simply feasible online - we use an open translation service where you can register for free at any time:')); -$conttp->setVariable("TRANSLATION_LINK",translate('Transifex translation service')); +$conttp->setVariable('SUBTITLE_3', translate('Translation services')); +$conttp->setVariable('SUPPORT_TEXT_3', translate('NagiosQL was translated into various languages​​. Since some ' + . 'translators are no longer available in later versions, there may be untranslated words or phrases. If ' + . 'you want to help us complete the translation, correct them or introduce a new language​​, then sign up ' + . 'with us now! The translations are simply feasible online - we use an open translation service where ' + . 'you can register for free at any time:')); +$conttp->setVariable('TRANSLATION_LINK', translate('Transifex translation service')); +// +// GIT repository +// ============== +$conttp->setVariable('SUBTITLE_8', translate('GIT software repository')); +$conttp->setVariable('SUPPORT_TEXT_5', translate('The NagiosQL sources are available on GitLab. There you will ' + .'always find the latest bugfixes and changes as well as older branches.')); +$conttp->setVariable('GIT_LINK', translate('GitLab')); // // Online version check // ==================== -$conttp->setVariable("SUBTITLE_4",translate('Version check')); +$conttp->setVariable('SUBTITLE_4', translate('Version check')); if (!isset($SETS['common']['updcheck']) || ($SETS['common']['updcheck'] == '0')) { - $conttp->setVariable("SUPPORT_TEXT_4",translate('The online version check is not enabled. You can enable it on the settings page.')); -} else if (isset($SETS['common']['updcheck']) && ($SETS['common']['updcheck'] == '1')) { - $conttp->setVariable("SUPPORT_TEXT_4",translate('The online version check connects the NagiosQL page to find out, if your version is still up to date.')); - $conttp->setVariable("LOADER_IMAGE",$_SESSION['SETS']['path']['base_url']."images/loader.gif"); - $conttp->setVariable("VERSION_IF_SRC",$_SESSION['SETS']['path']['base_url']."admin/versioncheck.php?show=0"); - $conttp->parse("versioncheck_frame"); - $conttp->setVariable("VERSION_IF_SRC_RELOAD",$_SESSION['SETS']['path']['base_url']."admin/versioncheck.php?show=1"); - $conttp->parse("versioncheck_js"); + $conttp->setVariable('SUPPORT_TEXT_4', translate('The online version check is not enabled. You can enable it ' + . 'on the settings page.')); +} elseif (isset($SETS['common']['updcheck']) && ($SETS['common']['updcheck'] == '1')) { + $conttp->setVariable('SUPPORT_TEXT_4', translate('The online version check connects the NagiosQL page to find ' + . 'out, if your version is still up to date.')); + $conttp->setVariable('LOADER_IMAGE', $_SESSION['SETS']['path']['base_url']. 'images/loader.gif'); + $conttp->setVariable('VERSION_IF_SRC', $_SESSION['SETS']['path']['base_url']. 'admin/versioncheck.php?show=0'); + $conttp->parse('versioncheck_frame'); + $conttp->setVariable('VERSION_IF_SRC_RELOAD', $_SESSION['SETS']['path']['base_url']. + 'admin/versioncheck.php?show=1'); + $conttp->parse('versioncheck_js'); } // // Environment check // ================= -$conttp->setVariable("SUBTITLE_5",translate('Environment check')); +$conttp->setVariable('SUBTITLE_5', translate('Environment check')); // Javascript check -$conttp->setVariable("FAILED",translate("failed")); -$conttp->setVariable("OK",translate("ok")); +$conttp->setVariable('FAILED', translate('failed')); +$conttp->setVariable('OK', translate('ok')); // PHP version check -define('MIN_PHP_VERSION', '5.2.0'); -$conttp->setVariable("PHP_VERSION",translate("PHP version")); -if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '>=')) { - $conttp->setVariable("PHP_CLASS","checkgreen"); - $conttp->setVariable("PHP_RESULT",translate("ok")." (".PHP_VERSION.")"); +$conttp->setVariable('PHP_VERSION', translate('PHP version')); +if (PHP_VERSION_ID >= 50500) { + $conttp->setVariable('PHP_CLASS', 'checkgreen'); + $conttp->setVariable('PHP_RESULT', translate('ok'). ' (' .PHP_VERSION. ')'); } else { - $conttp->setVariable("PHP_CLASS","checkred"); - $conttp->setVariable("PHP_RESULT",translate("failed")." (".PHP_VERSION." - ".translate("Required:")." ".MIN_PHP_VERSION.")"); + $conttp->setVariable('PHP_CLASS', 'checkred'); + $conttp->setVariable('PHP_RESULT', translate('failed'). ' (' .PHP_VERSION. ' - ' + .translate('Required:'). ' 5.5.0)'); } // PHP modules / extensions $strExtPath = ini_get('extension_dir'); -$strPrefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; -$conttp->setVariable("PHP_SESSION_MODULE",translate("PHP module:")." session"); +$strPrefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; +$conttp->setVariable('PHP_SESSION_MODULE', translate('PHP module:'). ' session'); if (extension_loaded('session')) { - $conttp->setVariable("PHP_SESSION_CLASS","checkgreen"); - $conttp->setVariable("PHP_SESSION_RESULT",translate("ok")); + $conttp->setVariable('PHP_SESSION_CLASS', 'checkgreen'); + $conttp->setVariable('PHP_SESSION_RESULT', translate('ok')); } else { - $conttp->setVariable("PHP_SESSION_CLASS","checkred"); - $conttp->setVariable("PHP_SESSION_RESULT",translate("failed")); + $conttp->setVariable('PHP_SESSION_CLASS', 'checkred'); + $conttp->setVariable('PHP_SESSION_RESULT', translate('failed')); } -$conttp->setVariable("PHP_GETTEXT_MODULE",translate("PHP module:")." gettext"); +$conttp->setVariable('PHP_GETTEXT_MODULE', translate('PHP module:'). ' gettext'); if (extension_loaded('gettext')) { - $conttp->setVariable("PHP_GETTEXT_CLASS","checkgreen"); - $conttp->setVariable("PHP_GETTEXT_RESULT",translate("ok")); + $conttp->setVariable('PHP_GETTEXT_CLASS', 'checkgreen'); + $conttp->setVariable('PHP_GETTEXT_RESULT', translate('ok')); } else { - $conttp->setVariable("PHP_GETTEXT_CLASS","checkred"); - $conttp->setVariable("PHP_GETTEXT_RESULT",translate("failed")); + $conttp->setVariable('PHP_GETTEXT_CLASS', 'checkred'); + $conttp->setVariable('PHP_GETTEXT_RESULT', translate('failed')); } -$conttp->setVariable("PHP_FTP_MODULE",translate("PHP module:")." ftp"); +$conttp->setVariable('PHP_FTP_MODULE', translate('PHP module:'). ' ftp'); if (extension_loaded('ftp')) { - $conttp->setVariable("PHP_FTP_CLASS","checkgreen"); - $conttp->setVariable("PHP_FTP_RESULT",translate("ok")); - $intFTP_ok = 1; + $conttp->setVariable('PHP_FTP_CLASS', 'checkgreen'); + $conttp->setVariable('PHP_FTP_RESULT', translate('ok')); + $intFTP_ok = 1; } else { - $conttp->setVariable("PHP_FTP_CLASS","checkorange"); - $conttp->setVariable("PHP_FTP_RESULT",translate("failed")); - $intFTP_ok = 0; + $conttp->setVariable('PHP_FTP_CLASS', 'checkorange'); + $conttp->setVariable('PHP_FTP_RESULT', translate('failed')); + $intFTP_ok = 0; } -$conttp->setVariable("PHP_SSH2_MODULE",translate("PHP module:")." ssh"); +$conttp->setVariable('PHP_SSH2_MODULE', translate('PHP module:'). ' ssh'); if (extension_loaded('ssh2')) { - $conttp->setVariable("PHP_SSH2_CLASS","checkgreen"); - $conttp->setVariable("PHP_SSH2_RESULT",translate("ok")); - $intSSH_ok = 1; + $conttp->setVariable('PHP_SSH2_CLASS', 'checkgreen'); + $conttp->setVariable('PHP_SSH2_RESULT', translate('ok')); + $intSSH_ok = 1; } else { - $conttp->setVariable("PHP_SSH2_CLASS","checkorange"); - $conttp->setVariable("PHP_SSH2_RESULT",translate("failed")); - $intSSH_ok = 0; + $conttp->setVariable('PHP_SSH2_CLASS', 'checkorange'); + $conttp->setVariable('PHP_SSH2_RESULT', translate('failed')); + $intSSH_ok = 0; } // Datenbankversion -if ($SETS['db']['type'] == "mysql") { - $conttp->setVariable("DB_VERSION",translate("MySQL version")); - $strSQL = "SHOW VARIABLES LIKE 'version'"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataset); - if ($booReturn && (count($arrDataset) != 0)) { - $strDBVersion = $arrDataset['Value']; - if (version_compare($strDBVersion, "5.0.0", '>=')) { - $conttp->setVariable("DB_CLASS","checkgreen"); - $conttp->setVariable("DB_RESULT",translate("ok")." (".$strDBVersion.")"); - } else { - $conttp->setVariable("DB_CLASS","checkorange"); - $conttp->setVariable("DB_RESULT",translate("failed")." (".$strDBVersion." - ".translate("Required:")." 5.0.0)"); - } - } +if ($SETS['db']['type'] == 'mysql') { + $conttp->setVariable('DB_VERSION', translate('MySQL version')); + $strSQL = "SHOW VARIABLES LIKE 'version'"; + $booReturn = $myDBClass->hasSingleDataset($strSQL, $arrDataset); + if ($booReturn && (count($arrDataset) != 0)) { + $strDBVersion = $arrDataset['Value']; + if (version_compare($strDBVersion, '5.0.0', '>=')) { + $conttp->setVariable('DB_CLASS', 'checkgreen'); + $conttp->setVariable('DB_RESULT', translate('ok'). ' (' .$strDBVersion. ')'); + } else { + $conttp->setVariable('DB_CLASS', 'checkorange'); + $conttp->setVariable('DB_RESULT', translate('failed'). ' (' .$strDBVersion. ' - ' .translate('Required:'). + ' 5.0.0)'); + } + } } // INI settings -$conttp->setVariable("INI_FILE_UPLOADS",translate("PHP ini settings:")." file_uploads"); -$strStatus = ini_get('file_uploads'); -if (empty($strStatus) || ($strStatus == 1)) { - $conttp->setVariable("INI_FILE_UPLOADS_CLASS","checkgreen"); - $conttp->setVariable("INI_FILE_UPLOADS_RESULT",translate("ok")); +$conttp->setVariable('INI_FILE_UPLOADS', translate('PHP ini settings:'). ' file_uploads'); +$strStatus1 = ini_get('file_uploads'); +if (empty($strStatus1) || ($strStatus1 == 1)) { + $conttp->setVariable('INI_FILE_UPLOADS_CLASS', 'checkgreen'); + $conttp->setVariable('INI_FILE_UPLOADS_RESULT', translate('ok')); } else { - $conttp->setVariable("INI_FILE_UPLOADS_CLASS","checkred"); - $conttp->setVariable("INI_FILE_UPLOADS_RESULT",translate("failed")); + $conttp->setVariable('INI_FILE_UPLOADS_CLASS', 'checkred'); + $conttp->setVariable('INI_FILE_UPLOADS_RESULT', translate('failed')); } -$conttp->setVariable("INI_AUTO_START",translate("PHP ini settings:")." session.auto_start"); -$strStatus = ini_get('session.auto_start'); -if (empty($strStatus) || ($strStatus == 0)) { - $conttp->setVariable("INI_AUTO_START_CLASS","checkgreen"); - $conttp->setVariable("INI_AUTO_START_RESULT",translate("ok")); +$conttp->setVariable('INI_AUTO_START', translate('PHP ini settings:'). ' session.auto_start'); +$strStatus2 = ini_get('session.auto_start'); +if (empty($strStatus2) || ($strStatus2 == 0)) { + $conttp->setVariable('INI_AUTO_START_CLASS', 'checkgreen'); + $conttp->setVariable('INI_AUTO_START_RESULT', translate('ok')); } else { - $conttp->setVariable("INI_AUTO_START_CLASS","checkred"); - $conttp->setVariable("INI_AUTO_START_RESULT",translate("failed")); + $conttp->setVariable('INI_AUTO_START_CLASS', 'checkred'); + $conttp->setVariable('INI_AUTO_START_RESULT', translate('failed')); } -$conttp->setVariable("INI_SUHO_SESS_ENC",translate("PHP ini settings:")." suhosin.session.encrypt"); -$strStatus = ini_get('suhosin.session.encrypt'); -if (empty($strStatus) || ($strStatus == 0)) { - $conttp->setVariable("INI_SUHO_SESS_ENC_CLASS","checkgreen"); - $conttp->setVariable("INI_SUHO_SESS_ENC_RESULT",translate("ok")); +$conttp->setVariable('INI_SUHO_SESS_ENC', translate('PHP ini settings:'). ' suhosin.session.encrypt'); +$strStatus3 = ini_get('suhosin.session.encrypt'); +if (empty($strStatus3) || ($strStatus3 == 0)) { + $conttp->setVariable('INI_SUHO_SESS_ENC_CLASS', 'checkgreen'); + $conttp->setVariable('INI_SUHO_SESS_ENC_RESULT', translate('ok')); } else { - $conttp->setVariable("INI_SUHO_SESS_ENC_CLASS","checkred"); - $conttp->setVariable("INI_SUHO_SESS_ENC_RESULT",translate("failed")); + $conttp->setVariable('INI_SUHO_SESS_ENC_CLASS', 'checkred'); + $conttp->setVariable('INI_SUHO_SESS_ENC_RESULT', translate('failed')); } -$conttp->setVariable("INI_DATE_TIMEZONE",translate("PHP ini settings:")." date.timezone"); -$strStatus = ini_get('date.timezone'); -if (!empty($strStatus)) { - $conttp->setVariable("INI_DATE_TIMEZONE_CLASS","checkgreen"); - $conttp->setVariable("INI_DATE_TIMEZONE_RESULT",translate("ok")." (".$strStatus.")"); +$conttp->setVariable('INI_DATE_TIMEZONE', translate('PHP ini settings:'). ' date.timezone'); +$strStatus4 = ini_get('date.timezone'); +if (!empty($strStatus4)) { + $conttp->setVariable('INI_DATE_TIMEZONE_CLASS', 'checkgreen'); + $conttp->setVariable('INI_DATE_TIMEZONE_RESULT', translate('ok'). ' (' .$strStatus4. ')'); } else { - $conttp->setVariable("INI_DATE_TIMEZONE_CLASS","checkred"); - $conttp->setVariable("INI_DATE_TIMEZONE_RESULT",translate("failed")); + $conttp->setVariable('INI_DATE_TIMEZONE_CLASS', 'checkred'); + $conttp->setVariable('INI_DATE_TIMEZONE_RESULT', translate('failed')); } // File access checks -$conttp->setVariable("RW_CONFIG",translate("Read/Write access:")." settings.php"); -$strConfigFile = "../config/settings.php"; +$conttp->setVariable('RW_CONFIG', translate('Read/Write access:'). ' settings.php'); +$strConfigFile = '../config/settings.php'; if (file_exists($strConfigFile) && is_readable($strConfigFile) && is_writable($strConfigFile)) { - $conttp->setVariable("RW_CONFIG_CLASS","checkgreen"); - $conttp->setVariable("RW_CONFIG_RESULT",translate("ok")); -} else { - $conttp->setVariable("RW_CONFIG_CLASS","checkred"); - $conttp->setVariable("RW_CONFIG_RESULT",translate("failed")); + $conttp->setVariable('RW_CONFIG_CLASS', 'checkgreen'); + $conttp->setVariable('RW_CONFIG_RESULT', translate('ok')); +} else { + $conttp->setVariable('RW_CONFIG_CLASS', 'checkred'); + $conttp->setVariable('RW_CONFIG_RESULT', translate('failed')); } // // Domain checks // ============= -$arrConfigSet = $myConfigClass->getConfigSets(); +$myConfigClass->getConfigTargets($arrConfigSet); $intConfigId = $arrConfigSet[0]; -$myConfigClass->getConfigData($intConfigId,"method",$intMethod); +$myConfigClass->getConfigValues($intConfigId, 'method', $intMethod); if ($intConfigId != 0) { - $conttp->setVariable("SUBTITLE_6",translate('Config domain checks')); - $conttp->setVariable("SUPPORT_TEXT_6",translate('The checks below are based on your data domain and config domain settings. To change the data domain, use the pull down menu in the upper right corner. Repeat this check for any data domain you have configured. To change the config domain, use the data domain menu and select a different config domain value.')); - $myConfigClass->getConfigData($intConfigId,"conffile",$strConffile); - $myConfigClass->getConfigData($intConfigId,"target",$strConfName); - $conttp->setVariable("DOMAIN_NAME",translate("Config domain name")); - $conttp->setVariable("DOMAIN_NAME_VALUE",$strConfName); - $conttp->setVariable("CONNECT_TYPE",translate("Connection type")); - if ($intMethod == 1) { - $conttp->setVariable("CONNECT_TYPE_CLASS","checkgreen"); - $conttp->setVariable("CONNECT_TYPE_RESULT","Fileaccess"); - } else if ($intMethod == 2) { - if ($intFTP_ok == 1) { - $conttp->setVariable("CONNECT_TYPE_CLASS","checkgreen"); - $conttp->setVariable("CONNECT_TYPE_RESULT","FTP"); - } else { - $conttp->setVariable("CONNECT_TYPE_CLASS","checkred"); - $conttp->setVariable("CONNECT_TYPE_RESULT","FTP (no FTP module)"); - } - } else if ($intMethod == 3) { - if ($intSSH_ok == 1) { - $conttp->setVariable("CONNECT_TYPE_CLASS","checkgreen"); - $conttp->setVariable("CONNECT_TYPE_RESULT","SSH/SFTP"); - } else { - $conttp->setVariable("CONNECT_TYPE_CLASS","checkred"); - $conttp->setVariable("CONNECT_TYPE_RESULT","SSH/SFTP (no SSH2 module)"); - } - } - $conttp->setVariable("CONNECT_CHECK",translate("Connection check")); - if ($intMethod == 1) { - $conttp->setVariable("CONNECT_CHECK_CLASS","checkgreen"); - $conttp->setVariable("CONNECT_CHECK_RESULT",translate("ok")); - } else if ($intMethod == 2) { - $booReturn = 0; - if (!isset($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { - $booReturn = $myConfigClass->getFTPConnection($intConfigId); - } - if ($booReturn == 1) { - $conttp->setVariable("CONNECT_CHECK_CLASS","checkred"); - $conttp->setVariable("CONNECT_CHECK_RESULT",translate("failed")); - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - $intConnectCheck = 0; - } else { - $conttp->setVariable("CONNECT_CHECK_CLASS","checkgreen"); - $conttp->setVariable("CONNECT_CHECK_RESULT",translate("ok")); - $intConnectCheck = 1; - } - } else if ($intMethod == 3) { - $booReturn = 0; - if (!isset($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { - $booReturn = $myConfigClass->getSSHConnection($intConfigId); - } - if ($booReturn == 1) { - $conttp->setVariable("CONNECT_CHECK_CLASS","checkred"); - $conttp->setVariable("CONNECT_CHECK_RESULT",translate("failed")); - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - $intConnectCheck = 0; - } else { - $conttp->setVariable("CONNECT_CHECK_CLASS","checkgreen"); - $conttp->setVariable("CONNECT_CHECK_RESULT",translate("ok")); - $intConnectCheck = 1; - } - } - $conttp->setVariable("RW_NAG_CONF",translate("Nagios config file")); - if ($intMethod == 1) { - if (file_exists($strConffile) && is_readable($strConffile) && is_writable($strConffile)) { - $conttp->setVariable("RW_NAG_CONF_CLASS","checkgreen"); - $conttp->setVariable("RW_NAG_CONF_RESULT",translate("ok")); - } else if (file_exists($strConffile) && is_readable($strConffile)) { - $conttp->setVariable("RW_NAG_CONF_CLASS","checkorange"); - $conttp->setVariable("RW_NAG_CONF_RESULT",translate("ok")." (".translate("readonly").")"); - } else{ - $conttp->setVariable("RW_NAG_CONF_CLASS","checkred"); - $conttp->setVariable("RW_NAG_CONF_RESULT",translate("failed")); - } - } else if (($intMethod == 2) || ($intMethod == 3)) { - // Write file to temporary - $strFileName = tempnam($SETS['path']['tempdir'], 'nagiosql_conf'); - // Copy configuration from remote system - $intReturn = $myConfigClass->configCopy($strConffile,$intConfigId,$strFileName,0); - if ($intReturn == 0) { - $intCheck = 0; - } else { - $intCheck = 1; - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - if (file_exists($strFileName)) unlink($strFileName); - } - // Copy configuration to remote system - if ($intCheck == 0) { - $intReturn = $myConfigClass->configCopy($strConffile,$intConfigId,$strFileName,1); - if ($intReturn == 0) { - $intCheck = 0; - if (file_exists($strFileName)) unlink($strFileName); - } else { - $intCheck = 2; - if (file_exists($strFileName)) unlink($strFileName); - } - } - // Write Results - if ($intCheck == 0) { - $conttp->setVariable("RW_NAG_CONF_CLASS","checkgreen"); - $conttp->setVariable("RW_NAG_CONF_RESULT",translate("ok")); - } else if ($intCheck == 1) { - $conttp->setVariable("RW_NAG_CONF_CLASS","checkred"); - $conttp->setVariable("RW_NAG_CONF_RESULT",translate("failed")); - } else if ($intCheck == 2) { - $conttp->setVariable("RW_NAG_CONF_CLASS","checkorange"); - $conttp->setVariable("RW_NAG_CONF_RESULT",translate("ok")." (".translate("readonly").")"); - } - } - $myConfigClass->getConfigData($intConfigId,"pidfile",$strPidfile); - $myConfigClass->getConfigData($intConfigId,"binaryfile",$strBinary); - $myConfigClass->getConfigData($intConfigId,"commandfile",$strCommandfile); - $conttp->setVariable("CHECK_NAG_LOCK",translate("Nagios process file")); - if ($intMethod == 1) { - if (substr_count(PHP_OS,"Linux") != 0) { - exec('ps -ef | grep '.basename($strBinary).' | grep -v grep',$arrExec); - } else { - $arrExec[0] = 1; - } - if (file_exists($strPidfile) && isset($arrExec[0])) { - $conttp->setVariable("CHECK_NAG_LOCK_CLASS","checkgreen"); - $conttp->setVariable("CHECK_NAG_LOCK_RESULT",translate("ok")); - $intDemonOk = 0; - } else if (!file_exists($strPidfile) && isset($arrExec[0])) { - $conttp->setVariable("CHECK_NAG_LOCK_CLASS","checkred"); - $conttp->setVariable("CHECK_NAG_LOCK_RESULT",translate("failed")." (".translate("file is missed").")"); - $intDemonOk = 1; - } else { - $conttp->setVariable("CHECK_NAG_LOCK_CLASS","checkred"); - $conttp->setVariable("CHECK_NAG_LOCK_RESULT",translate("failed")); - $myVisClass->processMessage(translate('Nagios daemon is not running'),$strErrorMessage); - $intDemonOk = 1; - } - } else if ($intMethod == 2) { - $conttp->setVariable("CHECK_NAG_LOCK_CLASS","checkorange"); - $conttp->setVariable("CHECK_NAG_LOCK_RESULT",translate("ok")." (".translate("not used with FTP").")"); - $intDemonOk = 1; - } else if ($intMethod == 3) { - $arrResult1 = $myConfigClass->sendSSHCommand('ps -ef | grep '.basename($strBinary).' | grep '.basename($strConffile).' | grep -v grep'); - $arrResult2 = $myConfigClass->sendSSHCommand('ls '.$strPidfile); - if (is_array($arrResult1) && is_array($arrResult2)) { - $conttp->setVariable("CHECK_NAG_LOCK_CLASS","checkgreen"); - $conttp->setVariable("CHECK_NAG_LOCK_RESULT",translate("ok")); - $intDemonOk = 0; - } else if (is_array($arrResult1) && !is_array($arrResult2)) { - $conttp->setVariable("CHECK_NAG_LOCK_CLASS","checkred"); - $conttp->setVariable("CHECK_NAG_LOCK_RESULT",translate("failed")." (".translate("file is missed").")"); - $intDemonOk = 1; - } else { - $conttp->setVariable("CHECK_NAG_LOCK_CLASS","checkred"); - $conttp->setVariable("CHECK_NAG_LOCK_RESULT",translate("failed")." (".translate("demon dead").")"); - $myVisClass->processMessage(translate('Nagios daemon is not running'),$strErrorMessage); - $intDemonOk = 1; - } - } - // Command file - $conttp->setVariable("RW_NAG_COMMAND",translate("Nagios command file")); - if ($intMethod == 1) { - if (file_exists($strCommandfile) && is_readable($strCommandfile) && is_writable($strCommandfile) && ($intDemonOk == 0)) { - $conttp->setVariable("RW_NAG_COMMAND_CLASS","checkgreen"); - $conttp->setVariable("RW_NAG_COMMAND_RESULT",translate("ok")); - } else if (file_exists($strCommandfile) && is_readable($strCommandfile) && is_writable($strCommandfile) && ($intDemonOk == 1)) { - $conttp->setVariable("RW_NAG_COMMAND_CLASS","checkorange"); - $conttp->setVariable("RW_NAG_COMMAND_RESULT",translate("ok")." (".translate("demon dead")."?)"); - } else if (!file_exists($strCommandfile)) { - $conttp->setVariable("RW_NAG_COMMAND_CLASS","checkred"); - $conttp->setVariable("RW_NAG_COMMAND_RESULT",translate("failed")." (".translate("file is missed").")"); - } else if (!is_writable($strCommandfile)) { - $conttp->setVariable("RW_NAG_COMMAND_CLASS","checkred"); - $conttp->setVariable("RW_NAG_COMMAND_RESULT",translate("failed")." (".translate("readonly").")"); - } else { - $conttp->setVariable("RW_NAG_COMMAND_CLASS","checkred"); - $conttp->setVariable("RW_NAG_COMMAND_RESULT",translate("failed")); - } - } else if ($intMethod == 2) { - $conttp->setVariable("RW_NAG_COMMAND_CLASS","checkorange"); - $conttp->setVariable("RW_NAG_COMMAND_RESULT",translate("ok")." (".translate("not used with FTP").")"); - } else if ($intMethod == 3) { - if (is_array($myConfigClass->sendSSHCommand('ls '.$strCommandfile)) && ($intDemonOk == 0)) { - $timeout = 3; - $old = ini_set('default_socket_timeout', $timeout); - $resCmdFile = fopen($strCommandfile,"w"); - ini_set('default_socket_timeout', $old); - stream_set_timeout($resCmdFile, $timeout); - stream_set_blocking($resCmdFile, 0); - if ($resCmdFile) { - $conttp->setVariable("RW_NAG_COMMAND_CLASS","checkgreen"); - $conttp->setVariable("RW_NAG_COMMAND_RESULT",translate("ok")); - fclose($resCmdFile); - } else { - $conttp->setVariable("RW_NAG_COMMAND_CLASS","checkred"); - $conttp->setVariable("RW_NAG_COMMAND_RESULT",translate("failed")." (".translate("readonly").")"); - } - } else if ($intDemonOk == 1) { - $conttp->setVariable("RW_NAG_COMMAND_CLASS","checkred"); - $conttp->setVariable("RW_NAG_COMMAND_RESULT",translate("failed")." (".translate("demon dead").")"); - } else { - $conttp->setVariable("RW_NAG_COMMAND_CLASS","checkred"); - $conttp->setVariable("RW_NAG_COMMAND_RESULT",translate("failed")." (".translate("file is missed").")"); - } - - } - // Binary file - $conttp->setVariable("EXE_NAG_BINARY",translate("Nagios binary file")); - if ($intMethod == 1) { - if (file_exists($strBinary) && is_executable($strBinary)) { - $conttp->setVariable("EXE_NAG_BINARY_CLASS","checkgreen"); - $conttp->setVariable("EXE_NAG_BINARY_RESULT",translate("ok")); - } else if (!file_exists($strBinary)) { - $conttp->setVariable("EXE_NAG_BINARY_CLASS","checkred"); - $conttp->setVariable("EXE_NAG_BINARY_RESULT",translate("failed")." (".translate("file is missed").")"); - } else { - $conttp->setVariable("EXE_NAG_BINARY_CLASS","checkred"); - $conttp->setVariable("EXE_NAG_BINARY_RESULT",translate("failed")." (".translate("not executable").")"); - } - } else if ($intMethod == 2) { - $conttp->setVariable("EXE_NAG_BINARY_CLASS","checkorange"); - $conttp->setVariable("EXE_NAG_BINARY_RESULT",translate("ok")." (".translate("not used with FTP").")"); - } else if ($intMethod == 3) { - $booReturn = 0; - if (!isset($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { - $booReturn = $myConfigClass->getSSHConnection($intConfigId); - } - if ($booReturn == 1) { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } else { - if (($strBinary != "") && ($strConffile != "") && (is_array($myConfigClass->sendSSHCommand('ls '.$strBinary)))) { - $arrResult = $myConfigClass->sendSSHCommand($strBinary.' -V'); - if (!is_array($arrResult) || ($arrResult == false)) { - $conttp->setVariable("EXE_NAG_BINARY_CLASS","checkred"); - $conttp->setVariable("EXE_NAG_BINARY_RESULT",translate("failed")." (".translate("not executable").")"); - } else { - $conttp->setVariable("EXE_NAG_BINARY_CLASS","checkgreen"); - $conttp->setVariable("EXE_NAG_BINARY_RESULT",translate("ok")); - } - } else { - $conttp->setVariable("EXE_NAG_BINARY_CLASS","checkred"); - $conttp->setVariable("EXE_NAG_BINARY_RESULT",translate("failed")." (".translate("file is missed").")"); - } - } - } - // Check config files - $myConfigClass->getConfigData($intConfigId,"basedir",$strBasedir); - $myConfigClass->getConfigData($intConfigId,"hostconfig",$strHostdir); - $myConfigClass->getConfigData($intConfigId,"serviceconfig",$strServicedir); - $conttp->setVariable("SUBTITLE_7",translate('Verify configuration files and demon configuration')); - $conttp->setVariable("CONFIGURATION_NAME",translate('Configuration name')); - $conttp->setVariable("USED",translate('Used in data domain')); - $conttp->setVariable("DEMON_CONFIG",translate('Included in demon configuration')." (".basename($strConffile).")"); - $arrConfigFiles = array ( - 'Hosts' => array( 'table' => 'tbl_host', 'file' => 'directory'), - 'Services' => array( 'table' => 'tbl_service', 'file' => 'directory'), - 'Hostgroups' => array( 'table' => 'tbl_hostgroup', 'file' => 'hostgroups.cfg'), - 'Servicegroups' => array( 'table' => 'tbl_servicegroup', 'file' => 'servicegroups.cfg'), - 'Hosttemplates' => array( 'table' => 'tbl_hosttemplate', 'file' => 'hosttemplates.cfg'), - 'servicetemplates' => array( 'table' => 'tbl_servicetemplate', 'file' => 'servicetemplates.cfg'), - 'Contacts' => array( 'table' => 'tbl_contact', 'file' => 'contacts.cfg'), - 'Contactgroups' => array( 'table' => 'tbl_contactgroup', 'file' => 'contactgroups.cfg'), - 'Timeperiods' => array( 'table' => 'tbl_timeperiod', 'file' => 'timeperiods.cfg'), - 'Contacttemplates' => array( 'table' => 'tbl_contacttemplate', 'file' => 'contacttemplates.cfg'), - 'Commands' => array( 'table' => 'tbl_command', 'file' => 'commands.cfg'), - 'Hostdependencies' => array( 'table' => 'tbl_hostdependency', 'file' => 'hostdependencies.cfg'), - 'Hostescalations' => array( 'table' => 'tbl_hostescalation', 'file' => 'hostescalations.cfg'), - 'Hostextinfo' => array( 'table' => 'tbl_hostextinfo', 'file' => 'hostextinfo.cfg'), - 'Servicedependencies' => array( 'table' => 'tbl_servicedependency', 'file' => 'servicedependencies.cfg'), - 'Serviceescalations' => array( 'table' => 'tbl_serviceescalation', 'file' => 'serviceescalations.cfg'), - 'Serviceextinfo' => array( 'table' => 'tbl_serviceextinfo', 'file' => 'serviceextinfo.cfg')); - if ($intMethod == 1) { - $intCheck = 1; - if (file_exists($strConffile) && is_readable($strConffile)) { - $resFile = fopen($strConffile,'r'); - while (!feof($resFile)) { - $strLine = trim(fgets($resFile)); - if ((substr($strLine,0,1) == 'c') && ((substr_count($strLine,'cfg_dir') != 0) || (substr_count($strLine,'cfg_file') != 0))) { - $arrConfig[] = $strLine; - } - } - $intCheck = 0; - fclose($resFile); - } - } else if (($intMethod == 2) || ($intMethod == 3)) { - $intCheck = 1; - // Write file to temporary - $strFileName = tempnam($SETS['path']['tempdir'], 'nagiosql_conf'); - // Copy configuration from remote system - $intReturn = $myConfigClass->configCopy($strConffile,$intConfigId,$strFileName,0); - if ($intReturn == 0) { - $intCheck = 0; - if (file_exists($strFileName) && is_readable($strFileName)) { - $resFile = fopen($strFileName,'r'); - while (!feof($resFile)) { - $strLine = trim(fgets($resFile)); - if ((substr($strLine,0,1) == 'c') && ((substr_count($strLine,'cfg_dir') != 0) || (substr_count($strLine,'cfg_file') != 0))) { - $arrConfig[] = $strLine; - } - } - fclose($resFile); - $intCheck = 0; - } - } else { - $intCheck = 1; - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - if (file_exists($strFileName)) unlink($strFileName); - } - } - $i = 0; - foreach ($arrConfigFiles AS $key => $elem){ - // Line colours - $strClassL = "tdlb"; $strClassM = "tdmb"; - if ($i%2 == 1) {$strClassL = "tdld"; $strClassM = "tdmd";} - $conttp->setVariable("CLASS_L",$strClassL); - $conttp->setVariable("CLASS_M",$strClassM); - // Write configuiration name - $conttp->setVariable("CONFIG_NAME",$key); - // Count active datasets - $strSQL = "SELECT * FROM `".$elem['table']."` WHERE `active`='1' AND `config_id`=$chkDomainId"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn && ($intDataCount != 0)) { - $conttp->setVariable("ACTIVE_CONFIG_COUNT","".translate("ok")." (".$intDataCount.")"); - } else if ($intDataCount == 0) { - $conttp->setVariable("ACTIVE_CONFIG_COUNT","".translate("not used").""); - } else { - $conttp->setVariable("ACTIVE_CONFIG_COUNT","".translate("failed").""); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - $conttp->setVariable("DEMON_CFG_OK","".translate("failed")." (".translate("cfg definition missed").")"); - if (($intCheck == 0) && is_array($arrConfig) && (count($arrConfig) != 0)) { - foreach ($arrConfig AS $line) { - if ($elem['file'] != 'directory') { - if ((substr_count($line,"cfg_dir=".$strBasedir) != 0) && (substr_count($line,"cfg_dir=".substr($strHostdir,0,-1)) == 0) && - (substr_count($line,"cfg_dir=".substr($strServicedir,0,-1)) == 0)) { - $conttp->setVariable("DEMON_CFG_OK","".translate("ok")." (".$line.")"); - } else if (substr_count($line,$strBasedir.$elem['file']) != 0) { - $conttp->setVariable("DEMON_CFG_OK","".translate("ok")." (".$line.")"); - } else if ($intDataCount == 0) { - $conttp->setVariable("DEMON_CFG_OK","".translate("ok")." (".translate("cfg definition missed, but actually not used").")"); - } else if (substr_count($line,$elem['file']) != 0) { - $conttp->setVariable("DEMON_CFG_OK","".translate("failed")." (".translate("wrong base path:")." ".$line.")"); - } - } else if ($elem['table'] == 'tbl_host'){ - if (substr_count($line,"cfg_dir=".substr($strHostdir,0,-1)) != 0) { - $conttp->setVariable("DEMON_CFG_OK","".translate("ok")." (".$line.")"); - } else if ($intDataCount == 0) { - $conttp->setVariable("DEMON_CFG_OK","".translate("ok")." (".translate("cfg definition missed, but actually not used").")"); - } - } else if ($elem['table'] == 'tbl_service'){ - if (substr_count($line,"cfg_dir=".substr($strServicedir,0,-1)) != 0) { - $conttp->setVariable("DEMON_CFG_OK","".translate("ok")." (".$line.")"); - } else if ($intDataCount == 0) { - $conttp->setVariable("DEMON_CFG_OK","".translate("ok")." (".translate("cfg definition missed, but actually not used").")"); - } - } - } - } else { - $conttp->setVariable("DEMON_CFG_OK","".translate("failed")." (".translate("cfg file not readable").")"); - } - $conttp->parse("configfileline"); - $i++; - } - // Check for unused config - if (($intCheck == 0) && is_array($arrConfig) && (count($arrConfig) != 0)) { - foreach ($arrConfig AS $line) { - $intTest=0; - foreach ($arrConfigFiles AS $elem) { - if (substr_count($line,$elem['file']) != 0) $intTest = 1; - } - if ($intTest == 0) { - if (substr_count($line,substr("cfg_dir=".$strHostdir,0,-1)) != 0) $intTest = 1; - if (substr_count($line,substr("cfg_dir=".$strServicedir,0,-1)) != 0) $intTest = 1; - //if (substr_count($line,substr("cfg_dir=".$strBasedir,0,-1)) != 0) $intTest = 1; - } - if ($intTest == 0) { - // Line colours - $strClassL = "tdlb"; $strClassM = "tdmb"; - if ($i%2 == 1) {$strClassL = "tdld"; $strClassM = "tdmd";} - $conttp->setVariable("CLASS_L",$strClassL); - $conttp->setVariable("CLASS_M",$strClassM); - $conttp->setVariable("CONFIG_NAME",translate("Not used")); - $conttp->setVariable("ACTIVE_CONFIG_COUNT","".translate("failed").""); - $conttp->setVariable("DEMON_CFG_OK","".translate("unused - please delete!")." (".$line.")"); - $conttp->parse("configfileline"); - $i++; - } - } - } - $conttp->parse("configdomain"); + $conttp->setVariable('SUBTITLE_6', translate('Config domain checks')); + $conttp->setVariable('SUPPORT_TEXT_6', translate('The checks below are based on your data domain and config ' + . 'domain settings. To change the data domain, use the pull down menu in the upper right corner. Repeat ' + . 'this check for any data domain you have configured. To change the config domain, use the data domain ' + . 'menu and select a different config domain value.')); + $myConfigClass->getConfigValues($intConfigId, 'conffile', $strConffile); + $myConfigClass->getConfigValues($intConfigId, 'target', $strConfName); + $conttp->setVariable('DOMAIN_NAME', translate('Config domain name')); + $conttp->setVariable('DOMAIN_NAME_VALUE', $strConfName); + $conttp->setVariable('CONNECT_TYPE', translate('Connection type')); + if ($intMethod == 1) { + $conttp->setVariable('CONNECT_TYPE_CLASS', 'checkgreen'); + $conttp->setVariable('CONNECT_TYPE_RESULT', 'Fileaccess'); + } elseif ($intMethod == 2) { + if ($intFTP_ok == 1) { + $conttp->setVariable('CONNECT_TYPE_CLASS', 'checkgreen'); + $conttp->setVariable('CONNECT_TYPE_RESULT', 'FTP'); + } else { + $conttp->setVariable('CONNECT_TYPE_CLASS', 'checkred'); + $conttp->setVariable('CONNECT_TYPE_RESULT', 'FTP (no FTP module)'); + } + } elseif ($intMethod == 3) { + if ($intSSH_ok == 1) { + $conttp->setVariable('CONNECT_TYPE_CLASS', 'checkgreen'); + $conttp->setVariable('CONNECT_TYPE_RESULT', 'SSH/SFTP'); + } else { + $conttp->setVariable('CONNECT_TYPE_CLASS', 'checkred'); + $conttp->setVariable('CONNECT_TYPE_RESULT', 'SSH/SFTP (no SSH2 module)'); + } + } + $conttp->setVariable('CONNECT_CHECK', translate('Connection check')); + if ($intMethod == 1) { + $conttp->setVariable('CONNECT_CHECK_CLASS', 'checkgreen'); + $conttp->setVariable('CONNECT_CHECK_RESULT', translate('ok')); + } elseif ($intMethod == 2) { + $booReturn = 0; + if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { + $booReturn = $myConfigClass->getFTPConnection($intConfigId); + } + if ($booReturn == 1) { + $conttp->setVariable('CONNECT_CHECK_CLASS', 'checkred'); + $conttp->setVariable('CONNECT_CHECK_RESULT', translate('failed')); + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + $intConnectCheck = 0; + } else { + $conttp->setVariable('CONNECT_CHECK_CLASS', 'checkgreen'); + $conttp->setVariable('CONNECT_CHECK_RESULT', translate('ok')); + $intConnectCheck = 1; + } + } elseif ($intMethod == 3) { + $booReturn = 0; + if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { + $booReturn = $myConfigClass->getSSHConnection($intConfigId); + } + if ($booReturn == 1) { + $conttp->setVariable('CONNECT_CHECK_CLASS', 'checkred'); + $conttp->setVariable('CONNECT_CHECK_RESULT', translate('failed')); + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + $intConnectCheck = 0; + } else { + $conttp->setVariable('CONNECT_CHECK_CLASS', 'checkgreen'); + $conttp->setVariable('CONNECT_CHECK_RESULT', translate('ok')); + $intConnectCheck = 1; + } + } + $conttp->setVariable('RW_NAG_CONF', translate('Nagios config file')); + if ($intMethod == 1) { + if (file_exists($strConffile) && is_readable($strConffile)) { + if (is_writable($strConffile)) { + $conttp->setVariable('RW_NAG_CONF_CLASS', 'checkgreen'); + $conttp->setVariable('RW_NAG_CONF_RESULT', translate('ok')); + } else { + $conttp->setVariable('RW_NAG_CONF_CLASS', 'checkorange'); + $conttp->setVariable('RW_NAG_CONF_RESULT', translate('ok'). ' (' .translate('readonly'). ')'); + } + } else { + $conttp->setVariable('RW_NAG_CONF_CLASS', 'checkred'); + $conttp->setVariable('RW_NAG_CONF_RESULT', translate('failed')); + } + } elseif (($intMethod == 2) || ($intMethod == 3)) { + // Write file to temporary + $strFileName = tempnam($SETS['path']['tempdir'], 'nagiosql_conf'); + // Copy configuration from remote system + $intReturn = $myConfigClass->remoteFileCopy($strConffile, $intConfigId, $strFileName, 0); + if ($intReturn == 0) { + $intCheck = 0; + } else { + $intCheck = 1; + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + if (file_exists($strFileName)) { + unlink($strFileName); + } + } + // Copy configuration to remote system + if ($intCheck == 0) { + $intReturn = $myConfigClass->remoteFileCopy($strConffile, $intConfigId, $strFileName, 1); + if ($intReturn == 0) { + $intCheck = 0; + if (file_exists($strFileName)) { + unlink($strFileName); + } + } else { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + $intCheck = 2; + if (file_exists($strFileName)) { + unlink($strFileName); + } + } + } + // Write Results + if ($intCheck == 0) { + $conttp->setVariable('RW_NAG_CONF_CLASS', 'checkgreen'); + $conttp->setVariable('RW_NAG_CONF_RESULT', translate('ok')); + } elseif ($intCheck == 1) { + $conttp->setVariable('RW_NAG_CONF_CLASS', 'checkred'); + $conttp->setVariable('RW_NAG_CONF_RESULT', translate('failed')); + } elseif ($intCheck == 2) { + $conttp->setVariable('RW_NAG_CONF_CLASS', 'checkorange'); + $conttp->setVariable('RW_NAG_CONF_RESULT', translate('ok'). ' (' .translate('readonly'). ')'); + } + } + $myConfigClass->getConfigValues($intConfigId, 'pidfile', $strPidfile); + $myConfigClass->getConfigValues($intConfigId, 'binaryfile', $strBinary); + $myConfigClass->getConfigValues($intConfigId, 'commandfile', $strCommandfile); + $conttp->setVariable('CHECK_NAG_LOCK', translate('Nagios process file')); + if ($intMethod == 1) { + if (substr_count(PHP_OS, 'Linux') != 0) { + exec('ps -ef | grep '.basename($strBinary).' | grep -v grep', $arrExec); + } else { + $arrExec[0] = 1; + } + if (isset($arrExec[0])) { + if (file_exists($strPidfile)) { + $conttp->setVariable('CHECK_NAG_LOCK_CLASS', 'checkgreen'); + $conttp->setVariable('CHECK_NAG_LOCK_RESULT', translate('ok')); + $intDemonOk = 0; + } else { + $conttp->setVariable('CHECK_NAG_LOCK_CLASS', 'checkred'); + $conttp->setVariable('CHECK_NAG_LOCK_RESULT', translate('failed') . ' (' + . translate('file is missed') . ')'); + $intDemonOk = 1; + } + } else { + $conttp->setVariable('CHECK_NAG_LOCK_CLASS', 'checkred'); + $conttp->setVariable('CHECK_NAG_LOCK_RESULT', translate('failed')); + $myVisClass->processMessage(translate('Nagios daemon is not running'), $strErrorMessage); + $intDemonOk = 1; + } + } elseif ($intMethod == 2) { + $conttp->setVariable('CHECK_NAG_LOCK_CLASS', 'checkorange'); + $conttp->setVariable('CHECK_NAG_LOCK_RESULT', translate('ok'). ' (' .translate('not used with FTP'). ')'); + $intDemonOk = 1; + } elseif ($intMethod == 3) { + $arrResultBinary = array(); + $arrResultPid = array(); + $intBinary = 1; + $intPid = 1; + if ($strBinary != '') { + $intBinary = $myConfigClass->sendSSHCommand('ps -ef | grep '.basename($strBinary).' | grep '. + basename($strConffile).' | grep -v grep', $arrResultBinary); + } + if ($strPidfile != '') { + $intPid = $myConfigClass->sendSSHCommand('ls ' . $strPidfile, $arrResult2); + } + if (($intBinary == 0) && ($intPid == 0)) { + $conttp->setVariable('CHECK_NAG_LOCK_CLASS', 'checkgreen'); + $conttp->setVariable('CHECK_NAG_LOCK_RESULT', translate('ok')); + $intDemonOk = 0; + } elseif (($intBinary == 0) && ($intPid == 1)) { + $conttp->setVariable('CHECK_NAG_LOCK_CLASS', 'checkred'); + $conttp->setVariable('CHECK_NAG_LOCK_RESULT', translate('failed'). ' (' .translate('file is missed'). ')'); + $intDemonOk = 1; + } else { + $conttp->setVariable('CHECK_NAG_LOCK_CLASS', 'checkred'); + $conttp->setVariable('CHECK_NAG_LOCK_RESULT', translate('failed'). ' (' .translate('demon dead'). ')'); + $myVisClass->processMessage(translate('Nagios daemon is not running'), $strErrorMessage); + $intDemonOk = 1; + } + } + // Command file + $conttp->setVariable('RW_NAG_COMMAND', translate('Nagios command file')); + if ($intMethod == 1) { + if (file_exists($strCommandfile) && is_readable($strCommandfile) && is_writable($strCommandfile)) { + if ($intDemonOk == 0) { + $conttp->setVariable('RW_NAG_COMMAND_CLASS', 'checkgreen'); + $conttp->setVariable('RW_NAG_COMMAND_RESULT', translate('ok')); + } else { + $conttp->setVariable('RW_NAG_COMMAND_CLASS', 'checkorange'); + $conttp->setVariable('RW_NAG_COMMAND_RESULT', translate('ok'). ' (' .translate('demon dead'). '?)'); + } + } + if (!file_exists($strCommandfile)) { + $conttp->setVariable('RW_NAG_COMMAND_CLASS', 'checkred'); + $conttp->setVariable('RW_NAG_COMMAND_RESULT', translate('failed'). ' (' .translate('file is missed'). ')'); + } elseif (!is_writable($strCommandfile)) { + $conttp->setVariable('RW_NAG_COMMAND_CLASS', 'checkred'); + $conttp->setVariable('RW_NAG_COMMAND_RESULT', translate('failed'). ' (' .translate('readonly'). ')'); + } elseif (!is_readable($strCommandfile)) { + $conttp->setVariable('RW_NAG_COMMAND_CLASS', 'checkred'); + $conttp->setVariable('RW_NAG_COMMAND_RESULT', translate('failed')); + } + } elseif ($intMethod == 2) { + $conttp->setVariable('RW_NAG_COMMAND_CLASS', 'checkorange'); + $conttp->setVariable('RW_NAG_COMMAND_RESULT', translate('ok'). ' (' .translate('not used with FTP'). ')'); + } elseif ($intMethod == 3) { + if ($strCommandfile != '') { + if ($intDemonOk == 0) { + $myConfigClass->sendSSHCommand('echo "TEST" >>' . $strCommandfile . '; echo $?; echo ""', $arrTemp); + if ($arrTemp[0] == 0) { + $conttp->setVariable('RW_NAG_COMMAND_CLASS', 'checkgreen'); + $conttp->setVariable('RW_NAG_COMMAND_RESULT', translate('ok')); + } else { + $conttp->setVariable('RW_NAG_COMMAND_CLASS', 'checkred'); + $conttp->setVariable('RW_NAG_COMMAND_RESULT', translate('failed'). ' (' + .translate('readonly'). ')'); + } + } elseif ($intDemonOk == 1) { + $conttp->setVariable('RW_NAG_COMMAND_CLASS', 'checkred'); + $conttp->setVariable('RW_NAG_COMMAND_RESULT', translate('failed'). ' (' .translate('demon dead'). ')'); + } else { + $conttp->setVariable('RW_NAG_COMMAND_CLASS', 'checkred'); + $conttp->setVariable('RW_NAG_COMMAND_RESULT', translate('failed'). ' (' + .translate('file is missed'). ')'); + } + } else { + $conttp->setVariable('RW_NAG_COMMAND_CLASS', 'checkred'); + $conttp->setVariable('RW_NAG_COMMAND_RESULT', translate('failed'). ' (' .translate('file is missed'). ')'); + } + } + // Binary file + $conttp->setVariable('EXE_NAG_BINARY', translate('Nagios binary file')); + if ($intMethod == 1) { + if (file_exists($strBinary)) { + if (is_executable($strBinary)) { + $conttp->setVariable('EXE_NAG_BINARY_CLASS', 'checkgreen'); + $conttp->setVariable('EXE_NAG_BINARY_RESULT', translate('ok')); + } else { + $conttp->setVariable('EXE_NAG_BINARY_CLASS', 'checkred'); + $conttp->setVariable('EXE_NAG_BINARY_RESULT', translate('failed'). ' (' + .translate('not executable'). ')'); + } + } else { + $conttp->setVariable('EXE_NAG_BINARY_CLASS', 'checkred'); + $conttp->setVariable('EXE_NAG_BINARY_RESULT', translate('failed'). ' (' .translate('file is missed'). ')'); + } + } elseif ($intMethod == 2) { + $conttp->setVariable('EXE_NAG_BINARY_CLASS', 'checkorange'); + $conttp->setVariable('EXE_NAG_BINARY_RESULT', translate('ok'). ' (' .translate('not used with FTP'). ')'); + } elseif ($intMethod == 3) { + $booReturn = 0; + /** @noinspection IsEmptyFunctionUsageInspection */ + if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { + $booReturn = $myConfigClass->getSSHConnection($intConfigId); + } + if ($booReturn == 1) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } else { + if (($strBinary != '') && ($strConffile != '') && + ($myConfigClass->sendSSHCommand('ls '.$strBinary, $arrTemp) == 0)) { + $myConfigClass->sendSSHCommand($strBinary.' -V', $arrResult); + if (!is_array($arrResult) || ($arrResult == false)) { + $conttp->setVariable('EXE_NAG_BINARY_CLASS', 'checkred'); + $conttp->setVariable('EXE_NAG_BINARY_RESULT', translate('failed'). ' (' . + translate('not executable'). ')'); + } else { + $conttp->setVariable('EXE_NAG_BINARY_CLASS', 'checkgreen'); + $conttp->setVariable('EXE_NAG_BINARY_RESULT', translate('ok')); + } + } else { + $conttp->setVariable('EXE_NAG_BINARY_CLASS', 'checkred'); + $conttp->setVariable('EXE_NAG_BINARY_RESULT', translate('failed'). ' (' . + translate('file is missed'). ')'); + } + } + } + // Check config files + $myConfigClass->getConfigValues($intConfigId, 'basedir', $strBasedir); + $myConfigClass->getConfigValues($intConfigId, 'hostconfig', $strHostdir); + $myConfigClass->getConfigValues($intConfigId, 'serviceconfig', $strServicedir); + $conttp->setVariable('SUBTITLE_7', translate('Verify configuration files and demon configuration')); + $conttp->setVariable('CONFIGURATION_NAME', translate('Configuration name')); + $conttp->setVariable('USED', translate('Used in data domain')); + $conttp->setVariable('DEMON_CONFIG', translate('Included in demon configuration'). ' (' + .basename($strConffile). ')'); + $arrConfig = array(); + $arrConfigFiles = array( + 'Hosts' => array( 'table' => 'tbl_host', 'file' => 'directory'), + 'Services' => array( 'table' => 'tbl_service', 'file' => 'directory'), + 'Hostgroups' => array( 'table' => 'tbl_hostgroup', 'file' => 'hostgroups.cfg'), + 'Servicegroups' => array( 'table' => 'tbl_servicegroup', 'file' => 'servicegroups.cfg'), + 'Hosttemplates' => array( 'table' => 'tbl_hosttemplate', 'file' => 'hosttemplates.cfg'), + 'servicetemplates' => array( 'table' => 'tbl_servicetemplate', 'file' => 'servicetemplates.cfg'), + 'Contacts' => array( 'table' => 'tbl_contact', 'file' => 'contacts.cfg'), + 'Contactgroups' => array( 'table' => 'tbl_contactgroup', 'file' => 'contactgroups.cfg'), + 'Timeperiods' => array( 'table' => 'tbl_timeperiod', 'file' => 'timeperiods.cfg'), + 'Contacttemplates' => array( 'table' => 'tbl_contacttemplate', 'file' => 'contacttemplates.cfg'), + 'Commands' => array( 'table' => 'tbl_command', 'file' => 'commands.cfg'), + 'Hostdependencies' => array( 'table' => 'tbl_hostdependency', 'file' => 'hostdependencies.cfg'), + 'Hostescalations' => array( 'table' => 'tbl_hostescalation', 'file' => 'hostescalations.cfg'), + 'Hostextinfo' => array( 'table' => 'tbl_hostextinfo', 'file' => 'hostextinfo.cfg'), + 'Servicedependencies' => array( 'table' => 'tbl_servicedependency', 'file' => 'servicedependencies.cfg'), + 'Serviceescalations' => array( 'table' => 'tbl_serviceescalation', 'file' => 'serviceescalations.cfg'), + 'Serviceextinfo' => array( 'table' => 'tbl_serviceextinfo', 'file' => 'serviceextinfo.cfg')); + if ($intMethod == 1) { + $intCheck = 1; + if (file_exists($strConffile) && is_readable($strConffile)) { + $resFile = fopen($strConffile, 'rb'); + while (!feof($resFile)) { + $strLine = trim(fgets($resFile)); + if ((0 === strpos($strLine, 'c')) && ((substr_count($strLine, 'cfg_dir') != 0) || + (substr_count($strLine, 'cfg_file') != 0))) { + $arrConfig[] = $strLine; + } + } + $intCheck = 0; + fclose($resFile); + } + } elseif (($intMethod == 2) || ($intMethod == 3)) { + $intCheck = 1; + // Write file to temporary + $strFileName = tempnam($SETS['path']['tempdir'], 'nagiosql_conf'); + // Copy configuration from remote system + $intReturn = $myConfigClass->remoteFileCopy($strConffile, $intConfigId, $strFileName, 0); + if ($intReturn == 0) { + $intCheck = 0; + if (file_exists($strFileName) && is_readable($strFileName)) { + $resFile = fopen($strFileName, 'rb'); + while (!feof($resFile)) { + $strLine = trim(fgets($resFile)); + if ((0 === strpos($strLine, 'c')) && ((substr_count($strLine, 'cfg_dir') != 0) || + (substr_count($strLine, 'cfg_file') != 0))) { + $arrConfig[] = $strLine; + } + } + fclose($resFile); + $intCheck = 0; + } + } else { + $intCheck = 1; + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + if (file_exists($strFileName)) { + unlink($strFileName); + } + } + } + $i = 0; + foreach ($arrConfigFiles as $key => $elem) { + // Line colours + $strClassL = 'tdlb'; + $strClassM = 'tdmb'; + if ($i%2 == 1) { + $strClassL = 'tdld'; + $strClassM = 'tdmd'; + } + $conttp->setVariable('CLASS_L', $strClassL); + $conttp->setVariable('CLASS_M', $strClassM); + // Write configuiration name + $conttp->setVariable('CONFIG_NAME', $key); + // Count active datasets + $strSQL = 'SELECT * FROM `' .$elem['table']."` WHERE `active`='1' AND `config_id`=$chkDomainId"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn && ($intDataCount != 0)) { + $conttp->setVariable('ACTIVE_CONFIG_COUNT', '' .translate('ok'). ' (' . + $intDataCount. ')'); + } elseif ($intDataCount == 0) { + $conttp->setVariable('ACTIVE_CONFIG_COUNT', '' .translate('not used'). ''); + } else { + $conttp->setVariable('ACTIVE_CONFIG_COUNT', '' .translate('failed'). ''); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + $conttp->setVariable('DEMON_CFG_OK', '' .translate('failed'). ' (' . + translate('cfg definition missed'). ')'); + if (($intCheck == 0) && is_array($arrConfig) && (count($arrConfig) != 0)) { + foreach ($arrConfig as $line) { + if ($elem['file'] != 'directory') { + if ((substr_count($line, 'cfg_dir=' .$strBasedir) != 0) && (substr_count($line, 'cfg_dir=' . + substr($strHostdir, 0, -1)) == 0) && (substr_count($line, 'cfg_dir=' . + substr($strServicedir, 0, -1)) == 0)) { + $conttp->setVariable('DEMON_CFG_OK', '' .translate('ok'). + ' (' .$line. ')'); + break; + } + if (substr_count($line, $strBasedir.$elem['file']) != 0) { + $conttp->setVariable('DEMON_CFG_OK', '' .translate('ok'). + ' (' .$line. ')'); + break; + } + if ($intDataCount == 0) { + $conttp->setVariable('DEMON_CFG_OK', '' .translate('ok'). + ' (' .translate('cfg definition missed, but actually not used'). ')'); + } elseif (substr_count($line, $elem['file']) != 0) { + $conttp->setVariable('DEMON_CFG_OK', '' .translate('failed'). + ' (' .translate('wrong base path:'). ' ' .$line. ')'); + break; + } + } elseif ($elem['table'] == 'tbl_host') { + if (substr_count($line, 'cfg_dir=' .substr($strHostdir, 0, -1)) != 0) { + $conttp->setVariable('DEMON_CFG_OK', '' .translate('ok'). + ' (' .$line. ')'); + break; + } + if ($intDataCount == 0) { + $conttp->setVariable('DEMON_CFG_OK', '' .translate('ok'). + ' (' .translate('cfg definition missed, but actually not used'). ')'); + break; + } + } elseif ($elem['table'] == 'tbl_service') { + if (substr_count($line, 'cfg_dir=' .substr($strServicedir, 0, -1)) != 0) { + $conttp->setVariable('DEMON_CFG_OK', '' .translate('ok'). + ' (' .$line. ')'); + break; + } + if ($intDataCount == 0) { + $conttp->setVariable('DEMON_CFG_OK', '' .translate('ok'). + ' (' .translate('cfg definition missed, but actually not used'). ')'); + break; + } + } + } + } else { + $conttp->setVariable('DEMON_CFG_OK', '' .translate('failed'). + ' (' .translate('cfg file not readable'). ')'); + } + $conttp->parse('configfileline'); + $i++; + } + // Check for unused config + if (($intCheck == 0) && is_array($arrConfig) && (count($arrConfig) != 0)) { + foreach ($arrConfig as $line) { + $intTest=0; + foreach ($arrConfigFiles as $elem) { + if (substr_count($line, $elem['file']) != 0) { + $intTest = 1; + } + } + if ($intTest == 0) { + if (substr_count($line, substr('cfg_dir=' .$strHostdir, 0, -1)) != 0) { + $intTest = 1; + } + if (substr_count($line, substr('cfg_dir=' .$strServicedir, 0, -1)) != 0) { + $intTest = 1; + } + //if (substr_count($line,substr("cfg_dir=".$strBasedir,0,-1)) != 0) $intTest = 1; + } + if ($intTest == 0) { + // Line colours + $strClassL = 'tdlb'; + $strClassM = 'tdmb'; + if ($i%2 == 1) { + $strClassL = 'tdld'; + $strClassM = 'tdmd'; + } + $conttp->setVariable('CLASS_L', $strClassL); + $conttp->setVariable('CLASS_M', $strClassM); + $conttp->setVariable('CONFIG_NAME', translate('Not used')); + $conttp->setVariable('ACTIVE_CONFIG_COUNT', '' .translate('failed'). ''); + $conttp->setVariable('DEMON_CFG_OK', '' .translate('unused - please delete!'). + ' (' .$line. ')'); + $conttp->parse('configfileline'); + $i++; + } + } + } + $conttp->parse('configdomain'); } // Messages -if ($strErrorMessage != "") $conttp->setVariable("ERRORMESSAGE",$strErrorMessage); -if ($strInfoMessage != "") $conttp->setVariable("INFOMESSAGE",$strInfoMessage); +if ($strErrorMessage != '') { + $conttp->setVariable('ERRORMESSAGE', $strErrorMessage); +} +if ($strInfoMessage != '') { + $conttp->setVariable('INFOMESSAGE', $strInfoMessage); +} // Check access rights for adding new objects -if ($myVisClass->checkAccGroup($prePageKey,'write') != 0) $conttp->setVariable("ADD_CONTROL","disabled=\"disabled\""); -$conttp->parse("support"); -$conttp->show("support"); +if ($myVisClass->checkAccountGroup($prePageKey, 'write') != 0) { + $conttp->setVariable('ADD_CONTROL', 'disabled="disabled"'); +} +$conttp->parse('support'); +$conttp->show('support'); // // Process footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/templatedefinitions.php b/admin/templatedefinitions.php index 9c2a9d9..1ad330e 100644 --- a/admin/templatedefinitions.php +++ b/admin/templatedefinitions.php @@ -5,245 +5,281 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Template definition list -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$preAccess = 1; -$preNoMain = 1; +$preAccess = 1; +$preNoMain = 1; // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); +require $preBasePath.'functions/prepend_adm.php'; // // Process post parameters // ======================= -$chkDataId = isset($_GET['dataId']) ? htmlspecialchars($_GET['dataId'], ENT_QUOTES, 'utf-8') : 0; -$chkMode = isset($_GET['mode']) ? htmlspecialchars($_GET['mode'], ENT_QUOTES, 'utf-8') : ""; -$chkKey = isset($_GET['key']) ? htmlspecialchars($_GET['key'], ENT_QUOTES, 'utf-8') : ""; -$chkDef = isset($_GET['def']) ? htmlspecialchars($_GET['def'], ENT_QUOTES, 'utf-8') : ""; -$chkType = isset($_GET['type']) ? htmlspecialchars($_GET['type'], ENT_QUOTES, 'utf-8') : ""; -if ($chkDataId == "") $chkDataId = 0; +$chkDataId = filter_input(INPUT_GET, 'dataId', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkMode = filter_input(INPUT_GET, 'mode', FILTER_SANITIZE_STRING); +$chkKey = filter_input(INPUT_GET, 'key', FILTER_SANITIZE_STRING); +$chkDef = filter_input(INPUT_GET, 'def', FILTER_SANITIZE_STRING); +$chkType = filter_input(INPUT_GET, 'type', FILTER_SANITIZE_STRING); +if ($chkDataId == '') { + $chkDataId = 0; +} if (get_magic_quotes_gpc() == 0) { - $chkDef = addslashes($chkDef); + $chkDef = addslashes($chkDef); } -$arrDefinition = explode("::",$chkDef); -if ($chkType == "") { - exit; +$arrDefinition = explode('::', $chkDef); +if ($chkType == '') { + exit; } -if ($chkType == "host") { - $chkLinkTab = "tbl_lnkHostToHosttemplate"; - $chkPreTab = "host"; +if ($chkType == 'host') { + $chkLinkTab = 'tbl_lnkHostToHosttemplate'; + $chkPreTab = 'host'; } -if ($chkType == "hosttemplate") { - $chkLinkTab = "tbl_lnkHosttemplateToHosttemplate"; - $chkPreTab = "host"; +if ($chkType == 'hosttemplate') { + $chkLinkTab = 'tbl_lnkHosttemplateToHosttemplate'; + $chkPreTab = 'host'; } -if ($chkType == "service") { - $chkLinkTab = "tbl_lnkServiceToServicetemplate"; - $chkPreTab = "service"; +if ($chkType == 'service') { + $chkLinkTab = 'tbl_lnkServiceToServicetemplate'; + $chkPreTab = 'service'; } -if ($chkType == "servicetemplate") { - $chkLinkTab = "tbl_lnkServicetemplateToServicetemplate"; - $chkPreTab = "service"; +if ($chkType == 'servicetemplate') { + $chkLinkTab = 'tbl_lnkServicetemplateToServicetemplate'; + $chkPreTab = 'service'; } -if ($chkType == "contact") { - $chkLinkTab = "tbl_lnkContactToContacttemplate"; - $chkPreTab = "contact"; +if ($chkType == 'contact') { + $chkLinkTab = 'tbl_lnkContactToContacttemplate'; + $chkPreTab = 'contact'; } -if ($chkType == "contacttemplate") { - $chkLinkTab = "tbl_lnkContacttemplateToContacttemplate"; - $chkPreTab = "contact"; +if ($chkType == 'contacttemplate') { + $chkLinkTab = 'tbl_lnkContacttemplateToContacttemplate'; + $chkPreTab = 'contact'; } // // Get data // ======== -if ($chkLinkTab != "") { - $strSQL = "SELECT * FROM `".$chkLinkTab."` WHERE `idMaster` = $chkDataId ORDER BY `idSort`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - // - // Store data to session - // ============================ - if ($chkMode == "") { - $_SESSION['templatedefinition'] = ""; - if ($booReturn && ($intDataCount != 0)) { - foreach ($arrDataLines AS $elem) { - if ($elem['idTable'] == 1) { - $strSQL2 = "SELECT `template_name` FROM `tbl_".$chkPreTab."template` WHERE `id` = ".$elem['idSlave']; - $strSQL3 = "SELECT `active` FROM `tbl_".$chkPreTab."template` WHERE `id` = ".$elem['idSlave']; - } else { - $strSQL2 = "SELECT `name` FROM `tbl_".$chkPreTab."` WHERE `id` = ".$elem['idSlave']; - $strSQL3 = "SELECT `active` FROM `tbl_".$chkPreTab."` WHERE `id` = ".$elem['idSlave']; - } - $arrTemp['idSlave'] = $elem['idSlave']; - $arrTemp['definition'] = addslashes($myDBClass->getFieldData($strSQL2)); - $arrTemp['idTable'] = $elem['idTable']; - $arrTemp['idSort'] = $elem['idSort']; - $arrTemp['active'] = $myDBClass->getFieldData($strSQL3)+0; - $arrTemp['status'] = 0; - $_SESSION['templatedefinition'][] = $arrTemp; - } - } - } +if ($chkLinkTab != '') { + $strSQL = 'SELECT * FROM `' .$chkLinkTab."` WHERE `idMaster` = $chkDataId ORDER BY `idSort`"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + // + // Store data to session + // ============================ + if ($chkMode == '') { + $_SESSION['templatedefinition'] = array(); + $arrTemp = array(); + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrDataLines as $elem) { + if ($elem['idTable'] == 1) { + $strSQL2 = 'SELECT `template_name` ' + . 'FROM `tbl_' .$chkPreTab. 'template` WHERE `id` = ' .$elem['idSlave']; + $strSQL3 = 'SELECT `active` FROM `tbl_' .$chkPreTab. 'template` WHERE `id` = ' .$elem['idSlave']; + } else { + $strSQL2 = 'SELECT `name` FROM `tbl_' .$chkPreTab. '` WHERE `id` = ' .$elem['idSlave']; + $strSQL3 = 'SELECT `active` FROM `tbl_' .$chkPreTab. '` WHERE `id` = ' .$elem['idSlave']; + } + $arrTemp['idSlave'] = $elem['idSlave']; + $arrTemp['definition'] = addslashes($myDBClass->getFieldData($strSQL2)); + $arrTemp['idTable'] = $elem['idTable']; + $arrTemp['idSort'] = $elem['idSort']; + $arrTemp['active'] = (int)$myDBClass->getFieldData($strSQL3); + $arrTemp['status'] = 0; + $_SESSION['templatedefinition'][] = $arrTemp; + } + } + } } // // Add mode // ======== -if ($chkMode == "add") { - if ($arrDefinition[1] == 1) { - $strSQL2 = "SELECT `template_name` FROM `tbl_".$chkPreTab."template` WHERE `id` = ".$arrDefinition[0]; - $strSQL3 = "SELECT `active` FROM `tbl_".$chkPreTab."template` WHERE `id` = ".$arrDefinition[0]; - } else { - $strSQL2 = "SELECT `name` FROM `tbl_".$chkPreTab."` WHERE `id` = ".$arrDefinition[0]; - $strSQL3 = "SELECT `active` FROM `tbl_".$chkPreTab."` WHERE `id` = ".$arrDefinition[0]; - } - if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition'])) { - $intCheck = 0; - foreach ($_SESSION['templatedefinition'] AS $key => $elem) { - if (($elem['idSlave'] == $arrDefinition[0]) && ($elem['idTable'] == $arrDefinition[1]) && ($elem['status'] == 0)) { - $intCheck = 1; - } - } - if ($intCheck == 0) { - $arrTemp['idSlave'] = $arrDefinition[0]; - $arrTemp['definition'] = addslashes($myDBClass->getFieldData($strSQL2)); - $arrTemp['idTable'] = $arrDefinition[1]; - $arrTemp['idSort'] = 0; - $arrTemp['status'] = 0; - $arrTemp['active'] = $myDBClass->getFieldData($strSQL3)+0; - $_SESSION['templatedefinition'][] = $arrTemp; - } - } else { - $arrTemp['idSlave'] = $arrDefinition[0]; - $arrTemp['definition'] = addslashes($myDBClass->getFieldData($strSQL2)); - $arrTemp['idTable'] = $arrDefinition[1]; - $arrTemp['idSort'] = 0; - $arrTemp['status'] = 0; - $arrTemp['active'] = $myDBClass->getFieldData($strSQL3)+0; - $_SESSION['templatedefinition'][] = $arrTemp; - } +if ($chkMode == 'add') { + $arrTemp = array(); + if ($arrDefinition[1] == 1) { + $strSQL2 = 'SELECT `template_name` FROM `tbl_' .$chkPreTab. 'template` WHERE `id` = ' .$arrDefinition[0]; + $strSQL3 = 'SELECT `active` FROM `tbl_' .$chkPreTab. 'template` WHERE `id` = ' .$arrDefinition[0]; + } else { + $strSQL2 = 'SELECT `name` FROM `tbl_' .$chkPreTab. '` WHERE `id` = ' .$arrDefinition[0]; + $strSQL3 = 'SELECT `active` FROM `tbl_' .$chkPreTab. '` WHERE `id` = ' .$arrDefinition[0]; + } + if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition'])) { + $intCheck = 0; + foreach ($_SESSION['templatedefinition'] as $key => $elem) { + if (($elem['idSlave'] == $arrDefinition[0]) && ($elem['idTable'] == $arrDefinition[1]) && + ($elem['status'] == 0)) { + $intCheck = 1; + } + } + if ($intCheck == 0) { + $arrTemp['idSlave'] = $arrDefinition[0]; + $arrTemp['definition'] = addslashes($myDBClass->getFieldData($strSQL2)); + $arrTemp['idTable'] = $arrDefinition[1]; + $arrTemp['idSort'] = 0; + $arrTemp['status'] = 0; + $arrTemp['active'] = (int)$myDBClass->getFieldData($strSQL3); + $_SESSION['templatedefinition'][] = $arrTemp; + } + } else { + $arrTemp['idSlave'] = $arrDefinition[0]; + $arrTemp['definition'] = addslashes($myDBClass->getFieldData($strSQL2)); + $arrTemp['idTable'] = $arrDefinition[1]; + $arrTemp['idSort'] = 0; + $arrTemp['status'] = 0; + $arrTemp['active'] = (int)$myDBClass->getFieldData($strSQL3); + $_SESSION['templatedefinition'][] = $arrTemp; + } } // // Deletion mode // ============= -if ($chkMode == "del") { - if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition'])) { - foreach ($_SESSION['templatedefinition'] AS $key => $elem) { - if (($elem['idSlave'] == $arrDefinition[0]) && ($elem['idTable'] == $arrDefinition[1]) && ($elem['status'] == 0)) { - $_SESSION['templatedefinition'][$key]['status'] = 1; - } - } - } +if ($chkMode == 'del' && isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition'])) { + foreach ($_SESSION['templatedefinition'] as $key => $elem) { + if (($elem['idSlave'] == $arrDefinition[0]) && ($elem['idTable'] == $arrDefinition[1]) && + ($elem['status'] == 0)) { + $_SESSION['templatedefinition'][$key]['status'] = 1; + } + } } // // Sort mode // ========= -if ($chkMode == "sortup") { - if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition'])) { - $arrTemp = ""; - $arrWait = ""; - $intNow = 0; - foreach ($_SESSION['templatedefinition'] AS $key => $elem) { - if ($key != ($chkKey-1)) { - $arrTemp[] = $elem; - if ($intNow == 1) { - $intNow = 0; - $arrTemp[] = $arrWait; - } - } else { - $arrWait = $elem; - $intNow = 1; - } - } - $_SESSION['templatedefinition'] = $arrTemp; - } +if ($chkMode == 'sortup') { + $chkKey = (int)$chkKey; + if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && + (count($_SESSION['templatedefinition']) > 1) && ($chkKey != 0)) { + $arrTemp = array(); + $arrWait = array(); + $intNow = 0; + foreach ($_SESSION['templatedefinition'] as $key => $elem) { + if ($key != ($chkKey-1)) { + $arrTemp[] = $elem; + if ($intNow == 1) { + $intNow = 0; + $arrTemp[] = $arrWait; + } + } else { + $arrWait = $elem; + $intNow = 1; + } + } + $_SESSION['templatedefinition'] = $arrTemp; + } } -if ($chkMode == "sortdown") { - if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition'])) { - $arrTemp = ""; - $arrWait = ""; - $intNow = 0; - foreach ($_SESSION['templatedefinition'] AS $key => $elem) { - if ($key != $chkKey) { - $arrTemp[] = $elem; - if ($intNow == 1) { - $intNow = 0; - $arrTemp[] = $arrWait; - } - } else { - $arrWait = $elem; - $intNow = 1; - } - } - $_SESSION['templatedefinition'] = $arrTemp; - } +if ($chkMode == 'sortdown') { + $chkKey = (int)$chkKey; + if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && + (count($_SESSION['templatedefinition']) > 1) && ($chkKey < (count($_SESSION['templatedefinition'])-1))) { + $arrTemp = array(); + $arrWait = array(); + $intNow = 0; + foreach ($_SESSION['templatedefinition'] as $key => $elem) { + if ($key != $chkKey) { + $arrTemp[] = $elem; + if ($intNow == 1) { + $intNow = 0; + $arrTemp[] = $arrWait; + } + } else { + $arrWait = $elem; + $intNow = 1; + } + } + $_SESSION['templatedefinition'] = $arrTemp; + } } // // Clean up data structure // ======================= if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition'])) { - $arrTemp = ""; - foreach ($_SESSION['templatedefinition'] AS $key => $elem) { - if ($elem['status'] == 0) { - $arrTemp[] = $elem; - } - } - $_SESSION['templatedefinition'] = $arrTemp; + $arrTemp = array(); + foreach ($_SESSION['templatedefinition'] as $key => $elem) { + if ($elem['status'] == 0) { + $arrTemp[] = $elem; + } + } + $_SESSION['templatedefinition'] = $arrTemp; } ?> - - - None - - - - - + + + None + + + + +
$elem) { - if ($elem['status'] == 0) { -?> - - - - +if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && + (count($_SESSION['templatedefinition']) != 0)) { + foreach ($_SESSION['templatedefinition'] as $key => $elem) { + if ($elem['status'] == 0) { + ?> + + + + - - - - + + + + -
<?php echo translate('Up');?>')" style="cursor:pointer"> <?php echo translate('Down'); ?>')" style="cursor:pointer"> <?php echo translate('Delete'); ?>')" style="cursor:pointer">
<?php
+                    echo translate('Up'); ?> <?php
+                    echo translate('Down'); ?> <?php
+                    echo translate('Delete'); ?>
 
 
- - \ No newline at end of file + + + diff --git a/admin/timedefinitions.php b/admin/timedefinitions.php index 221731a..cef0e42 100644 --- a/admin/timedefinitions.php +++ b/admin/timedefinitions.php @@ -5,179 +5,194 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Admin time definition list -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$preAccess = 1; -//$prePageId = 16; -$preNoMain = 1; +$preAccess = 1; +$preNoMain = 1; // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); +require $preBasePath.'functions/prepend_adm.php'; // // Process post parameters // ======================= -$chkTipId = (isset($_GET['tipId']) && ($_GET['tipId'] != "")) ? htmlspecialchars($_GET['tipId'], ENT_QUOTES, 'utf-8') : 0; -$chkMode = isset($_GET['mode']) ? htmlspecialchars($_GET['mode'], ENT_QUOTES, 'utf-8') : ""; -$chkDef = isset($_GET['def']) ? html_entity_decode($_GET['def']) : ""; -$chkRange = isset($_GET['range']) ? html_entity_decode($_GET['range']) : ""; -$chkId = isset($_GET['id']) ? htmlspecialchars($_GET['id'], ENT_QUOTES, 'utf-8') : ""; -$chkVersion = isset($_GET['version']) ? htmlspecialchars($_GET['version'], ENT_QUOTES, 'utf-8') : 0; +$chkTipId = filter_input(INPUT_GET, 'tipId', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkVersion = filter_input(INPUT_GET, 'version', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkMode = filter_input(INPUT_GET, 'mode', FILTER_SANITIZE_STRING); +$chkDef = filter_input(INPUT_GET, 'def', FILTER_SANITIZE_STRING); +$chkRange = filter_input(INPUT_GET, 'range', FILTER_SANITIZE_STRING); +$chkId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); if (get_magic_quotes_gpc() == 0) { - $chkDef = addslashes($chkDef); - $chkRange = addslashes($chkRange); + $chkDef = addslashes($chkDef); + $chkRange = addslashes($chkRange); } // // Get data // ======== -$strSQL = "SELECT * FROM `tbl_timedefinition` WHERE `tipId` = $chkTipId ORDER BY `definition`"; -$booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); +$strSQL = "SELECT * FROM `tbl_timedefinition` WHERE `tipId`=$chkTipId ORDER BY `definition`"; +$booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); // // Store data to session // ============================ -if ($chkMode == "") { - $_SESSION['timedefinition'] = ""; - if ($booReturn && ($intDataCount != 0)) { - foreach ($arrDataLines AS $elem) { - $arrTemp['id'] = $elem['id']; - $arrTemp['definition'] = addslashes($elem['definition']); - $arrTemp['range'] = addslashes($elem['range']); - $arrTemp['status'] = 0; - $_SESSION['timedefinition'][] = $arrTemp; - } - } +if ($chkMode == '') { + $_SESSION['timedefinition'] = array(); + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrDataLines as $elem) { + $arrTemp['id'] = $elem['id']; + $arrTemp['definition'] = addslashes($elem['definition']); + $arrTemp['range'] = addslashes($elem['range']); + $arrTemp['status'] = 0; + $_SESSION['timedefinition'][] = $arrTemp; + } + } } // // Add mode // ========= -if ($chkMode == "add") { - if (isset($_SESSION['timedefinition']) && is_array($_SESSION['timedefinition'])) { - $intCheck = 0; - foreach ($_SESSION['timedefinition'] AS $key => $elem) { - if (($elem['definition'] == $chkDef) && ($elem['status'] == 0)) { - $_SESSION['timedefinition'][$key]['definition'] = $chkDef; - $_SESSION['timedefinition'][$key]['range'] = $chkRange; - $intCheck = 1; - } - } - if ($intCheck == 0) { - $arrTemp['id'] = 0; - $arrTemp['definition'] = $chkDef; - $arrTemp['range'] = $chkRange; - $arrTemp['status'] = 0; - $_SESSION['timedefinition'][] = $arrTemp; - } - } else { - $arrTemp['id'] = 0; - $arrTemp['definition'] = $chkDef; - $arrTemp['range'] = $chkRange; - $arrTemp['status'] = 0; - $_SESSION['timedefinition'][] = $arrTemp; - } +if ($chkMode == 'add') { + if (isset($_SESSION['timedefinition']) && is_array($_SESSION['timedefinition'])) { + $intCheck = 0; + foreach ($_SESSION['timedefinition'] as $key => $elem) { + if (($elem['definition'] == $chkDef) && ($elem['status'] == 0)) { + $_SESSION['timedefinition'][$key]['definition'] = $chkDef; + $_SESSION['timedefinition'][$key]['range'] = $chkRange; + $intCheck = 1; + } + } + if ($intCheck == 0) { + $arrTemp['id'] = 0; + $arrTemp['definition'] = $chkDef; + $arrTemp['range'] = $chkRange; + $arrTemp['status'] = 0; + $_SESSION['timedefinition'][] = $arrTemp; + } + } else { + $arrTemp['id'] = 0; + $arrTemp['definition'] = $chkDef; + $arrTemp['range'] = $chkRange; + $arrTemp['status'] = 0; + $_SESSION['timedefinition'][] = $arrTemp; + } } // // Deletion mode // ============= -if ($chkMode == "del") { - if (isset($_SESSION['timedefinition']) && is_array($_SESSION['timedefinition'])) { - foreach ($_SESSION['timedefinition'] AS $key => $elem) { - if (($elem['definition'] == $chkDef) && ($elem['status'] == 0)) { - $_SESSION['timedefinition'][$key]['status'] = 1; - } - } - } +if ($chkMode == 'del' && isset($_SESSION['timedefinition']) && is_array($_SESSION['timedefinition'])) { + foreach ($_SESSION['timedefinition'] as $key => $elem) { + if (($elem['definition'] == $chkDef) && ($elem['status'] == 0)) { + $_SESSION['timedefinition'][$key]['status'] = 1; + } + } } ?> - - - None - - - - - - + } + function doDel(key) { + document.location.href = "admin/timedefinitions.php?tipId=&mode=del&def="+key; + } + //--> + + + + +
- - - - - + + + + + - - - - - + + + + + -
<?php echo translate('Modify');?> <?php echo translate('Delete');?>
<?php
+                    echo translate('Modify'); ?> <?php
+                    echo translate('Delete'); ?>
  
  
- + + \ No newline at end of file diff --git a/admin/timeperiods.php b/admin/timeperiods.php index 927aa12..bd4b682 100644 --- a/admin/timeperiods.php +++ b/admin/timeperiods.php @@ -5,197 +5,300 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Timeperiod definitions -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 16; -$preContent = "admin/timeperiods.tpl.htm"; -$preSearchSession = 'timeperiod'; -$preTableName = 'tbl_timeperiod'; -$preKeyField = 'timeperiod_name'; -$preAccess = 1; -$preFieldvars = 1; +$prePageId = 16; +$preContent = 'admin/timeperiods.htm.tpl'; +$preListTpl = 'admin/datalist.htm.tpl'; +$preSearchSession = 'timeperiod'; +$preTableName = 'tbl_timeperiod'; +$preKeyField = 'timeperiod_name'; +$preAccess = 1; +$preFieldvars = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); -// +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `exclude`=$intMselValue1, `use_template`=$intMselValue2, - `name`='$chkTfValue3', $preSQLCommon1"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && ($chkTfValue2 != "")) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($chkModus == "insert") $chkDataId = $intInsertId; - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $myDataClass->updateStatusTable($preTableName); - if ($chkModus == "insert") $myDataClass->writeLog(translate('New time period inserted:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('Time period modified:')." ".$chkTfValue1); - // - // Insert/update relations - // ======================= - if ($chkModus == "insert") { - if ($intMselValue1 != 0) $intRet1 = $myDataClass->dataInsertRelation("tbl_lnkTimeperiodToTimeperiod",$chkDataId,$chkMselValue1); - if (isset($intRet1) && ($intRet1 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) $intRet2 = $myDataClass->dataInsertRelation("tbl_lnkTimeperiodToTimeperiodUse",$chkDataId,$chkMselValue2); - if (isset($intRet2) && ($intRet2 != 0)) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else if ($chkModus == "modify") { - if ($intMselValue1 != 0) { - $intRet1 = $myDataClass->dataUpdateRelation("tbl_lnkTimeperiodToTimeperiod",$chkDataId,$chkMselValue1); - } else { - $intRet1 = $myDataClass->dataDeleteRelation("tbl_lnkTimeperiodToTimeperiod",$chkDataId); - } - if ($intRet1 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intMselValue2 != 0) { - $intRet2 = $myDataClass->dataUpdateRelation("tbl_lnkTimeperiodToTimeperiodUse",$chkDataId,$chkMselValue2); - } else { - $intRet2 = $myDataClass->dataDeleteRelation("tbl_lnkTimeperiodToTimeperiodUse",$chkDataId); - } - if ($intRet2 != 0) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (($intRet1 + $intRet2) != 0) $strInfoMessage = ""; - // - // Insert/update time defintions - // ============================= - if ($chkModus == "modify") { - $strSQL = "DELETE FROM `tbl_timedefinition` WHERE `tipId`=$chkDataId"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - if (isset($_SESSION['timedefinition']) && is_array($_SESSION['timedefinition']) && (count($_SESSION['timedefinition']) != 0)) { - foreach($_SESSION['timedefinition'] AS $elem) { - if ($elem['status'] == 0) { - if ($elem['definition'] != "use") { - $elem['range'] = str_replace(" ","",$elem['range']); - } - $strSQL = "INSERT INTO `tbl_timedefinition` (`tipId`,`definition`,`range`,`last_modified`) - VALUES ($chkDataId,'".$elem['definition']."','".$elem['range']."',now())"; - $booReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($booReturn == false) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } - } - } - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', `exclude`=$intMselValue1, " + . "`use_template`=$intMselValue2, `name`='$chkTfValue3', $preSQLCommon1"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && ($chkTfValue2 != '')) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($chkModus == 'insert') { + $chkDataId = $intInsertId; + } + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $myDataClass->updateStatusTable($preTableName); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New time period inserted:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('Time period modified:'). ' ' .$chkTfValue1); + } + // + // Insert/update relations + // ======================= + if ($chkModus == 'insert') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataInsertRelation( + 'tbl_lnkTimeperiodToTimeperiod', + $chkDataId, + $chkMselValue1 + ); + } + if (isset($intRet1) && ($intRet1 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataInsertRelation( + 'tbl_lnkTimeperiodToTimeperiodUse', + $chkDataId, + $chkMselValue2 + ); + } + if (isset($intRet2) && ($intRet2 != 0)) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } elseif ($chkModus == 'modify') { + if ($intMselValue1 != 0) { + $intRet1 = $myDataClass->dataUpdateRelation( + 'tbl_lnkTimeperiodToTimeperiod', + $chkDataId, + $chkMselValue1 + ); + } else { + $intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkTimeperiodToTimeperiod', $chkDataId); + } + if ($intRet1 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intMselValue2 != 0) { + $intRet2 = $myDataClass->dataUpdateRelation( + 'tbl_lnkTimeperiodToTimeperiodUse', + $chkDataId, + $chkMselValue2 + ); + } else { + $intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkTimeperiodToTimeperiodUse', $chkDataId); + } + if ($intRet2 != 0) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (($intRet1 + $intRet2) != 0) { + $strInfoMessage = ''; + } + // + // Insert/update time defintions + // ============================= + if ($chkModus == 'modify') { + $strSQL = "DELETE FROM `tbl_timedefinition` WHERE `tipId`=$chkDataId"; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + if (isset($_SESSION['timedefinition']) && is_array($_SESSION['timedefinition']) && + (count($_SESSION['timedefinition']) != 0)) { + foreach ($_SESSION['timedefinition'] as $elem) { + if ($elem['status'] == 0) { + if ($elem['definition'] != 'use') { + $elem['range'] = str_replace(' ', '', $elem['range']); + } + $strSQL = 'INSERT INTO `tbl_timedefinition` (`tipId`,`definition`,`range`, ' + . "`last_modified`) VALUES ($chkDataId,'".$elem['definition']."'," + . "'".$elem['range']."',now())"; + $booReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($booReturn == false) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + } + } + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; // // Get date/time of last database and config file manipulation // =========================================================== -$intReturn = $myConfigClass->lastModifiedFile($preTableName,$arrTimeData,$strTimeInfoString); -if ($intReturn != 0) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('Timeperiod definitions')); -$conttp->parse("header"); -$conttp->show("header"); +$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString); +if ($intReturn != 0) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); +} // // Singe data form // =============== -if ($chkModus == "add") { - // Do not show modified time list - $intNoTime = 1; - // Process exclude selection fields - if (isset($arrModifyData['exclude'])) {$intFieldId = $arrModifyData['exclude'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti($preTableName,'name','excludes','tbl_lnkTimeperiodToTimeperiod',0,$intFieldId,$chkListId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process include selection fields - if (isset($arrModifyData['use_template'])) {$intFieldId = $arrModifyData['use_template'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectMulti($preTableName,'name','uses','tbl_lnkTimeperiodToTimeperiodUse',0,$intFieldId,$chkListId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process acces group selection field - if (isset($arrModifyData['access_group'])) {$intFieldId = $arrModifyData['access_group'];} else {$intFieldId = 0;} - $intReturn = $myVisClass->parseSelectSimple('tbl_group','groupname','acc_group',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - if ($intDataWarning == 1) $conttp->setVariable("WARNING",$strDBWarning."
".translate('Saving not possible!')); - if ($intVersion != 3) $conttp->setVariable("VERSION_20_VALUE_MUST","mselValue1,"); - $conttp->setVariable("LANG_INSERT_ALL_TIMERANGE",translate('Please insert a time definition and a time range')); - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Check relation information to find out locked configuration datasets - $intLocked = $myDataClass->infoRelation($preTableName,$arrModifyData['id'],$preKeyField); - $myVisClass->processMessage($myDataClass->strInfoMessage,$strRelMessage); - $strInfo = "
".translate('Entry cannot be activated because it is used by another configuration').":"; - $strInfo .= "
".$strRelMessage.""; - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,$intLocked,$strInfo); - $conttp->setVariable("TIP_ID",$arrModifyData['id']); - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + $conttp->setVariable('TITLE', translate('Time period definitions (timeperiods.cfg)')); + // Do not show modified time list + $intNoTime = 1; + // Process exclude selection fields + if (isset($arrModifyData['exclude'])) { + $intFieldId = $arrModifyData['exclude']; + } else { + $intFieldId = 0; + } + $intReturn1 = $myVisClass->parseSelectMulti( + $preTableName, + 'name', + 'excludes', + 'tbl_lnkTimeperiodToTimeperiod', + 0, + $intFieldId, + $chkListId + ); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process include selection fields + if (isset($arrModifyData['use_template'])) { + $intFieldId = $arrModifyData['use_template']; + } else { + $intFieldId = 0; + } + $intReturn2 = $myVisClass->parseSelectMulti( + $preTableName, + 'name', + 'uses', + 'tbl_lnkTimeperiodToTimeperiodUse', + 0, + $intFieldId, + $chkListId + ); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process acces group selection field + if (isset($arrModifyData['access_group'])) { + $intFieldId = $arrModifyData['access_group']; + } else { + $intFieldId = 0; + } + $intReturn3 = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId); + if ($intReturn3 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + if ($intDataWarning == 1) { + $conttp->setVariable('WARNING', $strDBWarning. '
' .translate('Saving not possible!')); + } + if ($intVersion < 3) { + $conttp->setVariable('VERSION_20_VALUE_MUST', 'mselValue1,'); + } + $conttp->setVariable('LANG_INSERT_ALL_TIMERANGE', translate('Please insert a time definition and a time range')); + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Check relation information to find out locked configuration datasets + $intLocked = $myDataClass->infoRelation($preTableName, $arrModifyData['id'], $preKeyField); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strRelMessage); + $strInfo = '
' .translate('Entry cannot be activated because it is used by ' + . 'another configuration'). ':'; + $strInfo .= '
' .$strRelMessage. ''; + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo); + $conttp->setVariable('TIP_ID', $arrModifyData['id']); + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // List view // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Time period')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Process filter string - if ($_SESSION['search'][$preSearchSession] != "") { - $strSearchTxt = $_SESSION['search'][$preSearchSession]; - $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' OR `name` LIKE '%".$strSearchTxt."%')"; - } - // Row sorting - $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `config_id`, `access_group` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere - AND `access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'alias'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('Time period definitions (timeperiods.cfg)')); + $mastertp->setVariable('FIELD_1', translate('Time period')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Process filter string + if ($_SESSION['search'][$preSearchSession] != '') { + $strSearchTxt = $_SESSION['search'][$preSearchSession]; + $strSearchWhere = "AND (`$preKeyField` LIKE '%".$strSearchTxt."%' OR `alias` LIKE '%".$strSearchTxt."%' " + . "OR `name` LIKE '%".$strSearchTxt."%')"; + } + // Row sorting + $strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `config_id`, `alias` $hidSortDir"; + } + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere " + . "AND `access_group` IN ($strAccess)"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `register`, `active`, `config_id`, `access_group` " + . "FROM `$preTableName` WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess) " + . "$strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'alias'); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime); +$myContentClass->showMessages( + $mastertp, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime +); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/tools.php b/admin/tools.php index da7fdc2..28c6ca1 100644 --- a/admin/tools.php +++ b/admin/tools.php @@ -5,39 +5,41 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Tools overview -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 6; -$preContent = "admin/mainpages.tpl.htm"; +$prePageId = 6; +$preContent = 'admin/mainpages.htm.tpl'; // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); +require $preBasePath.'functions/prepend_adm.php'; // // Include content // =============== -$conttp->setVariable("TITLE",translate('Different tools')); -$conttp->parse("header"); -$conttp->show("header"); -$conttp->setVariable("DESC",translate('Useful functions for data import, main configuration, daemon control and so on.')); -$conttp->parse("main"); -$conttp->show("main"); +$conttp->setVariable('TITLE', translate('Different tools')); +$conttp->setVariable('DESC', translate('Useful functions for data import, main configuration, daemon control, etc.')); +$conttp->parse('main'); +$conttp->show('main'); // // Include Footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/user.php b/admin/user.php index 2e104d4..497cf73 100644 --- a/admin/user.php +++ b/admin/user.php @@ -5,171 +5,208 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : User administration -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 32; -$preContent = "admin/user.tpl.htm"; -$preSearchSession = 'user'; -$preTableName = 'tbl_user'; -$preKeyField = 'username'; -$preAccess = 1; -$preFieldvars = 1; -//$preNoAccessGrp = 1; +$prePageId = 32; +$preContent = 'admin/user.htm.tpl'; +$preListTpl = 'admin/datalist_common.htm.tpl'; +$preSearchSession = 'user'; +$preTableName = 'tbl_user'; +$preKeyField = 'username'; +$preAccess = 1; +$preFieldvars = 1; +$preNoAccessGrp = 1; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); -// +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; +// // Add or modify data // ================== -if ((($chkModus == "insert") || ($chkModus == "modify")) && ($intGlobalWriteAccess == 0)) { - // Check password - if ((($chkTfValue3 === $chkTfValue4) && (strlen($chkTfValue3) > 5)) || (($chkModus == "modify") && ($chkTfValue3 == ""))) { - if ($chkTfValue3 == "") {$strPasswd = "";} else {$strPasswd = "`password`=MD5('$chkTfValue3'),";} - // Grant admin rights - if ($chkTfValue5 == "Admin") { - $chkTfValue1 = "Admin"; - $chkActive = "1"; - $chkChbValue1 = "1"; - } - $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', $strPasswd `admin_enable`='$chkChbValue1', - `wsauth`='$chkChbValue2', `active`='$chkActive', `language`='$chkSelValue1', `domain`='$chkSelValue2', `last_modified`=NOW()"; - if ($chkModus == "insert") { - $strSQL = "INSERT INTO ".$strSQLx; - } else { - $strSQL = "UPDATE ".$strSQLx." WHERE `id`=$chkDataId"; - } - if ($intWriteAccessId == 0) { - if (($chkTfValue1 != "") && ($chkTfValue2 != "")) { - $intReturn = $myDataClass->dataInsert($strSQL,$intInsertId); - if ($intReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - if ($chkModus == "insert") $myDataClass->writeLog(translate('A new user added:')." ".$chkTfValue1); - if ($chkModus == "modify") $myDataClass->writeLog(translate('User modified:')." ".$chkTfValue1); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! Not all necessary data filled in!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Database entry failed! No write access!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Password too short or password fields unequally!'),$strErrorMessage); - } - $chkModus = "display"; +if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) { + // Check password + if ((($chkTfValue3 === $chkTfValue4) && (strlen($chkTfValue3) > 5)) || + (($chkModus == 'modify') && ($chkTfValue3 == ''))) { + if ($chkTfValue3 == '') { + $strPasswd = ''; + } else { + $strPasswd = "`password`=MD5('$chkTfValue3'),"; + } + // Grant admin rights + if ($chkTfValue5 == 'Admin') { + $chkTfValue1 = 'Admin'; + $chkActive = '1'; + $chkChbValue1 = '1'; + } + $strSQLx = "`$preTableName` SET `$preKeyField`='$chkTfValue1', `alias`='$chkTfValue2', $strPasswd " + . "`admin_enable`='$chkChbValue1', `wsauth`='$chkChbValue2', `active`='$chkActive', " + . "`language`='$chkSelValue1', `domain`='$chkSelValue2', `last_modified`=NOW()"; + if ($chkModus == 'insert') { + $strSQL = 'INSERT INTO ' .$strSQLx; + } else { + $strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId; + } + if ($intWriteAccessId == 0) { + if (($chkTfValue1 != '') && ($chkTfValue2 != '')) { + $intReturn = $myDataClass->dataInsert($strSQL, $intInsertId); + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + if ($chkModus == 'insert') { + $myDataClass->writeLog(translate('New user added:'). ' ' .$chkTfValue1); + } + if ($chkModus == 'modify') { + $myDataClass->writeLog(translate('User modified:'). ' ' .$chkTfValue1); + } + } + } else { + $myVisClass->processMessage( + translate('Database entry failed! Not all necessary data filled in!'), + $strErrorMessage + ); + } + } else { + $myVisClass->processMessage(translate('Database entry failed! No write access!'), $strErrorMessage); + } + } else { + $myVisClass->processMessage(translate('Password too short or password fields do not match!'), $strErrorMessage); + } + $chkModus = 'display'; +} +if ($chkModus != 'add') { + $chkModus = 'display'; } -if ($chkModus != "add") $chkModus = "display"; -// -// Start content -// ============= -$conttp->setVariable("TITLE",translate('User administration')); -$conttp->parse("header"); -$conttp->show("header"); // // Singe data form // =============== -if ($chkModus == "add") { - // Process domain selection field - if (isset($arrModifyData['domain'])) {$intFieldId = $arrModifyData['domain'];} else {$intFieldId = 1;} - $intReturn = $myVisClass->parseSelectSimple('tbl_datadomain','domain','std_domain',0,$intFieldId,0); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Process language selection field - if (isset($arrModifyData['language'])) {$intFieldId = $arrModifyData['language'];} else {$intFieldId = 0;} - if ($intFieldId == 0) { - $intFieldId = $myDBClass->getFieldData("SELECT `id` FROM `tbl_language` WHERE `locale`='".$_SESSION['SETS']['data']['locale']."'")+0; - } - $intReturn = $myVisClass->parseSelectSimple('tbl_language','language','language_name',0,$intFieldId); - if ($intReturn != 0) $myVisClass->processMessage($myVisClass->strErrorMessage,$strErrorMessage); - // Initial add/modify form definitions - $myContentClass->addFormInit($conttp); - $conttp->setVariable("WSAUTH_DISABLE","disabled"); - $conttp->setVariable("FILL_ALLFIELDS",translate('Please fill in all fields marked with an *')); - $conttp->setVariable("FILL_ILLEGALCHARS",translate('The following field contains not permitted characters:')); - $conttp->setVariable("FILL_PASSWD_NOT_EQUAL",translate('The passwords are not equal!')); - $conttp->setVariable("FILL_PASSWORD",translate('Please fill in the password')); - $conttp->setVariable("FILL_PWDSHORT",translate('The password is too short - use at least 6 characters!')); - $conttp->setVariable("LANG_WEBSERVER_AUTH",translate('Webserver authentification')); - $conttp->setVariable("PASSWORD_MUST","class=\"inpmust\""); - $conttp->setVariable("PASSWORD_MUST_STAR","*"); - // If webserver authetification is enabled - show option field - if (isset($SETS['security']['wsauth']) && ($SETS['security']['wsauth'] == 1)) { - $conttp->setVariable("WSAUTH_DISABLE",""); - } - // Insert data from database in "modify" mode - if (isset($arrModifyData) && ($chkSelModify == "modify")) { - // Process data - $myContentClass->addInsertData($conttp,$arrModifyData,0,''); - // Webserver authentification - $conttp->setVariable("WSAUTH_CHECKED",""); - if ($arrModifyData['wsauth'] == 1) $conttp->setVariable("WSAUTH_CHECKED","checked"); - // Object based group administration - $conttp->setVariable("ADMINENABLE_CHECKED",""); - if ($arrModifyData['admin_enable'] == 1) $conttp->setVariable("ADMINENABLE_CHECKED","checked"); - // Admin rules - if ($arrModifyData[$preKeyField] == "Admin") { - $conttp->setVariable("NAME_DISABLE","disabled"); - $conttp->setVariable("ACT_DISABLE","disabled"); - $conttp->setVariable("WSAUTH_DISABLE","disabled"); - $conttp->setVariable("ADMINENABLE_DISABLE","disabled"); - $conttp->setVariable("ADMINENABLE_CHECKED","checked"); - } - $conttp->setVariable("PASSWORD_MUST",""); - $conttp->setVariable("PASSWORD_MUST_STAR",""); - } - $conttp->parse("datainsert"); - $conttp->show("datainsert"); +if ($chkModus == 'add') { + // Process domain selection field + if (isset($arrModifyData['domain'])) { + $intFieldId = $arrModifyData['domain']; + } else { + $intFieldId = 1; + } + $intReturn1 = $myVisClass->parseSelectSimple('tbl_datadomain', 'domain', 'std_domain', 0, $intFieldId, 0); + if ($intReturn1 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Process language selection field + if (isset($arrModifyData['language'])) { + $intFieldId = $arrModifyData['language']; + } else { + $intFieldId = 0; + } + if ($intFieldId == 0) { + $intFieldId = $myDBClass->getFieldData('SELECT `id` FROM `tbl_language` ' + . "WHERE `locale`='".$_SESSION['SETS']['data']['locale']."'"); + $intFieldId = (int)$intFieldId; + } + $intReturn2 = $myVisClass->parseSelectSimple('tbl_language', 'language', 'language_name', 0, $intFieldId); + if ($intReturn2 != 0) { + $myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage); + } + // Initial add/modify form definitions + $myContentClass->addFormInit($conttp); + $conttp->setVariable('TITLE', translate('User administration')); + $conttp->setVariable('WSAUTH_DISABLE', 'disabled'); + $conttp->setVariable('FILL_ALLFIELDS', translate('Please fill in all fields marked with an *')); + $conttp->setVariable('FILL_ILLEGALCHARS', translate('The following field contains illegal characters:')); + $conttp->setVariable('FILL_PASSWD_NOT_EQUAL', translate('The passwords do not match!')); + $conttp->setVariable('FILL_PASSWORD', translate('Please fill in the password')); + $conttp->setVariable('FILL_PWDSHORT', translate('The password is too short - use at least 6 characters!')); + $conttp->setVariable('LANG_WEBSERVER_AUTH', translate('Webserver authentification')); + $conttp->setVariable('PASSWORD_MUST', 'class="inpmust"'); + $conttp->setVariable('PASSWORD_MUST_STAR', '*'); + // If webserver authetification is enabled - show option field + if (isset($SETS['security']['wsauth']) && ($SETS['security']['wsauth'] == 1)) { + $conttp->setVariable('WSAUTH_DISABLE', ''); + } + // Insert data from database in "modify" mode + if (isset($arrModifyData) && ($chkSelModify == 'modify')) { + // Process data + $myContentClass->addInsertData($conttp, $arrModifyData, 0, ''); + // Webserver authentification + $conttp->setVariable('WSAUTH_CHECKED', ''); + if ($arrModifyData['wsauth'] == 1) { + $conttp->setVariable('WSAUTH_CHECKED', 'checked'); + } + // Object based group administration + $conttp->setVariable('ADMINENABLE_CHECKED', ''); + if ($arrModifyData['admin_enable'] == 1) { + $conttp->setVariable('ADMINENABLE_CHECKED', 'checked'); + } + // Admin rules + if ($arrModifyData[$preKeyField] == 'Admin') { + $conttp->setVariable('NAME_DISABLE', 'disabled'); + $conttp->setVariable('ACT_DISABLE', 'disabled'); + $conttp->setVariable('WSAUTH_DISABLE', 'disabled'); + $conttp->setVariable('ADMINENABLE_DISABLE', 'disabled'); + $conttp->setVariable('ADMINENABLE_CHECKED', 'checked'); + } + $conttp->setVariable('PASSWORD_MUST', ''); + $conttp->setVariable('PASSWORD_MUST_STAR', ''); + } + $conttp->parse('datainsert'); + $conttp->show('datainsert'); } // // Data table // ========== -if ($chkModus == "display") { - // Initial list view definitions - $myContentClass->listViewInit($mastertp); - $mastertp->setVariable("FIELD_1",translate('Username')); - $mastertp->setVariable("FIELD_2",translate('Description')); - // Row sorting - $strOrderString = "ORDER BY `$preKeyField` $hidSortDir"; - if ($hidSortBy == 2) $strOrderString = "ORDER BY `alias` $hidSortDir"; - // Count datasets - $strSQL = "SELECT count(*) AS `number` FROM `$preTableName`"; - $booReturn = $myDBClass->getSingleDataset($strSQL,$arrDataLinesCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intLineCount = (int)$arrDataLinesCount['number']; - if ($intLineCount < $chkLimit) $chkLimit = 0; - } - // Get datasets - $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `active`, `nodelete` - FROM `$preTableName` $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } - // Process data - $myContentClass->listData($mastertp,$arrDataLines,$intDataCount,$intLineCount,$preKeyField,'alias'); +if ($chkModus == 'display') { + // Initial list view definitions + $myContentClass->listViewInit($mastertp); + $mastertp->setVariable('TITLE', translate('User administration')); + $mastertp->setVariable('FIELD_1', translate('Username')); + $mastertp->setVariable('FIELD_2', translate('Description')); + // Row sorting + $strOrderString = "ORDER BY `$preKeyField` $hidSortDir"; + if ($hidSortBy == 2) { + $strOrderString = "ORDER BY `alias` $hidSortDir"; + } + // Count datasets + $strSQL = "SELECT count(*) AS `number` FROM `$preTableName`"; + $booReturn1 = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount); + if ($booReturn1 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intLineCount = (int)$arrDataLinesCount['number']; + if ($intLineCount < $chkLimit) { + $chkLimit = 0; + } + } + // Get datasets + $strSQL = "SELECT `id`, `$preKeyField`, `alias`, `active`, `nodelete` " + . "FROM `$preTableName` $strOrderString LIMIT $chkLimit,".$SETS['common']['pagelines']; + $booReturn2 = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn2 == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + // Process data + $myContentClass->listData($mastertp, $arrDataLines, $intDataCount, $intLineCount, $preKeyField, 'alias'); } // Show messages -$myContentClass->showMessages($mastertp,$strErrorMessage,$strInfoMessage,$strConsistMessage,'','',1); +$myContentClass->showMessages($mastertp, $strErrorMessage, $strInfoMessage, $strConsistMessage, array(), '', 1); // // Process footer // ============== -$myContentClass->showFooter($maintp,$setFileVersion); -?> \ No newline at end of file +$myContentClass->showFooter($maintp, $setFileVersion); diff --git a/admin/variabledefinitions.php b/admin/variabledefinitions.php index 9679e33..6d20378 100644 --- a/admin/variabledefinitions.php +++ b/admin/variabledefinitions.php @@ -5,136 +5,151 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Variable definition list -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$preAccess = 1; -$preNoMain = 1; +$preAccess = 1; +$preNoMain = 1; // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); +require $preBasePath.'functions/prepend_adm.php'; // // Process post parameters // ======================= -$chkDataId = isset($_GET['dataId']) ? htmlspecialchars($_GET['dataId'], ENT_QUOTES, 'utf-8') : 0; -$chkMode = isset($_GET['mode']) ? htmlspecialchars($_GET['mode'], ENT_QUOTES, 'utf-8') : ""; -$chkDef = isset($_GET['def']) ? $_GET['def'] : ""; -$chkRange = isset($_GET['range']) ? $_GET['range'] : ""; -$chkId = isset($_GET['id']) ? htmlspecialchars($_GET['id'], ENT_QUOTES, 'utf-8') : ""; -$chkVersion = isset($_GET['version']) ? htmlspecialchars($_GET['version'], ENT_QUOTES, 'utf-8') : 0; -$chkLinkTab = isset($_GET['linktab']) ? htmlspecialchars($_GET['linktab'], ENT_QUOTES, 'utf-8') : ""; +$chkDataId = filter_input(INPUT_GET, 'dataId', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkMode = filter_input(INPUT_GET, 'mode', FILTER_SANITIZE_STRING); +$chkDef = filter_input(INPUT_GET, 'def', FILTER_SANITIZE_STRING); +$chkRange = filter_input(INPUT_GET, 'range', FILTER_SANITIZE_STRING); +$chkLinkTab = filter_input(INPUT_GET, 'linktab', FILTER_SANITIZE_STRING); if (get_magic_quotes_gpc() == 0) { - $chkDef = addslashes($chkDef); - $chkRange = addslashes($chkRange); + $chkDef = addslashes($chkDef); + $chkRange = addslashes($chkRange); } // // Get data // ======== -if ($chkLinkTab != "") { - $strSQL = "SELECT * FROM `tbl_variabledefinition` LEFT JOIN `".$chkLinkTab."` ON `id`=`idSlave` WHERE `idMaster`=$chkDataId ORDER BY `name`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - // - // Store data to session - // ============================ - if ($chkMode == "") { - $_SESSION['variabledefinition'] = ""; - if ($booReturn && ($intDataCount != 0)) { - foreach ($arrDataLines AS $elem) { - $arrTemp['id'] = $elem['id']; - $arrTemp['definition'] = addslashes($elem['name']); - $arrTemp['range'] = addslashes($elem['value']); - $arrTemp['status'] = 0; - $_SESSION['variabledefinition'][] = $arrTemp; - } - } - } +if ($chkLinkTab != '') { + $strSQL = 'SELECT * FROM `tbl_variabledefinition` LEFT JOIN `' .$chkLinkTab. '` ON `id`=`idSlave` ' . + "WHERE `idMaster`=$chkDataId ORDER BY `name`"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + // + // Store data to session + // ============================ + if ($chkMode == '') { + $arrTemp = array(); + $_SESSION['variabledefinition'] = array(); + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrDataLines as $elem) { + $arrTemp['id'] = $elem['id']; + $arrTemp['definition'] = addslashes($elem['name']); + $arrTemp['range'] = addslashes($elem['value']); + $arrTemp['status'] = 0; + $_SESSION['variabledefinition'][] = $arrTemp; + } + } + } } // // Add mode // ======== -if ($chkMode == "add") { - if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition'])) { - $intCheck = 0; - foreach ($_SESSION['variabledefinition'] AS $key => $elem) { - if (($elem['definition'] == $chkDef) && ($elem['status'] == 0)) { - $_SESSION['variabledefinition'][$key]['definition'] = $chkDef; - $_SESSION['variabledefinition'][$key]['range'] = $chkRange; - $intCheck = 1; - } - } - if ($intCheck == 0) { - $arrTemp['id'] = 0; - $arrTemp['definition'] = $chkDef; - $arrTemp['range'] = $chkRange; - $arrTemp['status'] = 0; - $_SESSION['variabledefinition'][] = $arrTemp; - } - } else { - $arrTemp['id'] = 0; - $arrTemp['definition'] = $chkDef; - $arrTemp['range'] = $chkRange; - $arrTemp['status'] = 0; - $_SESSION['variabledefinition'][] = $arrTemp; - } +if ($chkMode == 'add') { + $arrTemp = array(); + if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition'])) { + $intCheck = 0; + foreach ($_SESSION['variabledefinition'] as $key => $elem) { + if (($elem['definition'] == $chkDef) && ($elem['status'] == 0)) { + $_SESSION['variabledefinition'][$key]['definition'] = $chkDef; + $_SESSION['variabledefinition'][$key]['range'] = $chkRange; + $intCheck = 1; + } + } + if ($intCheck == 0) { + $arrTemp['id'] = 0; + $arrTemp['definition'] = $chkDef; + $arrTemp['range'] = $chkRange; + $arrTemp['status'] = 0; + $_SESSION['variabledefinition'][] = $arrTemp; + } + } else { + $arrTemp['id'] = 0; + $arrTemp['definition'] = $chkDef; + $arrTemp['range'] = $chkRange; + $arrTemp['status'] = 0; + $_SESSION['variabledefinition'][] = $arrTemp; + } } // // Deletion mode // ============= -if ($chkMode == "del") { - if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition'])) { - foreach ($_SESSION['variabledefinition'] AS $key => $elem) { - if (($elem['definition'] == $chkDef) && ($elem['status'] == 0)) { - $_SESSION['variabledefinition'][$key]['status'] = 1; - } - } - } +if ($chkMode == 'del' && isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition'])) { + foreach ($_SESSION['variabledefinition'] as $key => $elem) { + if (($elem['definition'] == $chkDef) && ($elem['status'] == 0)) { + $_SESSION['variabledefinition'][$key]['status'] = 1; + } + } } ?> - - None - - + + None + + + - +
- - - - + + + + @@ -143,8 +158,8 @@ if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefini -
<?php echo translate('Modify'); ?> <?php echo translate('Delete'); ?>
<?php
+                echo translate('Modify'); ?> <?php
+                echo translate('Delete'); ?>
 
+ \ No newline at end of file diff --git a/admin/verify.php b/admin/verify.php index d602364..b56792a 100644 --- a/admin/verify.php +++ b/admin/verify.php @@ -5,488 +5,571 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Configuration verification -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$prePageId = 30; -$preContent = "admin/verify.tpl.htm"; -$preAccess = 1; -$preFieldvars = 1; -$intModus = 0; -$strInfo = ""; +$prePageId = 30; +$preContent = 'admin/verify.htm.tpl'; +$preAccess = 1; +$preFieldvars = 1; +$intModus = 0; +$strInfo = ''; // // Include preprocessing files // =========================== -require("../functions/prepend_adm.php"); -require("../functions/prepend_content.php"); +require $preBasePath.'functions/prepend_adm.php'; +require $preBasePath.'functions/prepend_content.php'; // // Get configuration set ID // ======================== -$arrConfigSet = $myConfigClass->getConfigSets(); +$myConfigClass->getConfigTargets($arrConfigSet); $intConfigId = $arrConfigSet[0]; -$myConfigClass->getConfigData($intConfigId,"method",$intMethod); +$myConfigClass->getConfigValues($intConfigId, 'method', $intMethod); // // Process form variables // ====================== $intProcessError = 0; +$intError = 0; // Write monitoring data -if ($chkButValue1 != "") { - $strNoData = translate('Writing of the configuration failed - no dataset or not activated dataset found')."::"; - // Write host configuration - $strSQL = "SELECT `id` FROM `tbl_host` WHERE `config_id` = $chkDomainId AND `active`='1'"; - $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - $intError = 0; - if ($intDataCount != 0) { - foreach ($arrData AS $data) { - $intReturn = $myConfigClass->createConfigSingle("tbl_host",$data['id']); - $intError += $intReturn; - } - } - if (($intError == 0) && ($intDataCount != 0)) { - $myVisClass->processMessage(translate("Write host configurations")." ...",$strInfo); - $myVisClass->processMessage("Hosts: ".translate("Configuration file successfully written!"),$strInfo); - } else if ($intDataCount != 0) { - $myVisClass->processMessage("Hosts: ".translate("Cannot open/overwrite the configuration file (check the permissions)!"),$strErrorMessage); - $intProcessError = 1; - } else { - $myVisClass->processMessage("Hosts: ".translate("No configuration items defined!"),$strErrorMessage); - $intProcessError = 1; - } - // Write service configuration - $strSQL = "SELECT `id`, `config_name` FROM `tbl_service` WHERE `config_id` = $chkDomainId AND `active`='1' GROUP BY `config_name`"; - $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - $intError = 0; - if ($intDataCount != 0) { - foreach ($arrData AS $data) { - $intReturn = $myConfigClass->createConfigSingle("tbl_service",$data['id']); - $intError += $intReturn; - } - } - if (($intError == 0) && ($intDataCount != 0)) { - $myVisClass->processMessage(translate("Write service configurations")." ...",$strInfo); - $myVisClass->processMessage("Services: ".translate("Configuration file successfully written!"),$strInfo); - } else if ($intDataCount != 0) { - $myVisClass->processMessage("Services: ".translate("Cannot open/overwrite the configuration file (check the permissions)!"),$strErrorMessage); - $intProcessError = 1; - } else { - $myVisClass->processMessage("Services: ".translate("No configuration items defined!"),$strErrorMessage); - $intProcessError = 1; - } - // Write hostgroup configuration - $intReturn = $myConfigClass->createConfig("tbl_hostgroup"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." hostgroups.cfg ...",$strInfo); - $myVisClass->processMessage("Hostgroups: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - if ($myConfigClass->strErrorMessage == $strNoData) { - $myVisClass->processMessage(translate("Write")." hostgroups.cfg ...",$strInfo); - $myVisClass->processMessage("Hostgroups: ".translate('No dataset or no activated dataset found - empty configuration written')."::",$strInfo); - } else { - $myVisClass->processMessage("Hostgroups: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - } - // Write servicegroup configuration - $intReturn = $myConfigClass->createConfig("tbl_servicegroup"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." servicegroups.cfg ...",$strInfo); - $myVisClass->processMessage("Servicegroups: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - if ($myConfigClass->strErrorMessage == $strNoData) { - $myVisClass->processMessage(translate("Write")." servicegroups.cfg ...",$strInfo); - $myVisClass->processMessage("Servicegroups: ".translate('No dataset or no activated dataset found - empty configuration written')."::",$strInfo); - } else { - $myVisClass->processMessage("Servicegroups: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - } - // Write hosttemplate configuration - $intReturn = $myConfigClass->createConfig("tbl_hosttemplate"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." hosttemplates.cfg ...",$strInfo); - $myVisClass->processMessage("Hosttemplates: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - if ($myConfigClass->strErrorMessage == $strNoData) { - $myVisClass->processMessage(translate("Write")." hosttemplates.cfg ...",$strInfo); - $myVisClass->processMessage("Hosttemplates: ".translate('No dataset or no activated dataset found - empty configuration written')."::",$strInfo); - } else { - $myVisClass->processMessage("Hosttemplates: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - } - // Write servicetemplate configuration - $intReturn = $myConfigClass->createConfig("tbl_servicetemplate"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." servicetemplates.cfg ...",$strInfo); - $myVisClass->processMessage("Servicetemplates: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - if ($myConfigClass->strErrorMessage == $strNoData) { - $myVisClass->processMessage(translate("Write")." servicetemplates.cfg ...",$strInfo); - $myVisClass->processMessage("Servicetemplates: ".translate('No dataset or no activated dataset found - empty configuration written')."::",$strInfo); - } else { - $myVisClass->processMessage("Servicetemplates: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - } +if ($chkButValue1 != '') { + $strNoData = translate('Writing of the configuration failed - no dataset or not activated dataset found'). '::'; + // Write host configuration + $strSQL1 = "SELECT `id` FROM `tbl_host` WHERE `config_id` = $chkDomainId AND `active`='1'"; + $myDBClass->hasDataArray($strSQL1, $arrData, $intDataCount); + if ($intDataCount != 0) { + $intError = 0; + foreach ($arrData as $data) { + $intReturn = $myConfigClass->createConfigSingle('tbl_host', $data['id']); + $intError += $intReturn; + } + } + if (($intError == 0) && ($intDataCount != 0)) { + $myVisClass->processMessage(translate('Write host configurations'). ' ...', $strInfo); + $myVisClass->processMessage('Hosts: ' .translate('Configuration file successfully written!'), $strInfo); + } elseif ($intDataCount != 0) { + $myVisClass->processMessage('Hosts: ' .translate('Cannot open/overwrite the configuration file (check the ' + . 'permissions)!'), $strErrorMessage); + $intProcessError = 1; + } else { + $myVisClass->processMessage('Hosts: ' .translate('No configuration items defined!'), $strErrorMessage); + $intProcessError = 1; + } + // Write service configuration + $strSQL = 'SELECT `id`, `config_name` ' + . "FROM `tbl_service` WHERE `config_id` = $chkDomainId AND `active`='1' GROUP BY `config_name`"; + $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($intDataCount != 0) { + $intError = 0; + foreach ($arrData as $data) { + $intReturn = $myConfigClass->createConfigSingle('tbl_service', $data['id']); + $intError += $intReturn; + } + } + if (($intError == 0) && ($intDataCount != 0)) { + $myVisClass->processMessage(translate('Write service configurations'). ' ...', $strInfo); + $myVisClass->processMessage('Services: ' .translate('Configuration file successfully written!'), $strInfo); + } elseif ($intDataCount != 0) { + $myVisClass->processMessage('Services: ' .translate('Cannot open/overwrite the configuration file (check the ' + . 'permissions)!'), $strErrorMessage); + $intProcessError = 1; + } else { + $myVisClass->processMessage('Services: ' .translate('No configuration items defined!'), $strErrorMessage); + $intProcessError = 1; + } + // Write hostgroup configuration + $intReturn1 = $myConfigClass->createConfig('tbl_hostgroup'); + if ($intReturn1 == 0) { + $myVisClass->processMessage(translate('Write'). ' hostgroups.cfg ...', $strInfo); + $myVisClass->processMessage('Hostgroups: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + if ($myConfigClass->strErrorMessage == $strNoData) { + $myVisClass->processMessage(translate('Write'). ' hostgroups.cfg ...', $strInfo); + $myVisClass->processMessage('Hostgroups: ' .translate('No dataset or no activated dataset found - empty ' + . 'configuration written'). '::', $strInfo); + } else { + $myVisClass->processMessage('Hostgroups: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + } + // Write servicegroup configuration + $intReturn2 = $myConfigClass->createConfig('tbl_servicegroup'); + if ($intReturn2 == 0) { + $myVisClass->processMessage(translate('Write'). ' servicegroups.cfg ...', $strInfo); + $myVisClass->processMessage('Servicegroups: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + if ($myConfigClass->strErrorMessage == $strNoData) { + $myVisClass->processMessage(translate('Write'). ' servicegroups.cfg ...', $strInfo); + $myVisClass->processMessage('Servicegroups: ' .translate('No dataset or no activated dataset found - empty ' + . 'configuration written'). '::', $strInfo); + } else { + $myVisClass->processMessage('Servicegroups: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + } + // Write hosttemplate configuration + $intReturn3 = $myConfigClass->createConfig('tbl_hosttemplate'); + if ($intReturn3 == 0) { + $myVisClass->processMessage(translate('Write'). ' hosttemplates.cfg ...', $strInfo); + $myVisClass->processMessage('Hosttemplates: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + if ($myConfigClass->strErrorMessage == $strNoData) { + $myVisClass->processMessage(translate('Write'). ' hosttemplates.cfg ...', $strInfo); + $myVisClass->processMessage('Hosttemplates: ' .translate('No dataset or no activated dataset found - empty ' + . 'configuration written'). '::', $strInfo); + } else { + $myVisClass->processMessage('Hosttemplates: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + } + // Write servicetemplate configuration + $intReturn4 = $myConfigClass->createConfig('tbl_servicetemplate'); + if ($intReturn4 == 0) { + $myVisClass->processMessage(translate('Write'). ' servicetemplates.cfg ...', $strInfo); + $myVisClass->processMessage('Servicetemplates: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + if ($myConfigClass->strErrorMessage == $strNoData) { + $myVisClass->processMessage(translate('Write'). ' servicetemplates.cfg ...', $strInfo); + $myVisClass->processMessage('Servicetemplates: ' .translate('No dataset or no activated dataset found - ' + . 'empty configuration written'). '::', $strInfo); + } else { + $myVisClass->processMessage('Servicetemplates: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + } } // Write additional data -if ($chkButValue2 != "") { - $strNoData = translate('Writing of the configuration failed - no dataset or not activated dataset found')."::"; - // Write timeperiod configuration - $intReturn = $myConfigClass->createConfig("tbl_timeperiod"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." timeperiods.cfg ...",$strInfo); - $myVisClass->processMessage("Timeperiods: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - $myVisClass->processMessage("Timeperiods: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - // Write command configuration - $intReturn = $myConfigClass->createConfig("tbl_command"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." commands.cfg ...",$strInfo); - $myVisClass->processMessage("Commands: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - $myVisClass->processMessage("Commands: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - // Write contact configuration - $intReturn = $myConfigClass->createConfig("tbl_contact"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." contacts.cfg ...",$strInfo); - $myVisClass->processMessage("Contacts: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - $myVisClass->processMessage("Contacts: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - // Write contactgroup configuration - $intReturn = $myConfigClass->createConfig("tbl_contactgroup"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." contactgroups.cfg ...",$strInfo); - $myVisClass->processMessage("Contactgroups: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - $myVisClass->processMessage("Contactgroups: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - // Write contacttemplate configuration - $intReturn = $myConfigClass->createConfig("tbl_contacttemplate"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." contacttemplates.cfg ...",$strInfo); - $myVisClass->processMessage("Contacttemplates: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - if ($myConfigClass->strErrorMessage == $strNoData) { - $myVisClass->processMessage(translate("Write")." contacttemplates.cfg ...",$strInfo); - $myVisClass->processMessage("Contacttemplates: ".translate('No dataset or no activated dataset found - empty configuration written')."::",$strInfo); - } else { - $myVisClass->processMessage("Contacttemplates: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - } - // Write servicedependency configuration - $intReturn = $myConfigClass->createConfig("tbl_servicedependency"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." servicedependencies.cfg ...",$strInfo); - $myVisClass->processMessage("Servicedependencies: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - if ($myConfigClass->strErrorMessage == $strNoData) { - $myVisClass->processMessage(translate("Write")." servicedependencies.cfg ...",$strInfo); - $myVisClass->processMessage("Servicedependencies: ".translate('No dataset or no activated dataset found - empty configuration written')."::",$strInfo); - } else { - $myVisClass->processMessage("Servicedependencies: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - } - // Write hostdependency configuration - $intReturn = $myConfigClass->createConfig("tbl_hostdependency"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." hostdependencies.cfg ...",$strInfo); - $myVisClass->processMessage("Hostdependencies: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - if ($myConfigClass->strErrorMessage == $strNoData) { - $myVisClass->processMessage(translate("Write")." hostdependencies.cfg ...",$strInfo); - $myVisClass->processMessage("Hostdependencies: ".translate('No dataset or no activated dataset found - empty configuration written')."::",$strInfo); - } else { - $myVisClass->processMessage("Hostdependencies: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - } - // Write serviceescalation configuration - $intReturn = $myConfigClass->createConfig("tbl_serviceescalation"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." serviceescalations.cfg ...",$strInfo); - $myVisClass->processMessage("Serviceescalations: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - if ($myConfigClass->strErrorMessage == $strNoData) { - $myVisClass->processMessage(translate("Write")." serviceescalations.cfg ...",$strInfo); - $myVisClass->processMessage("Serviceescalations: ".translate('No dataset or no activated dataset found - empty configuration written')."::",$strInfo); - } else { - $myVisClass->processMessage("Serviceescalations: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - } - // Write hostescalation configuration - $intReturn = $myConfigClass->createConfig("tbl_hostescalation"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." hostescalations.cfg ...",$strInfo); - $myVisClass->processMessage("Hostescalations: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - if ($myConfigClass->strErrorMessage == $strNoData) { - $myVisClass->processMessage(translate("Write")." hostescalations.cfg ...",$strInfo); - $myVisClass->processMessage("Hostescalations: ".translate('No dataset or no activated dataset found - empty configuration written')."::",$strInfo); - } else { - $myVisClass->processMessage("Hostescalations: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - } - // Write serviceextinfo configuration - $intReturn = $myConfigClass->createConfig("tbl_serviceextinfo"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." serviceextinfo.cfg ...",$strInfo); - $myVisClass->processMessage("Serviceextinfo: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - if ($myConfigClass->strErrorMessage == $strNoData) { - $myVisClass->processMessage(translate("Write")." serviceextinfo.cfg ...",$strInfo); - $myVisClass->processMessage("Serviceextinfo: ".translate('No dataset or no activated dataset found - empty configuration written')."::",$strInfo); - } else { - $myVisClass->processMessage("Serviceextinfo: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - } - // Write hostextinfo configuration - $intReturn = $myConfigClass->createConfig("tbl_hostextinfo"); - if ($intReturn == 0) { - $myVisClass->processMessage(translate("Write")." hostextinfo.cfg ...",$strInfo); - $myVisClass->processMessage("Hostextinfo: ".$myConfigClass->strInfoMessage,$strInfo); - } else { - if ($myConfigClass->strErrorMessage == $strNoData) { - $myVisClass->processMessage(translate("Write")." hostextinfo.cfg ...",$strInfo); - $myVisClass->processMessage("Hostextinfo: ".translate('No dataset or no activated dataset found - empty configuration written')."::",$strInfo); - } else { - $myVisClass->processMessage("Hostextinfo: ".$myConfigClass->strErrorMessage,$strErrorMessage); - $intProcessError = 1; - } - } +if ($chkButValue2 != '') { + $strNoData = translate('Writing of the configuration failed - no dataset or not activated dataset found'). '::'; + // Write timeperiod configuration + $intReturn5 = $myConfigClass->createConfig('tbl_timeperiod'); + if ($intReturn5 == 0) { + $myVisClass->processMessage(translate('Write'). ' timeperiods.cfg ...', $strInfo); + $myVisClass->processMessage('Timeperiods: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + $myVisClass->processMessage('Timeperiods: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + // Write command configuration + $intReturn6 = $myConfigClass->createConfig('tbl_command'); + if ($intReturn6 == 0) { + $myVisClass->processMessage(translate('Write'). ' commands.cfg ...', $strInfo); + $myVisClass->processMessage('Commands: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + $myVisClass->processMessage('Commands: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + // Write contact configuration + $intReturn7 = $myConfigClass->createConfig('tbl_contact'); + if ($intReturn7 == 0) { + $myVisClass->processMessage(translate('Write'). ' contacts.cfg ...', $strInfo); + $myVisClass->processMessage('Contacts: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + $myVisClass->processMessage('Contacts: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + // Write contactgroup configuration + $intReturn8 = $myConfigClass->createConfig('tbl_contactgroup'); + if ($intReturn8 == 0) { + $myVisClass->processMessage(translate('Write'). ' contactgroups.cfg ...', $strInfo); + $myVisClass->processMessage('Contactgroups: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + $myVisClass->processMessage('Contactgroups: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + // Write contacttemplate configuration + $intReturn9 = $myConfigClass->createConfig('tbl_contacttemplate'); + if ($intReturn9 == 0) { + $myVisClass->processMessage(translate('Write'). ' contacttemplates.cfg ...', $strInfo); + $myVisClass->processMessage('Contacttemplates: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + if ($myConfigClass->strErrorMessage == $strNoData) { + $myVisClass->processMessage(translate('Write'). ' contacttemplates.cfg ...', $strInfo); + $myVisClass->processMessage('Contacttemplates: ' .translate('No dataset or no activated dataset found - ' + . 'empty configuration written'). '::', $strInfo); + } else { + $myVisClass->processMessage('Contacttemplates: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + } + // Write servicedependency configuration + $intReturn10 = $myConfigClass->createConfig('tbl_servicedependency'); + if ($intReturn10 == 0) { + $myVisClass->processMessage(translate('Write'). ' servicedependencies.cfg ...', $strInfo); + $myVisClass->processMessage('Servicedependencies: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + if ($myConfigClass->strErrorMessage == $strNoData) { + $myVisClass->processMessage(translate('Write'). ' servicedependencies.cfg ...', $strInfo); + $myVisClass->processMessage('Servicedependencies: ' .translate('No dataset or no activated dataset found - ' + . 'empty configuration written'). '::', $strInfo); + } else { + $myVisClass->processMessage('Servicedependencies: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + } + // Write hostdependency configuration + $intReturn11 = $myConfigClass->createConfig('tbl_hostdependency'); + if ($intReturn11 == 0) { + $myVisClass->processMessage(translate('Write'). ' hostdependencies.cfg ...', $strInfo); + $myVisClass->processMessage('Hostdependencies: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + if ($myConfigClass->strErrorMessage == $strNoData) { + $myVisClass->processMessage(translate('Write'). ' hostdependencies.cfg ...', $strInfo); + $myVisClass->processMessage('Hostdependencies: ' .translate('No dataset or no activated dataset found - ' + . 'empty configuration written'). '::', $strInfo); + } else { + $myVisClass->processMessage('Hostdependencies: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + } + // Write serviceescalation configuration + $intReturn12 = $myConfigClass->createConfig('tbl_serviceescalation'); + if ($intReturn12 == 0) { + $myVisClass->processMessage(translate('Write'). ' serviceescalations.cfg ...', $strInfo); + $myVisClass->processMessage('Serviceescalations: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + if ($myConfigClass->strErrorMessage == $strNoData) { + $myVisClass->processMessage(translate('Write'). ' serviceescalations.cfg ...', $strInfo); + $myVisClass->processMessage('Serviceescalations: ' .translate('No dataset or no activated dataset found - ' + . 'empty configuration written'). '::', $strInfo); + } else { + $myVisClass->processMessage('Serviceescalations: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + } + // Write hostescalation configuration + $intReturn13 = $myConfigClass->createConfig('tbl_hostescalation'); + if ($intReturn13 == 0) { + $myVisClass->processMessage(translate('Write'). ' hostescalations.cfg ...', $strInfo); + $myVisClass->processMessage('Hostescalations: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + if ($myConfigClass->strErrorMessage == $strNoData) { + $myVisClass->processMessage(translate('Write'). ' hostescalations.cfg ...', $strInfo); + $myVisClass->processMessage('Hostescalations: ' .translate('No dataset or no activated dataset found - ' + . 'empty configuration written'). '::', $strInfo); + } else { + $myVisClass->processMessage('Hostescalations: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + } + // Write serviceextinfo configuration + $intReturn14 = $myConfigClass->createConfig('tbl_serviceextinfo'); + if ($intReturn14 == 0) { + $myVisClass->processMessage(translate('Write'). ' serviceextinfo.cfg ...', $strInfo); + $myVisClass->processMessage('Serviceextinfo: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + if ($myConfigClass->strErrorMessage == $strNoData) { + $myVisClass->processMessage(translate('Write'). ' serviceextinfo.cfg ...', $strInfo); + $myVisClass->processMessage('Serviceextinfo: ' .translate('No dataset or no activated dataset found - ' + . 'empty configuration written'). '::', $strInfo); + } else { + $myVisClass->processMessage('Serviceextinfo: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + } + // Write hostextinfo configuration + $intReturn15 = $myConfigClass->createConfig('tbl_hostextinfo'); + if ($intReturn15 == 0) { + $myVisClass->processMessage(translate('Write'). ' hostextinfo.cfg ...', $strInfo); + $myVisClass->processMessage('Hostextinfo: ' .$myConfigClass->strInfoMessage, $strInfo); + } else { + if ($myConfigClass->strErrorMessage == $strNoData) { + $myVisClass->processMessage(translate('Write'). ' hostextinfo.cfg ...', $strInfo); + $myVisClass->processMessage('Hostextinfo: ' .translate('No dataset or no activated dataset found - empty ' + . 'configuration written'). '::', $strInfo); + } else { + $myVisClass->processMessage('Hostextinfo: ' .$myConfigClass->strErrorMessage, $strErrorMessage); + $intProcessError = 1; + } + } } // Check configuration -if ($chkButValue3 != "") { - $myConfigClass->getConfigData($intConfigId,"binaryfile",$strBinary); - $myConfigClass->getConfigData($intConfigId,"basedir",$strBaseDir); - $myConfigClass->getConfigData($intConfigId,"nagiosbasedir",$strNagiosBaseDir); - $myConfigClass->getConfigData($intConfigId,"conffile",$strConffile); - if ($intMethod == 1) { - if (file_exists($strBinary) && is_executable($strBinary)) { - $resFile = popen($strBinary." -v ".$strConffile,"r"); - } else { - $myVisClass->processMessage(translate('Cannot find the Nagios binary or no rights for execution!'),$strErrorMessage); - } - } else if ($intMethod == 2) { - $booReturn = 0; - if (!isset($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { - $booReturn = $myConfigClass->getFTPConnection($intConfigId); - } - if ($booReturn == 1) { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } else { - $intErrorReporting = error_reporting(); - error_reporting(0); - if (!($resFile = ftp_exec($myConfigClass->resConnectId,$strBinary.' -v '.$strConffile))) { - $myVisClass->processMessage(translate('Remote execution (FTP SITE EXEC) is not supported on your system!'),$strErrorMessage); - } - ftp_close($conn_id); - error_reporting($intErrorReporting); - } - } else if ($intMethod == 3) { - $booReturn = 0; - if (!isset($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { - $booReturn = $myConfigClass->getSSHConnection($intConfigId); - } - if ($booReturn == 1) { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } else { - if (($strBinary != "") && ($strConffile != "") && (is_array($myConfigClass->sendSSHCommand('ls '.$strBinary))) && - (is_array($myConfigClass->sendSSHCommand('ls '.$strConffile)))) { - $arrResult = $myConfigClass->sendSSHCommand($strBinary.' -v '.$strConffile,15000); - if (!is_array($arrResult) || ($arrResult == false)) { - $myVisClass->processMessage(translate('Remote execution of nagios verify command failed (remote SSH)!'),$strErrorMessage); - } - } else { - $myVisClass->processMessage(translate('Nagios binary or configuration file not found (remote SSH)!'),$strErrorMessage); - } - } - } +if ($chkButValue3 != '') { + $myConfigClass->getConfigValues($intConfigId, 'binaryfile', $strBinary); + $myConfigClass->getConfigValues($intConfigId, 'basedir', $strBaseDir); + $myConfigClass->getConfigValues($intConfigId, 'nagiosbasedir', $strNagiosBaseDir); + $myConfigClass->getConfigValues($intConfigId, 'conffile', $strConffile); + if ($intMethod == 1) { + if (file_exists($strBinary) && is_executable($strBinary)) { + $resFile = popen($strBinary. ' -v ' .$strConffile, 'r'); + } else { + $myVisClass->processMessage( + translate('Cannot find the Nagios binary or no execute permissions!'), + $strErrorMessage + ); + } + } elseif ($intMethod == 2) { + $booReturn = 0; + if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { + $booReturn = $myConfigClass->getFTPConnection($intConfigId); + } + if ($booReturn == 1) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } else { + $intErrorReporting = error_reporting(); + error_reporting(0); + if (!($resFile = ftp_exec($myConfigClass->resConnectId, $strBinary.' -v '.$strConffile))) { + $myVisClass->processMessage(translate('Remote execution (FTP SITE EXEC) is not supported on your ' + . 'system!'), $strErrorMessage); + } + ftp_close($conn_id); + error_reporting($intErrorReporting); + } + } elseif ($intMethod == 3) { + $booReturn = 0; + if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { + $booReturn = $myConfigClass->getSSHConnection($intConfigId); + } + if ($booReturn == 1) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } else { + if (($strBinary != '') && ($strConffile != '') && + $myConfigClass->sendSSHCommand('ls '.$strBinary, $arrTemp) == 0 && + $myConfigClass->sendSSHCommand('ls '.$strConffile, $arrTemp) == 0) { + $intResult = $myConfigClass->sendSSHCommand($strBinary.' -v '.$strConffile, $arrResult, 15000); + if (!is_array($arrResult) || ($arrResult == false)) { + $myVisClass->processMessage(translate('Remote execution of nagios verify command failed (remote ' + . 'SSH)!'), $strErrorMessage); + } + } else { + $myVisClass->processMessage( + translate('Nagios binary or configuration file not found (remote SSH)!'), + $strErrorMessage + ); + } + } + } } // Restart nagios -if ($chkButValue4 != "") { - // Read config file - $myConfigClass->getConfigData($intConfigId,"commandfile",$strCommandfile); - $myConfigClass->getConfigData($intConfigId,"binaryfile",$strBinary); - $myConfigClass->getConfigData($intConfigId,"pidfile",$strPidfile); - // Check state nagios demon - clearstatcache(); - if ($intMethod == 1) { - if (substr_count(PHP_OS,"Linux") != 0) { - exec('ps -ef | grep '.basename($strBinary).' | grep -v grep',$arrExec); - } else { - $arrExec[0] = 1; - } - if (file_exists($strPidfile) && isset($arrExec[0])) { - if (file_exists($strCommandfile) && is_writable($strCommandfile)) { - $strCommandString = "[".time()."] RESTART_PROGRAM;".time()."\n"; - $timeout = 3; - $old = ini_set('default_socket_timeout', $timeout); - $resCmdFile = fopen($strCommandfile,"w"); - ini_set('default_socket_timeout', $old); - stream_set_timeout($resCmdFile, $timeout); - stream_set_blocking($resCmdFile, 0); - if ($resCmdFile) { - fputs($resCmdFile,$strCommandString); - fclose($resCmdFile); - $myDataClass->writeLog(translate('Nagios daemon successfully restarted')); - $myVisClass->processMessage(translate('Restart command successfully send to Nagios'),$strInfoMessage); - } else { - $myDataClass->writeLog(translate('Restart failed - Nagios command file not found or no rights to execute')); - $myVisClass->processMessage(translate('Nagios command file not found or no rights to write!'),$strErrorMessage); - } - } else { - - $myDataClass->writeLog(translate('Restart failed - Nagios command file not found or no rights to execute')); - $myVisClass->processMessage(translate('Restart failed - Nagios command file not found or no rights to execute'),$strErrorMessage); - } - } else { - $myDataClass->writeLog(translate('Restart failed - Nagios daemon was not running')); - $myVisClass->processMessage(translate('Nagios daemon is not running, cannot send restart command!'),$strErrorMessage); - } - } else if ($intMethod == 2) { - $myDataClass->writeLog(translate('Restart failed - FTP restrictions')); - $myVisClass->processMessage(translate('Nagios restart is not possible via FTP remote connection!'),$strErrorMessage); - } else if ($intMethod == 3) { - $booReturn = 0; - if (!isset($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { - $booReturn = $myConfigClass->getSSHConnection($intConfigId); - } - if ($booReturn == 1) { - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } else { - if (is_array($myConfigClass->sendSSHCommand('ls '.$strCommandfile))) { - $strCommandString = "[".time()."] RESTART_PROGRAM;".time()."\n"; - $arrInfo = ssh2_sftp_stat($myConfigClass->resSFTP, $strCommandfile); - $intFileStamp1 = $arrInfo['mtime']; - $arrResult = $myConfigClass->sendSSHCommand('echo "'.$strCommandString.'" >> '.$strCommandfile); - $arrInfo = ssh2_sftp_stat($myConfigClass->resSFTP, $strCommandfile); - $intFileStamp2 = $arrInfo['mtime']; - if ($intFileStamp2 <= $intFileStamp1) { - $myVisClass->processMessage(translate('Restart failed - Nagios command file not found or no rights to execute (remote SSH)!'),$strErrorMessage); - } else { - $myDataClass->writeLog(translate('Nagios daemon successfully restarted (remote SSH)')); - $myVisClass->processMessage(translate('Restart command successfully send to Nagios (remote SSH)'),$strInfoMessage); - } - } else { - $myVisClass->processMessage(translate('Nagios command file not found (remote SSH)!'),$strErrorMessage); - } - } - } +if ($chkButValue4 != '') { + // Read config file + $myConfigClass->getConfigValues($intConfigId, 'commandfile', $strCommandfile); + $myConfigClass->getConfigValues($intConfigId, 'binaryfile', $strBinary); + $myConfigClass->getConfigValues($intConfigId, 'pidfile', $strPidfile); + $myConfigClass->getConfigValues($intConfigId, 'version', $intVersion); + // Check state nagios demon + clearstatcache(); + if ($intMethod == 1) { + if (substr_count(PHP_OS, 'Linux') != 0) { + exec('ps -ef | grep '.basename($strBinary).' | grep -v grep', $arrExec); + } else { + $arrExec[0] = 1; + } + if (file_exists($strPidfile) && isset($arrExec[0])) { + if (file_exists($strCommandfile) && is_writable($strCommandfile)) { + if ($intVersion == 4) { + $strCommandString = '[' .time(). "] RESTART_PROGRAM\n"; + } else { + $strCommandString = '[' .time(). '] RESTART_PROGRAM;' .time()."\n"; + } + $timeout = 3; + $old = ini_set('default_socket_timeout', $timeout); + $resCmdFile = fopen($strCommandfile, 'wb'); + ini_set('default_socket_timeout', $old); + stream_set_timeout($resCmdFile, $timeout); + stream_set_blocking($resCmdFile, 0); + if ($resCmdFile) { + fwrite($resCmdFile, $strCommandString); + fclose($resCmdFile); + $myDataClass->writeLog(translate('Nagios daemon successfully restarted')); + $myVisClass->processMessage( + translate('Restart command successfully send to Nagios'), + $strInfoMessage + ); + } else { + $myDataClass->writeLog(translate('Restart failed - Nagios command file not found or no execute ' + . 'permissions')); + $myVisClass->processMessage( + translate('Nagios command file not found or no write permissions!'), + $strErrorMessage + ); + } + } else { + $myDataClass->writeLog(translate('Restart failed - Nagios command file not found or no execute ' + . 'permissions')); + $myVisClass->processMessage(translate('Restart failed - Nagios command file not found or no rights ' + . 'to execute'), $strErrorMessage); + } + } else { + $myDataClass->writeLog(translate('Restart failed - Nagios daemon was not running')); + $myVisClass->processMessage( + translate('Nagios daemon is not running, cannot send restart command!'), + $strErrorMessage + ); + } + } elseif ($intMethod == 2) { + $myDataClass->writeLog(translate('Restart failed - FTP restrictions')); + $myVisClass->processMessage( + translate('Nagios restart is not possible via FTP remote connection!'), + $strErrorMessage + ); + } elseif ($intMethod == 3) { + $booReturn = 0; + if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { + $booReturn = $myConfigClass->getSSHConnection($intConfigId); + } + if ($booReturn == 1) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } else { + if ($myConfigClass->sendSSHCommand('ls '.$strCommandfile, $arrTemp) == 0) { + if ($intVersion == 4) { + $strCommandString = '[' .time(). "] RESTART_PROGRAM\n"; + } else { + $strCommandString = '[' .time(). '] RESTART_PROGRAM;' .time()."\n"; + } + $arrInfo1 = ssh2_sftp_stat($myConfigClass->resSFTP, $strCommandfile); + $intFileStamp1 = $arrInfo1['mtime']; + $myConfigClass->sendSSHCommand('echo "'.$strCommandString.'" >> '.$strCommandfile, $arrResult); + $arrInfo2 = ssh2_sftp_stat($myConfigClass->resSFTP, $strCommandfile); + $intFileStamp2 = $arrInfo2['mtime']; + if ($intFileStamp2 <= $intFileStamp1) { + $myVisClass->processMessage(translate('Restart failed - Nagios command file not found or no ' + . 'rights to execute (remote SSH)!'), $strErrorMessage); + } else { + $myDataClass->writeLog(translate('Nagios daemon successfully restarted (remote SSH)')); + $myVisClass->processMessage( + translate('Restart command successfully send to Nagios (remote SSH)'), + $strInfoMessage + ); + } + } else { + $myVisClass->processMessage(translate('Nagios command file not found (remote SSH)!'), $strErrorMessage); + } + } + } } // // include content // =============== -$conttp->setVariable("TITLE",translate('Check written configuration files')); -$conttp->parse("header"); -$conttp->show("header"); -$conttp->setVariable("CHECK_CONFIG",translate('Check configuration files:')); -$conttp->setVariable("RESTART_NAGIOS",translate('Restart Nagios:')); -$conttp->setVariable("WRITE_MONITORING_DATA",translate('Write monitoring data')); -$conttp->setVariable("WRITE_ADDITIONAL_DATA",translate('Write additional data')); -if (($chkButValue3 == "") && ($chkButValue4 == "")) $conttp->setVariable("WARNING",translate('Warning, always check the configuration files before restart Nagios!')); -$conttp->setVariable("MAKE",translate('Do it')); -$conttp->setVariable("IMAGE_PATH",$_SESSION['SETS']['path']['base_url']."images/"); -$conttp->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); -$strOutput = ""; -if (isset($resFile) && ($resFile != false)){ - $intError = 0; - $intWarning = 0; - while(!feof($resFile)) { - $strLine = fgets($resFile,1024); - if ((substr_count($strLine,"Error:") != 0) || (substr_count($strLine,"Total Errors:") != 0)) { - $conttp->setVariable("VERIFY_CLASS","errormessage"); - $conttp->setVariable("VERIFY_LINE",$strLine); - $conttp->parse("verifyline"); - $intError++; - if (substr_count($strLine,"Total Errors:") != 0) $intError--; - } - if ((substr_count($strLine,"Warning:") != 0) || (substr_count($strLine,"Total Warnings:") != 0)) { - $conttp->setVariable("VERIFY_CLASS","warnmessage"); - $conttp->setVariable("VERIFY_LINE",$strLine); - $conttp->parse("verifyline"); - $intWarning++; - if (substr_count($strLine,"Total Warnings:") != 0) $intWarning--; - } - $strOutput .= $strLine."
"; - } - $myDataClass->writeLog(translate('Written Nagios configuration checked - Warnings/Errors:')." ".$intWarning."/".$intError); - pclose($resFile); - if (($intError == 0) && ($intWarning == 0)) { - $conttp->setVariable("VERIFY_CLASS","greenmessage"); - $conttp->setVariable("VERIFY_LINE","".translate('Written configuration files are valid, Nagios can be restarted!').""); - $conttp->parse("verifyline"); - } - $conttp->setVariable("DATA",$strOutput); - $conttp->parse("verifyline"); -} else if (isset($arrResult) && is_array($arrResult)) { - $intError = 0; - $intWarning = 0; - foreach ($arrResult AS $elem) { - if ((substr_count($elem,"Error:") != 0) || (substr_count($elem,"Total Errors:") != 0)) { - $conttp->setVariable("VERIFY_CLASS","errormessage"); - $conttp->setVariable("VERIFY_LINE",$elem); - $conttp->parse("verifyline"); - $intError++; - if (substr_count($elem,"Total Errors:") != 0) $intError--; - } - if ((substr_count($elem,"Warning:") != 0) || (substr_count($elem,"Total Warnings:") != 0)) { - $conttp->setVariable("VERIFY_CLASS","warnmessage"); - $conttp->setVariable("VERIFY_LINE",$elem); - $conttp->parse("verifyline"); - $intWarning++; - if (substr_count($elem,"Total Warnings:") != 0) $intWarning--; - } - $strOutput .= $elem."
"; - } - $myDataClass->writeLog(translate('Written Nagios configuration checked - Warnings/Errors:')." ".$intWarning."/".$intError); - if (($intError == 0) && ($intWarning == 0)) { - $conttp->setVariable("VERIFY_CLASS","greenmessage"); - $conttp->setVariable("VERIFY_LINE","".translate('Written configuration files are valid, Nagios can be restarted!').""); - $conttp->parse("verifyline"); - } - $conttp->setVariable("DATA",$strOutput); - $conttp->parse("verifyline"); - +$conttp->setVariable('TITLE', translate('Check written configuration files')); +$conttp->setVariable('CHECK_CONFIG', translate('Check configuration files:')); +$conttp->setVariable('RESTART_NAGIOS', translate('Restart Nagios:')); +$conttp->setVariable('WRITE_MONITORING_DATA', translate('Write monitoring data')); +$conttp->setVariable('WRITE_ADDITIONAL_DATA', translate('Write additional data')); +if (($chkButValue3 == '') && ($chkButValue4 == '')) { + $conttp->setVariable('WARNING', translate('Warning, always check the configuration files before restarting ' + .'Nagios!')); } -if ($strErrorMessage != "") $conttp->setVariable("ERRORMESSAGE",$strErrorMessage); -$conttp->setVariable("INFOMESSAGE",$strInfoMessage); -if ($strInfo != "") { - $conttp->setVariable("VERIFY_CLASS","greenmessage"); - $conttp->setVariable("VERIFY_LINE","
".$strInfo); - $conttp->parse("verifyline"); +$conttp->setVariable('MAKE', translate('Do it')); +$conttp->setVariable('IMAGE_PATH', $_SESSION['SETS']['path']['base_url']. 'images/'); +$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$strOutput = ''; +if (isset($resFile) && ($resFile != false)) { + $intError = 0; + $intWarning = 0; + $intLines = 0; + while (!feof($resFile)) { + $strLine = fgets($resFile, 1024); + $intLines++; + if ((substr_count($strLine, 'Error:') != 0) || (substr_count($strLine, 'Total Errors:') != 0)) { + $conttp->setVariable('VERIFY_CLASS', 'errormessage'); + $conttp->setVariable('VERIFY_LINE', $strLine); + $conttp->parse('verifyline'); + $intError++; + if (substr_count($strLine, 'Total Errors:') != 0) { + $intError--; + } + } + if ((substr_count($strLine, 'Warning:') != 0) || (substr_count($strLine, 'Total Warnings:') != 0)) { + $conttp->setVariable('VERIFY_CLASS', 'warnmessage'); + $conttp->setVariable('VERIFY_LINE', $strLine); + $conttp->parse('verifyline'); + $intWarning++; + if (substr_count($strLine, 'Total Warnings:') != 0) { + $intWarning--; + } + } + $strOutput .= $strLine. '
'; + } + $myDataClass->writeLog(translate('Nagios written configuration files checked - Warnings/Errors:'). ' ' + .$intWarning. '/' . + $intError); + pclose($resFile); + if (($intError == 0) && ($intWarning == 0) && ($intLines > 5)) { + $conttp->setVariable('VERIFY_CLASS', 'greenmessage'); + $conttp->setVariable('VERIFY_LINE', '' .translate('Written configuration files are valid, Nagios can be ' + . 'restarted!'). ''); + $conttp->parse('verifyline'); + } + if ($intLines < 5) { + $conttp->setVariable('VERIFY_CLASS', 'redmessage'); + $conttp->setVariable('VERIFY_LINE', '' .translate('The configuration could not be tested successfully. ' + . 'The Nagios binary may have crashed during the test. Please repeat the test or try using the ' + . 'commandline to test. A running Nagios service should not be restarted because the configuration may ' + . 'be invalid.'). ''); + $conttp->parse('verifyline'); + } + $conttp->setVariable('DATA', $strOutput); + $conttp->parse('verifyline'); +} elseif (isset($arrResult) && is_array($arrResult)) { + $intError = 0; + $intWarning = 0; + foreach ($arrResult as $elem) { + if ((substr_count($elem, 'Error:') != 0) || (substr_count($elem, 'Total Errors:') != 0)) { + $conttp->setVariable('VERIFY_CLASS', 'errormessage'); + $conttp->setVariable('VERIFY_LINE', $elem); + $conttp->parse('verifyline'); + $intError++; + if (substr_count($elem, 'Total Errors:') != 0) { + $intError--; + } + } + if ((substr_count($elem, 'Warning:') != 0) || (substr_count($elem, 'Total Warnings:') != 0)) { + $conttp->setVariable('VERIFY_CLASS', 'warnmessage'); + $conttp->setVariable('VERIFY_LINE', $elem); + $conttp->parse('verifyline'); + $intWarning++; + if (substr_count($elem, 'Total Warnings:') != 0) { + $intWarning--; + } + } + $strOutput .= $elem. '
'; + } + $myDataClass->writeLog(translate('Nagios written configuration files checked - Warnings/Errors:'). ' ' + .$intWarning. '/' . + $intError); + if (($intError == 0) && ($intWarning == 0)) { + $conttp->setVariable('VERIFY_CLASS', 'greenmessage'); + $conttp->setVariable('VERIFY_LINE', '' .translate('Written configuration files are valid, Nagios can be ' + . 'restarted!'). ''); + $conttp->parse('verifyline'); + } + $conttp->setVariable('DATA', $strOutput); + $conttp->parse('verifyline'); +} +if ($strErrorMessage != '') { + $conttp->setVariable('ERRORMESSAGE', $strErrorMessage); +} +$conttp->setVariable('INFOMESSAGE', $strInfoMessage); +if ($strInfo != '') { + $conttp->setVariable('VERIFY_CLASS', 'greenmessage'); + $conttp->setVariable('VERIFY_LINE', '
' .$strInfo); + $conttp->parse('verifyline'); } // Check access rights for adding new objects -if ($myVisClass->checkAccGroup($prePageKey,'write') != 0) $conttp->setVariable("ADD_CONTROL","disabled=\"disabled\""); -$conttp->parse("main"); -$conttp->show("main"); +if ($myVisClass->checkAccountGroup($prePageKey, 'write') != 0) { + $conttp->setVariable('ADD_CONTROL', 'disabled="disabled"'); +} +$conttp->parse('main'); +$conttp->show('main'); // // Insert footer // ============= -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/admin/versioncheck.php b/admin/versioncheck.php index 297b797..820bcf6 100644 --- a/admin/versioncheck.php +++ b/admin/versioncheck.php @@ -5,168 +5,193 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL -// Component : Command line visualization -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Component : Online version check +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(admin/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$preNoMain = 1; -$chkShow = isset($_GET['show']) ? $_GET['show']+0 : 0; +$preNoMain = 1; +$chkShow = filter_input(INPUT_GET, 'show', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); // // Include preprocessing file // ========================== -require("../functions/prepend_adm.php"); -$strCommandLine = " "; -$intCount = 0; +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').""; - } else if (version_compare($strVersion, $setFileVersion,'>=')) { - $setFileInformation = "".translate('You are using an old NagiosQL version. Please update to the latest stable version').": "; - $setFileInformation .= "NagiosQL on Sourceforge"; - } else if (version_compare($strVersion, $setFileVersion,'<=')) { - $setFileInformation = "".translate('You are using a newer development version without official support').""; - } - if (($strError != "none") && ($strError != "")) $setFileInformation = "".$strError.""; -?> + $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...

- + + Commandline + + + + +


Loading...

+ "LANG_DOMAIN", "string" => translate("Domain")); -$arrDescription[] = array ("name" => "LANG_DESCRIPTION", "string" => translate("Description")); -$arrDescription[] = array ("name" => "LANG_SERVER_NAMEe", "string" => translate("Server name")); -$arrDescription[] = array ("name" => "LANG_METHOD", "string" => translate("Method")); -$arrDescription[] = array ("name" => "LANG_USERNAME", "string" => translate("Username")); -$arrDescription[] = array ("name" => "LANG_PASSWORD", "string" => translate("Password")); -$arrDescription[] = array ("name" => "LANG_SSH_KEY", "string" => translate("Directory with SSH key pair")); -$arrDescription[] = array ("name" => "LANG_SERVER_NAME", "string" => translate("Server name")); -$arrDescription[] = array ("name" => "LANG_CONFIGURATION_DIRECTORIES", "string" => translate("Configuration directories")); -$arrDescription[] = array ("name" => "LANG_BASE_DIRECTORY", "string" => translate("Base directory")); -$arrDescription[] = array ("name" => "LANG_HOST_DIRECTORY", "string" => translate("Host directory")); -$arrDescription[] = array ("name" => "LANG_SERVICE_DIRECTORY", "string" => translate("Service directory")); -$arrDescription[] = array ("name" => "LANG_BACKUP_DIRECTORY", "string" => translate("Backup directory")); -$arrDescription[] = array ("name" => "LANG_HOST_BACKUP_DIRECTORY", "string" => translate("Host backup directory")); -$arrDescription[] = array ("name" => "LANG_SERVICE_BACKUP_DIRECTORY", "string" => translate("Service backup directory")); -$arrDescription[] = array ("name" => "LANG_PICTURE_DIRECTORY", "string" => translate("Picture base directory")); -$arrDescription[] = array ("name" => "LANG_NAGIOS_COMMAND_FILE", "string" => translate("Nagios command file")); -$arrDescription[] = array ("name" => "LANG_NAGIOS_BINARY_FILE", "string" => translate("Nagios binary file")); -$arrDescription[] = array ("name" => "LANG_NAGIOS_PROCESS_FILE", "string" => translate("Nagios process file")); -$arrDescription[] = array ("name" => "LANG_NAGIOS_CONFIG_FILE", "string" => translate("Nagios config file")); -$arrDescription[] = array ("name" => "LANG_NAGIOS_VERSION", "string" => translate("Nagios version")); -$arrDescription[] = array ("name" => "LANG_ENABLE_COMMON_DOMAIN", "string" => translate("Use common domain")); -$arrDescription[] = array ("name" => "LANG_ENABLE_UTF8_DECODE", "string" => translate("Decode UTF8 data in config files")); -$arrDescription[] = array ("name" => "LANG_ACCESS_KEY_HOLES", "string" => translate("Access key holes")); -$arrDescription[] = array ("name" => "LANG_ACCESS_KEYS", "string" => translate("Access keys")); -$arrDescription[] = array ("name" => "LANG_ACTIVE", "string" => translate("Active")); -$arrDescription[] = array ("name" => "LANG_REGISTERED", "string" => translate("Registered")); -$arrDescription[] = array ("name" => "LANG_REQUIRED", "string" => translate("required")); -$arrDescription[] = array ("name" => "LANG_SAVE", "string" => translate("Save")); -$arrDescription[] = array ("name" => "LANG_ABORT", "string" => translate("Abort")); -$arrDescription[] = array ("name" => "LANG_FUNCTION", "string" => translate("Function")); -$arrDescription[] = array ("name" => "LANG_MARKED", "string" => translate("Marked")); -$arrDescription[] = array ("name" => "LANG_DO_IT", "string" => translate("Do it")); -$arrDescription[] = array ("name" => "LANG_ADD", "string" => translate("Add")); -$arrDescription[] = array ("name" => "LANG_FORMCHECK", "string" => translate("Formcheck")); -$arrDescription[] = array ("name" => "LANG_SECURE_QUESTION", "string" => translate("Secure question")); -$arrDescription[] = array ("name" => "LANG_YES", "string" => translate("Yes")); -$arrDescription[] = array ("name" => "LANG_NO", "string" => translate("No")); -$arrDescription[] = array ("name" => "LANG_TIME", "string" => translate("Time")); -$arrDescription[] = array ("name" => "LANG_USER", "string" => translate("User")); -$arrDescription[] = array ("name" => "LANG_IP", "string" => translate("IP")); -$arrDescription[] = array ("name" => "LANG_ENTRY", "string" => translate("Entry")); -$arrDescription[] = array ("name" => "LANG_FROM", "string" => translate("From")); -$arrDescription[] = array ("name" => "LANG_TO", "string" => translate("To")); -$arrDescription[] = array ("name" => "LANG_DELETE_LOG_ENTRIES", "string" => translate("Delete log entries")); -$arrDescription[] = array ("name" => "LANG_COPY", "string" => translate("Copy")); -$arrDescription[] = array ("name" => "LANG_DELETE", "string" => translate("Delete")); -$arrDescription[] = array ("name" => "LANG_MODIFY", "string" => translate("Modify")); -$arrDescription[] = array ("name" => "LANG_CONFIRM_PASSWORD", "string" => translate("Confirm password")); -$arrDescription[] = array ("name" => "LANG_OLD_PASSWORD", "string" => translate("Old password")); -$arrDescription[] = array ("name" => "LANG_NEW_PASSWORD", "string" => translate("New password")); -$arrDescription[] = array ("name" => "LANG_CHANGE_PASSWORD", "string" => translate("Change password")); -$arrDescription[] = array ("name" => "LANG_MENU_PAGE", "string" => translate("Menu page")); -$arrDescription[] = array ("name" => "LANG_SEARCH_STRING", "string" => translate("Search string")); -$arrDescription[] = array ("name" => "LANG_SEARCH", "string" => translate("Search")); -$arrDescription[] = array ("name" => "LANG_DELETE_SEARCH", "string" => translate("Reset filter")); -$arrDescription[] = array ("name" => "LANG_WRITE_CONFIG_FILE", "string" => translate("Write config file")); -$arrDescription[] = array ("name" => "LANG_DOWNLOAD", "string" => translate("Download")); -$arrDescription[] = array ("name" => "LANG_DUPLICATE", "string" => translate("Copy")); -$arrDescription[] = array ("name" => "LANG_COMMAND", "string" => translate("Command")); -$arrDescription[] = array ("name" => "LANG_COMMAND_LINE", "string" => translate("Command line")); -$arrDescription[] = array ("name" => "LANG_COMMAND_TYPE", "string" => translate("Command type")); -$arrDescription[] = array ("name" => "LANG_TIME_PERIOD", "string" => translate("Time period")); -$arrDescription[] = array ("name" => "LANG_EXCLUDE", "string" => translate("Exclude")); -$arrDescription[] = array ("name" => "LANG_INCLUDE", "string" => translate("Include")); -$arrDescription[] = array ("name" => "LANG_TIME_DEFINITIONS", "string" => translate("Time definitions")); -$arrDescription[] = array ("name" => "LANG_WEEKDAY", "string" => translate("Weekday")); -$arrDescription[] = array ("name" => "LANG_TIME_RANGE", "string" => translate("Time range")); -$arrDescription[] = array ("name" => "LANG_TIME_DEFINITION", "string" => translate("Time definition")); -$arrDescription[] = array ("name" => "LANG_INSERT", "string" => translate("Insert")); -$arrDescription[] = array ("name" => "LANG_MODIFY_SELECTION", "string" => translate("Modify selection")); -$arrDescription[] = array ("name" => "LANG_CONTACT_NAME", "string" => translate("Contact name")); -$arrDescription[] = array ("name" => "LANG_CONTACT_GROUP", "string" => translate("Contact group")); -$arrDescription[] = array ("name" => "LANG_TIME_PERIOD_HOSTS", "string" => translate("Time period hosts")); -$arrDescription[] = array ("name" => "LANG_TIME_PERIOD_SERVICES", "string" => translate("Time period services")); -$arrDescription[] = array ("name" => "LANG_HOST_OPTIONS", "string" => translate("Host options")); -$arrDescription[] = array ("name" => "LANG_SERVICE_OPTIONS", "string" => translate("Service options")); -$arrDescription[] = array ("name" => "LANG_HOST_COMMAND", "string" => translate("Host command")); -$arrDescription[] = array ("name" => "LANG_SERVICE_COMMAND", "string" => translate("Service command")); -$arrDescription[] = array ("name" => "LANG_EMAIL_ADDRESS", "string" => translate("EMail address")); -$arrDescription[] = array ("name" => "LANG_PAGER_NUMBER", "string" => translate("Pager number")); -$arrDescription[] = array ("name" => "LANG_ADDON_ADDRESS", "string" => translate("Addon address")); -$arrDescription[] = array ("name" => "LANG_HOST_NOTIF_ENABLE", "string" => translate("Host notif. enable")); -$arrDescription[] = array ("name" => "LANG_SERVICE_NOTIF_ENABLE", "string" => translate("Service notif. enable")); -$arrDescription[] = array ("name" => "LANG_CAN_SUBMIT_COMMANDS", "string" => translate("Can submit commands")); -$arrDescription[] = array ("name" => "LANG_RETAIN_STATUS_INFO", "string" => translate("Retain status info")); -$arrDescription[] = array ("name" => "LANG_RETAIN_NONSTATUS_INFO", "string" => translate("Retain nonstatus info")); -$arrDescription[] = array ("name" => "LANG_MEMBERS", "string" => translate("Members")); -$arrDescription[] = array ("name" => "LANG_GROUP_MEMBERS", "string" => translate("Group members")); -$arrDescription[] = array ("name" => "LANG_COMMON_SETTINGS", "string" => translate("Common settings")); -$arrDescription[] = array ("name" => "LANG_SERVICE_SETTINGS", "string" => translate("Service settings")); -$arrDescription[] = array ("name" => "LANG_SERVICE_SETTINGS_DESC", "string" => translate("Add this host configuration to existing service definitions")); -$arrDescription[] = array ("name" => "LANG_TEMPLATE_NAME", "string" => translate("Template name")); -$arrDescription[] = array ("name" => "LANG_PARENTS", "string" => translate("Parents")); -$arrDescription[] = array ("name" => "LANG_HOST_GROUPS", "string" => translate("Host groups")); -$arrDescription[] = array ("name" => "LANG_CHECK_COMMAND", "string" => translate("Check command")); -$arrDescription[] = array ("name" => "LANG_COMMAND_VIEW", "string" => translate("Command view")); -$arrDescription[] = array ("name" => "LANG_ADDITIONAL_TEMPLATES", "string" => translate("Additional templates")); -$arrDescription[] = array ("name" => "LANG_CHECK_SETTINGS", "string" => translate("Check settings")); -$arrDescription[] = array ("name" => "LANG_INITIAL_STATE", "string" => translate("Initial state")); -$arrDescription[] = array ("name" => "LANG_RETRY_INTERVAL", "string" => translate("Retry interval")); -$arrDescription[] = array ("name" => "LANG_MAX_CHECK_ATTEMPTS", "string" => translate("Max check attempts")); -$arrDescription[] = array ("name" => "LANG_CHECK_INTERVAL", "string" => translate("Check interval")); -$arrDescription[] = array ("name" => "LANG_ACTIVE_CHECKS_ENABLED", "string" => translate("Active checks enabled")); -$arrDescription[] = array ("name" => "LANG_PASSIVE_CHECKS_ENABLED", "string" => translate("Passive checks enabled")); -$arrDescription[] = array ("name" => "LANG_CHECK_PERIOD", "string" => translate("Check period")); -$arrDescription[] = array ("name" => "LANG_FRESHNESS_TRESHOLD", "string" => translate("Freshness treshold")); -$arrDescription[] = array ("name" => "LANG_CHECK_FRESHNESS", "string" => translate("Check freshness")); -$arrDescription[] = array ("name" => "LANG_OBSESS_OVER_HOST", "string" => translate("Obsess over host")); -$arrDescription[] = array ("name" => "LANG_OBSESS_OVER_SERVICE", "string" => translate("Obsess over service")); -$arrDescription[] = array ("name" => "LANG_EVENT_HANDLER", "string" => translate("Event handler")); -$arrDescription[] = array ("name" => "LANG_EVENT_HANDLER_ENABLED", "string" => translate("Event handler enabled")); -$arrDescription[] = array ("name" => "LANG_LOW_FLAP_THRESHOLD", "string" => translate("Low flap threshold")); -$arrDescription[] = array ("name" => "LANG_HIGH_FLAP_THRESHOLD", "string" => translate("High flap threshold")); -$arrDescription[] = array ("name" => "LANG_FLAP_DETECTION_ENABLED", "string" => translate("Flap detection enabled")); -$arrDescription[] = array ("name" => "LANG_FLAP_DETECTION_OPTIONS", "string" => translate("Flap detection options")); -$arrDescription[] = array ("name" => "LANG_RETAIN_STATUS_INFORMATION", "string" => translate("Retain status information")); -$arrDescription[] = array ("name" => "LANG_RETAIN_NOSTATUS_INFORMATION","string" => translate("Retain nostatus information")); -$arrDescription[] = array ("name" => "LANG_PROCESS_PERF_DATA", "string" => translate("Process perf data")); -$arrDescription[] = array ("name" => "LANG_ALARM_SETTINGS", "string" => translate("Alarm settings")); -$arrDescription[] = array ("name" => "LANG_CONTACTS", "string" => translate("Contacts")); -$arrDescription[] = array ("name" => "LANG_CONTACT_GROUPS", "string" => translate("Contact groups")); -$arrDescription[] = array ("name" => "LANG_NOTIFICATION_PERIOD", "string" => translate("Notification period")); -$arrDescription[] = array ("name" => "LANG_NOTIFICATION_OPTIONS", "string" => translate("Notification options")); -$arrDescription[] = array ("name" => "LANG_NOTIFICATION_INTERVAL", "string" => translate("Notification interval")); -$arrDescription[] = array ("name" => "LANG_FIRST_NOTIFICATION_DELAY", "string" => translate("First notification delay")); -$arrDescription[] = array ("name" => "LANG_NOTIFICATION_ENABLED", "string" => translate("Notification enabled")); -$arrDescription[] = array ("name" => "LANG_STALKING_OPTIONS", "string" => translate("Stalking options")); -$arrDescription[] = array ("name" => "LANG_ADDON_SETTINGS", "string" => translate("Addon settings")); -$arrDescription[] = array ("name" => "LANG_NOTES", "string" => translate("Notes")); -$arrDescription[] = array ("name" => "LANG_VRML_IMAGE", "string" => translate("VRML image")); -$arrDescription[] = array ("name" => "LANG_NOTES_URL", "string" => translate("Notes URL")); -$arrDescription[] = array ("name" => "LANG_STATUS_IMAGE", "string" => translate("Status image")); -$arrDescription[] = array ("name" => "LANG_ICON_IMAGE", "string" => translate("Icon image")); -$arrDescription[] = array ("name" => "LANG_ACTION_URL", "string" => translate("Action URL")); -$arrDescription[] = array ("name" => "LANG_2D_COORDS", "string" => translate("2D coords")); -$arrDescription[] = array ("name" => "LANG_3D_COORDS", "string" => translate("3D coords")); -$arrDescription[] = array ("name" => "LANG_ICON_IMAGE_ALT_TEXT", "string" => translate("Icon image ALT text")); -$arrDescription[] = array ("name" => "LANG_STANDARD", "string" => translate("standard")); -$arrDescription[] = array ("name" => "LANG_ON", "string" => translate("on")); -$arrDescription[] = array ("name" => "LANG_OFF", "string" => translate("off")); -$arrDescription[] = array ("name" => "LANG_SKIP", "string" => translate("skip")); -$arrDescription[] = array ("name" => "LANG_FREE_VARIABLE_DEFINITIONS", "string" => translate("Free variable definitions")); -$arrDescription[] = array ("name" => "LANG_VARIABLE_NAME", "string" => translate("Variable name")); -$arrDescription[] = array ("name" => "LANG_VARIABLE_VALUE", "string" => translate("Variable value")); -$arrDescription[] = array ("name" => "DELETE", "string" => translate("Delete")); -$arrDescription[] = array ("name" => "DUPLICATE", "string" => translate("Copy")); -$arrDescription[] = array ("name" => "ACTIVATE", "string" => translate("Activate")); -$arrDescription[] = array ("name" => "DEACTIVATE", "string" => translate("Deactivate")); -$arrDescription[] = array ("name" => "INFO", "string" => translate("Information")); -$arrDescription[] = array ("name" => "WRITE_CONFIG", "string" => translate("Write config file")); -$arrDescription[] = array ("name" => "LANG_DELETESINGLE", "string" => translate("Do you really want to delete this database entry:")); -$arrDescription[] = array ("name" => "LANG_DELETEOK", "string" => translate("Do you really want to delete all marked entries?")); -$arrDescription[] = array ("name" => "LANG_MARKALL", "string" => translate("Mark all shown datasets")); -$arrDescription[] = array ("name" => "LANG_FILE", "string" => translate("File")); -$arrDescription[] = array ("name" => "LANG_WRITE_CONF_ALL", "string" => translate("Write all config files")); -$arrDescription[] = array ("name" => "LANG_ADDRESS", "string" => translate("Address")); -$arrDescription[] = array ("name" => "LANG_DISPLAY_NAME", "string" => translate("Display name")); -$arrDescription[] = array ("name" => "LANG_USE_THIS_AS_TEMPLATE", "string" => translate("Use this configuration as template")); -$arrDescription[] = array ("name" => "LANG_GENERIC_NAME", "string" => translate("Generic name")); -$arrDescription[] = array ("name" => "LANG_HOST_NAME", "string" => translate("Host name")); -$arrDescription[] = array ("name" => "FILL_ALLFIELDS", "string" => translate("Please fill in all fields marked with an *")); -$arrDescription[] = array ("name" => "FILL_ILLEGALCHARS", "string" => translate("The following field contains not permitted characters:")); -$arrDescription[] = array ("name" => "FILL_BOXES", "string" => translate("Please check at least one option from:")); -$arrDescription[] = array ("name" => "LANG_HOSTGROUP_NAME", "string" => translate("Host group name")); -$arrDescription[] = array ("name" => "LANG_HOSTGROUP_MEMBERS", "string" => translate("Host group members")); -$arrDescription[] = array ("name" => "LANG_HOSTS", "string" => translate("Hosts")); -$arrDescription[] = array ("name" => "LANG_SERVICE_DESCRIPTION", "string" => translate("Service description")); -$arrDescription[] = array ("name" => "LANG_SERVICEGROUPS", "string" => translate("Service groups")); -$arrDescription[] = array ("name" => "LANG_IS_VOLATILE", "string" => translate("Is volatile")); -$arrDescription[] = array ("name" => "LANG_PARALLELIZE_CHECK", "string" => translate("Parallelize checks")); -$arrDescription[] = array ("name" => "LANG_CONFIGFILTER", "string" => translate("Config name filter")); -$arrDescription[] = array ("name" => "LANG_CONFIG_NAME", "string" => translate("Config name")); -$arrDescription[] = array ("name" => "LANG_IMPORT_DIRECTORY", "string" => translate("Import directory")); -$arrDescription[] = array ("name" => "LANG_INSERT_ALL_VARIABLE", "string" => translate("Please insert a variable name and a variable definition")); -$arrDescription[] = array ("name" => "LANG_MUST_BUT_TEMPLATE", "string" => "".translate("Warning:")."<\/b> ".translate("You have not filled in some required fields!

If this values are set by a template, you can save anyway - otherwise you will get an invalid configuration!")); -$arrDescription[] = array ("name" => "LANG_TPLNAME", "string" => translate("Template name")); -$arrDescription[] = array ("name" => "LANG_NAGIOS_BASEDIR", "string" => translate("Nagios base directory")); -$arrDescription[] = array ("name" => "LANG_WRITE_CONFIG", "string" => translate("Write config")); -$arrDescription[] = array ("name" => "FILL_ARGUMENTS", "string" => "".translate("Warning:")."<\/b> ".translate("You have not filled in all command arguments (ARGx) for your selected command!

If this arguments are optional, you can save anyway - otherwise you will get an invalid configuration!")); -$arrDescription[] = array ("name" => "LANG_SERVICEGROUP_MEMBERS", "string" => translate("Service group members")); -$arrDescription[] = array ("name" => "LANG_SERVICEGROUP_NAME", "string" => translate("Service group name")); -$arrDescription[] = array ("name" => "LANG_DEPENDHOSTS", "string" => translate("Dependent hosts")); -$arrDescription[] = array ("name" => "LANG_DEPENDHOSTGRS", "string" => translate("Dependent hostgroups")); -$arrDescription[] = array ("name" => "LANG_HOSTGROUPS", "string" => translate("Hostgroups")); -$arrDescription[] = array ("name" => "LANG_INHERIT", "string" => translate("Inherit parents")); -$arrDescription[] = array ("name" => "LANG_EXECFAILCRIT", "string" => translate("Execution failure criteria")); -$arrDescription[] = array ("name" => "LANG_NOTIFFAILCRIT", "string" => translate("Nofification failure criteria")); -$arrDescription[] = array ("name" => "LANG_DEPENDENCY_PERIOD", "string" => translate("Dependency period")); -$arrDescription[] = array ("name" => "LANG_ESCALATION_PERIOD", "string" => translate("Escalation period")); -$arrDescription[] = array ("name" => "LANG_ESCALATION_OPTIONS", "string" => translate("Escalation options")); -$arrDescription[] = array ("name" => "LANG_FIRST_NOTIFICATION", "string" => translate("First notification")); -$arrDescription[] = array ("name" => "LANG_LAST_NOTIFICATION", "string" => translate("Last notification")); -$arrDescription[] = array ("name" => "LANG_DEPENDSERVICES", "string" => translate("Dependent services")); -$arrDescription[] = array ("name" => "LANG_SERVICES", "string" => translate("Services")); -$arrDescription[] = array ("name" => "LANG_DEPENDSERVICEGROUPS", "string" => translate("Dependent servicegroups")); -$arrDescription[] = array ("name" => "LANG_HELP", "string" => translate("Help")); -$arrDescription[] = array ("name" => "LANG_CALENDAR", "string" => translate("Calendar")); -$arrDescription[] = array ("name" => "LANG_GROUPNAME", "string" => translate("Group name")); -$arrDescription[] = array ("name" => "LANG_USERS", "string" => translate("Users")); -$arrDescription[] = array ("name" => "LANG_ACCESS_GROUP", "string" => translate("Access group")); -$arrDescription[] = array ("name" => "LANG_USER_DEFINITIONS", "string" => translate("User definitions")); -$arrDescription[] = array ("name" => "LANG_USER_NAME", "string" => translate("User name")); -$arrDescription[] = array ("name" => "LANG_USER_RIGHTS", "string" => translate("User rights")); -$arrDescription[] = array ("name" => "LANG_OBJECT_ACCESS_RESTRICTIONS", "string" => translate("Object access restrictions")); -$arrDescription[] = array ("name" => "LANG_ADMIN_ENABLE", "string" => translate("Enable group administration")); -$arrDescription[] = array ("name" => "LANG_SHOW_RELATION_DATA", "string" => translate("Show relation data")); -$arrDescription[] = array ("name" => "LANG_HIDE_RELATION_DATA", "string" => translate("Hide relation data")); -$arrDescription[] = array ("name" => "LANG_CONFIG_TARGET", "string" => translate("Configuration target")); -$arrDescription[] = array ("name" => "LANG_LANGUAGE", "string" => translate("User language")); -$arrDescription[] = array ("name" => "LANG_STANDARD_DOMAIN", "string" => translate("Standard domain")); -$arrDescription[] = array ("name" => "LANG_SERVICES_WARNING", "string" => "".translate("Warning:")." ".translate("The associated services must be additionally written to the files. Only writing the host configuration is not sufficient because the modification is stored inside the service files!")); +$arrDescription[] = array('name' => 'LANG_DOMAIN', 'string' => translate('Domain')); +$arrDescription[] = array('name' => 'LANG_DESCRIPTION', 'string' => translate('Description')); +$arrDescription[] = array('name' => 'LANG_SERVER_NAMEe', 'string' => translate('Server name')); +$arrDescription[] = array('name' => 'LANG_METHOD', 'string' => translate('Method')); +$arrDescription[] = array('name' => 'LANG_USERNAME', 'string' => translate('Username')); +$arrDescription[] = array('name' => 'LANG_PASSWORD', 'string' => translate('Password')); +$arrDescription[] = array('name' => 'LANG_SSH_KEY', + 'string' => translate('Directory with SSH key pair')); +$arrDescription[] = array('name' => 'LANG_FTPS', + 'string' => translate('Use encrypted FTP (FTPS)')); +$arrDescription[] = array('name' => 'LANG_SERVER_NAME', 'string' => translate('Server name')); +$arrDescription[] = array('name' => 'LANG_CONFIGURATION_DIRECTORIES', + 'string' => translate('Configuration directories')); +$arrDescription[] = array('name' => 'LANG_NAGIOS_DIRECTORIES', + 'string' => translate('Nagios configuration files and directories')); +$arrDescription[] = array('name' => 'LANG_BASE_DIRECTORY', 'string' => translate('Base directory')); +$arrDescription[] = array('name' => 'LANG_HOST_DIRECTORY', 'string' => translate('Host directory')); +$arrDescription[] = array('name' => 'LANG_SERVICE_DIRECTORY', 'string' => translate('Service directory')); +$arrDescription[] = array('name' => 'LANG_BACKUP_DIRECTORY', 'string' => translate('Backup directory')); +$arrDescription[] = array('name' => 'LANG_HOST_BACKUP_DIRECTORY', 'string' => translate('Host backup directory')); +$arrDescription[] = array('name' => 'LANG_SERVICE_BACKUP_DIRECTORY', + 'string' => translate('Service backup directory')); +$arrDescription[] = array('name' => 'LANG_PICTURE_DIRECTORY', 'string' => translate('Picture base directory')); +$arrDescription[] = array('name' => 'LANG_NAGIOS_COMMAND_FILE', 'string' => translate('Nagios command file')); +$arrDescription[] = array('name' => 'LANG_NAGIOS_BINARY_FILE', 'string' => translate('Nagios binary file')); +$arrDescription[] = array('name' => 'LANG_NAGIOS_PROCESS_FILE', 'string' => translate('Nagios process file')); +$arrDescription[] = array('name' => 'LANG_NAGIOS_CONFIG_FILE', 'string' => translate('Nagios config file')); +$arrDescription[] = array('name' => 'LANG_NAGIOS_CGI_FILE', 'string' => translate('Nagios cgi file')); +$arrDescription[] = array('name' => 'LANG_NAGIOS_RESOURCE_FILE', 'string' => translate('Nagios resource file')); +$arrDescription[] = array('name' => 'LANG_NAGIOS_VERSION', 'string' => translate('Nagios version')); +$arrDescription[] = array('name' => 'LANG_ENABLE_COMMON_DOMAIN', 'string' => translate('Use common domain')); +$arrDescription[] = array('name' => 'LANG_ENABLE_UTF8_DECODE', + 'string' => translate('Decode UTF8 data in config files')); +$arrDescription[] = array('name' => 'LANG_ACCESS_KEY_HOLES', 'string' => translate('Access key holes')); +$arrDescription[] = array('name' => 'LANG_ACCESS_KEYS', 'string' => translate('Access keys')); +$arrDescription[] = array('name' => 'LANG_ACTIVE', 'string' => translate('Active')); +$arrDescription[] = array('name' => 'LANG_REGISTERED', 'string' => translate('Registered')); +$arrDescription[] = array('name' => 'LANG_REQUIRED', 'string' => translate('required')); +$arrDescription[] = array('name' => 'LANG_SAVE', 'string' => translate('Save')); +$arrDescription[] = array('name' => 'LANG_ABORT', 'string' => translate('Abort')); +$arrDescription[] = array('name' => 'LANG_FUNCTION', 'string' => translate('Function')); +$arrDescription[] = array('name' => 'LANG_MARKED', 'string' => translate('Marked')); +$arrDescription[] = array('name' => 'LANG_DO_IT', 'string' => translate('Do it')); +$arrDescription[] = array('name' => 'LANG_ADD', 'string' => translate('Add')); +$arrDescription[] = array('name' => 'LANG_FORMCHECK', 'string' => translate('Form check')); +$arrDescription[] = array('name' => 'LANG_SECURE_QUESTION', 'string' => translate('Secure question')); +$arrDescription[] = array('name' => 'LANG_YES', 'string' => translate('Yes')); +$arrDescription[] = array('name' => 'LANG_NO', 'string' => translate('No')); +$arrDescription[] = array('name' => 'LANG_TIME', 'string' => translate('Time')); +$arrDescription[] = array('name' => 'LANG_USER', 'string' => translate('User')); +$arrDescription[] = array('name' => 'LANG_IP', 'string' => translate('IP Address')); +$arrDescription[] = array('name' => 'LANG_ENTRY', 'string' => translate('Entry')); +$arrDescription[] = array('name' => 'LANG_FROM', 'string' => translate('From')); +$arrDescription[] = array('name' => 'LANG_TO', 'string' => translate('To')); +$arrDescription[] = array('name' => 'LANG_DELETE_LOG_ENTRIES', 'string' => translate('Delete log entries')); +$arrDescription[] = array('name' => 'LANG_COPY', 'string' => translate('Copy')); +$arrDescription[] = array('name' => 'LANG_DELETE', 'string' => translate('Delete')); +$arrDescription[] = array('name' => 'LANG_MODIFY', 'string' => translate('Modify')); +$arrDescription[] = array('name' => 'LANG_CONFIRM_PASSWORD', 'string' => translate('Confirm password')); +$arrDescription[] = array('name' => 'LANG_OLD_PASSWORD', 'string' => translate('Old password')); +$arrDescription[] = array('name' => 'LANG_NEW_PASSWORD', 'string' => translate('New password')); +$arrDescription[] = array('name' => 'LANG_CHANGE_PASSWORD', 'string' => translate('Change password')); +$arrDescription[] = array('name' => 'LANG_MENU_PAGE', 'string' => translate('Menu page')); +$arrDescription[] = array('name' => 'LANG_SEARCH_STRING', 'string' => translate('Search string')); +$arrDescription[] = array('name' => 'LANG_SEARCH', 'string' => translate('Search')); +$arrDescription[] = array('name' => 'LANG_DELETE_SEARCH', 'string' => translate('Reset filter')); +$arrDescription[] = array('name' => 'LANG_WRITE_CONFIG_FILE', 'string' => translate('Write config file')); +$arrDescription[] = array('name' => 'LANG_DOWNLOAD', 'string' => translate('Download')); +$arrDescription[] = array('name' => 'LANG_DUPLICATE', 'string' => translate('Copy')); +$arrDescription[] = array('name' => 'LANG_COMMAND', 'string' => translate('Command')); +$arrDescription[] = array('name' => 'LANG_COMMAND_LINE', 'string' => translate('Command line')); +$arrDescription[] = array('name' => 'LANG_COMMAND_TYPE', 'string' => translate('Command type')); +$arrDescription[] = array('name' => 'LANG_TIME_PERIOD', 'string' => translate('Time period')); +$arrDescription[] = array('name' => 'LANG_EXCLUDE', 'string' => translate('Exclude')); +$arrDescription[] = array('name' => 'LANG_INCLUDE', 'string' => translate('Include')); +$arrDescription[] = array('name' => 'LANG_TIME_DEFINITIONS', 'string' => translate('Time definitions')); +$arrDescription[] = array('name' => 'LANG_WEEKDAY', 'string' => translate('Weekday')); +$arrDescription[] = array('name' => 'LANG_TIME_RANGE', 'string' => translate('Time range')); +$arrDescription[] = array('name' => 'LANG_TIME_DEFINITION', 'string' => translate('Time definition')); +$arrDescription[] = array('name' => 'LANG_INSERT', 'string' => translate('Insert')); +$arrDescription[] = array('name' => 'LANG_MODIFY_SELECTION', 'string' => translate('Modify selection')); +$arrDescription[] = array('name' => 'LANG_CONTACT_NAME', 'string' => translate('Contact name')); +$arrDescription[] = array('name' => 'LANG_CONTACT_GROUP', 'string' => translate('Contact group')); +$arrDescription[] = array('name' => 'LANG_MINIMUM_IMPORTANCE', 'string' => translate('Minimum importance')); +$arrDescription[] = array('name' => 'LANG_TIME_PERIOD_HOSTS', 'string' => translate('Time period hosts')); +$arrDescription[] = array('name' => 'LANG_TIME_PERIOD_SERVICES', 'string' => translate('Time period services')); +$arrDescription[] = array('name' => 'LANG_HOST_OPTIONS', 'string' => translate('Host options')); +$arrDescription[] = array('name' => 'LANG_SERVICE_OPTIONS', 'string' => translate('Service options')); +$arrDescription[] = array('name' => 'LANG_HOST_COMMAND', 'string' => translate('Host command')); +$arrDescription[] = array('name' => 'LANG_SERVICE_COMMAND', 'string' => translate('Service command')); +$arrDescription[] = array('name' => 'LANG_EMAIL_ADDRESS', 'string' => translate('EMail address')); +$arrDescription[] = array('name' => 'LANG_PAGER_NUMBER', 'string' => translate('Pager number')); +$arrDescription[] = array('name' => 'LANG_ADDON_ADDRESS', 'string' => translate('Addon address')); +$arrDescription[] = array('name' => 'LANG_HOST_NOTIF_ENABLE', 'string' => translate('Host notif. enable')); +$arrDescription[] = array('name' => 'LANG_SERVICE_NOTIF_ENABLE', 'string' => translate('Service notif. enable')); +$arrDescription[] = array('name' => 'LANG_CAN_SUBMIT_COMMANDS', 'string' => translate('Can submit commands')); +$arrDescription[] = array('name' => 'LANG_RETAIN_STATUS_INFO', 'string' => translate('Retain status info')); +$arrDescription[] = array('name' => 'LANG_RETAIN_NONSTATUS_INFO', 'string' => translate('Retain non-status info')); +$arrDescription[] = array('name' => 'LANG_MEMBERS', 'string' => translate('Members')); +$arrDescription[] = array('name' => 'LANG_GROUP_MEMBERS', 'string' => translate('Group members')); +$arrDescription[] = array('name' => 'LANG_COMMON_SETTINGS', 'string' => translate('Common settings')); +$arrDescription[] = array('name' => 'LANG_SERVICE_SETTINGS', 'string' => translate('Service settings')); +$arrDescription[] = array('name' => 'LANG_SERVICE_SETTINGS_DESC', + 'string' => translate('Add this host configuration to existing service definitions')); +$arrDescription[] = array('name' => 'LANG_TEMPLATE_NAME', 'string' => translate('Template name')); +$arrDescription[] = array('name' => 'LANG_PARENTS', 'string' => translate('Parents')); +$arrDescription[] = array('name' => 'LANG_PARENT_SERVICES', 'string' => translate('Parent services')); +$arrDescription[] = array('name' => 'LANG_HOST_GROUPS', 'string' => translate('Host groups')); +$arrDescription[] = array('name' => 'LANG_CHECK_COMMAND', 'string' => translate('Check command')); +$arrDescription[] = array('name' => 'LANG_COMMAND_VIEW', 'string' => translate('Command view')); +$arrDescription[] = array('name' => 'LANG_ADDITIONAL_TEMPLATES', 'string' => translate('Additional templates')); +$arrDescription[] = array('name' => 'LANG_CHECK_SETTINGS', 'string' => translate('Check settings')); +$arrDescription[] = array('name' => 'LANG_INITIAL_STATE', 'string' => translate('Initial state')); +$arrDescription[] = array('name' => 'LANG_RETRY_INTERVAL', 'string' => translate('Retry interval')); +$arrDescription[] = array('name' => 'LANG_MAX_CHECK_ATTEMPTS', 'string' => translate('Max check attempts')); +$arrDescription[] = array('name' => 'LANG_CHECK_INTERVAL', 'string' => translate('Check interval')); +$arrDescription[] = array('name' => 'LANG_ACTIVE_CHECKS_ENABLED', 'string' => translate('Active checks enabled')); +$arrDescription[] = array('name' => 'LANG_PASSIVE_CHECKS_ENABLED', 'string' => translate('Passive checks enabled')); +$arrDescription[] = array('name' => 'LANG_CHECK_PERIOD', 'string' => translate('Check period')); +$arrDescription[] = array('name' => 'LANG_FRESHNESS_TRESHOLD', 'string' => translate('Freshness treshold')); +$arrDescription[] = array('name' => 'LANG_CHECK_FRESHNESS', 'string' => translate('Check freshness')); +$arrDescription[] = array('name' => 'LANG_OBSESS_OVER_HOST', 'string' => translate('Obsess over host')); +$arrDescription[] = array('name' => 'LANG_OBSESS_OVER_SERVICE', 'string' => translate('Obsess over service')); +$arrDescription[] = array('name' => 'LANG_EVENT_HANDLER', 'string' => translate('Event handler')); +$arrDescription[] = array('name' => 'LANG_EVENT_HANDLER_ENABLED', 'string' => translate('Event handler enabled')); +$arrDescription[] = array('name' => 'LANG_LOW_FLAP_THRESHOLD', 'string' => translate('Low flap threshold')); +$arrDescription[] = array('name' => 'LANG_HIGH_FLAP_THRESHOLD', 'string' => translate('High flap threshold')); +$arrDescription[] = array('name' => 'LANG_FLAP_DETECTION_ENABLED', 'string' => translate('Flap detection enabled')); +$arrDescription[] = array('name' => 'LANG_FLAP_DETECTION_OPTIONS', 'string' => translate('Flap detection options')); +$arrDescription[] = array('name' => 'LANG_RETAIN_STATUS_INFORMATION', + 'string' => translate('Retain status information')); +$arrDescription[] = array('name' => 'LANG_RETAIN_NOSTATUS_INFORMATION', + 'string' => translate('Retain non-status information')); +$arrDescription[] = array('name' => 'LANG_PROCESS_PERF_DATA', 'string' => translate('Process perf data')); +$arrDescription[] = array('name' => 'LANG_ALARM_SETTINGS', 'string' => translate('Alarm settings')); +$arrDescription[] = array('name' => 'LANG_CONTACTS', 'string' => translate('Contacts')); +$arrDescription[] = array('name' => 'LANG_CONTACT_GROUPS', 'string' => translate('Contact groups')); +$arrDescription[] = array('name' => 'LANG_NOTIFICATION_PERIOD', 'string' => translate('Notification period')); +$arrDescription[] = array('name' => 'LANG_NOTIFICATION_OPTIONS', 'string' => translate('Notification options')); +$arrDescription[] = array('name' => 'LANG_NOTIFICATION_INTERVAL', 'string' => translate('Notification interval')); +$arrDescription[] = array('name' => 'LANG_FIRST_NOTIFICATION_DELAY', + 'string' => translate('First notification delay')); +$arrDescription[] = array('name' => 'LANG_NOTIFICATION_ENABLED', 'string' => translate('Notification enabled')); +$arrDescription[] = array('name' => 'LANG_IMPORTANCE', 'string' => translate('Importance')); +$arrDescription[] = array('name' => 'LANG_STALKING_OPTIONS', 'string' => translate('Stalking options')); +$arrDescription[] = array('name' => 'LANG_ADDON_SETTINGS', 'string' => translate('Addon settings')); +$arrDescription[] = array('name' => 'LANG_NOTES', 'string' => translate('Notes')); +$arrDescription[] = array('name' => 'LANG_VRML_IMAGE', 'string' => translate('VRML image')); +$arrDescription[] = array('name' => 'LANG_NOTES_URL', 'string' => translate('Notes URL')); +$arrDescription[] = array('name' => 'LANG_STATUS_IMAGE', 'string' => translate('Status image')); +$arrDescription[] = array('name' => 'LANG_ICON_IMAGE', 'string' => translate('Icon image')); +$arrDescription[] = array('name' => 'LANG_ACTION_URL', 'string' => translate('Action URL')); +$arrDescription[] = array('name' => 'LANG_2D_COORDS', 'string' => translate('2D coords')); +$arrDescription[] = array('name' => 'LANG_3D_COORDS', 'string' => translate('3D coords')); +$arrDescription[] = array('name' => 'LANG_ICON_IMAGE_ALT_TEXT', 'string' => translate('Icon image ALT text')); +$arrDescription[] = array('name' => 'LANG_STANDARD', 'string' => translate('standard')); +$arrDescription[] = array('name' => 'LANG_ON', 'string' => translate('on')); +$arrDescription[] = array('name' => 'LANG_OFF', 'string' => translate('off')); +$arrDescription[] = array('name' => 'LANG_SKIP', 'string' => translate('skip')); +$arrDescription[] = array('name' => 'LANG_FREE_VARIABLE_DEFINITIONS', + 'string' => translate('Free variable definitions')); +$arrDescription[] = array('name' => 'LANG_VARIABLE_NAME', 'string' => translate('Variable name')); +$arrDescription[] = array('name' => 'LANG_VARIABLE_VALUE', 'string' => translate('Variable value')); +$arrDescription[] = array('name' => 'DELETE', 'string' => translate('Delete')); +$arrDescription[] = array('name' => 'DUPLICATE', 'string' => translate('Copy')); +$arrDescription[] = array('name' => 'ACTIVATE', 'string' => translate('Activate')); +$arrDescription[] = array('name' => 'DEACTIVATE', 'string' => translate('Deactivate')); +$arrDescription[] = array('name' => 'INFO', 'string' => translate('Information')); +$arrDescription[] = array('name' => 'WRITE_CONFIG', 'string' => translate('Write config file')); +$arrDescription[] = array('name' => 'LANG_DELETESINGLE', + 'string' => translate('Do you really want to delete this database entry:')); +$arrDescription[] = array('name' => 'LANG_DELETEOK', + 'string' => translate('Do you really want to delete all marked entries?')); +$arrDescription[] = array('name' => 'LANG_MARKALL', + 'string' => translate('Mark all shown datasets')); +$arrDescription[] = array('name' => 'LANG_FILE', 'string' => translate('File')); +$arrDescription[] = array('name' => 'LANG_WRITE_CONF_ALL', 'string' => translate('Write all config files')); +$arrDescription[] = array('name' => 'LANG_ADDRESS', 'string' => translate('Address')); +$arrDescription[] = array('name' => 'LANG_DISPLAY_NAME', 'string' => translate('Display name')); +$arrDescription[] = array('name' => 'LANG_USE_THIS_AS_TEMPLATE', + 'string' => translate('Use this configuration as a template')); +$arrDescription[] = array('name' => 'LANG_GENERIC_NAME', 'string' => translate('Generic name')); +$arrDescription[] = array('name' => 'LANG_HOST_NAME', 'string' => translate('Host name')); +$arrDescription[] = array('name' => 'FILL_ALLFIELDS', + 'string' => translate('Please fill in all fields marked with an *')); +$arrDescription[] = array('name' => 'FILL_ILLEGALCHARS', + 'string' => translate('The following field contains illegal characters:')); +$arrDescription[] = array('name' => 'FILL_BOXES', + 'string' => translate('Please check at least one option from:')); +$arrDescription[] = array('name' => 'LANG_HOSTGROUP_NAME', 'string' => translate('Host group name')); +$arrDescription[] = array('name' => 'LANG_HOSTGROUP_MEMBERS', 'string' => translate('Host group members')); +$arrDescription[] = array('name' => 'LANG_HOSTS', 'string' => translate('Hosts')); +$arrDescription[] = array('name' => 'LANG_SERVICE_DESCRIPTION', 'string' => translate('Service description')); +$arrDescription[] = array('name' => 'LANG_SERVICEGROUPS', 'string' => translate('Service groups')); +$arrDescription[] = array('name' => 'LANG_IS_VOLATILE', 'string' => translate('Is volatile')); +$arrDescription[] = array('name' => 'LANG_PARALLELIZE_CHECK', 'string' => translate('Parallelize checks')); +$arrDescription[] = array('name' => 'LANG_CONFIGFILTER', 'string' => translate('Config name filter')); +$arrDescription[] = array('name' => 'LANG_CONFIG_NAME', 'string' => translate('Config name')); +$arrDescription[] = array('name' => 'LANG_IMPORT_DIRECTORY', 'string' => translate('Import directory')); +$arrDescription[] = array('name' => 'LANG_INSERT_ALL_VARIABLE', + 'string' => translate('Please insert a variable name and a variable definition')); +$arrDescription[] = array('name' => 'LANG_MUST_BUT_TEMPLATE', + 'string' => '' .translate('Warning:'). ' ' .translate('You have not filled in some required fields!

' + . 'If this values are set by a template, you can save anyway - otherwise you will get an invalid ' + . 'configuration!')); +$arrDescription[] = array('name' => 'LANG_TPLNAME', 'string' => translate('Template name')); +$arrDescription[] = array('name' => 'LANG_NAGIOS_BASEDIR', 'string' => translate('Nagios base directory')); +$arrDescription[] = array('name' => 'LANG_WRITE_CONFIG', 'string' => translate('Write config')); +$arrDescription[] = array('name' => 'FILL_ARGUMENTS', + 'string' => '' .translate('Warning:'). ' ' .translate('You have not filled in all command arguments (ARGx) ' + . 'for your selected command!

If this arguments are optional, you can save anyway - otherwise ' + . 'you will get an invalid configuration!')); +$arrDescription[] = array('name' => 'LANG_SERVICEGROUP_MEMBERS', 'string' => translate('Service group members')); +$arrDescription[] = array('name' => 'LANG_SERVICEGROUP_NAME', 'string' => translate('Service group name')); +$arrDescription[] = array('name' => 'LANG_DEPENDHOSTS', 'string' => translate('Dependent hosts')); +$arrDescription[] = array('name' => 'LANG_DEPENDHOSTGRS', 'string' => translate('Dependent hostgroups')); +$arrDescription[] = array('name' => 'LANG_HOSTGROUPS', 'string' => translate('Hostgroups')); +$arrDescription[] = array('name' => 'LANG_INHERIT', 'string' => translate('Inherit parents')); +$arrDescription[] = array('name' => 'LANG_EXECFAILCRIT', + 'string' => translate('Execution failure criteria')); +$arrDescription[] = array('name' => 'LANG_NOTIFFAILCRIT', + 'string' => translate('Nofification failure criteria')); +$arrDescription[] = array('name' => 'LANG_DEPENDENCY_PERIOD', 'string' => translate('Dependency period')); +$arrDescription[] = array('name' => 'LANG_ESCALATION_PERIOD', 'string' => translate('Escalation period')); +$arrDescription[] = array('name' => 'LANG_ESCALATION_OPTIONS', 'string' => translate('Escalation options')); +$arrDescription[] = array('name' => 'LANG_FIRST_NOTIFICATION', 'string' => translate('First notification')); +$arrDescription[] = array('name' => 'LANG_LAST_NOTIFICATION', 'string' => translate('Last notification')); +$arrDescription[] = array('name' => 'LANG_DEPENDSERVICES', 'string' => translate('Dependent services')); +$arrDescription[] = array('name' => 'LANG_SERVICES', 'string' => translate('Services')); +$arrDescription[] = array('name' => 'LANG_DEPENDSERVICEGROUPS', + 'string' => translate('Dependent servicegroups')); +$arrDescription[] = array('name' => 'LANG_HELP', 'string' => translate('Help')); +$arrDescription[] = array('name' => 'LANG_CALENDAR', 'string' => translate('Calendar')); +$arrDescription[] = array('name' => 'LANG_GROUPNAME', 'string' => translate('Group name')); +$arrDescription[] = array('name' => 'LANG_USERS', 'string' => translate('Users')); +$arrDescription[] = array('name' => 'LANG_ACCESS_GROUP', 'string' => translate('Access group')); +$arrDescription[] = array('name' => 'LANG_USER_DEFINITIONS', 'string' => translate('User definitions')); +$arrDescription[] = array('name' => 'LANG_USER_NAME', 'string' => translate('User name')); +$arrDescription[] = array('name' => 'LANG_USER_RIGHTS', 'string' => translate('User rights')); +$arrDescription[] = array('name' => 'LANG_OBJECT_ACCESS_RESTRICTIONS', + 'string' => translate('Object access restrictions')); +$arrDescription[] = array('name' => 'LANG_ADMIN_ENABLE', + 'string' => translate('Enable group administration')); +$arrDescription[] = array('name' => 'LANG_SHOW_RELATION_DATA', 'string' => translate('Show relation data')); +$arrDescription[] = array('name' => 'LANG_HIDE_RELATION_DATA', 'string' => translate('Hide relation data')); +$arrDescription[] = array('name' => 'LANG_CONFIG_TARGET', 'string' => translate('Configuration target')); +$arrDescription[] = array('name' => 'LANG_LANGUAGE', 'string' => translate('User language')); +$arrDescription[] = array('name' => 'LANG_STANDARD_DOMAIN', 'string' => translate('Standard domain')); +$arrDescription[] = array('name' => 'LANG_SERVICES_WARNING', + 'string' => '' .translate('Warning:'). ' ' .translate('The associated services must be additionally '. + 'written to the files. Only writing the host configuration is not sufficient because the modification is ' . + 'stored inside the service files!')); // weekdays -$arrDescription[] = array ("name" => "LANG_MONDAY", "string" => translate("Monday")); -$arrDescription[] = array ("name" => "LANG_TUESDAY", "string" => translate("Tuesday")); -$arrDescription[] = array ("name" => "LANG_WEDNESDAY", "string" => translate("Wednesday")); -$arrDescription[] = array ("name" => "LANG_THURSDAY", "string" => translate("Thursday")); -$arrDescription[] = array ("name" => "LANG_FRIDAY", "string" => translate("Friday")); -$arrDescription[] = array ("name" => "LANG_SATURDAY", "string" => translate("Saturday")); -$arrDescription[] = array ("name" => "LANG_SUNDAY", "string" => translate("Sunday")); +$arrDescription[] = array('name' => 'LANG_MONDAY', 'string' => translate('Monday')); +$arrDescription[] = array('name' => 'LANG_TUESDAY', 'string' => translate('Tuesday')); +$arrDescription[] = array('name' => 'LANG_WEDNESDAY', 'string' => translate('Wednesday')); +$arrDescription[] = array('name' => 'LANG_THURSDAY', 'string' => translate('Thursday')); +$arrDescription[] = array('name' => 'LANG_FRIDAY', 'string' => translate('Friday')); +$arrDescription[] = array('name' => 'LANG_SATURDAY', 'string' => translate('Saturday')); +$arrDescription[] = array('name' => 'LANG_SUNDAY', 'string' => translate('Sunday')); if ($SETS['common']['seldisable'] == 0) { - $arrDescription[] = array ("name" => "LANG_CTRLINFO", "string" => translate("Hold CTRL to select
more than one entry")); + $arrDescription[] = array('name' => 'LANG_CTRLINFO', + 'string' => translate('Hold CTRL to select
more than one entry')); } else { - $arrDescription[] = array ("name" => "LANG_CTRLINFO", "string" => " "); + $arrDescription[] = array('name' => 'LANG_CTRLINFO', 'string' => ' '); } // // Quick fix for poEdit for dynamically loaded Parameters @@ -293,4 +332,3 @@ translate('Help editor'); translate('Data domains'); translate('Config targets'); translate('Support'); -?> \ No newline at end of file diff --git a/config/locale/da_DK/LC_MESSAGES/da_DK.po b/config/locale/da_DK/LC_MESSAGES/da_DK.po index b428e8d..00eaf0e 100644 --- a/config/locale/da_DK/LC_MESSAGES/da_DK.po +++ b/config/locale/da_DK/LC_MESSAGES/da_DK.po @@ -2,11 +2,9 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# # Translators: @@ -25,7 +23,6 @@ msgstr "" "Language: da_DK\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "X-Generator: Pootle 2.1.5\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" "X-Poedit-KeywordsList: translate\n" "X-Poedit-SourceCharset: utf-8\n" "X-Poedit-SearchPath-0: .\n" diff --git a/config/locale/de_DE/LC_MESSAGES/de_DE.mo b/config/locale/de_DE/LC_MESSAGES/de_DE.mo index d29e931..b9c393a 100644 Binary files a/config/locale/de_DE/LC_MESSAGES/de_DE.mo and b/config/locale/de_DE/LC_MESSAGES/de_DE.mo differ diff --git a/config/locale/de_DE/LC_MESSAGES/de_DE.po b/config/locale/de_DE/LC_MESSAGES/de_DE.po index 10ed922..25cda0d 100644 --- a/config/locale/de_DE/LC_MESSAGES/de_DE.po +++ b/config/locale/de_DE/LC_MESSAGES/de_DE.po @@ -2,3340 +2,3873 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# # Translators: # Martin , 2012. msgid "" msgstr "" -"Project-Id-Version: NagiosQL\n" +"Project-Id-Version: NagiosQL 3.4\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-09 22:50+0100\n" -"PO-Revision-Date: 2012-03-09 22:50+0100\n" +"POT-Creation-Date: 2018-05-07 16:01+0200\n" +"PO-Revision-Date: 2018-05-07 16:01+0200\n" "Last-Translator: \n" -"Language-Team: German (http://www.transifex.net/projects/p/nagiosql/language/de/)\n" +"Language-Team: German (http://www.transifex.net/projects/p/nagiosql/language/" +"de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: de\n" -"Plural-Forms: nplurals=2; plural=(n != 1)\n" -"X-Generator: Pootle 2.1.5\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.0.6\n" +"X-Poedit-Basepath: ../../../..\n" "X-Poedit-KeywordsList: translate\n" -"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: _archive\n" +"X-Poedit-SearchPathExcluded-1: config/locale\n" +"X-Poedit-SearchPathExcluded-2: functions/yui\n" +"X-Poedit-SearchPathExcluded-3: functions/tinyMCE\n" -#: admin.php:34 +#: admin.php:37 msgid "NagiosQL Administration" msgstr "NagiosQL Verwaltung" -#: admin.php:37 -msgid "Welcome to NagiosQL, the administration module that can be used to easily create, modify and delete configuration files for Nagios. The data is stored in a database and can be written directly to the standard files at any time you want." -msgstr "Willkommen bei NagiosQL, dem Administrationsmodul für das Erstellen, Ändern und Löschen von Nagios Konfigurationsdateien. Die Daten werden in einer Datenbank gespeichert und bei Bedarf als reguläre Konfigurationsdatei geschrieben." +#: admin.php:40 +msgid "" +"Welcome to NagiosQL, the administration module that can be used to easily " +"create, modify and delete configuration files for Nagios. The data is stored " +"in a database and can be written directly to the standard files at any time " +"you want." +msgstr "" +"Willkommen bei NagiosQL, dem Administrationsmodul für das Erstellen, Ändern " +"und Löschen von Nagios Konfigurationsdateien. Die Daten werden in einer " +"Datenbank gespeichert und bei Bedarf als reguläre Konfigurationsdatei " +"geschrieben." -#: index.php:45 -msgid "Welcome to" -msgstr "Willkommen bei" - -#: index.php:46 -msgid "Welcome" -msgstr "Willkommen" - -#: index.php:47 -msgid "Please enter your username and password to access NagiosQL.
If you forgot one of them, please contact your Administrator." -msgstr "Bitte geben Sie Ihren Benutzernamen und Ihr Passwort für den NagiosQL Zugriff ein.
Sollten Sie keinen Zugang besitzen oder Ihr Passwort vergessen haben, so wenden Sie sich an einen Administrator." - -#: index.php:48 -msgid "Username" -msgstr "Benutzername" - -#: index.php:49 -msgid "Password" -msgstr "Passwort" - -#: index.php:50 -msgid "Login" -msgstr "Login" - -#: admin/administration.php:31 +#: admin/administration.php:35 config/fieldvars.php:298 +#: functions/prepend_adm.php:460 functions/prepend_adm.php:469 msgid "Administration" msgstr "Verwaltung" # administration.php -#: admin/administration.php:34 +#: admin/administration.php:38 msgid "Functions to administrate NagiosQL V3" msgstr "Funktionen für die Administration von NagiosQL V3" -#: admin/alarming.php:31 +#: admin/alarming.php:35 config/fieldvars.php:293 config/fieldvars.php:294 msgid "Alarming" msgstr "Alarmierung" # alarming.php -#: admin/alarming.php:34 -msgid "To define contact data, contact templates and contact groups and time periods." -msgstr "Definieren von Kontaktdaten, Kontaktvorlagen, Kontaktgruppen und Zeitperioden." +#: admin/alarming.php:36 +msgid "" +"To define contact data, contact templates and contact groups and time " +"periods." +msgstr "" +"Definieren von Kontaktdaten, Kontaktvorlagen, Kontaktgruppen und " +"Zeitperioden." -#: admin/alarming.php:35 -#: admin/commands.php:35 +#: admin/alarming.php:38 admin/commands.php:38 admin/monitoring.php:40 +#: admin/specials.php:40 msgid "Statistical datas" msgstr "Statistische Daten" -#: admin/alarming.php:36 -#: admin/commands.php:36 +#: admin/alarming.php:39 admin/commands.php:39 admin/monitoring.php:41 +#: admin/specials.php:41 msgid "Group" msgstr "Gruppe" -#: admin/alarming.php:37 -#: admin/commands.php:37 +#: admin/alarming.php:40 admin/commands.php:40 admin/monitoring.php:42 +#: admin/specials.php:42 config/fieldvars.php:55 msgid "Active" msgstr "Aktiv" -#: admin/alarming.php:38 -#: admin/commands.php:38 +#: admin/alarming.php:41 admin/commands.php:41 admin/monitoring.php:43 +#: admin/specials.php:43 msgid "Inactive" msgstr "Inaktiv" -#: admin/alarming.php:45 +#: admin/alarming.php:52 config/fieldvars.php:303 msgid "Contact data" msgstr "Kontaktdaten" -#: admin/alarming.php:51 +#: admin/alarming.php:60 config/fieldvars.php:156 config/fieldvars.php:304 msgid "Contact groups" msgstr "Kontaktgruppen" -#: admin/alarming.php:57 +#: admin/alarming.php:68 config/fieldvars.php:301 msgid "Time periods" msgstr "Zeitperioden" -#: admin/alarming.php:63 +#: admin/alarming.php:76 config/fieldvars.php:330 msgid "Contact templates" msgstr "Kontaktvorlagen" -#: admin/cgicfg.php:61 -#: admin/cgicfg.php:81 +#: admin/cgicfg.php:65 admin/cgicfg.php:87 admin/nagioscfg.php:65 +#: admin/nagioscfg.php:87 admin/verify.php:63 admin/verify.php:85 +#: functions/NagConfigClass.php:2107 msgid "Configuration file successfully written!" msgstr "Konfigurationsdatei erfolgreich geschrieben!" -#: admin/cgicfg.php:62 -#: admin/cgicfg.php:82 +#: admin/cgicfg.php:67 admin/cgicfg.php:89 admin/nagioscfg.php:67 +#: admin/nagioscfg.php:89 functions/NagConfigClass.php:2106 msgid "Configuration successfully written:" msgstr "Konfiguration erfolgreich geschrieben:" -#: admin/cgicfg.php:64 +#: admin/cgicfg.php:69 admin/nagioscfg.php:69 admin/verify.php:65 +#: admin/verify.php:87 functions/NagConfigClass.php:1993 msgid "Cannot open/overwrite the configuration file (check the permissions)!" -msgstr "Kann Konfigurationsdatei nicht öffnen/überschreiben (Berechtigungen prüfen)!" +msgstr "" +"Kann Konfigurationsdatei nicht öffnen/überschreiben (Berechtigungen prüfen)!" -#: admin/cgicfg.php:65 +#: admin/cgicfg.php:71 admin/nagioscfg.php:71 functions/NagConfigClass.php:1992 msgid "Configuration write failed:" msgstr "Schreiben der Konfiguration fehlgeschlagen:" -#: admin/cgicfg.php:85 -msgid "Cannot open/overwrite the configuration file (check the permissions on remote system)!" -msgstr "Kann die Konfigurationsdatei nicht öffnen/überschreiben (Berechtigungen auf dem entfernten System prüfen)!" +#: admin/cgicfg.php:92 admin/nagioscfg.php:92 +msgid "" +"Cannot open/overwrite the configuration file (check the permissions on " +"remote system)!" +msgstr "" +"Kann die Konfigurationsdatei nicht öffnen/überschreiben (Berechtigungen auf " +"dem entfernten System prüfen)!" -#: admin/cgicfg.php:86 +#: admin/cgicfg.php:94 admin/nagioscfg.php:94 msgid "Configuration write failed (remote):" -msgstr "Konfigurationsdatei konnte nicht geschrieben werden (Entfernter Zugriff)" +msgstr "" +"Konfigurationsdatei konnte nicht geschrieben werden (Entfernter Zugriff)" -#: admin/cgicfg.php:94 +#: admin/cgicfg.php:99 admin/nagioscfg.php:99 +msgid "" +"There are no nagios configuration files in common domain, please select a " +"valid domain to edit this files!" +msgstr "" +"In der gemeinsamen Domäne gibt es keine Nagios Konfigurationsdateien. Wählen " +"sie bitte eine gültige Konfigurationsdomäne um diese Dateien zu bearbeiten!" + +#: admin/cgicfg.php:105 msgid "CGI configuration file" msgstr "CGI Konfigurationsdatei" -#: admin/cgicfg.php:117 +#: admin/cgicfg.php:123 admin/nagioscfg.php:123 +#: functions/NagImportClass.php:209 msgid "Cannot open the data file (check the permissions)!" msgstr "Datei kann nicht geöffnet werden (Berechtigungen prüfen)!" -#: admin/cgicfg.php:132 +#: admin/cgicfg.php:139 admin/nagioscfg.php:138 msgid "Cannot open the temporary file" msgstr "Kann die temporäre Datei nicht öffnen" -#: admin/cgicfg.php:136 +#: admin/cgicfg.php:143 admin/nagioscfg.php:142 msgid "Configuration read failed (remote):" msgstr "Konfigurationsdatei konnte nicht gelesen werden (Entfernter Zugriff)" -#: admin/checkcommands.php:53 +#: admin/checkcommands.php:62 msgid "New command inserted:" msgstr "Neuer Befehl eingetragen:" -#: admin/checkcommands.php:54 +#: admin/checkcommands.php:65 msgid "Command modified:" msgstr "Befehl modifiziert:" -#: admin/checkcommands.php:57 -#: admin/configtargets.php:131 -#: admin/contactgroups.php:80 -#: admin/contacts.php:157 -#: admin/contacttemplates.php:157 -#: admin/datadomain.php:58 +#: admin/checkcommands.php:70 admin/configtargets.php:152 +#: admin/contactgroups.php:123 admin/contacts.php:237 +#: admin/contacttemplates.php:242 admin/datadomain.php:72 admin/group.php:115 +#: admin/hostdependencies.php:182 admin/hostescalations.php:182 +#: admin/hostextinfo.php:72 admin/hostgroups.php:124 admin/hosts.php:380 +#: admin/hosttemplates.php:272 admin/password.php:83 +#: admin/servicedependencies.php:290 admin/serviceescalations.php:233 +#: admin/serviceextinfo.php:81 admin/servicegroups.php:126 +#: admin/services.php:387 admin/servicetemplates.php:318 +#: admin/timeperiods.php:150 admin/user.php:82 msgid "Database entry failed! Not all necessary data filled in!" msgstr "Datenbankeintrag fehlgeschlagen! Nicht alle Pflichtfelder ausgefüllt!" -#: admin/checkcommands.php:60 -#: admin/configtargets.php:134 -#: admin/contactgroups.php:83 -#: admin/contacts.php:160 -#: admin/contacttemplates.php:160 -#: admin/datadomain.php:61 +#: admin/checkcommands.php:75 admin/configtargets.php:157 +#: admin/contactgroups.php:128 admin/contacts.php:242 +#: admin/contacttemplates.php:247 admin/datadomain.php:77 admin/group.php:120 +#: admin/hostdependencies.php:187 admin/hostescalations.php:187 +#: admin/hostextinfo.php:77 admin/hostgroups.php:129 admin/hosts.php:385 +#: admin/hosttemplates.php:277 admin/servicedependencies.php:295 +#: admin/serviceescalations.php:238 admin/serviceextinfo.php:86 +#: admin/servicegroups.php:131 admin/services.php:392 +#: admin/servicetemplates.php:323 admin/timeperiods.php:155 admin/user.php:87 msgid "Database entry failed! No write access!" -msgstr "Datenbankeintrag fehlgeschlagen! Keine Schreibrechte." +msgstr "Datenbankeintrag fehlgeschlagen! Keine Schreibrechte!" -# checkcommand.php -#: admin/checkcommands.php:73 -msgid "Command definitions" -msgstr "Befehlsdefinitionen (commands.cfg)" - -#: admin/checkcommands.php:88 -#: admin/contactgroups.php:124 -#: admin/contacts.php:255 -#: admin/contacttemplates.php:247 -#: admin/datadomain.php:91 +#: admin/checkcommands.php:108 admin/contactgroups.php:199 +#: admin/contacts.php:398 admin/contacttemplates.php:398 +#: admin/datadomain.php:114 admin/hostdependencies.php:301 +#: admin/hostescalations.php:305 admin/hostextinfo.php:122 +#: admin/hostgroups.php:202 admin/hosts.php:596 admin/hosttemplates.php:466 +#: admin/servicedependencies.php:646 admin/serviceescalations.php:500 +#: admin/serviceextinfo.php:173 admin/servicegroups.php:204 +#: admin/services.php:630 admin/servicetemplates.php:551 +#: admin/timeperiods.php:225 msgid "Saving not possible!" msgstr "Speichern nicht möglich!" -#: admin/checkcommands.php:90 +# checkcommand.php +#: admin/checkcommands.php:113 admin/checkcommands.php:144 +msgid "Command definitions" +msgstr "Befehlsdefinitionen (commands.cfg)" + +#: admin/checkcommands.php:114 msgid "unclassified" msgstr "nicht klassifiziert" -#: admin/checkcommands.php:91 +#: admin/checkcommands.php:115 msgid "check command" msgstr "Prüfbefehl (check)" -#: admin/checkcommands.php:92 +#: admin/checkcommands.php:116 msgid "misc command" msgstr "Spezialbefehl (misc)" -#: admin/checkcommands.php:98 -#: admin/contactgroups.php:131 -#: admin/contacts.php:269 -#: admin/contacttemplates.php:261 +#: admin/checkcommands.php:122 admin/contactgroups.php:209 +#: admin/contacts.php:419 admin/contacttemplates.php:418 +#: admin/hostdependencies.php:308 admin/hostescalations.php:312 +#: admin/hostextinfo.php:132 admin/hostgroups.php:212 admin/hosts.php:606 +#: admin/hosttemplates.php:476 admin/servicedependencies.php:679 +#: admin/serviceescalations.php:536 admin/serviceextinfo.php:199 +#: admin/servicegroups.php:214 admin/services.php:637 +#: admin/servicetemplates.php:558 admin/timeperiods.php:236 msgid "Entry cannot be activated because it is used by another configuration" -msgstr "Eintrag kann nicht deaktiviert werden, da er als obligatorischer Eintrag in einer anderen Konfiguration verwendet wird" +msgstr "" +"Eintrag kann nicht deaktiviert werden, da er als obligatorischer Eintrag in " +"einer anderen Konfiguration verwendet wird" -#: admin/checkcommands.php:115 +#: admin/checkcommands.php:145 msgid "Command name" msgstr "Befehlsname" -#: admin/checkcommands.php:116 +#: admin/checkcommands.php:146 config/fieldvars.php:90 msgid "Command line" msgstr "Befehlszeile" # prepend.adm -#: admin/checkcommands.php:129 -#: admin/checkcommands.php:140 -#: admin/configtargets.php:264 -#: admin/configtargets.php:275 -#: admin/contactgroups.php:159 -#: admin/contactgroups.php:170 -#: admin/contacts.php:319 -#: admin/contacts.php:330 -#: admin/contacttemplates.php:311 -#: admin/contacttemplates.php:322 -#: admin/datadomain.php:137 -#: admin/datadomain.php:148 +#: admin/checkcommands.php:163 admin/checkcommands.php:177 +#: admin/configtargets.php:321 admin/configtargets.php:335 +#: admin/contactgroups.php:242 admin/contactgroups.php:256 +#: admin/contacts.php:477 admin/contacts.php:491 admin/contacttemplates.php:475 +#: admin/contacttemplates.php:489 admin/datadomain.php:162 +#: admin/datadomain.php:176 admin/group.php:177 admin/group.php:190 +#: admin/hostdependencies.php:352 admin/hostdependencies.php:366 +#: admin/hostescalations.php:349 admin/hostescalations.php:363 +#: admin/hostextinfo.php:167 admin/hostextinfo.php:184 admin/hostgroups.php:246 +#: admin/hostgroups.php:260 admin/hosts.php:690 admin/hosts.php:704 +#: admin/hosttemplates.php:558 admin/hosttemplates.php:572 admin/logbook.php:50 +#: admin/logbook.php:77 admin/menuaccess.php:69 admin/password.php:45 +#: admin/password.php:66 admin/servicedependencies.php:723 +#: admin/servicedependencies.php:737 admin/serviceescalations.php:574 +#: admin/serviceescalations.php:588 admin/serviceextinfo.php:235 +#: admin/serviceextinfo.php:253 admin/servicegroups.php:248 +#: admin/servicegroups.php:262 admin/services.php:713 admin/services.php:746 +#: admin/services.php:761 admin/servicetemplates.php:642 +#: admin/servicetemplates.php:656 admin/settings.php:241 +#: admin/timeperiods.php:271 admin/timeperiods.php:285 admin/user.php:188 +#: admin/user.php:201 functions/NagConfigClass.php:1352 +#: functions/NagDataClass.php:191 functions/NagVisualClass.php:841 +#: functions/prepend_adm.php:111 functions/prepend_adm.php:322 +#: functions/prepend_adm.php:381 functions/prepend_adm.php:495 +#: functions/prepend_adm.php:527 functions/prepend_content.php:495 msgid "Error while selecting data from database:" msgstr "Fehler bei der Datenbankabfrage:" -#: admin/commands.php:31 -#: admin/commands.php:45 +#: admin/commands.php:35 admin/commands.php:49 msgid "Check commands" msgstr "Definitionen" # commands.php -#: admin/commands.php:34 -msgid "To define check and misc commands, notification commands and special commands." +#: admin/commands.php:36 +msgid "" +"To define check and misc commands, notification commands and special " +"commands." msgstr "Definieren von Prüfbefehlen, Alarmierungsbefehlen und Spezialbefehlen." # mutdialog.php -#: admin/configtargets.php:56 -#: admin/configtargets.php:62 -#: admin/configtargets.php:82 +#: admin/configtargets.php:60 admin/configtargets.php:67 +#: admin/configtargets.php:89 admin/configtargets.php:94 msgid "is not writeable" msgstr "ist nicht beschreibbar" -#: admin/configtargets.php:62 -#: admin/configtargets.php:77 +#: admin/configtargets.php:66 admin/configtargets.php:82 admin/support.php:287 +#: config/fieldvars.php:46 msgid "Nagios config file" msgstr "Nagios Konfigurationsdatei" -#: admin/configtargets.php:77 +#: admin/configtargets.php:83 msgid "is not a valid configuration file!" msgstr "ist keine gültige Konfigurationsdatei!" -#: admin/configtargets.php:82 -msgid "Cgi config file" -msgstr "CGI Konfigurationsdatei" +#: admin/configtargets.php:88 config/fieldvars.php:226 +msgid "Nagios base directory" +msgstr "Nagios Basisverzeichnis" -#: admin/configtargets.php:89 +#: admin/configtargets.php:93 +msgid "Nagios cgi config file" +msgstr "Nagios CGI Konfigurationsdatei" + +#: admin/configtargets.php:98 +msgid "Nagios resource config file" +msgstr "Nagios Ressource Konfigurationsdatei" + +# mutdialog.php +#: admin/configtargets.php:99 +msgid "is not readable" +msgstr "ist nicht lesbar" + +#: admin/configtargets.php:105 functions/NagConfigClass.php:363 +#: functions/NagConfigClass.php:2083 msgid "SSH module not loaded!" msgstr "SSH Modul nicht geladen!" -#: admin/configtargets.php:94 +#: admin/configtargets.php:110 functions/NagConfigClass.php:2061 msgid "FTP module not loaded!" msgstr "FTP Modul nicht geladen!" # domain.php -#: admin/configtargets.php:127 -#: admin/datadomain.php:54 +#: admin/configtargets.php:144 admin/datadomain.php:64 msgid "New Domain inserted:" msgstr "Neue Domäne hinzugefügt:" -#: admin/configtargets.php:128 -#: admin/datadomain.php:55 +#: admin/configtargets.php:147 admin/datadomain.php:67 msgid "Domain modified:" msgstr "Domäne modifiziert:" -#: admin/configtargets.php:142 +#: admin/configtargets.php:180 admin/configtargets.php:309 msgid "Configuration domain administration" msgstr "Konfigurationsdomänen" -#: admin/configtargets.php:143 +#: admin/configtargets.php:182 msgid "Warning, at least one error occured, please check!" msgstr "Warnung, es ist mindestens ein Fehler aufgetreten, bitte prüfen!" -#: admin/configtargets.php:158 -#: admin/datadomain.php:92 +#: admin/configtargets.php:188 admin/datadomain.php:117 admin/group.php:149 +#: admin/password.php:99 admin/user.php:130 config/fieldvars.php:204 +#: install/step2.php:33 msgid "Please fill in all fields marked with an *" msgstr "Bitte füllen Sie alle Felder mit einem * aus" -#: admin/configtargets.php:159 -#: admin/datadomain.php:93 -msgid "The following field contains not permitted characters:" +#: admin/configtargets.php:189 admin/datadomain.php:118 admin/group.php:150 +#: admin/user.php:131 config/fieldvars.php:206 +msgid "The following field contains illegal characters:" msgstr "Das folgende Feld enthält unerlaubte Zeichen:" -#: admin/configtargets.php:255 +#: admin/configtargets.php:310 config/fieldvars.php:265 msgid "Configuration target" msgstr "Konfigurationsziel" -#: admin/configtargets.php:256 -#: admin/contactgroups.php:146 -#: admin/contacts.php:301 -#: admin/contacttemplates.php:293 -#: admin/datadomain.php:129 +#: admin/configtargets.php:311 admin/contactgroups.php:226 +#: admin/contacts.php:456 admin/contacttemplates.php:455 +#: admin/datadomain.php:152 admin/group.php:167 admin/hostgroups.php:229 +#: admin/hosts.php:673 admin/hosttemplates.php:542 admin/servicegroups.php:231 +#: admin/timeperiods.php:254 admin/user.php:178 config/fieldvars.php:21 msgid "Description" msgstr "Beschreibung" -#: admin/contactgroups.php:53 +#: admin/contactgroups.php:62 msgid "New contact group inserted:" msgstr "Neue Kontaktgruppe eingetragen:" -#: admin/contactgroups.php:54 +#: admin/contactgroups.php:65 msgid "Contact group modified:" msgstr "Kontaktgruppe modifiziert:" -#: admin/contactgroups.php:96 +#: admin/contactgroups.php:146 admin/contactgroups.php:224 msgid "Define contact groups (contactgroups.cfg)" msgstr "Kontaktgruppen definieren (contactgroups.cfg)" -#: admin/contactgroups.php:111 +#: admin/contactgroups.php:165 msgid "Attention, no contacts defined!" msgstr "Achtung, noch keine Kontakte definiert!" -#: admin/contactgroups.php:145 +#: admin/contactgroups.php:225 config/fieldvars.php:102 msgid "Contact group" msgstr "Kontaktgruppe" # contacts.php -#: admin/contacts.php:70 +#: admin/contacts.php:84 msgid "New contact inserted:" msgstr "Neuer Kontakt eingetragen:" -#: admin/contacts.php:71 +#: admin/contacts.php:87 msgid "Contact modified:" msgstr "Kontakt modifiziert:" -#: admin/contacts.php:173 +#: admin/contacts.php:260 admin/contacts.php:454 msgid "Define contacts (contacts.cfg)" msgstr "Kontakte definieren (contacts.cfg)" -#: admin/contacts.php:230 +#: admin/contacts.php:329 admin/hosts.php:515 admin/services.php:566 msgid "Attention, no time periods defined!" msgstr "Achtung, noch keine Zeitperioden definiert!" -#: admin/contacts.php:241 +#: admin/contacts.php:364 msgid "Attention, no commands defined!" msgstr "Achtung, noch keine Befehle definiert!" -#: admin/contacts.php:300 -#: admin/contacttemplates.php:292 +#: admin/contacts.php:455 admin/contacttemplates.php:454 +#: config/fieldvars.php:101 msgid "Contact name" msgstr "Kontaktname" # hosttemplates.php -#: admin/contacttemplates.php:70 +#: admin/contacttemplates.php:84 msgid "New contact template inserted:" msgstr "Neues Kontakttemplate eingefügt:" -#: admin/contacttemplates.php:71 +#: admin/contacttemplates.php:87 msgid "Contact template modified:" msgstr "Kontakttemplate modifiziert:" -#: admin/contacttemplates.php:173 +#: admin/contacttemplates.php:265 admin/contacttemplates.php:453 msgid "Define contact templates (contacttemplates.cfg)" msgstr "Kontaktvorlagen definieren (contacttemplates.cfg)" -#: admin/datadomain.php:69 -msgid "Data domain administration" -msgstr "Datendomänen" - -#: admin/datadomain.php:82 +#: admin/datadomain.php:98 msgid "Attention, no configuration targets defined!" msgstr "Achtung, noch keine Konfigurationsziele definiert!" -#: admin/datadomain.php:94 +#: admin/datadomain.php:116 admin/datadomain.php:150 +msgid "Data domain administration" +msgstr "Datendomänen" + +#: admin/datadomain.php:119 admin/settings.php:280 msgid "Enable" msgstr "Einschalten" # mutdialog.php -#: admin/datadomain.php:95 +#: admin/datadomain.php:120 admin/settings.php:281 msgid "Disable" msgstr "Ausschalten" # fieldvars.php -#: admin/datadomain.php:128 +#: admin/datadomain.php:151 msgid "Data domain" msgstr "Datendomäne" -#: admin/delbackup.php:50 -#: admin/delconfig.php:50 +#: admin/delbackup.php:55 admin/delconfig.php:55 msgid "File deleted" msgstr "Datei gelöscht" -#: admin/delbackup.php:51 -#: admin/delconfig.php:51 +#: admin/delbackup.php:56 admin/delconfig.php:56 msgid "successfully deleted" msgstr "erfolgreich gelöscht" -#: admin/delbackup.php:60 +#: admin/delbackup.php:65 config/fieldvars.php:316 msgid "Delete backup files" msgstr "Backupdateien löschen" -#: admin/delbackup.php:63 -#: admin/delconfig.php:63 +#: admin/delbackup.php:68 admin/delconfig.php:68 admin/import.php:94 msgid "Filter string" msgstr "Filterausdruck" -#: admin/delbackup.php:64 -#: admin/delconfig.php:64 +#: admin/delbackup.php:69 admin/delconfig.php:69 admin/import.php:95 +#: config/fieldvars.php:84 msgid "Search" msgstr "Suche" -#: admin/delbackup.php:65 -#: admin/delbackup.php:70 -#: admin/delconfig.php:65 -#: admin/delconfig.php:70 +#: admin/delbackup.php:70 admin/delbackup.php:75 admin/delconfig.php:70 +#: admin/delconfig.php:75 admin/groupusers.php:166 admin/import.php:96 +#: admin/templatedefinitions.php:268 admin/timedefinitions.php:180 +#: admin/variabledefinitions.php:147 config/fieldvars.php:76 +#: config/fieldvars.php:183 msgid "Delete" msgstr "Löschen" -#: admin/delbackup.php:66 -#: admin/delconfig.php:66 +#: admin/delbackup.php:71 admin/delconfig.php:71 admin/import.php:97 +#: config/fieldvars.php:85 msgid "Reset filter" msgstr "Filter zurücksetzen" -#: admin/delbackup.php:68 +#: admin/delbackup.php:73 msgid "Backup file" msgstr "Backupdatei" -#: admin/delbackup.php:69 -#: admin/delconfig.php:69 +#: admin/delbackup.php:74 admin/delconfig.php:74 admin/settings.php:312 +#: config/fieldvars.php:57 msgid "required" msgstr "Pflichtfelder" -#: admin/delbackup.php:71 -#: admin/delconfig.php:71 +#: admin/delbackup.php:76 admin/delconfig.php:76 admin/import.php:104 +#: admin/password.php:98 admin/settings.php:311 config/fieldvars.php:59 msgid "Abort" msgstr "Abbrechen" -#: admin/delbackup.php:72 -#: admin/delconfig.php:72 +#: admin/delbackup.php:77 admin/delconfig.php:77 config/fieldvars.php:282 msgid "Hold CTRL to select
more than one entry" msgstr "CTRL halten um mehr
als einen Eintrag auszuwählen" -#: admin/delbackup.php:106 -#: admin/delbackup.php:131 +#: admin/delbackup.php:120 admin/delbackup.php:156 msgid "No backup files or no permission to read the backup files" msgstr "Keine Backupdateien oder keine Rechte die Backupdateien zu lesen" -#: admin/delconfig.php:60 +#: admin/delconfig.php:65 config/fieldvars.php:315 msgid "Delete config files" msgstr "Konfigdateien löschen" -#: admin/delconfig.php:68 +#: admin/delconfig.php:73 msgid "Configuration file" msgstr "Konfigurationsdatei" -#: admin/download.php:67 +#: admin/download.php:61 config/fieldvars.php:87 msgid "Download" msgstr "Download" -#: admin/group.php:53 +#: admin/group.php:63 msgid "A new group added:" msgstr "Neue Gruppe angelegt:" -#: admin/group.php:54 +#: admin/group.php:66 admin/user.php:77 msgid "User modified:" msgstr "Benutzer modifizert:" -#: admin/group.php:94 +#: admin/group.php:144 admin/group.php:165 msgid "Group administration" msgstr "Gruppenadministration" -#: admin/group.php:114 +#: admin/group.php:145 msgid "Read" msgstr "Lesen" -#: admin/group.php:115 +#: admin/group.php:146 admin/verify.php:97 admin/verify.php:101 +#: admin/verify.php:112 admin/verify.php:116 admin/verify.php:127 +#: admin/verify.php:131 admin/verify.php:142 admin/verify.php:146 +#: admin/verify.php:161 admin/verify.php:170 admin/verify.php:179 +#: admin/verify.php:188 admin/verify.php:197 admin/verify.php:201 +#: admin/verify.php:212 admin/verify.php:216 admin/verify.php:227 +#: admin/verify.php:231 admin/verify.php:242 admin/verify.php:246 +#: admin/verify.php:257 admin/verify.php:261 admin/verify.php:272 +#: admin/verify.php:276 admin/verify.php:287 admin/verify.php:291 msgid "Write" msgstr "Schreiben" -#: admin/group.php:116 +#: admin/group.php:147 msgid "Link" msgstr "Verbinden" -#: admin/group.php:134 +#: admin/group.php:166 msgid "Groupname" msgstr "Gruppenname" -#: admin/groupusers.php:150 +#: admin/groupusers.php:175 admin/templatedefinitions.php:277 +#: admin/timedefinitions.php:189 admin/variabledefinitions.php:156 +#: functions/NagContentClass.php:136 msgid "No data" msgstr "Keine Daten" -#: admin/helpedit.php:65 +#: admin/helpedit.php:83 msgid "Help text editor" msgstr "Hilfesystem Texteditor" -#: admin/helpedit.php:76 +#: admin/helpedit.php:89 msgid "Main key" msgstr "Oberbereich" -#: admin/helpedit.php:77 +#: admin/helpedit.php:90 msgid "Sub key" msgstr "Unterbereich" -#: admin/helpedit.php:78 +#: admin/helpedit.php:91 admin/settings.php:226 admin/settings.php:227 +#: install/index.php:71 msgid "Language" msgstr "Sprache" -#: admin/helpedit.php:79 +#: admin/helpedit.php:92 config/fieldvars.php:49 msgid "Nagios version" msgstr "Nagios Version" -#: admin/helpedit.php:80 +#: admin/helpedit.php:93 msgid "Load default text" msgstr "Lade Standard Text" # hosttemplates.php -#: admin/hostdependencies.php:61 +#: admin/hostdependencies.php:70 msgid "New host dependency inserted:" msgstr "Neues Hostabhängigkeit eingefügt:" -#: admin/hostdependencies.php:62 +#: admin/hostdependencies.php:73 msgid "Host dependency modified:" msgstr "Hostabhängigkeit modifiziert:" -#: admin/hostdependencies.php:125 +#: admin/hostdependencies.php:205 admin/hostdependencies.php:332 msgid "Define host dependencies (hostdependencies.cfg)" msgstr "Hostanhängigkeiten definieren (hostdependencies.cfg)" -#: admin/hostdependencies.php:153 -#: admin/hostescalations.php:141 +#: admin/hostdependencies.php:285 admin/hostescalations.php:242 +#: admin/servicedependencies.php:533 admin/serviceescalations.php:369 msgid "Attention, no hosts and hostgroups defined!" msgstr "Achtung, noch keine Hosts und Hostgruppen definiert!" -#: admin/hostdependencies.php:189 -#: admin/hostescalations.php:188 +#: admin/hostdependencies.php:333 admin/hostescalations.php:331 +#: admin/servicedependencies.php:705 admin/serviceescalations.php:556 +#: admin/services.php:705 config/fieldvars.php:217 msgid "Config name" msgstr "Konfigurationsname" -#: admin/hostdependencies.php:190 +#: admin/hostdependencies.php:334 config/fieldvars.php:234 msgid "Dependent hosts" msgstr "Abhängige Hosts" -#: admin/hostdependencies.php:190 +#: admin/hostdependencies.php:334 config/fieldvars.php:235 msgid "Dependent hostgroups" msgstr "Abhängige Hostgruppen" # hosttemplates.php -#: admin/hostescalations.php:60 +#: admin/hostescalations.php:70 msgid "New host escalation inserted:" msgstr "Neue Hosteskalation eingefügt:" -#: admin/hostescalations.php:61 +#: admin/hostescalations.php:73 msgid "Host escalation modified:" msgstr "Hosteskalation modifiziert:" -#: admin/hostescalations.php:124 +#: admin/hostescalations.php:205 admin/hostescalations.php:330 msgid "Define host escalation (hostescalations.cfg)" msgstr "Hosteskalation definieren (hostescalations.cfg)" -#: admin/hostescalations.php:156 +#: admin/hostescalations.php:289 admin/serviceescalations.php:433 msgid "Attention, no contacts and contactgroups defined!" msgstr "Achtung, noch keine Kontake oder Kontaktgruppen definiert!" -#: admin/hostescalations.php:189 -#: admin/monitoring.php:46 +#: admin/hostescalations.php:332 admin/monitoring.php:56 +#: config/fieldvars.php:211 config/fieldvars.php:300 msgid "Hosts" msgstr "Hosts" -#: admin/hostescalations.php:189 -#: admin/monitoring.php:58 +#: admin/hostescalations.php:332 admin/monitoring.php:72 +#: config/fieldvars.php:127 config/fieldvars.php:306 msgid "Host groups" msgstr "Hostgruppen" # hosttemplates.php -#: admin/hostextinfo.php:55 +#: admin/hostextinfo.php:64 msgid "New host extended information inserted:" msgstr "Neue erweiterte Hostinformation eingefügt:" -#: admin/hostextinfo.php:56 +#: admin/hostextinfo.php:67 msgid "Host extended information modified:" msgstr "Erweiterte Hostinformation modifiziert:" -#: admin/hostextinfo.php:75 +#: admin/hostextinfo.php:95 admin/hostextinfo.php:147 msgid "Define host extended information (hostextinfo.cfg)" msgstr "Erweiterte Hostinformationen definieren (hostextinfo.cfg)" -#: admin/hostextinfo.php:88 -#: admin/hostgroups.php:111 +#: admin/hostextinfo.php:106 admin/hostgroups.php:168 +#: admin/serviceextinfo.php:141 msgid "Attention, no hosts defined!" msgstr "Achtung, noch keine Hosts definiert!" -#: admin/hostextinfo.php:118 -#: admin/hosts.php:454 +#: admin/hostextinfo.php:148 admin/hosts.php:672 config/fieldvars.php:202 msgid "Host name" msgstr "Hostname" -#: admin/hostextinfo.php:119 +#: admin/hostextinfo.php:149 config/fieldvars.php:166 msgid "Notes" msgstr "Notizen" -#: admin/hostgroups.php:54 +#: admin/hostgroups.php:63 msgid "New host group inserted:" msgstr "Neue Hostgruppe eingetragen:" -#: admin/hostgroups.php:55 +#: admin/hostgroups.php:66 msgid "Host group modified:" msgstr "Hostgruppe modifiziert:" -#: admin/hostgroups.php:97 +#: admin/hostgroups.php:147 admin/hostgroups.php:227 msgid "Define host groups (hostgroups.cfg)" msgstr "Hostgruppen definieren (hostgroups.cfg)" -#: admin/hostgroups.php:145 +#: admin/hostgroups.php:228 msgid "Host group" msgstr "Hostgruppen" # contacts.php -#: admin/hosts.php:77 +#: admin/hosts.php:95 msgid "New host inserted:" msgstr "Neuen Host eingetragen:" -#: admin/hosts.php:78 +#: admin/hosts.php:98 msgid "Host modified:" msgstr "Host modifizert:" -#: admin/hosts.php:129 -#: admin/hosts.php:152 -msgid "The assigned, no longer used configuration files were deleted successfully!" -msgstr "Die dazugehörenden, nicht mehr benutzten Konfigurationsdateien wurden erfolgreich gelöscht!" +#: admin/hosts.php:192 admin/hosts.php:218 admin/services.php:249 +#: admin/services.php:279 functions/NagDataClass.php:556 +#: functions/NagDataClass.php:583 functions/prepend_content.php:415 +#: functions/prepend_content.php:475 +msgid "" +"The assigned, no longer used configuration files were deleted successfully!" +msgstr "" +"Die dazugehörenden, nicht mehr benutzten Konfigurationsdateien wurden " +"erfolgreich gelöscht!" -#: admin/hosts.php:130 -#: admin/hosts.php:153 +#: admin/hosts.php:194 admin/hosts.php:220 functions/NagDataClass.php:558 +#: functions/NagDataClass.php:586 functions/prepend_content.php:401 msgid "Host file deleted:" msgstr "Hostdatei gelöscht:" -#: admin/hosts.php:133 -#: admin/hosts.php:156 -msgid "Common files cannot be removed from target systems - please check manually" -msgstr "Globale Konfigurationsdateien können auf den Zielsystemen nicht gelöscht werden - bitte manuell überprüfen" +#: admin/hosts.php:197 admin/hosts.php:223 admin/services.php:254 +#: functions/prepend_content.php:424 functions/prepend_content.php:484 +msgid "" +"Common files cannot be removed from target systems - please check manually" +msgstr "" +"Globale Konfigurationsdateien können auf den Zielsystemen nicht gelöscht " +"werden - bitte manuell überprüfen" -#: admin/hosts.php:135 -#: admin/hosts.php:158 +#: admin/hosts.php:200 admin/hosts.php:226 admin/services.php:257 +#: admin/services.php:283 functions/NagDataClass.php:560 +#: functions/NagDataClass.php:588 functions/prepend_content.php:419 +#: functions/prepend_content.php:479 msgid "Errors while deleting the old configuration file - please check!:" -msgstr "Beim Löschen der nicht mehr benutzten Konfigurationsdateien ist ein Fehler aufgetreten - bitte überprüfen!" +msgstr "" +"Beim Löschen der nicht mehr benutzten Konfigurationsdateien ist ein Fehler " +"aufgetreten - bitte überprüfen! :" -#: admin/hosts.php:283 +#: admin/hosts.php:396 admin/hosts.php:671 msgid "Define hosts (hosts.cfg)" msgstr "Host definieren" -#: admin/hosts.php:371 +#: admin/hosts.php:562 msgid "Attention, no contact groups defined!" msgstr "Achtung, noch keine Kontaktdaten definiert!" # hosttemplates.php -#: admin/hosttemplates.php:76 +#: admin/hosttemplates.php:96 msgid "New host template inserted:" msgstr "Neues Hosttemplate eingefügt:" -#: admin/hosttemplates.php:77 +#: admin/hosttemplates.php:99 msgid "Host template modified:" msgstr "Hosttemplate modifiziert:" -#: admin/hosttemplates.php:187 +#: admin/hosttemplates.php:295 admin/hosttemplates.php:540 msgid "Host template definition (hosttemplates.cfg)" msgstr "Hosttemplates definieren (hosttemplates.cfg)" -#: admin/hosttemplates.php:345 +#: admin/hosttemplates.php:541 msgid "Host template name" msgstr "Hosttemplatename" -#: admin/import.php:51 +#: admin/import.php:55 msgid "File upload error:" msgstr "Datei Upload-Fehler:" -#: admin/import.php:61 -#: admin/import.php:75 -msgid "File imported - File [overwite flag]:" -msgstr "Datei importiert - Datei [Überschreibflag]:" +#: admin/import.php:67 admin/import.php:83 +msgid "File imported - File [overwrite flag]:" +msgstr "Datei importiert - Datei [Überschreibmarker]:" -#: admin/import.php:82 +#: admin/import.php:91 msgid "Configuration import" msgstr "Import von Konfigurationsdateien" -#: admin/import.php:90 +#: admin/import.php:99 msgid "Template definition" msgstr "Vorlagen" -#: admin/import.php:91 +#: admin/import.php:100 msgid "Import file" msgstr "Importdatei" -#: admin/import.php:92 +#: admin/import.php:101 msgid "Local import file" msgstr "Lokale Importdatei" -#: admin/import.php:93 +#: admin/import.php:102 msgid "Overwrite database" msgstr "Überschreibe Datenbankwerte" -#: admin/import.php:94 +#: admin/import.php:103 msgid "Import" msgstr "Import" -#: admin/import.php:96 +#: admin/import.php:105 msgid "Hold CTRL to select
more than one" msgstr "CTRL halten um mehr
als einen Eintrag auszuwählen" -#: admin/import.php:100 -msgid "To prevent errors or misconfigurations, you should import your configurations in an useful order. We recommend to do it like this:

commands -> timeperiods -> contacttemplates -> contacts -> contactgroups -> hosttemplates -> hosts -> hostgroups -> servicetemplates -> services -> servicegroups

" -msgstr "Um Fehler und Fehlkonfigurationen vorzubeugen, sollte der Import soweit möglich in einer sinnvollen Reihenfolge vorgenommen werden. Wir empfehlen folgenden Ablauf:

commands -> timeperiods -> contacttemplates -> contacts -> contactgroups -> hosttemplates -> hosts -> hostgroups -> servicetemplates -> services -> servicegroups

" +#: admin/import.php:109 +msgid "" +"To prevent errors or misconfigurations, you should import your " +"configurations in an useful order. We recommend to do it like this:" +"

commands -> timeperiods -> contacttemplates -> contacts -> " +"contactgroups -> hosttemplates -> hosts -> hostgroups -> servicetemplates -> " +"services -> servicegroups

" +msgstr "" +"Um Fehler und Fehlkonfigurationen vorzubeugen, sollte der Import soweit " +"möglich in einer sinnvollen Reihenfolge vorgenommen werden. Wir empfehlen " +"folgenden Ablauf:

commands -> timeperiods -> contacttemplates -" +"> contacts -> contactgroups -> hosttemplates -> hosts -> hostgroups -> " +"servicetemplates -> services -> servicegroups

" -#: admin/import.php:101 -msgid "Check your configuration after import!
In cause of an error or an uncomplete configuration, re-importing the wrong configuration can solve the problem." -msgstr "Prüfen Sie Ihre Konfiguration nach dem Import!
Beim Auftreten eines Fehlers oder einer unvollständigen Konfiguration kann ein erneuter Import der einzelnen fehlerhaften Konfiguration oft Abhilfe schaffen." +#: admin/import.php:113 +msgid "" +"Check your configuration after import!
In cause of an error or an " +"uncomplete configuration, re-importing the wrong configuration can solve the " +"problem." +msgstr "" +"Prüfen Sie Ihre Konfiguration nach dem Import!
Beim Auftreten " +"eines Fehlers oder einer unvollständigen Konfiguration kann ein erneuter " +"Import der einzelnen fehlerhaften Konfiguration oft Abhilfe schaffen." -#: admin/info.php:39 +#: admin/info.php:43 msgid "This is relative path of your NagiosQL Installation" msgstr "Der Pfad aus Sicht des Webservers" -#: admin/info.php:40 +#: admin/info.php:44 msgid "This is the absolut path to your NagiosQL Installation" msgstr "Der komplette Pfad zur NagiosQL Installation" -#: admin/info.php:41 -msgid "If you need a secure connection, select HTTPS instead of HTTP" -msgstr "Wenn eine gesicherte Verbindung benutzt werden soll, muss die Installation mit Angabe von https anstatt http erneut ausgeführt werden" - -#: admin/info.php:42 -msgid "Please choose a temporary directory with write permissions. The default is the temp directory provided by your OS" -msgstr "Der Pfad zu einem temporären Verzeichnis das zur Zwischenspeicherung der Daten benötigt wird, normalerweise unter Linux /tmp" - -#: admin/info.php:43 -msgid "Please choose your application language" -msgstr "Bitte wählen Sie die Sprache für NagiosQL" - -#: admin/info.php:44 -msgid "Encoding should be set to nothing else than utf-8. Any changes at your own risk" -msgstr "Die Kodierung sollte auf utf-8 stehen bleiben. Alle Ändeurngen auf Ihr eigenes Risiko" - #: admin/info.php:45 -msgid "IP-Address or hostname of the database server
e.g. localhost" -msgstr "Auflösbarer Hostname oder IP-Adresse des Datenbank Servers
z.B. localhost" +msgid "If you need a secure connection, select HTTPS instead of HTTP" +msgstr "" +"Wenn eine gesicherte Verbindung benutzt werden soll, muss die Installation " +"mit Angabe von https anstatt http erneut ausgeführt werden" #: admin/info.php:46 +msgid "" +"Please choose a temporary directory with write permissions. The default is " +"the temp directory provided by your OS" +msgstr "" +"Der Pfad zu einem temporären Verzeichnis das zur Zwischenspeicherung der " +"Daten benötigt wird, normalerweise unter Linux /tmp" + +#: admin/info.php:48 +msgid "Please choose your application language for new users and login portal" +msgstr "" +"Bitte wählen Sie die Sprache für neue NagiosQL Benutzer und das Login-Portal" + +#: admin/info.php:49 +msgid "" +"Encoding should be set to nothing else than utf-8. Any changes at your own " +"risk" +msgstr "" +"Die Kodierung sollte auf utf-8 stehen bleiben. Alle Ändeurngen auf Ihr " +"eigenes Risiko" + +#: admin/info.php:50 +msgid "IP-Address or hostname of the database server
e.g. localhost" +msgstr "" +"Auflösbarer Hostname oder IP-Adresse des Datenbank Servers
z.B. localhost" + +#: admin/info.php:51 msgid "MySQL Server Port, default is 3306" msgstr "MySQL Server Port, Vorgabewert ist 3306" -#: admin/info.php:47 +#: admin/info.php:52 msgid "Name of the NagiosQL database
e.g. db_nagiosql_v3" msgstr "Name der NagiosQL Datenbank
z.B. db_nagiosql_v3" -#: admin/info.php:48 -msgid "User with sufficient permission for the NagiosQL database
At least this user should have SELECT, INSERT, UPDATE, DELETE permissions" -msgstr "Benutzer mit ausreichenden Rechten für die NagiosQL Datenbank
Der Benutzer sollte zumindest SELECT, INSERT, UPDATE und DELETE Berechtigungen haben" +#: admin/info.php:53 +msgid "" +"User with sufficient permission for the NagiosQL database
At least this " +"user should have SELECT, INSERT, UPDATE, DELETE permissions" +msgstr "" +"Benutzer mit ausreichenden Rechten für die NagiosQL Datenbank
Der " +"Benutzer sollte zumindest SELECT, INSERT, UPDATE und DELETE Berechtigungen " +"haben" -#: admin/info.php:49 +#: admin/info.php:55 msgid "Password for the above mentioned user" msgstr "Passwort des o.a. Benutzers" -#: admin/info.php:50 -msgid "After the defined amount of seconds the session will terminate for security reasons" -msgstr "Aus Sicherheitsgründen wird die Sitzung nach der hier angebeben Anzahl von Sekunden bei Inaktivität beendet" - -#: admin/info.php:51 -msgid "Decide between authentication based on your Webserver
e.g. Apache configuration (config file or htaccess) or NagiosQL" -msgstr "Authentifikation auf Basis von NagiosQL oder über den Webserver. Über den Webserver lässt sich z.B. auch eine LDAP Verbindung realisieren." - -#: admin/info.php:52 -msgid "How many entries per side should be visibile (e.g. services or hosts)" -msgstr "Wieviel Einträge pro Seite sollen angezeigt werden (z.B. bei Hosts oder Services)" - -#: admin/info.php:53 -msgid "Selection of multiple entries by using the new dialog or by holding CTRL + left click like in NagiosQL2" -msgstr "Die Auswahl mehrerer Einträge innerhalb der Dialogfelder wie in NagiosQL 2 durch STRG+ linker Mausclick" - -#: admin/info.php:54 -msgid "Enable or disable the warning if a required field contains no data in objects with templates" -msgstr "Aktiviere oder deaktiviere Warnungen wenn ein Pflichtfeld keine Daten in Objekten mit Vorlagen enthält" - -#: admin/info.php:55 -msgid "Enable or disable the automatic online version check." -msgstr "Aktiviere oder Deaktiviere die automatische Versionskontrolle" - #: admin/info.php:56 -msgid "If you require a Proxyserver to connect to the Internet (Port 80), please define one." -msgstr "Sollten Sie einen Proxyserver für Verbindungen ins Internet (Port 80) benötigen, dann definieren Sie hier einen." +msgid "" +"After the defined amount of seconds the session will terminate for security " +"reasons" +msgstr "" +"Aus Sicherheitsgründen wird die Sitzung nach der hier angebeben Anzahl von " +"Sekunden bei Inaktivität beendet" -#: admin/info.php:57 +#: admin/info.php:58 +msgid "" +"Decide between authentication based on your Webserver
e.g. Apache " +"configuration (config file or htaccess) or NagiosQL" +msgstr "" +"Authentizierung auf Basis von NagiosQL oder über den Webserver. Über den " +"Webserver lässt sich z.B. auch eine LDAP Verbindung realisieren" + +#: admin/info.php:60 +msgid "" +"Number of entries per side that should be visible (e.g. services or hosts)" +msgstr "" +"Wieviel Einträge pro Seite sollen angezeigt werden (z.B. bei Hosts oder " +"Services)" + +#: admin/info.php:61 +msgid "" +"Method of selection of multiple entries by using the new dialog or by " +"holding CTRL + left mouse button, as in NagiosQL 2" +msgstr "" +"Die Auswahl mehrerer Einträge innerhalb der Dialogfelder wie in NagiosQL 2 " +"durch STRG+ linker Mausclick" + +#: admin/info.php:63 +msgid "" +"Enable or disable the warning if a required field contains no data in " +"objects with templates" +msgstr "" +"Aktiviere oder deaktiviere Warnungen wenn ein Pflichtfeld keine Daten in " +"Objekten mit Vorlagen enthält" + +#: admin/info.php:65 +msgid "Enable or disable the automatic online version check." +msgstr "Aktiviere oder Deaktiviere die automatische Versionskontrolle." + +#: admin/info.php:66 +msgid "" +"If you require a Proxyserver to connect to the Internet (Port 80), please " +"define one." +msgstr "" +"Sollten Sie einen Proxyserver für Verbindungen ins Internet (Port 80) " +"benötigen, dann definieren Sie hier einen." + +#: admin/info.php:68 msgid "Address of your Proxyserver e.g. proxy.yourdomain.com:3128" msgstr "Adresse oder Name des Proxyservers, z.B. proxy.meinedomain.de:3128" -#: admin/info.php:58 +#: admin/info.php:69 msgid "Username to connect through your proxy (optional)" msgstr "Benutzername für Proxyverbindungen (optional)" -#: admin/info.php:59 +#: admin/info.php:70 msgid "Password to connect through your proxy (optional)" msgstr "Passwort für Proxyverbindungen (optional)" -#: admin/info.php:78 +#: admin/info.php:92 msgid "Information PopUp" msgstr "Information Pop-Up" # mutdialog.php -#: admin/info.php:91 +#: admin/info.php:105 msgid "No information available" msgstr "Keine Information verfügbar" -#: admin/logbook.php:48 +#: admin/logbook.php:53 functions/NagDataClass.php:401 +#: functions/NagDataClass.php:436 functions/NagDataClass.php:611 msgid "Dataset successfully deleted. Affected rows:" msgstr "Daten erfolgreich gelöscht. Betroffene Datensätze:" # logbook.php -#: admin/logbook.php:74 +#: admin/logbook.php:83 msgid "View logbook" msgstr "Logbuch einsehen" -#: admin/logbook.php:78 +#: admin/logbook.php:87 msgid "Delete logentries between:" msgstr "Lösche Logbucheinträge zwischen:" -#: admin/logbook.php:80 -msgid "Please at least fill in a start or a stop time" -msgstr "Bitte mindestens eine Start- oder eine Stopzeit eintragen" +#: admin/logbook.php:89 +msgid "Please supply a start or a stop time at least" +msgstr "Bitte mindestens ein Start- oder eine Stop-Datum eintragen" -#: admin/logbook.php:81 -msgid "Do you really want to delete all log entries between the selected dates?" -msgstr "Wollen Sie die Logeinträge zwischen den angegebenen Daten wirklich löschen?" +#: admin/logbook.php:90 +msgid "" +"Do you really want to delete all log entries between the selected dates?" +msgstr "" +"Wollen Sie die Logeinträge zwischen den angegebenen Daten wirklich löschen?" -#: admin/logbook.php:86 +#: admin/logbook.php:97 msgid "previous 20 entries" msgstr "vorherige 20 Einträge" -#: admin/logbook.php:92 +#: admin/logbook.php:104 msgid "next 20 entries" msgstr "nächste 20 Einträge" -#: admin/menuaccess.php:40 -msgid "Error while inserting the data to the data base:" +#: admin/menuaccess.php:44 functions/NagDataClass.php:137 +#: functions/NagDataClass.php:290 +msgid "Error while inserting the data into the database:" msgstr "Fehler beim Einfügen der Daten in die Datenbank:" -#: admin/menuaccess.php:43 +#: admin/menuaccess.php:47 functions/NagDataClass.php:134 +#: functions/NagDataClass.php:285 msgid "Data were successfully inserted to the data base!" msgstr "Daten wurden erfolgreich in die Datenbank eingetragen!" -#: admin/menuaccess.php:44 +#: admin/menuaccess.php:48 msgid "Access group set for menu item:" msgstr "Zugriffsgruppe festgelegt für Menuitem:" # menuaccess.php -#: admin/menuaccess.php:50 -msgid "Define Menu Accessrights" -msgstr "Menu Zugriffsrechte festlegen" +#: admin/menuaccess.php:55 +msgid "Define Menu Access Rights" +msgstr "Zugriffsrechte für das Menu festlegen" -#: admin/menuaccess.php:54 -msgid "In order for a user to get access, he needs to be member of the group selected here." -msgstr "Damit ein Benutzer Zugriff hat, muss er Mitglied der hier ausgewählten Gruppe sein." +#: admin/menuaccess.php:59 +msgid "" +"In order for a user to get access, he needs to be member of the group " +"selected here." +msgstr "" +"Damit ein Benutzer Zugriff hat, muss er Mitglied der hier ausgewählten " +"Gruppe sein." -#: admin/monitoring.php:32 +#: admin/monitoring.php:36 msgid "Monitoring" msgstr "Überwachung" # monitoring.php -#: admin/monitoring.php:35 -msgid "To define host and service supervisions as well as host and service groups." -msgstr "Definieren von Host- und Serviceüberwachungen sowie Host- und Servicegruppen." +#: admin/monitoring.php:39 +msgid "" +"Define host and service supervisions as well as host and service groups." +msgstr "" +"Definieren von Host- und Serviceüberwachungen sowie Host- und Servicegruppen." -#: admin/monitoring.php:52 +#: admin/monitoring.php:64 admin/serviceescalations.php:557 +#: config/fieldvars.php:248 config/fieldvars.php:305 msgid "Services" msgstr "Services" -#: admin/monitoring.php:64 +#: admin/monitoring.php:80 config/fieldvars.php:213 config/fieldvars.php:307 msgid "Service groups" msgstr "Servicegruppen" -#: admin/monitoring.php:70 +#: admin/monitoring.php:88 config/fieldvars.php:302 config/fieldvars.php:328 msgid "Host templates" msgstr "Hostvorlagen" -#: admin/monitoring.php:76 +#: admin/monitoring.php:96 config/fieldvars.php:329 msgid "Service templates" msgstr "Servicevorlagen" # mutdialog.php -#: admin/mutdialog.php:51 +#: admin/mutdialog.php:57 admin/versioncheck.php:83 msgid "Available" msgstr "Verfügbar" -#: admin/mutdialog.php:52 +#: admin/mutdialog.php:58 msgid "Selected" msgstr "Ausgewählt" -#: admin/nagioscfg.php:94 +#: admin/nagioscfg.php:105 msgid "Nagios main configuration file" msgstr "Nagios Hauptkonfigurationsdatei" -#: admin/password.php:50 +#: admin/password.php:55 msgid "Password successfully modified" msgstr "Passwort erfolgreich geändert" -#: admin/password.php:64 -#: admin/user.php:72 -msgid "Password too short or password fields unequally!" -msgstr "Passwort zu kurz oder Passwortfelder ungleich!" +#: admin/password.php:72 admin/user.php:90 +msgid "Password too short or password fields do not match!" +msgstr "Passwort zu kurz oder Passwörter ungleich!" -#: admin/password.php:68 -msgid "Old password is wrong" +#: admin/password.php:78 +msgid "The old password is invalid" msgstr "Das alte Passwort ist falsch" -#: admin/password.php:84 -#: admin/settings.php:244 +#: admin/password.php:97 admin/settings.php:310 config/fieldvars.php:58 msgid "Save" msgstr "Speichern" -#: admin/password.php:87 -msgid "The new passwords are not equal!" +#: admin/password.php:100 +msgid "The new passwords don not match!" msgstr "Die neuen Passwörter sind ungleich!" -#: admin/password.php:88 +#: admin/password.php:101 msgid "The new password is too short - use at least 6 characters!" msgstr "Das neue Passwort ist zu kurz - mindestens 6 Zeichen sind nötig!" # hosttemplates.php -#: admin/servicedependencies.php:61 +#: admin/servicedependencies.php:72 msgid "New service dependency inserted:" msgstr "Neue Serviceabhängigkeit eingefügt:" -#: admin/servicedependencies.php:62 +#: admin/servicedependencies.php:75 msgid "Service dependency modified:" msgstr "Serviceabhängigkeit modifiziert:" -#: admin/servicedependencies.php:157 +#: admin/servicedependencies.php:313 admin/servicedependencies.php:704 msgid "Define service dependencies (servicedependencies.cfg)" msgstr "Serviceanhängigkeiten definieren (servicedependencies.cfg)" -#: admin/servicedependencies.php:351 +#: admin/servicedependencies.php:706 config/fieldvars.php:247 msgid "Dependent services" msgstr "Abhängige Services" # hosttemplates.php -#: admin/serviceescalations.php:61 +#: admin/serviceescalations.php:71 msgid "New service escalation inserted:" msgstr "Neue Serviceeskalation eingefügt:" -#: admin/serviceescalations.php:62 +#: admin/serviceescalations.php:74 msgid "Service escalation modified:" msgstr "Serviceeskalation modifiziert:" -#: admin/serviceescalations.php:141 +#: admin/serviceescalations.php:256 admin/serviceescalations.php:555 msgid "Define service escalation (serviceescalations.cfg)" msgstr "Serviceeskalation definieren (serviceescalations.cfg)" # hosttemplates.php -#: admin/serviceextinfo.php:54 +#: admin/serviceextinfo.php:64 msgid "New service extended information inserted:" msgstr "Neue erweiterte Serviceinformation eingefügt:" -#: admin/serviceextinfo.php:55 +#: admin/serviceextinfo.php:68 msgid "Service extended information modified:" msgstr "Erweiterte Serviceinformation modifiziert:" -#: admin/serviceextinfo.php:79 +#: admin/serviceextinfo.php:104 admin/serviceextinfo.php:214 msgid "Define service extended information (serviceextinfo.cfg)" msgstr "Erweiterte Serviceinformationen definieren (serviceextinfo.cfg)" -#: admin/serviceextinfo.php:159 +#: admin/serviceextinfo.php:215 msgid "Hostname" msgstr "Hostname" -#: admin/serviceextinfo.php:160 +#: admin/serviceextinfo.php:216 msgid "Service" msgstr "Service" # hosttemplates.php -#: admin/servicegroups.php:54 +#: admin/servicegroups.php:63 msgid "New service group inserted:" msgstr "Neue Servicegruppe eingetragen:" -#: admin/servicegroups.php:55 +#: admin/servicegroups.php:66 msgid "Service group modified:" msgstr "Servicegruppe modifiziert:" -#: admin/servicegroups.php:97 +#: admin/servicegroups.php:149 admin/servicegroups.php:229 msgid "Define service groups (servicegroups.cfg)" msgstr "Servicesgruppen definieren (servicegroups.cfg)" -#: admin/servicegroups.php:112 +#: admin/servicegroups.php:170 msgid "Attention, no services defined!" msgstr "Achtung, noch keine Services definiert!" -#: admin/servicegroups.php:146 +#: admin/servicegroups.php:230 msgid "Service group" msgstr "Servicegruppe" # hosttemplates.php -#: admin/services.php:77 +#: admin/services.php:96 msgid "New service inserted:" msgstr "Neuen Service eingefügt:" -#: admin/services.php:78 +#: admin/services.php:99 msgid "Service modified:" msgstr "Service modifiziert:" -#: admin/services.php:141 -#: admin/services.php:167 +#: admin/services.php:251 admin/services.php:281 +#: functions/prepend_content.php:460 msgid "Service file deleted:" msgstr "Servicedatei gelöscht:" -#: admin/services.php:255 +#: admin/services.php:403 admin/services.php:704 msgid "Define services (services.cfg)" msgstr "Services definieren" -#: admin/services.php:311 +#: admin/services.php:488 msgid "Attention, no hosts or hostgroups defined!" msgstr "Achtung, noch keine Hosts oder Hostgruppen definiert!" -#: admin/services.php:328 +#: admin/services.php:543 msgid "Attention, no check commands defined!" msgstr "Achtung, noch keine Prüfbefehle definiert!" -#: admin/services.php:354 +#: admin/services.php:613 msgid "Attention, no contacts or contact groups defined!" msgstr "Achtung, noch keine Kontakte oder Kontaktgruppen definiert!" -#: admin/services.php:436 +#: admin/services.php:706 msgid "Service name" msgstr "Servicename" -#: admin/services.php:438 -#: admin/services.php:462 +#: admin/services.php:708 admin/services.php:732 msgid "All configs" msgstr "Alle Konfigurationen" # hosttemplates.php -#: admin/servicetemplates.php:76 +#: admin/servicetemplates.php:97 msgid "New service template inserted:" msgstr "Neue Servicevorlage eingefügt:" -#: admin/servicetemplates.php:77 +#: admin/servicetemplates.php:100 msgid "Service template modified:" msgstr "Servicevorlage modifiziert:" -#: admin/servicetemplates.php:195 +#: admin/servicetemplates.php:341 admin/servicetemplates.php:623 msgid "Define service templates (servicetemplates.cfg)" msgstr "Servicevorlagen definieren (servicetemplates.cfg)" -#: admin/servicetemplates.php:357 +#: admin/servicetemplates.php:624 config/fieldvars.php:124 +#: config/fieldvars.php:225 msgid "Template name" msgstr "Vorlagenname" -#: admin/servicetemplates.php:358 +#: admin/servicetemplates.php:625 config/fieldvars.php:212 msgid "Service description" msgstr "Servicebeschreibung" -#: admin/settings.php:63 +#: admin/settings.php:111 msgid "Curl module not loaded, Proxy will be deactivated!" msgstr "Curl Modul nicht geladen, der Proxy wird deaktiviert!" -#: admin/settings.php:90 +#: admin/settings.php:136 msgid "An error occured while writing settings to database:" msgstr "Beim Schreiben der Einstellungen in die Datenbank trat ein Fehler auf:" -#: admin/settings.php:129 -msgid "Error in setting the correct locale, please report this error with the associated output of 'locale -a'" -msgstr "Fehler bei der Erkennung der richtigen Umgebungsvariable locale. Bitte diese Fehlermeldung und die Ausgabe von 'locale -a' melden." +#: admin/settings.php:187 functions/prepend_adm.php:150 +msgid "" +"Error setting the correct locale. Please report this error with the " +"associated output of 'locale -a'" +msgstr "" +"Fehler bei der Erkennung der Umgebungsvariable locale. Bitte diese " +"Fehlermeldung und die Ausgabe von 'locale -a' melden." -#: admin/settings.php:136 +#: admin/settings.php:195 msgid "Settings were changed" msgstr "Systemeinstellungen wurden geändert" -#: admin/settings.php:138 -msgid "An error occured while writing settings.php, please check permissions!" -msgstr "Beim Schreiben der settings.php trat ein Fehler auf - bitte Berechtigungen prüfen" +#: admin/settings.php:197 +msgid "An error occured while writing settings.php. Please check permissions!" +msgstr "" +"Beim Schreiben der settings.php trat ein Fehler auf - bitte Berechtigungen " +"prüfen!" -#: admin/settings.php:141 +#: admin/settings.php:201 msgid "is not writeable, please check permissions!" msgstr "ist nicht beschreibbar (Berechtigungen prüfen)!" -#: admin/settings.php:147 +#: admin/settings.php:208 msgid "Configure Settings" msgstr "NagiosQL Systemeinstellungen konfigurieren" -#: admin/settings.php:154 +#: admin/settings.php:213 msgid "Change your current NagiosQL settings (e.g. Database user, Language)." -msgstr "Ändern der aktuellen NagiosQL Einstellungen (Datenbankbenutzer, Sprache, usw.)" +msgstr "" +"Ändern der aktuellen NagiosQL Einstellungen (Datenbankbenutzer, Sprache, " +"usw.)" -#: admin/settings.php:158 +#: admin/settings.php:218 msgid "Path" msgstr "Pfad" -#: admin/settings.php:159 +#: admin/settings.php:219 msgid "Temporary Directory" msgstr "Temporäres Verzeichnis" -#: admin/settings.php:161 +#: admin/settings.php:221 msgid "Server protocol" msgstr "Server Protokoll" -#: admin/settings.php:182 +#: admin/settings.php:244 msgid "Encoding" msgstr "Encoding" -#: admin/settings.php:187 +#: admin/settings.php:249 msgid "Database" msgstr "Datenbank" -#: admin/settings.php:188 +#: admin/settings.php:250 msgid "MySQL Server" msgstr "MySQL Server" -#: admin/settings.php:190 +#: admin/settings.php:252 msgid "MySQL Server Port" msgstr "MySQL Server Port" -#: admin/settings.php:192 +#: admin/settings.php:254 install/step2.php:66 msgid "Database name" msgstr "Datenbankname" -#: admin/settings.php:194 +#: admin/settings.php:256 msgid "Database user" msgstr "Datenbankbenutzer" -#: admin/settings.php:196 +#: admin/settings.php:258 msgid "Database password" msgstr "Datenbankpasswort" -#: admin/settings.php:201 +#: admin/settings.php:263 msgid "Security" msgstr "Sicherheit" -#: admin/settings.php:202 +#: admin/settings.php:264 msgid "Session auto logoff time" msgstr "Automatisches Ausloggen nach" -#: admin/settings.php:204 +#: admin/settings.php:266 msgid "Authentication type" msgstr "Authentifikation" -#: admin/settings.php:209 +#: admin/settings.php:271 msgid "Common" msgstr "Allgemeines" -#: admin/settings.php:210 +#: admin/settings.php:272 msgid "Data lines per page" msgstr "Zeilen pro Seite" -#: admin/settings.php:212 +#: admin/settings.php:274 msgid "Selection method" msgstr "Auswahl methode" -#: admin/settings.php:217 +#: admin/settings.php:279 msgid "Template warn message" msgstr "Warnungen bei Templatewerten" -#: admin/settings.php:226 +#: admin/settings.php:288 msgid "Online version check" msgstr "Online Versionsüberprüfung" -#: admin/settings.php:232 +#: admin/settings.php:296 msgid "Proxyserver" msgstr "Proxyserver" -#: admin/settings.php:235 +#: admin/settings.php:301 msgid "Proxy Address" msgstr "Proxyadresse" -#: admin/settings.php:237 +#: admin/settings.php:303 msgid "Proxy Username (optional)" msgstr "Proxy Benutzername (optional)" -#: admin/settings.php:239 +#: admin/settings.php:305 msgid "Proxy Password (optional)" msgstr "Proxy Passwort (optional)" -#: admin/specials.php:31 +#: admin/specials.php:35 msgid "Misc commands" msgstr "Spezialbefehle" # specials.php -#: admin/specials.php:34 -msgid "To define host and service dependencies, host and service escalations as well as host and service additional data." -msgstr "Definieren von Host- und Serviceabhängigkeiten, Host- und Serviceeskalationen sowie Host- und Servicezusatzdaten." +#: admin/specials.php:38 +msgid "" +"Define host and service dependencies, host and service escalations as well " +"as host and service additional data." +msgstr "" +"Definieren von Host- und Serviceabhängigkeiten, Host- und " +"Serviceeskalationen sowie Host- und Service-Zusatzdaten." -#: admin/specials.php:45 +#: admin/specials.php:56 msgid "Host dependencies" msgstr "Host Abhängigkeiten" -#: admin/specials.php:51 +#: admin/specials.php:64 msgid "Host escalations" msgstr "Host Eskalationen" -#: admin/specials.php:57 +#: admin/specials.php:72 msgid "Host ext. info" msgstr "Host AddOn" -#: admin/specials.php:63 +#: admin/specials.php:80 msgid "Service dependencies" msgstr "Service Abhängigkeiten" -#: admin/specials.php:69 +#: admin/specials.php:88 msgid "Service escalations" msgstr "Service Eskalationen" -#: admin/specials.php:75 +#: admin/specials.php:96 msgid "Service ext. info" msgstr "Service AddOn" -#: admin/support.php:65 +#: admin/support.php:39 msgid "NagiosQL support page" msgstr "NagiosQL Supportseite" -#: admin/support.php:75 +#: admin/support.php:49 msgid "Support contact information" msgstr "Support- und Kontaktinformationen" -#: admin/support.php:76 -msgid "For questions, the online support forum or contact information visit our website:" -msgstr "Für Fragen, das öffentliche Supportforum oder Kontaktinformationen besuchen Sie unsere Webseite unter:" +#: admin/support.php:50 +msgid "" +"For questions, the online support forum or contact information visit our " +"website:" +msgstr "" +"Für Fragen, das öffentliche Supportforum oder Kontaktinformationen besuchen " +"Sie unsere Webseite unter:" -#: admin/support.php:80 +#: admin/support.php:52 +msgid "NagiosQL on sourceforge" +msgstr "NagiosQL auf Sourceforge" + +#: admin/support.php:56 msgid "Donate to support NagiosQL" msgstr "NagiosQL durch Spenden unterstützen" -#: admin/support.php:81 -msgid "If you like NagiosQL and it simplifies your daily work, then you may want to support the project by making a donation. This helps us to keep NagiosQL alive and to cover our costs. Thank you for your donation!" -msgstr "Wenn Ihnen NagiosQL gefällt und Ihre tägliche Arbeit erleichtert, dann möchten Sie das Projekt eventuell durch eine Spende unterstützen. Das hilft uns NagiosQL weiterzuentwickeln und dabei entstehende Kosten zu decken. Vielen Dank für Ihre Spende!" +#: admin/support.php:57 +msgid "" +"If you like NagiosQL and it simplifies your daily work, then you may want to " +"support the project by making a donation. This helps us to keep NagiosQL " +"alive and to cover our costs. Thank you for your donation!" +msgstr "" +"Wenn Ihnen NagiosQL gefällt und Ihre tägliche Arbeit erleichtert, dann " +"möchten Sie das Projekt eventuell durch eine Spende unterstützen. Das hilft " +"uns NagiosQL weiterzuentwickeln und dabei entstehende Kosten zu decken. " +"Vielen Dank für Ihre Spende!" -#: admin/support.php:82 +#: admin/support.php:60 functions/NagVisualClass.php:230 +#: functions/NagVisualClass.php:231 msgid "Donate for NagiosQL on sourceforge" msgstr "Für NagiosQL auf Sourceforge spenden" -#: admin/support.php:86 +#: admin/support.php:64 msgid "Translation services" msgstr "Übersetzungsdienste" -#: admin/support.php:87 -msgid "NagiosQL was translated into various languages​​. Since some translators are no longer available in later versions, there may be untranslated words or phrases. If you want to help us complete the translation, correct them or introduce a new language​​, then sign up with us now! The translations are simply feasible online - we use an open translation service where you can register for free at any time:" -msgstr "NagiosQL wurde bereits in mehrere Sprachen übersetzt. Da einige Übersetzer bei späteren Versionen nicht mehr verfügbar waren, können dabei einige unübersetzte Wörter oder Sätze vorkommen. Wenn Sie uns beim Vervollständigen oder Korrigieren der Übersetzungen helfen oder an zusätzlichen Sprachen mitarbeiten wollen, dann melden Sie sich bei uns! Die Übersetzungen können einfach online bearbeitet werden - wir benutzen einen offenen Übersetzungsdienst bei dem Sie sich jederzeit kostenlos registrieren können. " +#: admin/support.php:65 +msgid "" +"NagiosQL was translated into various languages​​. Since some translators are " +"no longer available in later versions, there may be untranslated words or " +"phrases. If you want to help us complete the translation, correct them or " +"introduce a new language​​, then sign up with us now! The translations are " +"simply feasible online - we use an open translation service where you can " +"register for free at any time:" +msgstr "" +"NagiosQL wurde bereits in mehrere Sprachen übersetzt. Da einige Übersetzer " +"bei späteren Versionen nicht mehr verfügbar waren, können dabei einige " +"unübersetzte Wörter oder Sätze vorkommen. Wenn Sie uns beim Vervollständigen " +"oder Korrigieren der Übersetzungen helfen oder an zusätzlichen Sprachen " +"mitarbeiten wollen, dann melden Sie sich bei uns! Die Übersetzungen können " +"einfach online bearbeitet werden - wir benutzen einen offenen " +"Übersetzungsdienst bei dem Sie sich jederzeit kostenlos registrieren können:" -#: admin/support.php:88 +#: admin/support.php:70 msgid "Transifex translation service" msgstr "Transifex Übersetzungsservice" -#: admin/support.php:92 +#: admin/support.php:74 +msgid "GIT software repository" +msgstr "Git Software Repository" + +#: admin/support.php:75 +msgid "" +"The NagiosQL sources are available on GitLab. There you will always find the " +"latest bugfixes and changes as well as older branches." +msgstr "" +"Die NagiosQL Dateien sind auf GitLab verfügbar. Dort finden sie immer sie " +"letzten Fehlerbehebungen, Änderungen sowie auch ältere Versionen." + +#: admin/support.php:77 +msgid "GitLab" +msgstr "GitLab" + +#: admin/support.php:81 msgid "Version check" msgstr "Überprüfung der NagiosQL Version" -#: admin/support.php:94 -msgid "The online version check is not enabled. You can enable it on the settings page." -msgstr "Die Onlineüberprüfung der Version ist nicht eingeschaltet. Sie können diese auf der Einstellungsseite aktivieren." +#: admin/support.php:83 +msgid "" +"The online version check is not enabled. You can enable it on the settings " +"page." +msgstr "" +"Die Onlineüberprüfung der Version ist nicht eingeschaltet. Sie können diese " +"auf der Einstellungsseite aktivieren." -#: admin/support.php:96 -msgid "The online version check connects the NagiosQL page to find out, if your version is still up to date." -msgstr "Die Onlineüberprüfung öffnet eine Verbindung zur NagiosQL Entwicklerwebseite und prüft, ob Sie die aktuelle Version verwenden." +#: admin/support.php:86 +msgid "" +"The online version check connects the NagiosQL page to find out, if your " +"version is still up to date." +msgstr "" +"Die Onlineüberprüfung öffnet eine Verbindung zur NagiosQL Entwicklerwebseite " +"und prüft, ob Sie die aktuelle Version verwenden." -#: admin/support.php:106 +#: admin/support.php:98 msgid "Environment check" msgstr "Umgebungsprüfung" -#: admin/support.php:108 -#: admin/support.php:118 -#: admin/support.php:129 -#: admin/support.php:137 -#: admin/support.php:146 -#: admin/support.php:156 -#: admin/support.php:171 -#: admin/support.php:183 -#: admin/support.php:192 -#: admin/support.php:201 -#: admin/support.php:210 -#: admin/support.php:220 -#: admin/support.php:267 -#: admin/support.php:282 -#: admin/support.php:301 -#: admin/support.php:332 -#: admin/support.php:354 -#: admin/support.php:358 -#: admin/support.php:375 -#: admin/support.php:379 -#: admin/support.php:395 -#: admin/support.php:398 -#: admin/support.php:401 -#: admin/support.php:420 -#: admin/support.php:424 -#: admin/support.php:427 -#: admin/support.php:439 -#: admin/support.php:442 -#: admin/support.php:459 -#: admin/support.php:466 -#: admin/support.php:551 -#: admin/support.php:554 -#: admin/support.php:566 -#: admin/support.php:583 -#: admin/support.php:607 +#: admin/support.php:100 admin/support.php:109 admin/support.php:121 +#: admin/support.php:129 admin/support.php:138 admin/support.php:148 +#: admin/support.php:163 admin/support.php:176 admin/support.php:185 +#: admin/support.php:194 admin/support.php:203 admin/support.php:213 +#: admin/support.php:263 admin/support.php:278 admin/support.php:299 +#: admin/support.php:337 admin/support.php:360 admin/support.php:366 +#: admin/support.php:392 admin/support.php:396 admin/support.php:415 +#: admin/support.php:418 admin/support.php:421 admin/support.php:435 +#: admin/support.php:440 admin/support.php:443 admin/support.php:448 +#: admin/support.php:460 admin/support.php:465 admin/support.php:484 +#: admin/support.php:492 admin/support.php:589 admin/support.php:592 +#: admin/support.php:613 admin/support.php:642 admin/support.php:677 +#: install/functions/NagInstallClass.php:338 +#: install/functions/NagInstallClass.php:370 +#: install/functions/NagInstallClass.php:406 +#: install/functions/NagInstallClass.php:485 +#: install/functions/NagInstallClass.php:493 +#: install/functions/NagInstallClass.php:515 +#: install/functions/NagInstallClass.php:539 +#: install/functions/NagInstallClass.php:551 +#: install/functions/NagInstallClass.php:618 +#: install/functions/NagInstallClass.php:640 +#: install/functions/NagInstallClass.php:649 +#: install/functions/NagInstallClass.php:701 +#: install/functions/NagInstallClass.php:706 +#: install/functions/NagInstallClass.php:739 +#: install/functions/NagInstallClass.php:777 +#: install/functions/NagInstallClass.php:784 +#: install/functions/NagInstallClass.php:812 +#: install/functions/NagInstallClass.php:872 +#: install/functions/NagInstallClass.php:904 +#: install/functions/NagInstallClass.php:938 +#: install/functions/NagInstallClass.php:971 +#: install/functions/NagInstallClass.php:1010 +#: install/functions/NagInstallClass.php:1019 +#: install/functions/NagInstallClass.php:1062 +#: install/functions/NagInstallClass.php:1071 install/step1.php:229 +#: install/step1.php:242 install/step1.php:246 install/step1.php:255 +#: install/step1.php:264 install/step1.php:273 install/step1.php:282 +#: install/step1.php:291 install/step1.php:300 install/step3.php:90 +#: install/step3.php:179 install/step3.php:204 msgid "failed" -msgstr "Fehler!" +msgstr "fehlgeschlagen" -#: admin/support.php:109 -#: admin/support.php:115 -#: admin/support.php:126 -#: admin/support.php:134 -#: admin/support.php:142 -#: admin/support.php:152 -#: admin/support.php:168 -#: admin/support.php:180 -#: admin/support.php:189 -#: admin/support.php:198 -#: admin/support.php:207 -#: admin/support.php:217 -#: admin/support.php:259 -#: admin/support.php:272 -#: admin/support.php:287 -#: admin/support.php:295 -#: admin/support.php:298 -#: admin/support.php:329 -#: admin/support.php:335 -#: admin/support.php:350 -#: admin/support.php:364 -#: admin/support.php:371 -#: admin/support.php:389 -#: admin/support.php:392 -#: admin/support.php:405 -#: admin/support.php:416 -#: admin/support.php:436 -#: admin/support.php:446 -#: admin/support.php:462 -#: admin/support.php:547 -#: admin/support.php:560 -#: admin/support.php:562 -#: admin/support.php:564 -#: admin/support.php:570 -#: admin/support.php:572 -#: admin/support.php:576 -#: admin/support.php:578 +#: admin/support.php:101 admin/support.php:106 admin/support.php:118 +#: admin/support.php:126 admin/support.php:134 admin/support.php:144 +#: admin/support.php:160 admin/support.php:173 admin/support.php:182 +#: admin/support.php:191 admin/support.php:200 admin/support.php:210 +#: admin/support.php:255 admin/support.php:268 admin/support.php:283 +#: admin/support.php:292 admin/support.php:295 admin/support.php:334 +#: admin/support.php:340 admin/support.php:356 admin/support.php:372 +#: admin/support.php:388 admin/support.php:407 admin/support.php:410 +#: admin/support.php:425 admin/support.php:432 admin/support.php:457 +#: admin/support.php:469 admin/support.php:488 admin/support.php:584 +#: admin/support.php:600 admin/support.php:605 admin/support.php:610 +#: admin/support.php:619 admin/support.php:624 admin/support.php:630 +#: admin/support.php:635 msgid "ok" msgstr "OK" -#: admin/support.php:112 +#: admin/support.php:103 msgid "PHP version" msgstr "PHP Version" -#: admin/support.php:118 -#: admin/support.php:171 +#: admin/support.php:110 admin/support.php:163 msgid "Required:" msgstr "Benötigt:" -#: admin/support.php:123 -#: admin/support.php:131 -#: admin/support.php:139 -#: admin/support.php:149 +#: admin/support.php:115 admin/support.php:123 admin/support.php:131 +#: admin/support.php:141 install/index.php:170 install/index.php:171 +#: install/index.php:172 install/index.php:173 msgid "PHP module:" msgstr "PHP Modul:" -#: admin/support.php:161 +#: admin/support.php:153 msgid "MySQL version" msgstr "MySQL Version" -#: admin/support.php:176 -#: admin/support.php:185 -#: admin/support.php:194 -#: admin/support.php:203 +#: admin/support.php:169 admin/support.php:178 admin/support.php:187 +#: admin/support.php:196 msgid "PHP ini settings:" msgstr "PHP ini Einstellungen:" -#: admin/support.php:213 +#: admin/support.php:206 msgid "Read/Write access:" msgstr "Schreib-/Leserechte:" -#: admin/support.php:229 +#: admin/support.php:222 msgid "Config domain checks" msgstr "Überprüfung der Konfigurationsdomäne" -#: admin/support.php:230 -msgid "The checks below are based on your data domain and config domain settings. To change the data domain, use the pull down menu in the upper right corner. Repeat this check for any data domain you have configured. To change the config domain, use the data domain menu and select a different config domain value." -msgstr "Die nachstehenden Überprüfungen basieren auf den eingestellten Werten bei der Daten- und Konfigurationsdomäne. Die Datendomäne kann über das Pull-Down-Menu oben rechts geändert werden. Die Konfigurationsdomäne ist innerhalb der jeweiligen Datendomäne definiert. Wiederholen Sie diese Überprüfungen für alle Konfigurationsdomänen die Sie verwenden." +#: admin/support.php:223 +msgid "" +"The checks below are based on your data domain and config domain settings. " +"To change the data domain, use the pull down menu in the upper right corner. " +"Repeat this check for any data domain you have configured. To change the " +"config domain, use the data domain menu and select a different config domain " +"value." +msgstr "" +"Die nachstehenden Überprüfungen basieren auf den eingestellten Werten bei " +"der Daten- und Konfigurationsdomäne. Die Datendomäne kann über das Pull-Down-" +"Menu oben rechts geändert werden. Die Konfigurationsdomäne ist innerhalb der " +"jeweiligen Datendomäne definiert. Wiederholen Sie diese Überprüfungen für " +"alle Konfigurationsdomänen die Sie verwenden." -#: admin/support.php:233 +#: admin/support.php:229 msgid "Config domain name" msgstr "Name der Konfigurationsdomäne" -#: admin/support.php:235 +#: admin/support.php:231 msgid "Connection type" msgstr "Verbindungstyp" -#: admin/support.php:256 +#: admin/support.php:252 msgid "Connection check" msgstr "Verbindungsprüfung" -#: admin/support.php:298 -#: admin/support.php:335 -#: admin/support.php:398 -#: admin/support.php:420 +#: admin/support.php:295 admin/support.php:340 admin/support.php:418 +#: admin/support.php:436 msgid "readonly" msgstr "nur lesen" -#: admin/support.php:341 +#: admin/support.php:346 config/fieldvars.php:45 msgid "Nagios process file" msgstr "Nagios Prozess Datei" -#: admin/support.php:354 -#: admin/support.php:375 -#: admin/support.php:395 -#: admin/support.php:427 -#: admin/support.php:439 -#: admin/support.php:466 +#: admin/support.php:361 admin/support.php:392 admin/support.php:415 +#: admin/support.php:444 admin/support.php:448 admin/support.php:465 +#: admin/support.php:493 msgid "file is missed" msgstr "Datei fehlt" -#: admin/support.php:359 -#: admin/support.php:380 +#: admin/support.php:367 admin/support.php:397 msgid "Nagios daemon is not running" msgstr "Demon ist nicht gestartet" -#: admin/support.php:364 -#: admin/support.php:405 -#: admin/support.php:446 +#: admin/support.php:372 admin/support.php:425 admin/support.php:469 msgid "not used with FTP" msgstr "Wird nicht benutzt bei FTP" -#: admin/support.php:379 -#: admin/support.php:392 -#: admin/support.php:424 +#: admin/support.php:396 admin/support.php:410 admin/support.php:440 msgid "demon dead" msgstr "Demon läuft nicht" -#: admin/support.php:385 +#: admin/support.php:402 config/fieldvars.php:43 msgid "Nagios command file" msgstr "Nagios Command Datei" -#: admin/support.php:432 +#: admin/support.php:452 config/fieldvars.php:44 msgid "Nagios binary file" msgstr "Nagios Binary Datei" # mutdialog.php -#: admin/support.php:442 -#: admin/support.php:459 +#: admin/support.php:461 admin/support.php:485 msgid "not executable" msgstr "Nicht ausführbar" # config_class.php -#: admin/support.php:474 +#: admin/support.php:501 msgid "Verify configuration files and demon configuration" msgstr "Überprüfung der Konfigurationsdateien und der Demon Konfiguration" -#: admin/support.php:475 +#: admin/support.php:502 msgid "Configuration name" msgstr "Konfigurationsname" # fieldvars.php -#: admin/support.php:476 +#: admin/support.php:503 msgid "Used in data domain" msgstr "Benutzt in der Datendomäne" -#: admin/support.php:477 +#: admin/support.php:504 msgid "Included in demon configuration" msgstr "Eingebunden in der Demon Konfiguration" -#: admin/support.php:549 +#: admin/support.php:587 msgid "not used" msgstr "Nicht benutzt" -#: admin/support.php:554 +#: admin/support.php:593 msgid "cfg definition missed" msgstr "Definition fehlt" -#: admin/support.php:564 -#: admin/support.php:572 -#: admin/support.php:578 +#: admin/support.php:611 admin/support.php:625 admin/support.php:636 msgid "cfg definition missed, but actually not used" msgstr "Definition fehlt, wird aber aktuell nicht benutzt" -#: admin/support.php:566 +#: admin/support.php:614 msgid "wrong base path:" msgstr "Falscher Basispfad:" -#: admin/support.php:583 +#: admin/support.php:643 msgid "cfg file not readable" msgstr "Konfigurationsdatei nicht lesbar" -#: admin/support.php:606 +#: admin/support.php:676 msgid "Not used" msgstr "Nicht benutzt" -#: admin/support.php:608 +#: admin/support.php:678 msgid "unused - please delete!" -msgstr "unbenutzt - bitte löschen" +msgstr "unbenutzt - bitte löschen!" -#: admin/templatedefinitions.php:231 +#: admin/templatedefinitions.php:260 msgid "Up" msgstr "Hinauf" -#: admin/templatedefinitions.php:231 +#: admin/templatedefinitions.php:264 msgid "Down" msgstr "Hinunter" -#: admin/timedefinitions.php:166 -#: admin/variabledefinitions.php:133 +#: admin/timedefinitions.php:176 admin/variabledefinitions.php:143 +#: config/fieldvars.php:77 msgid "Modify" msgstr "Bearbeiten" -#: admin/timeperiods.php:54 +#: admin/timeperiods.php:62 msgid "New time period inserted:" msgstr "Neue Zeitgruppe eingetragen:" -#: admin/timeperiods.php:55 +#: admin/timeperiods.php:65 msgid "Time period modified:" msgstr "Zeitgruppe modifiziert:" -#: admin/timeperiods.php:118 -msgid "Timeperiod definitions" -msgstr "Zeitperiodendefinitionen (timeperiods.cfg)" +#: admin/timeperiods.php:173 admin/timeperiods.php:252 +msgid "Time period definitions (timeperiods.cfg)" +msgstr "Zeitperioden (timeperiods.cfg)" -#: admin/timeperiods.php:143 +#: admin/timeperiods.php:230 msgid "Please insert a time definition and a time range" msgstr "Bitte eine Zeitdefinition und einen Zeitbereich eintragen" # timeperiod.php -#: admin/timeperiods.php:164 +#: admin/timeperiods.php:253 config/fieldvars.php:92 msgid "Time period" msgstr "Zeitperiode" # tools.php -#: admin/tools.php:31 +#: admin/tools.php:35 msgid "Different tools" msgstr "Verschiedene Werkzeuge" -#: admin/tools.php:34 -msgid "Useful functions for data import, main configuration, daemon control and so on." -msgstr "Verschiedene nützliche Funktionen wie Datenimport, Daemonsteuerung etc." +#: admin/tools.php:36 +msgid "" +"Useful functions for data import, main configuration, daemon control, etc." +msgstr "" +"Verschiedene nützliche Funktionen wie Datenimport, Nagios Konfiguration, " +"Prozesssteuerung etc." -#: admin/user.php:62 -msgid "A new user added:" +#: admin/user.php:74 +msgid "New user added:" msgstr "Neuen Benutzer angelegt:" -#: admin/user.php:80 +#: admin/user.php:128 admin/user.php:176 msgid "User administration" msgstr "Benutzeradministration" -#: admin/user.php:103 -msgid "The passwords are not equal!" -msgstr "Passwörter sind ungleich!" +#: admin/user.php:132 +msgid "The passwords do not match!" +msgstr "Die Passwörter sind ungleich!" -#: admin/user.php:104 +#: admin/user.php:133 msgid "Please fill in the password" msgstr "Bitte ein Passwort eintragen" -#: admin/user.php:105 +#: admin/user.php:134 msgid "The password is too short - use at least 6 characters!" msgstr "Passwort ist zu kurz - mindestens 6 Zeichen sind nötig!" -#: admin/user.php:106 +#: admin/user.php:135 msgid "Webserver authentification" msgstr "Webserver Authentifikation" -#: admin/verify.php:45 -#: admin/verify.php:145 -#: functions/config_class.php:711 -#: functions/config_class.php:712 -#: functions/config_class.php:928 -msgid "Writing of the configuration failed - no dataset or not activated dataset found" -msgstr "Schreiben der Konfiguration fehlgeschlagen - es wurde kein existierender bzw. kein aktiver Datensatz gefunden." +#: admin/user.php:177 config/fieldvars.php:24 index.php:51 +msgid "Username" +msgstr "Benutzername" -#: admin/verify.php:57 +#: admin/verify.php:50 admin/verify.php:157 functions/NagConfigClass.php:1115 +#: functions/NagConfigClass.php:1117 functions/NagConfigClass.php:1357 +#: functions/NagConfigClass.php:1359 +msgid "" +"Writing of the configuration failed - no dataset or not activated dataset " +"found" +msgstr "" +"Schreiben der Konfiguration fehlgeschlagen - es wurde kein existierender " +"bzw. kein aktiver Datensatz gefunden" + +#: admin/verify.php:62 msgid "Write host configurations" msgstr "Schreibe Hostkonfigurationen" -#: admin/verify.php:63 -#: admin/verify.php:83 +#: admin/verify.php:69 admin/verify.php:91 msgid "No configuration items defined!" msgstr "Keine Konfiguration definiert!" -#: admin/verify.php:77 +#: admin/verify.php:84 msgid "Write service configurations" msgstr "Schreibe Servicekonfigurationen" -#: admin/verify.php:94 -#: admin/verify.php:108 -#: admin/verify.php:122 -#: admin/verify.php:136 -#: admin/verify.php:190 -#: admin/verify.php:204 -#: admin/verify.php:218 -#: admin/verify.php:232 -#: admin/verify.php:246 -#: admin/verify.php:260 -#: admin/verify.php:274 +#: admin/verify.php:102 admin/verify.php:117 admin/verify.php:132 +#: admin/verify.php:147 admin/verify.php:202 admin/verify.php:217 +#: admin/verify.php:232 admin/verify.php:247 admin/verify.php:262 +#: admin/verify.php:277 admin/verify.php:292 msgid "No dataset or no activated dataset found - empty configuration written" -msgstr "Kein Datensatz oder kein aktivierter Datensatz gefunden - leere Konfiguration geschrieben" +msgstr "" +"Kein Datensatz oder kein aktivierter Datensatz gefunden - leere " +"Konfiguration geschrieben" -#: admin/verify.php:291 -msgid "Cannot find the Nagios binary or no rights for execution!" -msgstr "Kann das Nagios Binary nicht finden oder habe keine Rechte dieses auszuführen." +#: admin/verify.php:311 +msgid "Cannot find the Nagios binary or no execute permissions!" +msgstr "" +"Nagios Binary Datei nicht gefunden oder keine Rechte dieses auszuführen!" -#: admin/verify.php:304 +#: admin/verify.php:326 msgid "Remote execution (FTP SITE EXEC) is not supported on your system!" -msgstr "Ihr FTP Server unterstützt nicht die (FTP SITE EXEC) Funktion zum Ausführen von Befehlen!" +msgstr "" +"Ihr FTP Server unterstützt nicht die (FTP SITE EXEC) Funktion zum Ausführen " +"von Befehlen!" -#: admin/verify.php:321 +#: admin/verify.php:345 msgid "Remote execution of nagios verify command failed (remote SSH)!" -msgstr "Entfernte Ausführung des Nagios Prüfbefehls fehlgeschlagen (SSH Verbindung)" +msgstr "" +"Entfernte Ausführung des Nagios Prüfbefehls fehlgeschlagen (SSH Verbindung)" -#: admin/verify.php:324 +#: admin/verify.php:350 msgid "Nagios binary or configuration file not found (remote SSH)!" -msgstr "Nagios Programmdatei oder Konfiguration nicht gefunden (Entfernter Zugriff via SSH/SFTP)!" +msgstr "" +"Nagios Programmdatei oder Konfiguration nicht gefunden (Entfernter Zugriff " +"via SSH/SFTP)!" -#: admin/verify.php:355 +#: admin/verify.php:388 msgid "Nagios daemon successfully restarted" msgstr "Nagios wurde erfolgreich neu gestartet" -#: admin/verify.php:356 +#: admin/verify.php:390 msgid "Restart command successfully send to Nagios" msgstr "Der Neustart Befehl wurde erfolgreich an Nagios übermittelt" -#: admin/verify.php:358 -#: admin/verify.php:363 -#: admin/verify.php:364 +#: admin/verify.php:394 admin/verify.php:402 +msgid "" +"Restart failed - Nagios command file not found or no execute permissions" +msgstr "" +"Nagios Neustart schlug fehl - Die Nagios Commanddatei konnte nicht gefunden " +"werden oder die Dateiberechtigungen sind ungenügend" + +#: admin/verify.php:397 +msgid "Nagios command file not found or no write permissions!" +msgstr "" +"Nagios Command Datei nicht gefunden oder keine Schreibrechte auf die Datei!" + +#: admin/verify.php:404 msgid "Restart failed - Nagios command file not found or no rights to execute" -msgstr "Neustart von Nagios schlug fehl - Die Nagios Command Datei konnte nicht gefunden werden oder die Datei Berechtigungen reichen nicht aus" +msgstr "" +"Neustart von Nagios schlug fehl - Die Nagios Command Datei konnte nicht " +"gefunden werden oder die Datei Berechtigungen reichen nicht aus" -#: admin/verify.php:359 -msgid "Nagios command file not found or no rights to write!" -msgstr "Nagios command Datei nicht gefunden oder es besteht keine Schreibberechtigung auf die Datei" - -#: admin/verify.php:367 +#: admin/verify.php:408 msgid "Restart failed - Nagios daemon was not running" msgstr "Neustart fehlgeschlagen - Der Nagios Dienst lief nicht" -#: admin/verify.php:368 +#: admin/verify.php:410 msgid "Nagios daemon is not running, cannot send restart command!" -msgstr "Der Nagios Dienst läuft nicht, die Aufforderung zum Neustart konnte nicht gesendet werden!" +msgstr "" +"Der Nagios Dienst läuft nicht, die Aufforderung zum Neustart konnte nicht " +"gesendet werden!" -#: admin/verify.php:371 +#: admin/verify.php:415 msgid "Restart failed - FTP restrictions" msgstr "Neustart fehlgeschlagen aufgrund von FTP Fehlern" -#: admin/verify.php:372 +#: admin/verify.php:417 msgid "Nagios restart is not possible via FTP remote connection!" -msgstr "Nagios Neustart ist nicht möglich über eine FTP Verbindung" +msgstr "Nagios Neustart ist nicht möglich über eine FTP Verbindung!" -#: admin/verify.php:389 -msgid "Restart failed - Nagios command file not found or no rights to execute (remote SSH)!" -msgstr "Neustart von Nagios schlug fehl - Die Nagios Command Datei konnte nicht gefunden werden oder die Datei Berechtigungen reichen nicht aus (Entfernter Zugriff via SSH/SFTP)!" +#: admin/verify.php:440 +msgid "" +"Restart failed - Nagios command file not found or no rights to execute " +"(remote SSH)!" +msgstr "" +"Neustart von Nagios schlug fehl - Die Nagios Command Datei konnte nicht " +"gefunden werden oder die Datei Berechtigungen reichen nicht aus (Entfernter " +"Zugriff via SSH/SFTP)!" -#: admin/verify.php:391 +#: admin/verify.php:443 msgid "Nagios daemon successfully restarted (remote SSH)" -msgstr "Nagios wurde erfolgreich neu gestartet (Entfernter Zugriff via SSH/SFTP)" +msgstr "" +"Nagios wurde erfolgreich neu gestartet (Entfernter Zugriff via SSH/SFTP)" -#: admin/verify.php:392 +#: admin/verify.php:445 msgid "Restart command successfully send to Nagios (remote SSH)" -msgstr "Der Neustart Befehl wurde erfolgreich an Nagios übermittelt (Entfernter Zugriff via SSH/SFTP)" +msgstr "" +"Der Neustart Befehl wurde erfolgreich an Nagios übermittelt (Entfernter " +"Zugriff via SSH/SFTP)" -#: admin/verify.php:395 +#: admin/verify.php:450 msgid "Nagios command file not found (remote SSH)!" -msgstr "Nagios command Datei nicht gefunden oder es besteht keine Schreibberechtigung auf die Datei (Entfernter Zugriff via SSH/SFTP)!" +msgstr "" +"Nagios command Datei nicht gefunden oder es besteht keine " +"Schreibberechtigung auf die Datei (Entfernter Zugriff via SSH/SFTP)!" -#: admin/verify.php:403 +#: admin/verify.php:458 msgid "Check written configuration files" msgstr "Prüfe geschriebene Konfigurationsdateien" -#: admin/verify.php:406 +#: admin/verify.php:459 msgid "Check configuration files:" msgstr "Konfigurationsdateien prüfen:" -#: admin/verify.php:407 +#: admin/verify.php:460 msgid "Restart Nagios:" msgstr "Nagios neu starten:" -#: admin/verify.php:408 +#: admin/verify.php:461 msgid "Write monitoring data" msgstr "Schreibe Überwachungsdaten" -#: admin/verify.php:409 +#: admin/verify.php:462 msgid "Write additional data" msgstr "Schreibe zusätzliche Daten" -#: admin/verify.php:410 -msgid "Warning, always check the configuration files before restart Nagios!" -msgstr "Achtung, immer die Konfiguration prüfen bevor Nagios neu gestartet wird!" +#: admin/verify.php:464 +msgid "Warning, always check the configuration files before restarting Nagios!" +msgstr "" +"Achtung, immer die Konfiguration prüfen bevor Nagios neu gestartet wird!" -#: admin/verify.php:411 -#: config/fieldvars.php:54 +#: admin/verify.php:467 config/fieldvars.php:62 msgid "Do it" msgstr "Ausführen" -#: admin/verify.php:436 -#: admin/verify.php:465 -msgid "Written Nagios configuration checked - Warnings/Errors:" +#: admin/verify.php:498 admin/verify.php:542 +msgid "Nagios written configuration files checked - Warnings/Errors:" msgstr "Geschriebene Nagios Konfiguration überprüft - Warnungen/Fehler:" # config_class.php -#: admin/verify.php:440 -#: admin/verify.php:468 +#: admin/verify.php:504 admin/verify.php:547 msgid "Written configuration files are valid, Nagios can be restarted!" -msgstr "Die geschriebene Konfiguration ist gültig, Nagios kann neu gestartet werden!" +msgstr "" +"Die geschriebene Konfiguration ist gültig, Nagios kann neu gestartet werden!" -#: admin/versioncheck.php:64 -#: admin/versioncheck.php:72 +#: admin/verify.php:510 +msgid "" +"The configuration could not be tested successfully. The Nagios binary may " +"have crashed during the test. Please repeat the test or try using the " +"commandline to test. A running Nagios service should not be restarted " +"because the configuration may be invalid." +msgstr "" +"Die Konfiguration konnte nicht erfolgreich getestet werden. Das Nagios-" +"Binary kann während des Tests abgestürzt sein. Bitte wiederholen Sie den " +"Test oder versuchen Sie es über die Kommandozeile. Ein laufender Nagios-" +"Dienst sollte nicht neu gestartet werden, da die Konfiguration ungültig sein " +"kann." + +#: admin/versioncheck.php:69 admin/versioncheck.php:79 msgid "check proxy settings" msgstr "prüfen Sie die Proxyeinstellungen" -#: admin/versioncheck.php:75 +#: admin/versioncheck.php:82 msgid "Installed" msgstr "Installiert" -#: admin/versioncheck.php:77 -#: config/fieldvars.php:171 +#: admin/versioncheck.php:84 config/fieldvars.php:187 msgid "Information" msgstr "Information" -#: admin/versioncheck.php:91 +#: admin/versioncheck.php:106 msgid "You already have the latest version installed" msgstr "Sie haben bereits die letzte stabile Version installiert" -#: admin/versioncheck.php:93 -msgid "You are using an old NagiosQL version. Please update to the latest stable version" -msgstr "You are using an old NagiosQL version. Please update to the latest stable version" +#: admin/versioncheck.php:109 +msgid "" +"You are using an old NagiosQL version. Please update to the latest stable " +"version" +msgstr "" +"You are using an old NagiosQL version. Please update to the latest stable " +"version" -#: admin/versioncheck.php:96 +#: admin/versioncheck.php:114 msgid "You are using a newer development version without official support" -msgstr "Sie verwenden eine neuere Entwicklerversion, welche nicht offiziell unterstützt wird." +msgstr "" +"Sie verwenden eine neuere Entwicklerversion, welche nicht offiziell " +"unterstützt wird" # fieldvars.php -#: config/fieldvars.php:22 -#: functions/prepend_adm.php:446 +#: config/fieldvars.php:20 functions/prepend_adm.php:538 msgid "Domain" msgstr "Domäne" -#: config/fieldvars.php:24 -#: config/fieldvars.php:29 +#: config/fieldvars.php:22 config/fieldvars.php:30 msgid "Server name" msgstr "Servername" -#: config/fieldvars.php:25 +#: config/fieldvars.php:23 msgid "Method" msgstr "Methode" -#: config/fieldvars.php:28 +#: config/fieldvars.php:25 index.php:52 +msgid "Password" +msgstr "Passwort" + +#: config/fieldvars.php:27 msgid "Directory with SSH key pair" msgstr "Verzeichnis zum SSH Schlüsselpaar" -#: config/fieldvars.php:30 +#: config/fieldvars.php:29 +msgid "Use encrypted FTP (FTPS)" +msgstr "Verschlüsseltes FTP (FTPS)" + +#: config/fieldvars.php:32 msgid "Configuration directories" msgstr "Konfigurationsverzeichnisse" -#: config/fieldvars.php:31 +#: config/fieldvars.php:34 +msgid "Nagios configuration files and directories" +msgstr "Nagios Konfigurationdateien und -verzeichnisse" + +#: config/fieldvars.php:35 msgid "Base directory" msgstr "Basisverzeichnis" -#: config/fieldvars.php:32 +#: config/fieldvars.php:36 msgid "Host directory" msgstr "Hostverzeichnis" -#: config/fieldvars.php:33 +#: config/fieldvars.php:37 msgid "Service directory" msgstr "Serviceverzeichnis" -#: config/fieldvars.php:34 +#: config/fieldvars.php:38 msgid "Backup directory" msgstr "Backupverzeichnis" -#: config/fieldvars.php:35 +#: config/fieldvars.php:39 msgid "Host backup directory" msgstr "Host Backupverzeichnis" -#: config/fieldvars.php:36 +#: config/fieldvars.php:41 msgid "Service backup directory" msgstr "Service Backupverzeichnis" -#: config/fieldvars.php:37 +#: config/fieldvars.php:42 msgid "Picture base directory" msgstr "Nagios Bilderverzeichnis" -#: config/fieldvars.php:43 +#: config/fieldvars.php:47 +msgid "Nagios cgi file" +msgstr "Nagios CGI Datei" + +#: config/fieldvars.php:48 +msgid "Nagios resource file" +msgstr "Nagios Ressource Datei" + +#: config/fieldvars.php:50 msgid "Use common domain" msgstr "Benutze die globale Domäne" -#: config/fieldvars.php:44 +#: config/fieldvars.php:52 msgid "Decode UTF8 data in config files" msgstr "Übersetze UTF8 Daten in Konfigurationsdateien" -#: config/fieldvars.php:45 +#: config/fieldvars.php:53 msgid "Access key holes" msgstr "Zugriffsschlüssellöcher" # user.php -#: config/fieldvars.php:46 +#: config/fieldvars.php:54 msgid "Access keys" msgstr "Zugriffsschlüssel" -#: config/fieldvars.php:48 +#: config/fieldvars.php:56 msgid "Registered" msgstr "Registriert" -#: config/fieldvars.php:52 +#: config/fieldvars.php:60 msgid "Function" msgstr "Funktion" -#: config/fieldvars.php:53 +#: config/fieldvars.php:61 msgid "Marked" msgstr "Markierte" -#: config/fieldvars.php:55 +#: config/fieldvars.php:63 msgid "Add" msgstr "Hinzufügen" -#: config/fieldvars.php:56 -msgid "Formcheck" +#: config/fieldvars.php:64 +msgid "Form check" msgstr "Formularprüfung" -#: config/fieldvars.php:57 +#: config/fieldvars.php:65 msgid "Secure question" msgstr "Sicherheitsabfrage" -#: config/fieldvars.php:58 -#: functions/content_class.php:241 -#: functions/content_class.php:242 +#: config/fieldvars.php:66 functions/NagContentClass.php:172 +#: functions/NagContentClass.php:177 msgid "Yes" msgstr "Ja" -#: config/fieldvars.php:59 -#: functions/content_class.php:241 -#: functions/content_class.php:242 +#: config/fieldvars.php:67 functions/NagContentClass.php:170 +#: functions/NagContentClass.php:175 msgid "No" msgstr "Nein" -#: config/fieldvars.php:60 +#: config/fieldvars.php:68 msgid "Time" msgstr "Zeit" -#: config/fieldvars.php:61 +#: config/fieldvars.php:69 msgid "User" msgstr "Benutzer" -#: config/fieldvars.php:62 -msgid "IP" -msgstr "IP-Adresse" +#: config/fieldvars.php:70 +msgid "IP Address" +msgstr "IP Adresse" -#: config/fieldvars.php:63 -#: functions/import_class.php:318 -#: functions/import_class.php:323 -#: functions/import_class.php:635 -#: functions/import_class.php:636 -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: config/fieldvars.php:71 functions/NagImportClass.php:350 +#: functions/NagImportClass.php:355 functions/NagImportClass.php:419 +#: functions/NagImportClass.php:425 functions/NagImportClass.php:432 +#: functions/NagImportClass.php:437 msgid "Entry" msgstr "Eintrag" -#: config/fieldvars.php:64 +#: config/fieldvars.php:72 msgid "From" msgstr "Von" -#: config/fieldvars.php:65 +#: config/fieldvars.php:73 msgid "To" msgstr "Bis" -#: config/fieldvars.php:66 +#: config/fieldvars.php:74 msgid "Delete log entries" msgstr "Lösche Logeinträge" -#: config/fieldvars.php:67 -#: config/fieldvars.php:80 -#: config/fieldvars.php:168 +#: config/fieldvars.php:75 config/fieldvars.php:88 config/fieldvars.php:184 msgid "Copy" msgstr "Kopieren" -#: config/fieldvars.php:70 +#: config/fieldvars.php:78 msgid "Confirm password" msgstr "Passwort bestätigen" # password.php -#: config/fieldvars.php:71 +#: config/fieldvars.php:79 msgid "Old password" msgstr "Altes Passwort" -#: config/fieldvars.php:72 -#: config/fieldvars.php:281 +#: config/fieldvars.php:80 config/fieldvars.php:320 msgid "New password" msgstr "Neues Passwort" -#: config/fieldvars.php:73 +#: config/fieldvars.php:81 msgid "Change password" msgstr "Passwort ändern" -#: config/fieldvars.php:74 +#: config/fieldvars.php:82 msgid "Menu page" msgstr "Menüseite" -#: config/fieldvars.php:75 +#: config/fieldvars.php:83 msgid "Search string" msgstr "Suchbegriff" -#: config/fieldvars.php:78 -#: config/fieldvars.php:172 +#: config/fieldvars.php:86 config/fieldvars.php:188 msgid "Write config file" msgstr "Konfigdatei schreiben" -#: config/fieldvars.php:81 +#: config/fieldvars.php:89 msgid "Command" msgstr "Befehl" -#: config/fieldvars.php:83 +#: config/fieldvars.php:91 msgid "Command type" msgstr "Befehlstyp" -#: config/fieldvars.php:85 +#: config/fieldvars.php:93 msgid "Exclude" msgstr "Ausschliessen" -#: config/fieldvars.php:86 +#: config/fieldvars.php:94 msgid "Include" msgstr "Einschliessen" -#: config/fieldvars.php:87 +#: config/fieldvars.php:95 msgid "Time definitions" msgstr "Zeitdefinitionen" -#: config/fieldvars.php:88 +#: config/fieldvars.php:96 msgid "Weekday" msgstr "Wochentag" -#: config/fieldvars.php:89 +#: config/fieldvars.php:97 msgid "Time range" msgstr "Zeitbereich" -#: config/fieldvars.php:90 +#: config/fieldvars.php:98 msgid "Time definition" msgstr "Zeitdefinition" -#: config/fieldvars.php:91 +#: config/fieldvars.php:99 msgid "Insert" msgstr "Einfügen" -#: config/fieldvars.php:92 +#: config/fieldvars.php:100 msgid "Modify selection" msgstr "Auswahl ändern" -#: config/fieldvars.php:95 +#: config/fieldvars.php:103 +msgid "Minimum importance" +msgstr "Minimale Dringlichkeit" + +#: config/fieldvars.php:104 msgid "Time period hosts" msgstr "Zeitperiode Hosts" -#: config/fieldvars.php:96 +#: config/fieldvars.php:105 msgid "Time period services" msgstr "Zeitperiode Services" -#: config/fieldvars.php:97 +#: config/fieldvars.php:106 msgid "Host options" msgstr "Hostoptionen" -#: config/fieldvars.php:98 +#: config/fieldvars.php:107 msgid "Service options" msgstr "Serviceoptionen" -#: config/fieldvars.php:99 +#: config/fieldvars.php:108 msgid "Host command" msgstr "Hostbefehl" -#: config/fieldvars.php:100 +#: config/fieldvars.php:109 msgid "Service command" msgstr "Servicebefehl" -#: config/fieldvars.php:101 +#: config/fieldvars.php:110 msgid "EMail address" msgstr "E-Mail Adresse" -#: config/fieldvars.php:102 +#: config/fieldvars.php:111 msgid "Pager number" msgstr "Pagernummer" -#: config/fieldvars.php:103 +#: config/fieldvars.php:112 msgid "Addon address" msgstr "Zusatzadresse" -#: config/fieldvars.php:104 +#: config/fieldvars.php:113 msgid "Host notif. enable" msgstr "Hostalarmierung" -#: config/fieldvars.php:105 +#: config/fieldvars.php:114 msgid "Service notif. enable" msgstr "Servicealarmierung" -#: config/fieldvars.php:106 +#: config/fieldvars.php:115 msgid "Can submit commands" msgstr "Darf Befehle senden" -#: config/fieldvars.php:107 +#: config/fieldvars.php:116 msgid "Retain status info" msgstr "Behält Statusinfo" -#: config/fieldvars.php:108 -msgid "Retain nonstatus info" -msgstr "Behält Nichtstatusinfo" +#: config/fieldvars.php:117 +msgid "Retain non-status info" +msgstr "Behält Nicht-Status information" # contactgroups.php -#: config/fieldvars.php:109 +#: config/fieldvars.php:118 msgid "Members" msgstr "Mitglieder" -#: config/fieldvars.php:110 +#: config/fieldvars.php:119 msgid "Group members" msgstr "Gruppenmitglieder" -#: config/fieldvars.php:111 +#: config/fieldvars.php:120 msgid "Common settings" msgstr "Allgemeine Einstellungen" -#: config/fieldvars.php:112 +#: config/fieldvars.php:121 msgid "Service settings" msgstr "Serviceeinstellungen" -#: config/fieldvars.php:113 +#: config/fieldvars.php:123 msgid "Add this host configuration to existing service definitions" msgstr "Diese Hostkonfiguration bestehenden Services hinzufügen" -#: config/fieldvars.php:115 +#: config/fieldvars.php:125 msgid "Parents" msgstr "Vorgeschaltete Hosts" -#: config/fieldvars.php:117 +#: config/fieldvars.php:126 +msgid "Parent services" +msgstr "Abhängige Services" + +#: config/fieldvars.php:128 msgid "Check command" msgstr "Prüfbefehl" -#: config/fieldvars.php:118 +#: config/fieldvars.php:129 msgid "Command view" msgstr "Befehlsübersicht" -#: config/fieldvars.php:119 +#: config/fieldvars.php:130 msgid "Additional templates" msgstr "Zusätzliche Vorlagen" -#: config/fieldvars.php:120 +#: config/fieldvars.php:131 msgid "Check settings" msgstr "Prüfeinstellungen" -#: config/fieldvars.php:121 +#: config/fieldvars.php:132 msgid "Initial state" msgstr "Initialstatus" -#: config/fieldvars.php:122 +#: config/fieldvars.php:133 msgid "Retry interval" msgstr "Wiederholintervall" -#: config/fieldvars.php:123 +#: config/fieldvars.php:134 msgid "Max check attempts" msgstr "Max. Prüfversuche" -#: config/fieldvars.php:124 +#: config/fieldvars.php:135 msgid "Check interval" msgstr "Prüfintervall" -#: config/fieldvars.php:125 +#: config/fieldvars.php:136 msgid "Active checks enabled" msgstr "Aktive Prüfungen" -#: config/fieldvars.php:126 +#: config/fieldvars.php:137 msgid "Passive checks enabled" msgstr "Passive Prüfungen" -#: config/fieldvars.php:127 +#: config/fieldvars.php:138 msgid "Check period" msgstr "Prüfperiode" -#: config/fieldvars.php:128 +#: config/fieldvars.php:139 msgid "Freshness treshold" msgstr "Aktualitätsschwelle" -#: config/fieldvars.php:129 +#: config/fieldvars.php:140 msgid "Check freshness" msgstr "Aktualitätsprüfung" -#: config/fieldvars.php:130 +#: config/fieldvars.php:141 msgid "Obsess over host" msgstr "Hostverfolgung" -#: config/fieldvars.php:131 +#: config/fieldvars.php:142 msgid "Obsess over service" msgstr "Serviceverfolgung" -#: config/fieldvars.php:132 +#: config/fieldvars.php:143 msgid "Event handler" msgstr "Ereignisbefehl" -#: config/fieldvars.php:133 +#: config/fieldvars.php:144 msgid "Event handler enabled" msgstr "Ereignisverarbeitung" -#: config/fieldvars.php:134 +#: config/fieldvars.php:145 msgid "Low flap threshold" msgstr "Untere Flatterschwelle" -#: config/fieldvars.php:135 +#: config/fieldvars.php:146 msgid "High flap threshold" msgstr "Obere Flatterschwelle" -#: config/fieldvars.php:136 +#: config/fieldvars.php:147 msgid "Flap detection enabled" msgstr "Flattererkennung" -#: config/fieldvars.php:137 +#: config/fieldvars.php:148 msgid "Flap detection options" msgstr "Flattererkennungsoptionen" -#: config/fieldvars.php:138 +#: config/fieldvars.php:150 msgid "Retain status information" msgstr "Behalte Statusinfo" -#: config/fieldvars.php:139 -msgid "Retain nostatus information" -msgstr "Behalte Nichtstatusinfo" +#: config/fieldvars.php:152 +msgid "Retain non-status information" +msgstr "Behalte Nicht-Status Information" -#: config/fieldvars.php:140 +#: config/fieldvars.php:153 msgid "Process perf data" msgstr "Verarbeite Perf. Daten" -#: config/fieldvars.php:141 +#: config/fieldvars.php:154 msgid "Alarm settings" msgstr "Alarmeinstellungen" -#: config/fieldvars.php:142 +#: config/fieldvars.php:155 msgid "Contacts" msgstr "Kontakte" -#: config/fieldvars.php:144 +#: config/fieldvars.php:157 msgid "Notification period" msgstr "Meldungsdauer" -#: config/fieldvars.php:145 +#: config/fieldvars.php:158 msgid "Notification options" msgstr "Meldungsoptionen" -#: config/fieldvars.php:146 +#: config/fieldvars.php:159 msgid "Notification interval" msgstr "Meldungsinterval" -#: config/fieldvars.php:147 +#: config/fieldvars.php:161 msgid "First notification delay" msgstr "Verzögerung erste Meldung" -#: config/fieldvars.php:148 +#: config/fieldvars.php:162 msgid "Notification enabled" msgstr "Meldungen" -#: config/fieldvars.php:149 +#: config/fieldvars.php:163 +msgid "Importance" +msgstr "Dringlichkeit" + +#: config/fieldvars.php:164 msgid "Stalking options" msgstr "Verfolgungsoptionen" -#: config/fieldvars.php:150 +#: config/fieldvars.php:165 msgid "Addon settings" msgstr "Zusatzeinstellungen" -#: config/fieldvars.php:152 +#: config/fieldvars.php:167 msgid "VRML image" msgstr "VRML Bild" -#: config/fieldvars.php:153 +#: config/fieldvars.php:168 msgid "Notes URL" msgstr "Notizen URL" -#: config/fieldvars.php:154 +#: config/fieldvars.php:169 msgid "Status image" msgstr "Statusbild" -#: config/fieldvars.php:155 +#: config/fieldvars.php:170 msgid "Icon image" msgstr "Icon Bild" -#: config/fieldvars.php:156 +#: config/fieldvars.php:171 msgid "Action URL" msgstr "Vorgangs URL" -#: config/fieldvars.php:157 +#: config/fieldvars.php:172 msgid "2D coords" msgstr "2D Koordinaten" -#: config/fieldvars.php:158 +#: config/fieldvars.php:173 msgid "3D coords" msgstr "3D Koordinaten" -#: config/fieldvars.php:159 +#: config/fieldvars.php:174 msgid "Icon image ALT text" msgstr "Icon Bild ALT Text" -#: config/fieldvars.php:160 +#: config/fieldvars.php:175 msgid "standard" msgstr "standard" -#: config/fieldvars.php:161 +#: config/fieldvars.php:176 msgid "on" msgstr "ein" -#: config/fieldvars.php:162 +#: config/fieldvars.php:177 msgid "off" msgstr "aus" -#: config/fieldvars.php:163 +#: config/fieldvars.php:178 msgid "skip" msgstr "skip" -#: config/fieldvars.php:164 +#: config/fieldvars.php:180 msgid "Free variable definitions" msgstr "Freie Variabel Definitionen" -#: config/fieldvars.php:165 +#: config/fieldvars.php:181 msgid "Variable name" msgstr "Variabelname" -#: config/fieldvars.php:166 +#: config/fieldvars.php:182 msgid "Variable value" msgstr "Variablen Wert" -#: config/fieldvars.php:169 +#: config/fieldvars.php:185 msgid "Activate" msgstr "Aktivieren" -#: config/fieldvars.php:170 +#: config/fieldvars.php:186 msgid "Deactivate" msgstr "Deaktivieren" -#: config/fieldvars.php:173 +#: config/fieldvars.php:190 msgid "Do you really want to delete this database entry:" msgstr "Soll dieser Datenbankeintrag wirklich gelöscht werden:" -#: config/fieldvars.php:174 +#: config/fieldvars.php:192 msgid "Do you really want to delete all marked entries?" msgstr "Sollen die markierten Einträge wirklich gelöscht werden?" -#: config/fieldvars.php:175 +#: config/fieldvars.php:194 msgid "Mark all shown datasets" msgstr "Alle angezeigten Datensätze markieren" -#: config/fieldvars.php:176 +#: config/fieldvars.php:195 msgid "File" msgstr "Datei" -#: config/fieldvars.php:177 +#: config/fieldvars.php:196 msgid "Write all config files" msgstr "Alle Konfigdateien schreiben" -#: config/fieldvars.php:178 +#: config/fieldvars.php:197 msgid "Address" msgstr "Hostadresse" -#: config/fieldvars.php:179 +#: config/fieldvars.php:198 msgid "Display name" msgstr "Anzeigename" -#: config/fieldvars.php:180 -msgid "Use this configuration as template" +#: config/fieldvars.php:200 +msgid "Use this configuration as a template" msgstr "Diese Definition als Vorlage verwenden" -#: config/fieldvars.php:181 +#: config/fieldvars.php:201 msgid "Generic name" msgstr "Generischer Name" -#: config/fieldvars.php:185 +#: config/fieldvars.php:208 msgid "Please check at least one option from:" msgstr "Bitte mindestens eine Option auswählen bei:" -#: config/fieldvars.php:186 +#: config/fieldvars.php:209 msgid "Host group name" msgstr "Hostgruppenname" -#: config/fieldvars.php:187 +#: config/fieldvars.php:210 msgid "Host group members" msgstr "Hostgruppenmitglieder" -#: config/fieldvars.php:191 +#: config/fieldvars.php:214 msgid "Is volatile" msgstr "Ist unstetig" -#: config/fieldvars.php:192 +#: config/fieldvars.php:215 msgid "Parallelize checks" msgstr "Parallele Prüfungen" -#: config/fieldvars.php:193 +#: config/fieldvars.php:216 msgid "Config name filter" msgstr "Filter Konfigurationsname" -#: config/fieldvars.php:195 +#: config/fieldvars.php:218 msgid "Import directory" msgstr "Importverzeichnis" -#: config/fieldvars.php:196 +#: config/fieldvars.php:220 msgid "Please insert a variable name and a variable definition" msgstr "Bitte einen Variablennamen und einen Wertbereich eintragen" -#: config/fieldvars.php:197 -#: config/fieldvars.php:201 -#: config/fieldvars.php:233 +#: config/fieldvars.php:222 config/fieldvars.php:229 config/fieldvars.php:269 msgid "Warning:" msgstr "Warnung:" -#: config/fieldvars.php:197 -msgid "You have not filled in some required fields!

If this values are set by a template, you can save anyway - otherwise you will get an invalid configuration!" -msgstr "Es wurden nicht alls Pflichfelder ausgefüllt!

Sofern diese Werte über eine Vorlage gesetzt werden kann trotzdem gespeichert werden - andernfalls wird eine ungültige Konfiguration entstehen!" +#: config/fieldvars.php:222 +msgid "" +"You have not filled in some required fields!

If this values are set " +"by a template, you can save anyway - otherwise you will get an invalid " +"configuration!" +msgstr "" +"Es wurden nicht alls Pflichfelder ausgefüllt!

Sofern diese Werte über " +"eine Vorlage gesetzt werden kann trotzdem gespeichert werden - andernfalls " +"wird eine ungültige Konfiguration entstehen!" -#: config/fieldvars.php:199 -msgid "Nagios base directory" -msgstr "Nagios Basisverzeichnis" - -#: config/fieldvars.php:200 +#: config/fieldvars.php:227 msgid "Write config" msgstr "Konfigurationsdatei schreiben" -#: config/fieldvars.php:201 -msgid "You have not filled in all command arguments (ARGx) for your selected command!

If this arguments are optional, you can save anyway - otherwise you will get an invalid configuration!" -msgstr "Es wurden nicht alle Befehlsargumente (ARGx) für den ausgewählten Befehl ausgefüllt!

Wenn diese Argumente nicht benötigt werden, speichern Sie einfach - andernfalls wird eine ungültige Konfiguration entstehen!" +#: config/fieldvars.php:229 +msgid "" +"You have not filled in all command arguments (ARGx) for your selected " +"command!

If this arguments are optional, you can save anyway - " +"otherwise you will get an invalid configuration!" +msgstr "" +"Es wurden nicht alle Befehlsargumente (ARGx) für den ausgewählten Befehl " +"ausgefüllt!

Wenn diese Argumente nicht benötigt werden, speichern Sie " +"einfach - andernfalls wird eine ungültige Konfiguration entstehen!" -#: config/fieldvars.php:202 +#: config/fieldvars.php:232 msgid "Service group members" msgstr "Servicegruppenmitglieder" -#: config/fieldvars.php:203 +#: config/fieldvars.php:233 msgid "Service group name" msgstr "Servicegruppenname" -#: config/fieldvars.php:206 +#: config/fieldvars.php:236 msgid "Hostgroups" msgstr "Hostgruppen" -#: config/fieldvars.php:207 +#: config/fieldvars.php:237 msgid "Inherit parents" msgstr "Vererbung" -#: config/fieldvars.php:208 +#: config/fieldvars.php:239 msgid "Execution failure criteria" msgstr "Ausführungsfehlerkriterium" -#: config/fieldvars.php:209 +#: config/fieldvars.php:241 msgid "Nofification failure criteria" msgstr "Meldungsfehlerkriterium" -#: config/fieldvars.php:210 +#: config/fieldvars.php:242 msgid "Dependency period" msgstr "Abhängigkeitsperiode" -#: config/fieldvars.php:211 +#: config/fieldvars.php:243 msgid "Escalation period" msgstr "Eskalationsdauer" -#: config/fieldvars.php:212 +#: config/fieldvars.php:244 msgid "Escalation options" msgstr "Eskalationsoptionen" -#: config/fieldvars.php:213 +#: config/fieldvars.php:245 msgid "First notification" msgstr "Erste Meldung" -#: config/fieldvars.php:214 +#: config/fieldvars.php:246 msgid "Last notification" msgstr "Letzte Meldung" -#: config/fieldvars.php:217 +#: config/fieldvars.php:250 msgid "Dependent servicegroups" msgstr "Abhängige Servicegruppen" -#: config/fieldvars.php:218 +#: config/fieldvars.php:251 msgid "Help" msgstr "Hilfe" -#: config/fieldvars.php:219 +#: config/fieldvars.php:252 msgid "Calendar" msgstr "Kalender" -#: config/fieldvars.php:220 +#: config/fieldvars.php:253 msgid "Group name" msgstr "Gruppenname" -#: config/fieldvars.php:221 +#: config/fieldvars.php:254 msgid "Users" msgstr "Benutzer" -#: config/fieldvars.php:222 +#: config/fieldvars.php:255 msgid "Access group" msgstr "Zugriffsgruppe" -#: config/fieldvars.php:223 +#: config/fieldvars.php:256 msgid "User definitions" msgstr "Benutzerdefinitionen" -#: config/fieldvars.php:224 +#: config/fieldvars.php:257 msgid "User name" msgstr "Benutzername" -#: config/fieldvars.php:225 +#: config/fieldvars.php:258 msgid "User rights" msgstr "Benutzerrechte" -#: config/fieldvars.php:226 +#: config/fieldvars.php:260 msgid "Object access restrictions" msgstr "Objektzugriffsrestriktionen" -#: config/fieldvars.php:227 +#: config/fieldvars.php:262 msgid "Enable group administration" msgstr "Erlaube Gruppenadministration" -#: config/fieldvars.php:228 +#: config/fieldvars.php:263 msgid "Show relation data" msgstr "Zeige verknüpfte Daten" -#: config/fieldvars.php:229 +#: config/fieldvars.php:264 msgid "Hide relation data" msgstr "Verstecke verknüpfte Daten" -#: config/fieldvars.php:231 +#: config/fieldvars.php:266 msgid "User language" msgstr "Benutzersprache" -#: config/fieldvars.php:232 +#: config/fieldvars.php:267 msgid "Standard domain" msgstr "Standarddomäne" -#: config/fieldvars.php:233 -msgid "The associated services must be additionally written to the files. Only writing the host configuration is not sufficient because the modification is stored inside the service files!" -msgstr "Die hier zugefügten Services müssen zusätzlich neu geschrieben werden. Das Schreiben der Hostkonfiguration alleine genügt nicht, weil die Änderungen in der Servicekonfiguration eingetragen werden." +#: config/fieldvars.php:269 +msgid "" +"The associated services must be additionally written to the files. Only " +"writing the host configuration is not sufficient because the modification is " +"stored inside the service files!" +msgstr "" +"Die hier zugefügten Services müssen zusätzlich neu geschrieben werden. Das " +"Schreiben der Hostkonfiguration alleine genügt nicht, weil die Änderungen in " +"der Servicekonfiguration eingetragen werden!" -#: config/fieldvars.php:235 +#: config/fieldvars.php:273 msgid "Monday" msgstr "Montag" -#: config/fieldvars.php:236 +#: config/fieldvars.php:274 msgid "Tuesday" msgstr "Dienstag" -#: config/fieldvars.php:237 +#: config/fieldvars.php:275 msgid "Wednesday" msgstr "Mittwoch" -#: config/fieldvars.php:238 +#: config/fieldvars.php:276 msgid "Thursday" msgstr "Donnerstag" -#: config/fieldvars.php:239 +#: config/fieldvars.php:277 msgid "Friday" msgstr "Freitag" -#: config/fieldvars.php:240 +#: config/fieldvars.php:278 msgid "Saturday" msgstr "Samstag" -#: config/fieldvars.php:241 +#: config/fieldvars.php:279 msgid "Sunday" msgstr "Sonntag" -#: config/fieldvars.php:252 +#: config/fieldvars.php:291 msgid "Main page" msgstr "Hauptseite" -#: config/fieldvars.php:253 +#: config/fieldvars.php:292 msgid "Supervision" msgstr "Überwachung" -#: config/fieldvars.php:256 +#: config/fieldvars.php:295 msgid "Commands" msgstr "Befehle" -#: config/fieldvars.php:257 +#: config/fieldvars.php:296 msgid "Specialties" msgstr "Spezialitäten" -#: config/fieldvars.php:258 +#: config/fieldvars.php:297 msgid "Tools" msgstr "Werkzeuge" -#: config/fieldvars.php:269 +#: config/fieldvars.php:308 msgid "Service dependency" msgstr "Service Abhängigkeiten" -#: config/fieldvars.php:270 +#: config/fieldvars.php:309 msgid "Service escalation" msgstr "Service Eskalationen" -#: config/fieldvars.php:271 +#: config/fieldvars.php:310 msgid "Host dependency" msgstr "Host Abhängigk." -#: config/fieldvars.php:272 +#: config/fieldvars.php:311 msgid "Host escalation" msgstr "Host Eskalation" -#: config/fieldvars.php:273 +#: config/fieldvars.php:312 msgid "Extended Host" msgstr "Host erweitert" -#: config/fieldvars.php:274 +#: config/fieldvars.php:313 msgid "Extended Service" msgstr "Service erweitert" -#: config/fieldvars.php:275 +#: config/fieldvars.php:314 msgid "Data import" msgstr "Datenimport" -#: config/fieldvars.php:278 +#: config/fieldvars.php:317 msgid "User admin" msgstr "Benutzer" -#: config/fieldvars.php:279 +#: config/fieldvars.php:318 msgid "Group admin" msgstr "Gruppen" -#: config/fieldvars.php:280 +#: config/fieldvars.php:319 msgid "Nagios control" msgstr "Nagios steuern" -#: config/fieldvars.php:282 +#: config/fieldvars.php:321 msgid "Logbook" msgstr "Logbuch" -#: config/fieldvars.php:283 +#: config/fieldvars.php:322 msgid "Nagios config" msgstr "Nagios Config" -#: config/fieldvars.php:284 +#: config/fieldvars.php:323 msgid "Settings" msgstr "Einstellungen" -#: config/fieldvars.php:285 +#: config/fieldvars.php:324 msgid "Definitions" msgstr "Definitionen" -#: config/fieldvars.php:286 +#: config/fieldvars.php:325 msgid "CGI config" msgstr "CGI Config" -#: config/fieldvars.php:287 +#: config/fieldvars.php:326 msgid "Menu access" msgstr "Menu Zugriff" -#: config/fieldvars.php:288 +#: config/fieldvars.php:327 msgid "Domains" msgstr "Domänen" -#: config/fieldvars.php:292 +#: config/fieldvars.php:331 msgid "Help editor" msgstr "Hilfe Editor" # fieldvars.php -#: config/fieldvars.php:293 +#: config/fieldvars.php:332 msgid "Data domains" msgstr "Datendomäne" -#: config/fieldvars.php:294 +#: config/fieldvars.php:333 msgid "Config targets" msgstr "Konfigdomäne" -#: config/fieldvars.php:295 +#: config/fieldvars.php:334 msgid "Support" msgstr "Support" -# config_class.php -#: functions/config_class.php:164 -#: functions/config_class.php:168 -msgid "Warning: configuration file is out of date!" -msgstr "Achtung: Konfigurationsdatei ist veraltet!" +#: functions/MysqliDbClass.php:291 +msgid "Missing server connection parameter!" +msgstr "Fehlende Parameter für die Serververbindung!" -#: functions/config_class.php:173 -#: functions/config_class.php:729 -msgid "Warning: no configuration target defined!" -msgstr "Achtung: kein Konfigurationsziel definiert!" +#: functions/MysqliDbClass.php:310 +msgid "Connection to the database server has failed by reason:" +msgstr "Die Verbindung zum Datenbankserver erzeugte den folgenden Fehler:" -#: functions/config_class.php:340 -msgid "Cannot backup and delete the old configuration file (check the permissions)!" -msgstr "Kann die alte Konfigurationsdatei nicht sichern und löschen (Berechtigungen prüfen)!" +#: functions/MysqliDbClass.php:338 +msgid "Missing database connection parameter!" +msgstr "Fehlende Parameter für die Datenbankverbindung!" -#: functions/config_class.php:358 -msgid "Cannot backup the old configuration file because the permissions are wrong (remote FTP)!" -msgstr "Kann die alte Konfigurationsdatei nicht sichern aufgrund falscher Dateiberechtigungen (FTP Remote Dateirechte)" +#: functions/MysqliDbClass.php:347 +msgid "Connection to the database has failed by reason:" +msgstr "Die Verbindung zum Datenbankserver erzeugte den folgenden Fehler:" -#: functions/config_class.php:380 -msgid "Cannot backup the old configuration file because the permissions are wrong (remote SFTP)!" -msgstr "Kann die alte Konfigurationsdatei nicht sichern aufgrund falscher Dateiberechtigungen (Entfernter Zugriff via SSH/SFTP)" - -#: functions/config_class.php:411 -msgid "Cannot delete the file (wrong permissions)!" -msgstr "Datei kann nicht gelöscht werden (Berechtigungen prüfen)!" - -#: functions/config_class.php:415 -msgid "Cannot delete the file (file does not exist)!" -msgstr "Datei kann nicht gelöscht werden (Datei existiert nicht)!" - -#: functions/config_class.php:432 -msgid "Cannot delete file because the permissions are wrong (remote FTP)!" -msgstr "Datei kann aufgrund falscher Dateiberechtigungen nicht gelöscht werden (FTP Remote Dateirechte)" - -#: functions/config_class.php:438 -msgid "Cannot delete file because it does not exists (remote FTP)!" -msgstr "Datei kann nicht gelöscht werden, da sie nicht exisitiert (Entfernter Zugriff via FTP)" - -#: functions/config_class.php:451 -msgid "Cannot delete file because the permissions are wrong (remote SFTP)!" -msgstr "Datei kann aufgrund falscher Dateiberechtigungen nicht gelöscht werden (Entfernter Zugriff via SSH/SFTP)" - -#: functions/config_class.php:454 -msgid "Cannot delete file because it does not exists (remote SFTP)!" -msgstr "Datei kann nicht gelöscht werden, da sie nicht exisitiert (Entfernter Zugriff via SSH/SFTP)" - -#: functions/config_class.php:488 -msgid "Cannot get the configuration file (FTP connection failed)!" -msgstr "Kann die Konfigurationsdatei nicht abholen (FTP Verbindung fehlgeschlagen)!" - -#: functions/config_class.php:499 -msgid "Cannot write the configuration file (FTP connection failed)!" -msgstr "Kann die Konfigurationsdatei nicht schreiben (FTP Verbindung fehlgeschlagen)!" - -#: functions/config_class.php:518 -msgid "Cannot get the configuration file (SSH connection failed)!" -msgstr "Kann die Konfigurationsdatei nicht abholen (SSH/SFTP Verbindung fehlgeschlagen)!" - -#: functions/config_class.php:524 -msgid "Cannot get the configuration file (remote file does not exist)!" -msgstr "Kann die Konfigurationsdatei nicht abholen, da sie nicht existiert (Entfernter Zugriff via SSH/SFTP)!" - -#: functions/config_class.php:533 -msgid "Cannot write the configuration file (SSH connection failed)!" -msgstr "Kann die Konfigurationsdatei nicht schreiben (Entfernter Zugriff via SSH/SFTP)!" - -#: functions/config_class.php:563 -#: functions/config_class.php:761 -msgid "It is not possible to write config files directly from the common domain!" -msgstr "Es ist nicht möglich Konfigurationsdateien direkt aus der globalen Domäne zu schreiben!" - -#: functions/config_class.php:929 -msgid "Writing of the configuration failed - no dataset, not activated dataset found or you do not have write permission." -msgstr "Das Schreiben der Konfiguration ist fehlgeschlagen - es wurde kein existierender bzw. kein aktiver Datensatz gefunden oder die Schreibrechte fehlen." - -#: functions/config_class.php:1046 -msgid "Configuration write failed (FTP connection failed):" -msgstr "Konfigurationsdatei konnte nicht geschrieben werden (FTP Verbindung fehlgeschlagen)" - -#: functions/config_class.php:1047 -#: functions/config_class.php:1111 -msgid "Cannot open/overwrite the configuration file (FTP connection failed)!" -msgstr "Kann die Konfigurationsdatei nicht öffnen/überschreiben (FTP Verbindung fehlgeschlagen)!" - -#: functions/config_class.php:1133 -msgid "Cannot open/overwrite the configuration file (remote SFTP)!" -msgstr "Kann Konfigurationsdatei nicht öffnen/überschreiben (Entfernter Zugriff via SSH/SFTP)!" - -#: functions/config_class.php:1608 -#: functions/config_class.php:1609 -#: functions/config_class.php:1652 -#: functions/config_class.php:1653 -msgid "Connection to remote system failed (SSH2 connection):" -msgstr "Verbindung zum entfernten System ist fehlgeschlagen (SSH2 Verbindung):" - -#: functions/config_class.php:1624 -#: functions/config_class.php:1625 -msgid "SSH public key does not exist or is not readable" -msgstr "Der SSH Public Key existiert nicht oder ist nicht lesbar" - -#: functions/config_class.php:1629 -#: functions/config_class.php:1630 -msgid "SSH private key does not exist or is not readable" -msgstr "Der SSH Private Key existiert nicht oder ist nicht lesbar" - -#: functions/config_class.php:1733 -#: functions/config_class.php:1734 +#: functions/NagConfigClass.php:336 functions/NagConfigClass.php:338 msgid "Connection to remote system failed (FTP connection):" msgstr "Verbindung zum entfernten System ist fehlgeschlagen (FTP Verbindung):" +#: functions/NagConfigClass.php:387 functions/NagConfigClass.php:389 +msgid "SSH public key does not exist or is not readable" +msgstr "Der SSH Public Key existiert nicht oder ist nicht lesbar" + +#: functions/NagConfigClass.php:394 functions/NagConfigClass.php:396 +msgid "SSH private key does not exist or is not readable" +msgstr "Der SSH Private Key existiert nicht oder ist nicht lesbar" + +#: functions/NagConfigClass.php:430 functions/NagConfigClass.php:432 +#: functions/NagConfigClass.php:441 functions/NagConfigClass.php:443 +msgid "Connection to remote system failed (SSH2 connection):" +msgstr "Verbindung zum entfernten System ist fehlgeschlagen (SSH2 Verbindung):" + +#: functions/NagConfigClass.php:600 +msgid "" +"Cannot backup the old file because the permissions are wrong - destination " +"file: " +msgstr "" +"Kann die alte Datei nicht sichern weil die Dateirechte falsch sind - " +"Zieldatei: " + +#: functions/NagConfigClass.php:605 +msgid "" +"Cannot backup the old file because the source file is missing - source file: " +msgstr "" +"Kann die alte Datei nicht sichern weil die Quelldatei nicht gefunden wurde: " + +#: functions/NagConfigClass.php:623 +msgid "" +"Cannot backup the old file because the source file is missing (remote FTP) - " +"source file: " +msgstr "" +"Kann die alte Datei nicht sichern weil die Quelldatei nicht gefunden wurde " +"(FTP Zugriff) - Quelldatei: " + +#: functions/NagConfigClass.php:629 +msgid "" +"Cannot backup the old file because the permissions are wrong (remote FTP) - " +"destination file: " +msgstr "" +"Kann die alte Datei nicht sichern weil die Dateirechte falsch sind (FTP " +"Zugriff) - Zieldatei: " + +#: functions/NagConfigClass.php:648 +msgid "" +"Cannot backup the old file because the source file is missing (remote SFTP) " +"- source file: " +msgstr "" +"Kann die alte Datei nicht sichern weil die Quelldatei nicht gefunden wurde " +"(SSH/SFTP Zugriff) - Quelldatei: " + +#: functions/NagConfigClass.php:654 +msgid "" +"Cannot backup the old file because the permissions are wrong (remote SFTP) - " +"destination file: " +msgstr "" +"Kann die alte Datei nicht sichern weil die Dateirechte falsch sind (SSH/SFTP " +"Zugriff) - Zieldatei: " + +#: functions/NagConfigClass.php:685 +msgid "Cannot delete the file (wrong permissions)!" +msgstr "Datei kann nicht gelöscht werden (Berechtigungen prüfen)!" + +#: functions/NagConfigClass.php:690 +msgid "Cannot delete the file (file does not exist)!" +msgstr "Datei kann nicht gelöscht werden (Datei existiert nicht)!" + +#: functions/NagConfigClass.php:706 +msgid "Cannot delete file because it does not exists (remote FTP)!" +msgstr "" +"Datei kann nicht gelöscht werden, da sie nicht exisitiert (Entfernter " +"Zugriff via FTP)" + +#: functions/NagConfigClass.php:712 +msgid "Cannot delete file because the permissions are incorrect (remote FTP)!" +msgstr "" +"Datei kann aufgrund falscher Dateiberechtigungen nicht gelöscht werden (FTP " +"Remote Dateirechte)" + +#: functions/NagConfigClass.php:724 +msgid "Cannot delete file because it does not exists (remote SSH/SFTP)!" +msgstr "" +"Datei kann nicht gelöscht werden, da sie nicht vorhanden ist (Entfernter " +"Zugriff via SSH/SFTP)" + +#: functions/NagConfigClass.php:730 +msgid "" +"Cannot delete file because the permissions are incorrect (remote SSH/SFTP)!" +msgstr "" +"Datei kann aufgrund falscher Dateiberechtigungen nicht gelöscht werden " +"(Entfernter Zugriff via SSH/SFTP)" + +#: functions/NagConfigClass.php:822 functions/NagConfigClass.php:846 +msgid "" +"Cannot get the remote file (it does not exist or is not readable) - remote " +"file: " +msgstr "Importdatei existiert nicht oder ist nicht lesbar - Importdatei: " + +#: functions/NagConfigClass.php:831 +msgid "" +"Cannot write the remote file (remote file is not writeable)- remote file: " +msgstr "" +"Kann die entfernte Datei nicht schreiben (fehlende Schreibrechte) - " +"entfernte Datei: " + +#: functions/NagConfigClass.php:849 +msgid "Remote file is not readable - remote file: " +msgstr "Entfernte Datei ist nicht lesbar - entfernte Datei: " + +#: functions/NagConfigClass.php:860 +msgid "" +"Cannot write a remote file (remote file is not writeable) - remote file: " +msgstr "" +"Kann eine entfernte Datei nicht schreiben (fehlende Schreibrechte) - " +"entfernte Datei: " + +#: functions/NagConfigClass.php:866 +msgid "" +"Cannot copy a local file to remote because the local file does not exist or " +"is not readable - local file: " +msgstr "" +"Kann eine lokale Datei nicht auf ein entferntes System kopieren, weil die " +"lokale Datei nicht existiert oder nicht lesbar ist - lokale Datei: " + # contacts.php -#: functions/config_class.php:1867 +#: functions/NagConfigClass.php:894 msgid "Could not open directory" msgstr "Kann das Verzeichnis nicht öffnen" -#: functions/content_class.php:274 -#: functions/content_class.php:278 +# config_class.php +#: functions/NagConfigClass.php:1003 functions/NagConfigClass.php:1006 +msgid "Warning: configuration file is out of date!" +msgstr "Achtung: Konfigurationsdatei ist veraltet!" + +#: functions/NagConfigClass.php:1010 functions/NagConfigClass.php:1042 +#: functions/NagConfigClass.php:1108 +msgid "Warning: no configuration target defined!" +msgstr "Achtung: kein Konfigurationsziel definiert!" + +#: functions/NagConfigClass.php:1030 functions/NagConfigClass.php:1076 +msgid "" +"It is not possible to write config files directly from the common domain!" +msgstr "" +"Es ist nicht möglich Konfigurationsdateien direkt aus der globalen Domäne zu " +"schreiben!" + +#: functions/NagConfigClass.php:2069 +msgid "Cannot open/overwrite the configuration file (FTP connection failed)!" +msgstr "" +"Kann die Konfigurationsdatei nicht schreiben/überschreiben (FTP Verbindung " +"fehlgeschlagen)!" + +#: functions/NagConfigClass.php:2091 +msgid "Cannot open/overwrite the configuration file (remote SFTP)!" +msgstr "" +"Kann Konfigurationsdatei nicht öffnen/überschreiben (Entfernter Zugriff via " +"SSH/SFTP)!" + +#: functions/NagContentClass.php:251 msgid "out-of-date" msgstr "Veraltet" -#: functions/content_class.php:275 +#: functions/NagContentClass.php:253 msgid "no target" msgstr "kein Ziel" -#: functions/content_class.php:276 -#: functions/content_class.php:277 +#: functions/NagContentClass.php:256 functions/NagContentClass.php:259 msgid "missed" msgstr "fehlt" -#: functions/content_class.php:279 +#: functions/NagContentClass.php:262 install/functions/NagInstallClass.php:479 msgid "up-to-date" msgstr "Aktuell" -#: functions/content_class.php:351 +#: functions/NagContentClass.php:355 msgid "Last database update:" msgstr "Letzte Datenbankänderung:" -#: functions/content_class.php:354 +#: functions/NagContentClass.php:359 msgid "Last file change of the configuration target " -msgstr "Letzte Dateiänderung beim Konfigurationsziel" +msgstr "Letzte Dateiänderung beim Konfigurationsziel " -# data_class.php -#: functions/data_class.php:116 -#: functions/data_class.php:140 -msgid "Delete failed because a database error:" -msgstr "Löschen wegen eines Datenbankfehlers fehlgeschlagen:" - -#: functions/data_class.php:119 -#: functions/data_class.php:149 -#: functions/data_class.php:158 -msgid "No data deleted. Probably the dataset does not exist or it is protected from delete." -msgstr "Keine Daten gelöscht. Möglicherweise existiert der Datensatz nicht, oder er ist Löschgeschützt." - -#: functions/data_class.php:123 -msgid "Delete dataset id:" -msgstr "Daten gelöscht mit id:" - -#: functions/data_class.php:123 -msgid "- from table:" -msgstr "- von Tabelle:" - -#: functions/data_class.php:123 -#: functions/data_class.php:153 -#: functions/data_class.php:311 -#: functions/data_class.php:638 -#: functions/data_class.php:703 -msgid "- with affected rows:" -msgstr "- Anzahl betroffene Datensätze:" - -#: functions/data_class.php:153 -#: functions/data_class.php:311 -msgid "Delete data from table:" -msgstr "Daten gelöscht aus der Tabelle:" - -#: functions/data_class.php:306 -msgid "No data deleted. Probably the dataset does not exist, it is protected from deletion, you do not have write permission or it has relations to other configurations which cannot be deleted. Use the \"info\" function for detailed informations about relations!" -msgstr "Kein Datensatz gelöscht. Möglicherweise existiert der Datensatz nicht, er ist Löschgeschützt, die Schreibrechte fehlen oder er hat noch nicht aufgelöste Abhängigkeiten. Benutze die \"info\" Funktion für weitere Informationen über Abhängigkeiten!" - -#: functions/data_class.php:316 -msgid "No data deleted. Probably the dataset does not exist, it is protected from deletion or you do not have write permission." -msgstr "Kein Datensatz gelöscht. Möglicherweise existiert der Datensatz nicht, er ist Löschgeschützt oder die Schreibrechte fehlen." - -#: functions/data_class.php:553 -#: functions/data_class.php:554 +#: functions/NagDataClass.php:267 functions/NagDataClass.php:269 msgid "Data set copy failed - table [new name]:" msgstr "Kopieren fehlgeschlagen - Tabelle [Neuer Name]:" -#: functions/data_class.php:557 -#: functions/data_class.php:558 +#: functions/NagDataClass.php:273 functions/NagDataClass.php:275 msgid "Data set copied - table [new name]:" msgstr "Daten in Tabelle kopiert - Tabelle [Neuer Name]:" -#: functions/data_class.php:576 -#: functions/data_class.php:580 -msgid "No dataset copied. Maybe the dataset does not exist or you do not have write permission." -msgstr "Kein Datensatz kopiert. Möglicherweise existiert der Datensatz nicht, es wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen." +#: functions/NagDataClass.php:295 functions/NagDataClass.php:300 +msgid "" +"No dataset copied. Maybe the dataset does not exist or you do not have write " +"permission." +msgstr "" +"Kein Datensatz kopiert. Möglicherweise existiert der Datensatz nicht oder " +"die Schreibrechte fehlen." -#: functions/data_class.php:633 -msgid "No dataset activated. Maybe the dataset does not exist, no dataset was selected or you do not have write permission." -msgstr "Kein Datensatz aktiviert. Möglicherweise existiert der Datensatz nicht, es wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen." +# data_class.php +#: functions/NagDataClass.php:393 functions/NagDataClass.php:422 +msgid "Delete failed because a database error:" +msgstr "Löschen wegen eines Datenbankfehlers fehlgeschlagen:" -#: functions/data_class.php:637 -msgid "Dataset successfully activated. Affected rows:" -msgstr "Datensätze erfolgreich aktiviert. Betroffenene Datensätze: " +#: functions/NagDataClass.php:397 +msgid "" +"No data deleted. The dataset probably does not exist or is protected from " +"deletion." +msgstr "" +"Keine Daten gelöscht. Möglicherweise existiert der Datensatz nicht oder er " +"ist Löschgeschützt." -#: functions/data_class.php:638 -#: functions/data_class.php:703 -msgid "Activate dataset from table:" -msgstr "Datensatz aktiviert aus der Tabelle:" +#: functions/NagDataClass.php:403 +msgid "Delete dataset id:" +msgstr "Daten gelöscht mit id:" -#: functions/data_class.php:642 -msgid "No dataset activated. Maybe the dataset does not exist or you do not have write permission." -msgstr "Kein Datensatz aktiviert. Möglicherweise existiert der Datensatz nicht, es wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen." +#: functions/NagDataClass.php:403 +msgid "- from table:" +msgstr "- von Tabelle:" -#: functions/data_class.php:698 -msgid "No dataset deactivated. Maybe the dataset does not exist, it is protected from deactivation, no dataset was selected or you do not have write permission. Use the \"info\" function for detailed informations about relations!" -msgstr "Kein Datensatz deaktiviert. Möglicherweise existiert der Datensatz nicht, er kann nicht deaktiviert werden, es wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen. Benutze die \"info\" Funktion für weitere Informationen über Abhängigkeiten!" +#: functions/NagDataClass.php:404 functions/NagDataClass.php:439 +#: functions/NagDataClass.php:614 functions/NagDataClass.php:963 +#: functions/NagDataClass.php:1020 +msgid "- with affected rows:" +msgstr "- Anzahl betroffene Datensätze:" -#: functions/data_class.php:702 -msgid "Dataset successfully deactivated. Affected rows:" -msgstr "Datensatz erfolgreich deaktiviert. Betroffene Datensätze:" +#: functions/NagDataClass.php:432 functions/NagDataClass.php:443 +msgid "" +"No data deleted. Probably the dataset does not exist or it is protected from " +"delete." +msgstr "" +"Keine Daten gelöscht. Möglicherweise existiert der Datensatz nicht, oder er " +"ist Löschgeschützt." -#: functions/data_class.php:707 -msgid "No dataset deactivated. Maybe the dataset does not exist or you do not have write permission." -msgstr "Kein Datensatz deaktiviert. Möglicherweise existiert der Datensatz nicht, es wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen." +#: functions/NagDataClass.php:438 functions/NagDataClass.php:613 +msgid "Deleted data from table:" +msgstr "Daten gelöscht aus der Tabelle:" -#: functions/data_class.php:891 +#: functions/NagDataClass.php:603 +msgid "" +"No data deleted. Probably the dataset does not exist, it is protected from " +"deletion, you do not have write permission or it has relations to other " +"configurations which cannot be deleted. Use the \"info\" function for " +"detailed informations about relations!" +msgstr "" +"Kein Datensatz gelöscht. Möglicherweise existiert der Datensatz nicht, er " +"ist Löschgeschützt, die Schreibrechte fehlen oder er hat noch nicht " +"aufgelöste Abhängigkeiten. Benutze die \"info\" Funktion für weitere " +"Informationen über Abhängigkeiten!" + +#: functions/NagDataClass.php:619 +msgid "" +"No data deleted. Probably the dataset does not exist, it is protected from " +"deletion or you do not have write permission." +msgstr "" +"Kein Datensatz gelöscht. Möglicherweise existiert der Datensatz nicht, er " +"ist Löschgeschützt oder die Schreibrechte fehlen." + +#: functions/NagDataClass.php:691 msgid "Relation information for " msgstr "Verknüpfungsinformationen für " -#: functions/data_class.php:891 +#: functions/NagDataClass.php:692 msgid " of table " msgstr " aus der Tabelle " -#: functions/data_class.php:945 -#: functions/data_class.php:947 -#: functions/data_class.php:951 -#: functions/data_class.php:967 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:747 functions/NagDataClass.php:752 +#: functions/NagDataClass.php:759 functions/NagDataClass.php:778 +#: functions/NagDataClass.php:784 msgid "Relation to " msgstr "Verknüpfung nach " -#: functions/data_class.php:945 -#: functions/data_class.php:947 -#: functions/data_class.php:951 -#: functions/data_class.php:967 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:748 functions/NagDataClass.php:753 +#: functions/NagDataClass.php:760 functions/NagDataClass.php:779 +#: functions/NagDataClass.php:785 msgid ", entry " msgstr ", Eintrag " -#: functions/data_class.php:945 -#: functions/data_class.php:951 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:749 functions/NagDataClass.php:761 +#: functions/NagDataClass.php:787 msgid "deletion possible" msgstr "löschen möglich" -#: functions/data_class.php:947 -#: functions/data_class.php:967 +#: functions/NagDataClass.php:755 functions/NagDataClass.php:781 msgid "deletion not possible" msgstr "löschen nicht möglich" -#: functions/import_class.php:78 -msgid "Unable to get configuration data:" -msgstr "Konfigurationsdaten nicht gefunden:" +#: functions/NagDataClass.php:954 +msgid "" +"No dataset deactivated. Maybe the dataset does not exist, it is protected " +"from deactivation, no dataset was selected or you do not have write " +"permission. Use the \"info\" function for detailed informations about " +"relations!" +msgstr "" +"Kein Datensatz deaktiviert. Möglicherweise existiert der Datensatz nicht, er " +"kann nicht deaktiviert werden, es wurde kein Datensatz ausgewählt oder die " +"Schreibrechte fehlen. Benutze die \"info\" Funktion für weitere " +"Informationen über Abhängigkeiten!" -#: functions/import_class.php:98 -msgid "Cannot receive the configuration file (FTP connection)!" -msgstr "Kann die Konfigurationsdatei nicht empfangen (Entfernter Zugriff via FTP)" +#: functions/NagDataClass.php:960 +msgid "Dataset successfully deactivated. Affected rows:" +msgstr "Datensatz erfolgreich deaktiviert. Betroffene Datensätze:" -#: functions/import_class.php:116 -msgid "Cannot receive the configuration file (SSH connection)!" -msgstr "Kann die Konfigurationsdatei nicht empfangen (Entfernter Zugriff via SSH/SFTP)" +#: functions/NagDataClass.php:962 +msgid "Deactivate dataset from table:" +msgstr "Datensatz deaktiviert aus der Tabelle:" -#: functions/import_class.php:189 +#: functions/NagDataClass.php:967 +msgid "" +"No dataset deactivated. Maybe the dataset does not exist or you do not have " +"write permission." +msgstr "" +"Kein Datensatz deaktiviert. Möglicherweise existiert der Datensatz nicht, es " +"wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen." + +#: functions/NagDataClass.php:1013 +msgid "" +"No dataset activated. Maybe the dataset does not exist, no dataset was " +"selected or you do not have write permission." +msgstr "" +"Kein Datensatz aktiviert. Möglicherweise existiert der Datensatz nicht, es " +"wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen." + +#: functions/NagDataClass.php:1017 +msgid "Dataset successfully activated. Affected rows:" +msgstr "Datensätze erfolgreich aktiviert. Betroffenene Datensätze:" + +#: functions/NagDataClass.php:1019 +msgid "Activate dataset from table:" +msgstr "Datensatz aktiviert aus der Tabelle:" + +#: functions/NagDataClass.php:1024 +msgid "" +"No dataset activated. Maybe the dataset does not exist or you do not have " +"write permission." +msgstr "" +"Kein Datensatz aktiviert. Möglicherweise existiert der Datensatz nicht, es " +"wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen." + +#: functions/NagImportClass.php:162 msgid "No valid configuration found:" msgstr "Keine gültige Konfiguration gefunden:" -#: functions/import_class.php:198 +#: functions/NagImportClass.php:170 msgid "Import file does not exist or is not readable:" msgstr "Importdatei existiert nicht oder ist nicht lesbar:" -#: functions/import_class.php:266 -msgid "Table for import definition" -msgstr "Tabelle für die Importdefinition" +#: functions/NagImportClass.php:202 +msgid "Unable to get configuration data:" +msgstr "Konfigurationsdaten nicht gefunden:" -# mutdialog.php -#: functions/import_class.php:266 -msgid "is not available!" -msgstr "ist nicht verfügbar" +#: functions/NagImportClass.php:229 +msgid "Cannot receive the configuration file (FTP connection)!" +msgstr "" +"Kann die Konfigurationsdatei nicht empfangen (Entfernter Zugriff via FTP)" -#: functions/import_class.php:318 -#: functions/import_class.php:323 -#: functions/import_class.php:635 -#: functions/import_class.php:636 -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: functions/NagImportClass.php:252 +msgid "Cannot receive the configuration file (SSH connection)!" +msgstr "" +"Kann die Konfigurationsdatei nicht empfangen (Entfernter Zugriff via SSH/" +"SFTP)" + +#: functions/NagImportClass.php:351 functions/NagImportClass.php:356 +#: functions/NagImportClass.php:420 functions/NagImportClass.php:426 +#: functions/NagImportClass.php:433 functions/NagImportClass.php:438 msgid "inside" msgstr "innerhalb" -#: functions/import_class.php:318 +#: functions/NagImportClass.php:352 msgid "exists and were not overwritten" msgstr "existiert bereits und wurden nicht überschrieben" -#: functions/import_class.php:323 +#: functions/NagImportClass.php:357 msgid "were not written" msgstr "konnten nicht geschrieben werden" # contacts.php -#: functions/import_class.php:635 -#: functions/import_class.php:636 +#: functions/NagImportClass.php:421 functions/NagImportClass.php:427 msgid "could not be inserted:" -msgstr "konnte nicht eingetragen werden" +msgstr "konnte nicht eingetragen werden:" -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: functions/NagImportClass.php:434 functions/NagImportClass.php:439 msgid "successfully inserted" msgstr "erfolgreich eingetragen" -#: functions/import_class.php:1275 -msgid "Error: wrong number of arguments - cannot import service group members" -msgstr "Fehler: ungültige Anzahl Argumente - kann die Servicegruppenmitglieder nicht eintragen" +#: functions/NagImportClass.php:564 +msgid "Table for import definition" +msgstr "Tabelle für die Importdefinition" -#: functions/mysql_class.php:269 -msgid "Missing server connection parameter!" -msgstr "Fehlende Parameter für die Serververbindung!" +# mutdialog.php +#: functions/NagImportClass.php:565 +msgid "is not available!" +msgstr "ist nicht verfügbar!" -#: functions/mysql_class.php:276 -#: functions/mysql_class.php:305 -msgid "Connection to the database server has failed by reason:" -msgstr "Die Verbindung zum Datenbankserver erzeugte den folgenden Fehler:" +#: functions/NagImportClass.php:1640 +msgid "" +"Error: incorrect number of arguments - cannot import service group members" +msgstr "" +"Fehler: ungültige Anzahl Argumente - kann die Servicegruppenmitglieder nicht " +"importieren" -#: functions/mysql_class.php:298 -msgid "Missing database connection parameter!" -msgstr "Fehlende Parameter für die Datenbankverbindung!" +#: functions/NagImportClass.php:1868 +msgid "" +"Error: incorrect number of arguments - cannot import service parent members" +msgstr "" +"Fehler: ungültige Anzahl Argumente - kann die vorgeschalteten Services der " +"Servicedefinition nicht importieren" -#: functions/nag_class.php:123 +#: functions/NagImportClass.php:1929 functions/NagImportClass.php:1934 +msgid "Error: cannot import the service parent member " +msgstr "" +"Fehler: kann die vorgeschalteten Services der Servicedefinition nicht " +"eintragen " + +#: functions/NagImportClass.php:1931 +msgid "This combination is not unique!" +msgstr "Diese Kombination ist nicht eindeutig!" + +#: functions/NagImportClass.php:1936 +msgid "This combination is not unique or does not exist!" +msgstr "Diese Kombination ist nicht eindeutig oder nicht vorhanden!" + +#: functions/NagVisualClass.php:227 msgid "Hide menu" msgstr "Menu ausblenden" -#: functions/nag_class.php:132 +#: functions/NagVisualClass.php:237 msgid "Show menu" msgstr "Menu einblenden" -#: functions/nag_class.php:406 +#: functions/NagVisualClass.php:272 msgid "Page" msgstr "Seite" -#: functions/nag_class.php:961 +#: functions/NagVisualClass.php:805 msgid "Unrestricted access" msgstr "Uneingeschränkter Zugriff" -# prepend.adm -#: functions/prepend_adm.php:101 -#: install/index.php:100 -msgid "Error while connecting to database:" -msgstr "Fehler beim Verbinden mit der Datenbank: " +#: functions/prepend_adm.php:214 +msgid "" +"Error in setting the correct locale, please report this error with the " +"associated output of 'locale -a' to bugs@nagiosql.org" +msgstr "" +"Fehler bei der Erkennung der richtigen Umgebungsvariable locale. Bitte diese " +"Fehlermeldung und die Ausgabe von 'locale -a' an bugs@nagiosql.org schicken" -#: functions/prepend_adm.php:133 -#: functions/prepend_adm.php:192 -msgid "Error in setting the correct locale, please report this error with the associated output of 'locale -a' to bugs@nagiosql.org" -msgstr "Fehler bei der Erkennung der richtigen Umgebungsvariable locale. Bitte diese Fehlermeldung und die Ausgabe von 'locale -a' an bugs@nagiosql.org schicken" - -#: functions/prepend_adm.php:269 +#: functions/prepend_adm.php:306 msgid "Webserver login successfull" msgstr "Webserver-Login erfolgreich" -#: functions/prepend_adm.php:302 +#: functions/prepend_adm.php:347 msgid "Login successfull" msgstr "Login erfolgreich" -#: functions/prepend_adm.php:307 -#: functions/prepend_adm.php:308 +#: functions/prepend_adm.php:354 functions/prepend_adm.php:355 msgid "Login failed!" msgstr "Login fehlgeschlagen!" -#: functions/prepend_adm.php:332 +#: functions/prepend_adm.php:387 msgid "Session timeout reached - Seconds:" msgstr "Session timeout erreicht - Sekunden:" -#: functions/prepend_adm.php:343 +#: functions/prepend_adm.php:402 msgid "Restricted site accessed:" msgstr "Unerlaubte Seite aufgerufen:" -#: functions/prepend_adm.php:355 +#: functions/prepend_adm.php:419 msgid "User not found in database" msgstr "User in Datenbank nicht gefunden" -#: functions/prepend_adm.php:393 -msgid "Admin" -msgstr "Administration" - -#: functions/prepend_adm.php:457 +#: functions/prepend_adm.php:548 msgid "Logged in:" msgstr "Eingeloggt:" -#: functions/prepend_adm.php:458 +#: functions/prepend_adm.php:550 msgid "Logout" msgstr "Abmelden" -#: functions/prepend_adm.php:478 -msgid "Warning - template file not found or not readable, please check your file permissions! - File: " -msgstr "Achtung, das Template konnte nicht gefunden werden oder ist nicht schreibbar, bitte überprüfe die Rechte! - Datei:" +#: functions/prepend_adm.php:573 +msgid "" +"Warning - template file not found or not readable, please check your file " +"permissions! - File: " +msgstr "" +"Achtung, das Template konnte nicht gefunden werden oder ist nicht " +"schreibbar, bitte überprüfe die Rechte! - Datei: " -#: functions/prepend_content.php:303 -#: functions/prepend_content.php:306 -#: functions/prepend_content.php:322 -#: functions/prepend_content.php:325 -msgid "Some configuration files were not written. Dataset not activated, not found or you do not have write permission!" -msgstr "Einige Konfigurationsdateien wurden nicht geschrieben. Es wurde kein existierender bzw. kein aktiver Datensatz gefunden oder die Schreibrechte fehlen." +#: functions/prepend_content.php:258 functions/prepend_content.php:265 +#: functions/prepend_content.php:288 functions/prepend_content.php:295 +msgid "" +"Some configuration files were not written. Dataset not activated, not found " +"or you do not have write permission!" +msgstr "" +"Einige Konfigurationsdateien wurden nicht geschrieben. Es wurde kein " +"existierender bzw. kein aktiver Datensatz gefunden oder die Schreibrechte " +"fehlen!" -#: functions/prepend_content.php:305 -#: functions/prepend_content.php:324 +#: functions/prepend_content.php:262 functions/prepend_content.php:292 msgid "Configuration files successfully written!" msgstr "Konfigurationsdateien erfolgreich geschrieben!" -#: functions/prepend_content.php:344 -msgid "Admin can't be deleted" +#: functions/prepend_content.php:321 +msgid "Admin cannot be deleted" msgstr "Der Benutzer Admin kann nicht gelöscht werden" -#: functions/prepend_content.php:347 +#: functions/prepend_content.php:325 msgid "Localhost can't be deleted" msgstr "Localhost kann nicht gelöscht werden" -#: functions/prepend_content.php:475 +#: functions/prepend_content.php:502 msgid "No permission to open configuration!" -msgstr "Nicht genügend Rechte um die Konfiguration zu öffnen" +msgstr "Nicht genügend Rechte um die Konfiguration zu öffnen!" -#: functions/translator.php:56 +#: functions/translator.php:63 install/functions/NagInstallClass.php:99 msgid "English" msgstr "Englisch" -#: functions/translator.php:60 +#: functions/translator.php:67 install/functions/NagInstallClass.php:103 msgid "German" msgstr "Deutsch" -#: functions/translator.php:64 +#: functions/translator.php:71 install/functions/NagInstallClass.php:107 msgid "Chinese (Simplified)" msgstr "Chinese (Simplified)" -#: functions/translator.php:68 +#: functions/translator.php:75 install/functions/NagInstallClass.php:111 msgid "Italian" msgstr "Italienisch" -#: functions/translator.php:72 +#: functions/translator.php:79 install/functions/NagInstallClass.php:115 msgid "French" msgstr "Französisch" -#: functions/translator.php:76 +#: functions/translator.php:83 install/functions/NagInstallClass.php:119 msgid "Russian" msgstr "Russisch" -#: functions/translator.php:80 +#: functions/translator.php:87 install/functions/NagInstallClass.php:123 msgid "Spanish" msgstr "Spanisch" -#: functions/translator.php:84 +#: functions/translator.php:91 install/functions/NagInstallClass.php:127 msgid "Portuguese (Brazilian)" msgstr "Portugiesisch (Brasilianisch)" -#: functions/translator.php:88 +#: functions/translator.php:95 install/functions/NagInstallClass.php:131 msgid "Dutch" msgstr "Niederländisch" -#: functions/translator.php:92 +#: functions/translator.php:99 install/functions/NagInstallClass.php:135 msgid "Danish" msgstr "Dänisch" -#: install/index.php:63 -#: install/index.php:172 +#: index.php:47 +msgid "Welcome to" +msgstr "Willkommen bei" + +#: index.php:48 +msgid "Welcome" +msgstr "Willkommen" + +#: index.php:49 +msgid "" +"Please enter your username and password to access NagiosQL.
If you forgot " +"one of them, please contact your Administrator." +msgstr "" +"Bitte geben Sie Ihren Benutzernamen und Ihr Passwort für den NagiosQL " +"Zugriff ein.
Sollten Sie keinen Zugang besitzen oder Ihr Passwort " +"vergessen haben, so wenden Sie sich an einen Administrator." + +#: index.php:53 +msgid "Login" +msgstr "Login" + +#: install/functions/NagInstallClass.php:75 +msgid "Template file not found" +msgstr "Vorlagenndatei nicht gefunden" + +#: install/functions/NagInstallClass.php:336 +#: install/functions/NagInstallClass.php:368 +msgid "passed" +msgstr "funktioniert" + +# prepend.adm +#: install/functions/NagInstallClass.php:358 +msgid "Error while connecting to database:" +msgstr "Fehler beim Verbinden mit der Datenbank:" + +#: install/functions/NagInstallClass.php:399 +#: install/functions/NagInstallClass.php:474 +msgid "supported" +msgstr "unterstützt" + +#: install/functions/NagInstallClass.php:401 +msgid "not supported" +msgstr "nicht unterstützt" + +#: install/functions/NagInstallClass.php:477 +msgid "" +"Your NagiosQL installation is up to date - no further actions are needed!" +msgstr "" +"Ihre NagiosQL Installation ist aktuell - es sind keine weiteren Schritte " +"notwendig!" + +#: install/functions/NagInstallClass.php:483 +#: install/functions/NagInstallClass.php:491 +msgid "" +"Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and " +"above!" +msgstr "" +"Aktualisierungen nach NagiosQL 3.2 und höher sind erst ab NagiosQL Version " +"3.0 unterstützt!" + +# prepend.adm +#: install/functions/NagInstallClass.php:489 +msgid "Error while selecting settings table." +msgstr "Fehler bei Abrufen der Einstellungstabelle." + +#: install/functions/NagInstallClass.php:511 +#: install/functions/NagInstallClass.php:547 +#: install/functions/NagInstallClass.php:610 +#: install/functions/NagInstallClass.php:614 +#: install/functions/NagInstallClass.php:655 +#: install/functions/NagInstallClass.php:736 +#: install/functions/NagInstallClass.php:819 +#: install/functions/NagInstallClass.php:870 +#: install/functions/NagInstallClass.php:935 +#: install/functions/NagInstallClass.php:945 +#: install/functions/NagInstallClass.php:967 +#: install/functions/NagInstallClass.php:1015 +#: install/functions/NagInstallClass.php:1067 +msgid "done" +msgstr "erledigt" + +#: install/functions/NagInstallClass.php:538 +msgid "Unsupported database type." +msgstr "Nicht unterstützter Datenbanktyp." + +#: install/functions/NagInstallClass.php:611 +msgid "Only added rights to existing user" +msgstr "Nur Rechte zum bestehenden Benutzer hinzugefügt" + +# mutdialog.php +#: install/functions/NagInstallClass.php:641 +msgid "No SQL update files available" +msgstr "Keine SQL Updatedateien verfügbar" + +#: install/functions/NagInstallClass.php:650 +#: install/functions/NagInstallClass.php:707 +msgid "SQL file is not readable or empty" +msgstr "SQL Datei nicht lesbar oder leer" + +#: install/functions/NagInstallClass.php:778 +#: install/functions/NagInstallClass.php:785 +#: install/functions/NagInstallClass.php:813 +msgid "Inserting initial data to settings database has failed:" +msgstr "" +"Das Einfügen der Vorgabewerte in die Einstellungstabelle ist fehlgeschlagen:" + +#: install/functions/NagInstallClass.php:873 +msgid "Connot open/write to config/settings.php" +msgstr "" +"Kann die Konfigurationsdatei nicht öffnen/beschreiben (config/settings.php)" + +#: install/functions/NagInstallClass.php:905 +msgid "Inserting path data to database has failed:" +msgstr "Das Einfügen der Verzeichnisdaten in die Datenbank ist fehlgeschlagen:" + +#: install/functions/NagInstallClass.php:936 +msgid "Check the permissions of the created paths!" +msgstr "Überprüfen Sie die Rechte der Verzeichnisse!" + +#: install/functions/NagInstallClass.php:939 +msgid "NagiosQL config path is not writeable - only database values updated" +msgstr "" +"NagiosQL Konfigurationsverzeichnis ist nicht beschreibbar - es wurden nur " +"die Datenbankwerte eingetragen" + +# prepend.adm +#: install/functions/NagInstallClass.php:969 +#: install/functions/NagInstallClass.php:1017 +#: install/functions/NagInstallClass.php:1069 +msgid "Database errors while converting to utf-8:" +msgstr "Datenbankfehler während dem Konvertieren nach UTF-8:" + +#: install/functions/NagInstallClass.php:1008 +#: install/functions/NagInstallClass.php:1060 install/step3.php:88 +#: install/step3.php:177 +msgid "Database type not defined!" +msgstr "Datenbanktyp nicht definiert!" + +#: install/index.php:69 msgid "Online Documentation" msgstr "Online Handbuch" -#: install/index.php:99 +#: install/index.php:115 msgid "Database connection failed. Upgrade not available!" msgstr "Datenbankverbindung fehlgeschlagen. Upgrade ist nicht verfügbar!" -#: install/index.php:105 +#: install/index.php:122 msgid "Settings table not available or wrong. Upgrade not available!" -msgstr "Einstellungstabelle nicht vorhanden oder fehlerhaft. Das Upgrade ist nicht verfügbar!" +msgstr "" +"Einstellungstabelle nicht vorhanden oder fehlerhaft. Das Upgrade ist nicht " +"verfügbar!" -#: install/index.php:116 -msgid "Installation cannot continue, please make sure you have the mysql extension loaded!" -msgstr "Die Installation kann nicht fortgesetzt werden. Bitte stellen Sie sicher, dass die mysql Erweiterung geladen ist!" +#: install/index.php:133 +msgid "" +"Invalid database type in settings file (config/settings.php). Upgrade not " +"available!" +msgstr "" +"Datenbanktyp in der Konfigurationsdatei ist ungültig (config/settings.php). " +"Upgrade nicht verfügbar!" -#: install/index.php:121 -msgid "Installation cannot continue, postgres is not yet available in beta!" -msgstr "Die Installation kann nicht fortgesetzt werden. Postgres ist in der aktuellen Version noch nicht verfügbar!" +#: install/index.php:137 +msgid "" +"Database values in settings file are missing (config/settings.php). Upgrade " +"not available!" +msgstr "" +"Datenbankeinstellungen in der Konfigurationsdatei nicht gefunden (config/" +"settings.php). Upgrade nicht verfügbar!" -#: install/index.php:124 -msgid "Installation cannot continue, please make sure you have the pgsql extension loaded!" -msgstr "Die Installation kann nicht fortgesetzt werden. Bitte stellen Sie sicher, dass die pgsql Erweiterung geladen ist!" - -#: install/index.php:128 -msgid "Database type in settings file is wrong (config/settings.php). Upgrade not available!" -msgstr "Datenbanktyp in der Konfigurationsdatei ist ungültig (config/settings.php). Upgrade nicht verfügbar!" - -#: install/index.php:131 -msgid "Database values in settings file are missing (config/settings.php). Upgrade not available!" -msgstr "Datenbankeinstellungen in der Konfigurationsdatei nicht gefunden (config/settings.php). Upgrade nicht verfügbar!" - -#: install/index.php:134 -msgid "Settings file not found or not readable (config/settings.php). Upgrade not available!" -msgstr "Konfigurationsdatei nicht gefunden oder nicht lesbar (config/settings.php). Upgrade ist nicht verfügbar!" - -#: install/index.php:144 -msgid "Default values file is not available or not readable (install/functions/initial_settings.php). Installation possible, but without predefined data!" -msgstr "Die Datei mit den Einstellungsvorgaben ist nicht verfügbar oder kann nicht gelesen werden (install/functions/initial_settings.php). Die Installation ist möglich, aber ohne Standardwertvorgaben!" - -#: install/index.php:150 -#: install/install.php:124 -msgid "Welcome to the NagiosQL Installation Wizard" -msgstr "Willkommen zum NagiosQL Installations Assistenten" - -#: install/index.php:151 -msgid "This wizard will help you to install and configure NagiosQL." -msgstr "Dieser Assistent hilft Ihnen NagiosQL zu installieren und zu konfigurieren." +#: install/index.php:141 +msgid "" +"Settings file not found or not readable (config/settings.php). Upgrade not " +"available!" +msgstr "" +"Konfigurationsdatei nicht gefunden oder nicht lesbar (config/settings.php). " +"Upgrade ist nicht verfügbar!" #: install/index.php:152 +msgid "" +"Default values file is not available or not readable (install/functions/" +"initial_settings.php). Installation possible, but without predefined data!" +msgstr "" +"Die Datei mit den Einstellungsvorgaben ist nicht verfügbar oder kann nicht " +"gelesen werden (install/functions/initial_settings.php). Die Installation " +"ist möglich, aber ohne Standardwertvorgaben!" + +#: install/index.php:159 +msgid "Installation wizard" +msgstr "Installationsassistent" + +#: install/index.php:160 +msgid "Welcome to the NagiosQL installation wizard" +msgstr "Willkommen zum NagiosQL Installations Assistenten" + +#: install/index.php:161 +msgid "This wizard will help you to install and configure NagiosQL." +msgstr "" +"Dieser Assistent hilft Ihnen NagiosQL zu installieren und zu konfigurieren." + +#: install/index.php:163 msgid "For questions please visit" msgstr "Für Rückfragen besuchen Sie bitte" -#: install/index.php:153 -msgid "First let's check your local environment and find out if everything NagiosQL needs is available." -msgstr "Zuerst prüfen wir die lokale Umgebung und schauen ob NagiosQL alles findet was es benötigt." +#: install/index.php:164 +msgid "" +"First let's check your local environment and find out if everything NagiosQL " +"needs is available." +msgstr "" +"Zuerst prüfen wir die lokale Umgebung und schauen ob NagiosQL alles findet " +"was es benötigt." -#: install/index.php:154 +#: install/index.php:166 msgid "The basic requirements are:" msgstr "Die wichtigsten Voraussetzungen sind:" -#: install/index.php:155 -msgid "PHP 5.2.0 or greater including:" -msgstr "PHP 5.2.0 oder größer, inklusive:" +#: install/index.php:167 +msgid "PHP 5.5.0 or greater including:" +msgstr "PHP 5.5.0 oder größer, inklusive:" -#: install/index.php:156 -#: install/index.php:157 -#: install/index.php:158 -#: install/index.php:161 -#: install/index.php:163 -#: install/index.php:164 -msgid "PHP Module:" -msgstr "PHP Module:" +#: install/index.php:168 +msgid "PHP database module:" +msgstr "PHP Datenbank Modul:" -#: install/index.php:163 -#: install/index.php:164 -#: install/index.php:165 +#: install/index.php:169 +msgid "supported types are" +msgstr "unterstützte Typen sind" + +#: install/index.php:174 install/index.php:176 msgid "(optional)" msgstr "(optional)" -#: install/index.php:165 -msgid "PECL Extension:" +#: install/index.php:175 +msgid "PECL extension:" msgstr "PECL Erweiterung:" -#: install/index.php:166 +#: install/index.php:177 msgid "php.ini options" msgstr "php.ini Einstellungen" -#: install/index.php:167 +#: install/index.php:178 msgid "file_uploads on (for upload features)" msgstr "file_uploads on (für Upload Unterstützung)" -#: install/index.php:168 +#: install/index.php:179 msgid "session.auto_start needs to be off" msgstr "session.auto_start sollte auf \"off\" stehen" -#: install/index.php:169 -msgid "A MySQL database server" +#: install/index.php:180 +msgid "A database server" msgstr "Ein Datenbankserver" -#: install/index.php:170 -msgid "Nagios 2.x/3.x" -msgstr "Nagios 2.x/3.x" +#: install/index.php:181 +msgid "Nagios 2.x/3.x/4.x" +msgstr "Nagios 2.x/3.x/4.x" -#: install/index.php:176 +#: install/index.php:182 +msgid "NagiosQL version" +msgstr "NagiosQL Version" + +#: install/index.php:184 +msgid "Online documentation" +msgstr "Online Handbuch" + +#: install/index.php:188 msgid "START INSTALLATION" msgstr "STARTE NEUINSTALLTION" -#: install/index.php:177 +#: install/index.php:189 msgid "START UPDATE" msgstr "STARTE AKTUALISIERUNG" -#: install/step1.php:80 +#: install/install.php:214 +msgid "Welcome to the NagiosQL Installation Wizard" +msgstr "Willkommen zum NagiosQL Installations Assistenten" + +#: install/step1.php:74 install/step2.php:34 install/step3.php:38 msgid "Requirements" msgstr "Voraussetzungen" -#: install/step1.php:82 +#: install/step1.php:75 install/step1.php:77 install/step2.php:35 +#: install/step2.php:37 install/step3.php:39 install/step3.php:41 +msgid "Installation" +msgstr "Installation" + +#: install/step1.php:76 install/step2.php:36 install/step3.php:40 +#: install/step3.php:301 msgid "Finish" msgstr "Ende" -#: install/step1.php:83 +#: install/step1.php:78 msgid "Checking requirements" msgstr "Überprüfe Voraussetzungen" -#: install/step1.php:84 +#: install/step1.php:79 msgid "Checking Client" msgstr "Überprüfe Client" -#: install/step1.php:85 +#: install/step1.php:80 msgid "Checking PHP version" msgstr "Überprüfe PHP Version" -#: install/step1.php:86 +#: install/step1.php:81 msgid "Checking PHP extensions" msgstr "Überprüfe die PHP Erweiterungen" -#: install/step1.php:87 +#: install/step1.php:82 msgid "Checking available database interfaces" msgstr "Überprüfe vorhandene Datenbankschnittstellen" -#: install/step1.php:88 +#: install/step1.php:83 msgid "Checking php.ini/.htaccess settings" msgstr "Überprüfe php.ini/.htaccess Einstellungen" -#: install/step1.php:89 +#: install/step1.php:84 msgid "Checking System Permission" msgstr "Überprüfe Systemberechtigungen" -#: install/step1.php:90 +#: install/step1.php:85 msgid "The following modules/extensions are required to run NagiosQL" -msgstr "Die folgenden Module/Erweiterungen sind notwendig für NagiosQL" +msgstr "" +"Die folgenden Module/Erweiterungen sind notwendig für NagiosQL" -#: install/step1.php:91 +#: install/step1.php:87 msgid "The next couple of extensions are optional but recommended" msgstr "Die nächsten Erweiterungen sind optional aber empfohlen" -#: install/step1.php:92 -msgid "Check which of the supported extensions are installed. At least one of them is required." -msgstr "Überprüfe welche der unterstützten Erweiterungen installiert sind. Wenigstens eine ist notwendig" +#: install/step1.php:89 +msgid "" +"Check which of the supported extensions are installed. At least one of them " +"is required." +msgstr "" +"Überprüfe welche der unterstützten Erweiterungen installiert sind. " +"Wenigstens eine ist notwendig." -#: install/step1.php:93 +#: install/step1.php:91 msgid "The following settings are required to run NagiosQL" msgstr "Die folgenden Einstellungen sind notwendig für NagiosQL" -#: install/step1.php:107 +#: install/step1.php:109 msgid "ENABLED" msgstr "AKTIVIERT" -#: install/step1.php:109 +#: install/step1.php:114 msgid "NOT ENABLED" msgstr "NICHT EINGESCHALTET" -#: install/step1.php:113 +#: install/step1.php:115 +msgid "" +"After enabling Javascript, the page must be updated twice so that the status " +"changes" +msgstr "" +"Nach dem einschalten von JavaScript muss die Seite zweimal neu geladen " +"werden sodass die Statusänderung" + +#: install/step1.php:120 msgid "Version" msgstr "Version" -#: install/step1.php:115 -#: install/step1.php:128 -#: install/step1.php:141 -#: install/step1.php:158 -#: install/step1.php:178 -#: install/step1.php:182 -#: install/step1.php:194 -#: install/step1.php:201 -#: install/step1.php:203 -#: install/step1.php:213 -#: install/step1.php:220 -#: install/step1.php:227 -#: install/step1.php:234 -#: install/step1.php:241 -#: install/step1.php:248 +#: install/step1.php:124 install/step1.php:140 install/step1.php:155 +#: install/step1.php:180 install/step1.php:208 install/step1.php:212 +#: install/step1.php:226 install/step1.php:236 install/step1.php:239 +#: install/step1.php:252 install/step1.php:261 install/step1.php:270 +#: install/step1.php:279 install/step1.php:288 install/step1.php:297 msgid "OK" msgstr "OK" -#: install/step1.php:116 -#: install/step1.php:118 +#: install/step1.php:125 install/step1.php:129 msgid "detected" msgstr "erkannt" -#: install/step1.php:119 +#: install/step1.php:130 msgid "or greater is required" msgstr "oder größer ist notwendig" -#: install/step1.php:131 -#: install/step1.php:144 -#: install/step1.php:162 +#: install/step1.php:143 install/step1.php:158 install/step1.php:187 msgid "Could be loaded. Please add in php.ini" msgstr "Kann geladen werden. Bitte zur php.ini hinzufügen" -#: install/step1.php:132 -#: install/step1.php:145 -#: install/step1.php:163 -#: install/step1.php:175 +#: install/step1.php:145 install/step1.php:160 install/step1.php:189 +#: install/step1.php:204 msgid "NOT AVAILABLE" msgstr "NICHT VERFÜGBAR" -#: install/step1.php:157 -msgid "New installation only - updates are only supported using the same database interface!" -msgstr "Nur Neuinstallation möglich - Upgrades werden nur bei gleichbleibendem Datenbankinterface unterstützt!" +#: install/step1.php:177 +msgid "" +"New installation only - updates are only supported using the same database " +"interface!" +msgstr "" +"Nur Neuinstallation möglich - Upgrades werden nur bei gleichbleibendem " +"Datenbankinterface unterstützt!" -#: install/step1.php:175 +#: install/step1.php:205 msgid "cannot be empty and needs to be set" msgstr "Kann nicht leer sein und muss gesetzt werden" -#: install/step1.php:184 +#: install/step1.php:214 msgid "should be" msgstr "Sollte auf" -#: install/step1.php:194 -#: install/step1.php:196 +#: install/step1.php:225 install/step1.php:228 msgid "Read test on settings file (config/settings.php)" msgstr "Lesezugriff auf die Konfigurationsdatei (config/settings.php)" -#: install/step1.php:198 +#: install/step1.php:231 msgid "Settings file does not exists (config/settings.php)" msgstr "Konfigurationsdatei existiert nicht (config/settings.php)" -#: install/step1.php:198 +#: install/step1.php:232 msgid "will be created" msgstr "wird später erstellt" -#: install/step1.php:201 -#: install/step1.php:205 +#: install/step1.php:235 install/step1.php:241 msgid "Write test on settings file (config/settings.php)" msgstr "Schreibzugriff auf die Konfigurationsdatei (config/settings.php)" -#: install/step1.php:203 -#: install/step1.php:208 +#: install/step1.php:238 install/step1.php:245 msgid "Write test on settings directory (config/)" msgstr "Schreibzugriff auf das Konfigurationsverzeichnis (config/)" -#: install/step1.php:213 -#: install/step1.php:215 -msgid "Read test on a class file (functions/nag_class.php)" -msgstr "Lesezugriff auf eine Klassendatei (functions/nag_class.php)" +#: install/step1.php:251 install/step1.php:254 +msgid "Read test on one class file (functions/NagVisualClass.php)" +msgstr "Lesezugriff auf eine Klassendatei (functions/NagVisualClass.php)" -#: install/step1.php:220 -#: install/step1.php:222 -msgid "Read test on startsite file (admin.php)" +#: install/step1.php:260 install/step1.php:263 +msgid "Read test on home page file (admin.php)" msgstr "Lesezugriff auf die Startseite (admin.php)" -#: install/step1.php:227 -#: install/step1.php:229 -msgid "Read test on a template file (templates/index.tpl.htm)" +#: install/step1.php:269 install/step1.php:272 +msgid "Read test on one template file (templates/index.tpl.htm)" msgstr "Lesezugriff auf eine Template Datei (templates/index.tpl.htm)" -#: install/step1.php:234 -#: install/step1.php:236 -msgid "Read test on a admin template file (templates/admin/admin_master.tpl.htm)" -msgstr "Lesezugriff auf ein Admin-Template (templates/admin/admin_master.tpl.htm)" +#: install/step1.php:278 install/step1.php:281 +msgid "Read test on one admin template file (templates/admin/datalist.htm.tpl)" +msgstr "Lesezugriff auf ein Admin-Template (templates/admin/datalist.htm.tpl)" -#: install/step1.php:241 -#: install/step1.php:243 -msgid "Read test on a file template (templates/files/contacts.tpl.dat)" +#: install/step1.php:287 install/step1.php:290 +msgid "Read test on one file template (templates/files/contacts.tpl.dat)" msgstr "Lesezugriff auf ein File-Template (templates/files/contacts.tpl.da)" -#: install/step1.php:248 -#: install/step1.php:250 -msgid "Read test on a image file (images/pixel.gif)" +#: install/step1.php:296 install/step1.php:299 +msgid "Read test on one image file (images/pixel.gif)" msgstr "Lesezugriff auf ein Bild (images/pixel.gif)" -#: install/step1.php:254 -msgid "There are some errors - please check your system settings and read the requirements of NagiosQL!" -msgstr "Es sind Fehler aufgetreten. Bitte überprüfen Sie die Einstellungen und lesen Sie die Dokumentation über die Systemanforderungen!" +#: install/step1.php:304 +msgid "" +"There are some errors - please check your system settings and read the " +"requirements of NagiosQL!" +msgstr "" +"Es sind Fehler aufgetreten. Bitte überprüfen Sie die Einstellungen und lesen " +"Sie die Dokumentation über die Systemanforderungen!" -#: install/step1.php:255 -msgid "Read the INSTALLATION file from NagiosQL to find out, how to fix them." -msgstr "Die Datei INSTALLATION enthält Informationen um die Probleme zu beheben." +#: install/step1.php:306 +msgid "" +"Read the INSTALLATION file in the NagiosQL doc directory or the installation " +"PDF file on our" +msgstr "" +"Lesen sie die INSTALLATION Datei im Nagiosql doc Verzeichnis oder die " +"Installation PDF Datei von unserer" -#: install/step1.php:256 +#: install/step1.php:310 +msgid "online documentation" +msgstr "Online Handbuch" + +#: install/step1.php:311 +msgid "site to find out, how to fix them." +msgstr "Webseite um herauszufinden, wie dies zu beheben ist." + +#: install/step1.php:312 msgid "After that - refresh this page to proceed" msgstr "Nach Änderungen aktualisieren Sie bitte diese Seite um fortzufahren" -#: install/step1.php:259 +#: install/step1.php:316 msgid "Refresh" msgstr "Aktualisieren" -#: install/step1.php:261 -msgid "Environment test sucessfully passed" -msgstr "Umgebungstest erfolgreich" +#: install/step1.php:318 +msgid "Environment test completed successfully" +msgstr "Umgebungstest erfolgreich abgeschlossen" -#: install/step1.php:264 +#: install/step1.php:323 install/step2.php:94 msgid "Next" msgstr "Weiter" -#: install/step2.php:33 +#: install/step2.php:32 msgid "The NagiosQL first passwords are not equal!" msgstr "Die NagiosQL Administrationspasswörter sind nicht gleich!" @@ -3345,356 +3878,449 @@ msgstr "Einrichtung" #: install/step2.php:39 msgid "Please complete the form below. Mandatory fields marked *" -msgstr "Bitte vervollständigen Sie das u.a. Formular. Pflichtfelder sind mit einem * markiert" +msgstr "" +"Bitte vervollständigen Sie das u.a. Formular. Pflichtfelder sind mit einem " +"* markiert" -#: install/step2.php:40 +#: install/step2.php:41 msgid "Database Configuration" msgstr "Datenbank Konfiguration" -#: install/step2.php:41 +#: install/step2.php:42 msgid "Database Type" msgstr "Datenbanktyp" -#: install/step2.php:43 +#: install/step2.php:56 msgid "Database Server" msgstr "Datenbankserver" -#: install/step2.php:45 +#: install/step2.php:58 msgid "Local hostname or IP address" msgstr "Lokaler Hostname oder IP-Adresse" -#: install/step2.php:51 +#: install/step2.php:64 msgid "Database Server Port" msgstr "Datenbankserver Port" -#: install/step2.php:55 +#: install/step2.php:68 msgid "NagiosQL DB User" msgstr "NagiosQL Datenbank Benutzer" -#: install/step2.php:57 +#: install/step2.php:70 msgid "NagiosQL DB Password" msgstr "NagiosQL Datenbank Passwort" -#: install/step2.php:59 +#: install/step2.php:72 msgid "Administrative Database User" msgstr "Administrativer Datenbankbenutzer" -#: install/step2.php:61 +#: install/step2.php:74 msgid "Administrative Database Password" msgstr "Administratives Datenbankpasswort" -#: install/step2.php:62 +#: install/step2.php:75 msgid "Drop database if already exists?" msgstr "Lösche Datenbank, sofern sie bereits existiert?" -#: install/step2.php:64 +#: install/step2.php:81 msgid "NagiosQL User Setup" msgstr "NagiosQL Benutzer Einrichtung" -#: install/step2.php:65 +#: install/step2.php:82 msgid "Initial NagiosQL User" msgstr "Erster NagiosQL Benutzer" -#: install/step2.php:67 +#: install/step2.php:84 msgid "Initial NagiosQL Password" msgstr "Erstes NagiosQL Passwort" -#: install/step2.php:69 +#: install/step2.php:86 msgid "Please repeat the password" msgstr "Bitte Passwort wiederholen" -#: install/step2.php:70 +#: install/step2.php:87 msgid "Nagios Configuration" msgstr "Nagios Konfiguration" -#: install/step2.php:71 +#: install/step2.php:88 msgid "Import Nagios sample config?" msgstr "Importiere Nagios Beispiel Konfiguration?" -#: install/step2.php:74 +#: install/step2.php:95 msgid "NagiosQL path values" msgstr "NagiosQL Verzeichnisdaten" -#: install/step2.php:75 +#: install/step2.php:96 msgid "Create NagiosQL config paths?" msgstr "Erstelle NagiosQL Verzeichnisse?" -#: install/step2.php:77 +#: install/step2.php:102 msgid "NagiosQL config path" msgstr "NagiosQL Konfigurationsverzeichnis" -#: install/step2.php:79 +#: install/step2.php:104 msgid "Nagios config path" msgstr "Nagios Konfigurationsverzeichnis" -#: install/step2.php:81 -msgid "Both path values were stored in your configuration target settings for localhost." -msgstr "Beide Verzeichnisdefinitionen werden in der Datenbank beim Konfigurationsziel \"localhost\" eingetragen." +#: install/step2.php:106 +msgid "" +"Both path values were stored in your configuration target settings for " +"localhost." +msgstr "" +"Beide Verzeichnisdefinitionen werden in der Datenbank beim " +"Konfigurationsziel \"localhost\" eingetragen." -#: install/step2.php:82 -msgid "If you select the create path option, be sure that the NagiosQL base path exist and the webserver demon has write access to it. So the installer will create the required subdirectories in your localhost's filesystem (hosts, services, backup etc.)" -msgstr "Wenn die Option \"Erstelle NagiosQL Verzeichnisse\" ausgewählt ist müssen Sie sicherstellen, dass das NagiosQL Konfigurationsverzeichnis existiert und der Webserver Schreibrechte darauf besitzt. Dann wird der Installer die benötigten Unterverzeichnisse im Dateisystem von \"localhost\" erstellen (hosts, services, backup etc.) " +#: install/step2.php:108 +msgid "" +"If you select the create path option, be sure that the NagiosQL base path " +"exist and the webserver demon has write access to it. So the installer will " +"create the required subdirectories in your localhost's filesystem (hosts, " +"services, backup etc.)" +msgstr "" +"Wenn die Option \"Erstelle NagiosQL Verzeichnisse\" ausgewählt ist müssen " +"Sie sicherstellen, dass das NagiosQL Konfigurationsverzeichnis existiert und " +"der Webserver Schreibrechte darauf besitzt. Dann wird der Installer die " +"benötigten Unterverzeichnisse im Dateisystem von \"localhost\" erstellen " +"(hosts, services, backup etc.)" -#: install/step2.php:94 +#: install/step2.php:120 msgid "Please backup your database before proceeding!" msgstr "Bitte sichern Sie Ihre Datenbank bevor Sie fortfahren!" -#: install/step3.php:40 +#: install/step3.php:42 msgid "Finishing Setup" msgstr "Fertigstellen" -#: install/step3.php:42 +#: install/step3.php:44 msgid "Deploy NagiosQL settings" msgstr "Setze NagiosQL Einstellungen" -#: install/step3.php:43 +#: install/step3.php:45 msgid "Database server connection (privileged user)" msgstr "Datenbankserver Verbindung (privilegierter Benutzer)" -#: install/step3.php:44 +#: install/step3.php:46 msgid "Database server version" msgstr "Datenbankserver Version" -#: install/step3.php:45 +#: install/step3.php:47 msgid "Database server support" msgstr "Datenbankserver Unterstützung" -#: install/step3.php:46 +#: install/step3.php:48 msgid "Delete existing NagiosQL database" msgstr "Bestehende NagiosQL 3 Datenbank löschen" -#: install/step3.php:47 +#: install/step3.php:49 msgid "Creating new database" msgstr "Erstelle neue Datenbank" -#: install/step3.php:48 -msgid "Create NagiosQL database user" -msgstr "Erstelle NagiosQL Datenbankbenutzer" - -#: install/step3.php:49 +#: install/step3.php:50 msgid "Installing NagiosQL database tables" msgstr "Installiere NagiosQL Datenbanktabellen" -#: install/step3.php:50 +#: install/step3.php:51 +msgid "Create NagiosQL database user" +msgstr "Erstelle NagiosQL Datenbankbenutzer" + +#: install/step3.php:52 msgid "Set initial NagiosQL Administrator" msgstr "Setze den NagiosQL Administrator" -#: install/step3.php:51 +#: install/step3.php:53 msgid "Database server connection (NagiosQL user)" msgstr "Datenbankserver Verbindung (NagiosQL Benutzer)" -#: install/step3.php:52 +#: install/step3.php:54 msgid "Writing global settings to database" msgstr "Schreiben der Einstellungen in die Datenbank" -#: install/step3.php:53 +#: install/step3.php:55 msgid "Writing database configuration to settings.php" msgstr "Schreibe Datenbank Konfiguration in settings.php" -#: install/step3.php:54 +#: install/step3.php:56 msgid "Import Nagios sample data" msgstr "Import Nagios Beispiel Daten" -#: install/step3.php:55 +#: install/step3.php:57 msgid "Create and/or store NagiosQL path settings" msgstr "Erstelle und/oder speichere NagiosQL Verzeichnisse" -#: install/step3.php:73 +#: install/step3.php:80 msgid "Updating existing NagiosQL database" msgstr "Aktualisiere bestehende NagiosQL Datenbank" -#: install/step3.php:80 +#: install/step3.php:113 msgid "Installed NagiosQL version" msgstr "Installierte NagiosQL Version" -#: install/step3.php:86 +#: install/step3.php:124 msgid "Upgrading from version" msgstr "Aktualisiere von Version" -#: install/step3.php:86 +#: install/step3.php:125 msgid "to" msgstr "nach" -#: install/step3.php:92 +#: install/step3.php:132 msgid "Converting database to utf8 character set" msgstr "Konvertiere Datenbank zu UTF8" -#: install/step3.php:98 +#: install/step3.php:138 msgid "Converting database tables to utf8 character set" msgstr "Konvertiere Datenbanktabellen zu UTF8" -#: install/step3.php:104 +#: install/step3.php:145 msgid "Converting database fields to utf8 character set" msgstr "Konvertiere Datenbankfelder zu UTF8" -#: install/step3.php:126 +#: install/step3.php:169 msgid "Create new NagiosQL database" msgstr "Erstelle NagiosQL MySQL Benutzer" -#: install/step3.php:133 -msgid "Database already exists and drop database was not selected, please correct or manage manually" -msgstr "Die Datenbank existiert bereits und das Löschen der Datenbank wurde nicht ausgewählt. Bitte beheben Sie das Problem" +#: install/step3.php:202 +msgid "" +"Database already exists and drop database was not selected, please correct " +"or manage manually" +msgstr "" +"Die Datenbank existiert bereits und das Löschen der Datenbank wurde nicht " +"ausgewählt. Bitte beheben Sie das Problem" -#: install/step3.php:137 -#: install/functions/install_class.php:115 -#: install/functions/install_class.php:159 -msgid "passed" -msgstr "funktioniert" - -#: install/step3.php:146 +#: install/step3.php:218 msgid "unknown" msgstr "unbekannt" -#: install/step3.php:211 +#: install/step3.php:293 msgid "Back" msgstr "Zurück" -#: install/step3.php:216 +#: install/step3.php:298 msgid "Please delete the install directory to continue!" msgstr "Bitte löschen Sie den Installationsordner bevor Sie fortfahren!" -#: install/functions/install_class.php:110 -#: install/functions/install_class.php:154 -#: install/functions/install_class.php:188 -#: install/functions/install_class.php:229 -#: install/functions/install_class.php:303 -#: install/functions/install_class.php:335 -#: install/functions/install_class.php:413 -#: install/functions/install_class.php:529 -#: install/functions/install_class.php:768 -#: install/functions/install_class.php:814 -#: install/functions/install_class.php:901 -msgid "Database type not defined!" -msgstr "Datenbanktyp nicht definiert!" +#~ msgid "Cgi config file" +#~ msgstr "CGI Konfigurationsdatei" -#: install/functions/install_class.php:195 -#: install/functions/install_class.php:265 -msgid "supported" -msgstr "unterstützt" +#~ msgid "Password too short or password fields don" +#~ msgstr "Passwort zu kurz oder Passwortfelder ungleich!" -#: install/functions/install_class.php:198 -msgid "not supported" -msgstr "nicht unterstützt" +#~ msgid "" +#~ "Cannot backup and delete the old configuration file (check the " +#~ "permissions)!" +#~ msgstr "" +#~ "Kann die alte Konfigurationsdatei nicht sichern und löschen " +#~ "(Berechtigungen prüfen)!" -#: install/functions/install_class.php:268 -msgid "Your NagiosQL installation is up to date - no further actions are needed!" -msgstr "Ihre NagiosQL Installation ist aktuell - es sind keine weiteren Schritte notwendig!" +#~ msgid "" +#~ "Cannot backup the old configuration file because the permissions are " +#~ "wrong (remote FTP)!" +#~ msgstr "" +#~ "Kann die alte Konfigurationsdatei nicht sichern aufgrund falscher " +#~ "Dateiberechtigungen (FTP Remote Dateirechte)" -#: install/functions/install_class.php:272 -#: install/functions/install_class.php:279 -msgid "Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and above!" -msgstr "Aktualisierungen nach NagiosQL 3.2 und höher sind erst ab NagiosQL Version 3.0 unterstützt!" +#~ msgid "" +#~ "Cannot backup the old configuration file because the permissions are " +#~ "wrong (remote SFTP)!" +#~ msgstr "" +#~ "Kann die alte Konfigurationsdatei nicht sichern aufgrund falscher " +#~ "Dateiberechtigungen (Entfernter Zugriff via SSH/SFTP)" -# prepend.adm -#: install/functions/install_class.php:277 -msgid "Error while selecting settings table." -msgstr "Fehler bei Abrufen der Einstellungstabelle." +#~ msgid "Cannot delete file because the permissions are wrong (remote FTP)!" +#~ msgstr "" +#~ "Datei kann aufgrund falscher Dateiberechtigungen nicht gelöscht werden " +#~ "(FTP Remote Dateirechte)" -#: install/functions/install_class.php:308 -#: install/functions/install_class.php:340 -#: install/functions/install_class.php:419 -#: install/functions/install_class.php:421 -#: install/functions/install_class.php:494 -#: install/functions/install_class.php:534 -#: install/functions/install_class.php:625 -#: install/functions/install_class.php:675 -#: install/functions/install_class.php:732 -#: install/functions/install_class.php:740 -#: install/functions/install_class.php:773 -#: install/functions/install_class.php:819 -#: install/functions/install_class.php:906 -msgid "done" -msgstr "erledigt" +#~ msgid "Cannot delete file because it does not exists (remote SFTP)!" +#~ msgstr "" +#~ "Datei kann nicht gelöscht werden, da sie nicht exisitiert (Entfernter " +#~ "Zugriff via SSH/SFTP)" -#: install/functions/install_class.php:419 -msgid "Only added rights to existing user" -msgstr "Nur Rechte zum bestehenden Benutzer hinzugefügt." +#~ msgid "Cannot delete file because the permissions are wrong (remote SFTP)!" +#~ msgstr "" +#~ "Datei kann aufgrund falscher Dateiberechtigungen nicht gelöscht werden " +#~ "(Entfernter Zugriff via SSH/SFTP)" -#: install/functions/install_class.php:483 -#: install/functions/install_class.php:488 -msgid "SQL file is not readable or empty" -msgstr "SQL Datei nicht lesbar oder leer" +#~ msgid "Cannot get the configuration file (FTP connection failed)!" +#~ msgstr "" +#~ "Kann die Konfigurationsdatei nicht abholen (FTP Verbindung " +#~ "fehlgeschlagen)!" -# mutdialog.php -#: install/functions/install_class.php:501 -msgid "No SQL update files available" -msgstr "Keine SQL Updatedateien verfügbar" +#~ msgid "Cannot write the configuration file (FTP connection failed)!" +#~ msgstr "" +#~ "Kann die Konfigurationsdatei nicht schreiben (FTP Verbindung " +#~ "fehlgeschlagen)!" -#: install/functions/install_class.php:571 -#: install/functions/install_class.php:576 -#: install/functions/install_class.php:585 -#: install/functions/install_class.php:590 -#: install/functions/install_class.php:613 -#: install/functions/install_class.php:620 -msgid "Inserting initial data to settings database has failed:" -msgstr "Das Einfügen der Vorgabewerte in die Einstellungstabelle ist fehlgeschlagen:" +#~ msgid "Cannot get the configuration file (SSH connection failed)!" +#~ msgstr "" +#~ "Kann die Konfigurationsdatei nicht abholen (SSH/SFTP Verbindung " +#~ "fehlgeschlagen)!" -#: install/functions/install_class.php:679 -msgid "Connot open/write to config/settings.php" -msgstr "Kann die Konfigurationsdatei nicht öffnen/beschreiben (config/settings.php)" +#~ msgid "Cannot write the configuration file (SSH connection failed)!" +#~ msgstr "" +#~ "Kann die Konfigurationsdatei nicht schreiben (Entfernter Zugriff via SSH/" +#~ "SFTP)!" -#: install/functions/install_class.php:713 -#: install/functions/install_class.php:720 -msgid "Inserting path data to database has failed:" -msgstr "Das Einfügen der Verzeichnisdaten in die Datenbank ist fehlgeschlagen:" +#, fuzzy +#~| msgid "" +#~| "Cannot open/overwrite the configuration file (check the permissions)!" +#~ msgid "" +#~ "Cannot open/overwrite the configuration file (check the \n" +#~ " permissions)!" +#~ msgstr "" +#~ "Kann Konfigurationsdatei nicht öffnen/überschreiben (Berechtigungen " +#~ "prüfen)!" -#: install/functions/install_class.php:732 -msgid "Check the permissions of the created paths!" -msgstr "Überprüfen Sie die Rechte der Verzeichnisse! " +#, fuzzy +#~| msgid "" +#~| "Cannot open/overwrite the configuration file (FTP connection failed)!" +#~ msgid "" +#~ "Cannot open/overwrite the configuration file (FTP connection \n" +#~ " failed)!" +#~ msgstr "" +#~ "Kann die Konfigurationsdatei nicht öffnen/überschreiben (FTP Verbindung " +#~ "fehlgeschlagen)!" -#: install/functions/install_class.php:736 -msgid "NagiosQL config path is not writeable - only database values updated" -msgstr "NagiosQL Konfigurationsverzeichnis ist nicht beschreibbar - es wurden nur die Datenbankwerte eingetragen" +#~ msgid "Delete data from table:" +#~ msgstr "Daten gelöscht aus der Tabelle:" -# prepend.adm -#: install/functions/install_class.php:776 -#: install/functions/install_class.php:822 -#: install/functions/install_class.php:909 -msgid "Database errors while converting to utf-8:" -msgstr "Datenbankfehler während dem Konvertieren nach UTF-8" +#~ msgid "The passwords are not equal!" +#~ msgstr "Passwörter sind ungleich!" + +#~ msgid "IP" +#~ msgstr "IP-Adresse" + +#, fuzzy +#~| msgid "Last file change of the configuration target " +#~ msgid "" +#~ "Last file change of the configuration \n" +#~ " target " +#~ msgstr "Letzte Dateiänderung beim Konfigurationsziel" + +#, fuzzy +#~| msgid "" +#~| "No dataset copied. Maybe the dataset does not exist or you do not have " +#~| "write permission." +#~ msgid "" +#~ "No dataset copied. Maybe the dataset does not exist or you do \".\n" +#~ " \"not have write permission." +#~ msgstr "" +#~ "Kein Datensatz kopiert. Möglicherweise existiert der Datensatz nicht, es " +#~ "wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen." + +#, fuzzy +#~| msgid "" +#~| "No dataset copied. Maybe the dataset does not exist or you do not have " +#~| "write permission." +#~ msgid "" +#~ "No dataset copied. Maybe the dataset does not exist or you do not \".\n" +#~ " \"have write permission." +#~ msgstr "" +#~ "Kein Datensatz kopiert. Möglicherweise existiert der Datensatz nicht, es " +#~ "wurde kein Datensatz ausgewählt oder die Schreibrechte fehlen." + +#~ msgid "Admin" +#~ msgstr "Administration" + +#~ msgid "" +#~ "Writing of the configuration failed - no dataset, not activated dataset " +#~ "found or you do not have write permission." +#~ msgstr "" +#~ "Das Schreiben der Konfiguration ist fehlgeschlagen - es wurde kein " +#~ "existierender bzw. kein aktiver Datensatz gefunden oder die Schreibrechte " +#~ "fehlen." + +#~ msgid "Configuration write failed (FTP connection failed):" +#~ msgstr "" +#~ "Konfigurationsdatei konnte nicht geschrieben werden (FTP Verbindung " +#~ "fehlgeschlagen)" + +#~ msgid "Missing MySQL SSL parameter!" +#~ msgstr "Fehlende SSL Parameter für die Serververbindung!" + +#~ msgid "" +#~ "Installation cannot continue, please make sure you have the mysql " +#~ "extension loaded!" +#~ msgstr "" +#~ "Die Installation kann nicht fortgesetzt werden. Bitte stellen Sie sicher, " +#~ "dass die mysql Erweiterung geladen ist!" + +#~ msgid "Installation cannot continue, postgres is not yet available in beta!" +#~ msgstr "" +#~ "Die Installation kann nicht fortgesetzt werden. Postgres ist in der " +#~ "aktuellen Version noch nicht verfügbar!" + +#~ msgid "" +#~ "Installation cannot continue, please make sure you have the pgsql " +#~ "extension loaded!" +#~ msgstr "" +#~ "Die Installation kann nicht fortgesetzt werden. Bitte stellen Sie sicher, " +#~ "dass die pgsql Erweiterung geladen ist!" + +#~ msgid "PHP Module:" +#~ msgstr "PHP Module:" #~ msgid "Polish" #~ msgstr "Polish" + #~ msgid "Japanese" #~ msgstr "Japanese" + #~ msgid "Spanish (Argentina)" #~ msgstr "Spanish (Argentina)" + #~ msgid "PHP session module" #~ msgstr "PHP session module" + #~ msgid "PHP gettext module" #~ msgstr "PHP Module:" + #~ msgid "PHP ftp module" #~ msgstr "PHP Module:" + #~ msgid "PHP ssh module" #~ msgstr "PHP Module:" + #~ msgid "Could not connect to Updateserver" #~ msgstr "Could not connect to update server" + #~ msgid "Error" #~ msgstr "Error" + #~ msgid "An error occured during the version check" #~ msgstr "An error occured during the version check" + #~ msgid "Checking for NagiosQL Updates" #~ msgstr "Checking for NagiosQL Updates" + #~ msgid "You already have the latest development version installed" #~ msgstr "You already have the latest development version installed" + #~ msgid "" #~ "Entry cannot be deactivated because it is used by another configuration" #~ msgstr "" #~ "Entry cannot be deactivated because it is used by another configuration" + #~ msgid "Automatically check for online updates (internet access required!)" #~ msgstr "Automatically check for online updates (internet access required!)" + #~ msgid "Connection to remote system failed (SSH2 connection)!" #~ msgstr "Connection to remote system failed (SSH2 connection)!" + #~ msgid "Connection to remote system failed (FTP connection)!" #~ msgstr "Connection to remote system failed (FTP connection)!" + #~ msgid "No dataset activated. Probably the dataset does not exist" #~ msgstr "No dataset activated. Probably the dataset does not exist" + #~ msgid "No dataset deactivated. Probably the dataset does not exist" #~ msgstr "No dataset deactivated. Probably the dataset does not exist" + #~ msgid "Relation information for " #~ msgstr "Relational information for " + #~ msgid "Not installed" #~ msgstr "Not installed" + #~ msgid "The following settings are optional but recommended" #~ msgstr "The following settings are optional but recommended" - diff --git a/config/locale/en_GB/LC_MESSAGES/en_GB.mo b/config/locale/en_GB/LC_MESSAGES/en_GB.mo index e7c5467..4c182a7 100644 Binary files a/config/locale/en_GB/LC_MESSAGES/en_GB.mo and b/config/locale/en_GB/LC_MESSAGES/en_GB.mo differ diff --git a/config/locale/en_GB/LC_MESSAGES/en_GB.po b/config/locale/en_GB/LC_MESSAGES/en_GB.po index 7967ad7..5fa21cb 100644 --- a/config/locale/en_GB/LC_MESSAGES/en_GB.po +++ b/config/locale/en_GB/LC_MESSAGES/en_GB.po @@ -2,3339 +2,3797 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# msgid "" msgstr "" -"Project-Id-Version: NagiosQL 3.1.x\n" +"Project-Id-Version: NagiosQL 3.4.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-09 22:50+0100\n" -"PO-Revision-Date: 2012-03-09 22:50+0100\n" +"POT-Creation-Date: 2018-05-07 15:58+0200\n" +"PO-Revision-Date: 2018-05-07 15:59+0200\n" "Last-Translator: \n" -"Language-Team: NagiosQL \n" +"Language-Team: NagiosQL\n" +"Language: en_GB\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: en_GB\n" -"Language: en_GB\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Pootle 2.1.5\n" -"X-Poedit-SourceCharset: utf-8\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" +"X-Generator: Poedit 2.0.6\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-Basepath: ../../../..\n" "X-Poedit-KeywordsList: translate\n" "X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: functions/yui\n" +"X-Poedit-SearchPathExcluded-1: functions/tinyMCE\n" +"X-Poedit-SearchPathExcluded-2: _archive\n" -#: admin.php:34 +#: admin.php:37 msgid "NagiosQL Administration" msgstr "NagiosQL Administration" -#: admin.php:37 -msgid "Welcome to NagiosQL, the administration module that can be used to easily create, modify and delete configuration files for Nagios. The data is stored in a database and can be written directly to the standard files at any time you want." -msgstr "Welcome to NagiosQL, the administration module that can be used to easily create, modify and delete configuration files for Nagios. The data is stored in a database and can be written directly to the standard files at any time you want." +#: admin.php:40 +msgid "" +"Welcome to NagiosQL, the administration module that can be used to easily " +"create, modify and delete configuration files for Nagios. The data is stored " +"in a database and can be written directly to the standard files at any time " +"you want." +msgstr "" +"Welcome to NagiosQL, the administration module that can be used to easily " +"create, modify and delete configuration files for Nagios. The data is stored " +"in a database and can be written directly to the standard files at any time " +"you want." -#: index.php:45 -msgid "Welcome to" -msgstr "Welcome to" - -#: index.php:46 -msgid "Welcome" -msgstr "Welcome" - -#: index.php:47 -msgid "Please enter your username and password to access NagiosQL.
If you forgot one of them, please contact your Administrator." -msgstr "Please enter your username and password to access NagiosQL.
If you forgot one of them, please contact your Administrator." - -#: index.php:48 -msgid "Username" -msgstr "Username" - -#: index.php:49 -msgid "Password" -msgstr "Password" - -#: index.php:50 -msgid "Login" -msgstr "Login" - -#: admin/administration.php:31 +#: admin/administration.php:35 config/fieldvars.php:298 +#: functions/prepend_adm.php:460 functions/prepend_adm.php:469 msgid "Administration" msgstr "Administration" # administration.php -#: admin/administration.php:34 +#: admin/administration.php:38 msgid "Functions to administrate NagiosQL V3" -msgstr "Functions to administer NagiosQL 3" +msgstr "Functions to administrate NagiosQL V3" -#: admin/alarming.php:31 +#: admin/alarming.php:35 config/fieldvars.php:293 config/fieldvars.php:294 msgid "Alarming" msgstr "Alerting" # alarming.php -#: admin/alarming.php:34 -msgid "To define contact data, contact templates and contact groups and time periods." -msgstr "Define contact data, contact templates, contact groups and time periods." +#: admin/alarming.php:36 +msgid "" +"To define contact data, contact templates and contact groups and time " +"periods." +msgstr "" +"To define contact data, contact templates and contact groups and time " +"periods." -#: admin/alarming.php:35 -#: admin/commands.php:35 +#: admin/alarming.php:38 admin/commands.php:38 admin/monitoring.php:40 +#: admin/specials.php:40 msgid "Statistical datas" msgstr "Statistical data" -#: admin/alarming.php:36 -#: admin/commands.php:36 +#: admin/alarming.php:39 admin/commands.php:39 admin/monitoring.php:41 +#: admin/specials.php:41 msgid "Group" msgstr "Group" -#: admin/alarming.php:37 -#: admin/commands.php:37 +#: admin/alarming.php:40 admin/commands.php:40 admin/monitoring.php:42 +#: admin/specials.php:42 config/fieldvars.php:55 msgid "Active" msgstr "Active" -#: admin/alarming.php:38 -#: admin/commands.php:38 +#: admin/alarming.php:41 admin/commands.php:41 admin/monitoring.php:43 +#: admin/specials.php:43 msgid "Inactive" msgstr "Inactive" -#: admin/alarming.php:45 +#: admin/alarming.php:52 config/fieldvars.php:303 msgid "Contact data" msgstr "Contact data" -#: admin/alarming.php:51 +#: admin/alarming.php:60 config/fieldvars.php:156 config/fieldvars.php:304 msgid "Contact groups" msgstr "Contact groups" -#: admin/alarming.php:57 +#: admin/alarming.php:68 config/fieldvars.php:301 msgid "Time periods" msgstr "Time periods" -#: admin/alarming.php:63 +#: admin/alarming.php:76 config/fieldvars.php:330 msgid "Contact templates" msgstr "Contact templates" -#: admin/cgicfg.php:61 -#: admin/cgicfg.php:81 +#: admin/cgicfg.php:65 admin/cgicfg.php:87 admin/nagioscfg.php:65 +#: admin/nagioscfg.php:87 admin/verify.php:63 admin/verify.php:85 +#: functions/NagConfigClass.php:2107 msgid "Configuration file successfully written!" msgstr "Configuration file successfully written!" -#: admin/cgicfg.php:62 -#: admin/cgicfg.php:82 +#: admin/cgicfg.php:67 admin/cgicfg.php:89 admin/nagioscfg.php:67 +#: admin/nagioscfg.php:89 functions/NagConfigClass.php:2106 msgid "Configuration successfully written:" msgstr "Configuration successfully written:" -#: admin/cgicfg.php:64 +#: admin/cgicfg.php:69 admin/nagioscfg.php:69 admin/verify.php:65 +#: admin/verify.php:87 functions/NagConfigClass.php:1993 msgid "Cannot open/overwrite the configuration file (check the permissions)!" msgstr "Cannot open/overwrite the configuration file (check the permissions)!" -#: admin/cgicfg.php:65 +#: admin/cgicfg.php:71 admin/nagioscfg.php:71 functions/NagConfigClass.php:1992 msgid "Configuration write failed:" msgstr "Configuration write failed:" -#: admin/cgicfg.php:85 -msgid "Cannot open/overwrite the configuration file (check the permissions on remote system)!" -msgstr "Cannot open/overwrite the configuration file (check the permissions on remote system)!" +#: admin/cgicfg.php:92 admin/nagioscfg.php:92 +msgid "" +"Cannot open/overwrite the configuration file (check the permissions on " +"remote system)!" +msgstr "" +"Cannot open/overwrite the configuration file (check the permissions on " +"remote system)!" -#: admin/cgicfg.php:86 +#: admin/cgicfg.php:94 admin/nagioscfg.php:94 msgid "Configuration write failed (remote):" msgstr "Configuration write failed (remote):" -#: admin/cgicfg.php:94 +#: admin/cgicfg.php:99 admin/nagioscfg.php:99 +msgid "" +"There are no nagios configuration files in common domain, please select a " +"valid domain to edit this files!" +msgstr "" +"There are no nagios configuration files in common domain, please select a " +"valid domain to edit this files!" + +#: admin/cgicfg.php:105 msgid "CGI configuration file" msgstr "CGI configuration file" -#: admin/cgicfg.php:117 +#: admin/cgicfg.php:123 admin/nagioscfg.php:123 +#: functions/NagImportClass.php:209 msgid "Cannot open the data file (check the permissions)!" msgstr "Cannot open the data file (check the permissions)!" -#: admin/cgicfg.php:132 +#: admin/cgicfg.php:139 admin/nagioscfg.php:138 msgid "Cannot open the temporary file" msgstr "Cannot open the temporary file" -#: admin/cgicfg.php:136 +#: admin/cgicfg.php:143 admin/nagioscfg.php:142 msgid "Configuration read failed (remote):" msgstr "Configuration read failed (remote):" -#: admin/checkcommands.php:53 +#: admin/checkcommands.php:62 msgid "New command inserted:" msgstr "New command inserted:" -#: admin/checkcommands.php:54 +#: admin/checkcommands.php:65 msgid "Command modified:" msgstr "Command modified:" -#: admin/checkcommands.php:57 -#: admin/configtargets.php:131 -#: admin/contactgroups.php:80 -#: admin/contacts.php:157 -#: admin/contacttemplates.php:157 -#: admin/datadomain.php:58 +#: admin/checkcommands.php:70 admin/configtargets.php:152 +#: admin/contactgroups.php:123 admin/contacts.php:237 +#: admin/contacttemplates.php:242 admin/datadomain.php:72 admin/group.php:115 +#: admin/hostdependencies.php:182 admin/hostescalations.php:182 +#: admin/hostextinfo.php:72 admin/hostgroups.php:124 admin/hosts.php:380 +#: admin/hosttemplates.php:272 admin/password.php:83 +#: admin/servicedependencies.php:290 admin/serviceescalations.php:233 +#: admin/serviceextinfo.php:81 admin/servicegroups.php:126 +#: admin/services.php:387 admin/servicetemplates.php:318 +#: admin/timeperiods.php:150 admin/user.php:82 msgid "Database entry failed! Not all necessary data filled in!" msgstr "Database entry failed! Not all necessary data supplied!" -#: admin/checkcommands.php:60 -#: admin/configtargets.php:134 -#: admin/contactgroups.php:83 -#: admin/contacts.php:160 -#: admin/contacttemplates.php:160 -#: admin/datadomain.php:61 +#: admin/checkcommands.php:75 admin/configtargets.php:157 +#: admin/contactgroups.php:128 admin/contacts.php:242 +#: admin/contacttemplates.php:247 admin/datadomain.php:77 admin/group.php:120 +#: admin/hostdependencies.php:187 admin/hostescalations.php:187 +#: admin/hostextinfo.php:77 admin/hostgroups.php:129 admin/hosts.php:385 +#: admin/hosttemplates.php:277 admin/servicedependencies.php:295 +#: admin/serviceescalations.php:238 admin/serviceextinfo.php:86 +#: admin/servicegroups.php:131 admin/services.php:392 +#: admin/servicetemplates.php:323 admin/timeperiods.php:155 admin/user.php:87 msgid "Database entry failed! No write access!" msgstr "Database entry failed! No write access!" -# checkcommand.php -#: admin/checkcommands.php:73 -msgid "Command definitions" -msgstr "Command definitions (commands.cfg)" - -#: admin/checkcommands.php:88 -#: admin/contactgroups.php:124 -#: admin/contacts.php:255 -#: admin/contacttemplates.php:247 -#: admin/datadomain.php:91 +#: admin/checkcommands.php:108 admin/contactgroups.php:199 +#: admin/contacts.php:398 admin/contacttemplates.php:398 +#: admin/datadomain.php:114 admin/hostdependencies.php:301 +#: admin/hostescalations.php:305 admin/hostextinfo.php:122 +#: admin/hostgroups.php:202 admin/hosts.php:596 admin/hosttemplates.php:466 +#: admin/servicedependencies.php:646 admin/serviceescalations.php:500 +#: admin/serviceextinfo.php:173 admin/servicegroups.php:204 +#: admin/services.php:630 admin/servicetemplates.php:551 +#: admin/timeperiods.php:225 msgid "Saving not possible!" msgstr "Saving not possible!" -#: admin/checkcommands.php:90 +# checkcommand.php +#: admin/checkcommands.php:113 admin/checkcommands.php:144 +msgid "Command definitions" +msgstr "Command definitions (commands.cfg)" + +#: admin/checkcommands.php:114 msgid "unclassified" msgstr "unclassified" -#: admin/checkcommands.php:91 +#: admin/checkcommands.php:115 msgid "check command" msgstr "check command" -#: admin/checkcommands.php:92 +#: admin/checkcommands.php:116 msgid "misc command" msgstr "misc command" -#: admin/checkcommands.php:98 -#: admin/contactgroups.php:131 -#: admin/contacts.php:269 -#: admin/contacttemplates.php:261 +#: admin/checkcommands.php:122 admin/contactgroups.php:209 +#: admin/contacts.php:419 admin/contacttemplates.php:418 +#: admin/hostdependencies.php:308 admin/hostescalations.php:312 +#: admin/hostextinfo.php:132 admin/hostgroups.php:212 admin/hosts.php:606 +#: admin/hosttemplates.php:476 admin/servicedependencies.php:679 +#: admin/serviceescalations.php:536 admin/serviceextinfo.php:199 +#: admin/servicegroups.php:214 admin/services.php:637 +#: admin/servicetemplates.php:558 admin/timeperiods.php:236 msgid "Entry cannot be activated because it is used by another configuration" msgstr "Entry cannot be activated because it is used by another configuration" -#: admin/checkcommands.php:115 +#: admin/checkcommands.php:145 msgid "Command name" msgstr "Command name" -#: admin/checkcommands.php:116 +#: admin/checkcommands.php:146 config/fieldvars.php:90 msgid "Command line" msgstr "Command line" # prepend.adm -#: admin/checkcommands.php:129 -#: admin/checkcommands.php:140 -#: admin/configtargets.php:264 -#: admin/configtargets.php:275 -#: admin/contactgroups.php:159 -#: admin/contactgroups.php:170 -#: admin/contacts.php:319 -#: admin/contacts.php:330 -#: admin/contacttemplates.php:311 -#: admin/contacttemplates.php:322 -#: admin/datadomain.php:137 -#: admin/datadomain.php:148 +#: admin/checkcommands.php:163 admin/checkcommands.php:177 +#: admin/configtargets.php:321 admin/configtargets.php:335 +#: admin/contactgroups.php:242 admin/contactgroups.php:256 +#: admin/contacts.php:477 admin/contacts.php:491 admin/contacttemplates.php:475 +#: admin/contacttemplates.php:489 admin/datadomain.php:162 +#: admin/datadomain.php:176 admin/group.php:177 admin/group.php:190 +#: admin/hostdependencies.php:352 admin/hostdependencies.php:366 +#: admin/hostescalations.php:349 admin/hostescalations.php:363 +#: admin/hostextinfo.php:167 admin/hostextinfo.php:184 admin/hostgroups.php:246 +#: admin/hostgroups.php:260 admin/hosts.php:690 admin/hosts.php:704 +#: admin/hosttemplates.php:558 admin/hosttemplates.php:572 admin/logbook.php:50 +#: admin/logbook.php:77 admin/menuaccess.php:69 admin/password.php:45 +#: admin/password.php:66 admin/servicedependencies.php:723 +#: admin/servicedependencies.php:737 admin/serviceescalations.php:574 +#: admin/serviceescalations.php:588 admin/serviceextinfo.php:235 +#: admin/serviceextinfo.php:253 admin/servicegroups.php:248 +#: admin/servicegroups.php:262 admin/services.php:713 admin/services.php:746 +#: admin/services.php:761 admin/servicetemplates.php:642 +#: admin/servicetemplates.php:656 admin/settings.php:241 +#: admin/timeperiods.php:271 admin/timeperiods.php:285 admin/user.php:188 +#: admin/user.php:201 functions/NagConfigClass.php:1352 +#: functions/NagDataClass.php:191 functions/NagVisualClass.php:841 +#: functions/prepend_adm.php:111 functions/prepend_adm.php:322 +#: functions/prepend_adm.php:381 functions/prepend_adm.php:495 +#: functions/prepend_adm.php:527 functions/prepend_content.php:495 msgid "Error while selecting data from database:" msgstr "Error while selecting data from database:" -#: admin/commands.php:31 -#: admin/commands.php:45 +#: admin/commands.php:35 admin/commands.php:49 msgid "Check commands" -msgstr "Definitions" +msgstr "Check commands" # commands.php -#: admin/commands.php:34 -msgid "To define check and misc commands, notification commands and special commands." -msgstr "To define check and misc commands, notification commands and special commands." +#: admin/commands.php:36 +msgid "" +"To define check and misc commands, notification commands and special " +"commands." +msgstr "" +"To define check and misc commands, notification commands and special " +"commands." # mutdialog.php -#: admin/configtargets.php:56 -#: admin/configtargets.php:62 -#: admin/configtargets.php:82 +#: admin/configtargets.php:60 admin/configtargets.php:67 +#: admin/configtargets.php:89 admin/configtargets.php:94 msgid "is not writeable" msgstr "is not writeable" -#: admin/configtargets.php:62 -#: admin/configtargets.php:77 +#: admin/configtargets.php:66 admin/configtargets.php:82 admin/support.php:287 +#: config/fieldvars.php:46 msgid "Nagios config file" msgstr "Nagios config file" -#: admin/configtargets.php:77 +#: admin/configtargets.php:83 msgid "is not a valid configuration file!" msgstr "is not a valid configuration file!" -#: admin/configtargets.php:82 -msgid "Cgi config file" -msgstr "Cgi config file" +#: admin/configtargets.php:88 config/fieldvars.php:226 +msgid "Nagios base directory" +msgstr "Nagios base directory" -#: admin/configtargets.php:89 +#: admin/configtargets.php:93 +msgid "Nagios cgi config file" +msgstr "Nagios cgi config file" + +#: admin/configtargets.php:98 +msgid "Nagios resource config file" +msgstr "Nagios resource config file" + +# mutdialog.php +#: admin/configtargets.php:99 +msgid "is not readable" +msgstr "is not readable" + +#: admin/configtargets.php:105 functions/NagConfigClass.php:363 +#: functions/NagConfigClass.php:2083 msgid "SSH module not loaded!" msgstr "SSH module not loaded!" -#: admin/configtargets.php:94 +#: admin/configtargets.php:110 functions/NagConfigClass.php:2061 msgid "FTP module not loaded!" msgstr "FTP module not loaded!" # domain.php -#: admin/configtargets.php:127 -#: admin/datadomain.php:54 +#: admin/configtargets.php:144 admin/datadomain.php:64 msgid "New Domain inserted:" msgstr "New Domain inserted:" -#: admin/configtargets.php:128 -#: admin/datadomain.php:55 +#: admin/configtargets.php:147 admin/datadomain.php:67 msgid "Domain modified:" msgstr "Domain modified:" -#: admin/configtargets.php:142 +#: admin/configtargets.php:180 admin/configtargets.php:309 msgid "Configuration domain administration" msgstr "Configuration domain administration" -#: admin/configtargets.php:143 +#: admin/configtargets.php:182 msgid "Warning, at least one error occured, please check!" msgstr "Warning, at least one error occurred. Please check!" -#: admin/configtargets.php:158 -#: admin/datadomain.php:92 +#: admin/configtargets.php:188 admin/datadomain.php:117 admin/group.php:149 +#: admin/password.php:99 admin/user.php:130 config/fieldvars.php:204 +#: install/step2.php:33 msgid "Please fill in all fields marked with an *" -msgstr "Please complete all fields marked with a *" +msgstr "Please fill in all fields marked with an *" -#: admin/configtargets.php:159 -#: admin/datadomain.php:93 -msgid "The following field contains not permitted characters:" +#: admin/configtargets.php:189 admin/datadomain.php:118 admin/group.php:150 +#: admin/user.php:131 config/fieldvars.php:206 +msgid "The following field contains illegal characters:" msgstr "The following field contains illegal characters:" -#: admin/configtargets.php:255 +#: admin/configtargets.php:310 config/fieldvars.php:265 msgid "Configuration target" msgstr "Configuration target" -#: admin/configtargets.php:256 -#: admin/contactgroups.php:146 -#: admin/contacts.php:301 -#: admin/contacttemplates.php:293 -#: admin/datadomain.php:129 +#: admin/configtargets.php:311 admin/contactgroups.php:226 +#: admin/contacts.php:456 admin/contacttemplates.php:455 +#: admin/datadomain.php:152 admin/group.php:167 admin/hostgroups.php:229 +#: admin/hosts.php:673 admin/hosttemplates.php:542 admin/servicegroups.php:231 +#: admin/timeperiods.php:254 admin/user.php:178 config/fieldvars.php:21 msgid "Description" msgstr "Description" -#: admin/contactgroups.php:53 +#: admin/contactgroups.php:62 msgid "New contact group inserted:" msgstr "New contact group inserted:" -#: admin/contactgroups.php:54 +#: admin/contactgroups.php:65 msgid "Contact group modified:" msgstr "Contact group modified:" -#: admin/contactgroups.php:96 +#: admin/contactgroups.php:146 admin/contactgroups.php:224 msgid "Define contact groups (contactgroups.cfg)" msgstr "Define contact groups (contactgroups.cfg)" -#: admin/contactgroups.php:111 +#: admin/contactgroups.php:165 msgid "Attention, no contacts defined!" msgstr "Attention, no contacts defined!" -#: admin/contactgroups.php:145 +#: admin/contactgroups.php:225 config/fieldvars.php:102 msgid "Contact group" msgstr "Contact group" # contacts.php -#: admin/contacts.php:70 +#: admin/contacts.php:84 msgid "New contact inserted:" msgstr "New contact inserted:" -#: admin/contacts.php:71 +#: admin/contacts.php:87 msgid "Contact modified:" msgstr "Contact modified:" -#: admin/contacts.php:173 +#: admin/contacts.php:260 admin/contacts.php:454 msgid "Define contacts (contacts.cfg)" msgstr "Define contacts (contacts.cfg)" -#: admin/contacts.php:230 +#: admin/contacts.php:329 admin/hosts.php:515 admin/services.php:566 msgid "Attention, no time periods defined!" msgstr "Attention, no time periods defined!" -#: admin/contacts.php:241 +#: admin/contacts.php:364 msgid "Attention, no commands defined!" msgstr "Attention, no commands defined!" -#: admin/contacts.php:300 -#: admin/contacttemplates.php:292 +#: admin/contacts.php:455 admin/contacttemplates.php:454 +#: config/fieldvars.php:101 msgid "Contact name" msgstr "Contact name" # hosttemplates.php -#: admin/contacttemplates.php:70 +#: admin/contacttemplates.php:84 msgid "New contact template inserted:" msgstr "New contact template inserted:" -#: admin/contacttemplates.php:71 +#: admin/contacttemplates.php:87 msgid "Contact template modified:" msgstr "Contact template modified:" -#: admin/contacttemplates.php:173 +#: admin/contacttemplates.php:265 admin/contacttemplates.php:453 msgid "Define contact templates (contacttemplates.cfg)" msgstr "Define contact templates (contacttemplates.cfg)" -#: admin/datadomain.php:69 -msgid "Data domain administration" -msgstr "Data domain administration" - -#: admin/datadomain.php:82 +#: admin/datadomain.php:98 msgid "Attention, no configuration targets defined!" msgstr "Attention, no configuration targets defined!" -#: admin/datadomain.php:94 +#: admin/datadomain.php:116 admin/datadomain.php:150 +msgid "Data domain administration" +msgstr "Data domain administration" + +#: admin/datadomain.php:119 admin/settings.php:280 msgid "Enable" msgstr "Enable" # mutdialog.php -#: admin/datadomain.php:95 +#: admin/datadomain.php:120 admin/settings.php:281 msgid "Disable" msgstr "Disable" # fieldvars.php -#: admin/datadomain.php:128 +#: admin/datadomain.php:151 msgid "Data domain" msgstr "Data domain" -#: admin/delbackup.php:50 -#: admin/delconfig.php:50 +#: admin/delbackup.php:55 admin/delconfig.php:55 msgid "File deleted" msgstr "File deleted" -#: admin/delbackup.php:51 -#: admin/delconfig.php:51 +#: admin/delbackup.php:56 admin/delconfig.php:56 msgid "successfully deleted" msgstr "successfully deleted" -#: admin/delbackup.php:60 +#: admin/delbackup.php:65 config/fieldvars.php:316 msgid "Delete backup files" msgstr "Delete backup files" -#: admin/delbackup.php:63 -#: admin/delconfig.php:63 +#: admin/delbackup.php:68 admin/delconfig.php:68 admin/import.php:94 msgid "Filter string" msgstr "Filter string" -#: admin/delbackup.php:64 -#: admin/delconfig.php:64 +#: admin/delbackup.php:69 admin/delconfig.php:69 admin/import.php:95 +#: config/fieldvars.php:84 msgid "Search" msgstr "Search" -#: admin/delbackup.php:65 -#: admin/delbackup.php:70 -#: admin/delconfig.php:65 -#: admin/delconfig.php:70 +#: admin/delbackup.php:70 admin/delbackup.php:75 admin/delconfig.php:70 +#: admin/delconfig.php:75 admin/groupusers.php:166 admin/import.php:96 +#: admin/templatedefinitions.php:268 admin/timedefinitions.php:180 +#: admin/variabledefinitions.php:147 config/fieldvars.php:76 +#: config/fieldvars.php:183 msgid "Delete" msgstr "Delete" -#: admin/delbackup.php:66 -#: admin/delconfig.php:66 +#: admin/delbackup.php:71 admin/delconfig.php:71 admin/import.php:97 +#: config/fieldvars.php:85 msgid "Reset filter" msgstr "Reset filter" -#: admin/delbackup.php:68 +#: admin/delbackup.php:73 msgid "Backup file" msgstr "Backup file" -#: admin/delbackup.php:69 -#: admin/delconfig.php:69 +#: admin/delbackup.php:74 admin/delconfig.php:74 admin/settings.php:312 +#: config/fieldvars.php:57 msgid "required" msgstr "required" -#: admin/delbackup.php:71 -#: admin/delconfig.php:71 +#: admin/delbackup.php:76 admin/delconfig.php:76 admin/import.php:104 +#: admin/password.php:98 admin/settings.php:311 config/fieldvars.php:59 msgid "Abort" msgstr "Abort" -#: admin/delbackup.php:72 -#: admin/delconfig.php:72 +#: admin/delbackup.php:77 admin/delconfig.php:77 config/fieldvars.php:282 msgid "Hold CTRL to select
more than one entry" msgstr "Hold down CTRL to select
more than one entry" -#: admin/delbackup.php:106 -#: admin/delbackup.php:131 +#: admin/delbackup.php:120 admin/delbackup.php:156 msgid "No backup files or no permission to read the backup files" msgstr "No backup files or no permission to read the backup files" -#: admin/delconfig.php:60 +#: admin/delconfig.php:65 config/fieldvars.php:315 msgid "Delete config files" msgstr "Delete config files" -#: admin/delconfig.php:68 +#: admin/delconfig.php:73 msgid "Configuration file" msgstr "Configuration file" -#: admin/download.php:67 +#: admin/download.php:61 config/fieldvars.php:87 msgid "Download" msgstr "Download" -#: admin/group.php:53 +#: admin/group.php:63 msgid "A new group added:" msgstr "A new group added:" -#: admin/group.php:54 +#: admin/group.php:66 admin/user.php:77 msgid "User modified:" msgstr "User modified:" -#: admin/group.php:94 +#: admin/group.php:144 admin/group.php:165 msgid "Group administration" msgstr "Group administration" -#: admin/group.php:114 +#: admin/group.php:145 msgid "Read" msgstr "Read" -#: admin/group.php:115 +#: admin/group.php:146 admin/verify.php:97 admin/verify.php:101 +#: admin/verify.php:112 admin/verify.php:116 admin/verify.php:127 +#: admin/verify.php:131 admin/verify.php:142 admin/verify.php:146 +#: admin/verify.php:161 admin/verify.php:170 admin/verify.php:179 +#: admin/verify.php:188 admin/verify.php:197 admin/verify.php:201 +#: admin/verify.php:212 admin/verify.php:216 admin/verify.php:227 +#: admin/verify.php:231 admin/verify.php:242 admin/verify.php:246 +#: admin/verify.php:257 admin/verify.php:261 admin/verify.php:272 +#: admin/verify.php:276 admin/verify.php:287 admin/verify.php:291 msgid "Write" msgstr "Write" -#: admin/group.php:116 +#: admin/group.php:147 msgid "Link" msgstr "Link" -#: admin/group.php:134 +#: admin/group.php:166 msgid "Groupname" msgstr "Groupname" -#: admin/groupusers.php:150 +#: admin/groupusers.php:175 admin/templatedefinitions.php:277 +#: admin/timedefinitions.php:189 admin/variabledefinitions.php:156 +#: functions/NagContentClass.php:136 msgid "No data" msgstr "No data" -#: admin/helpedit.php:65 +#: admin/helpedit.php:83 msgid "Help text editor" msgstr "Help text editor" -#: admin/helpedit.php:76 +#: admin/helpedit.php:89 msgid "Main key" msgstr "Main key" -#: admin/helpedit.php:77 +#: admin/helpedit.php:90 msgid "Sub key" msgstr "Sub key" -#: admin/helpedit.php:78 +#: admin/helpedit.php:91 admin/settings.php:226 admin/settings.php:227 +#: install/index.php:71 msgid "Language" msgstr "Language" -#: admin/helpedit.php:79 +#: admin/helpedit.php:92 config/fieldvars.php:49 msgid "Nagios version" msgstr "Nagios version" -#: admin/helpedit.php:80 +#: admin/helpedit.php:93 msgid "Load default text" msgstr "Load default text" # hosttemplates.php -#: admin/hostdependencies.php:61 +#: admin/hostdependencies.php:70 msgid "New host dependency inserted:" msgstr "New host dependency inserted:" -#: admin/hostdependencies.php:62 +#: admin/hostdependencies.php:73 msgid "Host dependency modified:" msgstr "Host dependency modified:" -#: admin/hostdependencies.php:125 +#: admin/hostdependencies.php:205 admin/hostdependencies.php:332 msgid "Define host dependencies (hostdependencies.cfg)" msgstr "Define host dependencies (hostdependencies.cfg)" -#: admin/hostdependencies.php:153 -#: admin/hostescalations.php:141 +#: admin/hostdependencies.php:285 admin/hostescalations.php:242 +#: admin/servicedependencies.php:533 admin/serviceescalations.php:369 msgid "Attention, no hosts and hostgroups defined!" -msgstr "Attention, no hosts or hostgroups defined!" +msgstr "Attention, no hosts and hostgroups defined!" -#: admin/hostdependencies.php:189 -#: admin/hostescalations.php:188 +#: admin/hostdependencies.php:333 admin/hostescalations.php:331 +#: admin/servicedependencies.php:705 admin/serviceescalations.php:556 +#: admin/services.php:705 config/fieldvars.php:217 msgid "Config name" msgstr "Config name" -#: admin/hostdependencies.php:190 +#: admin/hostdependencies.php:334 config/fieldvars.php:234 msgid "Dependent hosts" msgstr "Dependent hosts" -#: admin/hostdependencies.php:190 +#: admin/hostdependencies.php:334 config/fieldvars.php:235 msgid "Dependent hostgroups" msgstr "Dependent hostgroups" # hosttemplates.php -#: admin/hostescalations.php:60 +#: admin/hostescalations.php:70 msgid "New host escalation inserted:" msgstr "New host escalation inserted:" -#: admin/hostescalations.php:61 +#: admin/hostescalations.php:73 msgid "Host escalation modified:" msgstr "Host escalation modified:" -#: admin/hostescalations.php:124 +#: admin/hostescalations.php:205 admin/hostescalations.php:330 msgid "Define host escalation (hostescalations.cfg)" msgstr "Define host escalation (hostescalations.cfg)" -#: admin/hostescalations.php:156 +#: admin/hostescalations.php:289 admin/serviceescalations.php:433 msgid "Attention, no contacts and contactgroups defined!" -msgstr "Attention, no contacts or contactgroups defined!" +msgstr "Attention, no contacts and contactgroups defined!" -#: admin/hostescalations.php:189 -#: admin/monitoring.php:46 +#: admin/hostescalations.php:332 admin/monitoring.php:56 +#: config/fieldvars.php:211 config/fieldvars.php:300 msgid "Hosts" msgstr "Hosts" -#: admin/hostescalations.php:189 -#: admin/monitoring.php:58 +#: admin/hostescalations.php:332 admin/monitoring.php:72 +#: config/fieldvars.php:127 config/fieldvars.php:306 msgid "Host groups" msgstr "Host groups" # hosttemplates.php -#: admin/hostextinfo.php:55 +#: admin/hostextinfo.php:64 msgid "New host extended information inserted:" msgstr "New host extended information inserted:" -#: admin/hostextinfo.php:56 +#: admin/hostextinfo.php:67 msgid "Host extended information modified:" msgstr "Host extended information modified:" -#: admin/hostextinfo.php:75 +#: admin/hostextinfo.php:95 admin/hostextinfo.php:147 msgid "Define host extended information (hostextinfo.cfg)" msgstr "Define host extended information (hostextinfo.cfg)" -#: admin/hostextinfo.php:88 -#: admin/hostgroups.php:111 +#: admin/hostextinfo.php:106 admin/hostgroups.php:168 +#: admin/serviceextinfo.php:141 msgid "Attention, no hosts defined!" msgstr "Attention, no hosts defined!" -#: admin/hostextinfo.php:118 -#: admin/hosts.php:454 +#: admin/hostextinfo.php:148 admin/hosts.php:672 config/fieldvars.php:202 msgid "Host name" msgstr "Host name" -#: admin/hostextinfo.php:119 +#: admin/hostextinfo.php:149 config/fieldvars.php:166 msgid "Notes" msgstr "Notes" -#: admin/hostgroups.php:54 +#: admin/hostgroups.php:63 msgid "New host group inserted:" msgstr "New host group inserted:" -#: admin/hostgroups.php:55 +#: admin/hostgroups.php:66 msgid "Host group modified:" msgstr "Host group modified:" -#: admin/hostgroups.php:97 +#: admin/hostgroups.php:147 admin/hostgroups.php:227 msgid "Define host groups (hostgroups.cfg)" msgstr "Define host groups (hostgroups.cfg)" -#: admin/hostgroups.php:145 +#: admin/hostgroups.php:228 msgid "Host group" msgstr "Host group" # contacts.php -#: admin/hosts.php:77 +#: admin/hosts.php:95 msgid "New host inserted:" msgstr "New host inserted:" -#: admin/hosts.php:78 +#: admin/hosts.php:98 msgid "Host modified:" msgstr "Host modified:" -#: admin/hosts.php:129 -#: admin/hosts.php:152 -msgid "The assigned, no longer used configuration files were deleted successfully!" -msgstr "The associated, now obsolete, configuration files were deleted successfully!" +#: admin/hosts.php:192 admin/hosts.php:218 admin/services.php:249 +#: admin/services.php:279 functions/NagDataClass.php:556 +#: functions/NagDataClass.php:583 functions/prepend_content.php:415 +#: functions/prepend_content.php:475 +msgid "" +"The assigned, no longer used configuration files were deleted successfully!" +msgstr "" +"The associated, now obsolete, configuration files were deleted successfully!" -#: admin/hosts.php:130 -#: admin/hosts.php:153 +#: admin/hosts.php:194 admin/hosts.php:220 functions/NagDataClass.php:558 +#: functions/NagDataClass.php:586 functions/prepend_content.php:401 msgid "Host file deleted:" msgstr "Host file deleted:" -#: admin/hosts.php:133 -#: admin/hosts.php:156 -msgid "Common files cannot be removed from target systems - please check manually" -msgstr "Common files cannot be removed from target systems - please check manually" +#: admin/hosts.php:197 admin/hosts.php:223 admin/services.php:254 +#: functions/prepend_content.php:424 functions/prepend_content.php:484 +msgid "" +"Common files cannot be removed from target systems - please check manually" +msgstr "" +"Common files cannot be removed from target systems - please check manually" -#: admin/hosts.php:135 -#: admin/hosts.php:158 +#: admin/hosts.php:200 admin/hosts.php:226 admin/services.php:257 +#: admin/services.php:283 functions/NagDataClass.php:560 +#: functions/NagDataClass.php:588 functions/prepend_content.php:419 +#: functions/prepend_content.php:479 msgid "Errors while deleting the old configuration file - please check!:" msgstr "Error while deleting the old configuration file - please check!:" -#: admin/hosts.php:283 +#: admin/hosts.php:396 admin/hosts.php:671 msgid "Define hosts (hosts.cfg)" msgstr "Define hosts (hosts.cfg)" -#: admin/hosts.php:371 +#: admin/hosts.php:562 msgid "Attention, no contact groups defined!" -msgstr "Attention, no contact data defined!" +msgstr "Attention, no contact groups defined!" # hosttemplates.php -#: admin/hosttemplates.php:76 +#: admin/hosttemplates.php:96 msgid "New host template inserted:" msgstr "New host template inserted:" -#: admin/hosttemplates.php:77 +#: admin/hosttemplates.php:99 msgid "Host template modified:" msgstr "Host template modified:" -#: admin/hosttemplates.php:187 +#: admin/hosttemplates.php:295 admin/hosttemplates.php:540 msgid "Host template definition (hosttemplates.cfg)" msgstr "Host template definition (hosttemplates.cfg)" -#: admin/hosttemplates.php:345 +#: admin/hosttemplates.php:541 msgid "Host template name" msgstr "Host template name" -#: admin/import.php:51 +#: admin/import.php:55 msgid "File upload error:" msgstr "File upload error:" -#: admin/import.php:61 -#: admin/import.php:75 -msgid "File imported - File [overwite flag]:" +#: admin/import.php:67 admin/import.php:83 +msgid "File imported - File [overwrite flag]:" msgstr "File imported - File [overwrite flag]:" -#: admin/import.php:82 +#: admin/import.php:91 msgid "Configuration import" msgstr "Configuration import" -#: admin/import.php:90 +#: admin/import.php:99 msgid "Template definition" msgstr "Template definition" -#: admin/import.php:91 +#: admin/import.php:100 msgid "Import file" msgstr "Import file" -#: admin/import.php:92 +#: admin/import.php:101 msgid "Local import file" msgstr "Local import file" -#: admin/import.php:93 +#: admin/import.php:102 msgid "Overwrite database" msgstr "Overwrite database" -#: admin/import.php:94 +#: admin/import.php:103 msgid "Import" msgstr "Import" -#: admin/import.php:96 +#: admin/import.php:105 msgid "Hold CTRL to select
more than one" msgstr "Hold down CTRL to select
more than one" -#: admin/import.php:100 -msgid "To prevent errors or misconfigurations, you should import your configurations in an useful order. We recommend to do it like this:

commands -> timeperiods -> contacttemplates -> contacts -> contactgroups -> hosttemplates -> hosts -> hostgroups -> servicetemplates -> services -> servicegroups

" -msgstr "To prevent errors or misconfigurations, you should import your configurations in an useful order. We recommend to do it like this:

commands -> timeperiods -> contacttemplates -> contacts -> contactgroups -> hosttemplates -> hosts -> hostgroups -> servicetemplates -> services -> servicegroups

" +#: admin/import.php:109 +msgid "" +"To prevent errors or misconfigurations, you should import your " +"configurations in an useful order. We recommend to do it like this:" +"

commands -> timeperiods -> contacttemplates -> contacts -> " +"contactgroups -> hosttemplates -> hosts -> hostgroups -> servicetemplates -> " +"services -> servicegroups

" +msgstr "" +"To prevent errors or misconfigurations, you should import your " +"configurations in an useful order. We recommend to do it like this:" +"

commands -> timeperiods -> contacttemplates -> contacts -> " +"contactgroups -> hosttemplates -> hosts -> hostgroups -> servicetemplates -> " +"services -> servicegroups

" -#: admin/import.php:101 -msgid "Check your configuration after import!
In cause of an error or an uncomplete configuration, re-importing the wrong configuration can solve the problem." -msgstr "Check your configuration after import!
In cause of an error or an uncomplete configuration, re-importing the wrong configuration can solve the problem." - -#: admin/info.php:39 -msgid "This is relative path of your NagiosQL Installation" -msgstr "This is the relative path of your NagiosQL Installation." - -#: admin/info.php:40 -msgid "This is the absolut path to your NagiosQL Installation" -msgstr "This is the absolute path to your NagiosQL Installation." - -#: admin/info.php:41 -msgid "If you need a secure connection, select HTTPS instead of HTTP" -msgstr "If you need a secure connection, select HTTPS instead of HTTP." - -#: admin/info.php:42 -msgid "Please choose a temporary directory with write permissions. The default is the temp directory provided by your OS" -msgstr "Please choose a temporary directory with write permissions. The default is the temp directory provided by your OS." +#: admin/import.php:113 +msgid "" +"Check your configuration after import!
In cause of an error or an " +"uncomplete configuration, re-importing the wrong configuration can solve the " +"problem." +msgstr "" +"Check your configuration after import!
In cause of an error or an " +"uncomplete configuration, re-importing the wrong configuration can solve the " +"problem." #: admin/info.php:43 -msgid "Please choose your application language" -msgstr "Please choose your application language." +msgid "This is relative path of your NagiosQL Installation" +msgstr "This is relative path of your NagiosQL Installation" #: admin/info.php:44 -msgid "Encoding should be set to nothing else than utf-8. Any changes at your own risk" -msgstr "Encoding should only be set to utf-8. Make any changes at your own risk." +msgid "This is the absolut path to your NagiosQL Installation" +msgstr "This is the absolut path to your NagiosQL Installation" #: admin/info.php:45 +msgid "If you need a secure connection, select HTTPS instead of HTTP" +msgstr "If you need a secure connection, select HTTPS instead of HTTP" + +#: admin/info.php:46 +msgid "" +"Please choose a temporary directory with write permissions. The default is " +"the temp directory provided by your OS" +msgstr "" +"Please choose a temporary directory with write permissions. The default is " +"the temp directory provided by your OS" + +#: admin/info.php:48 +msgid "Please choose your application language for new users and login portal" +msgstr "Please choose your application language for new users and login portal" + +#: admin/info.php:49 +msgid "" +"Encoding should be set to nothing else than utf-8. Any changes at your own " +"risk" +msgstr "" +"Encoding should be set to nothing else than utf-8. Any changes at your own " +"risk" + +#: admin/info.php:50 msgid "IP-Address or hostname of the database server
e.g. localhost" msgstr "IP-Address or hostname of the database server
e.g. localhost" -#: admin/info.php:46 +#: admin/info.php:51 msgid "MySQL Server Port, default is 3306" msgstr "MySQL Server Port, default is 3306" -#: admin/info.php:47 +#: admin/info.php:52 msgid "Name of the NagiosQL database
e.g. db_nagiosql_v3" msgstr "Name of the NagiosQL database
e.g. db_nagiosql_v3" -#: admin/info.php:48 -msgid "User with sufficient permission for the NagiosQL database
At least this user should have SELECT, INSERT, UPDATE, DELETE permissions" -msgstr "User with sufficient permission for the NagiosQL database
At least this user should have SELECT, INSERT, UPDATE, DELETE permissions" +#: admin/info.php:53 +msgid "" +"User with sufficient permission for the NagiosQL database
At least this " +"user should have SELECT, INSERT, UPDATE, DELETE permissions" +msgstr "" +"User with sufficient permission for the NagiosQL database
At least this " +"user should have SELECT, INSERT, UPDATE, DELETE permissions" -#: admin/info.php:49 +#: admin/info.php:55 msgid "Password for the above mentioned user" msgstr "Password for the above mentioned user" -#: admin/info.php:50 -msgid "After the defined amount of seconds the session will terminate for security reasons" -msgstr "After the specified number of seconds the session will terminate for security reasons." +#: admin/info.php:56 +msgid "" +"After the defined amount of seconds the session will terminate for security " +"reasons" +msgstr "" +"After the defined amount of seconds the session will terminate for security " +"reasons" -#: admin/info.php:51 -msgid "Decide between authentication based on your Webserver
e.g. Apache configuration (config file or htaccess) or NagiosQL" -msgstr "Decide between authentication based on your Webserver
e.g. Apache configuration (config file or htaccess) or NagiosQL" +#: admin/info.php:58 +msgid "" +"Decide between authentication based on your Webserver
e.g. Apache " +"configuration (config file or htaccess) or NagiosQL" +msgstr "" +"Decide between authentication based on your Webserver
e.g. Apache " +"configuration (config file or htaccess) or NagiosQL" -#: admin/info.php:52 -msgid "How many entries per side should be visibile (e.g. services or hosts)" -msgstr "Number of entries per side that should be visible (e.g. services or hosts)" +#: admin/info.php:60 +msgid "" +"Number of entries per side that should be visible (e.g. services or hosts)" +msgstr "" +"Number of entries per side that should be visible (e.g. services or hosts)" -#: admin/info.php:53 -msgid "Selection of multiple entries by using the new dialog or by holding CTRL + left click like in NagiosQL2" -msgstr "Method of selection of multiple entries by using the new dialog or by holding CTRL + left mouse button, as in NagiosQL 2" +#: admin/info.php:61 +msgid "" +"Method of selection of multiple entries by using the new dialog or by " +"holding CTRL + left mouse button, as in NagiosQL 2" +msgstr "" +"Method of selection of multiple entries by using the new dialog or by " +"holding CTRL + left mouse button, as in NagiosQL 2" -#: admin/info.php:54 -msgid "Enable or disable the warning if a required field contains no data in objects with templates" -msgstr "Enable or disable the warning if a required field contains no data in objects with templates" +#: admin/info.php:63 +msgid "" +"Enable or disable the warning if a required field contains no data in " +"objects with templates" +msgstr "" +"Enable or disable the warning if a required field contains no data in " +"objects with templates" -#: admin/info.php:55 +#: admin/info.php:65 msgid "Enable or disable the automatic online version check." msgstr "Enable or disable the automatic online version check." -#: admin/info.php:56 -msgid "If you require a Proxyserver to connect to the Internet (Port 80), please define one." -msgstr "If you require a Proxyserver to connect to the Internet (Port 80), please define one." +#: admin/info.php:66 +msgid "" +"If you require a Proxyserver to connect to the Internet (Port 80), please " +"define one." +msgstr "" +"If you require a Proxyserver to connect to the Internet (Port 80), please " +"define one." -#: admin/info.php:57 +#: admin/info.php:68 msgid "Address of your Proxyserver e.g. proxy.yourdomain.com:3128" msgstr "Address of your Proxyserver e.g. proxy.yourdomain.com:3128" -#: admin/info.php:58 +#: admin/info.php:69 msgid "Username to connect through your proxy (optional)" msgstr "Username to connect through your proxy (optional)" -#: admin/info.php:59 +#: admin/info.php:70 msgid "Password to connect through your proxy (optional)" msgstr "Password to connect through your proxy (optional)" -#: admin/info.php:78 +#: admin/info.php:92 msgid "Information PopUp" msgstr "Information PopUp" # mutdialog.php -#: admin/info.php:91 +#: admin/info.php:105 msgid "No information available" msgstr "No information available" -#: admin/logbook.php:48 +#: admin/logbook.php:53 functions/NagDataClass.php:401 +#: functions/NagDataClass.php:436 functions/NagDataClass.php:611 msgid "Dataset successfully deleted. Affected rows:" -msgstr "Data successfully deleted. Affected rows:" +msgstr "Dataset successfully deleted. Affected rows:" # logbook.php -#: admin/logbook.php:74 +#: admin/logbook.php:83 msgid "View logbook" msgstr "View logbook" -#: admin/logbook.php:78 +#: admin/logbook.php:87 msgid "Delete logentries between:" msgstr "Delete log entries between:" -#: admin/logbook.php:80 -msgid "Please at least fill in a start or a stop time" +#: admin/logbook.php:89 +msgid "Please supply a start or a stop time at least" msgstr "Please supply a start or a stop time at least" -#: admin/logbook.php:81 -msgid "Do you really want to delete all log entries between the selected dates?" -msgstr "Do you really want to delete all log entries between the selected dates?" +#: admin/logbook.php:90 +msgid "" +"Do you really want to delete all log entries between the selected dates?" +msgstr "" +"Do you really want to delete all log entries between the selected dates?" -#: admin/logbook.php:86 +#: admin/logbook.php:97 msgid "previous 20 entries" msgstr "previous 20 entries" -#: admin/logbook.php:92 +#: admin/logbook.php:104 msgid "next 20 entries" msgstr "next 20 entries" -#: admin/menuaccess.php:40 -msgid "Error while inserting the data to the data base:" +#: admin/menuaccess.php:44 functions/NagDataClass.php:137 +#: functions/NagDataClass.php:290 +msgid "Error while inserting the data into the database:" msgstr "Error while inserting the data into the database:" -#: admin/menuaccess.php:43 +#: admin/menuaccess.php:47 functions/NagDataClass.php:134 +#: functions/NagDataClass.php:285 msgid "Data were successfully inserted to the data base!" msgstr "Data successfully inserted into the database!" -#: admin/menuaccess.php:44 +#: admin/menuaccess.php:48 msgid "Access group set for menu item:" msgstr "Access group set for menu item:" # menuaccess.php -#: admin/menuaccess.php:50 -msgid "Define Menu Accessrights" +#: admin/menuaccess.php:55 +msgid "Define Menu Access Rights" msgstr "Define Menu Access Rights" -#: admin/menuaccess.php:54 -msgid "In order for a user to get access, he needs to be member of the group selected here." -msgstr "In order for a user to get access, he needs to be member of the group selected here." +#: admin/menuaccess.php:59 +msgid "" +"In order for a user to get access, he needs to be member of the group " +"selected here." +msgstr "" +"In order for a user to get access, he needs to be member of the group " +"selected here." -#: admin/monitoring.php:32 +#: admin/monitoring.php:36 msgid "Monitoring" msgstr "Monitoring" # monitoring.php -#: admin/monitoring.php:35 -msgid "To define host and service supervisions as well as host and service groups." -msgstr "Define host and service supervisions as well as host and service groups." +#: admin/monitoring.php:39 +msgid "" +"Define host and service supervisions as well as host and service groups." +msgstr "" +"Define host and service supervisions as well as host and service groups." -#: admin/monitoring.php:52 +#: admin/monitoring.php:64 admin/serviceescalations.php:557 +#: config/fieldvars.php:248 config/fieldvars.php:305 msgid "Services" msgstr "Services" -#: admin/monitoring.php:64 +#: admin/monitoring.php:80 config/fieldvars.php:213 config/fieldvars.php:307 msgid "Service groups" msgstr "Service groups" -#: admin/monitoring.php:70 +#: admin/monitoring.php:88 config/fieldvars.php:302 config/fieldvars.php:328 msgid "Host templates" msgstr "Host templates" -#: admin/monitoring.php:76 +#: admin/monitoring.php:96 config/fieldvars.php:329 msgid "Service templates" msgstr "Service templates" # mutdialog.php -#: admin/mutdialog.php:51 +#: admin/mutdialog.php:57 admin/versioncheck.php:83 msgid "Available" msgstr "Available" -#: admin/mutdialog.php:52 +#: admin/mutdialog.php:58 msgid "Selected" msgstr "Selected" -#: admin/nagioscfg.php:94 +#: admin/nagioscfg.php:105 msgid "Nagios main configuration file" msgstr "Nagios main configuration file" -#: admin/password.php:50 +#: admin/password.php:55 msgid "Password successfully modified" msgstr "Password successfully modified" -#: admin/password.php:64 -#: admin/user.php:72 -msgid "Password too short or password fields unequally!" -msgstr "Password too short or password fields don't match!" +#: admin/password.php:72 admin/user.php:90 +msgid "Password too short or password fields do not match!" +msgstr "Password too short or password fields do not match!" -#: admin/password.php:68 -msgid "Old password is wrong" +#: admin/password.php:78 +msgid "The old password is invalid" msgstr "The old password is invalid" -#: admin/password.php:84 -#: admin/settings.php:244 +#: admin/password.php:97 admin/settings.php:310 config/fieldvars.php:58 msgid "Save" msgstr "Save" -#: admin/password.php:87 -msgid "The new passwords are not equal!" -msgstr "The new passwords don't match!" +#: admin/password.php:100 +msgid "The new passwords don not match!" +msgstr "The new passwords don not match!" -#: admin/password.php:88 +#: admin/password.php:101 msgid "The new password is too short - use at least 6 characters!" msgstr "The new password is too short - use at least 6 characters!" # hosttemplates.php -#: admin/servicedependencies.php:61 +#: admin/servicedependencies.php:72 msgid "New service dependency inserted:" msgstr "New service dependency inserted:" -#: admin/servicedependencies.php:62 +#: admin/servicedependencies.php:75 msgid "Service dependency modified:" msgstr "Service dependency modified:" -#: admin/servicedependencies.php:157 +#: admin/servicedependencies.php:313 admin/servicedependencies.php:704 msgid "Define service dependencies (servicedependencies.cfg)" msgstr "Define service dependencies (servicedependencies.cfg)" -#: admin/servicedependencies.php:351 +#: admin/servicedependencies.php:706 config/fieldvars.php:247 msgid "Dependent services" msgstr "Dependent services" # hosttemplates.php -#: admin/serviceescalations.php:61 +#: admin/serviceescalations.php:71 msgid "New service escalation inserted:" msgstr "New service escalation inserted:" -#: admin/serviceescalations.php:62 +#: admin/serviceescalations.php:74 msgid "Service escalation modified:" msgstr "Service escalation modified:" -#: admin/serviceescalations.php:141 +#: admin/serviceescalations.php:256 admin/serviceescalations.php:555 msgid "Define service escalation (serviceescalations.cfg)" msgstr "Define service escalation (serviceescalations.cfg)" # hosttemplates.php -#: admin/serviceextinfo.php:54 +#: admin/serviceextinfo.php:64 msgid "New service extended information inserted:" msgstr "New service extended information inserted:" -#: admin/serviceextinfo.php:55 +#: admin/serviceextinfo.php:68 msgid "Service extended information modified:" msgstr "Service extended information modified:" -#: admin/serviceextinfo.php:79 +#: admin/serviceextinfo.php:104 admin/serviceextinfo.php:214 msgid "Define service extended information (serviceextinfo.cfg)" msgstr "Define service extended information (serviceextinfo.cfg)" -#: admin/serviceextinfo.php:159 +#: admin/serviceextinfo.php:215 msgid "Hostname" msgstr "Hostname" -#: admin/serviceextinfo.php:160 +#: admin/serviceextinfo.php:216 msgid "Service" msgstr "Service" # hosttemplates.php -#: admin/servicegroups.php:54 +#: admin/servicegroups.php:63 msgid "New service group inserted:" msgstr "New service group inserted:" -#: admin/servicegroups.php:55 +#: admin/servicegroups.php:66 msgid "Service group modified:" msgstr "Service group modified:" -#: admin/servicegroups.php:97 +#: admin/servicegroups.php:149 admin/servicegroups.php:229 msgid "Define service groups (servicegroups.cfg)" msgstr "Define service groups (servicegroups.cfg)" -#: admin/servicegroups.php:112 +#: admin/servicegroups.php:170 msgid "Attention, no services defined!" msgstr "Attention, no services defined!" -#: admin/servicegroups.php:146 +#: admin/servicegroups.php:230 msgid "Service group" msgstr "Service group" # hosttemplates.php -#: admin/services.php:77 +#: admin/services.php:96 msgid "New service inserted:" msgstr "New service inserted:" -#: admin/services.php:78 +#: admin/services.php:99 msgid "Service modified:" msgstr "Service modified:" -#: admin/services.php:141 -#: admin/services.php:167 +#: admin/services.php:251 admin/services.php:281 +#: functions/prepend_content.php:460 msgid "Service file deleted:" msgstr "Service file deleted:" -#: admin/services.php:255 +#: admin/services.php:403 admin/services.php:704 msgid "Define services (services.cfg)" msgstr "Define services (services.cfg)" -#: admin/services.php:311 +#: admin/services.php:488 msgid "Attention, no hosts or hostgroups defined!" msgstr "Attention, no hosts or hostgroups defined!" -#: admin/services.php:328 +#: admin/services.php:543 msgid "Attention, no check commands defined!" msgstr "Attention, no check commands defined!" -#: admin/services.php:354 +#: admin/services.php:613 msgid "Attention, no contacts or contact groups defined!" msgstr "Attention, no contacts or contact groups defined!" -#: admin/services.php:436 +#: admin/services.php:706 msgid "Service name" msgstr "Service name" -#: admin/services.php:438 -#: admin/services.php:462 +#: admin/services.php:708 admin/services.php:732 msgid "All configs" msgstr "All configs" # hosttemplates.php -#: admin/servicetemplates.php:76 +#: admin/servicetemplates.php:97 msgid "New service template inserted:" msgstr "New service template inserted:" -#: admin/servicetemplates.php:77 +#: admin/servicetemplates.php:100 msgid "Service template modified:" msgstr "Service template modified:" -#: admin/servicetemplates.php:195 +#: admin/servicetemplates.php:341 admin/servicetemplates.php:623 msgid "Define service templates (servicetemplates.cfg)" msgstr "Define service templates (servicetemplates.cfg)" -#: admin/servicetemplates.php:357 +#: admin/servicetemplates.php:624 config/fieldvars.php:124 +#: config/fieldvars.php:225 msgid "Template name" msgstr "Template name" -#: admin/servicetemplates.php:358 +#: admin/servicetemplates.php:625 config/fieldvars.php:212 msgid "Service description" msgstr "Service description" -#: admin/settings.php:63 +#: admin/settings.php:111 msgid "Curl module not loaded, Proxy will be deactivated!" msgstr "Curl module not loaded, Proxy will be deactivated!" -#: admin/settings.php:90 +#: admin/settings.php:136 msgid "An error occured while writing settings to database:" msgstr "An error occured while writing settings to database:" -#: admin/settings.php:129 -msgid "Error in setting the correct locale, please report this error with the associated output of 'locale -a'" -msgstr "Error in setting the correct locale, please report this error with the associated output of 'locale -a'" +#: admin/settings.php:187 functions/prepend_adm.php:150 +msgid "" +"Error setting the correct locale. Please report this error with the " +"associated output of 'locale -a'" +msgstr "" +"Error setting the correct locale. Please report this error with the " +"associated output of 'locale -a'" -#: admin/settings.php:136 +#: admin/settings.php:195 msgid "Settings were changed" msgstr "Settings were changed" -#: admin/settings.php:138 -msgid "An error occured while writing settings.php, please check permissions!" -msgstr "An error occurred while writing settings.php. Please check permissions!" +#: admin/settings.php:197 +msgid "An error occured while writing settings.php. Please check permissions!" +msgstr "An error occured while writing settings.php. Please check permissions!" -#: admin/settings.php:141 +#: admin/settings.php:201 msgid "is not writeable, please check permissions!" msgstr "is not writeable, please check permissions!" -#: admin/settings.php:147 +#: admin/settings.php:208 msgid "Configure Settings" msgstr "Configure Settings" -#: admin/settings.php:154 +#: admin/settings.php:213 msgid "Change your current NagiosQL settings (e.g. Database user, Language)." msgstr "Change your current NagiosQL settings (e.g. Database user, Language)." -#: admin/settings.php:158 +#: admin/settings.php:218 msgid "Path" msgstr "Path" -#: admin/settings.php:159 +#: admin/settings.php:219 msgid "Temporary Directory" msgstr "Temporary Directory" -#: admin/settings.php:161 +#: admin/settings.php:221 msgid "Server protocol" msgstr "Server protocol" -#: admin/settings.php:182 +#: admin/settings.php:244 msgid "Encoding" msgstr "Encoding" -#: admin/settings.php:187 +#: admin/settings.php:249 msgid "Database" msgstr "Database" -#: admin/settings.php:188 +#: admin/settings.php:250 msgid "MySQL Server" msgstr "MySQL Server" -#: admin/settings.php:190 +#: admin/settings.php:252 msgid "MySQL Server Port" msgstr "MySQL Server Port" -#: admin/settings.php:192 +#: admin/settings.php:254 install/step2.php:66 msgid "Database name" msgstr "Database name" -#: admin/settings.php:194 +#: admin/settings.php:256 msgid "Database user" msgstr "Database user" -#: admin/settings.php:196 +#: admin/settings.php:258 msgid "Database password" msgstr "Database password" -#: admin/settings.php:201 +#: admin/settings.php:263 msgid "Security" msgstr "Security" -#: admin/settings.php:202 +#: admin/settings.php:264 msgid "Session auto logoff time" msgstr "Session auto logoff time" -#: admin/settings.php:204 +#: admin/settings.php:266 msgid "Authentication type" msgstr "Authentication type" -#: admin/settings.php:209 +#: admin/settings.php:271 msgid "Common" msgstr "Common" -#: admin/settings.php:210 +#: admin/settings.php:272 msgid "Data lines per page" msgstr "Data lines per page" -#: admin/settings.php:212 +#: admin/settings.php:274 msgid "Selection method" msgstr "Selection method" -#: admin/settings.php:217 +#: admin/settings.php:279 msgid "Template warn message" msgstr "Template warn message" -#: admin/settings.php:226 +#: admin/settings.php:288 msgid "Online version check" msgstr "Online version check" -#: admin/settings.php:232 +#: admin/settings.php:296 msgid "Proxyserver" msgstr "Proxyserver" -#: admin/settings.php:235 +#: admin/settings.php:301 msgid "Proxy Address" msgstr "Proxy Address" -#: admin/settings.php:237 +#: admin/settings.php:303 msgid "Proxy Username (optional)" msgstr "Proxy Username (optional)" -#: admin/settings.php:239 +#: admin/settings.php:305 msgid "Proxy Password (optional)" msgstr "Proxy Password (optional)" -#: admin/specials.php:31 +#: admin/specials.php:35 msgid "Misc commands" msgstr "Misc commands" # specials.php -#: admin/specials.php:34 -msgid "To define host and service dependencies, host and service escalations as well as host and service additional data." -msgstr "Define host and service dependencies, host and service escalations as well as host and service additional data." +#: admin/specials.php:38 +msgid "" +"Define host and service dependencies, host and service escalations as well " +"as host and service additional data." +msgstr "" +"Define host and service dependencies, host and service escalations as well " +"as host and service additional data." -#: admin/specials.php:45 +#: admin/specials.php:56 msgid "Host dependencies" msgstr "Host dependencies" -#: admin/specials.php:51 +#: admin/specials.php:64 msgid "Host escalations" msgstr "Host escalations" -#: admin/specials.php:57 +#: admin/specials.php:72 msgid "Host ext. info" msgstr "Host ext. info" -#: admin/specials.php:63 +#: admin/specials.php:80 msgid "Service dependencies" msgstr "Service dependencies" -#: admin/specials.php:69 +#: admin/specials.php:88 msgid "Service escalations" msgstr "Service escalations" -#: admin/specials.php:75 +#: admin/specials.php:96 msgid "Service ext. info" msgstr "Service ext. info" -#: admin/support.php:65 +#: admin/support.php:39 msgid "NagiosQL support page" msgstr "NagiosQL support page" -#: admin/support.php:75 +#: admin/support.php:49 msgid "Support contact information" msgstr "Support contact information" -#: admin/support.php:76 -msgid "For questions, the online support forum or contact information visit our website:" -msgstr "For questions, the online support forum or contact information visit our website:" +#: admin/support.php:50 +msgid "" +"For questions, the online support forum or contact information visit our " +"website:" +msgstr "" +"For questions, the online support forum or contact information visit our " +"website:" -#: admin/support.php:80 +#: admin/support.php:52 +msgid "NagiosQL on sourceforge" +msgstr "NagiosQL on sourceforge" + +#: admin/support.php:56 msgid "Donate to support NagiosQL" msgstr "Donate to support NagiosQL" -#: admin/support.php:81 -msgid "If you like NagiosQL and it simplifies your daily work, then you may want to support the project by making a donation. This helps us to keep NagiosQL alive and to cover our costs. Thank you for your donation!" -msgstr "If you like NagiosQL and it simplifies your daily work, then you may want to support the project by making a donation. This helps us to keep NagiosQL alive and to cover our costs. Thank you for your donation!" +#: admin/support.php:57 +msgid "" +"If you like NagiosQL and it simplifies your daily work, then you may want to " +"support the project by making a donation. This helps us to keep NagiosQL " +"alive and to cover our costs. Thank you for your donation!" +msgstr "" +"If you like NagiosQL and it simplifies your daily work, then you may want to " +"support the project by making a donation. This helps us to keep NagiosQL " +"alive and to cover our costs. Thank you for your donation!" -#: admin/support.php:82 +#: admin/support.php:60 functions/NagVisualClass.php:230 +#: functions/NagVisualClass.php:231 msgid "Donate for NagiosQL on sourceforge" msgstr "Donate for NagiosQL on sourceforge" -#: admin/support.php:86 +#: admin/support.php:64 msgid "Translation services" msgstr "Translation services" -#: admin/support.php:87 -msgid "NagiosQL was translated into various languages​​. Since some translators are no longer available in later versions, there may be untranslated words or phrases. If you want to help us complete the translation, correct them or introduce a new language​​, then sign up with us now! The translations are simply feasible online - we use an open translation service where you can register for free at any time:" -msgstr "NagiosQL was translated into various languages​​. Since some translators are no longer available in later versions, there may be untranslated words or phrases. If you want to help us complete the translation, correct them or introduce a new language​​, then sign up with us now! The translations are simply feasible online - we use an open translation service where you can register for free at any time:" +#: admin/support.php:65 +msgid "" +"NagiosQL was translated into various languages​​. Since some translators are " +"no longer available in later versions, there may be untranslated words or " +"phrases. If you want to help us complete the translation, correct them or " +"introduce a new language​​, then sign up with us now! The translations are " +"simply feasible online - we use an open translation service where you can " +"register for free at any time:" +msgstr "" +"NagiosQL was translated into various languages​​. Since some translators are " +"no longer available in later versions, there may be untranslated words or " +"phrases. If you want to help us complete the translation, correct them or " +"introduce a new language​​, then sign up with us now! The translations are " +"simply feasible online - we use an open translation service where you can " +"register for free at any time:" -#: admin/support.php:88 +#: admin/support.php:70 msgid "Transifex translation service" msgstr "Transifex translation service" -#: admin/support.php:92 +#: admin/support.php:74 +msgid "GIT software repository" +msgstr "GIT software repository" + +#: admin/support.php:75 +msgid "" +"The NagiosQL sources are available on GitLab. There you will always find the " +"latest bugfixes and changes as well as older branches." +msgstr "" +"The NagiosQL sources are available on GitLab. There you will always find the " +"latest bugfixes and changes as well as older branches." + +#: admin/support.php:77 +msgid "GitLab" +msgstr "GitLab" + +#: admin/support.php:81 msgid "Version check" msgstr "Version check" -#: admin/support.php:94 -msgid "The online version check is not enabled. You can enable it on the settings page." -msgstr "The online version check is not enabled. You can enable it on the settings page." +#: admin/support.php:83 +msgid "" +"The online version check is not enabled. You can enable it on the settings " +"page." +msgstr "" +"The online version check is not enabled. You can enable it on the settings " +"page." -#: admin/support.php:96 -msgid "The online version check connects the NagiosQL page to find out, if your version is still up to date." -msgstr "The online version check connects the NagiosQL page to find out, if your version is still up to date." +#: admin/support.php:86 +msgid "" +"The online version check connects the NagiosQL page to find out, if your " +"version is still up to date." +msgstr "" +"The online version check connects the NagiosQL page to find out, if your " +"version is still up to date." -#: admin/support.php:106 +#: admin/support.php:98 msgid "Environment check" msgstr "Environment check" -#: admin/support.php:108 -#: admin/support.php:118 -#: admin/support.php:129 -#: admin/support.php:137 -#: admin/support.php:146 -#: admin/support.php:156 -#: admin/support.php:171 -#: admin/support.php:183 -#: admin/support.php:192 -#: admin/support.php:201 -#: admin/support.php:210 -#: admin/support.php:220 -#: admin/support.php:267 -#: admin/support.php:282 -#: admin/support.php:301 -#: admin/support.php:332 -#: admin/support.php:354 -#: admin/support.php:358 -#: admin/support.php:375 -#: admin/support.php:379 -#: admin/support.php:395 -#: admin/support.php:398 -#: admin/support.php:401 -#: admin/support.php:420 -#: admin/support.php:424 -#: admin/support.php:427 -#: admin/support.php:439 -#: admin/support.php:442 -#: admin/support.php:459 -#: admin/support.php:466 -#: admin/support.php:551 -#: admin/support.php:554 -#: admin/support.php:566 -#: admin/support.php:583 -#: admin/support.php:607 +#: admin/support.php:100 admin/support.php:109 admin/support.php:121 +#: admin/support.php:129 admin/support.php:138 admin/support.php:148 +#: admin/support.php:163 admin/support.php:176 admin/support.php:185 +#: admin/support.php:194 admin/support.php:203 admin/support.php:213 +#: admin/support.php:263 admin/support.php:278 admin/support.php:299 +#: admin/support.php:337 admin/support.php:360 admin/support.php:366 +#: admin/support.php:392 admin/support.php:396 admin/support.php:415 +#: admin/support.php:418 admin/support.php:421 admin/support.php:435 +#: admin/support.php:440 admin/support.php:443 admin/support.php:448 +#: admin/support.php:460 admin/support.php:465 admin/support.php:484 +#: admin/support.php:492 admin/support.php:589 admin/support.php:592 +#: admin/support.php:613 admin/support.php:642 admin/support.php:677 +#: install/functions/NagInstallClass.php:338 +#: install/functions/NagInstallClass.php:370 +#: install/functions/NagInstallClass.php:406 +#: install/functions/NagInstallClass.php:485 +#: install/functions/NagInstallClass.php:493 +#: install/functions/NagInstallClass.php:515 +#: install/functions/NagInstallClass.php:539 +#: install/functions/NagInstallClass.php:551 +#: install/functions/NagInstallClass.php:618 +#: install/functions/NagInstallClass.php:640 +#: install/functions/NagInstallClass.php:649 +#: install/functions/NagInstallClass.php:701 +#: install/functions/NagInstallClass.php:706 +#: install/functions/NagInstallClass.php:739 +#: install/functions/NagInstallClass.php:777 +#: install/functions/NagInstallClass.php:784 +#: install/functions/NagInstallClass.php:812 +#: install/functions/NagInstallClass.php:872 +#: install/functions/NagInstallClass.php:904 +#: install/functions/NagInstallClass.php:938 +#: install/functions/NagInstallClass.php:971 +#: install/functions/NagInstallClass.php:1010 +#: install/functions/NagInstallClass.php:1019 +#: install/functions/NagInstallClass.php:1062 +#: install/functions/NagInstallClass.php:1071 install/step1.php:229 +#: install/step1.php:242 install/step1.php:246 install/step1.php:255 +#: install/step1.php:264 install/step1.php:273 install/step1.php:282 +#: install/step1.php:291 install/step1.php:300 install/step3.php:90 +#: install/step3.php:179 install/step3.php:204 msgid "failed" msgstr "failed" -#: admin/support.php:109 -#: admin/support.php:115 -#: admin/support.php:126 -#: admin/support.php:134 -#: admin/support.php:142 -#: admin/support.php:152 -#: admin/support.php:168 -#: admin/support.php:180 -#: admin/support.php:189 -#: admin/support.php:198 -#: admin/support.php:207 -#: admin/support.php:217 -#: admin/support.php:259 -#: admin/support.php:272 -#: admin/support.php:287 -#: admin/support.php:295 -#: admin/support.php:298 -#: admin/support.php:329 -#: admin/support.php:335 -#: admin/support.php:350 -#: admin/support.php:364 -#: admin/support.php:371 -#: admin/support.php:389 -#: admin/support.php:392 -#: admin/support.php:405 -#: admin/support.php:416 -#: admin/support.php:436 -#: admin/support.php:446 -#: admin/support.php:462 -#: admin/support.php:547 -#: admin/support.php:560 -#: admin/support.php:562 -#: admin/support.php:564 -#: admin/support.php:570 -#: admin/support.php:572 -#: admin/support.php:576 -#: admin/support.php:578 +#: admin/support.php:101 admin/support.php:106 admin/support.php:118 +#: admin/support.php:126 admin/support.php:134 admin/support.php:144 +#: admin/support.php:160 admin/support.php:173 admin/support.php:182 +#: admin/support.php:191 admin/support.php:200 admin/support.php:210 +#: admin/support.php:255 admin/support.php:268 admin/support.php:283 +#: admin/support.php:292 admin/support.php:295 admin/support.php:334 +#: admin/support.php:340 admin/support.php:356 admin/support.php:372 +#: admin/support.php:388 admin/support.php:407 admin/support.php:410 +#: admin/support.php:425 admin/support.php:432 admin/support.php:457 +#: admin/support.php:469 admin/support.php:488 admin/support.php:584 +#: admin/support.php:600 admin/support.php:605 admin/support.php:610 +#: admin/support.php:619 admin/support.php:624 admin/support.php:630 +#: admin/support.php:635 msgid "ok" msgstr "ok" -#: admin/support.php:112 +#: admin/support.php:103 msgid "PHP version" msgstr "PHP version" -#: admin/support.php:118 -#: admin/support.php:171 +#: admin/support.php:110 admin/support.php:163 msgid "Required:" msgstr "Required:" -#: admin/support.php:123 -#: admin/support.php:131 -#: admin/support.php:139 -#: admin/support.php:149 +#: admin/support.php:115 admin/support.php:123 admin/support.php:131 +#: admin/support.php:141 install/index.php:170 install/index.php:171 +#: install/index.php:172 install/index.php:173 msgid "PHP module:" msgstr "PHP module:" -#: admin/support.php:161 +#: admin/support.php:153 msgid "MySQL version" msgstr "MySQL version" -#: admin/support.php:176 -#: admin/support.php:185 -#: admin/support.php:194 -#: admin/support.php:203 +#: admin/support.php:169 admin/support.php:178 admin/support.php:187 +#: admin/support.php:196 msgid "PHP ini settings:" msgstr "PHP ini settings:" -#: admin/support.php:213 +#: admin/support.php:206 msgid "Read/Write access:" msgstr "Read/Write access:" -#: admin/support.php:229 +#: admin/support.php:222 msgid "Config domain checks" msgstr "Config domain checks" -#: admin/support.php:230 -msgid "The checks below are based on your data domain and config domain settings. To change the data domain, use the pull down menu in the upper right corner. Repeat this check for any data domain you have configured. To change the config domain, use the data domain menu and select a different config domain value." -msgstr "The checks below are based on your data domain and config domain settings. To change the data domain, use the pull down menu in the upper right corner. Repeat this check for any data domain you have configured. To change the config domain, use the data domain menu and select a different config domain value." +#: admin/support.php:223 +msgid "" +"The checks below are based on your data domain and config domain settings. " +"To change the data domain, use the pull down menu in the upper right corner. " +"Repeat this check for any data domain you have configured. To change the " +"config domain, use the data domain menu and select a different config domain " +"value." +msgstr "" +"The checks below are based on your data domain and config domain settings. " +"To change the data domain, use the pull down menu in the upper right corner. " +"Repeat this check for any data domain you have configured. To change the " +"config domain, use the data domain menu and select a different config domain " +"value." -#: admin/support.php:233 +#: admin/support.php:229 msgid "Config domain name" msgstr "Config domain name" -#: admin/support.php:235 +#: admin/support.php:231 msgid "Connection type" msgstr "Connection type" -#: admin/support.php:256 +#: admin/support.php:252 msgid "Connection check" msgstr "Connection check" -#: admin/support.php:298 -#: admin/support.php:335 -#: admin/support.php:398 -#: admin/support.php:420 +#: admin/support.php:295 admin/support.php:340 admin/support.php:418 +#: admin/support.php:436 msgid "readonly" msgstr "readonly" -#: admin/support.php:341 +#: admin/support.php:346 config/fieldvars.php:45 msgid "Nagios process file" msgstr "Nagios process file" -#: admin/support.php:354 -#: admin/support.php:375 -#: admin/support.php:395 -#: admin/support.php:427 -#: admin/support.php:439 -#: admin/support.php:466 +#: admin/support.php:361 admin/support.php:392 admin/support.php:415 +#: admin/support.php:444 admin/support.php:448 admin/support.php:465 +#: admin/support.php:493 msgid "file is missed" msgstr "file is missed" -#: admin/support.php:359 -#: admin/support.php:380 +#: admin/support.php:367 admin/support.php:397 msgid "Nagios daemon is not running" msgstr "Nagios daemon is not running" -#: admin/support.php:364 -#: admin/support.php:405 -#: admin/support.php:446 +#: admin/support.php:372 admin/support.php:425 admin/support.php:469 msgid "not used with FTP" msgstr "not used with FTP" -#: admin/support.php:379 -#: admin/support.php:392 -#: admin/support.php:424 +#: admin/support.php:396 admin/support.php:410 admin/support.php:440 msgid "demon dead" msgstr "demon dead" -#: admin/support.php:385 +#: admin/support.php:402 config/fieldvars.php:43 msgid "Nagios command file" msgstr "Nagios command file" -#: admin/support.php:432 +#: admin/support.php:452 config/fieldvars.php:44 msgid "Nagios binary file" msgstr "Nagios binary file" # mutdialog.php -#: admin/support.php:442 -#: admin/support.php:459 +#: admin/support.php:461 admin/support.php:485 msgid "not executable" msgstr "not executable" # config_class.php -#: admin/support.php:474 +#: admin/support.php:501 msgid "Verify configuration files and demon configuration" msgstr "Verify configuration files and demon configuration" -#: admin/support.php:475 +#: admin/support.php:502 msgid "Configuration name" msgstr "Configuration name" # fieldvars.php -#: admin/support.php:476 +#: admin/support.php:503 msgid "Used in data domain" msgstr "Used in data domain" -#: admin/support.php:477 +#: admin/support.php:504 msgid "Included in demon configuration" msgstr "Included in demon configuration" -#: admin/support.php:549 +#: admin/support.php:587 msgid "not used" msgstr "not used" -#: admin/support.php:554 +#: admin/support.php:593 msgid "cfg definition missed" msgstr "cfg definition missed" -#: admin/support.php:564 -#: admin/support.php:572 -#: admin/support.php:578 +#: admin/support.php:611 admin/support.php:625 admin/support.php:636 msgid "cfg definition missed, but actually not used" msgstr "cfg definition missed, but actually not used" -#: admin/support.php:566 +#: admin/support.php:614 msgid "wrong base path:" msgstr "wrong base path:" -#: admin/support.php:583 +#: admin/support.php:643 msgid "cfg file not readable" msgstr "cfg file not readable" -#: admin/support.php:606 +#: admin/support.php:676 msgid "Not used" msgstr "Not used" -#: admin/support.php:608 +#: admin/support.php:678 msgid "unused - please delete!" msgstr "unused - please delete!" -#: admin/templatedefinitions.php:231 +#: admin/templatedefinitions.php:260 msgid "Up" msgstr "Up" -#: admin/templatedefinitions.php:231 +#: admin/templatedefinitions.php:264 msgid "Down" msgstr "Down" -#: admin/timedefinitions.php:166 -#: admin/variabledefinitions.php:133 +#: admin/timedefinitions.php:176 admin/variabledefinitions.php:143 +#: config/fieldvars.php:77 msgid "Modify" msgstr "Modify" -#: admin/timeperiods.php:54 +#: admin/timeperiods.php:62 msgid "New time period inserted:" msgstr "New time period inserted:" -#: admin/timeperiods.php:55 +#: admin/timeperiods.php:65 msgid "Time period modified:" msgstr "Time period modified:" -#: admin/timeperiods.php:118 -msgid "Timeperiod definitions" +#: admin/timeperiods.php:173 admin/timeperiods.php:252 +msgid "Time period definitions (timeperiods.cfg)" msgstr "Time period definitions (timeperiods.cfg)" -#: admin/timeperiods.php:143 +#: admin/timeperiods.php:230 msgid "Please insert a time definition and a time range" msgstr "Please insert a time definition and a time range" # timeperiod.php -#: admin/timeperiods.php:164 +#: admin/timeperiods.php:253 config/fieldvars.php:92 msgid "Time period" msgstr "Time period" # tools.php -#: admin/tools.php:31 +#: admin/tools.php:35 msgid "Different tools" msgstr "Different tools" -#: admin/tools.php:34 -msgid "Useful functions for data import, main configuration, daemon control and so on." -msgstr "Useful functions for data import, main configuration, daemon control, etc." +#: admin/tools.php:36 +msgid "" +"Useful functions for data import, main configuration, daemon control, etc." +msgstr "" +"Useful functions for data import, main configuration, daemon control, etc." -#: admin/user.php:62 -msgid "A new user added:" +#: admin/user.php:74 +msgid "New user added:" msgstr "New user added:" -#: admin/user.php:80 +#: admin/user.php:128 admin/user.php:176 msgid "User administration" msgstr "User administration" -#: admin/user.php:103 -msgid "The passwords are not equal!" -msgstr "The passwords don't match!" +#: admin/user.php:132 +msgid "The passwords do not match!" +msgstr "The passwords do not match!" -#: admin/user.php:104 +#: admin/user.php:133 msgid "Please fill in the password" -msgstr "Please supply the password" +msgstr "Please fill in the password" -#: admin/user.php:105 +#: admin/user.php:134 msgid "The password is too short - use at least 6 characters!" msgstr "The password is too short - use at least 6 characters!" -#: admin/user.php:106 +#: admin/user.php:135 msgid "Webserver authentification" -msgstr "Web server authentication" +msgstr "Webserver authentification" -#: admin/verify.php:45 -#: admin/verify.php:145 -#: functions/config_class.php:711 -#: functions/config_class.php:712 -#: functions/config_class.php:928 -msgid "Writing of the configuration failed - no dataset or not activated dataset found" -msgstr "Writing of the configuration failed - no dataset or not activated dataset found" +#: admin/user.php:177 config/fieldvars.php:24 index.php:51 +msgid "Username" +msgstr "Username" -#: admin/verify.php:57 +#: admin/verify.php:50 admin/verify.php:157 functions/NagConfigClass.php:1115 +#: functions/NagConfigClass.php:1117 functions/NagConfigClass.php:1357 +#: functions/NagConfigClass.php:1359 +msgid "" +"Writing of the configuration failed - no dataset or not activated dataset " +"found" +msgstr "" +"Writing of the configuration failed - no dataset or not activated dataset " +"found" + +#: admin/verify.php:62 msgid "Write host configurations" msgstr "Write host configurations" -#: admin/verify.php:63 -#: admin/verify.php:83 +#: admin/verify.php:69 admin/verify.php:91 msgid "No configuration items defined!" msgstr "No configuration items defined!" -#: admin/verify.php:77 +#: admin/verify.php:84 msgid "Write service configurations" msgstr "Write service configurations" -#: admin/verify.php:94 -#: admin/verify.php:108 -#: admin/verify.php:122 -#: admin/verify.php:136 -#: admin/verify.php:190 -#: admin/verify.php:204 -#: admin/verify.php:218 -#: admin/verify.php:232 -#: admin/verify.php:246 -#: admin/verify.php:260 -#: admin/verify.php:274 +#: admin/verify.php:102 admin/verify.php:117 admin/verify.php:132 +#: admin/verify.php:147 admin/verify.php:202 admin/verify.php:217 +#: admin/verify.php:232 admin/verify.php:247 admin/verify.php:262 +#: admin/verify.php:277 admin/verify.php:292 msgid "No dataset or no activated dataset found - empty configuration written" msgstr "No dataset or no activated dataset found - empty configuration written" -#: admin/verify.php:291 -msgid "Cannot find the Nagios binary or no rights for execution!" +#: admin/verify.php:311 +msgid "Cannot find the Nagios binary or no execute permissions!" msgstr "Cannot find the Nagios binary or no execute permissions!" -#: admin/verify.php:304 +#: admin/verify.php:326 msgid "Remote execution (FTP SITE EXEC) is not supported on your system!" msgstr "Remote execution (FTP SITE EXEC) is not supported on your system!" -#: admin/verify.php:321 +#: admin/verify.php:345 msgid "Remote execution of nagios verify command failed (remote SSH)!" msgstr "Remote execution of nagios verify command failed (remote SSH)!" -#: admin/verify.php:324 +#: admin/verify.php:350 msgid "Nagios binary or configuration file not found (remote SSH)!" msgstr "Nagios binary or configuration file not found (remote SSH)!" -#: admin/verify.php:355 +#: admin/verify.php:388 msgid "Nagios daemon successfully restarted" msgstr "Nagios daemon successfully restarted" -#: admin/verify.php:356 +#: admin/verify.php:390 msgid "Restart command successfully send to Nagios" msgstr "Restart command successfully sent to Nagios" -#: admin/verify.php:358 -#: admin/verify.php:363 -#: admin/verify.php:364 -msgid "Restart failed - Nagios command file not found or no rights to execute" -msgstr "Restart failed - Nagios command file not found or no execute permissions" +#: admin/verify.php:394 admin/verify.php:402 +msgid "" +"Restart failed - Nagios command file not found or no execute permissions" +msgstr "" +"Restart failed - Nagios command file not found or no execute permissions" -#: admin/verify.php:359 -msgid "Nagios command file not found or no rights to write!" +#: admin/verify.php:397 +msgid "Nagios command file not found or no write permissions!" msgstr "Nagios command file not found or no write permissions!" -#: admin/verify.php:367 +#: admin/verify.php:404 +msgid "Restart failed - Nagios command file not found or no rights to execute" +msgstr "" +"Restart failed - Nagios command file not found or no execute permissions" + +#: admin/verify.php:408 msgid "Restart failed - Nagios daemon was not running" msgstr "Restart failed - Nagios daemon was not running" -#: admin/verify.php:368 +#: admin/verify.php:410 msgid "Nagios daemon is not running, cannot send restart command!" msgstr "Nagios daemon is not running, cannot send restart command!" -#: admin/verify.php:371 +#: admin/verify.php:415 msgid "Restart failed - FTP restrictions" msgstr "Restart failed - FTP restrictions" -#: admin/verify.php:372 +#: admin/verify.php:417 msgid "Nagios restart is not possible via FTP remote connection!" msgstr "Nagios restart is not possible via FTP remote connection!" -#: admin/verify.php:389 -msgid "Restart failed - Nagios command file not found or no rights to execute (remote SSH)!" -msgstr "Restart failed - Nagios command file not found or no rights to execute (remote SSH)!" +#: admin/verify.php:440 +msgid "" +"Restart failed - Nagios command file not found or no rights to execute " +"(remote SSH)!" +msgstr "" +"Restart failed - Nagios command file not found or no rights to execute " +"(remote SSH)!" -#: admin/verify.php:391 +#: admin/verify.php:443 msgid "Nagios daemon successfully restarted (remote SSH)" msgstr "Nagios daemon successfully restarted (remote SSH)" -#: admin/verify.php:392 +#: admin/verify.php:445 msgid "Restart command successfully send to Nagios (remote SSH)" msgstr "Restart command successfully send to Nagios (remote SSH)" -#: admin/verify.php:395 +#: admin/verify.php:450 msgid "Nagios command file not found (remote SSH)!" msgstr "Nagios command file not found (remote SSH)!" -#: admin/verify.php:403 +#: admin/verify.php:458 msgid "Check written configuration files" msgstr "Check written configuration files" -#: admin/verify.php:406 +#: admin/verify.php:459 msgid "Check configuration files:" msgstr "Check configuration files:" -#: admin/verify.php:407 +#: admin/verify.php:460 msgid "Restart Nagios:" msgstr "Restart Nagios:" -#: admin/verify.php:408 +#: admin/verify.php:461 msgid "Write monitoring data" msgstr "Write monitoring data" -#: admin/verify.php:409 +#: admin/verify.php:462 msgid "Write additional data" msgstr "Write additional data" -#: admin/verify.php:410 -msgid "Warning, always check the configuration files before restart Nagios!" -msgstr "Warning, always check the configuration files before restarting Nagios!" +#: admin/verify.php:464 +msgid "Warning, always check the configuration files before restarting Nagios!" +msgstr "" +"Warning, always check the configuration files before restarting Nagios!" -#: admin/verify.php:411 -#: config/fieldvars.php:54 +#: admin/verify.php:467 config/fieldvars.php:62 msgid "Do it" msgstr "Do it" -#: admin/verify.php:436 -#: admin/verify.php:465 -msgid "Written Nagios configuration checked - Warnings/Errors:" +#: admin/verify.php:498 admin/verify.php:542 +msgid "Nagios written configuration files checked - Warnings/Errors:" msgstr "Nagios written configuration files checked - Warnings/Errors:" # config_class.php -#: admin/verify.php:440 -#: admin/verify.php:468 +#: admin/verify.php:504 admin/verify.php:547 msgid "Written configuration files are valid, Nagios can be restarted!" msgstr "Written configuration files are valid. Nagios can be restarted!" -#: admin/versioncheck.php:64 -#: admin/versioncheck.php:72 +#: admin/verify.php:510 +msgid "" +"The configuration could not be tested successfully. The Nagios binary may " +"have crashed during the test. Please repeat the test or try using the " +"commandline to test. A running Nagios service should not be restarted " +"because the configuration may be invalid." +msgstr "" +"The configuration could not be tested successfully. The Nagios binary may " +"have crashed during the test. Please repeat the test or try using the " +"commandline to test. A running Nagios service should not be restarted " +"because the configuration may be invalid." + +#: admin/versioncheck.php:69 admin/versioncheck.php:79 msgid "check proxy settings" msgstr "check proxy settings" -#: admin/versioncheck.php:75 +#: admin/versioncheck.php:82 msgid "Installed" msgstr "Installed" -#: admin/versioncheck.php:77 -#: config/fieldvars.php:171 +#: admin/versioncheck.php:84 config/fieldvars.php:187 msgid "Information" msgstr "Information" -#: admin/versioncheck.php:91 +#: admin/versioncheck.php:106 msgid "You already have the latest version installed" msgstr "You already have the latest version installed" -#: admin/versioncheck.php:93 -msgid "You are using an old NagiosQL version. Please update to the latest stable version" -msgstr "You are using an old NagiosQL version. Please update to the latest stable version" +#: admin/versioncheck.php:109 +msgid "" +"You are using an old NagiosQL version. Please update to the latest stable " +"version" +msgstr "" +"You are using an old NagiosQL version. Please update to the latest stable " +"version" -#: admin/versioncheck.php:96 +#: admin/versioncheck.php:114 msgid "You are using a newer development version without official support" msgstr "You are using a newer development version without official support" # fieldvars.php -#: config/fieldvars.php:22 -#: functions/prepend_adm.php:446 +#: config/fieldvars.php:20 functions/prepend_adm.php:538 msgid "Domain" msgstr "Domain" -#: config/fieldvars.php:24 -#: config/fieldvars.php:29 +#: config/fieldvars.php:22 config/fieldvars.php:30 msgid "Server name" msgstr "Server name" -#: config/fieldvars.php:25 +#: config/fieldvars.php:23 msgid "Method" msgstr "Method" -#: config/fieldvars.php:28 +#: config/fieldvars.php:25 index.php:52 +msgid "Password" +msgstr "Password" + +#: config/fieldvars.php:27 msgid "Directory with SSH key pair" msgstr "Directory with SSH key pair" -#: config/fieldvars.php:30 +#: config/fieldvars.php:29 +msgid "Use encrypted FTP (FTPS)" +msgstr "Use encrypted FTP (FTPS)" + +#: config/fieldvars.php:32 msgid "Configuration directories" msgstr "Configuration directories" -#: config/fieldvars.php:31 +#: config/fieldvars.php:34 +msgid "Nagios configuration files and directories" +msgstr "Nagios configuration files and directories" + +#: config/fieldvars.php:35 msgid "Base directory" msgstr "Base directory" -#: config/fieldvars.php:32 +#: config/fieldvars.php:36 msgid "Host directory" msgstr "Host directory" -#: config/fieldvars.php:33 +#: config/fieldvars.php:37 msgid "Service directory" msgstr "Service directory" -#: config/fieldvars.php:34 +#: config/fieldvars.php:38 msgid "Backup directory" msgstr "Backup directory" -#: config/fieldvars.php:35 +#: config/fieldvars.php:39 msgid "Host backup directory" msgstr "Host backup directory" -#: config/fieldvars.php:36 +#: config/fieldvars.php:41 msgid "Service backup directory" msgstr "Service backup directory" -#: config/fieldvars.php:37 +#: config/fieldvars.php:42 msgid "Picture base directory" msgstr "Picture base directory" -#: config/fieldvars.php:43 +#: config/fieldvars.php:47 +msgid "Nagios cgi file" +msgstr "Nagios cgi file" + +#: config/fieldvars.php:48 +msgid "Nagios resource file" +msgstr "Nagios resource file" + +#: config/fieldvars.php:50 msgid "Use common domain" msgstr "Use common domain" -#: config/fieldvars.php:44 +#: config/fieldvars.php:52 msgid "Decode UTF8 data in config files" msgstr "Decode UTF8 data in config files" -#: config/fieldvars.php:45 +#: config/fieldvars.php:53 msgid "Access key holes" msgstr "Access keyholes" # user.php -#: config/fieldvars.php:46 +#: config/fieldvars.php:54 msgid "Access keys" msgstr "Access keys" -#: config/fieldvars.php:48 +#: config/fieldvars.php:56 msgid "Registered" msgstr "Registered" -#: config/fieldvars.php:52 +#: config/fieldvars.php:60 msgid "Function" msgstr "Function" -#: config/fieldvars.php:53 +#: config/fieldvars.php:61 msgid "Marked" msgstr "Marked" -#: config/fieldvars.php:55 +#: config/fieldvars.php:63 msgid "Add" msgstr "Add" -#: config/fieldvars.php:56 -msgid "Formcheck" +#: config/fieldvars.php:64 +msgid "Form check" msgstr "Form check" -#: config/fieldvars.php:57 +#: config/fieldvars.php:65 msgid "Secure question" msgstr "Secure question" -#: config/fieldvars.php:58 -#: functions/content_class.php:241 -#: functions/content_class.php:242 +#: config/fieldvars.php:66 functions/NagContentClass.php:172 +#: functions/NagContentClass.php:177 msgid "Yes" msgstr "Yes" -#: config/fieldvars.php:59 -#: functions/content_class.php:241 -#: functions/content_class.php:242 +#: config/fieldvars.php:67 functions/NagContentClass.php:170 +#: functions/NagContentClass.php:175 msgid "No" msgstr "No" -#: config/fieldvars.php:60 +#: config/fieldvars.php:68 msgid "Time" msgstr "Time" -#: config/fieldvars.php:61 +#: config/fieldvars.php:69 msgid "User" msgstr "User" -#: config/fieldvars.php:62 -msgid "IP" +#: config/fieldvars.php:70 +msgid "IP Address" msgstr "IP Address" -#: config/fieldvars.php:63 -#: functions/import_class.php:318 -#: functions/import_class.php:323 -#: functions/import_class.php:635 -#: functions/import_class.php:636 -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: config/fieldvars.php:71 functions/NagImportClass.php:350 +#: functions/NagImportClass.php:355 functions/NagImportClass.php:419 +#: functions/NagImportClass.php:425 functions/NagImportClass.php:432 +#: functions/NagImportClass.php:437 msgid "Entry" msgstr "Entry" -#: config/fieldvars.php:64 +#: config/fieldvars.php:72 msgid "From" msgstr "From" -#: config/fieldvars.php:65 +#: config/fieldvars.php:73 msgid "To" msgstr "To" -#: config/fieldvars.php:66 +#: config/fieldvars.php:74 msgid "Delete log entries" msgstr "Delete log entries" -#: config/fieldvars.php:67 -#: config/fieldvars.php:80 -#: config/fieldvars.php:168 +#: config/fieldvars.php:75 config/fieldvars.php:88 config/fieldvars.php:184 msgid "Copy" msgstr "Copy" -#: config/fieldvars.php:70 +#: config/fieldvars.php:78 msgid "Confirm password" msgstr "Confirm password" # password.php -#: config/fieldvars.php:71 +#: config/fieldvars.php:79 msgid "Old password" msgstr "Old password" -#: config/fieldvars.php:72 -#: config/fieldvars.php:281 +#: config/fieldvars.php:80 config/fieldvars.php:320 msgid "New password" msgstr "New password" -#: config/fieldvars.php:73 +#: config/fieldvars.php:81 msgid "Change password" msgstr "Change password" -#: config/fieldvars.php:74 +#: config/fieldvars.php:82 msgid "Menu page" msgstr "Menu page" -#: config/fieldvars.php:75 +#: config/fieldvars.php:83 msgid "Search string" msgstr "Search string" -#: config/fieldvars.php:78 -#: config/fieldvars.php:172 +#: config/fieldvars.php:86 config/fieldvars.php:188 msgid "Write config file" msgstr "Write config file" -#: config/fieldvars.php:81 +#: config/fieldvars.php:89 msgid "Command" msgstr "Command" -#: config/fieldvars.php:83 +#: config/fieldvars.php:91 msgid "Command type" msgstr "Command type" -#: config/fieldvars.php:85 +#: config/fieldvars.php:93 msgid "Exclude" msgstr "Exclude" -#: config/fieldvars.php:86 +#: config/fieldvars.php:94 msgid "Include" msgstr "Include" -#: config/fieldvars.php:87 +#: config/fieldvars.php:95 msgid "Time definitions" msgstr "Time definitions" -#: config/fieldvars.php:88 +#: config/fieldvars.php:96 msgid "Weekday" msgstr "Weekday" -#: config/fieldvars.php:89 +#: config/fieldvars.php:97 msgid "Time range" msgstr "Time range" -#: config/fieldvars.php:90 +#: config/fieldvars.php:98 msgid "Time definition" msgstr "Time definition" -#: config/fieldvars.php:91 +#: config/fieldvars.php:99 msgid "Insert" msgstr "Insert" -#: config/fieldvars.php:92 +#: config/fieldvars.php:100 msgid "Modify selection" msgstr "Modify selection" -#: config/fieldvars.php:95 +#: config/fieldvars.php:103 +msgid "Minimum importance" +msgstr "Minimum importance" + +#: config/fieldvars.php:104 msgid "Time period hosts" msgstr "Time period hosts" -#: config/fieldvars.php:96 +#: config/fieldvars.php:105 msgid "Time period services" msgstr "Time period services" -#: config/fieldvars.php:97 +#: config/fieldvars.php:106 msgid "Host options" msgstr "Host options" -#: config/fieldvars.php:98 +#: config/fieldvars.php:107 msgid "Service options" msgstr "Service options" -#: config/fieldvars.php:99 +#: config/fieldvars.php:108 msgid "Host command" msgstr "Host command" -#: config/fieldvars.php:100 +#: config/fieldvars.php:109 msgid "Service command" msgstr "Service command" -#: config/fieldvars.php:101 +#: config/fieldvars.php:110 msgid "EMail address" msgstr "E-Mail address" -#: config/fieldvars.php:102 +#: config/fieldvars.php:111 msgid "Pager number" msgstr "Pager number" -#: config/fieldvars.php:103 +#: config/fieldvars.php:112 msgid "Addon address" msgstr "Addon address" -#: config/fieldvars.php:104 +#: config/fieldvars.php:113 msgid "Host notif. enable" msgstr "Host notif. enable" -#: config/fieldvars.php:105 +#: config/fieldvars.php:114 msgid "Service notif. enable" msgstr "Service notif. enable" -#: config/fieldvars.php:106 +#: config/fieldvars.php:115 msgid "Can submit commands" msgstr "Can submit commands" -#: config/fieldvars.php:107 +#: config/fieldvars.php:116 msgid "Retain status info" msgstr "Retain status info" -#: config/fieldvars.php:108 -msgid "Retain nonstatus info" +#: config/fieldvars.php:117 +msgid "Retain non-status info" msgstr "Retain non-status info" # contactgroups.php -#: config/fieldvars.php:109 +#: config/fieldvars.php:118 msgid "Members" msgstr "Members" -#: config/fieldvars.php:110 +#: config/fieldvars.php:119 msgid "Group members" msgstr "Group members" -#: config/fieldvars.php:111 +#: config/fieldvars.php:120 msgid "Common settings" msgstr "Common settings" -#: config/fieldvars.php:112 +#: config/fieldvars.php:121 msgid "Service settings" msgstr "Service settings" -#: config/fieldvars.php:113 +#: config/fieldvars.php:123 msgid "Add this host configuration to existing service definitions" msgstr "Add this host configuration to existing service definitions" -#: config/fieldvars.php:115 +#: config/fieldvars.php:125 msgid "Parents" msgstr "Parents" -#: config/fieldvars.php:117 +#: config/fieldvars.php:126 +msgid "Parent services" +msgstr "Parent services" + +#: config/fieldvars.php:128 msgid "Check command" msgstr "Check command" -#: config/fieldvars.php:118 +#: config/fieldvars.php:129 msgid "Command view" msgstr "Command view" -#: config/fieldvars.php:119 +#: config/fieldvars.php:130 msgid "Additional templates" msgstr "Additional templates" -#: config/fieldvars.php:120 +#: config/fieldvars.php:131 msgid "Check settings" msgstr "Check settings" -#: config/fieldvars.php:121 +#: config/fieldvars.php:132 msgid "Initial state" msgstr "Initial state" -#: config/fieldvars.php:122 +#: config/fieldvars.php:133 msgid "Retry interval" msgstr "Retry interval" -#: config/fieldvars.php:123 +#: config/fieldvars.php:134 msgid "Max check attempts" msgstr "Max. check attempts" -#: config/fieldvars.php:124 +#: config/fieldvars.php:135 msgid "Check interval" msgstr "Check interval" -#: config/fieldvars.php:125 +#: config/fieldvars.php:136 msgid "Active checks enabled" msgstr "Active checks enabled" -#: config/fieldvars.php:126 +#: config/fieldvars.php:137 msgid "Passive checks enabled" msgstr "Passive checks enabled" -#: config/fieldvars.php:127 +#: config/fieldvars.php:138 msgid "Check period" msgstr "Check period" -#: config/fieldvars.php:128 +#: config/fieldvars.php:139 msgid "Freshness treshold" msgstr "Freshness threshold" -#: config/fieldvars.php:129 +#: config/fieldvars.php:140 msgid "Check freshness" msgstr "Check freshness" -#: config/fieldvars.php:130 +#: config/fieldvars.php:141 msgid "Obsess over host" msgstr "Obsess over host" -#: config/fieldvars.php:131 +#: config/fieldvars.php:142 msgid "Obsess over service" msgstr "Obsess over service" -#: config/fieldvars.php:132 +#: config/fieldvars.php:143 msgid "Event handler" msgstr "Event handler" -#: config/fieldvars.php:133 +#: config/fieldvars.php:144 msgid "Event handler enabled" msgstr "Event handler enabled" -#: config/fieldvars.php:134 +#: config/fieldvars.php:145 msgid "Low flap threshold" msgstr "Low flap threshold" -#: config/fieldvars.php:135 +#: config/fieldvars.php:146 msgid "High flap threshold" msgstr "High flap threshold" -#: config/fieldvars.php:136 +#: config/fieldvars.php:147 msgid "Flap detection enabled" msgstr "Flap detection enabled" -#: config/fieldvars.php:137 +#: config/fieldvars.php:148 msgid "Flap detection options" msgstr "Flap detection options" -#: config/fieldvars.php:138 +#: config/fieldvars.php:150 msgid "Retain status information" msgstr "Retain status information" -#: config/fieldvars.php:139 -msgid "Retain nostatus information" +#: config/fieldvars.php:152 +msgid "Retain non-status information" msgstr "Retain non-status information" -#: config/fieldvars.php:140 +#: config/fieldvars.php:153 msgid "Process perf data" msgstr "Process perf data" -#: config/fieldvars.php:141 +#: config/fieldvars.php:154 msgid "Alarm settings" msgstr "Alarm settings" -#: config/fieldvars.php:142 +#: config/fieldvars.php:155 msgid "Contacts" msgstr "Contacts" -#: config/fieldvars.php:144 +#: config/fieldvars.php:157 msgid "Notification period" msgstr "Notification period" -#: config/fieldvars.php:145 +#: config/fieldvars.php:158 msgid "Notification options" msgstr "Notification options" -#: config/fieldvars.php:146 +#: config/fieldvars.php:159 msgid "Notification interval" msgstr "Notification interval" -#: config/fieldvars.php:147 +#: config/fieldvars.php:161 msgid "First notification delay" msgstr "First notification delay" -#: config/fieldvars.php:148 +#: config/fieldvars.php:162 msgid "Notification enabled" msgstr "Notification enabled" -#: config/fieldvars.php:149 +#: config/fieldvars.php:163 +msgid "Importance" +msgstr "Importance" + +#: config/fieldvars.php:164 msgid "Stalking options" msgstr "Stalking options" -#: config/fieldvars.php:150 +#: config/fieldvars.php:165 msgid "Addon settings" msgstr "Addon settings" -#: config/fieldvars.php:152 +#: config/fieldvars.php:167 msgid "VRML image" msgstr "VRML image" -#: config/fieldvars.php:153 +#: config/fieldvars.php:168 msgid "Notes URL" msgstr "Notes URL" -#: config/fieldvars.php:154 +#: config/fieldvars.php:169 msgid "Status image" msgstr "Status image" -#: config/fieldvars.php:155 +#: config/fieldvars.php:170 msgid "Icon image" msgstr "Icon image" -#: config/fieldvars.php:156 +#: config/fieldvars.php:171 msgid "Action URL" msgstr "Action URL" -#: config/fieldvars.php:157 +#: config/fieldvars.php:172 msgid "2D coords" msgstr "2D coords" -#: config/fieldvars.php:158 +#: config/fieldvars.php:173 msgid "3D coords" msgstr "3D coords" -#: config/fieldvars.php:159 +#: config/fieldvars.php:174 msgid "Icon image ALT text" msgstr "Icon image ALT text" -#: config/fieldvars.php:160 +#: config/fieldvars.php:175 msgid "standard" msgstr "standard" -#: config/fieldvars.php:161 +#: config/fieldvars.php:176 msgid "on" msgstr "on" -#: config/fieldvars.php:162 +#: config/fieldvars.php:177 msgid "off" msgstr "off" -#: config/fieldvars.php:163 +#: config/fieldvars.php:178 msgid "skip" msgstr "skip" -#: config/fieldvars.php:164 +#: config/fieldvars.php:180 msgid "Free variable definitions" msgstr "Free variable definitions" -#: config/fieldvars.php:165 +#: config/fieldvars.php:181 msgid "Variable name" msgstr "Variable name" -#: config/fieldvars.php:166 +#: config/fieldvars.php:182 msgid "Variable value" msgstr "Variable value" -#: config/fieldvars.php:169 +#: config/fieldvars.php:185 msgid "Activate" msgstr "Activate" -#: config/fieldvars.php:170 +#: config/fieldvars.php:186 msgid "Deactivate" msgstr "Deactivate" -#: config/fieldvars.php:173 +#: config/fieldvars.php:190 msgid "Do you really want to delete this database entry:" msgstr "Do you really want to delete this database entry:" -#: config/fieldvars.php:174 +#: config/fieldvars.php:192 msgid "Do you really want to delete all marked entries?" msgstr "Do you really want to delete all marked entries?" -#: config/fieldvars.php:175 +#: config/fieldvars.php:194 msgid "Mark all shown datasets" msgstr "Mark all shown datasets" -#: config/fieldvars.php:176 +#: config/fieldvars.php:195 msgid "File" msgstr "File" -#: config/fieldvars.php:177 +#: config/fieldvars.php:196 msgid "Write all config files" msgstr "Write all config files" -#: config/fieldvars.php:178 +#: config/fieldvars.php:197 msgid "Address" msgstr "Address" -#: config/fieldvars.php:179 +#: config/fieldvars.php:198 msgid "Display name" msgstr "Display name" -#: config/fieldvars.php:180 -msgid "Use this configuration as template" +#: config/fieldvars.php:200 +msgid "Use this configuration as a template" msgstr "Use this configuration as a template" -#: config/fieldvars.php:181 +#: config/fieldvars.php:201 msgid "Generic name" msgstr "Generic name" -#: config/fieldvars.php:185 +#: config/fieldvars.php:208 msgid "Please check at least one option from:" msgstr "Please check at least one option from:" -#: config/fieldvars.php:186 +#: config/fieldvars.php:209 msgid "Host group name" msgstr "Host group name" -#: config/fieldvars.php:187 +#: config/fieldvars.php:210 msgid "Host group members" msgstr "Host group members" -#: config/fieldvars.php:191 +#: config/fieldvars.php:214 msgid "Is volatile" msgstr "Is volatile" -#: config/fieldvars.php:192 +#: config/fieldvars.php:215 msgid "Parallelize checks" msgstr "Parallelize checks" -#: config/fieldvars.php:193 +#: config/fieldvars.php:216 msgid "Config name filter" msgstr "Config name filter" -#: config/fieldvars.php:195 +#: config/fieldvars.php:218 msgid "Import directory" msgstr "Import directory" -#: config/fieldvars.php:196 +#: config/fieldvars.php:220 msgid "Please insert a variable name and a variable definition" msgstr "Please insert a variable name and a variable definition" -#: config/fieldvars.php:197 -#: config/fieldvars.php:201 -#: config/fieldvars.php:233 +#: config/fieldvars.php:222 config/fieldvars.php:229 config/fieldvars.php:269 msgid "Warning:" msgstr "Warning:" -#: config/fieldvars.php:197 -msgid "You have not filled in some required fields!

If this values are set by a template, you can save anyway - otherwise you will get an invalid configuration!" -msgstr "You have not filled in some required fields!

If this values are set by a template, you can save anyway - otherwise you will get an invalid configuration!" +#: config/fieldvars.php:222 +msgid "" +"You have not filled in some required fields!

If this values are set " +"by a template, you can save anyway - otherwise you will get an invalid " +"configuration!" +msgstr "" +"You have not filled in some required fields!

If this values are set " +"by a template, you can save anyway - otherwise you will get an invalid " +"configuration!" -#: config/fieldvars.php:199 -msgid "Nagios base directory" -msgstr "Nagios base directory" - -#: config/fieldvars.php:200 +#: config/fieldvars.php:227 msgid "Write config" msgstr "Write config" -#: config/fieldvars.php:201 -msgid "You have not filled in all command arguments (ARGx) for your selected command!

If this arguments are optional, you can save anyway - otherwise you will get an invalid configuration!" -msgstr "You have not filled in all command arguments (ARGx) for your selected command!

If this arguments are optional, you can save anyway - otherwise you will get an invalid configuration!" +#: config/fieldvars.php:229 +msgid "" +"You have not filled in all command arguments (ARGx) for your selected " +"command!

If this arguments are optional, you can save anyway - " +"otherwise you will get an invalid configuration!" +msgstr "" +"You have not filled in all command arguments (ARGx) for your selected " +"command!

If this arguments are optional, you can save anyway - " +"otherwise you will get an invalid configuration!" -#: config/fieldvars.php:202 +#: config/fieldvars.php:232 msgid "Service group members" msgstr "Service group members" -#: config/fieldvars.php:203 +#: config/fieldvars.php:233 msgid "Service group name" msgstr "Service group name" -#: config/fieldvars.php:206 +#: config/fieldvars.php:236 msgid "Hostgroups" msgstr "Host groups" -#: config/fieldvars.php:207 +#: config/fieldvars.php:237 msgid "Inherit parents" msgstr "Inherit parents" -#: config/fieldvars.php:208 +#: config/fieldvars.php:239 msgid "Execution failure criteria" msgstr "Execution failure criteria" -#: config/fieldvars.php:209 +#: config/fieldvars.php:241 msgid "Nofification failure criteria" msgstr "Notification failure criteria" -#: config/fieldvars.php:210 +#: config/fieldvars.php:242 msgid "Dependency period" msgstr "Dependency period" -#: config/fieldvars.php:211 +#: config/fieldvars.php:243 msgid "Escalation period" msgstr "Escalation period" -#: config/fieldvars.php:212 +#: config/fieldvars.php:244 msgid "Escalation options" msgstr "Escalation options" -#: config/fieldvars.php:213 +#: config/fieldvars.php:245 msgid "First notification" msgstr "First notification" -#: config/fieldvars.php:214 +#: config/fieldvars.php:246 msgid "Last notification" msgstr "Last notification" -#: config/fieldvars.php:217 +#: config/fieldvars.php:250 msgid "Dependent servicegroups" msgstr "Dependent servicegroups" -#: config/fieldvars.php:218 +#: config/fieldvars.php:251 msgid "Help" msgstr "Help" -#: config/fieldvars.php:219 +#: config/fieldvars.php:252 msgid "Calendar" msgstr "Calendar" -#: config/fieldvars.php:220 +#: config/fieldvars.php:253 msgid "Group name" msgstr "Group name" -#: config/fieldvars.php:221 +#: config/fieldvars.php:254 msgid "Users" msgstr "Users" -#: config/fieldvars.php:222 +#: config/fieldvars.php:255 msgid "Access group" msgstr "Access group" -#: config/fieldvars.php:223 +#: config/fieldvars.php:256 msgid "User definitions" msgstr "User definitions" -#: config/fieldvars.php:224 +#: config/fieldvars.php:257 msgid "User name" msgstr "User name" -#: config/fieldvars.php:225 +#: config/fieldvars.php:258 msgid "User rights" msgstr "User rights" -#: config/fieldvars.php:226 +#: config/fieldvars.php:260 msgid "Object access restrictions" msgstr "Object access restrictions" -#: config/fieldvars.php:227 +#: config/fieldvars.php:262 msgid "Enable group administration" msgstr "Enable group administration" -#: config/fieldvars.php:228 +#: config/fieldvars.php:263 msgid "Show relation data" msgstr "Show relation data" -#: config/fieldvars.php:229 +#: config/fieldvars.php:264 msgid "Hide relation data" msgstr "Hide relation data" -#: config/fieldvars.php:231 +#: config/fieldvars.php:266 msgid "User language" msgstr "User language" -#: config/fieldvars.php:232 +#: config/fieldvars.php:267 msgid "Standard domain" msgstr "Standard domain" -#: config/fieldvars.php:233 -msgid "The associated services must be additionally written to the files. Only writing the host configuration is not sufficient because the modification is stored inside the service files!" -msgstr "The associated services must be additionally written to the files. Only writing the host configuration is not sufficient because the modification is stored inside the service files!" +#: config/fieldvars.php:269 +msgid "" +"The associated services must be additionally written to the files. Only " +"writing the host configuration is not sufficient because the modification is " +"stored inside the service files!" +msgstr "" +"The associated services must be additionally written to the files. Only " +"writing the host configuration is not sufficient because the modification is " +"stored inside the service files!" -#: config/fieldvars.php:235 +#: config/fieldvars.php:273 msgid "Monday" msgstr "Monday" -#: config/fieldvars.php:236 +#: config/fieldvars.php:274 msgid "Tuesday" msgstr "Tuesday" -#: config/fieldvars.php:237 +#: config/fieldvars.php:275 msgid "Wednesday" msgstr "Wednesday" -#: config/fieldvars.php:238 +#: config/fieldvars.php:276 msgid "Thursday" msgstr "Thursday" -#: config/fieldvars.php:239 +#: config/fieldvars.php:277 msgid "Friday" msgstr "Friday" -#: config/fieldvars.php:240 +#: config/fieldvars.php:278 msgid "Saturday" msgstr "Saturday" -#: config/fieldvars.php:241 +#: config/fieldvars.php:279 msgid "Sunday" msgstr "Sunday" -#: config/fieldvars.php:252 +#: config/fieldvars.php:291 msgid "Main page" msgstr "Main page" -#: config/fieldvars.php:253 +#: config/fieldvars.php:292 msgid "Supervision" msgstr "Supervision" -#: config/fieldvars.php:256 +#: config/fieldvars.php:295 msgid "Commands" msgstr "Commands" -#: config/fieldvars.php:257 +#: config/fieldvars.php:296 msgid "Specialties" msgstr "Specialties" -#: config/fieldvars.php:258 +#: config/fieldvars.php:297 msgid "Tools" msgstr "Tools" -#: config/fieldvars.php:269 +#: config/fieldvars.php:308 msgid "Service dependency" msgstr "Service dependency" -#: config/fieldvars.php:270 +#: config/fieldvars.php:309 msgid "Service escalation" msgstr "Service escalation" -#: config/fieldvars.php:271 +#: config/fieldvars.php:310 msgid "Host dependency" msgstr "Host dependency" -#: config/fieldvars.php:272 +#: config/fieldvars.php:311 msgid "Host escalation" msgstr "Host escalation" -#: config/fieldvars.php:273 +#: config/fieldvars.php:312 msgid "Extended Host" msgstr "Extended Host" -#: config/fieldvars.php:274 +#: config/fieldvars.php:313 msgid "Extended Service" msgstr "Extended Service" -#: config/fieldvars.php:275 +#: config/fieldvars.php:314 msgid "Data import" msgstr "Data import" -#: config/fieldvars.php:278 +#: config/fieldvars.php:317 msgid "User admin" msgstr "User admin" -#: config/fieldvars.php:279 +#: config/fieldvars.php:318 msgid "Group admin" msgstr "Group admin" -#: config/fieldvars.php:280 +#: config/fieldvars.php:319 msgid "Nagios control" msgstr "Nagios control" -#: config/fieldvars.php:282 +#: config/fieldvars.php:321 msgid "Logbook" msgstr "Logbook" -#: config/fieldvars.php:283 +#: config/fieldvars.php:322 msgid "Nagios config" msgstr "Nagios config" -#: config/fieldvars.php:284 +#: config/fieldvars.php:323 msgid "Settings" msgstr "Settings" -#: config/fieldvars.php:285 +#: config/fieldvars.php:324 msgid "Definitions" msgstr "Definitions" -#: config/fieldvars.php:286 +#: config/fieldvars.php:325 msgid "CGI config" msgstr "CGI config" -#: config/fieldvars.php:287 +#: config/fieldvars.php:326 msgid "Menu access" msgstr "Menu access" -#: config/fieldvars.php:288 +#: config/fieldvars.php:327 msgid "Domains" msgstr "Domains" -#: config/fieldvars.php:292 +#: config/fieldvars.php:331 msgid "Help editor" msgstr "Help editor" # fieldvars.php -#: config/fieldvars.php:293 +#: config/fieldvars.php:332 msgid "Data domains" msgstr "Data domains" -#: config/fieldvars.php:294 +#: config/fieldvars.php:333 msgid "Config targets" msgstr "Config targets" -#: config/fieldvars.php:295 +#: config/fieldvars.php:334 msgid "Support" msgstr "Support" -# config_class.php -#: functions/config_class.php:164 -#: functions/config_class.php:168 -msgid "Warning: configuration file is out of date!" -msgstr "Warning: configuration file is out of date!" +#: functions/MysqliDbClass.php:291 +msgid "Missing server connection parameter!" +msgstr "Missing server connection parameter!" -#: functions/config_class.php:173 -#: functions/config_class.php:729 -msgid "Warning: no configuration target defined!" -msgstr "Warning: no configuration target defined!" +#: functions/MysqliDbClass.php:310 +msgid "Connection to the database server has failed by reason:" +msgstr "Connection to the database server has failed by reason:" -#: functions/config_class.php:340 -msgid "Cannot backup and delete the old configuration file (check the permissions)!" -msgstr "Cannot backup and delete the old configuration file (check the permissions)!" +#: functions/MysqliDbClass.php:338 +msgid "Missing database connection parameter!" +msgstr "Missing database connection parameter!" -#: functions/config_class.php:358 -msgid "Cannot backup the old configuration file because the permissions are wrong (remote FTP)!" -msgstr "Cannot backup the old configuration file because the permissions are incorrect (remote FTP)!" +#: functions/MysqliDbClass.php:347 +msgid "Connection to the database has failed by reason:" +msgstr "Connection to the database has failed by reason:" -#: functions/config_class.php:380 -msgid "Cannot backup the old configuration file because the permissions are wrong (remote SFTP)!" -msgstr "Cannot backup the old configuration file because the permissions are wrong (remote SSH/SFTP)!" - -#: functions/config_class.php:411 -msgid "Cannot delete the file (wrong permissions)!" -msgstr "Cannot delete the file (wrong permissions)!" - -#: functions/config_class.php:415 -msgid "Cannot delete the file (file does not exist)!" -msgstr "Cannot delete the file (file does not exist)!" - -#: functions/config_class.php:432 -msgid "Cannot delete file because the permissions are wrong (remote FTP)!" -msgstr "Cannot delete file because the permissions are incorrect (remote FTP)!" - -#: functions/config_class.php:438 -msgid "Cannot delete file because it does not exists (remote FTP)!" -msgstr "Cannot delete file because it does not exists (remote FTP)!" - -#: functions/config_class.php:451 -msgid "Cannot delete file because the permissions are wrong (remote SFTP)!" -msgstr "Cannot delete file because the permissions are wrong (remote SSH/SFTP)!" - -#: functions/config_class.php:454 -msgid "Cannot delete file because it does not exists (remote SFTP)!" -msgstr "Cannot delete file because it does not exists (remote SSH/SFTP)!" - -#: functions/config_class.php:488 -msgid "Cannot get the configuration file (FTP connection failed)!" -msgstr "Cannot get the configuration file (FTP connection failed)!" - -#: functions/config_class.php:499 -msgid "Cannot write the configuration file (FTP connection failed)!" -msgstr "Cannot write the configuration file (FTP connection failed)!" - -#: functions/config_class.php:518 -msgid "Cannot get the configuration file (SSH connection failed)!" -msgstr "Cannot get the configuration file (SSH connection failed)!" - -#: functions/config_class.php:524 -msgid "Cannot get the configuration file (remote file does not exist)!" -msgstr "Cannot get the configuration file (remote file does not exist)!" - -#: functions/config_class.php:533 -msgid "Cannot write the configuration file (SSH connection failed)!" -msgstr "Cannot write the configuration file (SSH connection failed)!" - -#: functions/config_class.php:563 -#: functions/config_class.php:761 -msgid "It is not possible to write config files directly from the common domain!" -msgstr "It is not possible to write config files directly from the common domain!" - -#: functions/config_class.php:929 -msgid "Writing of the configuration failed - no dataset, not activated dataset found or you do not have write permission." -msgstr "Writing of the configuration failed - no dataset, not activated dataset found or you do not have write permission." - -#: functions/config_class.php:1046 -msgid "Configuration write failed (FTP connection failed):" -msgstr "Configuration write failed (FTP connection failed):" - -#: functions/config_class.php:1047 -#: functions/config_class.php:1111 -msgid "Cannot open/overwrite the configuration file (FTP connection failed)!" -msgstr "Cannot open/overwrite the configuration file (FTP connection failed)!" - -#: functions/config_class.php:1133 -msgid "Cannot open/overwrite the configuration file (remote SFTP)!" -msgstr "Cannot open/overwrite the configuration file (remote SSH/SFTP)!" - -#: functions/config_class.php:1608 -#: functions/config_class.php:1609 -#: functions/config_class.php:1652 -#: functions/config_class.php:1653 -msgid "Connection to remote system failed (SSH2 connection):" -msgstr "Connection to remote system failed (SSH2 connection):" - -#: functions/config_class.php:1624 -#: functions/config_class.php:1625 -msgid "SSH public key does not exist or is not readable" -msgstr "SSH public key does not exist or is not readable" - -#: functions/config_class.php:1629 -#: functions/config_class.php:1630 -msgid "SSH private key does not exist or is not readable" -msgstr "SSH private key does not exist or is not readable" - -#: functions/config_class.php:1733 -#: functions/config_class.php:1734 +#: functions/NagConfigClass.php:336 functions/NagConfigClass.php:338 msgid "Connection to remote system failed (FTP connection):" msgstr "Connection to remote system failed (FTP connection):" +#: functions/NagConfigClass.php:387 functions/NagConfigClass.php:389 +msgid "SSH public key does not exist or is not readable" +msgstr "SSH public key does not exist or is not readable" + +#: functions/NagConfigClass.php:394 functions/NagConfigClass.php:396 +msgid "SSH private key does not exist or is not readable" +msgstr "SSH private key does not exist or is not readable" + +#: functions/NagConfigClass.php:430 functions/NagConfigClass.php:432 +#: functions/NagConfigClass.php:441 functions/NagConfigClass.php:443 +msgid "Connection to remote system failed (SSH2 connection):" +msgstr "Connection to remote system failed (SSH2 connection):" + +#: functions/NagConfigClass.php:600 +msgid "" +"Cannot backup the old file because the permissions are wrong - destination " +"file: " +msgstr "" +"Cannot backup the old file because the permissions are wrong - destination " +"file: " + +#: functions/NagConfigClass.php:605 +msgid "" +"Cannot backup the old file because the source file is missing - source file: " +msgstr "" +"Cannot backup the old file because the source file is missing - source file: " + +#: functions/NagConfigClass.php:623 +msgid "" +"Cannot backup the old file because the source file is missing (remote FTP) - " +"source file: " +msgstr "" +"Cannot backup the old file because the source file is missing (remote FTP) - " +"source file: " + +#: functions/NagConfigClass.php:629 +msgid "" +"Cannot backup the old file because the permissions are wrong (remote FTP) - " +"destination file: " +msgstr "" +"Cannot backup the old file because the permissions are wrong (remote FTP) - " +"destination file: " + +#: functions/NagConfigClass.php:648 +msgid "" +"Cannot backup the old file because the source file is missing (remote SFTP) " +"- source file: " +msgstr "" +"Cannot backup the old file because the source file is missing (remote SFTP) " +"- source file: " + +#: functions/NagConfigClass.php:654 +msgid "" +"Cannot backup the old file because the permissions are wrong (remote SFTP) - " +"destination file: " +msgstr "" +"Cannot backup the old file because the permissions are wrong (remote SFTP) - " +"destination file: " + +#: functions/NagConfigClass.php:685 +msgid "Cannot delete the file (wrong permissions)!" +msgstr "Cannot delete the file (wrong permissions)!" + +#: functions/NagConfigClass.php:690 +msgid "Cannot delete the file (file does not exist)!" +msgstr "Cannot delete the file (file does not exist)!" + +#: functions/NagConfigClass.php:706 +msgid "Cannot delete file because it does not exists (remote FTP)!" +msgstr "Cannot delete file because it does not exists (remote FTP)!" + +#: functions/NagConfigClass.php:712 +msgid "Cannot delete file because the permissions are incorrect (remote FTP)!" +msgstr "Cannot delete file because the permissions are incorrect (remote FTP)!" + +#: functions/NagConfigClass.php:724 +msgid "Cannot delete file because it does not exists (remote SSH/SFTP)!" +msgstr "Cannot delete file because it does not exists (remote SSH/SFTP)!" + +#: functions/NagConfigClass.php:730 +msgid "" +"Cannot delete file because the permissions are incorrect (remote SSH/SFTP)!" +msgstr "" +"Cannot delete file because the permissions are incorrect (remote SSH/SFTP)!" + +#: functions/NagConfigClass.php:822 functions/NagConfigClass.php:846 +msgid "" +"Cannot get the remote file (it does not exist or is not readable) - remote " +"file: " +msgstr "" +"Cannot get the remote file (it does not exist or is not readable) - remote " +"file: " + +#: functions/NagConfigClass.php:831 +msgid "" +"Cannot write the remote file (remote file is not writeable)- remote file: " +msgstr "" +"Cannot write the remote file (remote file is not writeable)- remote file: " + +#: functions/NagConfigClass.php:849 +msgid "Remote file is not readable - remote file: " +msgstr "Remote file is not readable - remote file: " + +#: functions/NagConfigClass.php:860 +msgid "" +"Cannot write a remote file (remote file is not writeable) - remote file: " +msgstr "" +"Cannot write a remote file (remote file is not writeable) - remote file: " + +#: functions/NagConfigClass.php:866 +msgid "" +"Cannot copy a local file to remote because the local file does not exist or " +"is not readable - local file: " +msgstr "" +"Cannot copy a local file to remote because the local file does not exist or " +"is not readable - local file: " + # contacts.php -#: functions/config_class.php:1867 +#: functions/NagConfigClass.php:894 msgid "Could not open directory" msgstr "Could not open directory" -#: functions/content_class.php:274 -#: functions/content_class.php:278 +# config_class.php +#: functions/NagConfigClass.php:1003 functions/NagConfigClass.php:1006 +msgid "Warning: configuration file is out of date!" +msgstr "Warning: configuration file is out of date!" + +#: functions/NagConfigClass.php:1010 functions/NagConfigClass.php:1042 +#: functions/NagConfigClass.php:1108 +msgid "Warning: no configuration target defined!" +msgstr "Warning: no configuration target defined!" + +#: functions/NagConfigClass.php:1030 functions/NagConfigClass.php:1076 +msgid "" +"It is not possible to write config files directly from the common domain!" +msgstr "" +"It is not possible to write config files directly from the common domain!" + +#: functions/NagConfigClass.php:2069 +msgid "Cannot open/overwrite the configuration file (FTP connection failed)!" +msgstr "Cannot open/overwrite the configuration file (FTP connection failed)!" + +#: functions/NagConfigClass.php:2091 +msgid "Cannot open/overwrite the configuration file (remote SFTP)!" +msgstr "Cannot open/overwrite the configuration file (remote SSH/SFTP)!" + +#: functions/NagContentClass.php:251 msgid "out-of-date" msgstr "out-of-date" -#: functions/content_class.php:275 +#: functions/NagContentClass.php:253 msgid "no target" msgstr "no target" -#: functions/content_class.php:276 -#: functions/content_class.php:277 +#: functions/NagContentClass.php:256 functions/NagContentClass.php:259 msgid "missed" msgstr "missed" -#: functions/content_class.php:279 +#: functions/NagContentClass.php:262 install/functions/NagInstallClass.php:479 msgid "up-to-date" msgstr "up-to-date" -#: functions/content_class.php:351 +#: functions/NagContentClass.php:355 msgid "Last database update:" msgstr "Last database update:" -#: functions/content_class.php:354 +#: functions/NagContentClass.php:359 msgid "Last file change of the configuration target " msgstr "Last file change of the configuration target " -# data_class.php -#: functions/data_class.php:116 -#: functions/data_class.php:140 -msgid "Delete failed because a database error:" -msgstr "Delete failed due to a database error:" - -#: functions/data_class.php:119 -#: functions/data_class.php:149 -#: functions/data_class.php:158 -msgid "No data deleted. Probably the dataset does not exist or it is protected from delete." -msgstr "No data deleted. The dataset probably does not exist or is protected from deletion." - -#: functions/data_class.php:123 -msgid "Delete dataset id:" -msgstr "Delete dataset id:" - -#: functions/data_class.php:123 -msgid "- from table:" -msgstr "- from table:" - -#: functions/data_class.php:123 -#: functions/data_class.php:153 -#: functions/data_class.php:311 -#: functions/data_class.php:638 -#: functions/data_class.php:703 -msgid "- with affected rows:" -msgstr "- with affected rows:" - -#: functions/data_class.php:153 -#: functions/data_class.php:311 -msgid "Delete data from table:" -msgstr "Delete data from table:" - -#: functions/data_class.php:306 -msgid "No data deleted. Probably the dataset does not exist, it is protected from deletion, you do not have write permission or it has relations to other configurations which cannot be deleted. Use the \"info\" function for detailed informations about relations!" -msgstr "No data deleted. Probably the dataset does not exist, it is protected from deletion, you do not have write permission or it has relations to other configurations which cannot be deleted. Use the \"info\" function for detailed informations about relations!" - -#: functions/data_class.php:316 -msgid "No data deleted. Probably the dataset does not exist, it is protected from deletion or you do not have write permission." -msgstr "No data deleted. Probably the dataset does not exist, it is protected from deletion or you do not have write permission." - -#: functions/data_class.php:553 -#: functions/data_class.php:554 +#: functions/NagDataClass.php:267 functions/NagDataClass.php:269 msgid "Data set copy failed - table [new name]:" msgstr "Data set copy failed - table [new name]:" -#: functions/data_class.php:557 -#: functions/data_class.php:558 +#: functions/NagDataClass.php:273 functions/NagDataClass.php:275 msgid "Data set copied - table [new name]:" msgstr "Data set copied - table [new name]:" -#: functions/data_class.php:576 -#: functions/data_class.php:580 -msgid "No dataset copied. Maybe the dataset does not exist or you do not have write permission." -msgstr "No dataset copied. Maybe the dataset does not exist or you do not have write permission." +#: functions/NagDataClass.php:295 functions/NagDataClass.php:300 +msgid "" +"No dataset copied. Maybe the dataset does not exist or you do not have write " +"permission." +msgstr "" +"No dataset copied. Maybe the dataset does not exist or you do not have write " +"permission." -#: functions/data_class.php:633 -msgid "No dataset activated. Maybe the dataset does not exist, no dataset was selected or you do not have write permission." -msgstr "No dataset activated. Maybe the dataset does not exist, no dataset was selected or you do not have write permission." +# data_class.php +#: functions/NagDataClass.php:393 functions/NagDataClass.php:422 +msgid "Delete failed because a database error:" +msgstr "Delete failed due to a database error:" -#: functions/data_class.php:637 -msgid "Dataset successfully activated. Affected rows:" -msgstr "Dataset successfully activated. Affected rows:" +#: functions/NagDataClass.php:397 +msgid "" +"No data deleted. The dataset probably does not exist or is protected from " +"deletion." +msgstr "" +"No data deleted. The dataset probably does not exist or is protected from " +"deletion." -#: functions/data_class.php:638 -#: functions/data_class.php:703 -msgid "Activate dataset from table:" -msgstr "Activate dataset from table:" +#: functions/NagDataClass.php:403 +msgid "Delete dataset id:" +msgstr "Delete dataset id:" -#: functions/data_class.php:642 -msgid "No dataset activated. Maybe the dataset does not exist or you do not have write permission." -msgstr "No dataset activated. Maybe the dataset does not exist or you do not have write permission." +#: functions/NagDataClass.php:403 +msgid "- from table:" +msgstr "- from table:" -#: functions/data_class.php:698 -msgid "No dataset deactivated. Maybe the dataset does not exist, it is protected from deactivation, no dataset was selected or you do not have write permission. Use the \"info\" function for detailed informations about relations!" -msgstr "No dataset deactivated. Maybe the dataset does not exist, it is protected from deactivation, no dataset was selected or you do not have write permission. Use the \"info\" function for detailed informations about relations!" +#: functions/NagDataClass.php:404 functions/NagDataClass.php:439 +#: functions/NagDataClass.php:614 functions/NagDataClass.php:963 +#: functions/NagDataClass.php:1020 +msgid "- with affected rows:" +msgstr "- with affected rows:" -#: functions/data_class.php:702 -msgid "Dataset successfully deactivated. Affected rows:" -msgstr "Dataset successfully deactivated. Affected rows:" +#: functions/NagDataClass.php:432 functions/NagDataClass.php:443 +msgid "" +"No data deleted. Probably the dataset does not exist or it is protected from " +"delete." +msgstr "" +"No data deleted. The dataset probably does not exist or is protected from " +"deletion." -#: functions/data_class.php:707 -msgid "No dataset deactivated. Maybe the dataset does not exist or you do not have write permission." -msgstr "No dataset deactivated. Maybe the dataset does not exist or you do not have write permission." +#: functions/NagDataClass.php:438 functions/NagDataClass.php:613 +msgid "Deleted data from table:" +msgstr "Deleted data from table:" -#: functions/data_class.php:891 +#: functions/NagDataClass.php:603 +msgid "" +"No data deleted. Probably the dataset does not exist, it is protected from " +"deletion, you do not have write permission or it has relations to other " +"configurations which cannot be deleted. Use the \"info\" function for " +"detailed informations about relations!" +msgstr "" +"No data deleted. Probably the dataset does not exist, it is protected from " +"deletion, you do not have write permission or it has relations to other " +"configurations which cannot be deleted. Use the \"info\" function for " +"detailed informations about relations!" + +#: functions/NagDataClass.php:619 +msgid "" +"No data deleted. Probably the dataset does not exist, it is protected from " +"deletion or you do not have write permission." +msgstr "" +"No data deleted. Probably the dataset does not exist, it is protected from " +"deletion or you do not have write permission." + +#: functions/NagDataClass.php:691 msgid "Relation information for " msgstr "Relation information for " -#: functions/data_class.php:891 +#: functions/NagDataClass.php:692 msgid " of table " msgstr " of table " -#: functions/data_class.php:945 -#: functions/data_class.php:947 -#: functions/data_class.php:951 -#: functions/data_class.php:967 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:747 functions/NagDataClass.php:752 +#: functions/NagDataClass.php:759 functions/NagDataClass.php:778 +#: functions/NagDataClass.php:784 msgid "Relation to " msgstr "Relation to " -#: functions/data_class.php:945 -#: functions/data_class.php:947 -#: functions/data_class.php:951 -#: functions/data_class.php:967 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:748 functions/NagDataClass.php:753 +#: functions/NagDataClass.php:760 functions/NagDataClass.php:779 +#: functions/NagDataClass.php:785 msgid ", entry " msgstr ", entry " -#: functions/data_class.php:945 -#: functions/data_class.php:951 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:749 functions/NagDataClass.php:761 +#: functions/NagDataClass.php:787 msgid "deletion possible" msgstr "deletion possible" -#: functions/data_class.php:947 -#: functions/data_class.php:967 +#: functions/NagDataClass.php:755 functions/NagDataClass.php:781 msgid "deletion not possible" msgstr "deletion not possible" -#: functions/import_class.php:78 -msgid "Unable to get configuration data:" -msgstr "Unable to get configuration data:" +#: functions/NagDataClass.php:954 +msgid "" +"No dataset deactivated. Maybe the dataset does not exist, it is protected " +"from deactivation, no dataset was selected or you do not have write " +"permission. Use the \"info\" function for detailed informations about " +"relations!" +msgstr "" +"No dataset deactivated. Maybe the dataset does not exist, it is protected " +"from deactivation, no dataset was selected or you do not have write " +"permission. Use the \"info\" function for detailed informations about " +"relations!" -#: functions/import_class.php:98 -msgid "Cannot receive the configuration file (FTP connection)!" -msgstr "Cannot receive the configuration file (FTP connection)!" +#: functions/NagDataClass.php:960 +msgid "Dataset successfully deactivated. Affected rows:" +msgstr "Dataset successfully deactivated. Affected rows:" -#: functions/import_class.php:116 -msgid "Cannot receive the configuration file (SSH connection)!" -msgstr "Cannot receive the configuration file (SSH connection)!" +#: functions/NagDataClass.php:962 +msgid "Deactivate dataset from table:" +msgstr "Deactivate dataset from table:" -#: functions/import_class.php:189 +#: functions/NagDataClass.php:967 +msgid "" +"No dataset deactivated. Maybe the dataset does not exist or you do not have " +"write permission." +msgstr "" +"No dataset deactivated. Maybe the dataset does not exist or you do not have " +"write permission." + +#: functions/NagDataClass.php:1013 +msgid "" +"No dataset activated. Maybe the dataset does not exist, no dataset was " +"selected or you do not have write permission." +msgstr "" +"No dataset activated. Maybe the dataset does not exist, no dataset was " +"selected or you do not have write permission." + +#: functions/NagDataClass.php:1017 +msgid "Dataset successfully activated. Affected rows:" +msgstr "Dataset successfully activated. Affected rows:" + +#: functions/NagDataClass.php:1019 +msgid "Activate dataset from table:" +msgstr "Activate dataset from table:" + +#: functions/NagDataClass.php:1024 +msgid "" +"No dataset activated. Maybe the dataset does not exist or you do not have " +"write permission." +msgstr "" +"No dataset activated. Maybe the dataset does not exist or you do not have " +"write permission." + +#: functions/NagImportClass.php:162 msgid "No valid configuration found:" msgstr "No valid configuration found:" -#: functions/import_class.php:198 +#: functions/NagImportClass.php:170 msgid "Import file does not exist or is not readable:" msgstr "Import file does not exist or is not readable:" -#: functions/import_class.php:266 -msgid "Table for import definition" -msgstr "Table for import definition" +#: functions/NagImportClass.php:202 +msgid "Unable to get configuration data:" +msgstr "Unable to get configuration data:" -# mutdialog.php -#: functions/import_class.php:266 -msgid "is not available!" -msgstr "is not available!" +#: functions/NagImportClass.php:229 +msgid "Cannot receive the configuration file (FTP connection)!" +msgstr "Cannot receive the configuration file (FTP connection)!" -#: functions/import_class.php:318 -#: functions/import_class.php:323 -#: functions/import_class.php:635 -#: functions/import_class.php:636 -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: functions/NagImportClass.php:252 +msgid "Cannot receive the configuration file (SSH connection)!" +msgstr "Cannot receive the configuration file (SSH connection)!" + +#: functions/NagImportClass.php:351 functions/NagImportClass.php:356 +#: functions/NagImportClass.php:420 functions/NagImportClass.php:426 +#: functions/NagImportClass.php:433 functions/NagImportClass.php:438 msgid "inside" msgstr "inside" -#: functions/import_class.php:318 +#: functions/NagImportClass.php:352 msgid "exists and were not overwritten" msgstr "exists and were not overwritten" -#: functions/import_class.php:323 +#: functions/NagImportClass.php:357 msgid "were not written" msgstr "were not written" # contacts.php -#: functions/import_class.php:635 -#: functions/import_class.php:636 +#: functions/NagImportClass.php:421 functions/NagImportClass.php:427 msgid "could not be inserted:" msgstr "could not be inserted:" -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: functions/NagImportClass.php:434 functions/NagImportClass.php:439 msgid "successfully inserted" msgstr "successfully inserted" -#: functions/import_class.php:1275 -msgid "Error: wrong number of arguments - cannot import service group members" -msgstr "Error: incorrect number of arguments - cannot import service group members" +#: functions/NagImportClass.php:564 +msgid "Table for import definition" +msgstr "Table for import definition" -#: functions/mysql_class.php:269 -msgid "Missing server connection parameter!" -msgstr "Missing server connection parameter!" +# mutdialog.php +#: functions/NagImportClass.php:565 +msgid "is not available!" +msgstr "is not available!" -#: functions/mysql_class.php:276 -#: functions/mysql_class.php:305 -msgid "Connection to the database server has failed by reason:" -msgstr "Connection to the database server has failed by reason:" +#: functions/NagImportClass.php:1640 +msgid "" +"Error: incorrect number of arguments - cannot import service group members" +msgstr "" +"Error: incorrect number of arguments - cannot import service group members" -#: functions/mysql_class.php:298 -msgid "Missing database connection parameter!" -msgstr "Missing database connection parameter!" +#: functions/NagImportClass.php:1868 +msgid "" +"Error: incorrect number of arguments - cannot import service parent members" +msgstr "" +"Error: incorrect number of arguments - cannot import service parent members" -#: functions/nag_class.php:123 +#: functions/NagImportClass.php:1929 functions/NagImportClass.php:1934 +msgid "Error: cannot import the service parent member " +msgstr "Error: cannot import the service parent member " + +#: functions/NagImportClass.php:1931 +msgid "This combination is not unique!" +msgstr "This combination is not unique!" + +#: functions/NagImportClass.php:1936 +msgid "This combination is not unique or does not exist!" +msgstr "This combination is not unique or does not exist!" + +#: functions/NagVisualClass.php:227 msgid "Hide menu" msgstr "Hide menu" -#: functions/nag_class.php:132 +#: functions/NagVisualClass.php:237 msgid "Show menu" msgstr "Show menu" -#: functions/nag_class.php:406 +#: functions/NagVisualClass.php:272 msgid "Page" msgstr "Page" -#: functions/nag_class.php:961 +#: functions/NagVisualClass.php:805 msgid "Unrestricted access" msgstr "Unrestricted access" -# prepend.adm -#: functions/prepend_adm.php:101 -#: install/index.php:100 -msgid "Error while connecting to database:" -msgstr "Error while connecting to database:" +#: functions/prepend_adm.php:214 +msgid "" +"Error in setting the correct locale, please report this error with the " +"associated output of 'locale -a' to bugs@nagiosql.org" +msgstr "" +"Error setting the correct locale. Please report this error with the " +"associated output of 'locale -a' to bugs@nagiosql.org" -#: functions/prepend_adm.php:133 -#: functions/prepend_adm.php:192 -msgid "Error in setting the correct locale, please report this error with the associated output of 'locale -a' to bugs@nagiosql.org" -msgstr "Error setting the correct locale. Please report this error with the associated output of 'locale -a' to bugs@nagiosql.org" - -#: functions/prepend_adm.php:269 +#: functions/prepend_adm.php:306 msgid "Webserver login successfull" msgstr "Webserver login successfull" -#: functions/prepend_adm.php:302 +#: functions/prepend_adm.php:347 msgid "Login successfull" msgstr "Login successful" -#: functions/prepend_adm.php:307 -#: functions/prepend_adm.php:308 +#: functions/prepend_adm.php:354 functions/prepend_adm.php:355 msgid "Login failed!" msgstr "Login failed!" -#: functions/prepend_adm.php:332 +#: functions/prepend_adm.php:387 msgid "Session timeout reached - Seconds:" msgstr "Session timeout reached - Seconds:" -#: functions/prepend_adm.php:343 +#: functions/prepend_adm.php:402 msgid "Restricted site accessed:" msgstr "Restricted site accessed:" -#: functions/prepend_adm.php:355 +#: functions/prepend_adm.php:419 msgid "User not found in database" msgstr "User not found in database" -#: functions/prepend_adm.php:393 -msgid "Admin" -msgstr "Administration" - -#: functions/prepend_adm.php:457 +#: functions/prepend_adm.php:548 msgid "Logged in:" msgstr "Logged in:" -#: functions/prepend_adm.php:458 +#: functions/prepend_adm.php:550 msgid "Logout" msgstr "Logout" -#: functions/prepend_adm.php:478 -msgid "Warning - template file not found or not readable, please check your file permissions! - File: " -msgstr "Warning - template file not found or not readable, please check your file permissions! - File: " +#: functions/prepend_adm.php:573 +msgid "" +"Warning - template file not found or not readable, please check your file " +"permissions! - File: " +msgstr "" +"Warning - template file not found or not readable, please check your file " +"permissions! - File: " -#: functions/prepend_content.php:303 -#: functions/prepend_content.php:306 -#: functions/prepend_content.php:322 -#: functions/prepend_content.php:325 -msgid "Some configuration files were not written. Dataset not activated, not found or you do not have write permission!" -msgstr "Some configuration files were not written. Dataset not activated, not found or you do not have write permission!" +#: functions/prepend_content.php:258 functions/prepend_content.php:265 +#: functions/prepend_content.php:288 functions/prepend_content.php:295 +msgid "" +"Some configuration files were not written. Dataset not activated, not found " +"or you do not have write permission!" +msgstr "" +"Some configuration files were not written. Dataset not activated, not found " +"or you do not have write permission!" -#: functions/prepend_content.php:305 -#: functions/prepend_content.php:324 +#: functions/prepend_content.php:262 functions/prepend_content.php:292 msgid "Configuration files successfully written!" msgstr "Configuration files successfully written!" -#: functions/prepend_content.php:344 -msgid "Admin can't be deleted" +#: functions/prepend_content.php:321 +msgid "Admin cannot be deleted" msgstr "Admin cannot be deleted" -#: functions/prepend_content.php:347 +#: functions/prepend_content.php:325 msgid "Localhost can't be deleted" msgstr "Localhost can't be deleted" -#: functions/prepend_content.php:475 +#: functions/prepend_content.php:502 msgid "No permission to open configuration!" msgstr "No permission to open configuration!" -#: functions/translator.php:56 +#: functions/translator.php:63 install/functions/NagInstallClass.php:99 msgid "English" msgstr "English" -#: functions/translator.php:60 +#: functions/translator.php:67 install/functions/NagInstallClass.php:103 msgid "German" msgstr "German" -#: functions/translator.php:64 +#: functions/translator.php:71 install/functions/NagInstallClass.php:107 msgid "Chinese (Simplified)" msgstr "Chinese (Simplified)" -#: functions/translator.php:68 +#: functions/translator.php:75 install/functions/NagInstallClass.php:111 msgid "Italian" msgstr "Italian" -#: functions/translator.php:72 +#: functions/translator.php:79 install/functions/NagInstallClass.php:115 msgid "French" msgstr "French" -#: functions/translator.php:76 +#: functions/translator.php:83 install/functions/NagInstallClass.php:119 msgid "Russian" msgstr "Russian" -#: functions/translator.php:80 +#: functions/translator.php:87 install/functions/NagInstallClass.php:123 msgid "Spanish" msgstr "Spanish" -#: functions/translator.php:84 +#: functions/translator.php:91 install/functions/NagInstallClass.php:127 msgid "Portuguese (Brazilian)" msgstr "Portuguese (Brazilian)" -#: functions/translator.php:88 +#: functions/translator.php:95 install/functions/NagInstallClass.php:131 msgid "Dutch" msgstr "Dutch" -#: functions/translator.php:92 +#: functions/translator.php:99 install/functions/NagInstallClass.php:135 msgid "Danish" msgstr "Danish" -#: install/index.php:63 -#: install/index.php:172 +#: index.php:47 +msgid "Welcome to" +msgstr "Welcome to" + +#: index.php:48 +msgid "Welcome" +msgstr "Welcome" + +#: index.php:49 +msgid "" +"Please enter your username and password to access NagiosQL.
If you forgot " +"one of them, please contact your Administrator." +msgstr "" +"Please enter your username and password to access NagiosQL.
If you forgot " +"one of them, please contact your Administrator." + +#: index.php:53 +msgid "Login" +msgstr "Login" + +#: install/functions/NagInstallClass.php:75 +msgid "Template file not found" +msgstr "Template file not found" + +#: install/functions/NagInstallClass.php:336 +#: install/functions/NagInstallClass.php:368 +msgid "passed" +msgstr "passed" + +# prepend.adm +#: install/functions/NagInstallClass.php:358 +msgid "Error while connecting to database:" +msgstr "Error while connecting to database:" + +#: install/functions/NagInstallClass.php:399 +#: install/functions/NagInstallClass.php:474 +msgid "supported" +msgstr "supported" + +#: install/functions/NagInstallClass.php:401 +msgid "not supported" +msgstr "not supported" + +#: install/functions/NagInstallClass.php:477 +msgid "" +"Your NagiosQL installation is up to date - no further actions are needed!" +msgstr "" +"Your NagiosQL installation is up to date - no further actions are needed!" + +#: install/functions/NagInstallClass.php:483 +#: install/functions/NagInstallClass.php:491 +msgid "" +"Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and " +"above!" +msgstr "" +"Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and " +"above!" + +# prepend.adm +#: install/functions/NagInstallClass.php:489 +msgid "Error while selecting settings table." +msgstr "Error while selecting settings table." + +#: install/functions/NagInstallClass.php:511 +#: install/functions/NagInstallClass.php:547 +#: install/functions/NagInstallClass.php:610 +#: install/functions/NagInstallClass.php:614 +#: install/functions/NagInstallClass.php:655 +#: install/functions/NagInstallClass.php:736 +#: install/functions/NagInstallClass.php:819 +#: install/functions/NagInstallClass.php:870 +#: install/functions/NagInstallClass.php:935 +#: install/functions/NagInstallClass.php:945 +#: install/functions/NagInstallClass.php:967 +#: install/functions/NagInstallClass.php:1015 +#: install/functions/NagInstallClass.php:1067 +msgid "done" +msgstr "done" + +#: install/functions/NagInstallClass.php:538 +msgid "Unsupported database type." +msgstr "Unsupported database type." + +#: install/functions/NagInstallClass.php:611 +msgid "Only added rights to existing user" +msgstr "Only added rights to existing user" + +# mutdialog.php +#: install/functions/NagInstallClass.php:641 +msgid "No SQL update files available" +msgstr "No SQL update files available" + +#: install/functions/NagInstallClass.php:650 +#: install/functions/NagInstallClass.php:707 +msgid "SQL file is not readable or empty" +msgstr "SQL file is not readable or empty" + +#: install/functions/NagInstallClass.php:778 +#: install/functions/NagInstallClass.php:785 +#: install/functions/NagInstallClass.php:813 +msgid "Inserting initial data to settings database has failed:" +msgstr "Inserting initial data to settings database has failed:" + +#: install/functions/NagInstallClass.php:873 +msgid "Connot open/write to config/settings.php" +msgstr "Connot open/write to config/settings.php" + +#: install/functions/NagInstallClass.php:905 +msgid "Inserting path data to database has failed:" +msgstr "Inserting path data to database has failed:" + +#: install/functions/NagInstallClass.php:936 +msgid "Check the permissions of the created paths!" +msgstr "Check the permissions of the created paths!" + +#: install/functions/NagInstallClass.php:939 +msgid "NagiosQL config path is not writeable - only database values updated" +msgstr "NagiosQL config path is not writeable - only database values updated" + +# prepend.adm +#: install/functions/NagInstallClass.php:969 +#: install/functions/NagInstallClass.php:1017 +#: install/functions/NagInstallClass.php:1069 +msgid "Database errors while converting to utf-8:" +msgstr "Database errors while converting to utf-8:" + +#: install/functions/NagInstallClass.php:1008 +#: install/functions/NagInstallClass.php:1060 install/step3.php:88 +#: install/step3.php:177 +msgid "Database type not defined!" +msgstr "Database type not defined!" + +#: install/index.php:69 msgid "Online Documentation" msgstr "Online Documentation" -#: install/index.php:99 +#: install/index.php:115 msgid "Database connection failed. Upgrade not available!" msgstr "Database connection failed. Upgrade not available!" -#: install/index.php:105 +#: install/index.php:122 msgid "Settings table not available or wrong. Upgrade not available!" msgstr "Settings table not available or wrong. Upgrade not available!" -#: install/index.php:116 -msgid "Installation cannot continue, please make sure you have the mysql extension loaded!" -msgstr "Installation cannot continue, please make sure you have the mysql extension loaded!" +#: install/index.php:133 +msgid "" +"Invalid database type in settings file (config/settings.php). Upgrade not " +"available!" +msgstr "" +"Invalid database type in settings file (config/settings.php). Upgrade not " +"available!" -#: install/index.php:121 -msgid "Installation cannot continue, postgres is not yet available in beta!" -msgstr "Installation cannot continue, postgres is not yet available in beta!" +#: install/index.php:137 +msgid "" +"Database values in settings file are missing (config/settings.php). Upgrade " +"not available!" +msgstr "" +"Database values in settings file are missing (config/settings.php). Upgrade " +"not available!" -#: install/index.php:124 -msgid "Installation cannot continue, please make sure you have the pgsql extension loaded!" -msgstr "Installation cannot continue, please make sure you have the pgsql extension loaded!" +#: install/index.php:141 +msgid "" +"Settings file not found or not readable (config/settings.php). Upgrade not " +"available!" +msgstr "" +"Settings file not found or not readable (config/settings.php). Upgrade not " +"available!" -#: install/index.php:128 -msgid "Database type in settings file is wrong (config/settings.php). Upgrade not available!" -msgstr "Database type in settings file is wrong (config/settings.php). Upgrade not available!" +#: install/index.php:152 +msgid "" +"Default values file is not available or not readable (install/functions/" +"initial_settings.php). Installation possible, but without predefined data!" +msgstr "" +"Default values file is not available or not readable (install/functions/" +"initial_settings.php). Installation possible, but without predefined data!" -#: install/index.php:131 -msgid "Database values in settings file are missing (config/settings.php). Upgrade not available!" -msgstr "Database values in settings file are missing (config/settings.php). Upgrade not available!" +#: install/index.php:159 +msgid "Installation wizard" +msgstr "Installation wizard" -#: install/index.php:134 -msgid "Settings file not found or not readable (config/settings.php). Upgrade not available!" -msgstr "Settings file not found or not readable (config/settings.php). Upgrade not available!" +#: install/index.php:160 +msgid "Welcome to the NagiosQL installation wizard" +msgstr "Welcome to the NagiosQL installation wizard" -#: install/index.php:144 -msgid "Default values file is not available or not readable (install/functions/initial_settings.php). Installation possible, but without predefined data!" -msgstr "Default values file is not available or not readable (install/functions/initial_settings.php). Installation possible, but without predefined data!" - -#: install/index.php:150 -#: install/install.php:124 -msgid "Welcome to the NagiosQL Installation Wizard" -msgstr "Welcome to the NagiosQL Installation Wizard" - -#: install/index.php:151 +#: install/index.php:161 msgid "This wizard will help you to install and configure NagiosQL." msgstr "This wizard will help you to install and configure NagiosQL." -#: install/index.php:152 +#: install/index.php:163 msgid "For questions please visit" msgstr "For questions please visit" -#: install/index.php:153 -msgid "First let's check your local environment and find out if everything NagiosQL needs is available." -msgstr "First let's check your local environment and find out if everything NagiosQL needs is available." +#: install/index.php:164 +msgid "" +"First let's check your local environment and find out if everything NagiosQL " +"needs is available." +msgstr "" +"First let's check your local environment and find out if everything NagiosQL " +"needs is available." -#: install/index.php:154 +#: install/index.php:166 msgid "The basic requirements are:" msgstr "The basic requirements are:" -#: install/index.php:155 -msgid "PHP 5.2.0 or greater including:" -msgstr "PHP 5.2.0 or greater including:" +#: install/index.php:167 +msgid "PHP 5.5.0 or greater including:" +msgstr "PHP 5.5.0 or greater including:" -#: install/index.php:156 -#: install/index.php:157 -#: install/index.php:158 -#: install/index.php:161 -#: install/index.php:163 -#: install/index.php:164 -msgid "PHP Module:" -msgstr "PHP Module:" +#: install/index.php:168 +msgid "PHP database module:" +msgstr "PHP database module:" -#: install/index.php:163 -#: install/index.php:164 -#: install/index.php:165 +#: install/index.php:169 +msgid "supported types are" +msgstr "supported types are" + +#: install/index.php:174 install/index.php:176 msgid "(optional)" msgstr "(optional)" -#: install/index.php:165 -msgid "PECL Extension:" -msgstr "PECL Extension:" +#: install/index.php:175 +msgid "PECL extension:" +msgstr "PECL extension:" -#: install/index.php:166 +#: install/index.php:177 msgid "php.ini options" msgstr "php.ini options" -#: install/index.php:167 +#: install/index.php:178 msgid "file_uploads on (for upload features)" msgstr "file_uploads on (for upload features)" -#: install/index.php:168 +#: install/index.php:179 msgid "session.auto_start needs to be off" msgstr "session.auto_start needs to be off" -#: install/index.php:169 -msgid "A MySQL database server" -msgstr "A MySQL database server" +#: install/index.php:180 +msgid "A database server" +msgstr "A database server" -#: install/index.php:170 -msgid "Nagios 2.x/3.x" -msgstr "Nagios 2.x/3.x" +#: install/index.php:181 +msgid "Nagios 2.x/3.x/4.x" +msgstr "Nagios 2.x/3.x/4.x" -#: install/index.php:176 +#: install/index.php:182 +msgid "NagiosQL version" +msgstr "NagiosQL version" + +#: install/index.php:184 +msgid "Online documentation" +msgstr "Online documentation" + +#: install/index.php:188 msgid "START INSTALLATION" msgstr "START INSTALLATION" -#: install/index.php:177 +#: install/index.php:189 msgid "START UPDATE" msgstr "START UPDATE" -#: install/step1.php:80 +#: install/install.php:214 +msgid "Welcome to the NagiosQL Installation Wizard" +msgstr "Welcome to the NagiosQL Installation Wizard" + +#: install/step1.php:74 install/step2.php:34 install/step3.php:38 msgid "Requirements" msgstr "Requirements" -#: install/step1.php:82 +#: install/step1.php:75 install/step1.php:77 install/step2.php:35 +#: install/step2.php:37 install/step3.php:39 install/step3.php:41 +msgid "Installation" +msgstr "Installation" + +#: install/step1.php:76 install/step2.php:36 install/step3.php:40 +#: install/step3.php:301 msgid "Finish" msgstr "Finish" -#: install/step1.php:83 +#: install/step1.php:78 msgid "Checking requirements" msgstr "Checking requirements" -#: install/step1.php:84 +#: install/step1.php:79 msgid "Checking Client" msgstr "Checking Client" -#: install/step1.php:85 +#: install/step1.php:80 msgid "Checking PHP version" msgstr "Checking PHP version" -#: install/step1.php:86 +#: install/step1.php:81 msgid "Checking PHP extensions" msgstr "Checking PHP extensions" -#: install/step1.php:87 +#: install/step1.php:82 msgid "Checking available database interfaces" msgstr "Checking available database interfaces" -#: install/step1.php:88 +#: install/step1.php:83 msgid "Checking php.ini/.htaccess settings" msgstr "Checking php.ini/.htaccess settings" -#: install/step1.php:89 +#: install/step1.php:84 msgid "Checking System Permission" msgstr "Checking System Permissions" -#: install/step1.php:90 +#: install/step1.php:85 msgid "The following modules/extensions are required to run NagiosQL" msgstr "The following modules/extensions are required to run NagiosQL" -#: install/step1.php:91 +#: install/step1.php:87 msgid "The next couple of extensions are optional but recommended" msgstr "The next couple of extensions are optional but recommended" -#: install/step1.php:92 -msgid "Check which of the supported extensions are installed. At least one of them is required." -msgstr "Check which of the supported extensions are installed. At least one of them is required." +#: install/step1.php:89 +msgid "" +"Check which of the supported extensions are installed. At least one of them " +"is required." +msgstr "" +"Check which of the supported extensions are installed. At least one of them " +"is required." -#: install/step1.php:93 +#: install/step1.php:91 msgid "The following settings are required to run NagiosQL" msgstr "The following settings are required to run NagiosQL" -#: install/step1.php:107 +#: install/step1.php:109 msgid "ENABLED" msgstr "ENABLED" -#: install/step1.php:109 +#: install/step1.php:114 msgid "NOT ENABLED" msgstr "NOT ENABLED" -#: install/step1.php:113 +#: install/step1.php:115 +msgid "" +"After enabling Javascript, the page must be updated twice so that the status " +"changes" +msgstr "" +"After enabling Javascript, the page must be updated twice so that the status " +"changes" + +#: install/step1.php:120 msgid "Version" msgstr "Version" -#: install/step1.php:115 -#: install/step1.php:128 -#: install/step1.php:141 -#: install/step1.php:158 -#: install/step1.php:178 -#: install/step1.php:182 -#: install/step1.php:194 -#: install/step1.php:201 -#: install/step1.php:203 -#: install/step1.php:213 -#: install/step1.php:220 -#: install/step1.php:227 -#: install/step1.php:234 -#: install/step1.php:241 -#: install/step1.php:248 +#: install/step1.php:124 install/step1.php:140 install/step1.php:155 +#: install/step1.php:180 install/step1.php:208 install/step1.php:212 +#: install/step1.php:226 install/step1.php:236 install/step1.php:239 +#: install/step1.php:252 install/step1.php:261 install/step1.php:270 +#: install/step1.php:279 install/step1.php:288 install/step1.php:297 msgid "OK" msgstr "OK" -#: install/step1.php:116 -#: install/step1.php:118 +#: install/step1.php:125 install/step1.php:129 msgid "detected" msgstr "detected" -#: install/step1.php:119 +#: install/step1.php:130 msgid "or greater is required" msgstr "or greater is required" -#: install/step1.php:131 -#: install/step1.php:144 -#: install/step1.php:162 +#: install/step1.php:143 install/step1.php:158 install/step1.php:187 msgid "Could be loaded. Please add in php.ini" msgstr "Could be loaded. Please add in php.ini" -#: install/step1.php:132 -#: install/step1.php:145 -#: install/step1.php:163 -#: install/step1.php:175 +#: install/step1.php:145 install/step1.php:160 install/step1.php:189 +#: install/step1.php:204 msgid "NOT AVAILABLE" msgstr "NOT AVAILABLE" -#: install/step1.php:157 -msgid "New installation only - updates are only supported using the same database interface!" -msgstr "New installation only - updates are only supported using the same database interface!" +#: install/step1.php:177 +msgid "" +"New installation only - updates are only supported using the same database " +"interface!" +msgstr "" +"New installation only - updates are only supported using the same database " +"interface!" -#: install/step1.php:175 +#: install/step1.php:205 msgid "cannot be empty and needs to be set" msgstr "cannot be empty and needs to be set" -#: install/step1.php:184 +#: install/step1.php:214 msgid "should be" msgstr "should be" -#: install/step1.php:194 -#: install/step1.php:196 +#: install/step1.php:225 install/step1.php:228 msgid "Read test on settings file (config/settings.php)" msgstr "Read test on settings file (config/settings.php)" -#: install/step1.php:198 +#: install/step1.php:231 msgid "Settings file does not exists (config/settings.php)" msgstr "Settings file does not exist (config/settings.php)" -#: install/step1.php:198 +#: install/step1.php:232 msgid "will be created" msgstr "will be created" -#: install/step1.php:201 -#: install/step1.php:205 +#: install/step1.php:235 install/step1.php:241 msgid "Write test on settings file (config/settings.php)" msgstr "Write test on settings file (config/settings.php)" -#: install/step1.php:203 -#: install/step1.php:208 +#: install/step1.php:238 install/step1.php:245 msgid "Write test on settings directory (config/)" msgstr "Write test on settings directory (config/)" -#: install/step1.php:213 -#: install/step1.php:215 -msgid "Read test on a class file (functions/nag_class.php)" -msgstr "Read test on one class file (functions/nag_class.php)" +#: install/step1.php:251 install/step1.php:254 +msgid "Read test on one class file (functions/NagVisualClass.php)" +msgstr "Read test on one class file (functions/NagVisualClass.php)" -#: install/step1.php:220 -#: install/step1.php:222 -msgid "Read test on startsite file (admin.php)" +#: install/step1.php:260 install/step1.php:263 +msgid "Read test on home page file (admin.php)" msgstr "Read test on home page file (admin.php)" -#: install/step1.php:227 -#: install/step1.php:229 -msgid "Read test on a template file (templates/index.tpl.htm)" +#: install/step1.php:269 install/step1.php:272 +msgid "Read test on one template file (templates/index.tpl.htm)" msgstr "Read test on one template file (templates/index.tpl.htm)" -#: install/step1.php:234 -#: install/step1.php:236 -msgid "Read test on a admin template file (templates/admin/admin_master.tpl.htm)" -msgstr "Read test on one admin template file (templates/admin/admin_master.tpl.htm)" +#: install/step1.php:278 install/step1.php:281 +msgid "Read test on one admin template file (templates/admin/datalist.htm.tpl)" +msgstr "" +"Read test on one admin template file (templates/admin/datalist.htm.tpl)" -#: install/step1.php:241 -#: install/step1.php:243 -msgid "Read test on a file template (templates/files/contacts.tpl.dat)" +#: install/step1.php:287 install/step1.php:290 +msgid "Read test on one file template (templates/files/contacts.tpl.dat)" msgstr "Read test on one file template (templates/files/contacts.tpl.dat)" -#: install/step1.php:248 -#: install/step1.php:250 -msgid "Read test on a image file (images/pixel.gif)" +#: install/step1.php:296 install/step1.php:299 +msgid "Read test on one image file (images/pixel.gif)" msgstr "Read test on one image file (images/pixel.gif)" -#: install/step1.php:254 -msgid "There are some errors - please check your system settings and read the requirements of NagiosQL!" -msgstr "There are some errors - please check your system settings and read the requirements for NagiosQL!" +#: install/step1.php:304 +msgid "" +"There are some errors - please check your system settings and read the " +"requirements of NagiosQL!" +msgstr "" +"There are some errors - please check your system settings and read the " +"requirements for NagiosQL!" -#: install/step1.php:255 -msgid "Read the INSTALLATION file from NagiosQL to find out, how to fix them." -msgstr "Read the INSTALLATION file from NagiosQL to find out how to fix them." +#: install/step1.php:306 +msgid "" +"Read the INSTALLATION file in the NagiosQL doc directory or the installation " +"PDF file on our" +msgstr "" +"Read the INSTALLATION file in the NagiosQL doc directory or the installation " +"PDF file on our" -#: install/step1.php:256 +#: install/step1.php:310 +msgid "online documentation" +msgstr "online documentation" + +#: install/step1.php:311 +msgid "site to find out, how to fix them." +msgstr "site to find out, how to fix them." + +#: install/step1.php:312 msgid "After that - refresh this page to proceed" msgstr "After that - refresh this page to proceed" -#: install/step1.php:259 +#: install/step1.php:316 msgid "Refresh" msgstr "Refresh" -#: install/step1.php:261 -msgid "Environment test sucessfully passed" +#: install/step1.php:318 +msgid "Environment test completed successfully" msgstr "Environment test completed successfully" -#: install/step1.php:264 +#: install/step1.php:323 install/step2.php:94 msgid "Next" msgstr "Next" -#: install/step2.php:33 +#: install/step2.php:32 msgid "The NagiosQL first passwords are not equal!" msgstr "The NagiosQL first passwords are not equal!" @@ -3346,360 +3804,224 @@ msgstr "Setup" msgid "Please complete the form below. Mandatory fields marked *" msgstr "Please complete the form below. Mandatory fields marked *" -#: install/step2.php:40 +#: install/step2.php:41 msgid "Database Configuration" msgstr "Database Configuration" -#: install/step2.php:41 +#: install/step2.php:42 msgid "Database Type" msgstr "Database Type" -#: install/step2.php:43 +#: install/step2.php:56 msgid "Database Server" msgstr "Database Server" -#: install/step2.php:45 +#: install/step2.php:58 msgid "Local hostname or IP address" msgstr "Local hostname or IP address" -#: install/step2.php:51 +#: install/step2.php:64 msgid "Database Server Port" msgstr "Database Server Port" -#: install/step2.php:55 +#: install/step2.php:68 msgid "NagiosQL DB User" msgstr "NagiosQL DB User" -#: install/step2.php:57 +#: install/step2.php:70 msgid "NagiosQL DB Password" msgstr "NagiosQL DB Password" -#: install/step2.php:59 +#: install/step2.php:72 msgid "Administrative Database User" msgstr "Administrative Database User" -#: install/step2.php:61 +#: install/step2.php:74 msgid "Administrative Database Password" msgstr "Administrative Database Password" -#: install/step2.php:62 +#: install/step2.php:75 msgid "Drop database if already exists?" msgstr "Drop database if already exists?" -#: install/step2.php:64 +#: install/step2.php:81 msgid "NagiosQL User Setup" msgstr "NagiosQL User Setup" -#: install/step2.php:65 +#: install/step2.php:82 msgid "Initial NagiosQL User" msgstr "Initial NagiosQL User" -#: install/step2.php:67 +#: install/step2.php:84 msgid "Initial NagiosQL Password" msgstr "Initial NagiosQL Password" -#: install/step2.php:69 +#: install/step2.php:86 msgid "Please repeat the password" msgstr "Please repeat the password" -#: install/step2.php:70 +#: install/step2.php:87 msgid "Nagios Configuration" msgstr "Nagios Configuration" -#: install/step2.php:71 +#: install/step2.php:88 msgid "Import Nagios sample config?" msgstr "Import Nagios sample config?" -#: install/step2.php:74 +#: install/step2.php:95 msgid "NagiosQL path values" msgstr "NagiosQL path values" -#: install/step2.php:75 +#: install/step2.php:96 msgid "Create NagiosQL config paths?" msgstr "Create NagiosQL config paths?" -#: install/step2.php:77 +#: install/step2.php:102 msgid "NagiosQL config path" msgstr "NagiosQL config path" -#: install/step2.php:79 +#: install/step2.php:104 msgid "Nagios config path" msgstr "Nagios config path" -#: install/step2.php:81 -msgid "Both path values were stored in your configuration target settings for localhost." -msgstr "Both path values were stored in your configuration target settings for localhost." +#: install/step2.php:106 +msgid "" +"Both path values were stored in your configuration target settings for " +"localhost." +msgstr "" +"Both path values were stored in your configuration target settings for " +"localhost." -#: install/step2.php:82 -msgid "If you select the create path option, be sure that the NagiosQL base path exist and the webserver demon has write access to it. So the installer will create the required subdirectories in your localhost's filesystem (hosts, services, backup etc.)" -msgstr "If you select the create path option, be sure that the NagiosQL base path exist and the webserver demon has write access to it. So the installer will create the required subdirectories in your localhost's filesystem (hosts, services, backup etc.)" +#: install/step2.php:108 +msgid "" +"If you select the create path option, be sure that the NagiosQL base path " +"exist and the webserver demon has write access to it. So the installer will " +"create the required subdirectories in your localhost's filesystem (hosts, " +"services, backup etc.)" +msgstr "" +"If you select the create path option, be sure that the NagiosQL base path " +"exist and the webserver demon has write access to it. So the installer will " +"create the required subdirectories in your localhost's filesystem (hosts, " +"services, backup etc.)" -#: install/step2.php:94 +#: install/step2.php:120 msgid "Please backup your database before proceeding!" msgstr "Please backup your database before proceeding!" -#: install/step3.php:40 +#: install/step3.php:42 msgid "Finishing Setup" msgstr "Finishing Setup" -#: install/step3.php:42 +#: install/step3.php:44 msgid "Deploy NagiosQL settings" msgstr "Deploy NagiosQL settings" -#: install/step3.php:43 +#: install/step3.php:45 msgid "Database server connection (privileged user)" msgstr "Database server connection (privileged user)" -#: install/step3.php:44 +#: install/step3.php:46 msgid "Database server version" msgstr "Database server version" -#: install/step3.php:45 +#: install/step3.php:47 msgid "Database server support" msgstr "Database server support" -#: install/step3.php:46 +#: install/step3.php:48 msgid "Delete existing NagiosQL database" msgstr "Delete existing NagiosQL database" -#: install/step3.php:47 +#: install/step3.php:49 msgid "Creating new database" msgstr "Creating new database" -#: install/step3.php:48 -msgid "Create NagiosQL database user" -msgstr "Create NagiosQL database user" - -#: install/step3.php:49 +#: install/step3.php:50 msgid "Installing NagiosQL database tables" msgstr "Installing NagiosQL database tables" -#: install/step3.php:50 +#: install/step3.php:51 +msgid "Create NagiosQL database user" +msgstr "Create NagiosQL database user" + +#: install/step3.php:52 msgid "Set initial NagiosQL Administrator" msgstr "Set initial NagiosQL Administrator" -#: install/step3.php:51 +#: install/step3.php:53 msgid "Database server connection (NagiosQL user)" msgstr "Database server connection (NagiosQL user)" -#: install/step3.php:52 +#: install/step3.php:54 msgid "Writing global settings to database" msgstr "Writing global settings to database" -#: install/step3.php:53 +#: install/step3.php:55 msgid "Writing database configuration to settings.php" msgstr "Writing database configuration to settings.php" -#: install/step3.php:54 +#: install/step3.php:56 msgid "Import Nagios sample data" msgstr "Import Nagios sample data" -#: install/step3.php:55 +#: install/step3.php:57 msgid "Create and/or store NagiosQL path settings" msgstr "Create and/or store NagiosQL path settings" -#: install/step3.php:73 +#: install/step3.php:80 msgid "Updating existing NagiosQL database" msgstr "Updating existing NagiosQL database" -#: install/step3.php:80 +#: install/step3.php:113 msgid "Installed NagiosQL version" msgstr "Installed NagiosQL version" -#: install/step3.php:86 +#: install/step3.php:124 msgid "Upgrading from version" msgstr "Upgrading from version" -#: install/step3.php:86 +#: install/step3.php:125 msgid "to" msgstr "to" -#: install/step3.php:92 +#: install/step3.php:132 msgid "Converting database to utf8 character set" msgstr "Converting database to utf8 character set" -#: install/step3.php:98 +#: install/step3.php:138 msgid "Converting database tables to utf8 character set" msgstr "Converting database tables to utf8 character set" -#: install/step3.php:104 +#: install/step3.php:145 msgid "Converting database fields to utf8 character set" msgstr "Converting database fields to utf8 character set" -#: install/step3.php:126 +#: install/step3.php:169 msgid "Create new NagiosQL database" msgstr "Create new NagiosQL database" -#: install/step3.php:133 -msgid "Database already exists and drop database was not selected, please correct or manage manually" -msgstr "Database already exists and drop database was not selected. Please correct or resolve manually." +#: install/step3.php:202 +msgid "" +"Database already exists and drop database was not selected, please correct " +"or manage manually" +msgstr "" +"Database already exists and drop database was not selected, please correct " +"or manage manually" -#: install/step3.php:137 -#: install/functions/install_class.php:115 -#: install/functions/install_class.php:159 -msgid "passed" -msgstr "passed" - -#: install/step3.php:146 +#: install/step3.php:218 msgid "unknown" msgstr "unknown" -#: install/step3.php:211 +#: install/step3.php:293 msgid "Back" msgstr "Back" -#: install/step3.php:216 +#: install/step3.php:298 msgid "Please delete the install directory to continue!" msgstr "Please delete the install directory to continue!" -#: install/functions/install_class.php:110 -#: install/functions/install_class.php:154 -#: install/functions/install_class.php:188 -#: install/functions/install_class.php:229 -#: install/functions/install_class.php:303 -#: install/functions/install_class.php:335 -#: install/functions/install_class.php:413 -#: install/functions/install_class.php:529 -#: install/functions/install_class.php:768 -#: install/functions/install_class.php:814 -#: install/functions/install_class.php:901 -msgid "Database type not defined!" -msgstr "Database type not defined!" - -#: install/functions/install_class.php:195 -#: install/functions/install_class.php:265 -msgid "supported" -msgstr "supported" - -#: install/functions/install_class.php:198 -msgid "not supported" -msgstr "not supported" - -#: install/functions/install_class.php:268 -msgid "Your NagiosQL installation is up to date - no further actions are needed!" -msgstr "Your NagiosQL installation is up to date - no further actions are needed!" - -#: install/functions/install_class.php:272 -#: install/functions/install_class.php:279 -msgid "Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and above!" -msgstr "Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and above!" - -# prepend.adm -#: install/functions/install_class.php:277 -msgid "Error while selecting settings table." -msgstr "Error while selecting settings table." - -#: install/functions/install_class.php:308 -#: install/functions/install_class.php:340 -#: install/functions/install_class.php:419 -#: install/functions/install_class.php:421 -#: install/functions/install_class.php:494 -#: install/functions/install_class.php:534 -#: install/functions/install_class.php:625 -#: install/functions/install_class.php:675 -#: install/functions/install_class.php:732 -#: install/functions/install_class.php:740 -#: install/functions/install_class.php:773 -#: install/functions/install_class.php:819 -#: install/functions/install_class.php:906 -msgid "done" -msgstr "done" - -#: install/functions/install_class.php:419 -msgid "Only added rights to existing user" -msgstr "Only added rights to existing user" - -#: install/functions/install_class.php:483 -#: install/functions/install_class.php:488 -msgid "SQL file is not readable or empty" -msgstr "SQL file is not readable or empty" - -# mutdialog.php -#: install/functions/install_class.php:501 -msgid "No SQL update files available" -msgstr "No SQL update files available" - -#: install/functions/install_class.php:571 -#: install/functions/install_class.php:576 -#: install/functions/install_class.php:585 -#: install/functions/install_class.php:590 -#: install/functions/install_class.php:613 -#: install/functions/install_class.php:620 -msgid "Inserting initial data to settings database has failed:" -msgstr "Inserting initial data to settings database has failed:" - -#: install/functions/install_class.php:679 -msgid "Connot open/write to config/settings.php" -msgstr "Connot open/write to config/settings.php" - -#: install/functions/install_class.php:713 -#: install/functions/install_class.php:720 -msgid "Inserting path data to database has failed:" -msgstr "Inserting path data to database has failed:" - -#: install/functions/install_class.php:732 -msgid "Check the permissions of the created paths!" -msgstr "Check the permissions of the created paths!" - -#: install/functions/install_class.php:736 -msgid "NagiosQL config path is not writeable - only database values updated" -msgstr "NagiosQL config path is not writeable - only database values updated" - -# prepend.adm -#: install/functions/install_class.php:776 -#: install/functions/install_class.php:822 -#: install/functions/install_class.php:909 -msgid "Database errors while converting to utf-8:" -msgstr "Database errors while converting to utf-8:" - -#~ msgid "Polish" -#~ msgstr "Polish" -#~ msgid "Japanese" -#~ msgstr "Japanese" -#~ msgid "Spanish (Argentina)" -#~ msgstr "Spanish (Argentina)" -#~ msgid "PHP session module" -#~ msgstr "PHP session module" - -#, fuzzy -#~ msgid "PHP gettext module" -#~ msgstr "PHP Module:" - -#, fuzzy -#~ msgid "PHP ftp module" -#~ msgstr "PHP Module:" - -#, fuzzy -#~ msgid "PHP ssh module" -#~ msgstr "PHP Module:" -#~ msgid "Could not connect to Updateserver" -#~ msgstr "Could not connect to update server" -#~ msgid "Error" -#~ msgstr "Error" -#~ msgid "An error occured during the version check" -#~ msgstr "An error occured during the version check" -#~ msgid "Checking for NagiosQL Updates" -#~ msgstr "Checking for NagiosQL Updates" -#~ msgid "You already have the latest development version installed" -#~ msgstr "You already have the latest development version installed" -#~ msgid "" -#~ "Entry cannot be deactivated because it is used by another configuration" -#~ msgstr "" -#~ "Entry cannot be deactivated because it is used by another configuration" -#~ msgid "Automatically check for online updates (internet access required!)" -#~ msgstr "Automatically check for online updates (internet access required!)" -#~ msgid "Connection to remote system failed (SSH2 connection)!" -#~ msgstr "Connection to remote system failed (SSH2 connection)!" -#~ msgid "Connection to remote system failed (FTP connection)!" -#~ msgstr "Connection to remote system failed (FTP connection)!" -#~ msgid "No dataset activated. Probably the dataset does not exist" -#~ msgstr "No dataset activated. Probably the dataset does not exist" -#~ msgid "No dataset deactivated. Probably the dataset does not exist" -#~ msgstr "No dataset deactivated. Probably the dataset does not exist" -#~ msgid "Relation information for " -#~ msgstr "Relational information for " -#~ msgid "Not installed" -#~ msgstr "Not installed" -#~ msgid "The following settings are optional but recommended" -#~ msgstr "The following settings are optional but recommended" +#~ msgid "Cgi config file" +#~ msgstr "Cgi config file" +#~ msgid "Password too short or password fields don" +#~ msgstr "Password too short or password fields don" diff --git a/config/locale/es_AR/LC_MESSAGES/es_AR.po b/config/locale/es_AR/LC_MESSAGES/es_AR.po index fde6293..b1b1e86 100644 --- a/config/locale/es_AR/LC_MESSAGES/es_AR.po +++ b/config/locale/es_AR/LC_MESSAGES/es_AR.po @@ -2,11 +2,9 @@ # # # # Project : NagiosQL # # Component : Translation File Spanish (Argentina) -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# msgid "" @@ -16,7 +14,7 @@ msgstr "" "POT-Creation-Date: 2012-03-09 22:51+0100\n" "PO-Revision-Date: 2012-03-09 22:51+0100\n" "Last-Translator: \n" -"Language-Team: www.nagiosql.org \n" +"Language-Team: https://sourceforge.net/projects/nagiosql/ \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -24,7 +22,6 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Pootle 2.1.5\n" "X-Poedit-SourceCharset: utf-8\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" "X-Poedit-KeywordsList: translate\n" "X-Poedit-SearchPath-0: .\n" diff --git a/config/locale/es_ES/LC_MESSAGES/es_ES.po b/config/locale/es_ES/LC_MESSAGES/es_ES.po index 8c18520..42747ee 100644 --- a/config/locale/es_ES/LC_MESSAGES/es_ES.po +++ b/config/locale/es_ES/LC_MESSAGES/es_ES.po @@ -2,11 +2,9 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# # Translators: @@ -25,7 +23,6 @@ msgstr "" "Language: es_ES\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "X-Generator: Pootle 2.1.5\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" "X-Poedit-KeywordsList: translate\n" "X-Poedit-SourceCharset: utf-8\n" "X-Poedit-SearchPath-0: .\n" diff --git a/config/locale/fr_FR/LC_MESSAGES/fr_FR.po b/config/locale/fr_FR/LC_MESSAGES/fr_FR.po index a49ac39..cd39f3f 100644 --- a/config/locale/fr_FR/LC_MESSAGES/fr_FR.po +++ b/config/locale/fr_FR/LC_MESSAGES/fr_FR.po @@ -2,11 +2,9 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# # Translators: @@ -24,7 +22,6 @@ msgstr "" "Language: fr_FR\n" "Plural-Forms: nplurals=2; plural=(n > 1)\n" "X-Generator: Pootle 2.1.5\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" "X-Poedit-KeywordsList: translate\n" "X-Poedit-SourceCharset: utf-8\n" "X-Poedit-SearchPath-0: .\n" diff --git a/config/locale/it_IT/LC_MESSAGES/it_IT.po b/config/locale/it_IT/LC_MESSAGES/it_IT.po index f6bf2f9..68792b1 100644 --- a/config/locale/it_IT/LC_MESSAGES/it_IT.po +++ b/config/locale/it_IT/LC_MESSAGES/it_IT.po @@ -2,11 +2,9 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# # Translators: @@ -24,7 +22,6 @@ msgstr "" "Language: it_IT\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "X-Generator: Pootle 2.1.5\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" "X-Poedit-KeywordsList: translate\n" "X-Poedit-SourceCharset: utf-8\n" "X-Poedit-SearchPath-0: .\n" diff --git a/config/locale/ja_JP/LC_MESSAGES/ja_JP.po b/config/locale/ja_JP/LC_MESSAGES/ja_JP.po index 95e460f..69e098f 100644 --- a/config/locale/ja_JP/LC_MESSAGES/ja_JP.po +++ b/config/locale/ja_JP/LC_MESSAGES/ja_JP.po @@ -2,11 +2,9 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# # Translators: @@ -24,7 +22,6 @@ msgstr "" "Language: ja_JP\n" "Plural-Forms: nplurals=1; plural=0\n" "X-Generator: Pootle 2.1.5\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" "X-Poedit-KeywordsList: translate\n" "X-Poedit-SourceCharset: utf-8\n" "X-Poedit-SearchPath-0: .\n" diff --git a/config/locale/nl_NL/LC_MESSAGES/nl_NL.po b/config/locale/nl_NL/LC_MESSAGES/nl_NL.po index 35be2af..70233e3 100644 --- a/config/locale/nl_NL/LC_MESSAGES/nl_NL.po +++ b/config/locale/nl_NL/LC_MESSAGES/nl_NL.po @@ -2,11 +2,9 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# # Translators: @@ -24,7 +22,6 @@ msgstr "" "Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "X-Generator: Pootle 2.1.5\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" "X-Poedit-KeywordsList: translate\n" "X-Poedit-SourceCharset: utf-8\n" "X-Poedit-SearchPath-0: .\n" diff --git a/config/locale/pl_PL/LC_MESSAGES/pl_PL.po b/config/locale/pl_PL/LC_MESSAGES/pl_PL.po index e6e0124..8255856 100644 --- a/config/locale/pl_PL/LC_MESSAGES/pl_PL.po +++ b/config/locale/pl_PL/LC_MESSAGES/pl_PL.po @@ -2,11 +2,9 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# # Translators: @@ -24,7 +22,6 @@ msgstr "" "Language: pl_PL\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" "X-Generator: Pootle 2.1.5\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" "X-Poedit-KeywordsList: translate\n" "X-Poedit-SourceCharset: utf-8\n" "X-Poedit-SearchPath-0: .\n" diff --git a/config/locale/pt_BR/LC_MESSAGES/pt_BR.mo b/config/locale/pt_BR/LC_MESSAGES/pt_BR.mo index 482e043..129129c 100644 Binary files a/config/locale/pt_BR/LC_MESSAGES/pt_BR.mo and b/config/locale/pt_BR/LC_MESSAGES/pt_BR.mo differ diff --git a/config/locale/pt_BR/LC_MESSAGES/pt_BR.po b/config/locale/pt_BR/LC_MESSAGES/pt_BR.po index a03bb5c..4759b0b 100644 --- a/config/locale/pt_BR/LC_MESSAGES/pt_BR.po +++ b/config/locale/pt_BR/LC_MESSAGES/pt_BR.po @@ -2,3341 +2,3839 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# # Translators: -# Benedito Ramos , 2012. -# Diramos , 2011. +# Benedito Ramos , 2012,2018 +# Diramos , 2011 msgid "" msgstr "" "Project-Id-Version: NagiosQL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-09 22:53+0100\n" -"PO-Revision-Date: 2012-03-09 22:53+0100\n" -"Last-Translator: \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.net/projects/p/nagiosql/language/pt_BR/)\n" +"POT-Creation-Date: 2018-05-06 12:16+0200\n" +"PO-Revision-Date: 2018-05-06 12:16+0200\n" +"Last-Translator: Benedito Ramos \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/wizonet/" +"nagiosql/language/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" -"Plural-Forms: nplurals=2; plural=(n > 1)\n" -"X-Generator: Pootle 2.1.5\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 2.0.6\n" +"X-Poedit-Basepath: ../../../..\n" "X-Poedit-KeywordsList: translate\n" -"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: functions/yui\n" +"X-Poedit-SearchPathExcluded-1: functions/tinyMCE\n" +"X-Poedit-SearchPathExcluded-2: _archive\n" -#: admin.php:34 +#: admin.php:37 msgid "NagiosQL Administration" msgstr "Bem vindo ao NagiosQL" -#: admin.php:37 -msgid "Welcome to NagiosQL, the administration module that can be used to easily create, modify and delete configuration files for Nagios. The data is stored in a database and can be written directly to the standard files at any time you want." -msgstr "O módulo de administração que facilita as tarefas de criação, alteração e exclusão de arquivos de configuração do Nagios. Os dados são armazenados em banco de dados e gravados nos arquivos (.cfg), de forma fácil e prática, poupando o administrador da tarefa de edição manual." +#: admin.php:40 +msgid "" +"Welcome to NagiosQL, the administration module that can be used to easily " +"create, modify and delete configuration files for Nagios. The data is stored " +"in a database and can be written directly to the standard files at any time " +"you want." +msgstr "" +"O módulo de administração que facilita as tarefas de criação, alteração e " +"exclusão de arquivos de configuração do Nagios. Os dados são armazenados em " +"banco de dados e gravados nos arquivos (.cfg), de forma fácil e prática, " +"poupando o administrador da tarefa de edição manual." -#: index.php:45 -msgid "Welcome to" -msgstr "Bem vindo ao" - -#: index.php:46 -msgid "Welcome" -msgstr "Bem vindo" - -#: index.php:47 -msgid "Please enter your username and password to access NagiosQL.
If you forgot one of them, please contact your Administrator." -msgstr "Para acessar o NagiosQL, preencha os dados solicitados acima.
Em caso de dúvidas, contate o Administrador." - -#: index.php:48 -msgid "Username" -msgstr "Nome" - -#: index.php:49 -msgid "Password" -msgstr "Senha" - -#: index.php:50 -msgid "Login" -msgstr "Entrar" - -#: admin/administration.php:31 +#: admin/administration.php:35 config/fieldvars.php:298 +#: functions/prepend_adm.php:460 functions/prepend_adm.php:469 msgid "Administration" msgstr "Administração" # administration.php -#: admin/administration.php:34 +#: admin/administration.php:38 msgid "Functions to administrate NagiosQL V3" -msgstr "Administração do NagiosQL" +msgstr "Funções para administrar o NagiosQL V3" -#: admin/alarming.php:31 +#: admin/alarming.php:35 config/fieldvars.php:293 config/fieldvars.php:294 msgid "Alarming" msgstr "Notificações" # alarming.php -#: admin/alarming.php:34 -msgid "To define contact data, contact templates and contact groups and time periods." -msgstr "Configurações de contatos, grupos e modelos de contatos e períodos de notificações." +#: admin/alarming.php:36 +msgid "" +"To define contact data, contact templates and contact groups and time " +"periods." +msgstr "Definir Contatos, modelos de Contatos, grupos de contatos e períodos" -#: admin/alarming.php:35 -#: admin/commands.php:35 +#: admin/alarming.php:38 admin/commands.php:38 admin/monitoring.php:40 +#: admin/specials.php:40 msgid "Statistical datas" msgstr "Resumo de dados" -#: admin/alarming.php:36 -#: admin/commands.php:36 +#: admin/alarming.php:39 admin/commands.php:39 admin/monitoring.php:41 +#: admin/specials.php:41 msgid "Group" msgstr "Objetos" -#: admin/alarming.php:37 -#: admin/commands.php:37 +#: admin/alarming.php:40 admin/commands.php:40 admin/monitoring.php:42 +#: admin/specials.php:42 config/fieldvars.php:55 msgid "Active" msgstr "Ativo" -#: admin/alarming.php:38 -#: admin/commands.php:38 +#: admin/alarming.php:41 admin/commands.php:41 admin/monitoring.php:43 +#: admin/specials.php:43 msgid "Inactive" msgstr "Inativo" -#: admin/alarming.php:45 +#: admin/alarming.php:52 config/fieldvars.php:303 msgid "Contact data" msgstr "Contatos" -#: admin/alarming.php:51 +#: admin/alarming.php:60 config/fieldvars.php:156 config/fieldvars.php:304 msgid "Contact groups" msgstr "Grupos de contatos" -#: admin/alarming.php:57 +#: admin/alarming.php:68 config/fieldvars.php:301 msgid "Time periods" msgstr "Períodos" -#: admin/alarming.php:63 +#: admin/alarming.php:76 config/fieldvars.php:330 msgid "Contact templates" msgstr "Modelos de contatos" -#: admin/cgicfg.php:61 -#: admin/cgicfg.php:81 +#: admin/cgicfg.php:65 admin/cgicfg.php:87 admin/nagioscfg.php:65 +#: admin/nagioscfg.php:87 admin/verify.php:63 admin/verify.php:85 +#: functions/NagConfigClass.php:2107 msgid "Configuration file successfully written!" msgstr "Configurações de arquivo gravadas com sucesso!" -#: admin/cgicfg.php:62 -#: admin/cgicfg.php:82 +#: admin/cgicfg.php:67 admin/cgicfg.php:89 admin/nagioscfg.php:67 +#: admin/nagioscfg.php:89 functions/NagConfigClass.php:2106 msgid "Configuration successfully written:" msgstr "Configurações gravadas com sucesso:" -#: admin/cgicfg.php:64 +#: admin/cgicfg.php:69 admin/nagioscfg.php:69 admin/verify.php:65 +#: admin/verify.php:87 functions/NagConfigClass.php:1993 msgid "Cannot open/overwrite the configuration file (check the permissions)!" -msgstr "Não foi possível abrir/sobrescrever o arquivo de configuração (verifique as permissões" +msgstr "" +"Não foi possível abrir/sobrescrever o arquivo de configuração (verifique as " +"permissões" -#: admin/cgicfg.php:65 +#: admin/cgicfg.php:71 admin/nagioscfg.php:71 functions/NagConfigClass.php:1992 msgid "Configuration write failed:" msgstr "Gravação da configuração falhou:" -#: admin/cgicfg.php:85 -msgid "Cannot open/overwrite the configuration file (check the permissions on remote system)!" -msgstr "Não foi possível abrir ou sobrescrever o arquivo de configuração. Verifique as permissõesdo sistema FTP remoto" +#: admin/cgicfg.php:92 admin/nagioscfg.php:92 +msgid "" +"Cannot open/overwrite the configuration file (check the permissions on " +"remote system)!" +msgstr "" +"Não foi possível abrir ou sobrescrever o arquivo de configuração. Verifique " +"as permissõesdo sistema FTP remoto" -#: admin/cgicfg.php:86 +#: admin/cgicfg.php:94 admin/nagioscfg.php:94 msgid "Configuration write failed (remote):" msgstr "Gravação da configuração falhou (FTP remoto):" -#: admin/cgicfg.php:94 +#: admin/cgicfg.php:99 admin/nagioscfg.php:99 +msgid "" +"There are no nagios configuration files in common domain, please select a " +"valid domain to edit this files!" +msgstr "" +"Nenhum arquivo de configuração encontrado no Domínio comum. Selecione um " +"Domínio válido para editar os arquivos!" + +#: admin/cgicfg.php:105 msgid "CGI configuration file" msgstr "Arquivo cgi.cfg" -#: admin/cgicfg.php:117 +#: admin/cgicfg.php:123 admin/nagioscfg.php:123 +#: functions/NagImportClass.php:209 msgid "Cannot open the data file (check the permissions)!" msgstr "Não foi possível abrir o arquivo de dados (verifique as permissões)!" -#: admin/cgicfg.php:132 +#: admin/cgicfg.php:139 admin/nagioscfg.php:138 msgid "Cannot open the temporary file" msgstr "Não foi possível abrir o arquivo temporário" -#: admin/cgicfg.php:136 +#: admin/cgicfg.php:143 admin/nagioscfg.php:142 msgid "Configuration read failed (remote):" msgstr "Gravação da configuração falhou (FTP remoto):" -#: admin/checkcommands.php:53 +#: admin/checkcommands.php:62 msgid "New command inserted:" msgstr "Novo comando incluído:" -#: admin/checkcommands.php:54 +#: admin/checkcommands.php:65 msgid "Command modified:" msgstr "Comando modificado:" -#: admin/checkcommands.php:57 -#: admin/configtargets.php:131 -#: admin/contactgroups.php:80 -#: admin/contacts.php:157 -#: admin/contacttemplates.php:157 -#: admin/datadomain.php:58 +#: admin/checkcommands.php:70 admin/configtargets.php:152 +#: admin/contactgroups.php:123 admin/contacts.php:237 +#: admin/contacttemplates.php:242 admin/datadomain.php:72 admin/group.php:115 +#: admin/hostdependencies.php:182 admin/hostescalations.php:182 +#: admin/hostextinfo.php:72 admin/hostgroups.php:124 admin/hosts.php:380 +#: admin/hosttemplates.php:272 admin/password.php:83 +#: admin/servicedependencies.php:290 admin/serviceescalations.php:233 +#: admin/serviceextinfo.php:81 admin/servicegroups.php:126 +#: admin/services.php:387 admin/servicetemplates.php:318 +#: admin/timeperiods.php:150 admin/user.php:82 msgid "Database entry failed! Not all necessary data filled in!" -msgstr "Entrada na base de dados falhou! Todos os dados nessários não foram preenchidos!" +msgstr "" +"Entrada na base de dados falhou! Todos os dados nessários não foram " +"preenchidos!" -#: admin/checkcommands.php:60 -#: admin/configtargets.php:134 -#: admin/contactgroups.php:83 -#: admin/contacts.php:160 -#: admin/contacttemplates.php:160 -#: admin/datadomain.php:61 +#: admin/checkcommands.php:75 admin/configtargets.php:157 +#: admin/contactgroups.php:128 admin/contacts.php:242 +#: admin/contacttemplates.php:247 admin/datadomain.php:77 admin/group.php:120 +#: admin/hostdependencies.php:187 admin/hostescalations.php:187 +#: admin/hostextinfo.php:77 admin/hostgroups.php:129 admin/hosts.php:385 +#: admin/hosttemplates.php:277 admin/servicedependencies.php:295 +#: admin/serviceescalations.php:238 admin/serviceextinfo.php:86 +#: admin/servicegroups.php:131 admin/services.php:392 +#: admin/servicetemplates.php:323 admin/timeperiods.php:155 admin/user.php:87 msgid "Database entry failed! No write access!" msgstr "Erro! Sem permissão de escrita na base de dados." -# checkcommand.php -#: admin/checkcommands.php:73 -msgid "Command definitions" -msgstr "Configurações de comandos (commands.cfg)" - -#: admin/checkcommands.php:88 -#: admin/contactgroups.php:124 -#: admin/contacts.php:255 -#: admin/contacttemplates.php:247 -#: admin/datadomain.php:91 +#: admin/checkcommands.php:108 admin/contactgroups.php:199 +#: admin/contacts.php:398 admin/contacttemplates.php:398 +#: admin/datadomain.php:114 admin/hostdependencies.php:301 +#: admin/hostescalations.php:305 admin/hostextinfo.php:122 +#: admin/hostgroups.php:202 admin/hosts.php:596 admin/hosttemplates.php:466 +#: admin/servicedependencies.php:646 admin/serviceescalations.php:500 +#: admin/serviceextinfo.php:173 admin/servicegroups.php:204 +#: admin/services.php:630 admin/servicetemplates.php:551 +#: admin/timeperiods.php:225 msgid "Saving not possible!" msgstr "Não é possível salvar!" -#: admin/checkcommands.php:90 +# checkcommand.php +#: admin/checkcommands.php:113 admin/checkcommands.php:144 +msgid "Command definitions" +msgstr "Configurações de comandos (commands.cfg)" + +#: admin/checkcommands.php:114 msgid "unclassified" msgstr "Não classificado" -#: admin/checkcommands.php:91 +#: admin/checkcommands.php:115 msgid "check command" msgstr "Comando de verificação" -#: admin/checkcommands.php:92 +#: admin/checkcommands.php:116 msgid "misc command" msgstr "Comando misto" -#: admin/checkcommands.php:98 -#: admin/contactgroups.php:131 -#: admin/contacts.php:269 -#: admin/contacttemplates.php:261 +#: admin/checkcommands.php:122 admin/contactgroups.php:209 +#: admin/contacts.php:419 admin/contacttemplates.php:418 +#: admin/hostdependencies.php:308 admin/hostescalations.php:312 +#: admin/hostextinfo.php:132 admin/hostgroups.php:212 admin/hosts.php:606 +#: admin/hosttemplates.php:476 admin/servicedependencies.php:679 +#: admin/serviceescalations.php:536 admin/serviceextinfo.php:199 +#: admin/servicegroups.php:214 admin/services.php:637 +#: admin/servicetemplates.php:558 admin/timeperiods.php:236 msgid "Entry cannot be activated because it is used by another configuration" msgstr "Entrada não pode ser ativada porque é usada por outra configuração" -#: admin/checkcommands.php:115 +#: admin/checkcommands.php:145 msgid "Command name" msgstr "Nome" -#: admin/checkcommands.php:116 +#: admin/checkcommands.php:146 config/fieldvars.php:90 msgid "Command line" msgstr "Linha de comando" # prepend.adm -#: admin/checkcommands.php:129 -#: admin/checkcommands.php:140 -#: admin/configtargets.php:264 -#: admin/configtargets.php:275 -#: admin/contactgroups.php:159 -#: admin/contactgroups.php:170 -#: admin/contacts.php:319 -#: admin/contacts.php:330 -#: admin/contacttemplates.php:311 -#: admin/contacttemplates.php:322 -#: admin/datadomain.php:137 -#: admin/datadomain.php:148 +#: admin/checkcommands.php:163 admin/checkcommands.php:177 +#: admin/configtargets.php:321 admin/configtargets.php:335 +#: admin/contactgroups.php:242 admin/contactgroups.php:256 +#: admin/contacts.php:477 admin/contacts.php:491 admin/contacttemplates.php:475 +#: admin/contacttemplates.php:489 admin/datadomain.php:162 +#: admin/datadomain.php:176 admin/group.php:177 admin/group.php:190 +#: admin/hostdependencies.php:352 admin/hostdependencies.php:366 +#: admin/hostescalations.php:349 admin/hostescalations.php:363 +#: admin/hostextinfo.php:167 admin/hostextinfo.php:184 admin/hostgroups.php:246 +#: admin/hostgroups.php:260 admin/hosts.php:690 admin/hosts.php:704 +#: admin/hosttemplates.php:558 admin/hosttemplates.php:572 admin/logbook.php:50 +#: admin/logbook.php:77 admin/menuaccess.php:69 admin/password.php:45 +#: admin/password.php:66 admin/servicedependencies.php:723 +#: admin/servicedependencies.php:737 admin/serviceescalations.php:574 +#: admin/serviceescalations.php:588 admin/serviceextinfo.php:235 +#: admin/serviceextinfo.php:253 admin/servicegroups.php:248 +#: admin/servicegroups.php:262 admin/services.php:713 admin/services.php:746 +#: admin/services.php:761 admin/servicetemplates.php:642 +#: admin/servicetemplates.php:656 admin/settings.php:241 +#: admin/timeperiods.php:271 admin/timeperiods.php:285 admin/user.php:188 +#: admin/user.php:201 functions/NagConfigClass.php:1352 +#: functions/NagDataClass.php:191 functions/NagVisualClass.php:841 +#: functions/prepend_adm.php:111 functions/prepend_adm.php:322 +#: functions/prepend_adm.php:381 functions/prepend_adm.php:495 +#: functions/prepend_adm.php:527 functions/prepend_content.php:495 msgid "Error while selecting data from database:" msgstr "Erro ao selecionar dados da base de dados:" -#: admin/commands.php:31 -#: admin/commands.php:45 +#: admin/commands.php:35 admin/commands.php:49 msgid "Check commands" msgstr "Comandos" # commands.php -#: admin/commands.php:34 -msgid "To define check and misc commands, notification commands and special commands." +#: admin/commands.php:36 +msgid "" +"To define check and misc commands, notification commands and special " +"commands." msgstr "Configurações de comandos (de verificação, de notificação e mistos)." # mutdialog.php -#: admin/configtargets.php:56 -#: admin/configtargets.php:62 -#: admin/configtargets.php:82 +#: admin/configtargets.php:60 admin/configtargets.php:67 +#: admin/configtargets.php:89 admin/configtargets.php:94 msgid "is not writeable" msgstr "não é possível alterar" -#: admin/configtargets.php:62 -#: admin/configtargets.php:77 +#: admin/configtargets.php:66 admin/configtargets.php:82 admin/support.php:287 +#: config/fieldvars.php:46 msgid "Nagios config file" -msgstr "Arquivo nagios.cfg" +msgstr "Arquivo nagios.cfg" -#: admin/configtargets.php:77 +#: admin/configtargets.php:83 msgid "is not a valid configuration file!" msgstr "não é um arquivo de configuração válido!" -#: admin/configtargets.php:82 -msgid "Cgi config file" -msgstr "Arquivo CGI de configuração" +#: admin/configtargets.php:88 config/fieldvars.php:226 +msgid "Nagios base directory" +msgstr "Diretório base do Nagios" -#: admin/configtargets.php:89 +#: admin/configtargets.php:93 +msgid "Nagios cgi config file" +msgstr "Arquivo cgi.cfg" + +#: admin/configtargets.php:98 +msgid "Nagios resource config file" +msgstr "Arquivo resource.cfg de configuração do Nagios" + +# mutdialog.php +#: admin/configtargets.php:99 +msgid "is not readable" +msgstr "não é possível ler" + +#: admin/configtargets.php:105 functions/NagConfigClass.php:363 +#: functions/NagConfigClass.php:2083 msgid "SSH module not loaded!" msgstr "Módulo SSH não carregado!" -#: admin/configtargets.php:94 +#: admin/configtargets.php:110 functions/NagConfigClass.php:2061 msgid "FTP module not loaded!" msgstr "Módulo FTP não carregado!" # domain.php -#: admin/configtargets.php:127 -#: admin/datadomain.php:54 +#: admin/configtargets.php:144 admin/datadomain.php:64 msgid "New Domain inserted:" msgstr "Novo domínio inserido" -#: admin/configtargets.php:128 -#: admin/datadomain.php:55 +#: admin/configtargets.php:147 admin/datadomain.php:67 msgid "Domain modified:" msgstr "Domínio modificado" -#: admin/configtargets.php:142 +#: admin/configtargets.php:180 admin/configtargets.php:309 msgid "Configuration domain administration" msgstr "Dados do Domínio" -#: admin/configtargets.php:143 +#: admin/configtargets.php:182 msgid "Warning, at least one error occured, please check!" msgstr "Atenção! Ocorreu erro. Verifique." -#: admin/configtargets.php:158 -#: admin/datadomain.php:92 +#: admin/configtargets.php:188 admin/datadomain.php:117 admin/group.php:149 +#: admin/password.php:99 admin/user.php:130 config/fieldvars.php:204 +#: install/step2.php:33 msgid "Please fill in all fields marked with an *" -msgstr "Campos marcados com * são de preenchimento obrigatório! " +msgstr "Por favor, preencha todos os campos marcados com *" -#: admin/configtargets.php:159 -#: admin/datadomain.php:93 -msgid "The following field contains not permitted characters:" -msgstr "O campo seguinte contém caracteres não permitidos" +#: admin/configtargets.php:189 admin/datadomain.php:118 admin/group.php:150 +#: admin/user.php:131 config/fieldvars.php:206 +msgid "The following field contains illegal characters:" +msgstr "O campo a seguir contém caracteres ilegais:" -#: admin/configtargets.php:255 +#: admin/configtargets.php:310 config/fieldvars.php:265 msgid "Configuration target" msgstr "Nome" -#: admin/configtargets.php:256 -#: admin/contactgroups.php:146 -#: admin/contacts.php:301 -#: admin/contacttemplates.php:293 -#: admin/datadomain.php:129 +#: admin/configtargets.php:311 admin/contactgroups.php:226 +#: admin/contacts.php:456 admin/contacttemplates.php:455 +#: admin/datadomain.php:152 admin/group.php:167 admin/hostgroups.php:229 +#: admin/hosts.php:673 admin/hosttemplates.php:542 admin/servicegroups.php:231 +#: admin/timeperiods.php:254 admin/user.php:178 config/fieldvars.php:21 msgid "Description" msgstr "Descrição" -#: admin/contactgroups.php:53 +#: admin/contactgroups.php:62 msgid "New contact group inserted:" msgstr "Novo gurpo de contato:" -#: admin/contactgroups.php:54 +#: admin/contactgroups.php:65 msgid "Contact group modified:" msgstr "Grupo de contado alterado:" -#: admin/contactgroups.php:96 +#: admin/contactgroups.php:146 admin/contactgroups.php:224 msgid "Define contact groups (contactgroups.cfg)" msgstr "Configurações de grupos de contatos (contactgroups.cfg)" -#: admin/contactgroups.php:111 +#: admin/contactgroups.php:165 msgid "Attention, no contacts defined!" msgstr "Atenção! Nenhum contato definido!" -#: admin/contactgroups.php:145 +#: admin/contactgroups.php:225 config/fieldvars.php:102 msgid "Contact group" msgstr "Nome" # contacts.php -#: admin/contacts.php:70 +#: admin/contacts.php:84 msgid "New contact inserted:" msgstr "Novo contato inserido" -#: admin/contacts.php:71 +#: admin/contacts.php:87 msgid "Contact modified:" msgstr "Contato modificado" -#: admin/contacts.php:173 +#: admin/contacts.php:260 admin/contacts.php:454 msgid "Define contacts (contacts.cfg)" msgstr "Configurações de contatos (contacts.cfg)" -#: admin/contacts.php:230 +#: admin/contacts.php:329 admin/hosts.php:515 admin/services.php:566 msgid "Attention, no time periods defined!" msgstr "Atenção! Nenhum período definido!" -#: admin/contacts.php:241 +#: admin/contacts.php:364 msgid "Attention, no commands defined!" msgstr "Atenção, nenhum comando definido" -#: admin/contacts.php:300 -#: admin/contacttemplates.php:292 +#: admin/contacts.php:455 admin/contacttemplates.php:454 +#: config/fieldvars.php:101 msgid "Contact name" msgstr "Nome" # hosttemplates.php -#: admin/contacttemplates.php:70 +#: admin/contacttemplates.php:84 msgid "New contact template inserted:" msgstr "Novo modelo de contato inserido:" -#: admin/contacttemplates.php:71 +#: admin/contacttemplates.php:87 msgid "Contact template modified:" msgstr "Modelo de contato modificado:" -#: admin/contacttemplates.php:173 +#: admin/contacttemplates.php:265 admin/contacttemplates.php:453 msgid "Define contact templates (contacttemplates.cfg)" msgstr "Configurações de modelos de contatos (contacttemplates.cfg)" -#: admin/datadomain.php:69 -msgid "Data domain administration" -msgstr "Domínios" - -#: admin/datadomain.php:82 +#: admin/datadomain.php:98 msgid "Attention, no configuration targets defined!" msgstr "Atenção: nenhum domínio definido!" -#: admin/datadomain.php:94 +#: admin/datadomain.php:116 admin/datadomain.php:150 +msgid "Data domain administration" +msgstr "Domínios" + +#: admin/datadomain.php:119 admin/settings.php:280 msgid "Enable" msgstr "Habilitar" # mutdialog.php -#: admin/datadomain.php:95 +#: admin/datadomain.php:120 admin/settings.php:281 msgid "Disable" msgstr "Desabilitar" # fieldvars.php -#: admin/datadomain.php:128 +#: admin/datadomain.php:151 msgid "Data domain" msgstr "Nome" -#: admin/delbackup.php:50 -#: admin/delconfig.php:50 +#: admin/delbackup.php:55 admin/delconfig.php:55 msgid "File deleted" msgstr "Arquivo excluído" -#: admin/delbackup.php:51 -#: admin/delconfig.php:51 +#: admin/delbackup.php:56 admin/delconfig.php:56 msgid "successfully deleted" msgstr "Exclusão feita com sucesso" -#: admin/delbackup.php:60 +#: admin/delbackup.php:65 config/fieldvars.php:316 msgid "Delete backup files" msgstr "Excluir backup" -#: admin/delbackup.php:63 -#: admin/delconfig.php:63 +#: admin/delbackup.php:68 admin/delconfig.php:68 admin/import.php:94 msgid "Filter string" msgstr "Filtro" -#: admin/delbackup.php:64 -#: admin/delconfig.php:64 +#: admin/delbackup.php:69 admin/delconfig.php:69 admin/import.php:95 +#: config/fieldvars.php:84 msgid "Search" msgstr "Procurar" -#: admin/delbackup.php:65 -#: admin/delbackup.php:70 -#: admin/delconfig.php:65 -#: admin/delconfig.php:70 +#: admin/delbackup.php:70 admin/delbackup.php:75 admin/delconfig.php:70 +#: admin/delconfig.php:75 admin/groupusers.php:166 admin/import.php:96 +#: admin/templatedefinitions.php:268 admin/timedefinitions.php:180 +#: admin/variabledefinitions.php:147 config/fieldvars.php:76 +#: config/fieldvars.php:183 msgid "Delete" msgstr "Excluir" -#: admin/delbackup.php:66 -#: admin/delconfig.php:66 +#: admin/delbackup.php:71 admin/delconfig.php:71 admin/import.php:97 +#: config/fieldvars.php:85 msgid "Reset filter" msgstr "Limpar filtro" -#: admin/delbackup.php:68 +#: admin/delbackup.php:73 msgid "Backup file" msgstr "Arquivos para exclusão " -#: admin/delbackup.php:69 -#: admin/delconfig.php:69 +#: admin/delbackup.php:74 admin/delconfig.php:74 admin/settings.php:312 +#: config/fieldvars.php:57 msgid "required" msgstr " Preenchimento obrigatório" -#: admin/delbackup.php:71 -#: admin/delconfig.php:71 +#: admin/delbackup.php:76 admin/delconfig.php:76 admin/import.php:104 +#: admin/password.php:98 admin/settings.php:311 config/fieldvars.php:59 msgid "Abort" msgstr "Cancelar" -#: admin/delbackup.php:72 -#: admin/delconfig.php:72 +#: admin/delbackup.php:77 admin/delconfig.php:77 config/fieldvars.php:282 msgid "Hold CTRL to select
more than one entry" msgstr "Pressione CTRL para selecionar mais que um arquivo." -#: admin/delbackup.php:106 -#: admin/delbackup.php:131 +#: admin/delbackup.php:120 admin/delbackup.php:156 msgid "No backup files or no permission to read the backup files" -msgstr "Backup de arquivos falhou ou não existe permissão para ler os arquivos de backup" +msgstr "" +"Backup de arquivos falhou ou não existe permissão para ler os arquivos de " +"backup" -#: admin/delconfig.php:60 +#: admin/delconfig.php:65 config/fieldvars.php:315 msgid "Delete config files" msgstr "Excluir configuração" -#: admin/delconfig.php:68 +#: admin/delconfig.php:73 msgid "Configuration file" msgstr "Arquivo de configuração" -#: admin/download.php:67 +#: admin/download.php:61 config/fieldvars.php:87 msgid "Download" msgstr "Download" -#: admin/group.php:53 +#: admin/group.php:63 msgid "A new group added:" msgstr "Novo grupo adicionado" -#: admin/group.php:54 +#: admin/group.php:66 admin/user.php:77 msgid "User modified:" msgstr "Usuário modificado" -#: admin/group.php:94 +#: admin/group.php:144 admin/group.php:165 msgid "Group administration" msgstr "Grupos de usuários" -#: admin/group.php:114 +#: admin/group.php:145 msgid "Read" msgstr "Leitura" -#: admin/group.php:115 +#: admin/group.php:146 admin/verify.php:97 admin/verify.php:101 +#: admin/verify.php:112 admin/verify.php:116 admin/verify.php:127 +#: admin/verify.php:131 admin/verify.php:142 admin/verify.php:146 +#: admin/verify.php:161 admin/verify.php:170 admin/verify.php:179 +#: admin/verify.php:188 admin/verify.php:197 admin/verify.php:201 +#: admin/verify.php:212 admin/verify.php:216 admin/verify.php:227 +#: admin/verify.php:231 admin/verify.php:242 admin/verify.php:246 +#: admin/verify.php:257 admin/verify.php:261 admin/verify.php:272 +#: admin/verify.php:276 admin/verify.php:287 admin/verify.php:291 msgid "Write" msgstr "Gravação" -#: admin/group.php:116 +#: admin/group.php:147 msgid "Link" msgstr "Ligação de objetos" -#: admin/group.php:134 +#: admin/group.php:166 msgid "Groupname" msgstr "Nome" -#: admin/groupusers.php:150 +#: admin/groupusers.php:175 admin/templatedefinitions.php:277 +#: admin/timedefinitions.php:189 admin/variabledefinitions.php:156 +#: functions/NagContentClass.php:136 msgid "No data" msgstr "Nenhum dado" -#: admin/helpedit.php:65 +#: admin/helpedit.php:77 msgid "Help text editor" msgstr "Editor de ajuda" -#: admin/helpedit.php:76 +#: admin/helpedit.php:83 msgid "Main key" msgstr "Filtro primário" -#: admin/helpedit.php:77 +#: admin/helpedit.php:84 msgid "Sub key" msgstr "Filtro secundário" -#: admin/helpedit.php:78 +#: admin/helpedit.php:85 admin/settings.php:226 admin/settings.php:227 +#: install/index.php:71 msgid "Language" msgstr "Idioma" -#: admin/helpedit.php:79 +#: admin/helpedit.php:86 config/fieldvars.php:49 msgid "Nagios version" msgstr "Versão do Nagios" -#: admin/helpedit.php:80 +#: admin/helpedit.php:87 msgid "Load default text" msgstr "Carregar texto padrão" # hosttemplates.php -#: admin/hostdependencies.php:61 +#: admin/hostdependencies.php:70 msgid "New host dependency inserted:" msgstr "Nova dependência de host incluída:" -#: admin/hostdependencies.php:62 +#: admin/hostdependencies.php:73 msgid "Host dependency modified:" msgstr "Dependência de host alterada:" -#: admin/hostdependencies.php:125 +#: admin/hostdependencies.php:205 admin/hostdependencies.php:332 msgid "Define host dependencies (hostdependencies.cfg)" msgstr "Configurações de dependências de host (hostdependencies.cfg)" -#: admin/hostdependencies.php:153 -#: admin/hostescalations.php:141 +#: admin/hostdependencies.php:285 admin/hostescalations.php:242 +#: admin/servicedependencies.php:533 admin/serviceescalations.php:369 msgid "Attention, no hosts and hostgroups defined!" -msgstr "Atenção, nenhum hosts e grupo de hosts foi definido!" +msgstr "Atenção! Nenhum Host e Grupo de Hosts definidos." -#: admin/hostdependencies.php:189 -#: admin/hostescalations.php:188 +#: admin/hostdependencies.php:333 admin/hostescalations.php:331 +#: admin/servicedependencies.php:705 admin/serviceescalations.php:556 +#: admin/services.php:705 config/fieldvars.php:217 msgid "Config name" msgstr "Nome" -#: admin/hostdependencies.php:190 +#: admin/hostdependencies.php:334 config/fieldvars.php:234 msgid "Dependent hosts" msgstr "Host" -#: admin/hostdependencies.php:190 +#: admin/hostdependencies.php:334 config/fieldvars.php:235 msgid "Dependent hostgroups" msgstr "Grupo de hosts" # hosttemplates.php -#: admin/hostescalations.php:60 +#: admin/hostescalations.php:70 msgid "New host escalation inserted:" msgstr "Nova escala de host incluída:" -#: admin/hostescalations.php:61 +#: admin/hostescalations.php:73 msgid "Host escalation modified:" msgstr "Escala de host alterada:" -#: admin/hostescalations.php:124 +#: admin/hostescalations.php:205 admin/hostescalations.php:330 msgid "Define host escalation (hostescalations.cfg)" msgstr "Configurações de escalas de host (hostescalations.cfg)" -#: admin/hostescalations.php:156 +#: admin/hostescalations.php:289 admin/serviceescalations.php:433 msgid "Attention, no contacts and contactgroups defined!" -msgstr "Atenção! Nenhum contato ou grupos de contatos foi definido" +msgstr "Atenção! Nenhum contato e grupo de contatos definidos." -#: admin/hostescalations.php:189 -#: admin/monitoring.php:46 +#: admin/hostescalations.php:332 admin/monitoring.php:56 +#: config/fieldvars.php:211 config/fieldvars.php:300 msgid "Hosts" msgstr "Hosts" -#: admin/hostescalations.php:189 -#: admin/monitoring.php:58 +#: admin/hostescalations.php:332 admin/monitoring.php:72 +#: config/fieldvars.php:127 config/fieldvars.php:306 msgid "Host groups" msgstr "Grupos de hosts" # hosttemplates.php -#: admin/hostextinfo.php:55 +#: admin/hostextinfo.php:64 msgid "New host extended information inserted:" msgstr "Nova informações extras de host incluídas" -#: admin/hostextinfo.php:56 +#: admin/hostextinfo.php:67 msgid "Host extended information modified:" msgstr "Informações extras de host alterada" -#: admin/hostextinfo.php:75 +#: admin/hostextinfo.php:95 admin/hostextinfo.php:147 msgid "Define host extended information (hostextinfo.cfg)" msgstr "Configurações de informações extras de hosts (hostextinfo.cfg)" -#: admin/hostextinfo.php:88 -#: admin/hostgroups.php:111 +#: admin/hostextinfo.php:106 admin/hostgroups.php:168 +#: admin/serviceextinfo.php:141 msgid "Attention, no hosts defined!" msgstr "Atenção! Nenhum host definido!" -#: admin/hostextinfo.php:118 -#: admin/hosts.php:454 +#: admin/hostextinfo.php:148 admin/hosts.php:672 config/fieldvars.php:202 msgid "Host name" msgstr "Nome" -#: admin/hostextinfo.php:119 +#: admin/hostextinfo.php:149 config/fieldvars.php:166 msgid "Notes" msgstr "Notas" -#: admin/hostgroups.php:54 +#: admin/hostgroups.php:63 msgid "New host group inserted:" msgstr "Novo grupo de host incluído:" -#: admin/hostgroups.php:55 +#: admin/hostgroups.php:66 msgid "Host group modified:" msgstr "Grupo de hosts alterado:" -#: admin/hostgroups.php:97 +#: admin/hostgroups.php:147 admin/hostgroups.php:227 msgid "Define host groups (hostgroups.cfg)" msgstr "Configurações de grupos de hosts (hostgroups.cfg)" -#: admin/hostgroups.php:145 +#: admin/hostgroups.php:228 msgid "Host group" msgstr "Nome" # contacts.php -#: admin/hosts.php:77 +#: admin/hosts.php:95 msgid "New host inserted:" msgstr "Novo host incluído:" -#: admin/hosts.php:78 +#: admin/hosts.php:98 msgid "Host modified:" msgstr "Host modificado:" -#: admin/hosts.php:129 -#: admin/hosts.php:152 -msgid "The assigned, no longer used configuration files were deleted successfully!" +#: admin/hosts.php:192 admin/hosts.php:218 admin/services.php:249 +#: admin/services.php:279 functions/NagDataClass.php:556 +#: functions/NagDataClass.php:583 functions/prepend_content.php:415 +#: functions/prepend_content.php:475 +msgid "" +"The assigned, no longer used configuration files were deleted successfully!" msgstr "Os arquivos antigos, não mais usados pelo sistema, foram excluídos!" -#: admin/hosts.php:130 -#: admin/hosts.php:153 +#: admin/hosts.php:194 admin/hosts.php:220 functions/NagDataClass.php:558 +#: functions/NagDataClass.php:586 functions/prepend_content.php:401 msgid "Host file deleted:" msgstr "Arquivo de host excluído:" -#: admin/hosts.php:133 -#: admin/hosts.php:156 -msgid "Common files cannot be removed from target systems - please check manually" -msgstr "Não foi possível remover os arquivos pelo sistema. Verifique e faça a remoção manualmente" +#: admin/hosts.php:197 admin/hosts.php:223 admin/services.php:254 +#: functions/prepend_content.php:424 functions/prepend_content.php:484 +msgid "" +"Common files cannot be removed from target systems - please check manually" +msgstr "" +"Não foi possível remover os arquivos pelo sistema. Verifique e faça a " +"remoção manualmente" -#: admin/hosts.php:135 -#: admin/hosts.php:158 +#: admin/hosts.php:200 admin/hosts.php:226 admin/services.php:257 +#: admin/services.php:283 functions/NagDataClass.php:560 +#: functions/NagDataClass.php:588 functions/prepend_content.php:419 +#: functions/prepend_content.php:479 msgid "Errors while deleting the old configuration file - please check!:" -msgstr "Erros durante a exclusão de arquivos de configurações antigos. Verifique!:" +msgstr "" +"Erros durante a exclusão de arquivos de configurações antigos. Verifique!:" -#: admin/hosts.php:283 +#: admin/hosts.php:396 admin/hosts.php:671 msgid "Define hosts (hosts.cfg)" msgstr "Configurações de hosts" -#: admin/hosts.php:371 +#: admin/hosts.php:562 msgid "Attention, no contact groups defined!" -msgstr "Atenção! Nenhum grupo de contato definido!" +msgstr "Atenção! Nenhum grupo de contato definido." # hosttemplates.php -#: admin/hosttemplates.php:76 +#: admin/hosttemplates.php:96 msgid "New host template inserted:" msgstr "Novo modelo de host inserido:" -#: admin/hosttemplates.php:77 +#: admin/hosttemplates.php:99 msgid "Host template modified:" msgstr "Modelo de hosts modificado:" -#: admin/hosttemplates.php:187 +#: admin/hosttemplates.php:295 admin/hosttemplates.php:540 msgid "Host template definition (hosttemplates.cfg)" msgstr "Configurações de modelos de hosts (hosttemplates.cfg)" -#: admin/hosttemplates.php:345 +#: admin/hosttemplates.php:541 msgid "Host template name" msgstr "Nome" -#: admin/import.php:51 +#: admin/import.php:55 msgid "File upload error:" msgstr "Erro de envio do arquivo:" -#: admin/import.php:61 -#: admin/import.php:75 -msgid "File imported - File [overwite flag]:" -msgstr "Arquivo importado:" +#: admin/import.php:67 admin/import.php:83 +msgid "File imported - File [overwrite flag]:" +msgstr "Arquivo importado - Arquivo [sinalizador de substituição]:" -#: admin/import.php:82 +#: admin/import.php:91 msgid "Configuration import" msgstr "Importar arquivos" -#: admin/import.php:90 +#: admin/import.php:99 msgid "Template definition" msgstr "Modelo de definição" -#: admin/import.php:91 +#: admin/import.php:100 msgid "Import file" msgstr "Arquivos para importação " -#: admin/import.php:92 +#: admin/import.php:101 msgid "Local import file" msgstr "Arquivo para importar" -#: admin/import.php:93 +#: admin/import.php:102 msgid "Overwrite database" msgstr "Sobrescrever base de dados " -#: admin/import.php:94 +#: admin/import.php:103 msgid "Import" msgstr "Importar" -#: admin/import.php:96 +#: admin/import.php:105 msgid "Hold CTRL to select
more than one" msgstr "Pressione CTRL para selecionar
mais que um registro." -#: admin/import.php:100 -msgid "To prevent errors or misconfigurations, you should import your configurations in an useful order. We recommend to do it like this:

commands -> timeperiods -> contacttemplates -> contacts -> contactgroups -> hosttemplates -> hosts -> hostgroups -> servicetemplates -> services -> servicegroups

" -msgstr "Para evitar erros de configuração, a importação deve ser feita preferencialmente na seguinte ordem:

comandos -> períodos -> modelos de contatos -> contatos -> grupos de contatos -> modelos de hosts -> hosts -> grupos de hosts -> modelos de serviços -> serviços -> grupos de serviços

" +#: admin/import.php:109 +msgid "" +"To prevent errors or misconfigurations, you should import your " +"configurations in an useful order. We recommend to do it like this:" +"

commands -> timeperiods -> contacttemplates -> contacts -> " +"contactgroups -> hosttemplates -> hosts -> hostgroups -> servicetemplates -> " +"services -> servicegroups

" +msgstr "" +"Para evitar erros de configuração, a importação deve ser feita " +"preferencialmente na seguinte ordem:

comandos -> períodos -> " +"modelos de contatos -> contatos -> grupos de contatos -> modelos de hosts -> " +"hosts -> grupos de hosts -> modelos de serviços -> serviços -> grupos de " +"serviços

" -#: admin/import.php:101 -msgid "Check your configuration after import!
In cause of an error or an uncomplete configuration, re-importing the wrong configuration can solve the problem." -msgstr "Verifique as configurações após a importação!
Em caso de erros, corrija os arquivos e proceda a importação novamente. " - -#: admin/info.php:39 -msgid "This is relative path of your NagiosQL Installation" -msgstr "Caminho relativo para instalação do NagiosQL." - -#: admin/info.php:40 -msgid "This is the absolut path to your NagiosQL Installation" -msgstr "Caminho absoluto para instalação do NagiosQL." - -#: admin/info.php:41 -msgid "If you need a secure connection, select HTTPS instead of HTTP" -msgstr "Se for necessário uma conexão segura, selecione HTTPS ao invés de HTTP." - -#: admin/info.php:42 -msgid "Please choose a temporary directory with write permissions. The default is the temp directory provided by your OS" -msgstr "Selecione um diretório temporário com permissões de escrita. O padrão é o diretório /tmp do seu sistema." +#: admin/import.php:113 +msgid "" +"Check your configuration after import!
In cause of an error or an " +"uncomplete configuration, re-importing the wrong configuration can solve the " +"problem." +msgstr "" +"Verifique as configurações após a importação!
Em caso de erros, " +"corrija os arquivos e proceda a importação novamente. " #: admin/info.php:43 -msgid "Please choose your application language" -msgstr "Selecione um idioma para a aplicação." +msgid "This is relative path of your NagiosQL Installation" +msgstr "Este é o caminho relativo da sua instalação do NagiosQL" #: admin/info.php:44 -msgid "Encoding should be set to nothing else than utf-8. Any changes at your own risk" -msgstr "A codificação deve ser utf-8. Qualquer alteração fica por sua conta e risco." +msgid "This is the absolut path to your NagiosQL Installation" +msgstr "Este é o caminho absoluto da sua instalação do NagiosQL" #: admin/info.php:45 +msgid "If you need a secure connection, select HTTPS instead of HTTP" +msgstr "Se você precisar de uma conexão segura, selecione HTTPS em vez de HTTP" + +#: admin/info.php:46 +msgid "" +"Please choose a temporary directory with write permissions. The default is " +"the temp directory provided by your OS" +msgstr "" +"Por favor, escolha um diretório temporário com permissões de gravação. O " +"padrão é o diretório temporário fornecido pelo seu Sistema Operacional" + +#: admin/info.php:48 +msgid "Please choose your application language for new users and login portal" +msgstr "" +"Por favor, escolha o idioma do seu aplicativo para novos usuários e o portal " +"de login" + +#: admin/info.php:49 +msgid "" +"Encoding should be set to nothing else than utf-8. Any changes at your own " +"risk" +msgstr "" +"A codificação deve ser definida para utf-8. Quaisquer alterações são por sua " +"conta e risco" + +#: admin/info.php:50 msgid "IP-Address or hostname of the database server
e.g. localhost" msgstr "Endereço IP ou nome do servidor da base de dados.
ex: localhost" -#: admin/info.php:46 +#: admin/info.php:51 msgid "MySQL Server Port, default is 3306" msgstr "Porta do servidor MySQL. O padrão é 3306" -#: admin/info.php:47 +#: admin/info.php:52 msgid "Name of the NagiosQL database
e.g. db_nagiosql_v3" msgstr "Nome da base de dados do NagiosQL
.ex: db_nagiosql_v3" -#: admin/info.php:48 -msgid "User with sufficient permission for the NagiosQL database
At least this user should have SELECT, INSERT, UPDATE, DELETE permissions" -msgstr "Usuário com permissões suficientes na base de dados do NagiosQL.
Tal usuário deve ter, no mínimo, permissão de SELECT, INSERT, UPDATE e DELETE na base." - -#: admin/info.php:49 -msgid "Password for the above mentioned user" -msgstr "Senha para o usuário da base de dados NagiosQL citado no campo anterior." - -#: admin/info.php:50 -msgid "After the defined amount of seconds the session will terminate for security reasons" -msgstr "Por razões de segurança, a sessão expira após o número de segundos definidos neste campo." - -#: admin/info.php:51 -msgid "Decide between authentication based on your Webserver
e.g. Apache configuration (config file or htaccess) or NagiosQL" -msgstr "Escolha o método de autenticação do seu servidor WEB.
Ex: configuração Apache (arquivo config ou htaccess) ou NagiosQL" - -#: admin/info.php:52 -msgid "How many entries per side should be visibile (e.g. services or hosts)" -msgstr "Número de registros a serem visualizados por página (ex: hosts, serviços, etc)." - #: admin/info.php:53 -msgid "Selection of multiple entries by using the new dialog or by holding CTRL + left click like in NagiosQL2" -msgstr "Selecione múltiplos arquivos usando novo diálogo ou pressionando CRTL + botão esquerdo do mouse." - -#: admin/info.php:54 -msgid "Enable or disable the warning if a required field contains no data in objects with templates" -msgstr "Habilitar ou desabilitar alertas, se um campo obrigatório não for preenchido." +msgid "" +"User with sufficient permission for the NagiosQL database
At least this " +"user should have SELECT, INSERT, UPDATE, DELETE permissions" +msgstr "" +"Usuário com permissões suficientes na base de dados do NagiosQL.
Tal " +"usuário deve ter, no mínimo, permissão de SELECT, INSERT, UPDATE e DELETE na " +"base." #: admin/info.php:55 +msgid "Password for the above mentioned user" +msgstr "" +"Senha para o usuário da base de dados NagiosQL citado no campo anterior." + +#: admin/info.php:56 +msgid "" +"After the defined amount of seconds the session will terminate for security " +"reasons" +msgstr "" +"Por motivos de segurança, a sessão será encerrada após a quantidade definida " +"de segundos" + +#: admin/info.php:58 +msgid "" +"Decide between authentication based on your Webserver
e.g. Apache " +"configuration (config file or htaccess) or NagiosQL" +msgstr "" +"Escolha o método de autenticação do seu servidor WEB.
Ex: configuração " +"Apache (arquivo config ou htaccess) ou NagiosQL" + +#: admin/info.php:60 +msgid "" +"Number of entries per side that should be visible (e.g. services or hosts)" +msgstr "Número de entradas que devem estar visíveis (ex: serviços ou hosts)" + +#: admin/info.php:61 +msgid "" +"Method of selection of multiple entries by using the new dialog or by " +"holding CTRL + left mouse button, as in NagiosQL 2" +msgstr "" +"Método de seleção de múltiplas entradas usando o novo diálogo ou " +"pressionando + botão esquerdo do mouse, como no NagiosQL 2" + +#: admin/info.php:63 +msgid "" +"Enable or disable the warning if a required field contains no data in " +"objects with templates" +msgstr "" +"Habilitar ou desabilitar alertas, se um campo obrigatório não for preenchido." + +#: admin/info.php:65 msgid "Enable or disable the automatic online version check." msgstr "Habilitar ou desabilitar veririficação online de versão." -#: admin/info.php:56 -msgid "If you require a Proxyserver to connect to the Internet (Port 80), please define one." -msgstr "Se for necessário um servidor proxy para conectar-se à Internet (porta 80), informe um." +#: admin/info.php:66 +msgid "" +"If you require a Proxyserver to connect to the Internet (Port 80), please " +"define one." +msgstr "" +"Se for necessário um servidor proxy para conectar-se à Internet (porta 80), " +"informe um." -#: admin/info.php:57 +#: admin/info.php:68 msgid "Address of your Proxyserver e.g. proxy.yourdomain.com:3128" msgstr "Endereço do seu servidor proxy (ex: proxy.seudominio.com:3128)" -#: admin/info.php:58 +#: admin/info.php:69 msgid "Username to connect through your proxy (optional)" msgstr "Usuário para conexão através do servidor proxy (opcional)" -#: admin/info.php:59 +#: admin/info.php:70 msgid "Password to connect through your proxy (optional)" msgstr "Senha para conexão através do servidor proxy (opcional)" -#: admin/info.php:78 +#: admin/info.php:92 msgid "Information PopUp" msgstr "Informação" # mutdialog.php -#: admin/info.php:91 +#: admin/info.php:105 msgid "No information available" msgstr "Informação não disponível." -#: admin/logbook.php:48 +#: admin/logbook.php:53 functions/NagDataClass.php:401 +#: functions/NagDataClass.php:436 functions/NagDataClass.php:611 msgid "Dataset successfully deleted. Affected rows:" -msgstr "Registros excluídos com sucesso. Dados atualizados: " +msgstr "Dados excluídos com sucesso. Linhas afetadas:" # logbook.php -#: admin/logbook.php:74 +#: admin/logbook.php:83 msgid "View logbook" msgstr "Log do sistema" -#: admin/logbook.php:78 +#: admin/logbook.php:87 msgid "Delete logentries between:" msgstr "Excluir entradas de log" -#: admin/logbook.php:80 -msgid "Please at least fill in a start or a stop time" -msgstr "Preencha pelo menos data de início e fim das entradas de log a serem excluídas" +#: admin/logbook.php:89 +msgid "Please supply a start or a stop time at least" +msgstr "Por favor, forneça um horário de início ou de fim" -#: admin/logbook.php:81 -msgid "Do you really want to delete all log entries between the selected dates?" +#: admin/logbook.php:90 +msgid "" +"Do you really want to delete all log entries between the selected dates?" msgstr "Confirma exclusão de todas as entradas de log do período selecionado?" -#: admin/logbook.php:86 +#: admin/logbook.php:97 msgid "previous 20 entries" msgstr "20 anteriores" -#: admin/logbook.php:92 +#: admin/logbook.php:104 msgid "next 20 entries" msgstr "20 próximas" -#: admin/menuaccess.php:40 -msgid "Error while inserting the data to the data base:" -msgstr "Erro na inclusão dos dados na base de dados:" +#: admin/menuaccess.php:44 functions/NagDataClass.php:137 +#: functions/NagDataClass.php:290 +msgid "Error while inserting the data into the database:" +msgstr "Erro ao inserir os dados no banco de dados:" -#: admin/menuaccess.php:43 +#: admin/menuaccess.php:47 functions/NagDataClass.php:134 +#: functions/NagDataClass.php:285 msgid "Data were successfully inserted to the data base!" msgstr "Dados incluídos na base de dados com sucesso!" -#: admin/menuaccess.php:44 +#: admin/menuaccess.php:48 msgid "Access group set for menu item:" msgstr "Níveis de acesso ao item de menu:" # menuaccess.php -#: admin/menuaccess.php:50 -msgid "Define Menu Accessrights" -msgstr "Controle de acesso" +#: admin/menuaccess.php:55 +msgid "Define Menu Access Rights" +msgstr "Definir direitos de acesso ao menu" -#: admin/menuaccess.php:54 -msgid "In order for a user to get access, he needs to be member of the group selected here." -msgstr "
Em \"Grupo de acesso\", defina o(s) grupo(s) para acesso ao item selecionado.

ATENÇÃO: \"Acesso irrestrito\" habilita TODOS os usuários/grupos ao item selecionado." +#: admin/menuaccess.php:59 +msgid "" +"In order for a user to get access, he needs to be member of the group " +"selected here." +msgstr "" +"
Em \"Grupo de acesso\", defina o(s) grupo(s) para acesso ao item " +"selecionado.

ATENÇÃO: \"Acesso irrestrito\" habilita " +"TODOS os usuários/grupos ao item selecionado." -#: admin/monitoring.php:32 +#: admin/monitoring.php:36 msgid "Monitoring" msgstr "Configurações" # monitoring.php -#: admin/monitoring.php:35 -msgid "To define host and service supervisions as well as host and service groups." -msgstr "Configurações de hosts, serviços, grupos e modelos de hosts e de serviços." +#: admin/monitoring.php:39 +msgid "" +"Define host and service supervisions as well as host and service groups." +msgstr "" +"Defina supervisões de hosts, serviços, grupos de hosts e grupos de serviços." -#: admin/monitoring.php:52 +#: admin/monitoring.php:64 admin/serviceescalations.php:557 +#: config/fieldvars.php:248 config/fieldvars.php:305 msgid "Services" msgstr "Serviços" -#: admin/monitoring.php:64 +#: admin/monitoring.php:80 config/fieldvars.php:213 config/fieldvars.php:307 msgid "Service groups" msgstr "Grupos de serviços" -#: admin/monitoring.php:70 +#: admin/monitoring.php:88 config/fieldvars.php:302 config/fieldvars.php:328 msgid "Host templates" msgstr "Modelos de hosts" -#: admin/monitoring.php:76 +#: admin/monitoring.php:96 config/fieldvars.php:329 msgid "Service templates" msgstr "Modelos de serviços" # mutdialog.php -#: admin/mutdialog.php:51 +#: admin/mutdialog.php:57 admin/versioncheck.php:83 msgid "Available" msgstr "Disponível" -#: admin/mutdialog.php:52 +#: admin/mutdialog.php:58 msgid "Selected" msgstr "Selecionados" -#: admin/nagioscfg.php:94 +#: admin/nagioscfg.php:105 msgid "Nagios main configuration file" msgstr "Arquivo nagios.cfg" -#: admin/password.php:50 +#: admin/password.php:55 msgid "Password successfully modified" msgstr "Senha alterada com sucesso" -#: admin/password.php:64 -#: admin/user.php:72 -msgid "Password too short or password fields unequally!" -msgstr "Senha muito curta ou campos divergentes!" +#: admin/password.php:72 admin/user.php:90 +msgid "Password too short or password fields do not match!" +msgstr "Senha muito curta ou senhas digitadas não conferem!" -#: admin/password.php:68 -msgid "Old password is wrong" -msgstr "Senha atual incorreta" +#: admin/password.php:78 +msgid "The old password is invalid" +msgstr "A senha atual não confere" -#: admin/password.php:84 -#: admin/settings.php:244 +#: admin/password.php:97 admin/settings.php:310 config/fieldvars.php:58 msgid "Save" msgstr "Salvar" -#: admin/password.php:87 -msgid "The new passwords are not equal!" -msgstr "As novas senhas não são iguais!" +#: admin/password.php:100 +msgid "The new passwords don not match!" +msgstr "As novas senhas não conferem!" -#: admin/password.php:88 +#: admin/password.php:101 msgid "The new password is too short - use at least 6 characters!" msgstr "A senha deve ter, no mínimo, 6 caracteres!" # hosttemplates.php -#: admin/servicedependencies.php:61 +#: admin/servicedependencies.php:72 msgid "New service dependency inserted:" msgstr "Nova dependência de serviço incluída:" -#: admin/servicedependencies.php:62 +#: admin/servicedependencies.php:75 msgid "Service dependency modified:" msgstr "Dependência de serviço modificada:" -#: admin/servicedependencies.php:157 +#: admin/servicedependencies.php:313 admin/servicedependencies.php:704 msgid "Define service dependencies (servicedependencies.cfg)" msgstr "Configurações de dependências de serviço (servicedependencies.cfg)" -#: admin/servicedependencies.php:351 +#: admin/servicedependencies.php:706 config/fieldvars.php:247 msgid "Dependent services" msgstr "Serviço - dependência" # hosttemplates.php -#: admin/serviceescalations.php:61 +#: admin/serviceescalations.php:71 msgid "New service escalation inserted:" msgstr "Nova escala de serviço incluída" -#: admin/serviceescalations.php:62 +#: admin/serviceescalations.php:74 msgid "Service escalation modified:" msgstr "Escala de serviço alterada:" -#: admin/serviceescalations.php:141 +#: admin/serviceescalations.php:256 admin/serviceescalations.php:555 msgid "Define service escalation (serviceescalations.cfg)" msgstr "Configurações de escalas de serviço (serviceescalations.cfg)" # hosttemplates.php -#: admin/serviceextinfo.php:54 +#: admin/serviceextinfo.php:64 msgid "New service extended information inserted:" msgstr "Novas informações extras de serviço incluídas:" -#: admin/serviceextinfo.php:55 +#: admin/serviceextinfo.php:68 msgid "Service extended information modified:" msgstr "Informação extra de serviço alterada:" -#: admin/serviceextinfo.php:79 +#: admin/serviceextinfo.php:104 admin/serviceextinfo.php:214 msgid "Define service extended information (serviceextinfo.cfg)" msgstr "Configurações de informações extras de serviços (serviceextinfo.cfg)" -#: admin/serviceextinfo.php:159 +#: admin/serviceextinfo.php:215 msgid "Hostname" msgstr "Host" -#: admin/serviceextinfo.php:160 +#: admin/serviceextinfo.php:216 msgid "Service" msgstr "Serviço" # hosttemplates.php -#: admin/servicegroups.php:54 +#: admin/servicegroups.php:63 msgid "New service group inserted:" msgstr "Novo grupo de serviço incluído:" -#: admin/servicegroups.php:55 +#: admin/servicegroups.php:66 msgid "Service group modified:" msgstr "Grupo de serviço modificado:" -#: admin/servicegroups.php:97 +#: admin/servicegroups.php:149 admin/servicegroups.php:229 msgid "Define service groups (servicegroups.cfg)" msgstr "Configurações de grupos de serviços (servicegroups.cfg)" -#: admin/servicegroups.php:112 +#: admin/servicegroups.php:170 msgid "Attention, no services defined!" msgstr "Atenção! Nenhum serviço definido" -#: admin/servicegroups.php:146 +#: admin/servicegroups.php:230 msgid "Service group" msgstr "Nome" # hosttemplates.php -#: admin/services.php:77 +#: admin/services.php:96 msgid "New service inserted:" msgstr "Novo serviço incluído:" -#: admin/services.php:78 +#: admin/services.php:99 msgid "Service modified:" msgstr "Serviço alterado:" -#: admin/services.php:141 -#: admin/services.php:167 +#: admin/services.php:251 admin/services.php:281 +#: functions/prepend_content.php:460 msgid "Service file deleted:" msgstr "Arquivo de serviço excluído:" -#: admin/services.php:255 +#: admin/services.php:403 admin/services.php:704 msgid "Define services (services.cfg)" msgstr "Configurações de serviços (services.cfg)" -#: admin/services.php:311 +#: admin/services.php:488 msgid "Attention, no hosts or hostgroups defined!" msgstr "Atenção! Nenhum host ou grupo de hosts definidos!" -#: admin/services.php:328 +#: admin/services.php:543 msgid "Attention, no check commands defined!" msgstr "Atenção! Nenhum comando de verificação definido!" -#: admin/services.php:354 +#: admin/services.php:613 msgid "Attention, no contacts or contact groups defined!" msgstr "Atenção: nenhum contato ou grupo de contato definido!" -#: admin/services.php:436 +#: admin/services.php:706 msgid "Service name" msgstr "Descrição" -#: admin/services.php:438 -#: admin/services.php:462 +#: admin/services.php:708 admin/services.php:732 msgid "All configs" msgstr "Todas as configurações" # hosttemplates.php -#: admin/servicetemplates.php:76 +#: admin/servicetemplates.php:97 msgid "New service template inserted:" msgstr "Novo modelo de serviço incluído" -#: admin/servicetemplates.php:77 +#: admin/servicetemplates.php:100 msgid "Service template modified:" msgstr "Modelo de serviços alterado:" -#: admin/servicetemplates.php:195 +#: admin/servicetemplates.php:341 admin/servicetemplates.php:623 msgid "Define service templates (servicetemplates.cfg)" msgstr "Configurações de modelos de serviços (servicetemplates.cfg)" -#: admin/servicetemplates.php:357 +#: admin/servicetemplates.php:624 config/fieldvars.php:124 +#: config/fieldvars.php:225 msgid "Template name" msgstr "Nome" -#: admin/servicetemplates.php:358 +#: admin/servicetemplates.php:625 config/fieldvars.php:212 msgid "Service description" msgstr "Descrição" -#: admin/settings.php:63 +#: admin/settings.php:111 msgid "Curl module not loaded, Proxy will be deactivated!" msgstr "Módulo Curl não carregado. O Proxy será desativado!" -#: admin/settings.php:90 +#: admin/settings.php:136 msgid "An error occured while writing settings to database:" msgstr "Um erro ocorreu durante a gravação das configurações na base de dados!" -#: admin/settings.php:129 -msgid "Error in setting the correct locale, please report this error with the associated output of 'locale -a'" -msgstr "Erro na definição do locale. Informe este erro juntamente com a saída do comando 'locale -a' para bugs@nagiosql.org" +#: admin/settings.php:187 functions/prepend_adm.php:150 +msgid "" +"Error setting the correct locale. Please report this error with the " +"associated output of 'locale -a'" +msgstr "" +"Erro ao definir a localidade correta. Por favor, verifique o erro comandando " +"no prompt de comando: locale -a" -#: admin/settings.php:136 +#: admin/settings.php:195 msgid "Settings were changed" msgstr "Os parâmetros foram alterados" -#: admin/settings.php:138 -msgid "An error occured while writing settings.php, please check permissions!" -msgstr "Ocorreu um erro na escrita de settings.php. Verifique as permissões! " +#: admin/settings.php:197 +msgid "An error occured while writing settings.php. Please check permissions!" +msgstr "" +"Ocorreu um erro durante a gravação do arquivo settings.php. Por favor, " +"verifique as permissões!" -#: admin/settings.php:141 +#: admin/settings.php:201 msgid "is not writeable, please check permissions!" msgstr "sem acesso para gravação. Verifique as permissões!" -#: admin/settings.php:147 +#: admin/settings.php:208 msgid "Configure Settings" msgstr "Parâmetros" -#: admin/settings.php:154 +#: admin/settings.php:213 msgid "Change your current NagiosQL settings (e.g. Database user, Language)." -msgstr "Altere suas atuais configurações do NagiosQL (ex.usuário da base de dados, idioma)." +msgstr "" +"Altere suas atuais configurações do NagiosQL (ex.usuário da base de dados, " +"idioma)." -#: admin/settings.php:158 +#: admin/settings.php:218 msgid "Path" msgstr "Caminhos" -#: admin/settings.php:159 +#: admin/settings.php:219 msgid "Temporary Directory" msgstr "Diretório temporário" -#: admin/settings.php:161 +#: admin/settings.php:221 msgid "Server protocol" msgstr "Protocolo do servidor" -#: admin/settings.php:182 +#: admin/settings.php:244 msgid "Encoding" msgstr "Codificação" -#: admin/settings.php:187 +#: admin/settings.php:249 msgid "Database" msgstr "Base de dados" -#: admin/settings.php:188 +#: admin/settings.php:250 msgid "MySQL Server" msgstr "Servidor MySQL" -#: admin/settings.php:190 +#: admin/settings.php:252 msgid "MySQL Server Port" msgstr "Porta do Servidor MySQL" -#: admin/settings.php:192 +#: admin/settings.php:254 install/step2.php:66 msgid "Database name" msgstr "Nome da base de dados" -#: admin/settings.php:194 +#: admin/settings.php:256 msgid "Database user" msgstr "Usuário da base de dados" -#: admin/settings.php:196 +#: admin/settings.php:258 msgid "Database password" msgstr "Senha do usuário da base de dados" -#: admin/settings.php:201 +#: admin/settings.php:263 msgid "Security" msgstr "Segurança" -#: admin/settings.php:202 +#: admin/settings.php:264 msgid "Session auto logoff time" msgstr "Expiração de sessão" -#: admin/settings.php:204 +#: admin/settings.php:266 msgid "Authentication type" msgstr "Tipo de autenticação" -#: admin/settings.php:209 +#: admin/settings.php:271 msgid "Common" msgstr "Gerais" -#: admin/settings.php:210 +#: admin/settings.php:272 msgid "Data lines per page" msgstr "Registros por página" -#: admin/settings.php:212 +#: admin/settings.php:274 msgid "Selection method" msgstr "Método de seleção" -#: admin/settings.php:217 +#: admin/settings.php:279 msgid "Template warn message" msgstr "Modelo de mensagem de alerta" -#: admin/settings.php:226 +#: admin/settings.php:288 msgid "Online version check" msgstr "Verificar atualizações online" -#: admin/settings.php:232 +#: admin/settings.php:296 msgid "Proxyserver" msgstr "Servidor Proxy" -#: admin/settings.php:235 +#: admin/settings.php:301 msgid "Proxy Address" msgstr "Endereço do Servidor Proxy" -#: admin/settings.php:237 +#: admin/settings.php:303 msgid "Proxy Username (optional)" msgstr "Usuário do Servidor Proxy (opcional)" -#: admin/settings.php:239 +#: admin/settings.php:305 msgid "Proxy Password (optional)" msgstr "Senha do Servidor Proxy (opcional)" -#: admin/specials.php:31 +#: admin/specials.php:35 msgid "Misc commands" msgstr "Extras" # specials.php -#: admin/specials.php:34 -msgid "To define host and service dependencies, host and service escalations as well as host and service additional data." -msgstr "Configurações extras de hosts e serviços, dependência e escala de hosts e serviços." +#: admin/specials.php:38 +msgid "" +"Define host and service dependencies, host and service escalations as well " +"as host and service additional data." +msgstr "" +"Definir dependências de host e serviço, escalonamentos de host e serviço e " +"dados adicionais de hosts e serviços." -#: admin/specials.php:45 +#: admin/specials.php:56 msgid "Host dependencies" msgstr "Host - dependência" -#: admin/specials.php:51 +#: admin/specials.php:64 msgid "Host escalations" msgstr "Host - escala" -#: admin/specials.php:57 +#: admin/specials.php:72 msgid "Host ext. info" msgstr "Host - extra" -#: admin/specials.php:63 +#: admin/specials.php:80 msgid "Service dependencies" msgstr "Serviço - dependência" -#: admin/specials.php:69 +#: admin/specials.php:88 msgid "Service escalations" msgstr "Serviço - escala" -#: admin/specials.php:75 +#: admin/specials.php:96 msgid "Service ext. info" msgstr "Serviço - extra" -#: admin/support.php:65 +#: admin/support.php:39 msgid "NagiosQL support page" msgstr "Página de suporte ao NagiosQL" -#: admin/support.php:75 +#: admin/support.php:49 msgid "Support contact information" msgstr "Informações de contato para suporte" -#: admin/support.php:76 -msgid "For questions, the online support forum or contact information visit our website:" -msgstr "Em caso de dúvidas, acesse o fórum de suporte online, visitando nosso site: " +#: admin/support.php:50 +msgid "" +"For questions, the online support forum or contact information visit our " +"website:" +msgstr "" +"Em caso de dúvidas, acesse o fórum de suporte online, visitando nosso site: " -#: admin/support.php:80 +#: admin/support.php:52 +msgid "NagiosQL on sourceforge" +msgstr "NagiosQL no Sourceforge" + +#: admin/support.php:56 msgid "Donate to support NagiosQL" msgstr "Doações para o suporte ao NagiosQL" -#: admin/support.php:81 -msgid "If you like NagiosQL and it simplifies your daily work, then you may want to support the project by making a donation. This helps us to keep NagiosQL alive and to cover our costs. Thank you for your donation!" -msgstr "Se você acha que o NagiosQL é útil e simplifica a administração do Nagios no seu cotidiano, você pode querer apoiar o projeto, fazendo uma doação. Isso vai nos ajudar a manter o NagiosQL vivo, além de cobrir parte dos nossos custos. Obrigado por sua doação!" +#: admin/support.php:57 +msgid "" +"If you like NagiosQL and it simplifies your daily work, then you may want to " +"support the project by making a donation. This helps us to keep NagiosQL " +"alive and to cover our costs. Thank you for your donation!" +msgstr "" +"Se você acha que o NagiosQL é útil e simplifica a administração do Nagios no " +"seu cotidiano, você pode querer apoiar o projeto, fazendo uma doação. Isso " +"vai nos ajudar a manter o NagiosQL vivo, além de cobrir parte dos nossos " +"custos. Obrigado por sua doação!" -#: admin/support.php:82 +#: admin/support.php:60 functions/NagVisualClass.php:230 +#: functions/NagVisualClass.php:231 msgid "Donate for NagiosQL on sourceforge" msgstr "Doações para o NagiosQL no Sourceforge" -#: admin/support.php:86 +#: admin/support.php:64 msgid "Translation services" msgstr "Serviços de tradução" -#: admin/support.php:87 -msgid "NagiosQL was translated into various languages​​. Since some translators are no longer available in later versions, there may be untranslated words or phrases. If you want to help us complete the translation, correct them or introduce a new language​​, then sign up with us now! The translations are simply feasible online - we use an open translation service where you can register for free at any time:" -msgstr "O NagiosQL foi traduzido para diversos idiomas. Pelo fato de alguns tradutores não estarem mais disponíveis, versões posteriores podem conter palavras ou frases não traduzidas para determinados idiomas. Caso queira, você pode nos ajudar a concluir a tradução, corrigí-la ou mesmo traduzir para um novo idioma ainda não disponível. Colabore com o NagiosQL fazendo parte do nosso time de tradutores. As traduções podem ser feitas online. Nós usamos um serviço de tradução aberto, onde você pode se cadastrar gratuitamente, a qualquer momento:" +#: admin/support.php:65 +msgid "" +"NagiosQL was translated into various languages​​. Since some translators are " +"no longer available in later versions, there may be untranslated words or " +"phrases. If you want to help us complete the translation, correct them or " +"introduce a new language​​, then sign up with us now! The translations are " +"simply feasible online - we use an open translation service where you can " +"register for free at any time:" +msgstr "" +"O NagiosQL foi traduzido para diversos idiomas. Pelo fato de alguns " +"tradutores não estarem mais disponíveis, versões posteriores podem conter " +"palavras ou frases não traduzidas para determinados idiomas. Caso queira, " +"você pode nos ajudar a concluir a tradução, corrigí-la ou mesmo traduzir " +"para um novo idioma ainda não disponível. Colabore com o NagiosQL fazendo " +"parte do nosso time de tradutores. As traduções podem ser feitas online. Nós " +"usamos um serviço de tradução aberto, onde você pode se cadastrar " +"gratuitamente, a qualquer momento:" -#: admin/support.php:88 +#: admin/support.php:70 msgid "Transifex translation service" msgstr "Serviço Transifex de traduções" -#: admin/support.php:92 +#: admin/support.php:74 +msgid "GIT software repository" +msgstr "Repositório de software GIT" + +#: admin/support.php:75 +msgid "" +"The NagiosQL sources are available on GitLab. There you will always find the " +"latest bugfixes and changes as well as older branches." +msgstr "" +"Os arquivos fontes do NagiosQL estão disponíveis no GitLab. Lá você sempre " +"encontrará as últimas alterações e correções de eventuais bugs, assim como " +"as versões mais antigas." + +#: admin/support.php:77 +msgid "GitLab" +msgstr "GitLab" + +#: admin/support.php:81 msgid "Version check" msgstr "Buscar por atualizações online" -#: admin/support.php:94 -msgid "The online version check is not enabled. You can enable it on the settings page." -msgstr "A busca por atualizações online está desabilitada. Caso queira, você pode habilitar através do menu \"Administração -> Parâmetros\"." +#: admin/support.php:83 +msgid "" +"The online version check is not enabled. You can enable it on the settings " +"page." +msgstr "" +"A busca por atualizações online está desabilitada. Caso queira, você pode " +"habilitar através do menu \"Administração -> Parâmetros\"." -#: admin/support.php:96 -msgid "The online version check connects the NagiosQL page to find out, if your version is still up to date." -msgstr "A busca de atualizações online se conecta ao site do NagiosQL para verificar se a versão instalada está atualizada." +#: admin/support.php:86 +msgid "" +"The online version check connects the NagiosQL page to find out, if your " +"version is still up to date." +msgstr "" +"A busca de atualizações online se conecta ao site do NagiosQL para verificar " +"se a versão instalada está atualizada." -#: admin/support.php:106 +#: admin/support.php:98 msgid "Environment check" msgstr "Verificação do ambiente" -#: admin/support.php:108 -#: admin/support.php:118 -#: admin/support.php:129 -#: admin/support.php:137 -#: admin/support.php:146 -#: admin/support.php:156 -#: admin/support.php:171 -#: admin/support.php:183 -#: admin/support.php:192 -#: admin/support.php:201 -#: admin/support.php:210 -#: admin/support.php:220 -#: admin/support.php:267 -#: admin/support.php:282 -#: admin/support.php:301 -#: admin/support.php:332 -#: admin/support.php:354 -#: admin/support.php:358 -#: admin/support.php:375 -#: admin/support.php:379 -#: admin/support.php:395 -#: admin/support.php:398 -#: admin/support.php:401 -#: admin/support.php:420 -#: admin/support.php:424 -#: admin/support.php:427 -#: admin/support.php:439 -#: admin/support.php:442 -#: admin/support.php:459 -#: admin/support.php:466 -#: admin/support.php:551 -#: admin/support.php:554 -#: admin/support.php:566 -#: admin/support.php:583 -#: admin/support.php:607 +#: admin/support.php:100 admin/support.php:109 admin/support.php:121 +#: admin/support.php:129 admin/support.php:138 admin/support.php:148 +#: admin/support.php:163 admin/support.php:176 admin/support.php:185 +#: admin/support.php:194 admin/support.php:203 admin/support.php:213 +#: admin/support.php:263 admin/support.php:278 admin/support.php:299 +#: admin/support.php:337 admin/support.php:360 admin/support.php:366 +#: admin/support.php:392 admin/support.php:396 admin/support.php:415 +#: admin/support.php:418 admin/support.php:421 admin/support.php:435 +#: admin/support.php:440 admin/support.php:443 admin/support.php:448 +#: admin/support.php:460 admin/support.php:465 admin/support.php:484 +#: admin/support.php:492 admin/support.php:589 admin/support.php:592 +#: admin/support.php:613 admin/support.php:642 admin/support.php:677 +#: install/functions/NagInstallClass.php:338 +#: install/functions/NagInstallClass.php:370 +#: install/functions/NagInstallClass.php:406 +#: install/functions/NagInstallClass.php:485 +#: install/functions/NagInstallClass.php:493 +#: install/functions/NagInstallClass.php:515 +#: install/functions/NagInstallClass.php:539 +#: install/functions/NagInstallClass.php:551 +#: install/functions/NagInstallClass.php:618 +#: install/functions/NagInstallClass.php:640 +#: install/functions/NagInstallClass.php:649 +#: install/functions/NagInstallClass.php:701 +#: install/functions/NagInstallClass.php:706 +#: install/functions/NagInstallClass.php:739 +#: install/functions/NagInstallClass.php:777 +#: install/functions/NagInstallClass.php:784 +#: install/functions/NagInstallClass.php:812 +#: install/functions/NagInstallClass.php:872 +#: install/functions/NagInstallClass.php:904 +#: install/functions/NagInstallClass.php:938 +#: install/functions/NagInstallClass.php:971 +#: install/functions/NagInstallClass.php:1010 +#: install/functions/NagInstallClass.php:1019 +#: install/functions/NagInstallClass.php:1062 +#: install/functions/NagInstallClass.php:1071 install/step1.php:229 +#: install/step1.php:242 install/step1.php:246 install/step1.php:255 +#: install/step1.php:264 install/step1.php:273 install/step1.php:282 +#: install/step1.php:291 install/step1.php:300 install/step3.php:90 +#: install/step3.php:179 install/step3.php:204 msgid "failed" msgstr "Falhou" -#: admin/support.php:109 -#: admin/support.php:115 -#: admin/support.php:126 -#: admin/support.php:134 -#: admin/support.php:142 -#: admin/support.php:152 -#: admin/support.php:168 -#: admin/support.php:180 -#: admin/support.php:189 -#: admin/support.php:198 -#: admin/support.php:207 -#: admin/support.php:217 -#: admin/support.php:259 -#: admin/support.php:272 -#: admin/support.php:287 -#: admin/support.php:295 -#: admin/support.php:298 -#: admin/support.php:329 -#: admin/support.php:335 -#: admin/support.php:350 -#: admin/support.php:364 -#: admin/support.php:371 -#: admin/support.php:389 -#: admin/support.php:392 -#: admin/support.php:405 -#: admin/support.php:416 -#: admin/support.php:436 -#: admin/support.php:446 -#: admin/support.php:462 -#: admin/support.php:547 -#: admin/support.php:560 -#: admin/support.php:562 -#: admin/support.php:564 -#: admin/support.php:570 -#: admin/support.php:572 -#: admin/support.php:576 -#: admin/support.php:578 +#: admin/support.php:101 admin/support.php:106 admin/support.php:118 +#: admin/support.php:126 admin/support.php:134 admin/support.php:144 +#: admin/support.php:160 admin/support.php:173 admin/support.php:182 +#: admin/support.php:191 admin/support.php:200 admin/support.php:210 +#: admin/support.php:255 admin/support.php:268 admin/support.php:283 +#: admin/support.php:292 admin/support.php:295 admin/support.php:334 +#: admin/support.php:340 admin/support.php:356 admin/support.php:372 +#: admin/support.php:388 admin/support.php:407 admin/support.php:410 +#: admin/support.php:425 admin/support.php:432 admin/support.php:457 +#: admin/support.php:469 admin/support.php:488 admin/support.php:584 +#: admin/support.php:600 admin/support.php:605 admin/support.php:610 +#: admin/support.php:619 admin/support.php:624 admin/support.php:630 +#: admin/support.php:635 msgid "ok" msgstr "ok" -#: admin/support.php:112 +#: admin/support.php:103 msgid "PHP version" msgstr "Versão do PHP" -#: admin/support.php:118 -#: admin/support.php:171 +#: admin/support.php:110 admin/support.php:163 msgid "Required:" msgstr "Requisitos:" -#: admin/support.php:123 -#: admin/support.php:131 -#: admin/support.php:139 -#: admin/support.php:149 +#: admin/support.php:115 admin/support.php:123 admin/support.php:131 +#: admin/support.php:141 install/index.php:170 install/index.php:171 +#: install/index.php:172 install/index.php:173 msgid "PHP module:" msgstr "Módulo PHP:" -#: admin/support.php:161 +#: admin/support.php:153 msgid "MySQL version" msgstr "Versão do MySQL" -#: admin/support.php:176 -#: admin/support.php:185 -#: admin/support.php:194 -#: admin/support.php:203 +#: admin/support.php:169 admin/support.php:178 admin/support.php:187 +#: admin/support.php:196 msgid "PHP ini settings:" msgstr "Configurações do .ini do PHP: " -#: admin/support.php:213 +#: admin/support.php:206 msgid "Read/Write access:" msgstr "Acesso de leitura/gravação no arquivo " -#: admin/support.php:229 +#: admin/support.php:222 msgid "Config domain checks" msgstr "Verificações de configurações do Domínio" -#: admin/support.php:230 -msgid "The checks below are based on your data domain and config domain settings. To change the data domain, use the pull down menu in the upper right corner. Repeat this check for any data domain you have configured. To change the config domain, use the data domain menu and select a different config domain value." -msgstr "As caixas de marcação a seguir são baseadas nos dados e configurações do domínio. Para alterar o domínio, use o menu suspenso no lado superior direito. Repita isso para os outros domínios que você configurou. Para configurar os domínios, use o menu \"Administração -> Domínios\"." +#: admin/support.php:223 +msgid "" +"The checks below are based on your data domain and config domain settings. " +"To change the data domain, use the pull down menu in the upper right corner. " +"Repeat this check for any data domain you have configured. To change the " +"config domain, use the data domain menu and select a different config domain " +"value." +msgstr "" +"As caixas de marcação a seguir são baseadas nos dados e configurações do " +"domínio. Para alterar o domínio, use o menu suspenso no lado superior " +"direito. Repita isso para os outros domínios que você configurou. Para " +"configurar os domínios, use o menu \"Administração -> Domínios\"." -#: admin/support.php:233 +#: admin/support.php:229 msgid "Config domain name" msgstr "Nome do Domínio" -#: admin/support.php:235 +#: admin/support.php:231 msgid "Connection type" msgstr "Tipo de conexão" -#: admin/support.php:256 +#: admin/support.php:252 msgid "Connection check" msgstr "Verificação da conexão" -#: admin/support.php:298 -#: admin/support.php:335 -#: admin/support.php:398 -#: admin/support.php:420 +#: admin/support.php:295 admin/support.php:340 admin/support.php:418 +#: admin/support.php:436 msgid "readonly" msgstr "somente escrita" -#: admin/support.php:341 +#: admin/support.php:346 config/fieldvars.php:45 msgid "Nagios process file" msgstr "Arquivo de processo do Nagios" -#: admin/support.php:354 -#: admin/support.php:375 -#: admin/support.php:395 -#: admin/support.php:427 -#: admin/support.php:439 -#: admin/support.php:466 +#: admin/support.php:361 admin/support.php:392 admin/support.php:415 +#: admin/support.php:444 admin/support.php:448 admin/support.php:465 +#: admin/support.php:493 msgid "file is missed" msgstr "arquivo não existe" -#: admin/support.php:359 -#: admin/support.php:380 +#: admin/support.php:367 admin/support.php:397 msgid "Nagios daemon is not running" msgstr "Serviço Nagios não foi iniciado" -#: admin/support.php:364 -#: admin/support.php:405 -#: admin/support.php:446 +#: admin/support.php:372 admin/support.php:425 admin/support.php:469 msgid "not used with FTP" msgstr "não usado com FTP" -#: admin/support.php:379 -#: admin/support.php:392 -#: admin/support.php:424 +#: admin/support.php:396 admin/support.php:410 admin/support.php:440 msgid "demon dead" msgstr "processo parado" -#: admin/support.php:385 +#: admin/support.php:402 config/fieldvars.php:43 msgid "Nagios command file" msgstr "Arquivo de comandos do Nagios" -#: admin/support.php:432 +#: admin/support.php:452 config/fieldvars.php:44 msgid "Nagios binary file" msgstr "Arquivo binário do Nagios" # mutdialog.php -#: admin/support.php:442 -#: admin/support.php:459 +#: admin/support.php:461 admin/support.php:485 msgid "not executable" msgstr "não executável" # config_class.php -#: admin/support.php:474 +#: admin/support.php:501 msgid "Verify configuration files and demon configuration" msgstr "Verifique os arquivos de configuração e a configuração do processo" -#: admin/support.php:475 +#: admin/support.php:502 msgid "Configuration name" msgstr "Nome de configuração" # fieldvars.php -#: admin/support.php:476 +#: admin/support.php:503 msgid "Used in data domain" msgstr "Usado nos dados do Domínio" -#: admin/support.php:477 +#: admin/support.php:504 msgid "Included in demon configuration" msgstr "Incluído no arquivo de configuração" -#: admin/support.php:549 +#: admin/support.php:587 msgid "not used" msgstr "não usado" -#: admin/support.php:554 +#: admin/support.php:593 msgid "cfg definition missed" msgstr "Definição cfg não encontrada" -#: admin/support.php:564 -#: admin/support.php:572 -#: admin/support.php:578 +#: admin/support.php:611 admin/support.php:625 admin/support.php:636 msgid "cfg definition missed, but actually not used" msgstr "Definição cfg não encontrada, mas não usada " -#: admin/support.php:566 +#: admin/support.php:614 msgid "wrong base path:" msgstr "Caminho da base errado: " -#: admin/support.php:583 +#: admin/support.php:643 msgid "cfg file not readable" msgstr "Arquivo cfg ilegível" -#: admin/support.php:606 +#: admin/support.php:676 msgid "Not used" msgstr "Não usado" -#: admin/support.php:608 +#: admin/support.php:678 msgid "unused - please delete!" msgstr "não usado. Exclua!" -#: admin/templatedefinitions.php:231 +#: admin/templatedefinitions.php:260 msgid "Up" msgstr "Para cima" -#: admin/templatedefinitions.php:231 +#: admin/templatedefinitions.php:264 msgid "Down" msgstr "Para baixo" -#: admin/timedefinitions.php:166 -#: admin/variabledefinitions.php:133 +#: admin/timedefinitions.php:176 admin/variabledefinitions.php:143 +#: config/fieldvars.php:77 msgid "Modify" msgstr "Alterar" -#: admin/timeperiods.php:54 +#: admin/timeperiods.php:62 msgid "New time period inserted:" msgstr "Novo período incluído:" -#: admin/timeperiods.php:55 +#: admin/timeperiods.php:65 msgid "Time period modified:" msgstr "Período alterado:" -#: admin/timeperiods.php:118 -msgid "Timeperiod definitions" -msgstr "Configurações de períodos (timeperiods.cfg)" +#: admin/timeperiods.php:173 admin/timeperiods.php:252 +msgid "Time period definitions (timeperiods.cfg)" +msgstr "Definições de períodos de verificações (timeperiods.cfg" -#: admin/timeperiods.php:143 +#: admin/timeperiods.php:230 msgid "Please insert a time definition and a time range" msgstr "Insira a unidade e intervalo de tempo" # timeperiod.php -#: admin/timeperiods.php:164 +#: admin/timeperiods.php:253 config/fieldvars.php:92 msgid "Time period" msgstr "Nome" # tools.php -#: admin/tools.php:31 +#: admin/tools.php:35 msgid "Different tools" msgstr "Ferramentas" -#: admin/tools.php:34 -msgid "Useful functions for data import, main configuration, daemon control and so on." -msgstr "Ferramentas para importação de dados, exclusão de arquivos de backup e de configuração, edição dos arquivos nagios.cfg e cgi.cfg, verificação das configurações e reinicialização do processo do Nagios" +#: admin/tools.php:36 +msgid "" +"Useful functions for data import, main configuration, daemon control, etc." +msgstr "" +"Funções úteis para importação de dados, configuração principal, controle de " +"processo, etc." -#: admin/user.php:62 -msgid "A new user added:" -msgstr "Novo usuário adicionado" +#: admin/user.php:74 +msgid "New user added:" +msgstr "Novo usuário adicionado:" -#: admin/user.php:80 +#: admin/user.php:128 admin/user.php:176 msgid "User administration" msgstr "Usuários" -#: admin/user.php:103 -msgid "The passwords are not equal!" -msgstr "Senhas não conferem" +#: admin/user.php:132 +msgid "The passwords do not match!" +msgstr "As senhas não conferem!" -#: admin/user.php:104 +#: admin/user.php:133 msgid "Please fill in the password" -msgstr "Preencha a senha" +msgstr "Por favor, digite a senha" -#: admin/user.php:105 +#: admin/user.php:134 msgid "The password is too short - use at least 6 characters!" msgstr "A senha deve ter, no mínimo, 6 caracteres!" -#: admin/user.php:106 +#: admin/user.php:135 msgid "Webserver authentification" -msgstr "Autenticação WEB" +msgstr "Autenticação do Servidor Web" -#: admin/verify.php:45 -#: admin/verify.php:145 -#: functions/config_class.php:711 -#: functions/config_class.php:712 -#: functions/config_class.php:928 -msgid "Writing of the configuration failed - no dataset or not activated dataset found" -msgstr "Gravação da configuração falhou! Base de dados ou registro não encontrados." +#: admin/user.php:177 config/fieldvars.php:24 index.php:51 +msgid "Username" +msgstr "Nome" -#: admin/verify.php:57 +#: admin/verify.php:50 admin/verify.php:157 functions/NagConfigClass.php:1115 +#: functions/NagConfigClass.php:1117 functions/NagConfigClass.php:1357 +#: functions/NagConfigClass.php:1359 +msgid "" +"Writing of the configuration failed - no dataset or not activated dataset " +"found" +msgstr "" +"Gravação da configuração falhou! Base de dados ou registro não encontrados." + +#: admin/verify.php:62 msgid "Write host configurations" msgstr "Gravar configurações de host" -#: admin/verify.php:63 -#: admin/verify.php:83 +#: admin/verify.php:69 admin/verify.php:91 msgid "No configuration items defined!" msgstr "Nenhum item de configuração definido!" -#: admin/verify.php:77 +#: admin/verify.php:84 msgid "Write service configurations" msgstr "Gravar configurações de serviço" -#: admin/verify.php:94 -#: admin/verify.php:108 -#: admin/verify.php:122 -#: admin/verify.php:136 -#: admin/verify.php:190 -#: admin/verify.php:204 -#: admin/verify.php:218 -#: admin/verify.php:232 -#: admin/verify.php:246 -#: admin/verify.php:260 -#: admin/verify.php:274 +#: admin/verify.php:102 admin/verify.php:117 admin/verify.php:132 +#: admin/verify.php:147 admin/verify.php:202 admin/verify.php:217 +#: admin/verify.php:232 admin/verify.php:247 admin/verify.php:262 +#: admin/verify.php:277 admin/verify.php:292 msgid "No dataset or no activated dataset found - empty configuration written" msgstr "Nenhum registro encontrado ou ativo. Configuração gravada em branco." -#: admin/verify.php:291 -msgid "Cannot find the Nagios binary or no rights for execution!" -msgstr "Não foi possível encontrar o arquivo binário do Nagios ou não hápermissão para executá-lo!" +#: admin/verify.php:311 +msgid "Cannot find the Nagios binary or no execute permissions!" +msgstr "" +"Não é possível encontrar o arquivo binário do Nagios ou não há permissão de " +"execução!" -#: admin/verify.php:304 +#: admin/verify.php:326 msgid "Remote execution (FTP SITE EXEC) is not supported on your system!" msgstr "Execução remota (FTP SITE EXEC) não é suportada pelo sistema!" -#: admin/verify.php:321 +#: admin/verify.php:345 msgid "Remote execution of nagios verify command failed (remote SSH)!" -msgstr "Execução remota do comando de verificação do Nagios falhou (SSH remoto)!" +msgstr "" +"Execução remota do comando de verificação do Nagios falhou (SSH remoto)!" -#: admin/verify.php:324 +#: admin/verify.php:350 msgid "Nagios binary or configuration file not found (remote SSH)!" -msgstr "Arquivo binario do Nagios ou arquivo de configuração nagios.cfg não encontrado (SSH remoto)!" +msgstr "" +"Arquivo binario do Nagios ou arquivo de configuração nagios.cfg não " +"encontrado (SSH remoto)!" -#: admin/verify.php:355 +#: admin/verify.php:388 msgid "Nagios daemon successfully restarted" msgstr "Processo Nagios reiniciado com sucesso" -#: admin/verify.php:356 +#: admin/verify.php:390 msgid "Restart command successfully send to Nagios" msgstr "Reinicialização do Nagios efetuada com sucesso!" -#: admin/verify.php:358 -#: admin/verify.php:363 -#: admin/verify.php:364 +#: admin/verify.php:394 admin/verify.php:402 +msgid "" +"Restart failed - Nagios command file not found or no execute permissions" +msgstr "" +"Reinicialização falhou! Arquivo de comando do Nagios não encontrado ou sem " +"permissões de execução" + +#: admin/verify.php:397 +msgid "Nagios command file not found or no write permissions!" +msgstr "" +"Arquivo de comando do Nagios não encontrado ou sem permissões de escrita!" + +#: admin/verify.php:404 msgid "Restart failed - Nagios command file not found or no rights to execute" -msgstr "Reinicialização falhou! Comando Nagios não encontrado sem permissão de execução!" +msgstr "" +"Reinicialização falhou! Comando Nagios não encontrado sem permissão de " +"execução!" -#: admin/verify.php:359 -msgid "Nagios command file not found or no rights to write!" -msgstr "Comando Nagios não encontrado ou sem permissão de escrita!" - -#: admin/verify.php:367 +#: admin/verify.php:408 msgid "Restart failed - Nagios daemon was not running" msgstr "Reinicialização falhou! Processo Nagios não encontrado" -#: admin/verify.php:368 +#: admin/verify.php:410 msgid "Nagios daemon is not running, cannot send restart command!" msgstr "Processo Nagios não encontrado! Não foi possível reiniciar!" -#: admin/verify.php:371 +#: admin/verify.php:415 msgid "Restart failed - FTP restrictions" msgstr "Reinicialização falhou! Restrições FTP" -#: admin/verify.php:372 +#: admin/verify.php:417 msgid "Nagios restart is not possible via FTP remote connection!" msgstr "Reinicialização do Nagios não é possível via conexão remota FTP" -#: admin/verify.php:389 -msgid "Restart failed - Nagios command file not found or no rights to execute (remote SSH)!" -msgstr "Reinicialização falhou! Comando Nagios não encontrado ou sem permissão de execução (SSH remoto)!" +#: admin/verify.php:440 +msgid "" +"Restart failed - Nagios command file not found or no rights to execute " +"(remote SSH)!" +msgstr "" +"Reinicialização falhou! Comando Nagios não encontrado ou sem permissão de " +"execução (SSH remoto)!" -#: admin/verify.php:391 +#: admin/verify.php:443 msgid "Nagios daemon successfully restarted (remote SSH)" msgstr "Processo Nagios reiniciado com sucesso (SSH remoto)" -#: admin/verify.php:392 +#: admin/verify.php:445 msgid "Restart command successfully send to Nagios (remote SSH)" msgstr "Reinicialização do Nagios efetuada com sucesso (SSH remoto)" -#: admin/verify.php:395 +#: admin/verify.php:450 msgid "Nagios command file not found (remote SSH)!" msgstr "Comando Nagios não encontrado (SSH remoto)!" -#: admin/verify.php:403 +#: admin/verify.php:458 msgid "Check written configuration files" msgstr "Controle do Nagios" -#: admin/verify.php:406 +#: admin/verify.php:459 msgid "Check configuration files:" msgstr "Verificar configuração do Nagios" -#: admin/verify.php:407 +#: admin/verify.php:460 msgid "Restart Nagios:" msgstr "Reiniciar o Nagios" -#: admin/verify.php:408 +#: admin/verify.php:461 msgid "Write monitoring data" msgstr "Gravar configurações de hosts e serviços" -#: admin/verify.php:409 +#: admin/verify.php:462 msgid "Write additional data" msgstr "Gravar configurações adicionais" -#: admin/verify.php:410 -msgid "Warning, always check the configuration files before restart Nagios!" -msgstr "Atenção! Sempre efetue verificação da configuração antes de reiniciar o Nagios" +#: admin/verify.php:464 +msgid "Warning, always check the configuration files before restarting Nagios!" +msgstr "" +"Atenção! Sempre verifique os arquivos de configuração antes de reiniciar o " +"Nagios!" -#: admin/verify.php:411 -#: config/fieldvars.php:54 +#: admin/verify.php:467 config/fieldvars.php:62 msgid "Do it" msgstr "Executar" -#: admin/verify.php:436 -#: admin/verify.php:465 -msgid "Written Nagios configuration checked - Warnings/Errors:" -msgstr "Verificação das configurações do Nagios efetuada! Alertas/Erros:" +#: admin/verify.php:498 admin/verify.php:542 +msgid "Nagios written configuration files checked - Warnings/Errors:" +msgstr "Arquivos de configuração do Nagios verificados - Alertas/Erros:" # config_class.php -#: admin/verify.php:440 -#: admin/verify.php:468 +#: admin/verify.php:504 admin/verify.php:547 msgid "Written configuration files are valid, Nagios can be restarted!" msgstr "Configuração dos arquivos valida! O Nagios pode ser reinicializado." -#: admin/versioncheck.php:64 -#: admin/versioncheck.php:72 +#: admin/verify.php:510 +msgid "" +"The configuration could not be tested successfully. The Nagios binary may " +"have crashed during the test. Please repeat the test or try using the " +"commandline to test. A running Nagios service should not be restarted " +"because the configuration may be invalid." +msgstr "" +"Não foi possível verificar as configurações. O arquivo binário do Nagios não " +"estava ativo durante a verificação. Por favor, repita a verificação ou tente " +"usar a linha de comando para verificar. O serviço Nagios não pôde ser " +"incializado porque as configurações podem conter erros." + +#: admin/versioncheck.php:69 admin/versioncheck.php:79 msgid "check proxy settings" msgstr "verifique as configurações do proxy" -#: admin/versioncheck.php:75 +#: admin/versioncheck.php:82 msgid "Installed" msgstr "Versão atual" -#: admin/versioncheck.php:77 -#: config/fieldvars.php:171 +#: admin/versioncheck.php:84 config/fieldvars.php:187 msgid "Information" msgstr "Informação" -#: admin/versioncheck.php:91 +#: admin/versioncheck.php:106 msgid "You already have the latest version installed" msgstr "Versão atualizada" -#: admin/versioncheck.php:93 -msgid "You are using an old NagiosQL version. Please update to the latest stable version" -msgstr "A versão do NagiosQL instalada está desatualizada. Atualize para a última versão estável." +#: admin/versioncheck.php:109 +msgid "" +"You are using an old NagiosQL version. Please update to the latest stable " +"version" +msgstr "" +"A versão do NagiosQL instalada está desatualizada. Atualize para a última " +"versão estável." -#: admin/versioncheck.php:96 +#: admin/versioncheck.php:114 msgid "You are using a newer development version without official support" -msgstr "A versão atualmente instalada ainda está em teste e não tem suporte oficial" +msgstr "" +"A versão atualmente instalada ainda está em teste e não tem suporte oficial" # fieldvars.php -#: config/fieldvars.php:22 -#: functions/prepend_adm.php:446 +#: config/fieldvars.php:20 functions/prepend_adm.php:538 msgid "Domain" msgstr "Domínio" -#: config/fieldvars.php:24 -#: config/fieldvars.php:29 +#: config/fieldvars.php:22 config/fieldvars.php:30 msgid "Server name" msgstr "Nome do servidor" -#: config/fieldvars.php:25 +#: config/fieldvars.php:23 msgid "Method" msgstr "Método" -#: config/fieldvars.php:28 +#: config/fieldvars.php:25 index.php:52 +msgid "Password" +msgstr "Senha" + +#: config/fieldvars.php:27 msgid "Directory with SSH key pair" msgstr "Diretório com par de chaves SSH" -#: config/fieldvars.php:30 +#: config/fieldvars.php:29 +msgid "Use encrypted FTP (FTPS)" +msgstr "Usar FTP criptografado (FTPS)" + +#: config/fieldvars.php:32 msgid "Configuration directories" msgstr "Configuração de diretórios" -#: config/fieldvars.php:31 +#: config/fieldvars.php:34 +msgid "Nagios configuration files and directories" +msgstr "Diretórios e arquivos de configuração do Nagios" + +#: config/fieldvars.php:35 msgid "Base directory" msgstr "Diretório base" -#: config/fieldvars.php:32 +#: config/fieldvars.php:36 msgid "Host directory" msgstr "Diretório de host" -#: config/fieldvars.php:33 +#: config/fieldvars.php:37 msgid "Service directory" msgstr "Diretório de serviço" -#: config/fieldvars.php:34 +#: config/fieldvars.php:38 msgid "Backup directory" msgstr "Diretório de backup" -#: config/fieldvars.php:35 +#: config/fieldvars.php:39 msgid "Host backup directory" msgstr "Diretório de backup de host" -#: config/fieldvars.php:36 +#: config/fieldvars.php:41 msgid "Service backup directory" msgstr "Diretório de backup de serviço" -#: config/fieldvars.php:37 +#: config/fieldvars.php:42 msgid "Picture base directory" msgstr "Diretório base de imagens" -#: config/fieldvars.php:43 +#: config/fieldvars.php:47 +msgid "Nagios cgi file" +msgstr "Arquivo cgi.cfg do Nagios" + +#: config/fieldvars.php:48 +msgid "Nagios resource file" +msgstr "Arquivo resource.cfg do Nagios" + +#: config/fieldvars.php:50 msgid "Use common domain" msgstr "Domínio comum usado" -#: config/fieldvars.php:44 +#: config/fieldvars.php:52 msgid "Decode UTF8 data in config files" msgstr "Dados decode UTF8 em arquivos de configuração" -#: config/fieldvars.php:45 +#: config/fieldvars.php:53 msgid "Access key holes" msgstr "Chaves de acesso" # user.php -#: config/fieldvars.php:46 +#: config/fieldvars.php:54 msgid "Access keys" msgstr "Chaves de acesso" -#: config/fieldvars.php:48 +#: config/fieldvars.php:56 msgid "Registered" msgstr "Registrado" -#: config/fieldvars.php:52 +#: config/fieldvars.php:60 msgid "Function" msgstr "Ação" -#: config/fieldvars.php:53 +#: config/fieldvars.php:61 msgid "Marked" msgstr "Selecionados" -#: config/fieldvars.php:55 +#: config/fieldvars.php:63 msgid "Add" msgstr "Novo" -#: config/fieldvars.php:56 -msgid "Formcheck" -msgstr "Alerta de verificação" +#: config/fieldvars.php:64 +msgid "Form check" +msgstr "Formulário de verificação" -#: config/fieldvars.php:57 +#: config/fieldvars.php:65 msgid "Secure question" msgstr "Alerta de confirmação" -#: config/fieldvars.php:58 -#: functions/content_class.php:241 -#: functions/content_class.php:242 +#: config/fieldvars.php:66 functions/NagContentClass.php:172 +#: functions/NagContentClass.php:177 msgid "Yes" msgstr "Sim" -#: config/fieldvars.php:59 -#: functions/content_class.php:241 -#: functions/content_class.php:242 +#: config/fieldvars.php:67 functions/NagContentClass.php:170 +#: functions/NagContentClass.php:175 msgid "No" msgstr "Não" -#: config/fieldvars.php:60 +#: config/fieldvars.php:68 msgid "Time" msgstr "Data/hora" -#: config/fieldvars.php:61 +#: config/fieldvars.php:69 msgid "User" msgstr "Usuário" -#: config/fieldvars.php:62 -msgid "IP" -msgstr "IP" +#: config/fieldvars.php:70 +msgid "IP Address" +msgstr "Endereço IP" -#: config/fieldvars.php:63 -#: functions/import_class.php:318 -#: functions/import_class.php:323 -#: functions/import_class.php:635 -#: functions/import_class.php:636 -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: config/fieldvars.php:71 functions/NagImportClass.php:350 +#: functions/NagImportClass.php:355 functions/NagImportClass.php:419 +#: functions/NagImportClass.php:425 functions/NagImportClass.php:432 +#: functions/NagImportClass.php:437 msgid "Entry" msgstr "Entrada" -#: config/fieldvars.php:64 +#: config/fieldvars.php:72 msgid "From" msgstr "De" -#: config/fieldvars.php:65 +#: config/fieldvars.php:73 msgid "To" msgstr "Até" -#: config/fieldvars.php:66 +#: config/fieldvars.php:74 msgid "Delete log entries" msgstr "Excluir" -#: config/fieldvars.php:67 -#: config/fieldvars.php:80 -#: config/fieldvars.php:168 +#: config/fieldvars.php:75 config/fieldvars.php:88 config/fieldvars.php:184 msgid "Copy" msgstr "Copiar" -#: config/fieldvars.php:70 +#: config/fieldvars.php:78 msgid "Confirm password" msgstr "Confirmar senha" # password.php -#: config/fieldvars.php:71 +#: config/fieldvars.php:79 msgid "Old password" msgstr "Senha atual" -#: config/fieldvars.php:72 -#: config/fieldvars.php:281 +#: config/fieldvars.php:80 config/fieldvars.php:320 msgid "New password" msgstr "Alterar senha" -#: config/fieldvars.php:73 +#: config/fieldvars.php:81 msgid "Change password" msgstr "Alterar senha do usuário atual" -#: config/fieldvars.php:74 +#: config/fieldvars.php:82 msgid "Menu page" msgstr "Item de menu" -#: config/fieldvars.php:75 +#: config/fieldvars.php:83 msgid "Search string" msgstr "Procurar" -#: config/fieldvars.php:78 -#: config/fieldvars.php:172 +#: config/fieldvars.php:86 config/fieldvars.php:188 msgid "Write config file" msgstr "Gravar arquivos" -#: config/fieldvars.php:81 +#: config/fieldvars.php:89 msgid "Command" msgstr "Nome" -#: config/fieldvars.php:83 +#: config/fieldvars.php:91 msgid "Command type" msgstr "Tipo de Comando" -#: config/fieldvars.php:85 +#: config/fieldvars.php:93 msgid "Exclude" msgstr "Exclusão" -#: config/fieldvars.php:86 +#: config/fieldvars.php:94 msgid "Include" msgstr "Inclusão" -#: config/fieldvars.php:87 +#: config/fieldvars.php:95 msgid "Time definitions" msgstr "Configurações de horário" -#: config/fieldvars.php:88 +#: config/fieldvars.php:96 msgid "Weekday" msgstr "Dia da semana" -#: config/fieldvars.php:89 +#: config/fieldvars.php:97 msgid "Time range" msgstr "Intervalo de tempo" -#: config/fieldvars.php:90 +#: config/fieldvars.php:98 msgid "Time definition" msgstr "Dia da semana" -#: config/fieldvars.php:91 +#: config/fieldvars.php:99 msgid "Insert" msgstr "Incluir" -#: config/fieldvars.php:92 +#: config/fieldvars.php:100 msgid "Modify selection" msgstr "Alterar seleção" -#: config/fieldvars.php:95 +#: config/fieldvars.php:103 +msgid "Minimum importance" +msgstr "Importância mínima" + +#: config/fieldvars.php:104 msgid "Time period hosts" msgstr "Período de hosts" -#: config/fieldvars.php:96 +#: config/fieldvars.php:105 msgid "Time period services" msgstr "Período de serviços" -#: config/fieldvars.php:97 +#: config/fieldvars.php:106 msgid "Host options" msgstr "Opções de host" -#: config/fieldvars.php:98 +#: config/fieldvars.php:107 msgid "Service options" msgstr "Opções de serviço" -#: config/fieldvars.php:99 +#: config/fieldvars.php:108 msgid "Host command" msgstr "Comando de hosts" -#: config/fieldvars.php:100 +#: config/fieldvars.php:109 msgid "Service command" msgstr "Comando de serviços" -#: config/fieldvars.php:101 +#: config/fieldvars.php:110 msgid "EMail address" msgstr "Endereço de Email" -#: config/fieldvars.php:102 +#: config/fieldvars.php:111 msgid "Pager number" msgstr "Número do pager" -#: config/fieldvars.php:103 +#: config/fieldvars.php:112 msgid "Addon address" msgstr "Endereço adicional" -#: config/fieldvars.php:104 +#: config/fieldvars.php:113 msgid "Host notif. enable" msgstr "Notif. de host habilitadas" -#: config/fieldvars.php:105 +#: config/fieldvars.php:114 msgid "Service notif. enable" msgstr "Notif. de serviço hablitadas" -#: config/fieldvars.php:106 +#: config/fieldvars.php:115 msgid "Can submit commands" msgstr "Pode executar comandos" -#: config/fieldvars.php:107 +#: config/fieldvars.php:116 msgid "Retain status info" msgstr "Reter informações de estado" -#: config/fieldvars.php:108 -msgid "Retain nonstatus info" -msgstr "Não reter informações de estado" +#: config/fieldvars.php:117 +msgid "Retain non-status info" +msgstr "Reter informações de não-estado" # contactgroups.php -#: config/fieldvars.php:109 +#: config/fieldvars.php:118 msgid "Members" msgstr "Membros" -#: config/fieldvars.php:110 +#: config/fieldvars.php:119 msgid "Group members" msgstr "Grupo de membros" -#: config/fieldvars.php:111 +#: config/fieldvars.php:120 msgid "Common settings" msgstr "Configurações gerais" -#: config/fieldvars.php:112 +#: config/fieldvars.php:121 msgid "Service settings" msgstr "Opções de serviço" -#: config/fieldvars.php:113 +#: config/fieldvars.php:123 msgid "Add this host configuration to existing service definitions" msgstr "Adicionar serviços existentes ao host" -#: config/fieldvars.php:115 +#: config/fieldvars.php:125 msgid "Parents" msgstr "Host pai" -#: config/fieldvars.php:117 +#: config/fieldvars.php:126 +msgid "Parent services" +msgstr "Serviços pais" + +#: config/fieldvars.php:128 msgid "Check command" msgstr "Comando de verificação" -#: config/fieldvars.php:118 +#: config/fieldvars.php:129 msgid "Command view" msgstr "Linha de comando:" -#: config/fieldvars.php:119 +#: config/fieldvars.php:130 msgid "Additional templates" msgstr "Modelos adicionais:" -#: config/fieldvars.php:120 +#: config/fieldvars.php:131 msgid "Check settings" msgstr "Configurações de verificação" -#: config/fieldvars.php:121 +#: config/fieldvars.php:132 msgid "Initial state" msgstr "Estado inicial" -#: config/fieldvars.php:122 +#: config/fieldvars.php:133 msgid "Retry interval" msgstr "Tempo entre tentativas" -#: config/fieldvars.php:123 +#: config/fieldvars.php:134 msgid "Max check attempts" msgstr "Nº de tentativas" -#: config/fieldvars.php:124 +#: config/fieldvars.php:135 msgid "Check interval" msgstr "Tempo entre verificações" -#: config/fieldvars.php:125 +#: config/fieldvars.php:136 msgid "Active checks enabled" msgstr "Verificação ativa" -#: config/fieldvars.php:126 +#: config/fieldvars.php:137 msgid "Passive checks enabled" msgstr "Verificação passiva" -#: config/fieldvars.php:127 +#: config/fieldvars.php:138 msgid "Check period" msgstr "Período " -#: config/fieldvars.php:128 +#: config/fieldvars.php:139 msgid "Freshness treshold" msgstr "Início de freshness" -#: config/fieldvars.php:129 +#: config/fieldvars.php:140 msgid "Check freshness" msgstr "Freshness" -#: config/fieldvars.php:130 +#: config/fieldvars.php:141 msgid "Obsess over host" msgstr "Obsessão" -#: config/fieldvars.php:131 +#: config/fieldvars.php:142 msgid "Obsess over service" msgstr "Obsessão" -#: config/fieldvars.php:132 +#: config/fieldvars.php:143 msgid "Event handler" msgstr "Tratador de eventos" -#: config/fieldvars.php:133 +#: config/fieldvars.php:144 msgid "Event handler enabled" msgstr "Tratar eventos" -#: config/fieldvars.php:134 +#: config/fieldvars.php:145 msgid "Low flap threshold" msgstr "Início da oscilação" -#: config/fieldvars.php:135 +#: config/fieldvars.php:146 msgid "High flap threshold" msgstr "Fim da oscilação" -#: config/fieldvars.php:136 +#: config/fieldvars.php:147 msgid "Flap detection enabled" msgstr "Detecção de oscilação" -#: config/fieldvars.php:137 +#: config/fieldvars.php:148 msgid "Flap detection options" msgstr "Opções de oscilação" -#: config/fieldvars.php:138 +#: config/fieldvars.php:150 msgid "Retain status information" msgstr "Retenção de estado" -#: config/fieldvars.php:139 -msgid "Retain nostatus information" -msgstr "Manter estados " +#: config/fieldvars.php:152 +msgid "Retain non-status information" +msgstr "Reter informação de não-estado" -#: config/fieldvars.php:140 +#: config/fieldvars.php:153 msgid "Process perf data" msgstr "Dados de desempenho" -#: config/fieldvars.php:141 +#: config/fieldvars.php:154 msgid "Alarm settings" msgstr "Configurações de alertas" -#: config/fieldvars.php:142 +#: config/fieldvars.php:155 msgid "Contacts" msgstr "Contatos" -#: config/fieldvars.php:144 +#: config/fieldvars.php:157 msgid "Notification period" msgstr "Período de notificações" -#: config/fieldvars.php:145 +#: config/fieldvars.php:158 msgid "Notification options" msgstr "Opções de notificações" -#: config/fieldvars.php:146 +#: config/fieldvars.php:159 msgid "Notification interval" msgstr "Intervalo entre notificações" -#: config/fieldvars.php:147 +#: config/fieldvars.php:161 msgid "First notification delay" msgstr "Retardo na primeira notificação" -#: config/fieldvars.php:148 +#: config/fieldvars.php:162 msgid "Notification enabled" msgstr "Notificações habilitadas" -#: config/fieldvars.php:149 +#: config/fieldvars.php:163 +msgid "Importance" +msgstr "Importância" + +#: config/fieldvars.php:164 msgid "Stalking options" msgstr "Opções de stalking" -#: config/fieldvars.php:150 +#: config/fieldvars.php:165 msgid "Addon settings" msgstr "Configurações adicionais" -#: config/fieldvars.php:152 +#: config/fieldvars.php:167 msgid "VRML image" msgstr "Imagem VRML" -#: config/fieldvars.php:153 +#: config/fieldvars.php:168 msgid "Notes URL" msgstr "Notas da URL" -#: config/fieldvars.php:154 +#: config/fieldvars.php:169 msgid "Status image" msgstr "Imagem do mapa da rede" -#: config/fieldvars.php:155 +#: config/fieldvars.php:170 msgid "Icon image" msgstr "Imagem do ícone" -#: config/fieldvars.php:156 +#: config/fieldvars.php:171 msgid "Action URL" msgstr "Ação da URL" -#: config/fieldvars.php:157 +#: config/fieldvars.php:172 msgid "2D coords" msgstr "Coordenadas 2D" -#: config/fieldvars.php:158 +#: config/fieldvars.php:173 msgid "3D coords" msgstr "Coordenadas 3D" -#: config/fieldvars.php:159 +#: config/fieldvars.php:174 msgid "Icon image ALT text" msgstr "Texto ALT do ícone" -#: config/fieldvars.php:160 +#: config/fieldvars.php:175 msgid "standard" msgstr "padrão" -#: config/fieldvars.php:161 +#: config/fieldvars.php:176 msgid "on" msgstr "sim" -#: config/fieldvars.php:162 +#: config/fieldvars.php:177 msgid "off" msgstr "não" -#: config/fieldvars.php:163 +#: config/fieldvars.php:178 msgid "skip" msgstr "herdar" -#: config/fieldvars.php:164 +#: config/fieldvars.php:180 msgid "Free variable definitions" msgstr "Variáveis personalizadas" -#: config/fieldvars.php:165 +#: config/fieldvars.php:181 msgid "Variable name" msgstr "Nome da variável" -#: config/fieldvars.php:166 +#: config/fieldvars.php:182 msgid "Variable value" msgstr "Valor da variável" -#: config/fieldvars.php:169 +#: config/fieldvars.php:185 msgid "Activate" msgstr "Ativar" -#: config/fieldvars.php:170 +#: config/fieldvars.php:186 msgid "Deactivate" msgstr "Desativar" -#: config/fieldvars.php:173 +#: config/fieldvars.php:190 msgid "Do you really want to delete this database entry:" msgstr "Confirma exclusão do registro da base de dados:" -#: config/fieldvars.php:174 +#: config/fieldvars.php:192 msgid "Do you really want to delete all marked entries?" msgstr "Confirma exclusão dos registros selecionados da base de dados?" -#: config/fieldvars.php:175 +#: config/fieldvars.php:194 msgid "Mark all shown datasets" msgstr "Selecionar todos" -#: config/fieldvars.php:176 +#: config/fieldvars.php:195 msgid "File" msgstr "Arquivo" -#: config/fieldvars.php:177 +#: config/fieldvars.php:196 msgid "Write all config files" msgstr "Gravar arquivos" -#: config/fieldvars.php:178 +#: config/fieldvars.php:197 msgid "Address" msgstr "Endereço" -#: config/fieldvars.php:179 +#: config/fieldvars.php:198 msgid "Display name" msgstr "Nome de exibição" -#: config/fieldvars.php:180 -msgid "Use this configuration as template" -msgstr "Usar esta configuração como modelo" +#: config/fieldvars.php:200 +msgid "Use this configuration as a template" +msgstr "Usar esta configuração como um modelo" -#: config/fieldvars.php:181 +#: config/fieldvars.php:201 msgid "Generic name" msgstr "Nome genérico" -#: config/fieldvars.php:185 +#: config/fieldvars.php:208 msgid "Please check at least one option from:" msgstr "Verifique pelo menos uma das opções:" -#: config/fieldvars.php:186 +#: config/fieldvars.php:209 msgid "Host group name" msgstr "Nome" -#: config/fieldvars.php:187 +#: config/fieldvars.php:210 msgid "Host group members" msgstr "Grupos de hosts membros" -#: config/fieldvars.php:191 +#: config/fieldvars.php:214 msgid "Is volatile" msgstr "É volátil" -#: config/fieldvars.php:192 +#: config/fieldvars.php:215 msgid "Parallelize checks" msgstr "Verificações paralelas" -#: config/fieldvars.php:193 +#: config/fieldvars.php:216 msgid "Config name filter" msgstr "Filtro" -#: config/fieldvars.php:195 +#: config/fieldvars.php:218 msgid "Import directory" msgstr "Diretório de importação" -#: config/fieldvars.php:196 +#: config/fieldvars.php:220 msgid "Please insert a variable name and a variable definition" msgstr "Informe um nome de variável e seu valor" -#: config/fieldvars.php:197 -#: config/fieldvars.php:201 -#: config/fieldvars.php:233 +#: config/fieldvars.php:222 config/fieldvars.php:229 config/fieldvars.php:269 msgid "Warning:" msgstr "Atenção!

" -#: config/fieldvars.php:197 -msgid "You have not filled in some required fields!

If this values are set by a template, you can save anyway - otherwise you will get an invalid configuration!" -msgstr "Um ou mais campos de preenchimento obrigatório não foram preenchidos!
Em alguns casos, isso pode causar configurações inválidas nos arquivos do Nagios.

Deseja continuar?" +#: config/fieldvars.php:222 +msgid "" +"You have not filled in some required fields!

If this values are set " +"by a template, you can save anyway - otherwise you will get an invalid " +"configuration!" +msgstr "" +"Um ou mais campos de preenchimento obrigatório não foram preenchidos!
Em " +"alguns casos, isso pode causar configurações inválidas nos arquivos do " +"Nagios.

Deseja continuar?" -#: config/fieldvars.php:199 -msgid "Nagios base directory" -msgstr "Diretório base do Nagios" - -#: config/fieldvars.php:200 +#: config/fieldvars.php:227 msgid "Write config" msgstr "Gravar configuração" -#: config/fieldvars.php:201 -msgid "You have not filled in all command arguments (ARGx) for your selected command!

If this arguments are optional, you can save anyway - otherwise you will get an invalid configuration!" -msgstr "Nem todos os argumentos (ARGx) do comando selecionado foram preenchidos!

Se forem argumentos opcionais, não há problema. Caso contrário, a falta de preenchimento poderá acarretar uma configuração inválida." +#: config/fieldvars.php:229 +msgid "" +"You have not filled in all command arguments (ARGx) for your selected " +"command!

If this arguments are optional, you can save anyway - " +"otherwise you will get an invalid configuration!" +msgstr "" +"Nem todos os argumentos (ARGx) do comando selecionado foram preenchidos!" +"

Se forem argumentos opcionais, não há problema. Caso contrário, a " +"falta de preenchimento poderá acarretar uma configuração inválida." -#: config/fieldvars.php:202 +#: config/fieldvars.php:232 msgid "Service group members" msgstr "Grupos de serviços membros" -#: config/fieldvars.php:203 +#: config/fieldvars.php:233 msgid "Service group name" msgstr "Nome" -#: config/fieldvars.php:206 +#: config/fieldvars.php:236 msgid "Hostgroups" msgstr "Grupos de hosts" -#: config/fieldvars.php:207 +#: config/fieldvars.php:237 msgid "Inherit parents" msgstr "Herdar dependências do host pai" -#: config/fieldvars.php:208 +#: config/fieldvars.php:239 msgid "Execution failure criteria" msgstr "Critérios de falhas de execução" -#: config/fieldvars.php:209 +#: config/fieldvars.php:241 msgid "Nofification failure criteria" msgstr "Critérios de falhas de notificação" -#: config/fieldvars.php:210 +#: config/fieldvars.php:242 msgid "Dependency period" msgstr "Dependência de períodos" -#: config/fieldvars.php:211 +#: config/fieldvars.php:243 msgid "Escalation period" msgstr "Escala de períodos" -#: config/fieldvars.php:212 +#: config/fieldvars.php:244 msgid "Escalation options" msgstr "Opções de escala" -#: config/fieldvars.php:213 +#: config/fieldvars.php:245 msgid "First notification" msgstr "Primeira notificação" -#: config/fieldvars.php:214 +#: config/fieldvars.php:246 msgid "Last notification" msgstr "Última notificação" -#: config/fieldvars.php:217 +#: config/fieldvars.php:250 msgid "Dependent servicegroups" msgstr "Grupos de serviços dependentes" -#: config/fieldvars.php:218 +#: config/fieldvars.php:251 msgid "Help" msgstr "Ajuda" -#: config/fieldvars.php:219 +#: config/fieldvars.php:252 msgid "Calendar" msgstr "Calendário" -#: config/fieldvars.php:220 +#: config/fieldvars.php:253 msgid "Group name" msgstr "Nome do Grupo" -#: config/fieldvars.php:221 +#: config/fieldvars.php:254 msgid "Users" msgstr "Usuários" -#: config/fieldvars.php:222 +#: config/fieldvars.php:255 msgid "Access group" msgstr "Grupo de acesso" -#: config/fieldvars.php:223 +#: config/fieldvars.php:256 msgid "User definitions" msgstr "Definições de usuário" -#: config/fieldvars.php:224 +#: config/fieldvars.php:257 msgid "User name" msgstr "Usuário" -#: config/fieldvars.php:225 +#: config/fieldvars.php:258 msgid "User rights" msgstr "Direitos de usuário" -#: config/fieldvars.php:226 +#: config/fieldvars.php:260 msgid "Object access restrictions" msgstr "Restrições de acesso a objetos" -#: config/fieldvars.php:227 +#: config/fieldvars.php:262 msgid "Enable group administration" msgstr "Habilitar administração de grupos" -#: config/fieldvars.php:228 +#: config/fieldvars.php:263 msgid "Show relation data" msgstr "Exibir dados relacionados" -#: config/fieldvars.php:229 +#: config/fieldvars.php:264 msgid "Hide relation data" msgstr "Ocultar dados relacionados" -#: config/fieldvars.php:231 +#: config/fieldvars.php:266 msgid "User language" msgstr "Idioma do usuário" -#: config/fieldvars.php:232 +#: config/fieldvars.php:267 msgid "Standard domain" msgstr "Domínio padrão" -#: config/fieldvars.php:233 -msgid "The associated services must be additionally written to the files. Only writing the host configuration is not sufficient because the modification is stored inside the service files!" -msgstr "Os serviços associados aos hosts sempre devem ser cadastrados previamente. Apenas associar o serviço ao host não é suficiente." +#: config/fieldvars.php:269 +msgid "" +"The associated services must be additionally written to the files. Only " +"writing the host configuration is not sufficient because the modification is " +"stored inside the service files!" +msgstr "" +"Os serviços associados aos hosts sempre devem ser cadastrados previamente. " +"Apenas associar o serviço ao host não é suficiente." -#: config/fieldvars.php:235 +#: config/fieldvars.php:273 msgid "Monday" msgstr "Segunda" -#: config/fieldvars.php:236 +#: config/fieldvars.php:274 msgid "Tuesday" msgstr "Terça" -#: config/fieldvars.php:237 +#: config/fieldvars.php:275 msgid "Wednesday" msgstr "Quarta" -#: config/fieldvars.php:238 +#: config/fieldvars.php:276 msgid "Thursday" msgstr "Quinta" -#: config/fieldvars.php:239 +#: config/fieldvars.php:277 msgid "Friday" msgstr "Sexta" -#: config/fieldvars.php:240 +#: config/fieldvars.php:278 msgid "Saturday" msgstr "Sábado" -#: config/fieldvars.php:241 +#: config/fieldvars.php:279 msgid "Sunday" msgstr "Domingo" -#: config/fieldvars.php:252 +#: config/fieldvars.php:291 msgid "Main page" msgstr "Início" -#: config/fieldvars.php:253 +#: config/fieldvars.php:292 msgid "Supervision" msgstr "Configurações" -#: config/fieldvars.php:256 +#: config/fieldvars.php:295 msgid "Commands" msgstr "Comandos" -#: config/fieldvars.php:257 +#: config/fieldvars.php:296 msgid "Specialties" msgstr "Extras" -#: config/fieldvars.php:258 +#: config/fieldvars.php:297 msgid "Tools" msgstr "Ferramentas" -#: config/fieldvars.php:269 +#: config/fieldvars.php:308 msgid "Service dependency" msgstr "Serviço - dependência" -#: config/fieldvars.php:270 +#: config/fieldvars.php:309 msgid "Service escalation" msgstr "Serviço - escala" -#: config/fieldvars.php:271 +#: config/fieldvars.php:310 msgid "Host dependency" msgstr "Host - dependência" -#: config/fieldvars.php:272 +#: config/fieldvars.php:311 msgid "Host escalation" msgstr "Host - escala" -#: config/fieldvars.php:273 +#: config/fieldvars.php:312 msgid "Extended Host" msgstr "Host - extra" -#: config/fieldvars.php:274 +#: config/fieldvars.php:313 msgid "Extended Service" msgstr "Serviço - extra" -#: config/fieldvars.php:275 +#: config/fieldvars.php:314 msgid "Data import" msgstr "Importar arquivos" -#: config/fieldvars.php:278 +#: config/fieldvars.php:317 msgid "User admin" msgstr "Usuários" -#: config/fieldvars.php:279 +#: config/fieldvars.php:318 msgid "Group admin" msgstr "Grupos de usuários" -#: config/fieldvars.php:280 +#: config/fieldvars.php:319 msgid "Nagios control" msgstr "Controle do Nagios" -#: config/fieldvars.php:282 +#: config/fieldvars.php:321 msgid "Logbook" msgstr "Log do sistema" -#: config/fieldvars.php:283 +#: config/fieldvars.php:322 msgid "Nagios config" msgstr "Arquivo nagios.cfg" -#: config/fieldvars.php:284 +#: config/fieldvars.php:323 msgid "Settings" msgstr "Parâmetros" -#: config/fieldvars.php:285 +#: config/fieldvars.php:324 msgid "Definitions" msgstr "Configurações" -#: config/fieldvars.php:286 +#: config/fieldvars.php:325 msgid "CGI config" msgstr "Arquivo cgi.cfg" -#: config/fieldvars.php:287 +#: config/fieldvars.php:326 msgid "Menu access" msgstr "Controle de acesso" -#: config/fieldvars.php:288 +#: config/fieldvars.php:327 msgid "Domains" msgstr "Domínios" -#: config/fieldvars.php:292 +#: config/fieldvars.php:331 msgid "Help editor" msgstr "Editor de ajuda" # fieldvars.php -#: config/fieldvars.php:293 +#: config/fieldvars.php:332 msgid "Data domains" msgstr "Domínios" -#: config/fieldvars.php:294 +#: config/fieldvars.php:333 msgid "Config targets" msgstr "Dados do Domínio" -#: config/fieldvars.php:295 +#: config/fieldvars.php:334 msgid "Support" msgstr "Suporte" -# config_class.php -#: functions/config_class.php:164 -#: functions/config_class.php:168 -msgid "Warning: configuration file is out of date!" -msgstr "Atenção: configurações ainda não gravadas!" +#: functions/MysqliDbClass.php:291 +msgid "Missing server connection parameter!" +msgstr "Faltou parâmetro para conexão com o Servidor!" -#: functions/config_class.php:173 -#: functions/config_class.php:729 -msgid "Warning: no configuration target defined!" -msgstr "Atenção: configurações não definidas!" +#: functions/MysqliDbClass.php:310 +msgid "Connection to the database server has failed by reason:" +msgstr "A conexão com o Servidor da base de dados falhou pelo seguinte motivo:" -#: functions/config_class.php:340 -msgid "Cannot backup and delete the old configuration file (check the permissions)!" -msgstr "Não foi possível fazer backup ou excluir arquivos de configurações anteriores Verifique as permissões!" +#: functions/MysqliDbClass.php:338 +msgid "Missing database connection parameter!" +msgstr "Faltou parâmetro para conexão com a base de dados!" -#: functions/config_class.php:358 -msgid "Cannot backup the old configuration file because the permissions are wrong (remote FTP)!" -msgstr "Não foi possível fazer backup de arquivos de configurações anteriores porque as permissões estão incorretas (FTP remoto)!" +#: functions/MysqliDbClass.php:347 +msgid "Connection to the database has failed by reason:" +msgstr "Conexão com a base de dados falhou pelo seguinte motivo:" -#: functions/config_class.php:380 -msgid "Cannot backup the old configuration file because the permissions are wrong (remote SFTP)!" -msgstr "Não foi possível fazer backup de arquivos de configurações anteriores porque as permissões estão incorretas (SFTP remoto)!" - -#: functions/config_class.php:411 -msgid "Cannot delete the file (wrong permissions)!" -msgstr "Não foi possível excluir o arquivo. Permissão negada!" - -#: functions/config_class.php:415 -msgid "Cannot delete the file (file does not exist)!" -msgstr "Não foi possível excluir o arquivo. Arquivo não existe!" - -#: functions/config_class.php:432 -msgid "Cannot delete file because the permissions are wrong (remote FTP)!" -msgstr "Não foi possível excluir o arquivo porque as permissões estão incorretas (FTP remoto)!" - -#: functions/config_class.php:438 -msgid "Cannot delete file because it does not exists (remote FTP)!" -msgstr "Não foi possível excluir o arquivo porque ele não existe (FTP remoto)!" - -#: functions/config_class.php:451 -msgid "Cannot delete file because the permissions are wrong (remote SFTP)!" -msgstr "Não foi possível excluir o arquivo porque as permissões estão incorretas (SFTP remoto)!" - -#: functions/config_class.php:454 -msgid "Cannot delete file because it does not exists (remote SFTP)!" -msgstr "Não foi possível excluir o arquivo porque ele não existe (SFTP remoto)!" - -#: functions/config_class.php:488 -msgid "Cannot get the configuration file (FTP connection failed)!" -msgstr "Não foi possível obter o arquivo de configuração (conexão FTP falhou)!" - -#: functions/config_class.php:499 -msgid "Cannot write the configuration file (FTP connection failed)!" -msgstr "Não foi possível gravar o arquivo de configuração (conexão FTP falhou)!" - -#: functions/config_class.php:518 -msgid "Cannot get the configuration file (SSH connection failed)!" -msgstr "Não foi possível obter o arquivo de configuração (conexão SSH falhou)!" - -#: functions/config_class.php:524 -msgid "Cannot get the configuration file (remote file does not exist)!" -msgstr "Não foi possível obter o arquivo de configuração (arquivo remoto não existe)!" - -#: functions/config_class.php:533 -msgid "Cannot write the configuration file (SSH connection failed)!" -msgstr "Não foi possível gravar o arquivo de configuração (conexão SSH falhou)!" - -#: functions/config_class.php:563 -#: functions/config_class.php:761 -msgid "It is not possible to write config files directly from the common domain!" -msgstr "Não é possível gravar arquivos de configuração diretamente a partir do domínio comum!" - -#: functions/config_class.php:929 -msgid "Writing of the configuration failed - no dataset, not activated dataset found or you do not have write permission." -msgstr "Gravação da configuração falhou! Base de dados ou registro não encontrados, ou sem permissão de gravação." - -#: functions/config_class.php:1046 -msgid "Configuration write failed (FTP connection failed):" -msgstr "Gravação da configuração falhou (conexão FTP falhou)!" - -#: functions/config_class.php:1047 -#: functions/config_class.php:1111 -msgid "Cannot open/overwrite the configuration file (FTP connection failed)!" -msgstr "Não foi possível abrir/sobrescrever o arquivo de configuração(conexão FTP falhou)!" - -#: functions/config_class.php:1133 -msgid "Cannot open/overwrite the configuration file (remote SFTP)!" -msgstr "Não foi possível abrir/sobrescrever o arquivo de configuração (SFTP remoto)" - -#: functions/config_class.php:1608 -#: functions/config_class.php:1609 -#: functions/config_class.php:1652 -#: functions/config_class.php:1653 -msgid "Connection to remote system failed (SSH2 connection):" -msgstr "Conexão com o sistema falhou (conexão SSH2):" - -#: functions/config_class.php:1624 -#: functions/config_class.php:1625 -msgid "SSH public key does not exist or is not readable" -msgstr "Chave SSH pública não existe ou sem permissão de leitura" - -#: functions/config_class.php:1629 -#: functions/config_class.php:1630 -msgid "SSH private key does not exist or is not readable" -msgstr "Vhave privada SSH não existe ou sem permissão de leitura" - -#: functions/config_class.php:1733 -#: functions/config_class.php:1734 +#: functions/NagConfigClass.php:336 functions/NagConfigClass.php:338 msgid "Connection to remote system failed (FTP connection):" msgstr "Conexão com o sistema remoto falhou (conexão FTP):" +#: functions/NagConfigClass.php:387 functions/NagConfigClass.php:389 +msgid "SSH public key does not exist or is not readable" +msgstr "Chave SSH pública não existe ou sem permissão de leitura" + +#: functions/NagConfigClass.php:394 functions/NagConfigClass.php:396 +msgid "SSH private key does not exist or is not readable" +msgstr "Vhave privada SSH não existe ou sem permissão de leitura" + +#: functions/NagConfigClass.php:430 functions/NagConfigClass.php:432 +#: functions/NagConfigClass.php:441 functions/NagConfigClass.php:443 +msgid "Connection to remote system failed (SSH2 connection):" +msgstr "Conexão com o sistema falhou (conexão SSH2):" + +#: functions/NagConfigClass.php:600 +msgid "" +"Cannot backup the old file because the permissions are wrong - destination " +"file: " +msgstr "" +"Não foi possível fazer o backup do arquivo antigo porque as permissões estão " +"incorretas. Arquivo de destino:" + +#: functions/NagConfigClass.php:605 +msgid "" +"Cannot backup the old file because the source file is missing - source file: " +msgstr "" +"Não foi possível fazer o backup do arquivo antigo porque o arquivo de origem " +"não foi encontrado. Arquivo de origem:" + +#: functions/NagConfigClass.php:623 +msgid "" +"Cannot backup the old file because the source file is missing (remote FTP) - " +"source file: " +msgstr "" +"Não foi possível fazer o backup do arquivo antigo porque o arquivo de origem " +"não foi encontrado (FTP remoto). Arquivo de origem:" + +#: functions/NagConfigClass.php:629 +msgid "" +"Cannot backup the old file because the permissions are wrong (remote FTP) - " +"destination file: " +msgstr "" +"Não foi possível fazer o backup do arquivo antigo porque as permissões estão " +"incorretas (FTP remoto). Arquivo de destino:" + +#: functions/NagConfigClass.php:648 +msgid "" +"Cannot backup the old file because the source file is missing (remote SFTP) " +"- source file: " +msgstr "" +"Não foi possível fazer o backup do arquivo antigo porque o arquivo de origem " +"está ausente (SFTP remoto). Arquivo de origem:" + +#: functions/NagConfigClass.php:654 +msgid "" +"Cannot backup the old file because the permissions are wrong (remote SFTP) - " +"destination file: " +msgstr "" +"Não foi possível fazer o backup do arquivo antigo porque as permissões estão " +"incorretas (SFTP remoto). Arquivo de destino:" + +#: functions/NagConfigClass.php:685 +msgid "Cannot delete the file (wrong permissions)!" +msgstr "Não foi possível excluir o arquivo. Permissão negada!" + +#: functions/NagConfigClass.php:690 +msgid "Cannot delete the file (file does not exist)!" +msgstr "Não foi possível excluir o arquivo. Arquivo não existe!" + +#: functions/NagConfigClass.php:706 +msgid "Cannot delete file because it does not exists (remote FTP)!" +msgstr "Não foi possível excluir o arquivo porque ele não existe (FTP remoto)!" + +#: functions/NagConfigClass.php:712 +msgid "Cannot delete file because the permissions are incorrect (remote FTP)!" +msgstr "" +"Não foi possível excluir o arquivo porque as permissões estão incorretas " +"(FTP remoto)!" + +#: functions/NagConfigClass.php:724 +msgid "Cannot delete file because it does not exists (remote SSH/SFTP)!" +msgstr "" +"Não foi possível excluir o arquivo porque ele não foi encontrado (SSH/SFTP " +"remoto)!" + +#: functions/NagConfigClass.php:730 +msgid "" +"Cannot delete file because the permissions are incorrect (remote SSH/SFTP)!" +msgstr "" +"Não foi possível excluir o arquivo porque as permissões estão incorretas " +"(SSH/SFTP remoto)!" + +#: functions/NagConfigClass.php:822 functions/NagConfigClass.php:846 +msgid "" +"Cannot get the remote file (it does not exist or is not readable) - remote " +"file: " +msgstr "" +"Não foi possível obter o arquivo remoto (ele não existe ou não tem permissão " +"de leitura) .Arquivo remoto:" + +#: functions/NagConfigClass.php:831 +msgid "" +"Cannot write the remote file (remote file is not writeable)- remote file: " +msgstr "" +"Não foi possível gravar o arquivo remoto (sem permissão de escrita) . " +"Arquivo remoto:" + +#: functions/NagConfigClass.php:849 +msgid "Remote file is not readable - remote file: " +msgstr "O arquivo remoto não pôde ser lido. Arquivo remoto:" + +#: functions/NagConfigClass.php:860 +msgid "" +"Cannot write a remote file (remote file is not writeable) - remote file: " +msgstr "" +"Não foi possível gravar o arquivo remoto (sem permissão de escrita). Arquivo " +"remoto:" + +#: functions/NagConfigClass.php:866 +msgid "" +"Cannot copy a local file to remote because the local file does not exist or " +"is not readable - local file: " +msgstr "" +"Não foi possível copiar o arquivo local para remoto porque o arquivo local " +"não existe ou não tem permissão de leitura. Arquivo local:" + # contacts.php -#: functions/config_class.php:1867 +#: functions/NagConfigClass.php:894 msgid "Could not open directory" msgstr "Não foi possível abrir o diretório" -#: functions/content_class.php:274 -#: functions/content_class.php:278 +# config_class.php +#: functions/NagConfigClass.php:1003 functions/NagConfigClass.php:1006 +msgid "Warning: configuration file is out of date!" +msgstr "Atenção: configurações ainda não gravadas!" + +#: functions/NagConfigClass.php:1010 functions/NagConfigClass.php:1042 +#: functions/NagConfigClass.php:1108 +msgid "Warning: no configuration target defined!" +msgstr "Atenção: configurações não definidas!" + +#: functions/NagConfigClass.php:1030 functions/NagConfigClass.php:1076 +msgid "" +"It is not possible to write config files directly from the common domain!" +msgstr "" +"Não é possível gravar arquivos de configuração diretamente a partir do " +"domínio comum!" + +#: functions/NagConfigClass.php:2069 +msgid "Cannot open/overwrite the configuration file (FTP connection failed)!" +msgstr "" +"Não foi possível abrir/gravar o arquivo de configuração (falha na conexão " +"FTP)!" + +#: functions/NagConfigClass.php:2091 +msgid "Cannot open/overwrite the configuration file (remote SFTP)!" +msgstr "" +"Não foi possível abrir/sobrescrever o arquivo de configuração (SFTP remoto)" + +#: functions/NagContentClass.php:251 msgid "out-of-date" msgstr "Não gravado" -#: functions/content_class.php:275 +#: functions/NagContentClass.php:253 msgid "no target" msgstr "sem alvo" -#: functions/content_class.php:276 -#: functions/content_class.php:277 +#: functions/NagContentClass.php:256 functions/NagContentClass.php:259 msgid "missed" msgstr "Não gravado" -#: functions/content_class.php:279 +#: functions/NagContentClass.php:262 install/functions/NagInstallClass.php:479 msgid "up-to-date" msgstr "Gravado" -#: functions/content_class.php:351 +#: functions/NagContentClass.php:355 msgid "Last database update:" msgstr "Última atualização da base de dados:" -#: functions/content_class.php:354 +#: functions/NagContentClass.php:359 msgid "Last file change of the configuration target " msgstr "Última alteração da configuração do Domínio " -# data_class.php -#: functions/data_class.php:116 -#: functions/data_class.php:140 -msgid "Delete failed because a database error:" -msgstr "Exclusão falhou devido ao seguinte erro:" - -#: functions/data_class.php:119 -#: functions/data_class.php:149 -#: functions/data_class.php:158 -msgid "No data deleted. Probably the dataset does not exist or it is protected from delete." -msgstr "Nenhum registro excluído. O registro não existe ou não pode ser excluído." - -#: functions/data_class.php:123 -msgid "Delete dataset id:" -msgstr "ID de registro excluído:" - -#: functions/data_class.php:123 -msgid "- from table:" -msgstr "da tabela" - -#: functions/data_class.php:123 -#: functions/data_class.php:153 -#: functions/data_class.php:311 -#: functions/data_class.php:638 -#: functions/data_class.php:703 -msgid "- with affected rows:" -msgstr "com atualização dos dados:" - -#: functions/data_class.php:153 -#: functions/data_class.php:311 -msgid "Delete data from table:" -msgstr "Deletar registros da tabela:" - -#: functions/data_class.php:306 -msgid "No data deleted. Probably the dataset does not exist, it is protected from deletion, you do not have write permission or it has relations to other configurations which cannot be deleted. Use the \"info\" function for detailed informations about relations!" -msgstr "Nenhum registro excluído! Provavelmente os registros não existam na base de dados. Também podem estar protegidos contra gravação ou têm relacionamento com outros registros que não podem ser excluídos. Em caso de dúvidas, clique no link \"Info\" para mais detalhes." - -#: functions/data_class.php:316 -msgid "No data deleted. Probably the dataset does not exist, it is protected from deletion or you do not have write permission." -msgstr "Nenhum registro excluído! Provavelmente os registros não existam na base de dados. Ou podem estar protegidos contra gravação." - -#: functions/data_class.php:553 -#: functions/data_class.php:554 +#: functions/NagDataClass.php:267 functions/NagDataClass.php:269 msgid "Data set copy failed - table [new name]:" msgstr "Cópia de registro falhou. Tabela [novo nome]:" -#: functions/data_class.php:557 -#: functions/data_class.php:558 +#: functions/NagDataClass.php:273 functions/NagDataClass.php:275 msgid "Data set copied - table [new name]:" msgstr "Registro copiado - tabela [novo nome]:" -#: functions/data_class.php:576 -#: functions/data_class.php:580 -msgid "No dataset copied. Maybe the dataset does not exist or you do not have write permission." -msgstr "Nenhum registro copiado! Talvez os registros não existam na base de dados. Ou podem estar protegidos contra gravação." +#: functions/NagDataClass.php:295 functions/NagDataClass.php:300 +msgid "" +"No dataset copied. Maybe the dataset does not exist or you do not have write " +"permission." +msgstr "" +"Nenhum registro copiado! Talvez os registros não existam na base de dados. " +"Ou podem estar protegidos contra gravação." -#: functions/data_class.php:633 -msgid "No dataset activated. Maybe the dataset does not exist, no dataset was selected or you do not have write permission." -msgstr "Nenhum registro ativado! Talvez os registros não existam na base de dados, ou não foram selecionados. Também podem estar protegidos contra gravação." +# data_class.php +#: functions/NagDataClass.php:393 functions/NagDataClass.php:422 +msgid "Delete failed because a database error:" +msgstr "Exclusão falhou devido ao seguinte erro:" -#: functions/data_class.php:637 -msgid "Dataset successfully activated. Affected rows:" -msgstr "Dado ativado com sucesso. Colunas afetadas: " +#: functions/NagDataClass.php:397 +msgid "" +"No data deleted. The dataset probably does not exist or is protected from " +"deletion." +msgstr "" +"Nenhum dado excluído. O conjunto de dados provavelmente não existe ou está " +"protegido contra exclusão." -#: functions/data_class.php:638 -#: functions/data_class.php:703 -msgid "Activate dataset from table:" -msgstr "Ativar dado da tabela:" +#: functions/NagDataClass.php:403 +msgid "Delete dataset id:" +msgstr "ID de registro excluído:" -#: functions/data_class.php:642 -msgid "No dataset activated. Maybe the dataset does not exist or you do not have write permission." -msgstr "Nenhum registro ativado! Talvez os registros não existam na base de dados, ou podem estar protegidos contra gravação." +#: functions/NagDataClass.php:403 +msgid "- from table:" +msgstr "da tabela" -#: functions/data_class.php:698 -msgid "No dataset deactivated. Maybe the dataset does not exist, it is protected from deactivation, no dataset was selected or you do not have write permission. Use the \"info\" function for detailed informations about relations!" -msgstr "Nenhum registro desativado! Talvez o registro não exista, não foi selecionado ou é protegido contra desativação ou escrita. Use a função \"Info\" para mais informações." +#: functions/NagDataClass.php:404 functions/NagDataClass.php:439 +#: functions/NagDataClass.php:614 functions/NagDataClass.php:963 +#: functions/NagDataClass.php:1020 +msgid "- with affected rows:" +msgstr "com atualização dos dados:" -#: functions/data_class.php:702 -msgid "Dataset successfully deactivated. Affected rows:" -msgstr "Registros excluídos com sucesso. Dados atualizados:" +#: functions/NagDataClass.php:432 functions/NagDataClass.php:443 +msgid "" +"No data deleted. Probably the dataset does not exist or it is protected from " +"delete." +msgstr "" +"Nenhum registro excluído. O registro não existe ou não pode ser excluído." -#: functions/data_class.php:707 -msgid "No dataset deactivated. Maybe the dataset does not exist or you do not have write permission." -msgstr "Nenhum registro desativado! Talvez o registro não exista ou é protegido contra gravação." +#: functions/NagDataClass.php:438 functions/NagDataClass.php:613 +msgid "Deleted data from table:" +msgstr "Dados excluídos da tabela:" -#: functions/data_class.php:891 +#: functions/NagDataClass.php:603 +msgid "" +"No data deleted. Probably the dataset does not exist, it is protected from " +"deletion, you do not have write permission or it has relations to other " +"configurations which cannot be deleted. Use the \"info\" function for " +"detailed informations about relations!" +msgstr "" +"Nenhum registro excluído! Provavelmente os registros não existam na base de " +"dados. Também podem estar protegidos contra gravação ou têm relacionamento " +"com outros registros que não podem ser excluídos. Em caso de dúvidas, clique " +"no link \"Info\" para mais detalhes." + +#: functions/NagDataClass.php:619 +msgid "" +"No data deleted. Probably the dataset does not exist, it is protected from " +"deletion or you do not have write permission." +msgstr "" +"Nenhum registro excluído! Provavelmente os registros não existam na base de " +"dados. Ou podem estar protegidos contra gravação." + +#: functions/NagDataClass.php:691 msgid "Relation information for " msgstr "Informações de relacionamentos para " -#: functions/data_class.php:891 +#: functions/NagDataClass.php:692 msgid " of table " msgstr " da tabela " -#: functions/data_class.php:945 -#: functions/data_class.php:947 -#: functions/data_class.php:951 -#: functions/data_class.php:967 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:747 functions/NagDataClass.php:752 +#: functions/NagDataClass.php:759 functions/NagDataClass.php:778 +#: functions/NagDataClass.php:784 msgid "Relation to " msgstr "Relacionado com " -#: functions/data_class.php:945 -#: functions/data_class.php:947 -#: functions/data_class.php:951 -#: functions/data_class.php:967 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:748 functions/NagDataClass.php:753 +#: functions/NagDataClass.php:760 functions/NagDataClass.php:779 +#: functions/NagDataClass.php:785 msgid ", entry " msgstr ", entrada " -#: functions/data_class.php:945 -#: functions/data_class.php:951 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:749 functions/NagDataClass.php:761 +#: functions/NagDataClass.php:787 msgid "deletion possible" msgstr "exclusão possível" -#: functions/data_class.php:947 -#: functions/data_class.php:967 +#: functions/NagDataClass.php:755 functions/NagDataClass.php:781 msgid "deletion not possible" msgstr "exclusão impossível" -#: functions/import_class.php:78 -msgid "Unable to get configuration data:" -msgstr "Não foi possível obter os dados de configuração: " +#: functions/NagDataClass.php:954 +msgid "" +"No dataset deactivated. Maybe the dataset does not exist, it is protected " +"from deactivation, no dataset was selected or you do not have write " +"permission. Use the \"info\" function for detailed informations about " +"relations!" +msgstr "" +"Nenhum registro desativado! Talvez o registro não exista, não foi " +"selecionado ou é protegido contra desativação ou escrita. Use a função \"Info" +"\" para mais informações." -#: functions/import_class.php:98 -msgid "Cannot receive the configuration file (FTP connection)!" -msgstr "Não foi possível receber o arquivo de configuração (conexão FTP)!" +#: functions/NagDataClass.php:960 +msgid "Dataset successfully deactivated. Affected rows:" +msgstr "Registros excluídos com sucesso. Dados atualizados:" -#: functions/import_class.php:116 -msgid "Cannot receive the configuration file (SSH connection)!" -msgstr "Não foi possível receber o arquivo de configuração (conexão SSH)!" +#: functions/NagDataClass.php:962 +msgid "Deactivate dataset from table:" +msgstr "Registros excluídos da tabela:" -#: functions/import_class.php:189 +#: functions/NagDataClass.php:967 +msgid "" +"No dataset deactivated. Maybe the dataset does not exist or you do not have " +"write permission." +msgstr "" +"Nenhum registro excluído! Talvez o registro não exista ou é protegido contra " +"gravação." + +#: functions/NagDataClass.php:1013 +msgid "" +"No dataset activated. Maybe the dataset does not exist, no dataset was " +"selected or you do not have write permission." +msgstr "" +"Nenhum registro ativado! Talvez os registros não existam na base de dados, " +"ou não foram selecionados. Também podem estar protegidos contra gravação." + +#: functions/NagDataClass.php:1017 +msgid "Dataset successfully activated. Affected rows:" +msgstr "Dado ativado com sucesso. Colunas afetadas: " + +#: functions/NagDataClass.php:1019 +msgid "Activate dataset from table:" +msgstr "Ativar dado da tabela:" + +#: functions/NagDataClass.php:1024 +msgid "" +"No dataset activated. Maybe the dataset does not exist or you do not have " +"write permission." +msgstr "" +"Nenhum registro ativado! Talvez os registros não existam na base de dados, " +"ou podem estar protegidos contra gravação." + +#: functions/NagImportClass.php:162 msgid "No valid configuration found:" msgstr "Nenhuma configuração válida foi encontrada: " -#: functions/import_class.php:198 +#: functions/NagImportClass.php:170 msgid "Import file does not exist or is not readable:" msgstr "Arquivo a ser importado não existe ou é inválido: " -#: functions/import_class.php:266 -msgid "Table for import definition" -msgstr "Tabela para definição de importação" +#: functions/NagImportClass.php:202 +msgid "Unable to get configuration data:" +msgstr "Não foi possível obter os dados de configuração: " -# mutdialog.php -#: functions/import_class.php:266 -msgid "is not available!" -msgstr "não disponível!" +#: functions/NagImportClass.php:229 +msgid "Cannot receive the configuration file (FTP connection)!" +msgstr "Não foi possível receber o arquivo de configuração (conexão FTP)!" -#: functions/import_class.php:318 -#: functions/import_class.php:323 -#: functions/import_class.php:635 -#: functions/import_class.php:636 -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: functions/NagImportClass.php:252 +msgid "Cannot receive the configuration file (SSH connection)!" +msgstr "Não foi possível receber o arquivo de configuração (conexão SSH)!" + +#: functions/NagImportClass.php:351 functions/NagImportClass.php:356 +#: functions/NagImportClass.php:420 functions/NagImportClass.php:426 +#: functions/NagImportClass.php:433 functions/NagImportClass.php:438 msgid "inside" msgstr "dentro" -#: functions/import_class.php:318 +#: functions/NagImportClass.php:352 msgid "exists and were not overwritten" msgstr "existe e não pode ser sobrescrita" -#: functions/import_class.php:323 +#: functions/NagImportClass.php:357 msgid "were not written" msgstr "não gravada" # contacts.php -#: functions/import_class.php:635 -#: functions/import_class.php:636 +#: functions/NagImportClass.php:421 functions/NagImportClass.php:427 msgid "could not be inserted:" msgstr "não foi possível a inclusão" -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: functions/NagImportClass.php:434 functions/NagImportClass.php:439 msgid "successfully inserted" msgstr "incluída com sucesso" -#: functions/import_class.php:1275 -msgid "Error: wrong number of arguments - cannot import service group members" -msgstr "Erro: número incorreto de parâmetros - não é possível importar membros de grupos de serviços" +#: functions/NagImportClass.php:564 +msgid "Table for import definition" +msgstr "Tabela para definição de importação" -#: functions/mysql_class.php:269 -msgid "Missing server connection parameter!" -msgstr "Faltou parâmetro para conexão com o Servidor!" +# mutdialog.php +#: functions/NagImportClass.php:565 +msgid "is not available!" +msgstr "não disponível!" -#: functions/mysql_class.php:276 -#: functions/mysql_class.php:305 -msgid "Connection to the database server has failed by reason:" -msgstr "A conexão com o Servidor da base de dados falhou pelo seguinte motivo:" +#: functions/NagImportClass.php:1640 +msgid "" +"Error: incorrect number of arguments - cannot import service group members" +msgstr "" +"Erro: número incorreto de argumentos. Não foi possível importar membros do " +"grupo de serviços" -#: functions/mysql_class.php:298 -msgid "Missing database connection parameter!" -msgstr "Faltou parâmetro para conexão com a base de dados!" +#: functions/NagImportClass.php:1868 +msgid "" +"Error: incorrect number of arguments - cannot import service parent members" +msgstr "" +"Erro: número incorreto de argumentos. Não foi possível importar membros do " +"serviço pai" -#: functions/nag_class.php:123 +#: functions/NagImportClass.php:1929 functions/NagImportClass.php:1934 +msgid "Error: cannot import the service parent member " +msgstr "Erro: Não foi possível importar o membro do serviço pai" + +#: functions/NagImportClass.php:1931 +msgid "This combination is not unique!" +msgstr "Esta combinação não é única!" + +#: functions/NagImportClass.php:1936 +msgid "This combination is not unique or does not exist!" +msgstr "Esta combinação não é única ou não existe!" + +#: functions/NagVisualClass.php:227 msgid "Hide menu" msgstr "Ocultar menu" -#: functions/nag_class.php:132 +#: functions/NagVisualClass.php:237 msgid "Show menu" msgstr "Mostrar menu" -#: functions/nag_class.php:406 +#: functions/NagVisualClass.php:272 msgid "Page" msgstr "Pág." -#: functions/nag_class.php:961 +#: functions/NagVisualClass.php:805 msgid "Unrestricted access" msgstr "Acesso irrestrito" -# prepend.adm -#: functions/prepend_adm.php:101 -#: install/index.php:100 -msgid "Error while connecting to database:" -msgstr "Erro ao conectar base de dados:" +#: functions/prepend_adm.php:214 +msgid "" +"Error in setting the correct locale, please report this error with the " +"associated output of 'locale -a' to bugs@nagiosql.org" +msgstr "" +"Erro na definição do correto locale. Relate este erro juntamente com a saída " +"do comando 'locale -a' para bugs@nagiosql.org" -#: functions/prepend_adm.php:133 -#: functions/prepend_adm.php:192 -msgid "Error in setting the correct locale, please report this error with the associated output of 'locale -a' to bugs@nagiosql.org" -msgstr "Erro na definição do correto locale. Relate este erro juntamente com a saída do comando 'locale -a' para bugs@nagiosql.org" - -#: functions/prepend_adm.php:269 +#: functions/prepend_adm.php:306 msgid "Webserver login successfull" msgstr "Login com sucesso" -#: functions/prepend_adm.php:302 +#: functions/prepend_adm.php:347 msgid "Login successfull" msgstr "Login com sucesso" -#: functions/prepend_adm.php:307 -#: functions/prepend_adm.php:308 +#: functions/prepend_adm.php:354 functions/prepend_adm.php:355 msgid "Login failed!" msgstr "Login falhou" -#: functions/prepend_adm.php:332 +#: functions/prepend_adm.php:387 msgid "Session timeout reached - Seconds:" msgstr "Sessão finalizada por timeout - Segundos:" -#: functions/prepend_adm.php:343 +#: functions/prepend_adm.php:402 msgid "Restricted site accessed:" msgstr "Site restrito acessado:" -#: functions/prepend_adm.php:355 +#: functions/prepend_adm.php:419 msgid "User not found in database" msgstr "Usuário não encontrado na base de dados" -#: functions/prepend_adm.php:393 -msgid "Admin" -msgstr "NagiosQL" - -#: functions/prepend_adm.php:457 +#: functions/prepend_adm.php:548 msgid "Logged in:" msgstr "Usuário atual:" -#: functions/prepend_adm.php:458 +#: functions/prepend_adm.php:550 msgid "Logout" msgstr "Sair" -#: functions/prepend_adm.php:478 -msgid "Warning - template file not found or not readable, please check your file permissions! - File: " -msgstr "Atenção! Arquivo modelo não encontrado ou sem acesso para leitura. Verifique as permissões do arquivo:" +#: functions/prepend_adm.php:573 +msgid "" +"Warning - template file not found or not readable, please check your file " +"permissions! - File: " +msgstr "" +"Atenção! Arquivo modelo não encontrado ou sem acesso para leitura. Verifique " +"as permissões do arquivo:" -#: functions/prepend_content.php:303 -#: functions/prepend_content.php:306 -#: functions/prepend_content.php:322 -#: functions/prepend_content.php:325 -msgid "Some configuration files were not written. Dataset not activated, not found or you do not have write permission!" -msgstr "Alguns arquivos de configuração não foram gravados! Registro não existe, não está ativado ou é protegido contra gravação." +#: functions/prepend_content.php:258 functions/prepend_content.php:265 +#: functions/prepend_content.php:288 functions/prepend_content.php:295 +msgid "" +"Some configuration files were not written. Dataset not activated, not found " +"or you do not have write permission!" +msgstr "" +"Alguns arquivos de configuração não foram gravados! Registro não existe, não " +"está ativado ou é protegido contra gravação." -#: functions/prepend_content.php:305 -#: functions/prepend_content.php:324 +#: functions/prepend_content.php:262 functions/prepend_content.php:292 msgid "Configuration files successfully written!" msgstr "Arquivos de configuração gravados com sucesso!" -#: functions/prepend_content.php:344 -msgid "Admin can't be deleted" -msgstr "Usuário administrador não pode ser excluído" +#: functions/prepend_content.php:321 +msgid "Admin cannot be deleted" +msgstr "O usuário Admin não pode ser excluído!" -#: functions/prepend_content.php:347 +#: functions/prepend_content.php:325 msgid "Localhost can't be deleted" msgstr "Localhost não pode ser excluído" -#: functions/prepend_content.php:475 +#: functions/prepend_content.php:502 msgid "No permission to open configuration!" msgstr "Sem permissão para abrir a configuração!" -#: functions/translator.php:56 +#: functions/translator.php:63 install/functions/NagInstallClass.php:99 msgid "English" msgstr "Inglês" -#: functions/translator.php:60 +#: functions/translator.php:67 install/functions/NagInstallClass.php:103 msgid "German" msgstr "Alemão" -#: functions/translator.php:64 +#: functions/translator.php:71 install/functions/NagInstallClass.php:107 msgid "Chinese (Simplified)" msgstr "Chinês (Simplificado)" -#: functions/translator.php:68 +#: functions/translator.php:75 install/functions/NagInstallClass.php:111 msgid "Italian" msgstr "Italiano" -#: functions/translator.php:72 +#: functions/translator.php:79 install/functions/NagInstallClass.php:115 msgid "French" msgstr "Francês" -#: functions/translator.php:76 +#: functions/translator.php:83 install/functions/NagInstallClass.php:119 msgid "Russian" msgstr "Russo" -#: functions/translator.php:80 +#: functions/translator.php:87 install/functions/NagInstallClass.php:123 msgid "Spanish" msgstr "Espanhol" -#: functions/translator.php:84 +#: functions/translator.php:91 install/functions/NagInstallClass.php:127 msgid "Portuguese (Brazilian)" msgstr "Português (Brasil)" -#: functions/translator.php:88 +#: functions/translator.php:95 install/functions/NagInstallClass.php:131 msgid "Dutch" msgstr "Holandês" -#: functions/translator.php:92 +#: functions/translator.php:99 install/functions/NagInstallClass.php:135 msgid "Danish" msgstr "Dinamarquês" -#: install/index.php:63 -#: install/index.php:172 +#: index.php:47 +msgid "Welcome to" +msgstr "Bem vindo ao" + +#: index.php:48 +msgid "Welcome" +msgstr "Bem vindo" + +#: index.php:49 +msgid "" +"Please enter your username and password to access NagiosQL.
If you forgot " +"one of them, please contact your Administrator." +msgstr "" +"Para acessar o NagiosQL, preencha os dados solicitados acima.
Em " +"caso de dúvidas, contate o Administrador." + +#: index.php:53 +msgid "Login" +msgstr "Entrar" + +#: install/functions/NagInstallClass.php:75 +msgid "Template file not found" +msgstr "Modelo não encontrado" + +#: install/functions/NagInstallClass.php:336 +#: install/functions/NagInstallClass.php:368 +msgid "passed" +msgstr "OK" + +# prepend.adm +#: install/functions/NagInstallClass.php:358 +msgid "Error while connecting to database:" +msgstr "Erro ao conectar base de dados:" + +#: install/functions/NagInstallClass.php:399 +#: install/functions/NagInstallClass.php:474 +msgid "supported" +msgstr "Suportado" + +#: install/functions/NagInstallClass.php:401 +msgid "not supported" +msgstr "Não suportado" + +#: install/functions/NagInstallClass.php:477 +msgid "" +"Your NagiosQL installation is up to date - no further actions are needed!" +msgstr "O NagiosQL está atualizado! Nenhuma ação adicional é necessária." + +#: install/functions/NagInstallClass.php:483 +#: install/functions/NagInstallClass.php:491 +msgid "" +"Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and " +"above!" +msgstr "" +"Atualização para o NagiosQL 3.2 é suportada apenas para servidores que " +"tenham a versão NagiosQL 3.0.0 ou superior." + +# prepend.adm +#: install/functions/NagInstallClass.php:489 +msgid "Error while selecting settings table." +msgstr "Erro ao selecionar a tabela de configurações!" + +#: install/functions/NagInstallClass.php:511 +#: install/functions/NagInstallClass.php:547 +#: install/functions/NagInstallClass.php:610 +#: install/functions/NagInstallClass.php:614 +#: install/functions/NagInstallClass.php:655 +#: install/functions/NagInstallClass.php:736 +#: install/functions/NagInstallClass.php:819 +#: install/functions/NagInstallClass.php:870 +#: install/functions/NagInstallClass.php:935 +#: install/functions/NagInstallClass.php:945 +#: install/functions/NagInstallClass.php:967 +#: install/functions/NagInstallClass.php:1015 +#: install/functions/NagInstallClass.php:1067 +msgid "done" +msgstr "Concluído" + +#: install/functions/NagInstallClass.php:538 +msgid "Unsupported database type." +msgstr "Tipo de banco de dados não suportado." + +#: install/functions/NagInstallClass.php:611 +msgid "Only added rights to existing user" +msgstr "Direitos adicionados apenas a usuários existentes" + +# mutdialog.php +#: install/functions/NagInstallClass.php:641 +msgid "No SQL update files available" +msgstr "Atualização de arquivos SQL não disponível" + +#: install/functions/NagInstallClass.php:650 +#: install/functions/NagInstallClass.php:707 +msgid "SQL file is not readable or empty" +msgstr "Arquivo SQL ilegível ou vazio" + +#: install/functions/NagInstallClass.php:778 +#: install/functions/NagInstallClass.php:785 +#: install/functions/NagInstallClass.php:813 +msgid "Inserting initial data to settings database has failed:" +msgstr "A entrada inicial dos dados para configuração da base de dados falhou:" + +#: install/functions/NagInstallClass.php:873 +msgid "Connot open/write to config/settings.php" +msgstr "Não foi possível abrir o arquivo config/settings.php para gravação" + +#: install/functions/NagInstallClass.php:905 +msgid "Inserting path data to database has failed:" +msgstr "A entrada de dados do caminho para a base de dados falhou:" + +#: install/functions/NagInstallClass.php:936 +msgid "Check the permissions of the created paths!" +msgstr "Verifique as permissões dos caminhos criados!" + +#: install/functions/NagInstallClass.php:939 +msgid "NagiosQL config path is not writeable - only database values updated" +msgstr "" +"O diretório base do NagiosQL não tem permissão de gravação. Apenas os " +"valores da base de dados foram atualizados" + +# prepend.adm +#: install/functions/NagInstallClass.php:969 +#: install/functions/NagInstallClass.php:1017 +#: install/functions/NagInstallClass.php:1069 +msgid "Database errors while converting to utf-8:" +msgstr "Ocorreram erros durante a conversão para UTF-8" + +#: install/functions/NagInstallClass.php:1008 +#: install/functions/NagInstallClass.php:1060 install/step3.php:88 +#: install/step3.php:177 +msgid "Database type not defined!" +msgstr "Tipo de base de dados não definido!" + +#: install/index.php:69 msgid "Online Documentation" msgstr "Documentação online" -#: install/index.php:99 +#: install/index.php:115 msgid "Database connection failed. Upgrade not available!" msgstr "Conexão com a abase de dados falhou! Atualização não disponível." -#: install/index.php:105 +#: install/index.php:122 msgid "Settings table not available or wrong. Upgrade not available!" -msgstr "Tabela de configurações não existe ou está corrompida! Atualização não disponível." +msgstr "" +"Tabela de configurações não existe ou está corrompida! Atualização não " +"disponível." -#: install/index.php:116 -msgid "Installation cannot continue, please make sure you have the mysql extension loaded!" -msgstr "Instalação interrompida! Certifique-se que o MySQL foi instalado." +#: install/index.php:133 +msgid "" +"Invalid database type in settings file (config/settings.php). Upgrade not " +"available!" +msgstr "" +"Tipo de banco de dados inválido no arquivo de configurações (config/" +"settings.php). Atualização não disponível!" -#: install/index.php:121 -msgid "Installation cannot continue, postgres is not yet available in beta!" -msgstr "Instalação interrompida! Certifique-se que o MySQL foi instalado." +#: install/index.php:137 +msgid "" +"Database values in settings file are missing (config/settings.php). Upgrade " +"not available!" +msgstr "" +"Valores do banco de dados faltantes no arquivo de configurações (config/" +"settings.php)! Atualização não disponível." -#: install/index.php:124 -msgid "Installation cannot continue, please make sure you have the pgsql extension loaded!" -msgstr "Instalação interrompida! Certifique-se de que o pacote pgsql está instalado." +#: install/index.php:141 +msgid "" +"Settings file not found or not readable (config/settings.php). Upgrade not " +"available!" +msgstr "" +"Arquivo de configurações (config/settings.php) não encontrado ou ilegível! " +"Apenas instalação full será possível. Caso queira atualizar a versão, copie " +"o arquivo config/settings.php da versão anterior para o diretório de " +"instalação e dê permissão de escrita." -#: install/index.php:128 -msgid "Database type in settings file is wrong (config/settings.php). Upgrade not available!" -msgstr "Tipo de banco de dados no arquivo de configurações (config/settings.php) desconhecido! Atualização não disponível." +#: install/index.php:152 +msgid "" +"Default values file is not available or not readable (install/functions/" +"initial_settings.php). Installation possible, but without predefined data!" +msgstr "" +"Arquivo de valores padrões (install/functions/initial_settings.php) não " +"encontrado ou ilegível! Instalação possível, mas sem dados pré-definidos!" -#: install/index.php:131 -msgid "Database values in settings file are missing (config/settings.php). Upgrade not available!" -msgstr "Valores do banco de dados faltantes no arquivo de configurações (config/settings.php)! Atualização não disponível." +#: install/index.php:159 +msgid "Installation wizard" +msgstr "Assistente de atualização" -#: install/index.php:134 -msgid "Settings file not found or not readable (config/settings.php). Upgrade not available!" -msgstr "Arquivo de configurações (config/settings.php) não encontrado ou ilegível! Apenas instalação full será possível. Caso queira atualizar a versão, copie o arquivo config/settings.php da versão anterior para o diretório de instalação e dê permissão de escrita." +#: install/index.php:160 +msgid "Welcome to the NagiosQL installation wizard" +msgstr "Seja bem vindo ao Assistente de Instalação do NagiosQL!" -#: install/index.php:144 -msgid "Default values file is not available or not readable (install/functions/initial_settings.php). Installation possible, but without predefined data!" -msgstr "Arquivo de valores padrões (install/functions/initial_settings.php) não encontrado ou ilegível! Instalação possível, mas sem dados pré-definidos!" - -#: install/index.php:150 -#: install/install.php:124 -msgid "Welcome to the NagiosQL Installation Wizard" -msgstr "Bem vindo ao assistente de instalação do NagiosQL" - -#: install/index.php:151 +#: install/index.php:161 msgid "This wizard will help you to install and configure NagiosQL." msgstr "Este assistente irá ajudá-lo a instalar e configurar o NagiosQL." -#: install/index.php:152 +#: install/index.php:163 msgid "For questions please visit" msgstr "Em caso de dúvidas, acesse " -#: install/index.php:153 -msgid "First let's check your local environment and find out if everything NagiosQL needs is available." -msgstr "Primeiro, verifique se o ambiente está preparado para o NagiosQL funcionar." +#: install/index.php:164 +msgid "" +"First let's check your local environment and find out if everything NagiosQL " +"needs is available." +msgstr "" +"Primeiro, verifique se o ambiente está preparado para o NagiosQL funcionar." -#: install/index.php:154 +#: install/index.php:166 msgid "The basic requirements are:" msgstr "Requisitos básicos:" -#: install/index.php:155 -msgid "PHP 5.2.0 or greater including:" -msgstr "PHP 5.2.0 ou superior incluído:" +#: install/index.php:167 +msgid "PHP 5.5.0 or greater including:" +msgstr "PHP 5.5.0 (ou posterior), incluindo:" -#: install/index.php:156 -#: install/index.php:157 -#: install/index.php:158 -#: install/index.php:161 -#: install/index.php:163 -#: install/index.php:164 -msgid "PHP Module:" -msgstr "Módulo PHP:" +#: install/index.php:168 +msgid "PHP database module:" +msgstr "Módulo de banco de dados PHP:" -#: install/index.php:163 -#: install/index.php:164 -#: install/index.php:165 +#: install/index.php:169 +msgid "supported types are" +msgstr "tipos suportados são" + +#: install/index.php:174 install/index.php:176 msgid "(optional)" msgstr "(opcional)" -#: install/index.php:165 -msgid "PECL Extension:" -msgstr "Extenção PECL:" +#: install/index.php:175 +msgid "PECL extension:" +msgstr "Extensão PECL:" -#: install/index.php:166 +#: install/index.php:177 msgid "php.ini options" msgstr "Parâmetros do arquivo php.ini" -#: install/index.php:167 +#: install/index.php:178 msgid "file_uploads on (for upload features)" msgstr "file_uploads = On" -#: install/index.php:168 +#: install/index.php:179 msgid "session.auto_start needs to be off" msgstr "session.auto_start = 0" -#: install/index.php:169 -msgid "A MySQL database server" -msgstr "Um Servidor MySQL" +#: install/index.php:180 +msgid "A database server" +msgstr "Um servidor de banco de dados" -#: install/index.php:170 -msgid "Nagios 2.x/3.x" -msgstr "Nagios 2.x/3.x" +#: install/index.php:181 +msgid "Nagios 2.x/3.x/4.x" +msgstr "Nagios, versão 2.x/3.x/4.x" -#: install/index.php:176 +#: install/index.php:182 +msgid "NagiosQL version" +msgstr "Versão NagiosQL" + +#: install/index.php:184 +msgid "Online documentation" +msgstr "Documentação online" + +#: install/index.php:188 msgid "START INSTALLATION" msgstr "INICIAR INSTALAÇÃO" -#: install/index.php:177 +#: install/index.php:189 msgid "START UPDATE" msgstr "INICIAR ATUALIZAÇÃO" -#: install/step1.php:80 +#: install/install.php:214 +msgid "Welcome to the NagiosQL Installation Wizard" +msgstr "Bem vindo ao assistente de instalação do NagiosQL" + +#: install/step1.php:74 install/step2.php:34 install/step3.php:38 msgid "Requirements" msgstr "Requisitos" -#: install/step1.php:82 +#: install/step1.php:76 install/step2.php:36 install/step3.php:40 +#: install/step3.php:301 msgid "Finish" msgstr "Concluir" -#: install/step1.php:83 +#: install/step1.php:78 msgid "Checking requirements" msgstr "verificação de requisitos" -#: install/step1.php:84 +#: install/step1.php:79 msgid "Checking Client" msgstr "Verificação do Cliente" -#: install/step1.php:85 +#: install/step1.php:80 msgid "Checking PHP version" msgstr "Versão do PHP" -#: install/step1.php:86 +#: install/step1.php:81 msgid "Checking PHP extensions" msgstr "Verificação de extenções PHP" -#: install/step1.php:87 +#: install/step1.php:82 msgid "Checking available database interfaces" msgstr "Verificação de interfaces de base de dados disponíveis" -#: install/step1.php:88 +#: install/step1.php:83 msgid "Checking php.ini/.htaccess settings" msgstr "Verificação das configurações dos arquivos php.ini e htaccess" -#: install/step1.php:89 +#: install/step1.php:84 msgid "Checking System Permission" msgstr "Verificação de permissões do sistema" -#: install/step1.php:90 +#: install/step1.php:85 msgid "The following modules/extensions are required to run NagiosQL" -msgstr "Os seguintes módulos ou extenções são necessários para o NagiosQL" +msgstr "" +"Os seguintes módulos ou extenções são necessários para o NagiosQL" -#: install/step1.php:91 +#: install/step1.php:87 msgid "The next couple of extensions are optional but recommended" msgstr "O seguinte conjunto de extenções é opcional, mas recomendado" -#: install/step1.php:92 -msgid "Check which of the supported extensions are installed. At least one of them is required." -msgstr "Verificar quais das extenções suportadas estão instaladas. Pelo menos uma delas é necessária" +#: install/step1.php:89 +msgid "" +"Check which of the supported extensions are installed. At least one of them " +"is required." +msgstr "" +"Verificar quais das extenções suportadas estão instaladas. Pelo menos uma " +"delas é necessária" -#: install/step1.php:93 +#: install/step1.php:91 msgid "The following settings are required to run NagiosQL" -msgstr "Os seguintes parâmetros são necessários no arquivo php.ini para o NagiosQL" +msgstr "" +"Os seguintes parâmetros são necessários no arquivo php.ini para o " +"NagiosQL" -#: install/step1.php:107 +#: install/step1.php:109 msgid "ENABLED" msgstr "HABILITADO" -#: install/step1.php:109 +#: install/step1.php:114 msgid "NOT ENABLED" msgstr "DESABILITADO" -#: install/step1.php:113 +#: install/step1.php:115 +msgid "" +"After enabling Javascript, the page must be updated twice so that the status " +"changes" +msgstr "" +"Depois de ativar o Javascript, a página deve ser atualizada duas vezes para " +"que o estado seja alterado" + +#: install/step1.php:120 msgid "Version" msgstr "Versão" -#: install/step1.php:115 -#: install/step1.php:128 -#: install/step1.php:141 -#: install/step1.php:158 -#: install/step1.php:178 -#: install/step1.php:182 -#: install/step1.php:194 -#: install/step1.php:201 -#: install/step1.php:203 -#: install/step1.php:213 -#: install/step1.php:220 -#: install/step1.php:227 -#: install/step1.php:234 -#: install/step1.php:241 -#: install/step1.php:248 +#: install/step1.php:124 install/step1.php:140 install/step1.php:155 +#: install/step1.php:180 install/step1.php:208 install/step1.php:212 +#: install/step1.php:226 install/step1.php:236 install/step1.php:239 +#: install/step1.php:252 install/step1.php:261 install/step1.php:270 +#: install/step1.php:279 install/step1.php:288 install/step1.php:297 msgid "OK" msgstr "OK" -#: install/step1.php:116 -#: install/step1.php:118 +#: install/step1.php:125 install/step1.php:129 msgid "detected" msgstr "detectado" -#: install/step1.php:119 +#: install/step1.php:130 msgid "or greater is required" msgstr "ou superior é necessário" -#: install/step1.php:131 -#: install/step1.php:144 -#: install/step1.php:162 +#: install/step1.php:143 install/step1.php:158 install/step1.php:187 msgid "Could be loaded. Please add in php.ini" -msgstr "não pôde ser carregado. Verifique se a variável \"extension = ssh2.so\" foi adicionada no arquivo php.ini. Em caso negativo, adicione." +msgstr "" +"não pôde ser carregado. Verifique se a variável \"extension = ssh2.so\" foi " +"adicionada no arquivo php.ini. Em caso negativo, adicione." -#: install/step1.php:132 -#: install/step1.php:145 -#: install/step1.php:163 -#: install/step1.php:175 +#: install/step1.php:145 install/step1.php:160 install/step1.php:189 +#: install/step1.php:204 msgid "NOT AVAILABLE" msgstr "NÃO DISPONÍVEL" -#: install/step1.php:157 -msgid "New installation only - updates are only supported using the same database interface!" -msgstr "Apenas nova instalação! Atualizações somente são suportadas usando a mesma interface de banco de dados." +#: install/step1.php:177 +msgid "" +"New installation only - updates are only supported using the same database " +"interface!" +msgstr "" +"Apenas nova instalação! Atualizações somente são suportadas usando a mesma " +"interface de banco de dados." -#: install/step1.php:175 +#: install/step1.php:205 msgid "cannot be empty and needs to be set" -msgstr "não pode ser vazio e precisa ser configurado. Ex: date.timezone = America/Sao_Paulo. Após qualquer alteração no php.ini, reinicie o apache." +msgstr "" +"não pode ser vazio e precisa ser configurado. Ex: date.timezone = America/" +"Sao_Paulo. Após qualquer alteração no php.ini, reinicie o apache." -#: install/step1.php:184 +#: install/step1.php:214 msgid "should be" msgstr "deve ser" -#: install/step1.php:194 -#: install/step1.php:196 +#: install/step1.php:225 install/step1.php:228 msgid "Read test on settings file (config/settings.php)" msgstr "Teste de leitura no arquivo de configuração (config/settings.php)" -#: install/step1.php:198 +#: install/step1.php:231 msgid "Settings file does not exists (config/settings.php)" msgstr "Arquivo de configuração não existe (config/settings.php)" -#: install/step1.php:198 +#: install/step1.php:232 msgid "will be created" msgstr "Será criado posteriormente" -#: install/step1.php:201 -#: install/step1.php:205 +#: install/step1.php:235 install/step1.php:241 msgid "Write test on settings file (config/settings.php)" -msgstr "Teste de escrita no arquivo de configuração (config/settings.php). Verifique as permissões do arquivo e corrija, através do comando chmod" +msgstr "" +"Teste de escrita no arquivo de configuração (config/settings.php). Verifique " +"as permissões do arquivo e corrija, através do comando chmod" -#: install/step1.php:203 -#: install/step1.php:208 +#: install/step1.php:238 install/step1.php:245 msgid "Write test on settings directory (config/)" msgstr "Teste de escrita no diretório de configuração (config/)" -#: install/step1.php:213 -#: install/step1.php:215 -msgid "Read test on a class file (functions/nag_class.php)" -msgstr "Teste de leitura no arquivo de classes (functions/nag_class.php)" +#: install/step1.php:251 install/step1.php:254 +msgid "Read test on one class file (functions/NagVisualClass.php)" +msgstr "Leia o teste no arquivo functions/NagVisualClass.php" -#: install/step1.php:220 -#: install/step1.php:222 -msgid "Read test on startsite file (admin.php)" -msgstr "Teste de leitura no arquivo inicial do site (admin.php)" +#: install/step1.php:260 install/step1.php:263 +msgid "Read test on home page file (admin.php)" +msgstr "Leia o teste no arquivo admin.php" -#: install/step1.php:227 -#: install/step1.php:229 -msgid "Read test on a template file (templates/index.tpl.htm)" -msgstr "Teste de leitura no arquivo de modelo (templates/index.tpl.htm)" +#: install/step1.php:269 install/step1.php:272 +msgid "Read test on one template file (templates/index.tpl.htm)" +msgstr "Leia o teste no arquivo templates/index.tpl.htm" -#: install/step1.php:234 -#: install/step1.php:236 -msgid "Read test on a admin template file (templates/admin/admin_master.tpl.htm)" -msgstr "Teste de leitura no arquivo modelo de administrador (templates/admin/admin_master.tpl.htm)" +#: install/step1.php:278 install/step1.php:281 +msgid "Read test on one admin template file (templates/admin/datalist.htm.tpl)" +msgstr "Leia o teste no arquivo templates/admin/datalist.htm.tpl" -#: install/step1.php:241 -#: install/step1.php:243 -msgid "Read test on a file template (templates/files/contacts.tpl.dat)" -msgstr "Teste de leitura no arquivo de modelo (templates/files/contacts.tpl.dat)" +#: install/step1.php:287 install/step1.php:290 +msgid "Read test on one file template (templates/files/contacts.tpl.dat)" +msgstr "Leia o teste no arquivo templates/files/contacts.tpl.dat" -#: install/step1.php:248 -#: install/step1.php:250 -msgid "Read test on a image file (images/pixel.gif)" -msgstr "Teste de leitura no arquivo de imagem (images/pixel.gif)" +#: install/step1.php:296 install/step1.php:299 +msgid "Read test on one image file (images/pixel.gif)" +msgstr "Veja o teste no arquivo images/pixel.gif" -#: install/step1.php:254 -msgid "There are some errors - please check your system settings and read the requirements of NagiosQL!" -msgstr "Os erros acima foram detectados! Consulte os requisitos para o NagiosQL e verifique suas configurações de sistema." +#: install/step1.php:304 +msgid "" +"There are some errors - please check your system settings and read the " +"requirements of NagiosQL!" +msgstr "" +"Os erros acima foram detectados! Consulte os requisitos para o NagiosQL e " +"verifique suas configurações de sistema." -#: install/step1.php:255 -msgid "Read the INSTALLATION file from NagiosQL to find out, how to fix them." -msgstr "Consulte o Manual de Instalação do NagiosQL para saber como corrigir isso." +#: install/step1.php:306 +msgid "" +"Read the INSTALLATION file in the NagiosQL doc directory or the installation " +"PDF file on our" +msgstr "" +"Consulte o arquivo INSTALLATION no diretório doc ou o arquivo " +"de instalação PDF no nosso" -#: install/step1.php:256 +#: install/step1.php:310 +msgid "online documentation" +msgstr "Documentação online" + +#: install/step1.php:311 +msgid "site to find out, how to fix them." +msgstr "site para descobrir como corrigi-los." + +#: install/step1.php:312 msgid "After that - refresh this page to proceed" msgstr "Em seguida, atualize esta página para prosseguir " -#: install/step1.php:259 +#: install/step1.php:316 msgid "Refresh" msgstr "Atualizar" -#: install/step1.php:261 -msgid "Environment test sucessfully passed" -msgstr "Teste de ambiente efetuado com sucesso!" +#: install/step1.php:318 +msgid "Environment test completed successfully" +msgstr "Teste de ambiente concluído com sucesso" -#: install/step1.php:264 +#: install/step1.php:323 install/step2.php:94 msgid "Next" msgstr "Próximo" -#: install/step2.php:33 +#: install/step2.php:32 msgid "The NagiosQL first passwords are not equal!" msgstr "As senhas inseridas não conferem! Tente outra vez." @@ -3346,356 +3844,228 @@ msgstr "Instalação" #: install/step2.php:39 msgid "Please complete the form below. Mandatory fields marked *" -msgstr "Preencha o formulário a seguir. Campos marcados com * são de preenchimento obrigatório" +msgstr "" +"Preencha o formulário a seguir. Campos marcados com * são de " +"preenchimento obrigatório" -#: install/step2.php:40 +#: install/step2.php:41 msgid "Database Configuration" msgstr "Configuração da Base de Dados" -#: install/step2.php:41 +#: install/step2.php:42 msgid "Database Type" msgstr "Tipo da base de dados" -#: install/step2.php:43 +#: install/step2.php:56 msgid "Database Server" msgstr "Servidor da base de dados" -#: install/step2.php:45 +#: install/step2.php:58 msgid "Local hostname or IP address" msgstr "Nome ou IP do servidor" -#: install/step2.php:51 +#: install/step2.php:64 msgid "Database Server Port" msgstr "Porta da base de dados do servidor" -#: install/step2.php:55 +#: install/step2.php:68 msgid "NagiosQL DB User" msgstr "Usuário da base de dados do NagiosQL" -#: install/step2.php:57 +#: install/step2.php:70 msgid "NagiosQL DB Password" msgstr "Senha da base de dados do NagiosQL" -#: install/step2.php:59 +#: install/step2.php:72 msgid "Administrative Database User" msgstr "Usuário administrador da base de dados" -#: install/step2.php:61 +#: install/step2.php:74 msgid "Administrative Database Password" msgstr "Senha do administrador da base de dados" -#: install/step2.php:62 +#: install/step2.php:75 msgid "Drop database if already exists?" msgstr "Excluir base de dados caso exista" -#: install/step2.php:64 +#: install/step2.php:81 msgid "NagiosQL User Setup" msgstr "Usuário da base de dados do NagiosQL" -#: install/step2.php:65 +#: install/step2.php:82 msgid "Initial NagiosQL User" msgstr "Usuário inicial do NagiosQL" -#: install/step2.php:67 +#: install/step2.php:84 msgid "Initial NagiosQL Password" msgstr "Senha inicial do NagiosQL" -#: install/step2.php:69 +#: install/step2.php:86 msgid "Please repeat the password" msgstr "Repita a senha" -#: install/step2.php:70 +#: install/step2.php:87 msgid "Nagios Configuration" msgstr "Arquivo nagios.cfg" -#: install/step2.php:71 +#: install/step2.php:88 msgid "Import Nagios sample config?" msgstr "Importar exemplo de configuração do Nagios?" -#: install/step2.php:74 +#: install/step2.php:95 msgid "NagiosQL path values" msgstr "Caminho do NagiosQL" -#: install/step2.php:75 +#: install/step2.php:96 msgid "Create NagiosQL config paths?" msgstr "Criar caminhos de configuração do NagiosQL?" -#: install/step2.php:77 +#: install/step2.php:102 msgid "NagiosQL config path" msgstr "Caminho de configuração do NagiosQL" -#: install/step2.php:79 +#: install/step2.php:104 msgid "Nagios config path" msgstr "Caminho de configuração do Nagios" -#: install/step2.php:81 -msgid "Both path values were stored in your configuration target settings for localhost." -msgstr "Os valores dos caminhos foram armazenados em suas configurações do localhost" +#: install/step2.php:106 +msgid "" +"Both path values were stored in your configuration target settings for " +"localhost." +msgstr "" +"Os valores dos caminhos foram armazenados em suas configurações do localhost" -#: install/step2.php:82 -msgid "If you select the create path option, be sure that the NagiosQL base path exist and the webserver demon has write access to it. So the installer will create the required subdirectories in your localhost's filesystem (hosts, services, backup etc.)" -msgstr "Se a opção de criar o caminho for selecionada, certifique-se de que o caminho base do NagiosQL existe e que o usuário de aplicação web tem permissão de gravação no mesmo. Somente assim, o processo de instalação poderá criar os sub-diretórios necessários hosts, services, backup etc.)" +#: install/step2.php:108 +msgid "" +"If you select the create path option, be sure that the NagiosQL base path " +"exist and the webserver demon has write access to it. So the installer will " +"create the required subdirectories in your localhost's filesystem (hosts, " +"services, backup etc.)" +msgstr "" +"Se a opção de criar o caminho for selecionada, certifique-se de que o " +"caminho base do NagiosQL existe e que o usuário de aplicação web tem " +"permissão de gravação no mesmo. Somente assim, o processo de instalação " +"poderá criar os sub-diretórios necessários hosts, services, backup etc.)" -#: install/step2.php:94 +#: install/step2.php:120 msgid "Please backup your database before proceeding!" msgstr "Atenção! Efetue backup da base de dados antes de prosseguir!" -#: install/step3.php:40 +#: install/step3.php:42 msgid "Finishing Setup" msgstr "concluindo instalação" -#: install/step3.php:42 +#: install/step3.php:44 msgid "Deploy NagiosQL settings" msgstr "Aplicar configurações do NagiosQL" -#: install/step3.php:43 +#: install/step3.php:45 msgid "Database server connection (privileged user)" msgstr "Conexão com o banco do servidor (usuário root)" -#: install/step3.php:44 +#: install/step3.php:46 msgid "Database server version" msgstr "Versão do servidor da base de dados" -#: install/step3.php:45 +#: install/step3.php:47 msgid "Database server support" msgstr "Suporte do servidor da base de dados" -#: install/step3.php:46 +#: install/step3.php:48 msgid "Delete existing NagiosQL database" msgstr "Exluir base de dado NagiosQL existente" -#: install/step3.php:47 +#: install/step3.php:49 msgid "Creating new database" msgstr "Criação da nova base de dados" -#: install/step3.php:48 -msgid "Create NagiosQL database user" -msgstr "Criar usuário da base de dados do NagiosQL" - -#: install/step3.php:49 +#: install/step3.php:50 msgid "Installing NagiosQL database tables" msgstr "Instalando as tabelas do banco de dados NagiosQL" -#: install/step3.php:50 +#: install/step3.php:51 +msgid "Create NagiosQL database user" +msgstr "Criar usuário da base de dados do NagiosQL" + +#: install/step3.php:52 msgid "Set initial NagiosQL Administrator" msgstr "Definição do Administrador inicial do NagiosQL" -#: install/step3.php:51 +#: install/step3.php:53 msgid "Database server connection (NagiosQL user)" msgstr "Conexão do servidor da base de dados (usuário NagiosQL)" -#: install/step3.php:52 +#: install/step3.php:54 msgid "Writing global settings to database" msgstr "Gravação de configurações globais na base de dados" -#: install/step3.php:53 +#: install/step3.php:55 msgid "Writing database configuration to settings.php" -msgstr "Gravação de configurações da base de dados no arquivo settings.php " +msgstr "" +"Gravação de configurações da base de dados no arquivo settings.php " -#: install/step3.php:54 +#: install/step3.php:56 msgid "Import Nagios sample data" msgstr "Importar modelo de dados do Nagios" -#: install/step3.php:55 +#: install/step3.php:57 msgid "Create and/or store NagiosQL path settings" msgstr "Criar e/ou armazenar as configurações de caminhos do NagiosQL" -#: install/step3.php:73 +#: install/step3.php:80 msgid "Updating existing NagiosQL database" msgstr "Atualizar base de dados NagiosQL existente" -#: install/step3.php:80 +#: install/step3.php:113 msgid "Installed NagiosQL version" msgstr "Versão do NagiosQL instalada" -#: install/step3.php:86 +#: install/step3.php:124 msgid "Upgrading from version" msgstr "Atualização da versão" -#: install/step3.php:86 +#: install/step3.php:125 msgid "to" msgstr "para" -#: install/step3.php:92 +#: install/step3.php:132 msgid "Converting database to utf8 character set" msgstr "Convertendo base de dados para conjunto de caracteres utf8" -#: install/step3.php:98 +#: install/step3.php:138 msgid "Converting database tables to utf8 character set" msgstr "Convertendo tabelas da base de dados para conjunto de caracteres utf8" -#: install/step3.php:104 +#: install/step3.php:145 msgid "Converting database fields to utf8 character set" msgstr "Convertendo campos da base de dados para conjunto de caracteres utf8" -#: install/step3.php:126 +#: install/step3.php:169 msgid "Create new NagiosQL database" msgstr "Criar nova base de dados" -#: install/step3.php:133 -msgid "Database already exists and drop database was not selected, please correct or manage manually" -msgstr "A base de dados já existe e a sua exclusão não foi selecionada. Corrija ou faça manualmente, através de seu gerenciador MySQL" +#: install/step3.php:202 +msgid "" +"Database already exists and drop database was not selected, please correct " +"or manage manually" +msgstr "" +"O banco de dados já existe e a base de destino não foi selecionada. Corrija " +"ou gerencie manualmente" -#: install/step3.php:137 -#: install/functions/install_class.php:115 -#: install/functions/install_class.php:159 -msgid "passed" -msgstr "OK" - -#: install/step3.php:146 +#: install/step3.php:218 msgid "unknown" msgstr "desconhecido" -#: install/step3.php:211 +#: install/step3.php:293 msgid "Back" msgstr "Voltar" -#: install/step3.php:216 +#: install/step3.php:298 msgid "Please delete the install directory to continue!" msgstr "Remova o diretório de instalação do NagiosQL (install) para continuar!" -#: install/functions/install_class.php:110 -#: install/functions/install_class.php:154 -#: install/functions/install_class.php:188 -#: install/functions/install_class.php:229 -#: install/functions/install_class.php:303 -#: install/functions/install_class.php:335 -#: install/functions/install_class.php:413 -#: install/functions/install_class.php:529 -#: install/functions/install_class.php:768 -#: install/functions/install_class.php:814 -#: install/functions/install_class.php:901 -msgid "Database type not defined!" -msgstr "Tipo de base de dados não definido!" - -#: install/functions/install_class.php:195 -#: install/functions/install_class.php:265 -msgid "supported" -msgstr "Suportado" - -#: install/functions/install_class.php:198 -msgid "not supported" -msgstr "Não suportado" - -#: install/functions/install_class.php:268 -msgid "Your NagiosQL installation is up to date - no further actions are needed!" -msgstr "O NagiosQL está atualizado! Nenhuma ação adicional é necessária." - -#: install/functions/install_class.php:272 -#: install/functions/install_class.php:279 -msgid "Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and above!" -msgstr "Atualização para o NagiosQL 3.2 é suportada apenas para servidores que tenham a versão NagiosQL 3.0.0 ou superior." - -# prepend.adm -#: install/functions/install_class.php:277 -msgid "Error while selecting settings table." -msgstr "Erro ao selecionar a tabela de configurações!" - -#: install/functions/install_class.php:308 -#: install/functions/install_class.php:340 -#: install/functions/install_class.php:419 -#: install/functions/install_class.php:421 -#: install/functions/install_class.php:494 -#: install/functions/install_class.php:534 -#: install/functions/install_class.php:625 -#: install/functions/install_class.php:675 -#: install/functions/install_class.php:732 -#: install/functions/install_class.php:740 -#: install/functions/install_class.php:773 -#: install/functions/install_class.php:819 -#: install/functions/install_class.php:906 -msgid "done" -msgstr "Concluído" - -#: install/functions/install_class.php:419 -msgid "Only added rights to existing user" -msgstr "Direitos adicionados apenas a usuários existentes" - -#: install/functions/install_class.php:483 -#: install/functions/install_class.php:488 -msgid "SQL file is not readable or empty" -msgstr "Arquivo SQL ilegível ou vazio" - -# mutdialog.php -#: install/functions/install_class.php:501 -msgid "No SQL update files available" -msgstr "Atualização de arquivos SQL não disponível" - -#: install/functions/install_class.php:571 -#: install/functions/install_class.php:576 -#: install/functions/install_class.php:585 -#: install/functions/install_class.php:590 -#: install/functions/install_class.php:613 -#: install/functions/install_class.php:620 -msgid "Inserting initial data to settings database has failed:" -msgstr "A entrada inicial dos dados para configuração da base de dados falhou:" - -#: install/functions/install_class.php:679 -msgid "Connot open/write to config/settings.php" -msgstr "Não foi possível abrir o arquivo config/settings.php para gravação" - -#: install/functions/install_class.php:713 -#: install/functions/install_class.php:720 -msgid "Inserting path data to database has failed:" -msgstr "A entrada de dados do caminho para a base de dados falhou:" - -#: install/functions/install_class.php:732 -msgid "Check the permissions of the created paths!" -msgstr "Verifique as permissões dos caminhos criados!" - -#: install/functions/install_class.php:736 -msgid "NagiosQL config path is not writeable - only database values updated" -msgstr "O diretório base do NagiosQL não tem permissão de gravação. Apenas os valores da base de dados foram atualizados" - -# prepend.adm -#: install/functions/install_class.php:776 -#: install/functions/install_class.php:822 -#: install/functions/install_class.php:909 -msgid "Database errors while converting to utf-8:" -msgstr "Ocorreram erros durante a conversão para UTF-8" - -#~ msgid "Polish" -#~ msgstr "Polish" -#~ msgid "Japanese" -#~ msgstr "Japanese" -#~ msgid "Spanish (Argentina)" -#~ msgstr "Spanish (Argentina)" -#~ msgid "PHP session module" -#~ msgstr "PHP session module" -#~ msgid "PHP gettext module" -#~ msgstr "PHP Module:" -#~ msgid "PHP ftp module" -#~ msgstr "PHP Module:" -#~ msgid "PHP ssh module" -#~ msgstr "PHP Module:" -#~ msgid "Could not connect to Updateserver" -#~ msgstr "Could not connect to update server" -#~ msgid "Error" -#~ msgstr "Error" -#~ msgid "An error occured during the version check" -#~ msgstr "An error occured during the version check" -#~ msgid "Checking for NagiosQL Updates" -#~ msgstr "Checking for NagiosQL Updates" -#~ msgid "You already have the latest development version installed" -#~ msgstr "You already have the latest development version installed" -#~ msgid "" -#~ "Entry cannot be deactivated because it is used by another configuration" -#~ msgstr "" -#~ "Entry cannot be deactivated because it is used by another configuration" -#~ msgid "Automatically check for online updates (internet access required!)" -#~ msgstr "Automatically check for online updates (internet access required!)" -#~ msgid "Connection to remote system failed (SSH2 connection)!" -#~ msgstr "Connection to remote system failed (SSH2 connection)!" -#~ msgid "Connection to remote system failed (FTP connection)!" -#~ msgstr "Connection to remote system failed (FTP connection)!" -#~ msgid "No dataset activated. Probably the dataset does not exist" -#~ msgstr "No dataset activated. Probably the dataset does not exist" -#~ msgid "No dataset deactivated. Probably the dataset does not exist" -#~ msgstr "No dataset deactivated. Probably the dataset does not exist" -#~ msgid "Relation information for " -#~ msgstr "Relational information for " -#~ msgid "Not installed" -#~ msgstr "Not installed" -#~ msgid "The following settings are optional but recommended" -#~ msgstr "The following settings are optional but recommended" +#~ msgid "Cgi config file" +#~ msgstr "Cgi config file" +#~ msgid "Password too short or password fields don" +#~ msgstr "Password too short or password fields don" diff --git a/config/locale/ru_RU/LC_MESSAGES/ru_RU.po b/config/locale/ru_RU/LC_MESSAGES/ru_RU.po index bd4c1df..eb09c1a 100644 --- a/config/locale/ru_RU/LC_MESSAGES/ru_RU.po +++ b/config/locale/ru_RU/LC_MESSAGES/ru_RU.po @@ -2,11 +2,9 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# # Translators: @@ -24,7 +22,6 @@ msgstr "" "Language: ru_RU\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n" "X-Generator: Pootle 2.1.5\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" "X-Poedit-KeywordsList: translate\n" "X-Poedit-SourceCharset: utf-8\n" "X-Poedit-SearchPath-0: .\n" diff --git a/config/locale/zh_CN/LC_MESSAGES/zh_CN.mo b/config/locale/zh_CN/LC_MESSAGES/zh_CN.mo index 1be472c..d1a9dab 100644 Binary files a/config/locale/zh_CN/LC_MESSAGES/zh_CN.mo and b/config/locale/zh_CN/LC_MESSAGES/zh_CN.mo differ diff --git a/config/locale/zh_CN/LC_MESSAGES/zh_CN.po b/config/locale/zh_CN/LC_MESSAGES/zh_CN.po index 6ac26bf..d63aa6b 100644 --- a/config/locale/zh_CN/LC_MESSAGES/zh_CN.po +++ b/config/locale/zh_CN/LC_MESSAGES/zh_CN.po @@ -2,3341 +2,3379 @@ # # # # Project : NagiosQL # # Component : Translation File English -# # Website : http://www.nagiosql.org -# # Date : $LastChangedDate: 2012-03-09 22:55:35 +0100 (Fri, 09 Mar 2012) $ -# # Author : $LastChangedBy: martin $ -# # Version : 3.1.1 -# # Revision : $LastChangedRevision: 1284 $ +# # Website : https://sourceforge.net/projects/nagiosql/ +# # Version : 3.4.0 +# # GIT Repo : https://gitlab.com/wizonet/NagiosQL # # # ############################################################################# # Translators: +# mm8m6m7m <766527901@qq.com>, 2018 msgid "" msgstr "" "Project-Id-Version: NagiosQL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-03-09 22:54+0100\n" -"PO-Revision-Date: 2012-03-09 22:54+0100\n" -"Last-Translator: \n" -"Language-Team: Chinese (China) (http://www.transifex.net/projects/p/nagiosql/language/zh_CN/)\n" +"POT-Creation-Date: 2018-05-07 15:58+0200\n" +"PO-Revision-Date: 2018-06-09 11:54+0200\n" +"Last-Translator: mm8m6m7m <766527901@qq.com>\n" +"Language-Team: Chinese (China) (http://www.transifex.com/wizonet/nagiosql/language/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: zh_CN\n" -"Plural-Forms: nplurals=1; plural=0\n" -"X-Generator: Pootle 2.1.5\n" -"X-Poedit-Basepath: D:\\$_Daten\\Webentwicklung\\NagiosQL_v3.2_svn\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.0.6\n" +"X-Poedit-Basepath: ../../../..\n" "X-Poedit-KeywordsList: translate\n" -"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-SourceCharset: UTF-8\n" "X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: functions/yui\n" +"X-Poedit-SearchPathExcluded-1: functions/tinyMCE\n" +"X-Poedit-SearchPathExcluded-2: _archive\n" -#: admin.php:34 +#: admin.php:37 msgid "NagiosQL Administration" msgstr "NagiosQL管理" -#: admin.php:37 -msgid "Welcome to NagiosQL, the administration module that can be used to easily create, modify and delete configuration files for Nagios. The data is stored in a database and can be written directly to the standard files at any time you want." +#: admin.php:40 +msgid "" +"Welcome to NagiosQL, the administration module that can be used to easily create, modify and delete configuration files for " +"Nagios. The data is stored in a database and can be written directly to the standard files at any time you want." msgstr "" +"欢迎使用NagiosQL管理模块,可以轻松地创建、修改和删除NAGIOS的配置文件。数据存储在数据库中,并且可以在任何时候直接写入到nagios的标准" +"文件。" -#: index.php:45 -msgid "Welcome to" -msgstr "欢迎来到" - -#: index.php:46 -msgid "Welcome" -msgstr "欢迎" - -#: index.php:47 -msgid "Please enter your username and password to access NagiosQL.
If you forgot one of them, please contact your Administrator." -msgstr "请输入你的用户名及密码以访问NagiosQL。
如果你忘记其中的一个,请联系管理员。" - -#: index.php:48 -msgid "Username" -msgstr "用户名" - -#: index.php:49 -msgid "Password" -msgstr "密码" - -#: index.php:50 -msgid "Login" -msgstr "登录" - -#: admin/administration.php:31 +#: admin/administration.php:35 config/fieldvars.php:298 functions/prepend_adm.php:460 functions/prepend_adm.php:469 msgid "Administration" msgstr "管理" # administration.php -#: admin/administration.php:34 +#: admin/administration.php:38 msgid "Functions to administrate NagiosQL V3" -msgstr "管理NagiosQL3版的功能" +msgstr "管理NAGIOSQL V3的功能" -#: admin/alarming.php:31 +#: admin/alarming.php:35 config/fieldvars.php:293 config/fieldvars.php:294 msgid "Alarming" msgstr "警告" # alarming.php -#: admin/alarming.php:34 +#: admin/alarming.php:36 msgid "To define contact data, contact templates and contact groups and time periods." -msgstr "定义联系数据,联系组及时间段。" +msgstr "定义联系人对象内容,联系组及时间段。" -#: admin/alarming.php:35 -#: admin/commands.php:35 +#: admin/alarming.php:38 admin/commands.php:38 admin/monitoring.php:40 admin/specials.php:40 msgid "Statistical datas" msgstr "统计数据" -#: admin/alarming.php:36 -#: admin/commands.php:36 +#: admin/alarming.php:39 admin/commands.php:39 admin/monitoring.php:41 admin/specials.php:41 msgid "Group" msgstr "组" -#: admin/alarming.php:37 -#: admin/commands.php:37 +#: admin/alarming.php:40 admin/commands.php:40 admin/monitoring.php:42 admin/specials.php:42 config/fieldvars.php:55 msgid "Active" msgstr "活动" -#: admin/alarming.php:38 -#: admin/commands.php:38 +#: admin/alarming.php:41 admin/commands.php:41 admin/monitoring.php:43 admin/specials.php:43 msgid "Inactive" msgstr "非活动" -#: admin/alarming.php:45 +#: admin/alarming.php:52 config/fieldvars.php:303 msgid "Contact data" msgstr "联系数据" -#: admin/alarming.php:51 +#: admin/alarming.php:60 config/fieldvars.php:156 config/fieldvars.php:304 msgid "Contact groups" msgstr "联系组" -#: admin/alarming.php:57 +#: admin/alarming.php:68 config/fieldvars.php:301 msgid "Time periods" msgstr "时间段" -#: admin/alarming.php:63 +#: admin/alarming.php:76 config/fieldvars.php:330 msgid "Contact templates" msgstr "联系人模板" -#: admin/cgicfg.php:61 -#: admin/cgicfg.php:81 +#: admin/cgicfg.php:65 admin/cgicfg.php:87 admin/nagioscfg.php:65 admin/nagioscfg.php:87 admin/verify.php:63 admin/verify.php:85 +#: functions/NagConfigClass.php:2107 msgid "Configuration file successfully written!" msgstr "配置文件写入成功!" -#: admin/cgicfg.php:62 -#: admin/cgicfg.php:82 +#: admin/cgicfg.php:67 admin/cgicfg.php:89 admin/nagioscfg.php:67 admin/nagioscfg.php:89 functions/NagConfigClass.php:2106 msgid "Configuration successfully written:" msgstr "配置写入成功" -#: admin/cgicfg.php:64 +#: admin/cgicfg.php:69 admin/nagioscfg.php:69 admin/verify.php:65 admin/verify.php:87 functions/NagConfigClass.php:1993 msgid "Cannot open/overwrite the configuration file (check the permissions)!" msgstr "不能打开/覆盖配置文件(检查权限)!" -#: admin/cgicfg.php:65 +#: admin/cgicfg.php:71 admin/nagioscfg.php:71 functions/NagConfigClass.php:1992 msgid "Configuration write failed:" msgstr "配置写入失败:" -#: admin/cgicfg.php:85 +#: admin/cgicfg.php:92 admin/nagioscfg.php:92 msgid "Cannot open/overwrite the configuration file (check the permissions on remote system)!" msgstr "不能打开/覆盖配置文件(检查远程系统的权限)!" -#: admin/cgicfg.php:86 +#: admin/cgicfg.php:94 admin/nagioscfg.php:94 msgid "Configuration write failed (remote):" msgstr "配置文件写入错误(远程):" -#: admin/cgicfg.php:94 +#: admin/cgicfg.php:99 admin/nagioscfg.php:99 +msgid "There are no nagios configuration files in common domain, please select a valid domain to edit this files!" +msgstr "在公共域中没有NAGIOS配置文件,请选择一个有效的域来编辑此文件!" + +#: admin/cgicfg.php:105 msgid "CGI configuration file" msgstr "CGI配置文件" -#: admin/cgicfg.php:117 +#: admin/cgicfg.php:123 admin/nagioscfg.php:123 functions/NagImportClass.php:209 msgid "Cannot open the data file (check the permissions)!" msgstr "不能打开数据文件(检查权限)!" -#: admin/cgicfg.php:132 +#: admin/cgicfg.php:139 admin/nagioscfg.php:138 msgid "Cannot open the temporary file" msgstr "不能打开临时文件" -#: admin/cgicfg.php:136 +#: admin/cgicfg.php:143 admin/nagioscfg.php:142 msgid "Configuration read failed (remote):" msgstr "配置文件写入错误(远程):" -#: admin/checkcommands.php:53 +#: admin/checkcommands.php:62 msgid "New command inserted:" msgstr "插入新命令:" -#: admin/checkcommands.php:54 +#: admin/checkcommands.php:65 msgid "Command modified:" msgstr "更改命令:" -#: admin/checkcommands.php:57 -#: admin/configtargets.php:131 -#: admin/contactgroups.php:80 -#: admin/contacts.php:157 -#: admin/contacttemplates.php:157 -#: admin/datadomain.php:58 +#: admin/checkcommands.php:70 admin/configtargets.php:152 admin/contactgroups.php:123 admin/contacts.php:237 +#: admin/contacttemplates.php:242 admin/datadomain.php:72 admin/group.php:115 admin/hostdependencies.php:182 +#: admin/hostescalations.php:182 admin/hostextinfo.php:72 admin/hostgroups.php:124 admin/hosts.php:380 admin/hosttemplates.php:272 +#: admin/password.php:83 admin/servicedependencies.php:290 admin/serviceescalations.php:233 admin/serviceextinfo.php:81 +#: admin/servicegroups.php:126 admin/services.php:387 admin/servicetemplates.php:318 admin/timeperiods.php:150 admin/user.php:82 msgid "Database entry failed! Not all necessary data filled in!" msgstr "数据库入口查找失败!并非所有必须数据被填充!" -#: admin/checkcommands.php:60 -#: admin/configtargets.php:134 -#: admin/contactgroups.php:83 -#: admin/contacts.php:160 -#: admin/contacttemplates.php:160 -#: admin/datadomain.php:61 +#: admin/checkcommands.php:75 admin/configtargets.php:157 admin/contactgroups.php:128 admin/contacts.php:242 +#: admin/contacttemplates.php:247 admin/datadomain.php:77 admin/group.php:120 admin/hostdependencies.php:187 +#: admin/hostescalations.php:187 admin/hostextinfo.php:77 admin/hostgroups.php:129 admin/hosts.php:385 admin/hosttemplates.php:277 +#: admin/servicedependencies.php:295 admin/serviceescalations.php:238 admin/serviceextinfo.php:86 admin/servicegroups.php:131 +#: admin/services.php:392 admin/servicetemplates.php:323 admin/timeperiods.php:155 admin/user.php:87 msgid "Database entry failed! No write access!" -msgstr "" +msgstr "数据库连接失败!无写访问权限!" -# checkcommand.php -#: admin/checkcommands.php:73 -msgid "Command definitions" -msgstr "命令定义" - -#: admin/checkcommands.php:88 -#: admin/contactgroups.php:124 -#: admin/contacts.php:255 -#: admin/contacttemplates.php:247 -#: admin/datadomain.php:91 +#: admin/checkcommands.php:108 admin/contactgroups.php:199 admin/contacts.php:398 admin/contacttemplates.php:398 +#: admin/datadomain.php:114 admin/hostdependencies.php:301 admin/hostescalations.php:305 admin/hostextinfo.php:122 +#: admin/hostgroups.php:202 admin/hosts.php:596 admin/hosttemplates.php:466 admin/servicedependencies.php:646 +#: admin/serviceescalations.php:500 admin/serviceextinfo.php:173 admin/servicegroups.php:204 admin/services.php:630 +#: admin/servicetemplates.php:551 admin/timeperiods.php:225 msgid "Saving not possible!" msgstr "不能保存!" -#: admin/checkcommands.php:90 +# checkcommand.php +#: admin/checkcommands.php:113 admin/checkcommands.php:144 +msgid "Command definitions" +msgstr "命令定义" + +#: admin/checkcommands.php:114 msgid "unclassified" msgstr "未分类" -#: admin/checkcommands.php:91 +#: admin/checkcommands.php:115 msgid "check command" msgstr "检查命令" -#: admin/checkcommands.php:92 +#: admin/checkcommands.php:116 msgid "misc command" msgstr "各种命令" -#: admin/checkcommands.php:98 -#: admin/contactgroups.php:131 -#: admin/contacts.php:269 -#: admin/contacttemplates.php:261 +#: admin/checkcommands.php:122 admin/contactgroups.php:209 admin/contacts.php:419 admin/contacttemplates.php:418 +#: admin/hostdependencies.php:308 admin/hostescalations.php:312 admin/hostextinfo.php:132 admin/hostgroups.php:212 +#: admin/hosts.php:606 admin/hosttemplates.php:476 admin/servicedependencies.php:679 admin/serviceescalations.php:536 +#: admin/serviceextinfo.php:199 admin/servicegroups.php:214 admin/services.php:637 admin/servicetemplates.php:558 +#: admin/timeperiods.php:236 msgid "Entry cannot be activated because it is used by another configuration" msgstr "由于入口被其他配置占用,无法激活" -#: admin/checkcommands.php:115 +#: admin/checkcommands.php:145 msgid "Command name" msgstr "命令名" -#: admin/checkcommands.php:116 +#: admin/checkcommands.php:146 config/fieldvars.php:90 msgid "Command line" msgstr "命令行" # prepend.adm -#: admin/checkcommands.php:129 -#: admin/checkcommands.php:140 -#: admin/configtargets.php:264 -#: admin/configtargets.php:275 -#: admin/contactgroups.php:159 -#: admin/contactgroups.php:170 -#: admin/contacts.php:319 -#: admin/contacts.php:330 -#: admin/contacttemplates.php:311 -#: admin/contacttemplates.php:322 -#: admin/datadomain.php:137 -#: admin/datadomain.php:148 +#: admin/checkcommands.php:163 admin/checkcommands.php:177 admin/configtargets.php:321 admin/configtargets.php:335 +#: admin/contactgroups.php:242 admin/contactgroups.php:256 admin/contacts.php:477 admin/contacts.php:491 +#: admin/contacttemplates.php:475 admin/contacttemplates.php:489 admin/datadomain.php:162 admin/datadomain.php:176 +#: admin/group.php:177 admin/group.php:190 admin/hostdependencies.php:352 admin/hostdependencies.php:366 +#: admin/hostescalations.php:349 admin/hostescalations.php:363 admin/hostextinfo.php:167 admin/hostextinfo.php:184 +#: admin/hostgroups.php:246 admin/hostgroups.php:260 admin/hosts.php:690 admin/hosts.php:704 admin/hosttemplates.php:558 +#: admin/hosttemplates.php:572 admin/logbook.php:50 admin/logbook.php:77 admin/menuaccess.php:69 admin/password.php:45 +#: admin/password.php:66 admin/servicedependencies.php:723 admin/servicedependencies.php:737 admin/serviceescalations.php:574 +#: admin/serviceescalations.php:588 admin/serviceextinfo.php:235 admin/serviceextinfo.php:253 admin/servicegroups.php:248 +#: admin/servicegroups.php:262 admin/services.php:713 admin/services.php:746 admin/services.php:761 admin/servicetemplates.php:642 +#: admin/servicetemplates.php:656 admin/settings.php:241 admin/timeperiods.php:271 admin/timeperiods.php:285 admin/user.php:188 +#: admin/user.php:201 functions/NagConfigClass.php:1352 functions/NagDataClass.php:191 functions/NagVisualClass.php:841 +#: functions/prepend_adm.php:111 functions/prepend_adm.php:322 functions/prepend_adm.php:381 functions/prepend_adm.php:495 +#: functions/prepend_adm.php:527 functions/prepend_content.php:495 msgid "Error while selecting data from database:" msgstr "从数据库查取数据失败" -#: admin/commands.php:31 -#: admin/commands.php:45 +#: admin/commands.php:35 admin/commands.php:49 msgid "Check commands" msgstr "检查命令" # commands.php -#: admin/commands.php:34 +#: admin/commands.php:36 msgid "To define check and misc commands, notification commands and special commands." msgstr "定义检查及各种命令,提醒命令和特殊命令" # mutdialog.php -#: admin/configtargets.php:56 -#: admin/configtargets.php:62 -#: admin/configtargets.php:82 +#: admin/configtargets.php:60 admin/configtargets.php:67 admin/configtargets.php:89 admin/configtargets.php:94 msgid "is not writeable" msgstr "不可写" -#: admin/configtargets.php:62 -#: admin/configtargets.php:77 +#: admin/configtargets.php:66 admin/configtargets.php:82 admin/support.php:287 config/fieldvars.php:46 msgid "Nagios config file" msgstr "Nagios配置文件" -#: admin/configtargets.php:77 +#: admin/configtargets.php:83 msgid "is not a valid configuration file!" -msgstr "" +msgstr "这不是有效的配置文件!" -#: admin/configtargets.php:82 -msgid "Cgi config file" -msgstr "" +#: admin/configtargets.php:88 config/fieldvars.php:226 +msgid "Nagios base directory" +msgstr "Nagios基目录" -#: admin/configtargets.php:89 +#: admin/configtargets.php:93 +msgid "Nagios cgi config file" +msgstr "Nagios CGI配置文件" + +#: admin/configtargets.php:98 +msgid "Nagios resource config file" +msgstr "Nagios资源配置文件" + +# mutdialog.php +#: admin/configtargets.php:99 +msgid "is not readable" +msgstr "不可读" + +#: admin/configtargets.php:105 functions/NagConfigClass.php:363 functions/NagConfigClass.php:2083 msgid "SSH module not loaded!" msgstr "SSH模块没有加载!" -#: admin/configtargets.php:94 +#: admin/configtargets.php:110 functions/NagConfigClass.php:2061 msgid "FTP module not loaded!" msgstr "FTP模块没有加载!" # domain.php -#: admin/configtargets.php:127 -#: admin/datadomain.php:54 +#: admin/configtargets.php:144 admin/datadomain.php:64 msgid "New Domain inserted:" msgstr "插入新域:" -#: admin/configtargets.php:128 -#: admin/datadomain.php:55 +#: admin/configtargets.php:147 admin/datadomain.php:67 msgid "Domain modified:" msgstr "被修改的域:" -#: admin/configtargets.php:142 +#: admin/configtargets.php:180 admin/configtargets.php:309 msgid "Configuration domain administration" -msgstr "" +msgstr "配置域管理" -#: admin/configtargets.php:143 +#: admin/configtargets.php:182 msgid "Warning, at least one error occured, please check!" msgstr "警告,至少发省了一个错误,请检查!" -#: admin/configtargets.php:158 -#: admin/datadomain.php:92 +#: admin/configtargets.php:188 admin/datadomain.php:117 admin/group.php:149 admin/password.php:99 admin/user.php:130 +#: config/fieldvars.php:204 install/step2.php:33 msgid "Please fill in all fields marked with an *" -msgstr "请填写所有标记*的空白" +msgstr "请填写标有*的所有字段。" -#: admin/configtargets.php:159 -#: admin/datadomain.php:93 -msgid "The following field contains not permitted characters:" -msgstr "下列域包含不被允许的字符:" +#: admin/configtargets.php:189 admin/datadomain.php:118 admin/group.php:150 admin/user.php:131 config/fieldvars.php:206 +msgid "The following field contains illegal characters:" +msgstr "以下字段包含非法字符:" -#: admin/configtargets.php:255 +#: admin/configtargets.php:310 config/fieldvars.php:265 msgid "Configuration target" -msgstr "" +msgstr "配置目标" -#: admin/configtargets.php:256 -#: admin/contactgroups.php:146 -#: admin/contacts.php:301 -#: admin/contacttemplates.php:293 -#: admin/datadomain.php:129 +#: admin/configtargets.php:311 admin/contactgroups.php:226 admin/contacts.php:456 admin/contacttemplates.php:455 +#: admin/datadomain.php:152 admin/group.php:167 admin/hostgroups.php:229 admin/hosts.php:673 admin/hosttemplates.php:542 +#: admin/servicegroups.php:231 admin/timeperiods.php:254 admin/user.php:178 config/fieldvars.php:21 msgid "Description" msgstr "描述" -#: admin/contactgroups.php:53 +#: admin/contactgroups.php:62 msgid "New contact group inserted:" msgstr "插入新联系人组:" -#: admin/contactgroups.php:54 +#: admin/contactgroups.php:65 msgid "Contact group modified:" msgstr "修改联系人组:" -#: admin/contactgroups.php:96 +#: admin/contactgroups.php:146 admin/contactgroups.php:224 msgid "Define contact groups (contactgroups.cfg)" msgstr "定义联系人组(contactgroups.cfg)" -#: admin/contactgroups.php:111 +#: admin/contactgroups.php:165 msgid "Attention, no contacts defined!" msgstr "注意,未定义联系人!" -#: admin/contactgroups.php:145 +#: admin/contactgroups.php:225 config/fieldvars.php:102 msgid "Contact group" msgstr "联系人组" # contacts.php -#: admin/contacts.php:70 +#: admin/contacts.php:84 msgid "New contact inserted:" msgstr "插入新的联系人:" -#: admin/contacts.php:71 +#: admin/contacts.php:87 msgid "Contact modified:" msgstr "被修改的联系人:" -#: admin/contacts.php:173 +#: admin/contacts.php:260 admin/contacts.php:454 msgid "Define contacts (contacts.cfg)" msgstr "定义联系人(contacts.cfg)" -#: admin/contacts.php:230 +#: admin/contacts.php:329 admin/hosts.php:515 admin/services.php:566 msgid "Attention, no time periods defined!" msgstr "注意,没有定义时间段!" -#: admin/contacts.php:241 +#: admin/contacts.php:364 msgid "Attention, no commands defined!" msgstr "注意,没有定义命令!" -#: admin/contacts.php:300 -#: admin/contacttemplates.php:292 +#: admin/contacts.php:455 admin/contacttemplates.php:454 config/fieldvars.php:101 msgid "Contact name" msgstr "联系人名字" # hosttemplates.php -#: admin/contacttemplates.php:70 +#: admin/contacttemplates.php:84 msgid "New contact template inserted:" msgstr "已插入的新联系模板:" -#: admin/contacttemplates.php:71 +#: admin/contacttemplates.php:87 msgid "Contact template modified:" msgstr "已修改的联系模板:" -#: admin/contacttemplates.php:173 +#: admin/contacttemplates.php:265 admin/contacttemplates.php:453 msgid "Define contact templates (contacttemplates.cfg)" msgstr "定义联系人模板(contacttemplates.cfg)" -#: admin/datadomain.php:69 -msgid "Data domain administration" -msgstr "" - -#: admin/datadomain.php:82 +#: admin/datadomain.php:98 msgid "Attention, no configuration targets defined!" -msgstr "" +msgstr "注意!没有配置目标定义!" -#: admin/datadomain.php:94 +#: admin/datadomain.php:116 admin/datadomain.php:150 +msgid "Data domain administration" +msgstr "数据域管理" + +#: admin/datadomain.php:119 admin/settings.php:280 msgid "Enable" msgstr "启用" # mutdialog.php -#: admin/datadomain.php:95 +#: admin/datadomain.php:120 admin/settings.php:281 msgid "Disable" msgstr "禁用" # fieldvars.php -#: admin/datadomain.php:128 +#: admin/datadomain.php:151 msgid "Data domain" -msgstr "" +msgstr "数据域" -#: admin/delbackup.php:50 -#: admin/delconfig.php:50 +#: admin/delbackup.php:55 admin/delconfig.php:55 msgid "File deleted" msgstr "被删除的文件" -#: admin/delbackup.php:51 -#: admin/delconfig.php:51 +#: admin/delbackup.php:56 admin/delconfig.php:56 msgid "successfully deleted" msgstr "删除成功" -#: admin/delbackup.php:60 +#: admin/delbackup.php:65 config/fieldvars.php:316 msgid "Delete backup files" msgstr "删除备份文件" -#: admin/delbackup.php:63 -#: admin/delconfig.php:63 +#: admin/delbackup.php:68 admin/delconfig.php:68 admin/import.php:94 msgid "Filter string" msgstr "过滤字符串" -#: admin/delbackup.php:64 -#: admin/delconfig.php:64 +#: admin/delbackup.php:69 admin/delconfig.php:69 admin/import.php:95 config/fieldvars.php:84 msgid "Search" msgstr "搜索" -#: admin/delbackup.php:65 -#: admin/delbackup.php:70 -#: admin/delconfig.php:65 -#: admin/delconfig.php:70 +#: admin/delbackup.php:70 admin/delbackup.php:75 admin/delconfig.php:70 admin/delconfig.php:75 admin/groupusers.php:166 +#: admin/import.php:96 admin/templatedefinitions.php:268 admin/timedefinitions.php:180 admin/variabledefinitions.php:147 +#: config/fieldvars.php:76 config/fieldvars.php:183 msgid "Delete" msgstr "删除" -#: admin/delbackup.php:66 -#: admin/delconfig.php:66 +#: admin/delbackup.php:71 admin/delconfig.php:71 admin/import.php:97 config/fieldvars.php:85 msgid "Reset filter" msgstr "重置过滤条件" -#: admin/delbackup.php:68 +#: admin/delbackup.php:73 msgid "Backup file" msgstr "备份文件" -#: admin/delbackup.php:69 -#: admin/delconfig.php:69 +#: admin/delbackup.php:74 admin/delconfig.php:74 admin/settings.php:312 config/fieldvars.php:57 msgid "required" msgstr "必填" -#: admin/delbackup.php:71 -#: admin/delconfig.php:71 +#: admin/delbackup.php:76 admin/delconfig.php:76 admin/import.php:104 admin/password.php:98 admin/settings.php:311 +#: config/fieldvars.php:59 msgid "Abort" msgstr "取消" -#: admin/delbackup.php:72 -#: admin/delconfig.php:72 +#: admin/delbackup.php:77 admin/delconfig.php:77 config/fieldvars.php:282 msgid "Hold CTRL to select
more than one entry" msgstr "按住CTTL选择
多个" -#: admin/delbackup.php:106 -#: admin/delbackup.php:131 +#: admin/delbackup.php:120 admin/delbackup.php:156 msgid "No backup files or no permission to read the backup files" -msgstr "" +msgstr "没有备份文件或没有权限读取备份文件" -#: admin/delconfig.php:60 +#: admin/delconfig.php:65 config/fieldvars.php:315 msgid "Delete config files" msgstr "删除配置文件" -#: admin/delconfig.php:68 +#: admin/delconfig.php:73 msgid "Configuration file" -msgstr "" +msgstr "配置文件" -#: admin/download.php:67 +#: admin/download.php:61 config/fieldvars.php:87 msgid "Download" msgstr "下载" -#: admin/group.php:53 +#: admin/group.php:63 msgid "A new group added:" msgstr "新增组:" -#: admin/group.php:54 +#: admin/group.php:66 admin/user.php:77 msgid "User modified:" msgstr "用户被修改:" -#: admin/group.php:94 +#: admin/group.php:144 admin/group.php:165 msgid "Group administration" msgstr "用户组管理" -#: admin/group.php:114 +#: admin/group.php:145 msgid "Read" msgstr "读" -#: admin/group.php:115 +#: admin/group.php:146 admin/verify.php:97 admin/verify.php:101 admin/verify.php:112 admin/verify.php:116 admin/verify.php:127 +#: admin/verify.php:131 admin/verify.php:142 admin/verify.php:146 admin/verify.php:161 admin/verify.php:170 admin/verify.php:179 +#: admin/verify.php:188 admin/verify.php:197 admin/verify.php:201 admin/verify.php:212 admin/verify.php:216 admin/verify.php:227 +#: admin/verify.php:231 admin/verify.php:242 admin/verify.php:246 admin/verify.php:257 admin/verify.php:261 admin/verify.php:272 +#: admin/verify.php:276 admin/verify.php:287 admin/verify.php:291 msgid "Write" msgstr "写" -#: admin/group.php:116 +#: admin/group.php:147 msgid "Link" msgstr "链接" -#: admin/group.php:134 +#: admin/group.php:166 msgid "Groupname" msgstr "组名" -#: admin/groupusers.php:150 +#: admin/groupusers.php:175 admin/templatedefinitions.php:277 admin/timedefinitions.php:189 admin/variabledefinitions.php:156 +#: functions/NagContentClass.php:136 msgid "No data" msgstr "无数据" -#: admin/helpedit.php:65 +#: admin/helpedit.php:83 msgid "Help text editor" msgstr "帮助文本编辑器" -#: admin/helpedit.php:76 +#: admin/helpedit.php:89 msgid "Main key" msgstr "主键" -#: admin/helpedit.php:77 +#: admin/helpedit.php:90 msgid "Sub key" msgstr "子键" -#: admin/helpedit.php:78 +#: admin/helpedit.php:91 admin/settings.php:226 admin/settings.php:227 install/index.php:71 msgid "Language" msgstr "语言" -#: admin/helpedit.php:79 +#: admin/helpedit.php:92 config/fieldvars.php:49 msgid "Nagios version" msgstr "Nagios版本" -#: admin/helpedit.php:80 +#: admin/helpedit.php:93 msgid "Load default text" msgstr "载入缺省文本" # hosttemplates.php -#: admin/hostdependencies.php:61 +#: admin/hostdependencies.php:70 msgid "New host dependency inserted:" msgstr "插入新主机依赖性:" -#: admin/hostdependencies.php:62 +#: admin/hostdependencies.php:73 msgid "Host dependency modified:" msgstr "改变了主机依赖关系" -#: admin/hostdependencies.php:125 +#: admin/hostdependencies.php:205 admin/hostdependencies.php:332 msgid "Define host dependencies (hostdependencies.cfg)" msgstr "定义主机依赖性(hostdependencies.cfg)" -#: admin/hostdependencies.php:153 -#: admin/hostescalations.php:141 +#: admin/hostdependencies.php:285 admin/hostescalations.php:242 admin/servicedependencies.php:533 admin/serviceescalations.php:369 msgid "Attention, no hosts and hostgroups defined!" -msgstr "注意,没有定义主机或主机组" +msgstr "注意!没有定义主机和主机组!" -#: admin/hostdependencies.php:189 -#: admin/hostescalations.php:188 +#: admin/hostdependencies.php:333 admin/hostescalations.php:331 admin/servicedependencies.php:705 admin/serviceescalations.php:556 +#: admin/services.php:705 config/fieldvars.php:217 msgid "Config name" msgstr "配置名称" -#: admin/hostdependencies.php:190 +#: admin/hostdependencies.php:334 config/fieldvars.php:234 msgid "Dependent hosts" msgstr "依赖的主机" -#: admin/hostdependencies.php:190 +#: admin/hostdependencies.php:334 config/fieldvars.php:235 msgid "Dependent hostgroups" msgstr "依赖的主机组" # hosttemplates.php -#: admin/hostescalations.php:60 +#: admin/hostescalations.php:70 msgid "New host escalation inserted:" msgstr "插入新升级主机:" -#: admin/hostescalations.php:61 +#: admin/hostescalations.php:73 msgid "Host escalation modified:" msgstr "升级主机被修改:" -#: admin/hostescalations.php:124 +#: admin/hostescalations.php:205 admin/hostescalations.php:330 msgid "Define host escalation (hostescalations.cfg)" msgstr "定义升级主机(hostescalationss.cfg)" -#: admin/hostescalations.php:156 +#: admin/hostescalations.php:289 admin/serviceescalations.php:433 msgid "Attention, no contacts and contactgroups defined!" -msgstr "注意,没有定义联系人或联系人组!" +msgstr "注意!没有定义联系人和联系组!" -#: admin/hostescalations.php:189 -#: admin/monitoring.php:46 +#: admin/hostescalations.php:332 admin/monitoring.php:56 config/fieldvars.php:211 config/fieldvars.php:300 msgid "Hosts" msgstr "主机" -#: admin/hostescalations.php:189 -#: admin/monitoring.php:58 +#: admin/hostescalations.php:332 admin/monitoring.php:72 config/fieldvars.php:127 config/fieldvars.php:306 msgid "Host groups" msgstr "主机组" # hosttemplates.php -#: admin/hostextinfo.php:55 +#: admin/hostextinfo.php:64 msgid "New host extended information inserted:" msgstr "插入新主机扩展信息:" -#: admin/hostextinfo.php:56 +#: admin/hostextinfo.php:67 msgid "Host extended information modified:" msgstr "主机扩展信息改变:" -#: admin/hostextinfo.php:75 +#: admin/hostextinfo.php:95 admin/hostextinfo.php:147 msgid "Define host extended information (hostextinfo.cfg)" msgstr "定义主机扩展信息(hostextinfo.cfg)" -#: admin/hostextinfo.php:88 -#: admin/hostgroups.php:111 +#: admin/hostextinfo.php:106 admin/hostgroups.php:168 admin/serviceextinfo.php:141 msgid "Attention, no hosts defined!" msgstr "注意,没有定义主机!" -#: admin/hostextinfo.php:118 -#: admin/hosts.php:454 +#: admin/hostextinfo.php:148 admin/hosts.php:672 config/fieldvars.php:202 msgid "Host name" msgstr "主机名" -#: admin/hostextinfo.php:119 +#: admin/hostextinfo.php:149 config/fieldvars.php:166 msgid "Notes" msgstr "注释" -#: admin/hostgroups.php:54 +#: admin/hostgroups.php:63 msgid "New host group inserted:" msgstr "插入新主机组:" -#: admin/hostgroups.php:55 +#: admin/hostgroups.php:66 msgid "Host group modified:" msgstr "主机组被修改:" -#: admin/hostgroups.php:97 +#: admin/hostgroups.php:147 admin/hostgroups.php:227 msgid "Define host groups (hostgroups.cfg)" msgstr "定义主机组(hostgroups.cfg)" -#: admin/hostgroups.php:145 +#: admin/hostgroups.php:228 msgid "Host group" msgstr "主机组" # contacts.php -#: admin/hosts.php:77 +#: admin/hosts.php:95 msgid "New host inserted:" msgstr "新主机插入:" -#: admin/hosts.php:78 +#: admin/hosts.php:98 msgid "Host modified:" msgstr "被修改的主机:" -#: admin/hosts.php:129 -#: admin/hosts.php:152 +#: admin/hosts.php:192 admin/hosts.php:218 admin/services.php:249 admin/services.php:279 functions/NagDataClass.php:556 +#: functions/NagDataClass.php:583 functions/prepend_content.php:415 functions/prepend_content.php:475 msgid "The assigned, no longer used configuration files were deleted successfully!" msgstr "被指定的不被使用的配置文件删除成功" -#: admin/hosts.php:130 -#: admin/hosts.php:153 +#: admin/hosts.php:194 admin/hosts.php:220 functions/NagDataClass.php:558 functions/NagDataClass.php:586 +#: functions/prepend_content.php:401 msgid "Host file deleted:" msgstr "删除的主机文件:" -#: admin/hosts.php:133 -#: admin/hosts.php:156 +#: admin/hosts.php:197 admin/hosts.php:223 admin/services.php:254 functions/prepend_content.php:424 functions/prepend_content.php:484 msgid "Common files cannot be removed from target systems - please check manually" msgstr "普通文件不能从目标系统移除-请人工检查" -#: admin/hosts.php:135 -#: admin/hosts.php:158 +#: admin/hosts.php:200 admin/hosts.php:226 admin/services.php:257 admin/services.php:283 functions/NagDataClass.php:560 +#: functions/NagDataClass.php:588 functions/prepend_content.php:419 functions/prepend_content.php:479 msgid "Errors while deleting the old configuration file - please check!:" msgstr "删除旧配置文件时发生错误 - 请检查" -#: admin/hosts.php:283 +#: admin/hosts.php:396 admin/hosts.php:671 msgid "Define hosts (hosts.cfg)" msgstr "定义主机(hosts.cfg)" -#: admin/hosts.php:371 +#: admin/hosts.php:562 msgid "Attention, no contact groups defined!" -msgstr "注意,没有定义联系组!" +msgstr "注意!没有定义联系组!" # hosttemplates.php -#: admin/hosttemplates.php:76 +#: admin/hosttemplates.php:96 msgid "New host template inserted:" msgstr "插入新主机模板:" -#: admin/hosttemplates.php:77 +#: admin/hosttemplates.php:99 msgid "Host template modified:" msgstr "主机模板被修改:" -#: admin/hosttemplates.php:187 +#: admin/hosttemplates.php:295 admin/hosttemplates.php:540 msgid "Host template definition (hosttemplates.cfg)" msgstr "主机模板定义(hosttemplates.cfg)" -#: admin/hosttemplates.php:345 +#: admin/hosttemplates.php:541 msgid "Host template name" msgstr "主机模板名称" -#: admin/import.php:51 +#: admin/import.php:55 msgid "File upload error:" msgstr "文件上传错误:" -#: admin/import.php:61 -#: admin/import.php:75 -msgid "File imported - File [overwite flag]:" -msgstr "导入文件 - 文件[覆盖标志]:" +#: admin/import.php:67 admin/import.php:83 +msgid "File imported - File [overwrite flag]:" +msgstr "文件导入-文件[覆写标志]:" -#: admin/import.php:82 +#: admin/import.php:91 msgid "Configuration import" msgstr "导入配置" -#: admin/import.php:90 +#: admin/import.php:99 msgid "Template definition" msgstr "模板定义" -#: admin/import.php:91 +#: admin/import.php:100 msgid "Import file" msgstr "导入文件" -#: admin/import.php:92 +#: admin/import.php:101 msgid "Local import file" msgstr "本地导入文件" -#: admin/import.php:93 +#: admin/import.php:102 msgid "Overwrite database" msgstr "覆盖数据库" -#: admin/import.php:94 +#: admin/import.php:103 msgid "Import" msgstr "导入" -#: admin/import.php:96 +#: admin/import.php:105 msgid "Hold CTRL to select
more than one" msgstr "按住CTTL选择
多个" -#: admin/import.php:100 -msgid "To prevent errors or misconfigurations, you should import your configurations in an useful order. We recommend to do it like this:

commands -> timeperiods -> contacttemplates -> contacts -> contactgroups -> hosttemplates -> hosts -> hostgroups -> servicetemplates -> services -> servicegroups

" +#: admin/import.php:109 +msgid "" +"To prevent errors or misconfigurations, you should import your configurations in an useful order. We recommend to do it like this:" +"

commands -> timeperiods -> contacttemplates -> contacts -> contactgroups -> hosttemplates -> hosts -> hostgroups -> " +"servicetemplates -> services -> servicegroups

" msgstr "" +"为了防止错误或错误配置,您应该以有用的顺序导入配置。我们建议这样做:

命令->时间段->联系模板->联系人->联系组->主机模板-" +">主机->主机组>服务模板>服务>服务组

" -#: admin/import.php:101 -msgid "Check your configuration after import!
In cause of an error or an uncomplete configuration, re-importing the wrong configuration can solve the problem." -msgstr "" +#: admin/import.php:113 +msgid "" +"Check your configuration after import!
In cause of an error or an uncomplete configuration, re-importing the wrong " +"configuration can solve the problem." +msgstr "导入后检查你的配置!
为了保证由于错误或不完整的配置,重新导入错误的配置可以解决这个问题。" -#: admin/info.php:39 +#: admin/info.php:43 msgid "This is relative path of your NagiosQL Installation" msgstr "这是NagiosQL的相对安装路径" -#: admin/info.php:40 +#: admin/info.php:44 msgid "This is the absolut path to your NagiosQL Installation" msgstr "这是NagiosQL的绝对安装路径" -#: admin/info.php:41 +#: admin/info.php:45 msgid "If you need a secure connection, select HTTPS instead of HTTP" msgstr "如果你需要使用安全连接,使用HTTPS而不是使用HTTP" -#: admin/info.php:42 +#: admin/info.php:46 msgid "Please choose a temporary directory with write permissions. The default is the temp directory provided by your OS" msgstr "请选择一个有写权限的临时路径。默认情况下是操作系统提供的临时路径" -#: admin/info.php:43 -msgid "Please choose your application language" -msgstr "请选择你的应用语言" +#: admin/info.php:48 +msgid "Please choose your application language for new users and login portal" +msgstr "请为新用户选择应用语言和登录门户" -#: admin/info.php:44 +#: admin/info.php:49 msgid "Encoding should be set to nothing else than utf-8. Any changes at your own risk" -msgstr "编码不应设置为utf-8以外的其他编码。修改的风险由个人承担" +msgstr "编码不应设置为UTF-8以外的编码。修改的风险自行承担" -#: admin/info.php:45 +#: admin/info.php:50 msgid "IP-Address or hostname of the database server
e.g. localhost" msgstr "数据库服务器IP地址或者主机名
例如localhost" -#: admin/info.php:46 +#: admin/info.php:51 msgid "MySQL Server Port, default is 3306" msgstr "MySQL服务器端口,默认3306" -#: admin/info.php:47 +#: admin/info.php:52 msgid "Name of the NagiosQL database
e.g. db_nagiosql_v3" msgstr "NagiosQL数据库名
例如db_nagiosql_v3" -#: admin/info.php:48 -msgid "User with sufficient permission for the NagiosQL database
At least this user should have SELECT, INSERT, UPDATE, DELETE permissions" +#: admin/info.php:53 +msgid "" +"User with sufficient permission for the NagiosQL database
At least this user should have SELECT, INSERT, UPDATE, DELETE " +"permissions" msgstr "有足够NagiosQL数据库权限的用户
至少是此用户应该有SELECT,INSERT,UPDATE,DELETE权限" -#: admin/info.php:49 +#: admin/info.php:55 msgid "Password for the above mentioned user" msgstr "上述用户密码" -#: admin/info.php:50 +#: admin/info.php:56 msgid "After the defined amount of seconds the session will terminate for security reasons" -msgstr "在指定的秒数过后,session将会由于安全原因而关闭" +msgstr "在定义的秒数过后,出于安全原因,会话将终止。" -#: admin/info.php:51 +#: admin/info.php:58 msgid "Decide between authentication based on your Webserver
e.g. Apache configuration (config file or htaccess) or NagiosQL" msgstr "决定使用网页服务器认证
如:Apache配置文件(配置我恶念或htaccess)还是NagiosQL" -#: admin/info.php:52 -msgid "How many entries per side should be visibile (e.g. services or hosts)" -msgstr "单个网站可见入口数(如:服务或者主机)" +#: admin/info.php:60 +msgid "Number of entries per side that should be visible (e.g. services or hosts)" +msgstr "应该是可见的(例如服务或主机)每侧的条目数。" -#: admin/info.php:53 -msgid "Selection of multiple entries by using the new dialog or by holding CTRL + left click like in NagiosQL2" +#: admin/info.php:61 +msgid "Method of selection of multiple entries by using the new dialog or by holding CTRL + left mouse button, as in NagiosQL 2" msgstr "通过使用新对话框或者像NagiosQL2按住CTRL + 鼠标左键选择多个条目" -#: admin/info.php:54 +#: admin/info.php:63 msgid "Enable or disable the warning if a required field contains no data in objects with templates" msgstr "如果模版内缺少必要的数据,启用或禁止警告。" -#: admin/info.php:55 +#: admin/info.php:65 msgid "Enable or disable the automatic online version check." msgstr "启用或禁止自动版本检查。" -#: admin/info.php:56 +#: admin/info.php:66 msgid "If you require a Proxyserver to connect to the Internet (Port 80), please define one." msgstr "如果你需要代理服务器连接到互联网(端口80),请定义一个。" -#: admin/info.php:57 +#: admin/info.php:68 msgid "Address of your Proxyserver e.g. proxy.yourdomain.com:3128" msgstr "代理服务器地址,例如proxy.youdomain.com:3128" -#: admin/info.php:58 +#: admin/info.php:69 msgid "Username to connect through your proxy (optional)" msgstr "通过代理链接使用的用户名(可选)" -#: admin/info.php:59 +#: admin/info.php:70 msgid "Password to connect through your proxy (optional)" msgstr "通过代理链接使用的密码(可选)" -#: admin/info.php:78 +#: admin/info.php:92 msgid "Information PopUp" msgstr "弹出信息" # mutdialog.php -#: admin/info.php:91 +#: admin/info.php:105 msgid "No information available" msgstr "无可用信息" -#: admin/logbook.php:48 +#: admin/logbook.php:53 functions/NagDataClass.php:401 functions/NagDataClass.php:436 functions/NagDataClass.php:611 msgid "Dataset successfully deleted. Affected rows:" msgstr "数据集成功删除。影响行数:" # logbook.php -#: admin/logbook.php:74 +#: admin/logbook.php:83 msgid "View logbook" msgstr "查看日志簿" -#: admin/logbook.php:78 +#: admin/logbook.php:87 msgid "Delete logentries between:" msgstr "删除日志区间:" -#: admin/logbook.php:80 -msgid "Please at least fill in a start or a stop time" +#: admin/logbook.php:89 +msgid "Please supply a start or a stop time at least" msgstr "请至少输入起始时间或截止时间" -#: admin/logbook.php:81 +#: admin/logbook.php:90 msgid "Do you really want to delete all log entries between the selected dates?" msgstr "你真的希望删除所选日期间的所有日志么?" -#: admin/logbook.php:86 +#: admin/logbook.php:97 msgid "previous 20 entries" msgstr "前20条条目" -#: admin/logbook.php:92 +#: admin/logbook.php:104 msgid "next 20 entries" msgstr "后20条条目" -#: admin/menuaccess.php:40 -msgid "Error while inserting the data to the data base:" +#: admin/menuaccess.php:44 functions/NagDataClass.php:137 functions/NagDataClass.php:290 +msgid "Error while inserting the data into the database:" msgstr "写入数据库错误:" -#: admin/menuaccess.php:43 +#: admin/menuaccess.php:47 functions/NagDataClass.php:134 functions/NagDataClass.php:285 msgid "Data were successfully inserted to the data base!" msgstr "数据成功写入数据库!" -#: admin/menuaccess.php:44 +#: admin/menuaccess.php:48 msgid "Access group set for menu item:" msgstr "菜单条目中的访问组:" # menuaccess.php -#: admin/menuaccess.php:50 -msgid "Define Menu Accessrights" +#: admin/menuaccess.php:55 +msgid "Define Menu Access Rights" msgstr "定义菜单访问权限" -#: admin/menuaccess.php:54 +#: admin/menuaccess.php:59 msgid "In order for a user to get access, he needs to be member of the group selected here." msgstr "为使一个用户可以访问,他需要是所选择组的成员。" -#: admin/monitoring.php:32 +#: admin/monitoring.php:36 msgid "Monitoring" msgstr "监测" # monitoring.php -#: admin/monitoring.php:35 -msgid "To define host and service supervisions as well as host and service groups." -msgstr "定义对主机及服务的监控以及主机和服务器组" +#: admin/monitoring.php:39 +msgid "Define host and service supervisions as well as host and service groups." +msgstr "定义对主机及服务的监控以及主机和服务器组." -#: admin/monitoring.php:52 +#: admin/monitoring.php:64 admin/serviceescalations.php:557 config/fieldvars.php:248 config/fieldvars.php:305 msgid "Services" msgstr "服务" -#: admin/monitoring.php:64 +#: admin/monitoring.php:80 config/fieldvars.php:213 config/fieldvars.php:307 msgid "Service groups" msgstr "服务组" -#: admin/monitoring.php:70 +#: admin/monitoring.php:88 config/fieldvars.php:302 config/fieldvars.php:328 msgid "Host templates" msgstr "主机模板" -#: admin/monitoring.php:76 +#: admin/monitoring.php:96 config/fieldvars.php:329 msgid "Service templates" msgstr "服务模板" # mutdialog.php -#: admin/mutdialog.php:51 +#: admin/mutdialog.php:57 admin/versioncheck.php:83 msgid "Available" msgstr "可用的" -#: admin/mutdialog.php:52 +#: admin/mutdialog.php:58 msgid "Selected" msgstr "选择" -#: admin/nagioscfg.php:94 +#: admin/nagioscfg.php:105 msgid "Nagios main configuration file" msgstr "Nagios主配置文件" -#: admin/password.php:50 +#: admin/password.php:55 msgid "Password successfully modified" msgstr "成功修改密码" -#: admin/password.php:64 -#: admin/user.php:72 -msgid "Password too short or password fields unequally!" +#: admin/password.php:72 admin/user.php:90 +msgid "Password too short or password fields do not match!" msgstr "密码太短或密码不匹配" -#: admin/password.php:68 -msgid "Old password is wrong" +#: admin/password.php:78 +msgid "The old password is invalid" msgstr "错误的旧密码" -#: admin/password.php:84 -#: admin/settings.php:244 +#: admin/password.php:97 admin/settings.php:310 config/fieldvars.php:58 msgid "Save" msgstr "保存" -#: admin/password.php:87 -msgid "The new passwords are not equal!" -msgstr "新密码不匹配" +#: admin/password.php:100 +msgid "The new passwords don not match!" +msgstr "新密码不匹配!" -#: admin/password.php:88 +#: admin/password.php:101 msgid "The new password is too short - use at least 6 characters!" msgstr "新密码太短 - 至少使用6个字符!" # hosttemplates.php -#: admin/servicedependencies.php:61 +#: admin/servicedependencies.php:72 msgid "New service dependency inserted:" msgstr "插入新服务依赖项:" -#: admin/servicedependencies.php:62 +#: admin/servicedependencies.php:75 msgid "Service dependency modified:" msgstr "更改服务依赖项" -#: admin/servicedependencies.php:157 +#: admin/servicedependencies.php:313 admin/servicedependencies.php:704 msgid "Define service dependencies (servicedependencies.cfg)" msgstr "定义服务依赖项(servicedependencies.cfg)" -#: admin/servicedependencies.php:351 +#: admin/servicedependencies.php:706 config/fieldvars.php:247 msgid "Dependent services" msgstr "依赖的服务" # hosttemplates.php -#: admin/serviceescalations.php:61 +#: admin/serviceescalations.php:71 msgid "New service escalation inserted:" msgstr "插入新升级服务:" -#: admin/serviceescalations.php:62 +#: admin/serviceescalations.php:74 msgid "Service escalation modified:" msgstr "升级模板被修改:" -#: admin/serviceescalations.php:141 +#: admin/serviceescalations.php:256 admin/serviceescalations.php:555 msgid "Define service escalation (serviceescalations.cfg)" msgstr "定义服务升级(serviceescalations.cfg)" # hosttemplates.php -#: admin/serviceextinfo.php:54 +#: admin/serviceextinfo.php:64 msgid "New service extended information inserted:" msgstr "插入新服务扩展信息:" -#: admin/serviceextinfo.php:55 +#: admin/serviceextinfo.php:68 msgid "Service extended information modified:" msgstr "更改了服务扩展信息" -#: admin/serviceextinfo.php:79 +#: admin/serviceextinfo.php:104 admin/serviceextinfo.php:214 msgid "Define service extended information (serviceextinfo.cfg)" msgstr "定义服务扩展信息(serviceextinfo.cfg)" -#: admin/serviceextinfo.php:159 +#: admin/serviceextinfo.php:215 msgid "Hostname" msgstr "主机名" -#: admin/serviceextinfo.php:160 +#: admin/serviceextinfo.php:216 msgid "Service" msgstr "服务" # hosttemplates.php -#: admin/servicegroups.php:54 +#: admin/servicegroups.php:63 msgid "New service group inserted:" msgstr "插入的新服务组" -#: admin/servicegroups.php:55 +#: admin/servicegroups.php:66 msgid "Service group modified:" msgstr "被修改的服务组:" -#: admin/servicegroups.php:97 +#: admin/servicegroups.php:149 admin/servicegroups.php:229 msgid "Define service groups (servicegroups.cfg)" msgstr "定义服务组(servicegroups.cfg)" -#: admin/servicegroups.php:112 +#: admin/servicegroups.php:170 msgid "Attention, no services defined!" msgstr "注意,没有定义服务!" -#: admin/servicegroups.php:146 +#: admin/servicegroups.php:230 msgid "Service group" msgstr "服务组" # hosttemplates.php -#: admin/services.php:77 +#: admin/services.php:96 msgid "New service inserted:" msgstr "插入的新服务" -#: admin/services.php:78 +#: admin/services.php:99 msgid "Service modified:" msgstr "修改的服务:" -#: admin/services.php:141 -#: admin/services.php:167 +#: admin/services.php:251 admin/services.php:281 functions/prepend_content.php:460 msgid "Service file deleted:" msgstr "删除的服务文件:" -#: admin/services.php:255 +#: admin/services.php:403 admin/services.php:704 msgid "Define services (services.cfg)" msgstr "定义服务(services.cfg)" -#: admin/services.php:311 +#: admin/services.php:488 msgid "Attention, no hosts or hostgroups defined!" msgstr "注意,没有定义主机或主机组" -#: admin/services.php:328 +#: admin/services.php:543 msgid "Attention, no check commands defined!" msgstr "注意,没有定义要检查的命令" -#: admin/services.php:354 +#: admin/services.php:613 msgid "Attention, no contacts or contact groups defined!" -msgstr "" +msgstr "注意,没有定义联系人或联系人组!" -#: admin/services.php:436 +#: admin/services.php:706 msgid "Service name" msgstr "服务名称" -#: admin/services.php:438 -#: admin/services.php:462 +#: admin/services.php:708 admin/services.php:732 msgid "All configs" msgstr "所有配置" # hosttemplates.php -#: admin/servicetemplates.php:76 +#: admin/servicetemplates.php:97 msgid "New service template inserted:" msgstr "插入新服务模板:" -#: admin/servicetemplates.php:77 +#: admin/servicetemplates.php:100 msgid "Service template modified:" msgstr "服务模板被修改:" -#: admin/servicetemplates.php:195 +#: admin/servicetemplates.php:341 admin/servicetemplates.php:623 msgid "Define service templates (servicetemplates.cfg)" msgstr "定义服务模板(servicetemplates.cfg)" -#: admin/servicetemplates.php:357 +#: admin/servicetemplates.php:624 config/fieldvars.php:124 config/fieldvars.php:225 msgid "Template name" msgstr "模板名称" -#: admin/servicetemplates.php:358 +#: admin/servicetemplates.php:625 config/fieldvars.php:212 msgid "Service description" msgstr "服务描述" -#: admin/settings.php:63 +#: admin/settings.php:111 msgid "Curl module not loaded, Proxy will be deactivated!" msgstr "Curl模块没有加载,代理将被禁用。" -#: admin/settings.php:90 +#: admin/settings.php:136 msgid "An error occured while writing settings to database:" -msgstr "" +msgstr "将设置写入数据库时发生错误:" -#: admin/settings.php:129 -msgid "Error in setting the correct locale, please report this error with the associated output of 'locale -a'" +#: admin/settings.php:187 functions/prepend_adm.php:150 +msgid "Error setting the correct locale. Please report this error with the associated output of 'locale -a'" msgstr "在设置区域时出错,请汇报此错误以及'locale -a'的输出" -#: admin/settings.php:136 +#: admin/settings.php:195 msgid "Settings were changed" msgstr "配置被改变" -#: admin/settings.php:138 -msgid "An error occured while writing settings.php, please check permissions!" +#: admin/settings.php:197 +msgid "An error occured while writing settings.php. Please check permissions!" msgstr "在写入settings.php时发生错误,请检查权限!" -#: admin/settings.php:141 +#: admin/settings.php:201 msgid "is not writeable, please check permissions!" -msgstr "" +msgstr "没有写的权限,请检查权限!" -#: admin/settings.php:147 +#: admin/settings.php:208 msgid "Configure Settings" msgstr "配置选项" -#: admin/settings.php:154 +#: admin/settings.php:213 msgid "Change your current NagiosQL settings (e.g. Database user, Language)." msgstr "改变你当前的NagiosQL配置(例如 数据库用户,语言)" -#: admin/settings.php:158 +#: admin/settings.php:218 msgid "Path" msgstr "路径" -#: admin/settings.php:159 +#: admin/settings.php:219 msgid "Temporary Directory" msgstr "临时路径" -#: admin/settings.php:161 +#: admin/settings.php:221 msgid "Server protocol" msgstr "服务器协议" -#: admin/settings.php:182 +#: admin/settings.php:244 msgid "Encoding" msgstr "编码" -#: admin/settings.php:187 +#: admin/settings.php:249 msgid "Database" msgstr "数据库" -#: admin/settings.php:188 +#: admin/settings.php:250 msgid "MySQL Server" msgstr "MySQL服务器" -#: admin/settings.php:190 +#: admin/settings.php:252 msgid "MySQL Server Port" msgstr "MySQL服务器端口" -#: admin/settings.php:192 +#: admin/settings.php:254 install/step2.php:66 msgid "Database name" msgstr "数据库名" -#: admin/settings.php:194 +#: admin/settings.php:256 msgid "Database user" msgstr "数据库用户" -#: admin/settings.php:196 +#: admin/settings.php:258 msgid "Database password" msgstr "数据库密码" -#: admin/settings.php:201 +#: admin/settings.php:263 msgid "Security" msgstr "安全" -#: admin/settings.php:202 +#: admin/settings.php:264 msgid "Session auto logoff time" msgstr "Session自动退出时间" -#: admin/settings.php:204 +#: admin/settings.php:266 msgid "Authentication type" msgstr "认证类型" -#: admin/settings.php:209 +#: admin/settings.php:271 msgid "Common" msgstr "普通" -#: admin/settings.php:210 +#: admin/settings.php:272 msgid "Data lines per page" msgstr "每页的数据行数" -#: admin/settings.php:212 +#: admin/settings.php:274 msgid "Selection method" msgstr "选择方法" -#: admin/settings.php:217 +#: admin/settings.php:279 msgid "Template warn message" msgstr "模板警告信息" -#: admin/settings.php:226 +#: admin/settings.php:288 msgid "Online version check" -msgstr "" +msgstr "在线检查版本" -#: admin/settings.php:232 +#: admin/settings.php:296 msgid "Proxyserver" msgstr "代理服务器" -#: admin/settings.php:235 +#: admin/settings.php:301 msgid "Proxy Address" msgstr "代理地址" -#: admin/settings.php:237 +#: admin/settings.php:303 msgid "Proxy Username (optional)" msgstr "代理用户名(可选)" -#: admin/settings.php:239 +#: admin/settings.php:305 msgid "Proxy Password (optional)" msgstr "代理密码(可选)" -#: admin/specials.php:31 +#: admin/specials.php:35 msgid "Misc commands" msgstr "各种命令" # specials.php -#: admin/specials.php:34 -msgid "To define host and service dependencies, host and service escalations as well as host and service additional data." -msgstr " 定义主机及服务间的依赖关系,主机及服务升级和主机及服务的附属数据。" +#: admin/specials.php:38 +msgid "Define host and service dependencies, host and service escalations as well as host and service additional data." +msgstr "定义主机及服务间的依赖关系,主机及服务升级和主机及服务的附属数据。" -#: admin/specials.php:45 +#: admin/specials.php:56 msgid "Host dependencies" msgstr "主机依赖关系" -#: admin/specials.php:51 +#: admin/specials.php:64 msgid "Host escalations" msgstr "主机升级" -#: admin/specials.php:57 +#: admin/specials.php:72 msgid "Host ext. info" msgstr "主机其他信息" -#: admin/specials.php:63 +#: admin/specials.php:80 msgid "Service dependencies" msgstr "服务依赖关系" -#: admin/specials.php:69 +#: admin/specials.php:88 msgid "Service escalations" msgstr "服务升级" -#: admin/specials.php:75 +#: admin/specials.php:96 msgid "Service ext. info" msgstr "服务其他信息" -#: admin/support.php:65 +#: admin/support.php:39 msgid "NagiosQL support page" +msgstr "NagiosQL帮助页面" + +#: admin/support.php:49 +msgid "Support contact information" +msgstr "帮助联系信息" + +#: admin/support.php:50 +msgid "For questions, the online support forum or contact information visit our website:" +msgstr "有关问题,在线支持论坛或联系人信息访问我们的网站:" + +#: admin/support.php:52 +msgid "NagiosQL on sourceforge" +msgstr "在SourceForge中的NagiosQL" + +#: admin/support.php:56 +msgid "Donate to support NagiosQL" +msgstr "捐献支持NAGIOSQL" + +#: admin/support.php:57 +msgid "" +"If you like NagiosQL and it simplifies your daily work, then you may want to support the project by making a donation. This helps " +"us to keep NagiosQL alive and to cover our costs. Thank you for your donation!" msgstr "" +"如果你喜欢NagiosQL,它简化了你的日常工作,那么你可能想通过捐赠来支持这个项目。这有助于我们保持NigiOSQL的活力并支付我们的成本。谢谢" +"你的捐赠!" + +#: admin/support.php:60 functions/NagVisualClass.php:230 functions/NagVisualClass.php:231 +msgid "Donate for NagiosQL on sourceforge" +msgstr "在sourceforge中捐献NagiosQL" + +#: admin/support.php:64 +msgid "Translation services" +msgstr "翻译服务" + +#: admin/support.php:65 +msgid "" +"NagiosQL was translated into various languages​​. Since some translators are no longer available in later versions, there may be " +"untranslated words or phrases. If you want to help us complete the translation, correct them or introduce a new language​​, then " +"sign up with us now! The translations are simply feasible online - we use an open translation service where you can register for " +"free at any time:" +msgstr "" +"NagiosQL被翻译成各种语言。由于一些翻译人员在以后的版本中不再可用,因此可能有未翻译的词或短语。如果你想帮助我们完成翻译,改正它们或" +"者介绍一种新的语言,那么现在就与我们签约!翻译在网上是可行的,我们使用一个开放的翻译服务,你可以随时免费注册:" + +#: admin/support.php:70 +msgid "Transifex translation service" +msgstr "Transifex的翻译服务" + +#: admin/support.php:74 +msgid "GIT software repository" +msgstr "Git软件存储库" #: admin/support.php:75 -msgid "Support contact information" -msgstr "" +msgid "" +"The NagiosQL sources are available on GitLab. There you will always find the latest bugfixes and changes as well as older branches." +msgstr "NGIOSQL源可在GITLAB上使用。在那里,你总会发现最新的错误和变化以及旧的分支。" -#: admin/support.php:76 -msgid "For questions, the online support forum or contact information visit our website:" -msgstr "" - -#: admin/support.php:80 -msgid "Donate to support NagiosQL" -msgstr "" +#: admin/support.php:77 +msgid "GitLab" +msgstr "Gitlab" #: admin/support.php:81 -msgid "If you like NagiosQL and it simplifies your daily work, then you may want to support the project by making a donation. This helps us to keep NagiosQL alive and to cover our costs. Thank you for your donation!" -msgstr "" +msgid "Version check" +msgstr "版本检查" -#: admin/support.php:82 -msgid "Donate for NagiosQL on sourceforge" -msgstr "" +#: admin/support.php:83 +msgid "The online version check is not enabled. You can enable it on the settings page." +msgstr "无法启用联机版本检查。您可以在设置页上启用它。" #: admin/support.php:86 -msgid "Translation services" -msgstr "" - -#: admin/support.php:87 -msgid "NagiosQL was translated into various languages​​. Since some translators are no longer available in later versions, there may be untranslated words or phrases. If you want to help us complete the translation, correct them or introduce a new language​​, then sign up with us now! The translations are simply feasible online - we use an open translation service where you can register for free at any time:" -msgstr "" - -#: admin/support.php:88 -msgid "Transifex translation service" -msgstr "" - -#: admin/support.php:92 -msgid "Version check" -msgstr "" - -#: admin/support.php:94 -msgid "The online version check is not enabled. You can enable it on the settings page." -msgstr "" - -#: admin/support.php:96 msgid "The online version check connects the NagiosQL page to find out, if your version is still up to date." -msgstr "" +msgstr "在线版本检查连接NAGIOSQL页面,如果您的版本仍然是最新的。" -#: admin/support.php:106 +#: admin/support.php:98 msgid "Environment check" -msgstr "" +msgstr "环境检查" -#: admin/support.php:108 -#: admin/support.php:118 -#: admin/support.php:129 -#: admin/support.php:137 -#: admin/support.php:146 -#: admin/support.php:156 -#: admin/support.php:171 -#: admin/support.php:183 -#: admin/support.php:192 -#: admin/support.php:201 -#: admin/support.php:210 -#: admin/support.php:220 -#: admin/support.php:267 -#: admin/support.php:282 -#: admin/support.php:301 -#: admin/support.php:332 -#: admin/support.php:354 -#: admin/support.php:358 -#: admin/support.php:375 -#: admin/support.php:379 -#: admin/support.php:395 -#: admin/support.php:398 -#: admin/support.php:401 -#: admin/support.php:420 -#: admin/support.php:424 -#: admin/support.php:427 -#: admin/support.php:439 -#: admin/support.php:442 -#: admin/support.php:459 -#: admin/support.php:466 -#: admin/support.php:551 -#: admin/support.php:554 -#: admin/support.php:566 -#: admin/support.php:583 -#: admin/support.php:607 +#: admin/support.php:100 admin/support.php:109 admin/support.php:121 admin/support.php:129 admin/support.php:138 +#: admin/support.php:148 admin/support.php:163 admin/support.php:176 admin/support.php:185 admin/support.php:194 +#: admin/support.php:203 admin/support.php:213 admin/support.php:263 admin/support.php:278 admin/support.php:299 +#: admin/support.php:337 admin/support.php:360 admin/support.php:366 admin/support.php:392 admin/support.php:396 +#: admin/support.php:415 admin/support.php:418 admin/support.php:421 admin/support.php:435 admin/support.php:440 +#: admin/support.php:443 admin/support.php:448 admin/support.php:460 admin/support.php:465 admin/support.php:484 +#: admin/support.php:492 admin/support.php:589 admin/support.php:592 admin/support.php:613 admin/support.php:642 +#: admin/support.php:677 install/functions/NagInstallClass.php:338 install/functions/NagInstallClass.php:370 +#: install/functions/NagInstallClass.php:406 install/functions/NagInstallClass.php:485 install/functions/NagInstallClass.php:493 +#: install/functions/NagInstallClass.php:515 install/functions/NagInstallClass.php:539 install/functions/NagInstallClass.php:551 +#: install/functions/NagInstallClass.php:618 install/functions/NagInstallClass.php:640 install/functions/NagInstallClass.php:649 +#: install/functions/NagInstallClass.php:701 install/functions/NagInstallClass.php:706 install/functions/NagInstallClass.php:739 +#: install/functions/NagInstallClass.php:777 install/functions/NagInstallClass.php:784 install/functions/NagInstallClass.php:812 +#: install/functions/NagInstallClass.php:872 install/functions/NagInstallClass.php:904 install/functions/NagInstallClass.php:938 +#: install/functions/NagInstallClass.php:971 install/functions/NagInstallClass.php:1010 install/functions/NagInstallClass.php:1019 +#: install/functions/NagInstallClass.php:1062 install/functions/NagInstallClass.php:1071 install/step1.php:229 install/step1.php:242 +#: install/step1.php:246 install/step1.php:255 install/step1.php:264 install/step1.php:273 install/step1.php:282 +#: install/step1.php:291 install/step1.php:300 install/step3.php:90 install/step3.php:179 install/step3.php:204 msgid "failed" msgstr "失败" -#: admin/support.php:109 -#: admin/support.php:115 -#: admin/support.php:126 -#: admin/support.php:134 -#: admin/support.php:142 -#: admin/support.php:152 -#: admin/support.php:168 -#: admin/support.php:180 -#: admin/support.php:189 -#: admin/support.php:198 -#: admin/support.php:207 -#: admin/support.php:217 -#: admin/support.php:259 -#: admin/support.php:272 -#: admin/support.php:287 -#: admin/support.php:295 -#: admin/support.php:298 -#: admin/support.php:329 -#: admin/support.php:335 -#: admin/support.php:350 -#: admin/support.php:364 -#: admin/support.php:371 -#: admin/support.php:389 -#: admin/support.php:392 -#: admin/support.php:405 -#: admin/support.php:416 -#: admin/support.php:436 -#: admin/support.php:446 -#: admin/support.php:462 -#: admin/support.php:547 -#: admin/support.php:560 -#: admin/support.php:562 -#: admin/support.php:564 -#: admin/support.php:570 -#: admin/support.php:572 -#: admin/support.php:576 -#: admin/support.php:578 +#: admin/support.php:101 admin/support.php:106 admin/support.php:118 admin/support.php:126 admin/support.php:134 +#: admin/support.php:144 admin/support.php:160 admin/support.php:173 admin/support.php:182 admin/support.php:191 +#: admin/support.php:200 admin/support.php:210 admin/support.php:255 admin/support.php:268 admin/support.php:283 +#: admin/support.php:292 admin/support.php:295 admin/support.php:334 admin/support.php:340 admin/support.php:356 +#: admin/support.php:372 admin/support.php:388 admin/support.php:407 admin/support.php:410 admin/support.php:425 +#: admin/support.php:432 admin/support.php:457 admin/support.php:469 admin/support.php:488 admin/support.php:584 +#: admin/support.php:600 admin/support.php:605 admin/support.php:610 admin/support.php:619 admin/support.php:624 +#: admin/support.php:630 admin/support.php:635 msgid "ok" -msgstr "" +msgstr "OK" -#: admin/support.php:112 +#: admin/support.php:103 msgid "PHP version" -msgstr "" +msgstr "PHP版本" -#: admin/support.php:118 -#: admin/support.php:171 +#: admin/support.php:110 admin/support.php:163 msgid "Required:" -msgstr "" +msgstr "必填:" -#: admin/support.php:123 -#: admin/support.php:131 -#: admin/support.php:139 -#: admin/support.php:149 +#: admin/support.php:115 admin/support.php:123 admin/support.php:131 admin/support.php:141 install/index.php:170 +#: install/index.php:171 install/index.php:172 install/index.php:173 msgid "PHP module:" -msgstr "" +msgstr "PHP模块:" -#: admin/support.php:161 +#: admin/support.php:153 msgid "MySQL version" -msgstr "" +msgstr "MySQL版本" -#: admin/support.php:176 -#: admin/support.php:185 -#: admin/support.php:194 -#: admin/support.php:203 +#: admin/support.php:169 admin/support.php:178 admin/support.php:187 admin/support.php:196 msgid "PHP ini settings:" -msgstr "" +msgstr "PHP ini设置:" -#: admin/support.php:213 +#: admin/support.php:206 msgid "Read/Write access:" +msgstr "写/读权限:" + +#: admin/support.php:222 +msgid "Config domain checks" +msgstr "配置域检查" + +#: admin/support.php:223 +msgid "" +"The checks below are based on your data domain and config domain settings. To change the data domain, use the pull down menu in " +"the upper right corner. Repeat this check for any data domain you have configured. To change the config domain, use the data " +"domain menu and select a different config domain value." msgstr "" +"下面的检查基于您的数据域和配置域设置。要更改数据域,请使用右上角的下拉菜单。对已配置的任何数据域重复此检查。若要更改配置域,请使" +"用“数据域”菜单并选择不同的配置域值。" #: admin/support.php:229 -msgid "Config domain checks" -msgstr "" - -#: admin/support.php:230 -msgid "The checks below are based on your data domain and config domain settings. To change the data domain, use the pull down menu in the upper right corner. Repeat this check for any data domain you have configured. To change the config domain, use the data domain menu and select a different config domain value." -msgstr "" - -#: admin/support.php:233 msgid "Config domain name" -msgstr "" +msgstr "配置域名称" -#: admin/support.php:235 +#: admin/support.php:231 msgid "Connection type" -msgstr "" +msgstr "连接类型" -#: admin/support.php:256 +#: admin/support.php:252 msgid "Connection check" -msgstr "" +msgstr "连接检查" -#: admin/support.php:298 -#: admin/support.php:335 -#: admin/support.php:398 -#: admin/support.php:420 +#: admin/support.php:295 admin/support.php:340 admin/support.php:418 admin/support.php:436 msgid "readonly" -msgstr "" +msgstr "只读" -#: admin/support.php:341 +#: admin/support.php:346 config/fieldvars.php:45 msgid "Nagios process file" msgstr "Nagios进程文件" -#: admin/support.php:354 -#: admin/support.php:375 -#: admin/support.php:395 -#: admin/support.php:427 -#: admin/support.php:439 -#: admin/support.php:466 +#: admin/support.php:361 admin/support.php:392 admin/support.php:415 admin/support.php:444 admin/support.php:448 +#: admin/support.php:465 admin/support.php:493 msgid "file is missed" -msgstr "" +msgstr "文件丢失" -#: admin/support.php:359 -#: admin/support.php:380 +#: admin/support.php:367 admin/support.php:397 msgid "Nagios daemon is not running" -msgstr "" +msgstr "Nagios进程没有运行" -#: admin/support.php:364 -#: admin/support.php:405 -#: admin/support.php:446 +#: admin/support.php:372 admin/support.php:425 admin/support.php:469 msgid "not used with FTP" -msgstr "" +msgstr "没有FTP用户" -#: admin/support.php:379 -#: admin/support.php:392 -#: admin/support.php:424 +#: admin/support.php:396 admin/support.php:410 admin/support.php:440 msgid "demon dead" -msgstr "" +msgstr "进程僵死" -#: admin/support.php:385 +#: admin/support.php:402 config/fieldvars.php:43 msgid "Nagios command file" msgstr "Nagios命令文件" -#: admin/support.php:432 +#: admin/support.php:452 config/fieldvars.php:44 msgid "Nagios binary file" msgstr "Nagios执行文件" # mutdialog.php -#: admin/support.php:442 -#: admin/support.php:459 +#: admin/support.php:461 admin/support.php:485 msgid "not executable" -msgstr "" +msgstr "不可执行" # config_class.php -#: admin/support.php:474 +#: admin/support.php:501 msgid "Verify configuration files and demon configuration" -msgstr "" +msgstr "验证配置文件和进程配置" -#: admin/support.php:475 +#: admin/support.php:502 msgid "Configuration name" -msgstr "" +msgstr "配置名称" # fieldvars.php -#: admin/support.php:476 +#: admin/support.php:503 msgid "Used in data domain" -msgstr "" +msgstr "使用数据域" -#: admin/support.php:477 +#: admin/support.php:504 msgid "Included in demon configuration" -msgstr "" +msgstr "包含进程配置" -#: admin/support.php:549 +#: admin/support.php:587 msgid "not used" -msgstr "" +msgstr "没有使用" -#: admin/support.php:554 +#: admin/support.php:593 msgid "cfg definition missed" -msgstr "" +msgstr "CFG定义缺失" -#: admin/support.php:564 -#: admin/support.php:572 -#: admin/support.php:578 +#: admin/support.php:611 admin/support.php:625 admin/support.php:636 msgid "cfg definition missed, but actually not used" -msgstr "" +msgstr "CFG定义缺失,但实际未使用" -#: admin/support.php:566 +#: admin/support.php:614 msgid "wrong base path:" -msgstr "" +msgstr "错误的基本路径:" -#: admin/support.php:583 +#: admin/support.php:643 msgid "cfg file not readable" -msgstr "" +msgstr "CFG文件不可读" -#: admin/support.php:606 +#: admin/support.php:676 msgid "Not used" -msgstr "" +msgstr "没有使用" -#: admin/support.php:608 +#: admin/support.php:678 msgid "unused - please delete!" -msgstr "" +msgstr "未使用-请删除!" -#: admin/templatedefinitions.php:231 +#: admin/templatedefinitions.php:260 msgid "Up" msgstr "上" -#: admin/templatedefinitions.php:231 +#: admin/templatedefinitions.php:264 msgid "Down" msgstr "下" -#: admin/timedefinitions.php:166 -#: admin/variabledefinitions.php:133 +#: admin/timedefinitions.php:176 admin/variabledefinitions.php:143 config/fieldvars.php:77 msgid "Modify" msgstr "修改" -#: admin/timeperiods.php:54 +#: admin/timeperiods.php:62 msgid "New time period inserted:" msgstr "插入新的时间段:" -#: admin/timeperiods.php:55 +#: admin/timeperiods.php:65 msgid "Time period modified:" msgstr "被修改的时间段:" -#: admin/timeperiods.php:118 -msgid "Timeperiod definitions" -msgstr "时间段定义" +#: admin/timeperiods.php:173 admin/timeperiods.php:252 +msgid "Time period definitions (timeperiods.cfg)" +msgstr "时间周期定义(timeperiods.cfg)" -#: admin/timeperiods.php:143 +#: admin/timeperiods.php:230 msgid "Please insert a time definition and a time range" msgstr "请插入一个时间定义及时间范围" # timeperiod.php -#: admin/timeperiods.php:164 +#: admin/timeperiods.php:253 config/fieldvars.php:92 msgid "Time period" msgstr "时间段" # tools.php -#: admin/tools.php:31 +#: admin/tools.php:35 msgid "Different tools" msgstr "不同的工具" -#: admin/tools.php:34 -msgid "Useful functions for data import, main configuration, daemon control and so on." -msgstr "对于导入数据,主要的配置,进程控制及其他组件有用的功能" +#: admin/tools.php:36 +msgid "Useful functions for data import, main configuration, daemon control, etc." +msgstr "数据导入、主配置、守护进程控制等功能。" -#: admin/user.php:62 -msgid "A new user added:" -msgstr "新增用户:" +#: admin/user.php:74 +msgid "New user added:" +msgstr "新增用户:" -#: admin/user.php:80 +#: admin/user.php:128 admin/user.php:176 msgid "User administration" msgstr "用户管理" -#: admin/user.php:103 -msgid "The passwords are not equal!" -msgstr "密码不一样!" +#: admin/user.php:132 +msgid "The passwords do not match!" +msgstr "密码不一样!" -#: admin/user.php:104 +#: admin/user.php:133 msgid "Please fill in the password" -msgstr "请输入密码" +msgstr "请填写密码" -#: admin/user.php:105 +#: admin/user.php:134 msgid "The password is too short - use at least 6 characters!" msgstr "密码太短 - 至少6位字符" -#: admin/user.php:106 +#: admin/user.php:135 msgid "Webserver authentification" -msgstr "Web服务器认证" +msgstr "webserver认证" -#: admin/verify.php:45 -#: admin/verify.php:145 -#: functions/config_class.php:711 -#: functions/config_class.php:712 -#: functions/config_class.php:928 +#: admin/user.php:177 config/fieldvars.php:24 index.php:51 +msgid "Username" +msgstr "用户名" + +#: admin/verify.php:50 admin/verify.php:157 functions/NagConfigClass.php:1115 functions/NagConfigClass.php:1117 +#: functions/NagConfigClass.php:1357 functions/NagConfigClass.php:1359 msgid "Writing of the configuration failed - no dataset or not activated dataset found" -msgstr "" +msgstr "配置写入失败-没有数据集或未激活的数据集" -#: admin/verify.php:57 +#: admin/verify.php:62 msgid "Write host configurations" msgstr "写入主机配置文件" -#: admin/verify.php:63 -#: admin/verify.php:83 +#: admin/verify.php:69 admin/verify.php:91 msgid "No configuration items defined!" msgstr "配置选项没有被定义!" -#: admin/verify.php:77 +#: admin/verify.php:84 msgid "Write service configurations" msgstr "写入服务配置文件" -#: admin/verify.php:94 -#: admin/verify.php:108 -#: admin/verify.php:122 -#: admin/verify.php:136 -#: admin/verify.php:190 -#: admin/verify.php:204 -#: admin/verify.php:218 -#: admin/verify.php:232 -#: admin/verify.php:246 -#: admin/verify.php:260 -#: admin/verify.php:274 +#: admin/verify.php:102 admin/verify.php:117 admin/verify.php:132 admin/verify.php:147 admin/verify.php:202 admin/verify.php:217 +#: admin/verify.php:232 admin/verify.php:247 admin/verify.php:262 admin/verify.php:277 admin/verify.php:292 msgid "No dataset or no activated dataset found - empty configuration written" -msgstr "" +msgstr "未找到数据集或未激活的数据集-空配置写入" -#: admin/verify.php:291 -msgid "Cannot find the Nagios binary or no rights for execution!" +#: admin/verify.php:311 +msgid "Cannot find the Nagios binary or no execute permissions!" msgstr "找不到Nagios执行文件或没有执行权限" -#: admin/verify.php:304 +#: admin/verify.php:326 msgid "Remote execution (FTP SITE EXEC) is not supported on your system!" msgstr "远程执行(FTP SITE EXEC)在您的系统上不支持" -#: admin/verify.php:321 +#: admin/verify.php:345 msgid "Remote execution of nagios verify command failed (remote SSH)!" msgstr "在远程执行Nagios确认命令失败(远程SSH链接)!" -#: admin/verify.php:324 +#: admin/verify.php:350 msgid "Nagios binary or configuration file not found (remote SSH)!" msgstr "没有发现Nagios二进制或配置文件(远程SSH)!" -#: admin/verify.php:355 +#: admin/verify.php:388 msgid "Nagios daemon successfully restarted" msgstr "Nagios进程成功重启" -#: admin/verify.php:356 +#: admin/verify.php:390 msgid "Restart command successfully send to Nagios" msgstr "重启命令成功发送给Nagios" -#: admin/verify.php:358 -#: admin/verify.php:363 -#: admin/verify.php:364 +#: admin/verify.php:394 admin/verify.php:402 +msgid "Restart failed - Nagios command file not found or no execute permissions" +msgstr "重启失败 - 找不到Nagios执行文件或没有执行权限" + +#: admin/verify.php:397 +msgid "Nagios command file not found or no write permissions!" +msgstr "没有发现Nagios命令文件或者没有写的权限!" + +#: admin/verify.php:404 msgid "Restart failed - Nagios command file not found or no rights to execute" msgstr "重启失败 - 找不到Nagios执行文件或没有执行权限" -#: admin/verify.php:359 -msgid "Nagios command file not found or no rights to write!" -msgstr "没有发现Nagios命令文件或没有写权限" - -#: admin/verify.php:367 +#: admin/verify.php:408 msgid "Restart failed - Nagios daemon was not running" msgstr "重启失败 - Nagios进程没有运行" -#: admin/verify.php:368 +#: admin/verify.php:410 msgid "Nagios daemon is not running, cannot send restart command!" msgstr "Nagios进程没有运行,不能发送重启命令!" -#: admin/verify.php:371 +#: admin/verify.php:415 msgid "Restart failed - FTP restrictions" msgstr "重启失败 - FTP限制" -#: admin/verify.php:372 +#: admin/verify.php:417 msgid "Nagios restart is not possible via FTP remote connection!" msgstr "不能通过远程FTP连接重启Nagios" -#: admin/verify.php:389 +#: admin/verify.php:440 msgid "Restart failed - Nagios command file not found or no rights to execute (remote SSH)!" msgstr "重启失败 - 找不到Nagios执行文件或没有执行权限(远程SSH链接)!" -#: admin/verify.php:391 +#: admin/verify.php:443 msgid "Nagios daemon successfully restarted (remote SSH)" msgstr "Nagios进程成功重启(远程SSH链接)" -#: admin/verify.php:392 +#: admin/verify.php:445 msgid "Restart command successfully send to Nagios (remote SSH)" msgstr "重启命令成功发送给Nagios(远程SSH链接)" -#: admin/verify.php:395 +#: admin/verify.php:450 msgid "Nagios command file not found (remote SSH)!" msgstr "没有发现Nagios命令文件(远程SSH链接)!" -#: admin/verify.php:403 +#: admin/verify.php:458 msgid "Check written configuration files" msgstr "检查写入的配置文件" -#: admin/verify.php:406 +#: admin/verify.php:459 msgid "Check configuration files:" msgstr "检查配置文件:" -#: admin/verify.php:407 +#: admin/verify.php:460 msgid "Restart Nagios:" msgstr "重新启动Nagios:" -#: admin/verify.php:408 +#: admin/verify.php:461 msgid "Write monitoring data" msgstr "写入检测数据" -#: admin/verify.php:409 +#: admin/verify.php:462 msgid "Write additional data" msgstr "写入其他数据" -#: admin/verify.php:410 -msgid "Warning, always check the configuration files before restart Nagios!" +#: admin/verify.php:464 +msgid "Warning, always check the configuration files before restarting Nagios!" msgstr "警告,重启Nagios前要检查配置文件!" -#: admin/verify.php:411 -#: config/fieldvars.php:54 +#: admin/verify.php:467 config/fieldvars.php:62 msgid "Do it" msgstr "执行" -#: admin/verify.php:436 -#: admin/verify.php:465 -msgid "Written Nagios configuration checked - Warnings/Errors:" +#: admin/verify.php:498 admin/verify.php:542 +msgid "Nagios written configuration files checked - Warnings/Errors:" msgstr "检查写入的Nagios配置 - 警告/错误:" # config_class.php -#: admin/verify.php:440 -#: admin/verify.php:468 +#: admin/verify.php:504 admin/verify.php:547 msgid "Written configuration files are valid, Nagios can be restarted!" msgstr "写入的配置文件可用,Nagios可以重启" -#: admin/versioncheck.php:64 -#: admin/versioncheck.php:72 -msgid "check proxy settings" +#: admin/verify.php:510 +msgid "" +"The configuration could not be tested successfully. The Nagios binary may have crashed during the test. Please repeat the test or " +"try using the commandline to test. A running Nagios service should not be restarted because the configuration may be invalid." msgstr "" +"无法成功地测试配置。NAGIOS二进制可能在测试过程中崩溃。请重复测试或尝试使用命令行进行测试。由于配置可能无效,不应重新启动运行的" +"NAGIOS服务。" -#: admin/versioncheck.php:75 +#: admin/versioncheck.php:69 admin/versioncheck.php:79 +msgid "check proxy settings" +msgstr "检查代理设置" + +#: admin/versioncheck.php:82 msgid "Installed" msgstr "已安装" -#: admin/versioncheck.php:77 -#: config/fieldvars.php:171 +#: admin/versioncheck.php:84 config/fieldvars.php:187 msgid "Information" msgstr "信息" -#: admin/versioncheck.php:91 +#: admin/versioncheck.php:106 msgid "You already have the latest version installed" msgstr "你已经安装了最新版本" -#: admin/versioncheck.php:93 +#: admin/versioncheck.php:109 msgid "You are using an old NagiosQL version. Please update to the latest stable version" msgstr "你正在使用老版本的NagiosQL。请更新到最新的稳定版。" -#: admin/versioncheck.php:96 +#: admin/versioncheck.php:114 msgid "You are using a newer development version without official support" -msgstr "" +msgstr "您正在使用没有官方支持的新开发版本。" # fieldvars.php -#: config/fieldvars.php:22 -#: functions/prepend_adm.php:446 +#: config/fieldvars.php:20 functions/prepend_adm.php:538 msgid "Domain" msgstr "域" -#: config/fieldvars.php:24 -#: config/fieldvars.php:29 +#: config/fieldvars.php:22 config/fieldvars.php:30 msgid "Server name" msgstr "服务器名" -#: config/fieldvars.php:25 +#: config/fieldvars.php:23 msgid "Method" msgstr "方法" -#: config/fieldvars.php:28 +#: config/fieldvars.php:25 index.php:52 +msgid "Password" +msgstr "密码" + +#: config/fieldvars.php:27 msgid "Directory with SSH key pair" msgstr "有SSH密钥对的目录" -#: config/fieldvars.php:30 +#: config/fieldvars.php:29 +msgid "Use encrypted FTP (FTPS)" +msgstr "使用加密的FTP(FTPS)" + +#: config/fieldvars.php:32 msgid "Configuration directories" msgstr "配置目录" -#: config/fieldvars.php:31 +#: config/fieldvars.php:34 +msgid "Nagios configuration files and directories" +msgstr "Nagios配置文件和路径" + +#: config/fieldvars.php:35 msgid "Base directory" msgstr "基目录" -#: config/fieldvars.php:32 +#: config/fieldvars.php:36 msgid "Host directory" msgstr "主机目录" -#: config/fieldvars.php:33 +#: config/fieldvars.php:37 msgid "Service directory" msgstr "服务目录" -#: config/fieldvars.php:34 +#: config/fieldvars.php:38 msgid "Backup directory" msgstr "备份目录" -#: config/fieldvars.php:35 +#: config/fieldvars.php:39 msgid "Host backup directory" msgstr "主机备份目录" -#: config/fieldvars.php:36 +#: config/fieldvars.php:41 msgid "Service backup directory" msgstr "服务备份目录" -#: config/fieldvars.php:37 +#: config/fieldvars.php:42 msgid "Picture base directory" msgstr "图片根目录" -#: config/fieldvars.php:43 +#: config/fieldvars.php:47 +msgid "Nagios cgi file" +msgstr "Nagios CGI文件" + +#: config/fieldvars.php:48 +msgid "Nagios resource file" +msgstr "Nagios资源文件" + +#: config/fieldvars.php:50 msgid "Use common domain" msgstr "使用普通域" -#: config/fieldvars.php:44 +#: config/fieldvars.php:52 msgid "Decode UTF8 data in config files" msgstr "解码配置文件中的UTF8数据" -#: config/fieldvars.php:45 +#: config/fieldvars.php:53 msgid "Access key holes" msgstr "访问须输入密码" # user.php -#: config/fieldvars.php:46 +#: config/fieldvars.php:54 msgid "Access keys" msgstr "访问密码" -#: config/fieldvars.php:48 +#: config/fieldvars.php:56 msgid "Registered" -msgstr "" +msgstr "已注册" -#: config/fieldvars.php:52 +#: config/fieldvars.php:60 msgid "Function" msgstr "功能" -#: config/fieldvars.php:53 +#: config/fieldvars.php:61 msgid "Marked" msgstr "标记" -#: config/fieldvars.php:55 +#: config/fieldvars.php:63 msgid "Add" msgstr "添加" -#: config/fieldvars.php:56 -msgid "Formcheck" +#: config/fieldvars.php:64 +msgid "Form check" msgstr "表格检查" -#: config/fieldvars.php:57 +#: config/fieldvars.php:65 msgid "Secure question" msgstr "安全问题" -#: config/fieldvars.php:58 -#: functions/content_class.php:241 -#: functions/content_class.php:242 +#: config/fieldvars.php:66 functions/NagContentClass.php:172 functions/NagContentClass.php:177 msgid "Yes" msgstr "是" -#: config/fieldvars.php:59 -#: functions/content_class.php:241 -#: functions/content_class.php:242 +#: config/fieldvars.php:67 functions/NagContentClass.php:170 functions/NagContentClass.php:175 msgid "No" msgstr "否" -#: config/fieldvars.php:60 +#: config/fieldvars.php:68 msgid "Time" msgstr "时间" -#: config/fieldvars.php:61 +#: config/fieldvars.php:69 msgid "User" msgstr "用户" -#: config/fieldvars.php:62 -msgid "IP" -msgstr "IP" +#: config/fieldvars.php:70 +msgid "IP Address" +msgstr "IP地址" -#: config/fieldvars.php:63 -#: functions/import_class.php:318 -#: functions/import_class.php:323 -#: functions/import_class.php:635 -#: functions/import_class.php:636 -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: config/fieldvars.php:71 functions/NagImportClass.php:350 functions/NagImportClass.php:355 functions/NagImportClass.php:419 +#: functions/NagImportClass.php:425 functions/NagImportClass.php:432 functions/NagImportClass.php:437 msgid "Entry" msgstr "入口" -#: config/fieldvars.php:64 +#: config/fieldvars.php:72 msgid "From" msgstr "发件人" -#: config/fieldvars.php:65 +#: config/fieldvars.php:73 msgid "To" msgstr "收件人" -#: config/fieldvars.php:66 +#: config/fieldvars.php:74 msgid "Delete log entries" msgstr "删除日志条目" -#: config/fieldvars.php:67 -#: config/fieldvars.php:80 -#: config/fieldvars.php:168 +#: config/fieldvars.php:75 config/fieldvars.php:88 config/fieldvars.php:184 msgid "Copy" msgstr "复制" -#: config/fieldvars.php:70 +#: config/fieldvars.php:78 msgid "Confirm password" msgstr "确认密码" # password.php -#: config/fieldvars.php:71 +#: config/fieldvars.php:79 msgid "Old password" msgstr "旧密码" -#: config/fieldvars.php:72 -#: config/fieldvars.php:281 +#: config/fieldvars.php:80 config/fieldvars.php:320 msgid "New password" msgstr "新密码" -#: config/fieldvars.php:73 +#: config/fieldvars.php:81 msgid "Change password" msgstr "修改密码" -#: config/fieldvars.php:74 +#: config/fieldvars.php:82 msgid "Menu page" msgstr "菜单页" -#: config/fieldvars.php:75 +#: config/fieldvars.php:83 msgid "Search string" msgstr "搜索字符串" -#: config/fieldvars.php:78 -#: config/fieldvars.php:172 +#: config/fieldvars.php:86 config/fieldvars.php:188 msgid "Write config file" msgstr "写入配置文件" -#: config/fieldvars.php:81 +#: config/fieldvars.php:89 msgid "Command" msgstr "命令" -#: config/fieldvars.php:83 +#: config/fieldvars.php:91 msgid "Command type" msgstr "命令类型" -#: config/fieldvars.php:85 +#: config/fieldvars.php:93 msgid "Exclude" msgstr "排除" -#: config/fieldvars.php:86 +#: config/fieldvars.php:94 msgid "Include" msgstr "包含" -#: config/fieldvars.php:87 +#: config/fieldvars.php:95 msgid "Time definitions" msgstr "时间定义" -#: config/fieldvars.php:88 +#: config/fieldvars.php:96 msgid "Weekday" msgstr "平日" -#: config/fieldvars.php:89 +#: config/fieldvars.php:97 msgid "Time range" msgstr "时间范围" -#: config/fieldvars.php:90 +#: config/fieldvars.php:98 msgid "Time definition" msgstr "时间定义" -#: config/fieldvars.php:91 +#: config/fieldvars.php:99 msgid "Insert" msgstr "插入" -#: config/fieldvars.php:92 +#: config/fieldvars.php:100 msgid "Modify selection" msgstr "修改被选项" -#: config/fieldvars.php:95 +#: config/fieldvars.php:103 +msgid "Minimum importance" +msgstr "最小重要性" + +#: config/fieldvars.php:104 msgid "Time period hosts" msgstr "时间段主机" -#: config/fieldvars.php:96 +#: config/fieldvars.php:105 msgid "Time period services" msgstr "时间段服务" -#: config/fieldvars.php:97 +#: config/fieldvars.php:106 msgid "Host options" msgstr "主机选项" -#: config/fieldvars.php:98 +#: config/fieldvars.php:107 msgid "Service options" msgstr "服务选项" -#: config/fieldvars.php:99 +#: config/fieldvars.php:108 msgid "Host command" msgstr "主机命令" -#: config/fieldvars.php:100 +#: config/fieldvars.php:109 msgid "Service command" msgstr "服务命令" -#: config/fieldvars.php:101 +#: config/fieldvars.php:110 msgid "EMail address" msgstr "电子邮件地址" -#: config/fieldvars.php:102 +#: config/fieldvars.php:111 msgid "Pager number" msgstr "页码" -#: config/fieldvars.php:103 +#: config/fieldvars.php:112 msgid "Addon address" msgstr "附加地址" -#: config/fieldvars.php:104 +#: config/fieldvars.php:113 msgid "Host notif. enable" msgstr "启用主机提醒" -#: config/fieldvars.php:105 +#: config/fieldvars.php:114 msgid "Service notif. enable" msgstr "启用服务提醒" -#: config/fieldvars.php:106 +#: config/fieldvars.php:115 msgid "Can submit commands" msgstr "能提交命令" -#: config/fieldvars.php:107 +#: config/fieldvars.php:116 msgid "Retain status info" msgstr "保留状态信息" -#: config/fieldvars.php:108 -msgid "Retain nonstatus info" +#: config/fieldvars.php:117 +msgid "Retain non-status info" msgstr "保留非状态信息" # contactgroups.php -#: config/fieldvars.php:109 +#: config/fieldvars.php:118 msgid "Members" msgstr "成员" -#: config/fieldvars.php:110 +#: config/fieldvars.php:119 msgid "Group members" msgstr "组成员" -#: config/fieldvars.php:111 +#: config/fieldvars.php:120 msgid "Common settings" msgstr "普通设置" -#: config/fieldvars.php:112 +#: config/fieldvars.php:121 msgid "Service settings" msgstr "服务选项" -#: config/fieldvars.php:113 +#: config/fieldvars.php:123 msgid "Add this host configuration to existing service definitions" msgstr "将此主机配置加入到现有服务定义中" -#: config/fieldvars.php:115 +#: config/fieldvars.php:125 msgid "Parents" msgstr "父" -#: config/fieldvars.php:117 +#: config/fieldvars.php:126 +msgid "Parent services" +msgstr "父服务" + +#: config/fieldvars.php:128 msgid "Check command" msgstr "检查命令" -#: config/fieldvars.php:118 +#: config/fieldvars.php:129 msgid "Command view" msgstr "命令视图" -#: config/fieldvars.php:119 +#: config/fieldvars.php:130 msgid "Additional templates" msgstr "其他模板" -#: config/fieldvars.php:120 +#: config/fieldvars.php:131 msgid "Check settings" msgstr "检查设置" -#: config/fieldvars.php:121 +#: config/fieldvars.php:132 msgid "Initial state" msgstr "初始状态" -#: config/fieldvars.php:122 +#: config/fieldvars.php:133 msgid "Retry interval" msgstr "重试间隔" -#: config/fieldvars.php:123 +#: config/fieldvars.php:134 msgid "Max check attempts" msgstr "最大重试次数" -#: config/fieldvars.php:124 +#: config/fieldvars.php:135 msgid "Check interval" msgstr "检查间隔" -#: config/fieldvars.php:125 +#: config/fieldvars.php:136 msgid "Active checks enabled" msgstr "启用的主动检查" -#: config/fieldvars.php:126 +#: config/fieldvars.php:137 msgid "Passive checks enabled" msgstr "启用的被动检查" -#: config/fieldvars.php:127 +#: config/fieldvars.php:138 msgid "Check period" msgstr "检查时段" -#: config/fieldvars.php:128 +#: config/fieldvars.php:139 msgid "Freshness treshold" msgstr "刷新阈值" -#: config/fieldvars.php:129 +#: config/fieldvars.php:140 msgid "Check freshness" msgstr "检查新数据" -#: config/fieldvars.php:130 +#: config/fieldvars.php:141 msgid "Obsess over host" msgstr "关注主机" -#: config/fieldvars.php:131 +#: config/fieldvars.php:142 msgid "Obsess over service" msgstr "关注服务" -#: config/fieldvars.php:132 +#: config/fieldvars.php:143 msgid "Event handler" msgstr "事件处理方法" -#: config/fieldvars.php:133 +#: config/fieldvars.php:144 msgid "Event handler enabled" msgstr "启用时间处理方法" -#: config/fieldvars.php:134 +#: config/fieldvars.php:145 msgid "Low flap threshold" msgstr "通过阈值下限" -#: config/fieldvars.php:135 +#: config/fieldvars.php:146 msgid "High flap threshold" msgstr "通过阈值上限" -#: config/fieldvars.php:136 +#: config/fieldvars.php:147 msgid "Flap detection enabled" msgstr "启用通过检测" -#: config/fieldvars.php:137 +#: config/fieldvars.php:148 msgid "Flap detection options" msgstr "通过检测选项" -#: config/fieldvars.php:138 +#: config/fieldvars.php:150 msgid "Retain status information" msgstr "保留状态信息" -#: config/fieldvars.php:139 -msgid "Retain nostatus information" +#: config/fieldvars.php:152 +msgid "Retain non-status information" msgstr "保留非状态信息" -#: config/fieldvars.php:140 +#: config/fieldvars.php:153 msgid "Process perf data" msgstr "进程性能信息" -#: config/fieldvars.php:141 +#: config/fieldvars.php:154 msgid "Alarm settings" msgstr "报警设置" -#: config/fieldvars.php:142 +#: config/fieldvars.php:155 msgid "Contacts" msgstr "联系人" -#: config/fieldvars.php:144 +#: config/fieldvars.php:157 msgid "Notification period" msgstr "通知时段" -#: config/fieldvars.php:145 +#: config/fieldvars.php:158 msgid "Notification options" msgstr "通知选项" -#: config/fieldvars.php:146 +#: config/fieldvars.php:159 msgid "Notification interval" msgstr "通知时长" -#: config/fieldvars.php:147 +#: config/fieldvars.php:161 msgid "First notification delay" msgstr "第一次通知延时" -#: config/fieldvars.php:148 +#: config/fieldvars.php:162 msgid "Notification enabled" msgstr "启用通知" -#: config/fieldvars.php:149 +#: config/fieldvars.php:163 +msgid "Importance" +msgstr "重要性" + +#: config/fieldvars.php:164 msgid "Stalking options" msgstr "纠缠选项" -#: config/fieldvars.php:150 +#: config/fieldvars.php:165 msgid "Addon settings" msgstr "附加设置" -#: config/fieldvars.php:152 +#: config/fieldvars.php:167 msgid "VRML image" msgstr "VRML图片" -#: config/fieldvars.php:153 +#: config/fieldvars.php:168 msgid "Notes URL" msgstr "注释URL" -#: config/fieldvars.php:154 +#: config/fieldvars.php:169 msgid "Status image" msgstr "状态图片" -#: config/fieldvars.php:155 +#: config/fieldvars.php:170 msgid "Icon image" msgstr "图标图片" -#: config/fieldvars.php:156 +#: config/fieldvars.php:171 msgid "Action URL" msgstr "行动URL" -#: config/fieldvars.php:157 +#: config/fieldvars.php:172 msgid "2D coords" msgstr "2D坐标" -#: config/fieldvars.php:158 +#: config/fieldvars.php:173 msgid "3D coords" msgstr "3D坐标" -#: config/fieldvars.php:159 +#: config/fieldvars.php:174 msgid "Icon image ALT text" msgstr "图片替换文字" -#: config/fieldvars.php:160 +#: config/fieldvars.php:175 msgid "standard" msgstr "标准" -#: config/fieldvars.php:161 +#: config/fieldvars.php:176 msgid "on" msgstr "开" -#: config/fieldvars.php:162 +#: config/fieldvars.php:177 msgid "off" msgstr "关" -#: config/fieldvars.php:163 +#: config/fieldvars.php:178 msgid "skip" msgstr "忽略" -#: config/fieldvars.php:164 +#: config/fieldvars.php:180 msgid "Free variable definitions" msgstr "自由变量定义" -#: config/fieldvars.php:165 +#: config/fieldvars.php:181 msgid "Variable name" msgstr "变量名" -#: config/fieldvars.php:166 +#: config/fieldvars.php:182 msgid "Variable value" msgstr "变量值" -#: config/fieldvars.php:169 +#: config/fieldvars.php:185 msgid "Activate" msgstr "激活" -#: config/fieldvars.php:170 +#: config/fieldvars.php:186 msgid "Deactivate" msgstr "停用" -#: config/fieldvars.php:173 +#: config/fieldvars.php:190 msgid "Do you really want to delete this database entry:" msgstr "你真想删除此数据库条目:" -#: config/fieldvars.php:174 +#: config/fieldvars.php:192 msgid "Do you really want to delete all marked entries?" msgstr "你真想删除所有被标记的条目?" -#: config/fieldvars.php:175 +#: config/fieldvars.php:194 msgid "Mark all shown datasets" msgstr "标记所有被显示数据集" -#: config/fieldvars.php:176 +#: config/fieldvars.php:195 msgid "File" msgstr "文件" -#: config/fieldvars.php:177 +#: config/fieldvars.php:196 msgid "Write all config files" msgstr "写入所有配置文件" -#: config/fieldvars.php:178 +#: config/fieldvars.php:197 msgid "Address" msgstr "地址" -#: config/fieldvars.php:179 +#: config/fieldvars.php:198 msgid "Display name" msgstr "显示名" -#: config/fieldvars.php:180 -msgid "Use this configuration as template" +#: config/fieldvars.php:200 +msgid "Use this configuration as a template" msgstr "使用此配置作为模板" -#: config/fieldvars.php:181 +#: config/fieldvars.php:201 msgid "Generic name" msgstr "通用名" -#: config/fieldvars.php:185 +#: config/fieldvars.php:208 msgid "Please check at least one option from:" msgstr "请至少从一个选项检查:" -#: config/fieldvars.php:186 +#: config/fieldvars.php:209 msgid "Host group name" msgstr "主机组名" -#: config/fieldvars.php:187 +#: config/fieldvars.php:210 msgid "Host group members" msgstr "主机组成员" -#: config/fieldvars.php:191 +#: config/fieldvars.php:214 msgid "Is volatile" msgstr "是暂时的" -#: config/fieldvars.php:192 +#: config/fieldvars.php:215 msgid "Parallelize checks" msgstr "并行检查" -#: config/fieldvars.php:193 +#: config/fieldvars.php:216 msgid "Config name filter" msgstr "配置名过滤器" -#: config/fieldvars.php:195 +#: config/fieldvars.php:218 msgid "Import directory" msgstr "导入路径" -#: config/fieldvars.php:196 +#: config/fieldvars.php:220 msgid "Please insert a variable name and a variable definition" msgstr "请插入一个变量名以及一个变量值" -#: config/fieldvars.php:197 -#: config/fieldvars.php:201 -#: config/fieldvars.php:233 +#: config/fieldvars.php:222 config/fieldvars.php:229 config/fieldvars.php:269 msgid "Warning:" msgstr "警告:" -#: config/fieldvars.php:197 -msgid "You have not filled in some required fields!

If this values are set by a template, you can save anyway - otherwise you will get an invalid configuration!" +#: config/fieldvars.php:222 +msgid "" +"You have not filled in some required fields!

If this values are set by a template, you can save anyway - otherwise you will " +"get an invalid configuration!" msgstr "你没有填写一些必须的域!

如果这些值由模板设置,你可以保存 - 否则你的配置无效" -#: config/fieldvars.php:199 -msgid "Nagios base directory" -msgstr "Nagios基目录" - -#: config/fieldvars.php:200 +#: config/fieldvars.php:227 msgid "Write config" msgstr "写入配置" -#: config/fieldvars.php:201 -msgid "You have not filled in all command arguments (ARGx) for your selected command!

If this arguments are optional, you can save anyway - otherwise you will get an invalid configuration!" +#: config/fieldvars.php:229 +msgid "" +"You have not filled in all command arguments (ARGx) for your selected command!

If this arguments are optional, you can save " +"anyway - otherwise you will get an invalid configuration!" msgstr "对选定的命令您没有填写一些必须的参数!

如果这些值是可选的,你可以保存 - 否则你的配置无效!" -#: config/fieldvars.php:202 +#: config/fieldvars.php:232 msgid "Service group members" msgstr "服务组成员" -#: config/fieldvars.php:203 +#: config/fieldvars.php:233 msgid "Service group name" msgstr "服务组名" -#: config/fieldvars.php:206 +#: config/fieldvars.php:236 msgid "Hostgroups" msgstr "主机组" -#: config/fieldvars.php:207 +#: config/fieldvars.php:237 msgid "Inherit parents" msgstr "继承的父类" -#: config/fieldvars.php:208 +#: config/fieldvars.php:239 msgid "Execution failure criteria" msgstr "执行失败标准" -#: config/fieldvars.php:209 +#: config/fieldvars.php:241 msgid "Nofification failure criteria" msgstr "通知失败标准" -#: config/fieldvars.php:210 +#: config/fieldvars.php:242 msgid "Dependency period" msgstr "依赖时段" -#: config/fieldvars.php:211 +#: config/fieldvars.php:243 msgid "Escalation period" msgstr "升级时段" -#: config/fieldvars.php:212 +#: config/fieldvars.php:244 msgid "Escalation options" msgstr "升级选项" -#: config/fieldvars.php:213 +#: config/fieldvars.php:245 msgid "First notification" msgstr "第一次通知" -#: config/fieldvars.php:214 +#: config/fieldvars.php:246 msgid "Last notification" msgstr "最后一次通知" -#: config/fieldvars.php:217 +#: config/fieldvars.php:250 msgid "Dependent servicegroups" -msgstr "" +msgstr "依赖的服务组" -#: config/fieldvars.php:218 +#: config/fieldvars.php:251 msgid "Help" msgstr "帮助" -#: config/fieldvars.php:219 +#: config/fieldvars.php:252 msgid "Calendar" msgstr "日历" -#: config/fieldvars.php:220 +#: config/fieldvars.php:253 msgid "Group name" msgstr "组名" -#: config/fieldvars.php:221 +#: config/fieldvars.php:254 msgid "Users" msgstr "用户" -#: config/fieldvars.php:222 +#: config/fieldvars.php:255 msgid "Access group" msgstr "访问组" -#: config/fieldvars.php:223 +#: config/fieldvars.php:256 msgid "User definitions" msgstr "用户定义" -#: config/fieldvars.php:224 +#: config/fieldvars.php:257 msgid "User name" msgstr "用户名" -#: config/fieldvars.php:225 +#: config/fieldvars.php:258 msgid "User rights" msgstr "用户权限" -#: config/fieldvars.php:226 +#: config/fieldvars.php:260 msgid "Object access restrictions" msgstr "对象访问限制" -#: config/fieldvars.php:227 +#: config/fieldvars.php:262 msgid "Enable group administration" msgstr "启用组管理" -#: config/fieldvars.php:228 +#: config/fieldvars.php:263 msgid "Show relation data" msgstr "显示相关数据" -#: config/fieldvars.php:229 +#: config/fieldvars.php:264 msgid "Hide relation data" msgstr "隐藏相关数据" -#: config/fieldvars.php:231 +#: config/fieldvars.php:266 msgid "User language" -msgstr "" +msgstr "用户语言" -#: config/fieldvars.php:232 +#: config/fieldvars.php:267 msgid "Standard domain" -msgstr "" +msgstr "标准域" -#: config/fieldvars.php:233 -msgid "The associated services must be additionally written to the files. Only writing the host configuration is not sufficient because the modification is stored inside the service files!" -msgstr "" +#: config/fieldvars.php:269 +msgid "" +"The associated services must be additionally written to the files. Only writing the host configuration is not sufficient because " +"the modification is stored inside the service files!" +msgstr "相关的服务必须另外写入文件。只写主机配置是不够的,因为修改是存储在服务文件中的!" -#: config/fieldvars.php:235 +#: config/fieldvars.php:273 msgid "Monday" msgstr "星期一" -#: config/fieldvars.php:236 +#: config/fieldvars.php:274 msgid "Tuesday" msgstr "星期二" -#: config/fieldvars.php:237 +#: config/fieldvars.php:275 msgid "Wednesday" msgstr "星期三" -#: config/fieldvars.php:238 +#: config/fieldvars.php:276 msgid "Thursday" msgstr "星期四" -#: config/fieldvars.php:239 +#: config/fieldvars.php:277 msgid "Friday" msgstr "星期五" -#: config/fieldvars.php:240 +#: config/fieldvars.php:278 msgid "Saturday" msgstr "星期六" -#: config/fieldvars.php:241 +#: config/fieldvars.php:279 msgid "Sunday" msgstr "星期日" -#: config/fieldvars.php:252 +#: config/fieldvars.php:291 msgid "Main page" msgstr "主页" -#: config/fieldvars.php:253 +#: config/fieldvars.php:292 msgid "Supervision" msgstr "监督" -#: config/fieldvars.php:256 +#: config/fieldvars.php:295 msgid "Commands" msgstr "命令" -#: config/fieldvars.php:257 +#: config/fieldvars.php:296 msgid "Specialties" msgstr "特征" -#: config/fieldvars.php:258 +#: config/fieldvars.php:297 msgid "Tools" msgstr "工具" -#: config/fieldvars.php:269 +#: config/fieldvars.php:308 msgid "Service dependency" msgstr "服务依赖" -#: config/fieldvars.php:270 +#: config/fieldvars.php:309 msgid "Service escalation" msgstr "服务升级" -#: config/fieldvars.php:271 +#: config/fieldvars.php:310 msgid "Host dependency" msgstr "主机依赖项" -#: config/fieldvars.php:272 +#: config/fieldvars.php:311 msgid "Host escalation" msgstr "主机升级" -#: config/fieldvars.php:273 +#: config/fieldvars.php:312 msgid "Extended Host" msgstr "扩展主机" -#: config/fieldvars.php:274 +#: config/fieldvars.php:313 msgid "Extended Service" msgstr "扩展服务" -#: config/fieldvars.php:275 +#: config/fieldvars.php:314 msgid "Data import" msgstr "导入数据" -#: config/fieldvars.php:278 +#: config/fieldvars.php:317 msgid "User admin" msgstr "用户管理" -#: config/fieldvars.php:279 +#: config/fieldvars.php:318 msgid "Group admin" msgstr "组管理" -#: config/fieldvars.php:280 +#: config/fieldvars.php:319 msgid "Nagios control" msgstr "Nagios控制" -#: config/fieldvars.php:282 +#: config/fieldvars.php:321 msgid "Logbook" msgstr "日志簿" -#: config/fieldvars.php:283 +#: config/fieldvars.php:322 msgid "Nagios config" msgstr "Nagios配置" -#: config/fieldvars.php:284 +#: config/fieldvars.php:323 msgid "Settings" msgstr "设置" -#: config/fieldvars.php:285 +#: config/fieldvars.php:324 msgid "Definitions" msgstr "定义" -#: config/fieldvars.php:286 +#: config/fieldvars.php:325 msgid "CGI config" msgstr "CGI配置" -#: config/fieldvars.php:287 +#: config/fieldvars.php:326 msgid "Menu access" msgstr "访问菜单" -#: config/fieldvars.php:288 +#: config/fieldvars.php:327 msgid "Domains" msgstr "域" -#: config/fieldvars.php:292 +#: config/fieldvars.php:331 msgid "Help editor" msgstr "帮助编辑器" # fieldvars.php -#: config/fieldvars.php:293 +#: config/fieldvars.php:332 msgid "Data domains" -msgstr "" +msgstr "数据域" -#: config/fieldvars.php:294 +#: config/fieldvars.php:333 msgid "Config targets" -msgstr "" +msgstr "配置目标" -#: config/fieldvars.php:295 +#: config/fieldvars.php:334 msgid "Support" -msgstr "" +msgstr "支持" -# config_class.php -#: functions/config_class.php:164 -#: functions/config_class.php:168 -msgid "Warning: configuration file is out of date!" -msgstr "警告:配置文件已过期" +#: functions/MysqliDbClass.php:291 +msgid "Missing server connection parameter!" +msgstr "不存在服务器连接参数" -#: functions/config_class.php:173 -#: functions/config_class.php:729 -msgid "Warning: no configuration target defined!" -msgstr "" +#: functions/MysqliDbClass.php:310 +msgid "Connection to the database server has failed by reason:" +msgstr "连接到数据库失败,原因如下:" -#: functions/config_class.php:340 -msgid "Cannot backup and delete the old configuration file (check the permissions)!" -msgstr "不能备份或者删除旧配置文件(检查权限)!" +#: functions/MysqliDbClass.php:338 +msgid "Missing database connection parameter!" +msgstr "不存在数据库连接参数" -#: functions/config_class.php:358 -msgid "Cannot backup the old configuration file because the permissions are wrong (remote FTP)!" -msgstr "不能备份旧配置文件,权限错误(远程FTP)" +#: functions/MysqliDbClass.php:347 +msgid "Connection to the database has failed by reason:" +msgstr "连接到数据库失败,原因如下:" -#: functions/config_class.php:380 -msgid "Cannot backup the old configuration file because the permissions are wrong (remote SFTP)!" -msgstr "不能备份旧配置文件,权限错误(远程SFTP)" - -#: functions/config_class.php:411 -msgid "Cannot delete the file (wrong permissions)!" -msgstr "" - -#: functions/config_class.php:415 -msgid "Cannot delete the file (file does not exist)!" -msgstr "" - -#: functions/config_class.php:432 -msgid "Cannot delete file because the permissions are wrong (remote FTP)!" -msgstr "由于权限错误不能备份配置文件(远程FTP)!" - -#: functions/config_class.php:438 -msgid "Cannot delete file because it does not exists (remote FTP)!" -msgstr "由于文件不存在不能删除配置文件(远程FTP)!" - -#: functions/config_class.php:451 -msgid "Cannot delete file because the permissions are wrong (remote SFTP)!" -msgstr "由于权限错误不能删除文件(远程SFTP)!" - -#: functions/config_class.php:454 -msgid "Cannot delete file because it does not exists (remote SFTP)!" -msgstr "由于文件不存在不能删除文件(远程SFTP)!" - -#: functions/config_class.php:488 -msgid "Cannot get the configuration file (FTP connection failed)!" -msgstr "不能获取配置文件(FTP连接失败)!" - -#: functions/config_class.php:499 -msgid "Cannot write the configuration file (FTP connection failed)!" -msgstr "不能写入配置文件(FTP连接失败)!" - -#: functions/config_class.php:518 -msgid "Cannot get the configuration file (SSH connection failed)!" -msgstr "不能获取配置文件(SSH连接失败)!" - -#: functions/config_class.php:524 -msgid "Cannot get the configuration file (remote file does not exist)!" -msgstr "不能获取配置文件(远程文件不存在)!" - -#: functions/config_class.php:533 -msgid "Cannot write the configuration file (SSH connection failed)!" -msgstr "不能写入配置文件(SSH连接失败)!" - -#: functions/config_class.php:563 -#: functions/config_class.php:761 -msgid "It is not possible to write config files directly from the common domain!" -msgstr "不能从普通域直接写入配置文件。" - -#: functions/config_class.php:929 -msgid "Writing of the configuration failed - no dataset, not activated dataset found or you do not have write permission." -msgstr "" - -#: functions/config_class.php:1046 -msgid "Configuration write failed (FTP connection failed):" -msgstr "配置写入失败(FTP连接失败):" - -#: functions/config_class.php:1047 -#: functions/config_class.php:1111 -msgid "Cannot open/overwrite the configuration file (FTP connection failed)!" -msgstr "不能打开/覆盖配置文件(FTP连接失败)!" - -#: functions/config_class.php:1133 -msgid "Cannot open/overwrite the configuration file (remote SFTP)!" -msgstr "不能打开/覆盖配置文件(远程SFTP)!" - -#: functions/config_class.php:1608 -#: functions/config_class.php:1609 -#: functions/config_class.php:1652 -#: functions/config_class.php:1653 -msgid "Connection to remote system failed (SSH2 connection):" -msgstr "链接远程系统失败(SSH2链接):" - -#: functions/config_class.php:1624 -#: functions/config_class.php:1625 -msgid "SSH public key does not exist or is not readable" -msgstr "SSH公钥不存在或不可读。" - -#: functions/config_class.php:1629 -#: functions/config_class.php:1630 -msgid "SSH private key does not exist or is not readable" -msgstr "SSH私钥不存在或不可读" - -#: functions/config_class.php:1733 -#: functions/config_class.php:1734 +#: functions/NagConfigClass.php:336 functions/NagConfigClass.php:338 msgid "Connection to remote system failed (FTP connection):" msgstr "链接远程系统失败(FTP连接):" +#: functions/NagConfigClass.php:387 functions/NagConfigClass.php:389 +msgid "SSH public key does not exist or is not readable" +msgstr "SSH公钥不存在或不可读。" + +#: functions/NagConfigClass.php:394 functions/NagConfigClass.php:396 +msgid "SSH private key does not exist or is not readable" +msgstr "SSH私钥不存在或不可读" + +#: functions/NagConfigClass.php:430 functions/NagConfigClass.php:432 functions/NagConfigClass.php:441 +#: functions/NagConfigClass.php:443 +msgid "Connection to remote system failed (SSH2 connection):" +msgstr "链接远程系统失败(SSH2链接):" + +#: functions/NagConfigClass.php:600 +msgid "Cannot backup the old file because the permissions are wrong - destination file: " +msgstr "无法备份旧文件,因为权限是错误的-目标文件:" + +#: functions/NagConfigClass.php:605 +msgid "Cannot backup the old file because the source file is missing - source file: " +msgstr "无法备份旧文件,因为源文件丢失-源文件:" + +#: functions/NagConfigClass.php:623 +msgid "Cannot backup the old file because the source file is missing (remote FTP) - source file: " +msgstr "无法备份旧文件,因为源文件丢失(远程FTP)-源文件:" + +#: functions/NagConfigClass.php:629 +msgid "Cannot backup the old file because the permissions are wrong (remote FTP) - destination file: " +msgstr "无法备份旧文件,因为权限是错误的(远程FTP)-目标文件:" + +#: functions/NagConfigClass.php:648 +msgid "Cannot backup the old file because the source file is missing (remote SFTP) - source file: " +msgstr "无法备份旧文件,因为源文件丢失(远程SFTP)-源文件:" + +#: functions/NagConfigClass.php:654 +msgid "Cannot backup the old file because the permissions are wrong (remote SFTP) - destination file: " +msgstr "无法备份旧文件,因为权限是错误的(远程SFTP)-目标文件:" + +#: functions/NagConfigClass.php:685 +msgid "Cannot delete the file (wrong permissions)!" +msgstr "无法删除文件(错误权限)!" + +#: functions/NagConfigClass.php:690 +msgid "Cannot delete the file (file does not exist)!" +msgstr "无法删除文件(文件不存在)!" + +#: functions/NagConfigClass.php:706 +msgid "Cannot delete file because it does not exists (remote FTP)!" +msgstr "由于文件不存在不能删除配置文件(远程FTP)!" + +#: functions/NagConfigClass.php:712 +msgid "Cannot delete file because the permissions are incorrect (remote FTP)!" +msgstr "无法删除文件,因为权限不正确(远程FTP)!" + +#: functions/NagConfigClass.php:724 +msgid "Cannot delete file because it does not exists (remote SSH/SFTP)!" +msgstr "无法删除文件,因为它不存在(远程SSH/SFTP)!" + +#: functions/NagConfigClass.php:730 +msgid "Cannot delete file because the permissions are incorrect (remote SSH/SFTP)!" +msgstr "无法删除文件,因为权限不正确(远程SSH/SFTP)!" + +#: functions/NagConfigClass.php:822 functions/NagConfigClass.php:846 +msgid "Cannot get the remote file (it does not exist or is not readable) - remote file: " +msgstr "无法获取远程文件(它不存在或不可读)-远程文件:" + +#: functions/NagConfigClass.php:831 +msgid "Cannot write the remote file (remote file is not writeable)- remote file: " +msgstr "无法写入远程文件(远程文件不可写入)-远程文件:" + +#: functions/NagConfigClass.php:849 +msgid "Remote file is not readable - remote file: " +msgstr "远程文件不可读-远程文件:" + +#: functions/NagConfigClass.php:860 +msgid "Cannot write a remote file (remote file is not writeable) - remote file: " +msgstr "无法写入远程文件(远程文件不可写入)-远程文件:" + +#: functions/NagConfigClass.php:866 +msgid "Cannot copy a local file to remote because the local file does not exist or is not readable - local file: " +msgstr "无法将本地文件复制到远程文件,因为本地文件不存在或不可读-本地文件:" + # contacts.php -#: functions/config_class.php:1867 +#: functions/NagConfigClass.php:894 msgid "Could not open directory" msgstr "不能打开目录" -#: functions/content_class.php:274 -#: functions/content_class.php:278 +# config_class.php +#: functions/NagConfigClass.php:1003 functions/NagConfigClass.php:1006 +msgid "Warning: configuration file is out of date!" +msgstr "警告:配置文件已过期" + +#: functions/NagConfigClass.php:1010 functions/NagConfigClass.php:1042 functions/NagConfigClass.php:1108 +msgid "Warning: no configuration target defined!" +msgstr "警告:没有定义配置目标!" + +#: functions/NagConfigClass.php:1030 functions/NagConfigClass.php:1076 +msgid "It is not possible to write config files directly from the common domain!" +msgstr "不能从普通域直接写入配置文件。" + +#: functions/NagConfigClass.php:2069 +msgid "Cannot open/overwrite the configuration file (FTP connection failed)!" +msgstr "无法打开/覆盖配置文件(FTP连接失败)!" + +#: functions/NagConfigClass.php:2091 +msgid "Cannot open/overwrite the configuration file (remote SFTP)!" +msgstr "不能打开/覆盖配置文件(远程SFTP)!" + +#: functions/NagContentClass.php:251 msgid "out-of-date" msgstr "过期" -#: functions/content_class.php:275 +#: functions/NagContentClass.php:253 msgid "no target" -msgstr "" +msgstr "没有目标" -#: functions/content_class.php:276 -#: functions/content_class.php:277 +#: functions/NagContentClass.php:256 functions/NagContentClass.php:259 msgid "missed" msgstr "丢失" -#: functions/content_class.php:279 +#: functions/NagContentClass.php:262 install/functions/NagInstallClass.php:479 msgid "up-to-date" msgstr "最新" -#: functions/content_class.php:351 +#: functions/NagContentClass.php:355 msgid "Last database update:" msgstr "最后一次数据库升级:" -#: functions/content_class.php:354 +#: functions/NagContentClass.php:359 msgid "Last file change of the configuration target " -msgstr "" +msgstr "配置目标的最后文件更改" -# data_class.php -#: functions/data_class.php:116 -#: functions/data_class.php:140 -msgid "Delete failed because a database error:" -msgstr "由于数据库错误删除失败:" - -#: functions/data_class.php:119 -#: functions/data_class.php:149 -#: functions/data_class.php:158 -msgid "No data deleted. Probably the dataset does not exist or it is protected from delete." -msgstr "没有数据被删除。可能由于数据集不存在或者它是受保护对象不能删除。" - -#: functions/data_class.php:123 -msgid "Delete dataset id:" -msgstr "删除数据集ID:" - -#: functions/data_class.php:123 -msgid "- from table:" -msgstr "- 从表中:" - -#: functions/data_class.php:123 -#: functions/data_class.php:153 -#: functions/data_class.php:311 -#: functions/data_class.php:638 -#: functions/data_class.php:703 -msgid "- with affected rows:" -msgstr "- 受影响行:" - -#: functions/data_class.php:153 -#: functions/data_class.php:311 -msgid "Delete data from table:" -msgstr "从表中删除数据:" - -#: functions/data_class.php:306 -msgid "No data deleted. Probably the dataset does not exist, it is protected from deletion, you do not have write permission or it has relations to other configurations which cannot be deleted. Use the \"info\" function for detailed informations about relations!" -msgstr "" - -#: functions/data_class.php:316 -msgid "No data deleted. Probably the dataset does not exist, it is protected from deletion or you do not have write permission." -msgstr "" - -#: functions/data_class.php:553 -#: functions/data_class.php:554 +#: functions/NagDataClass.php:267 functions/NagDataClass.php:269 msgid "Data set copy failed - table [new name]:" msgstr "数据集复制失败 - 表[新名]:" -#: functions/data_class.php:557 -#: functions/data_class.php:558 +#: functions/NagDataClass.php:273 functions/NagDataClass.php:275 msgid "Data set copied - table [new name]:" msgstr "数据集复制成功 - 表[新名]:" -#: functions/data_class.php:576 -#: functions/data_class.php:580 +#: functions/NagDataClass.php:295 functions/NagDataClass.php:300 msgid "No dataset copied. Maybe the dataset does not exist or you do not have write permission." +msgstr "没有复制数据集。可能数据集不存在,或者您没有写入权限。" + +# data_class.php +#: functions/NagDataClass.php:393 functions/NagDataClass.php:422 +msgid "Delete failed because a database error:" +msgstr "由于数据库错误删除失败:" + +#: functions/NagDataClass.php:397 +msgid "No data deleted. The dataset probably does not exist or is protected from deletion." +msgstr "没有删除数据。数据集可能不存在或受保护而不被删除。" + +#: functions/NagDataClass.php:403 +msgid "Delete dataset id:" +msgstr "删除数据集ID:" + +#: functions/NagDataClass.php:403 +msgid "- from table:" +msgstr "- 从表中:" + +#: functions/NagDataClass.php:404 functions/NagDataClass.php:439 functions/NagDataClass.php:614 functions/NagDataClass.php:963 +#: functions/NagDataClass.php:1020 +msgid "- with affected rows:" +msgstr "- 受影响行:" + +#: functions/NagDataClass.php:432 functions/NagDataClass.php:443 +msgid "No data deleted. Probably the dataset does not exist or it is protected from delete." +msgstr "没有数据被删除。可能由于数据集不存在或者它是受保护对象不能删除。" + +#: functions/NagDataClass.php:438 functions/NagDataClass.php:613 +msgid "Deleted data from table:" +msgstr "从表中删除数据:" + +#: functions/NagDataClass.php:603 +msgid "" +"No data deleted. Probably the dataset does not exist, it is protected from deletion, you do not have write permission or it has " +"relations to other configurations which cannot be deleted. Use the \"info\" function for detailed informations about relations!" msgstr "" +"没有删除数据。可能数据集不存在,它不受删除的影响,您没有写入权限,或者它与其他不能删除的配置有关系。使用“信息”功能的详细信息的关" +"系!" -#: functions/data_class.php:633 -msgid "No dataset activated. Maybe the dataset does not exist, no dataset was selected or you do not have write permission." -msgstr "" +#: functions/NagDataClass.php:619 +msgid "No data deleted. Probably the dataset does not exist, it is protected from deletion or you do not have write permission." +msgstr "没有删除数据。可能数据集不存在,它不受删除或没有写入权限保护。" -#: functions/data_class.php:637 -msgid "Dataset successfully activated. Affected rows:" -msgstr "数据集成功激活。影响行数:" - -#: functions/data_class.php:638 -#: functions/data_class.php:703 -msgid "Activate dataset from table:" -msgstr "从表中激活数据集:" - -#: functions/data_class.php:642 -msgid "No dataset activated. Maybe the dataset does not exist or you do not have write permission." -msgstr "" - -#: functions/data_class.php:698 -msgid "No dataset deactivated. Maybe the dataset does not exist, it is protected from deactivation, no dataset was selected or you do not have write permission. Use the \"info\" function for detailed informations about relations!" -msgstr "" - -#: functions/data_class.php:702 -msgid "Dataset successfully deactivated. Affected rows:" -msgstr "数据集成功停用。影响行数:" - -#: functions/data_class.php:707 -msgid "No dataset deactivated. Maybe the dataset does not exist or you do not have write permission." -msgstr "" - -#: functions/data_class.php:891 +#: functions/NagDataClass.php:691 msgid "Relation information for " -msgstr "" +msgstr "关联信息到" -#: functions/data_class.php:891 +#: functions/NagDataClass.php:692 msgid " of table " msgstr "" -#: functions/data_class.php:945 -#: functions/data_class.php:947 -#: functions/data_class.php:951 -#: functions/data_class.php:967 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:747 functions/NagDataClass.php:752 functions/NagDataClass.php:759 functions/NagDataClass.php:778 +#: functions/NagDataClass.php:784 msgid "Relation to " msgstr "关系到" -#: functions/data_class.php:945 -#: functions/data_class.php:947 -#: functions/data_class.php:951 -#: functions/data_class.php:967 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:748 functions/NagDataClass.php:753 functions/NagDataClass.php:760 functions/NagDataClass.php:779 +#: functions/NagDataClass.php:785 msgid ", entry " msgstr ", 条目" -#: functions/data_class.php:945 -#: functions/data_class.php:951 -#: functions/data_class.php:970 +#: functions/NagDataClass.php:749 functions/NagDataClass.php:761 functions/NagDataClass.php:787 msgid "deletion possible" msgstr "删除" -#: functions/data_class.php:947 -#: functions/data_class.php:967 +#: functions/NagDataClass.php:755 functions/NagDataClass.php:781 msgid "deletion not possible" msgstr "不能删除!" -#: functions/import_class.php:78 -msgid "Unable to get configuration data:" -msgstr "" +#: functions/NagDataClass.php:954 +msgid "" +"No dataset deactivated. Maybe the dataset does not exist, it is protected from deactivation, no dataset was selected or you do not " +"have write permission. Use the \"info\" function for detailed informations about relations!" +msgstr "没有数据集停用。可能数据集不存在,它被保护为不激活,没有选择数据集,或者您没有写入权限。使用“信息”功能的详细信息的关系!" -#: functions/import_class.php:98 +#: functions/NagDataClass.php:960 +msgid "Dataset successfully deactivated. Affected rows:" +msgstr "数据集成功停用。影响行数:" + +#: functions/NagDataClass.php:962 +msgid "Deactivate dataset from table:" +msgstr "从表中停用数据" + +#: functions/NagDataClass.php:967 +msgid "No dataset deactivated. Maybe the dataset does not exist or you do not have write permission." +msgstr "没有数据集停用。可能数据集不存在,或者您没有写入权限。" + +#: functions/NagDataClass.php:1013 +msgid "No dataset activated. Maybe the dataset does not exist, no dataset was selected or you do not have write permission." +msgstr "没有激活数据集。可能数据集不存在,没有选择数据集,或者您没有写入权限。" + +#: functions/NagDataClass.php:1017 +msgid "Dataset successfully activated. Affected rows:" +msgstr "数据集成功激活。影响行数:" + +#: functions/NagDataClass.php:1019 +msgid "Activate dataset from table:" +msgstr "从表中激活数据集:" + +#: functions/NagDataClass.php:1024 +msgid "No dataset activated. Maybe the dataset does not exist or you do not have write permission." +msgstr "没有激活数据集。可能数据集不存在,或者您没有写入权限。" + +#: functions/NagImportClass.php:162 +msgid "No valid configuration found:" +msgstr "没有找到有效的配置:" + +#: functions/NagImportClass.php:170 +msgid "Import file does not exist or is not readable:" +msgstr "导入文件不存在或不可读:" + +#: functions/NagImportClass.php:202 +msgid "Unable to get configuration data:" +msgstr "无法获取配置数据:" + +#: functions/NagImportClass.php:229 msgid "Cannot receive the configuration file (FTP connection)!" msgstr "不能接收配置文件(FTP连接)!" -#: functions/import_class.php:116 +#: functions/NagImportClass.php:252 msgid "Cannot receive the configuration file (SSH connection)!" msgstr "不能接收配置文件(SSH连接)!" -#: functions/import_class.php:189 -msgid "No valid configuration found:" -msgstr "" - -#: functions/import_class.php:198 -msgid "Import file does not exist or is not readable:" -msgstr "" - -#: functions/import_class.php:266 -msgid "Table for import definition" -msgstr "导入定义的表" - -# mutdialog.php -#: functions/import_class.php:266 -msgid "is not available!" -msgstr "不存在!" - -#: functions/import_class.php:318 -#: functions/import_class.php:323 -#: functions/import_class.php:635 -#: functions/import_class.php:636 -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: functions/NagImportClass.php:351 functions/NagImportClass.php:356 functions/NagImportClass.php:420 +#: functions/NagImportClass.php:426 functions/NagImportClass.php:433 functions/NagImportClass.php:438 msgid "inside" msgstr "内部" -#: functions/import_class.php:318 +#: functions/NagImportClass.php:352 msgid "exists and were not overwritten" msgstr "存在并没有被覆盖" -#: functions/import_class.php:323 +#: functions/NagImportClass.php:357 msgid "were not written" msgstr "没有被写入" # contacts.php -#: functions/import_class.php:635 -#: functions/import_class.php:636 +#: functions/NagImportClass.php:421 functions/NagImportClass.php:427 msgid "could not be inserted:" msgstr "不能被插入:" -#: functions/import_class.php:639 -#: functions/import_class.php:640 +#: functions/NagImportClass.php:434 functions/NagImportClass.php:439 msgid "successfully inserted" msgstr "成功插入" -#: functions/import_class.php:1275 -msgid "Error: wrong number of arguments - cannot import service group members" -msgstr "错误:参数个数错误 - 不能导入服务组成员" +#: functions/NagImportClass.php:564 +msgid "Table for import definition" +msgstr "导入定义的表" -#: functions/mysql_class.php:269 -msgid "Missing server connection parameter!" -msgstr "不存在服务器连接参数" +# mutdialog.php +#: functions/NagImportClass.php:565 +msgid "is not available!" +msgstr "不存在!" -#: functions/mysql_class.php:276 -#: functions/mysql_class.php:305 -msgid "Connection to the database server has failed by reason:" -msgstr "连接到数据库失败,原因如下:" +#: functions/NagImportClass.php:1640 +msgid "Error: incorrect number of arguments - cannot import service group members" +msgstr "错误:参数数目不正确-不能导入服务组成员" -#: functions/mysql_class.php:298 -msgid "Missing database connection parameter!" -msgstr "不存在数据库连接参数" +#: functions/NagImportClass.php:1868 +msgid "Error: incorrect number of arguments - cannot import service parent members" +msgstr "错误:参数数目不正确-不能导入服务父成员" -#: functions/nag_class.php:123 +#: functions/NagImportClass.php:1929 functions/NagImportClass.php:1934 +msgid "Error: cannot import the service parent member " +msgstr "错误:无法导入服务的父成员" + +#: functions/NagImportClass.php:1931 +msgid "This combination is not unique!" +msgstr "这种组合不是唯一的!" + +#: functions/NagImportClass.php:1936 +msgid "This combination is not unique or does not exist!" +msgstr "这种组合不是唯一的或者不存在!" + +#: functions/NagVisualClass.php:227 msgid "Hide menu" msgstr "隐藏菜单" -#: functions/nag_class.php:132 +#: functions/NagVisualClass.php:237 msgid "Show menu" msgstr "显示菜单" -#: functions/nag_class.php:406 +#: functions/NagVisualClass.php:272 msgid "Page" msgstr "页" -#: functions/nag_class.php:961 +#: functions/NagVisualClass.php:805 msgid "Unrestricted access" msgstr "无限制访问" -# prepend.adm -#: functions/prepend_adm.php:101 -#: install/index.php:100 -msgid "Error while connecting to database:" -msgstr "连接数据库失败" - -#: functions/prepend_adm.php:133 -#: functions/prepend_adm.php:192 +#: functions/prepend_adm.php:214 msgid "Error in setting the correct locale, please report this error with the associated output of 'locale -a' to bugs@nagiosql.org" msgstr "在设置正确的区域时出错,请将此错误以及'locale -a'的输出汇报给bugs@nagiosql.org" -#: functions/prepend_adm.php:269 +#: functions/prepend_adm.php:306 msgid "Webserver login successfull" msgstr "网页服务器成功登录!" -#: functions/prepend_adm.php:302 +#: functions/prepend_adm.php:347 msgid "Login successfull" msgstr "成功登录" -#: functions/prepend_adm.php:307 -#: functions/prepend_adm.php:308 +#: functions/prepend_adm.php:354 functions/prepend_adm.php:355 msgid "Login failed!" msgstr "登录失败" -#: functions/prepend_adm.php:332 +#: functions/prepend_adm.php:387 msgid "Session timeout reached - Seconds:" msgstr "Session超时-秒:" -#: functions/prepend_adm.php:343 +#: functions/prepend_adm.php:402 msgid "Restricted site accessed:" msgstr "访问受限站点" -#: functions/prepend_adm.php:355 +#: functions/prepend_adm.php:419 msgid "User not found in database" msgstr "数据库中未发现用户" -#: functions/prepend_adm.php:393 -msgid "Admin" -msgstr "管理" - -#: functions/prepend_adm.php:457 +#: functions/prepend_adm.php:548 msgid "Logged in:" msgstr "进入" -#: functions/prepend_adm.php:458 +#: functions/prepend_adm.php:550 msgid "Logout" msgstr "退出登录" -#: functions/prepend_adm.php:478 +#: functions/prepend_adm.php:573 msgid "Warning - template file not found or not readable, please check your file permissions! - File: " msgstr "警告 - 模板文件没有发现或不可读,请检查文件权限! - 文件:" -#: functions/prepend_content.php:303 -#: functions/prepend_content.php:306 -#: functions/prepend_content.php:322 -#: functions/prepend_content.php:325 +#: functions/prepend_content.php:258 functions/prepend_content.php:265 functions/prepend_content.php:288 +#: functions/prepend_content.php:295 msgid "Some configuration files were not written. Dataset not activated, not found or you do not have write permission!" -msgstr "" +msgstr "未写入某些配置文件。未激活数据集,未找到或没有写入权限!" -#: functions/prepend_content.php:305 -#: functions/prepend_content.php:324 +#: functions/prepend_content.php:262 functions/prepend_content.php:292 msgid "Configuration files successfully written!" -msgstr "" +msgstr "配置文件写入成功!" -#: functions/prepend_content.php:344 -msgid "Admin can't be deleted" +#: functions/prepend_content.php:321 +msgid "Admin cannot be deleted" msgstr "管理员不能被删除" -#: functions/prepend_content.php:347 +#: functions/prepend_content.php:325 msgid "Localhost can't be deleted" msgstr "Localhost不能删除" -#: functions/prepend_content.php:475 +#: functions/prepend_content.php:502 msgid "No permission to open configuration!" msgstr "没有打开配置的权限!" -#: functions/translator.php:56 +#: functions/translator.php:63 install/functions/NagInstallClass.php:99 msgid "English" msgstr "英语" -#: functions/translator.php:60 +#: functions/translator.php:67 install/functions/NagInstallClass.php:103 msgid "German" msgstr "德语" -#: functions/translator.php:64 +#: functions/translator.php:71 install/functions/NagInstallClass.php:107 msgid "Chinese (Simplified)" msgstr "中文(简体)" -#: functions/translator.php:68 +#: functions/translator.php:75 install/functions/NagInstallClass.php:111 msgid "Italian" msgstr "意大利语" -#: functions/translator.php:72 +#: functions/translator.php:79 install/functions/NagInstallClass.php:115 msgid "French" msgstr "法语" -#: functions/translator.php:76 +#: functions/translator.php:83 install/functions/NagInstallClass.php:119 msgid "Russian" msgstr "俄语" -#: functions/translator.php:80 +#: functions/translator.php:87 install/functions/NagInstallClass.php:123 msgid "Spanish" msgstr "西班牙语" -#: functions/translator.php:84 +#: functions/translator.php:91 install/functions/NagInstallClass.php:127 msgid "Portuguese (Brazilian)" msgstr "葡萄牙语(巴西)" -#: functions/translator.php:88 +#: functions/translator.php:95 install/functions/NagInstallClass.php:131 msgid "Dutch" msgstr "荷兰语" -#: functions/translator.php:92 +#: functions/translator.php:99 install/functions/NagInstallClass.php:135 msgid "Danish" msgstr "丹麦语" -#: install/index.php:63 -#: install/index.php:172 +#: index.php:47 +msgid "Welcome to" +msgstr "欢迎来到" + +#: index.php:48 +msgid "Welcome" +msgstr "欢迎" + +#: index.php:49 +msgid "Please enter your username and password to access NagiosQL.
If you forgot one of them, please contact your Administrator." +msgstr "请输入你的用户名及密码以访问NagiosQL。
如果你忘记其中的一个,请联系管理员。" + +#: index.php:53 +msgid "Login" +msgstr "登录" + +#: install/functions/NagInstallClass.php:75 +msgid "Template file not found" +msgstr "没有找到模板文件" + +#: install/functions/NagInstallClass.php:336 install/functions/NagInstallClass.php:368 +msgid "passed" +msgstr "通过" + +# prepend.adm +#: install/functions/NagInstallClass.php:358 +msgid "Error while connecting to database:" +msgstr "连接数据库失败" + +#: install/functions/NagInstallClass.php:399 install/functions/NagInstallClass.php:474 +msgid "supported" +msgstr "支持" + +#: install/functions/NagInstallClass.php:401 +msgid "not supported" +msgstr "不支持" + +#: install/functions/NagInstallClass.php:477 +msgid "Your NagiosQL installation is up to date - no further actions are needed!" +msgstr "您的NAGIOSQL安装日期是最新的-没有进一步的检查的必要!" + +#: install/functions/NagInstallClass.php:483 install/functions/NagInstallClass.php:491 +msgid "Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and above!" +msgstr "对NAGIOSQL 3.2和以上的更新仅支持NAGIOSQL 3.0.0及以上!" + +# prepend.adm +#: install/functions/NagInstallClass.php:489 +msgid "Error while selecting settings table." +msgstr "选择设置表时出错。" + +#: install/functions/NagInstallClass.php:511 install/functions/NagInstallClass.php:547 install/functions/NagInstallClass.php:610 +#: install/functions/NagInstallClass.php:614 install/functions/NagInstallClass.php:655 install/functions/NagInstallClass.php:736 +#: install/functions/NagInstallClass.php:819 install/functions/NagInstallClass.php:870 install/functions/NagInstallClass.php:935 +#: install/functions/NagInstallClass.php:945 install/functions/NagInstallClass.php:967 install/functions/NagInstallClass.php:1015 +#: install/functions/NagInstallClass.php:1067 +msgid "done" +msgstr "完成" + +#: install/functions/NagInstallClass.php:538 +msgid "Unsupported database type." +msgstr "不支持的数据库类型。" + +#: install/functions/NagInstallClass.php:611 +msgid "Only added rights to existing user" +msgstr "仅对现有用户添加权限" + +# mutdialog.php +#: install/functions/NagInstallClass.php:641 +msgid "No SQL update files available" +msgstr "没有可用的SQL更新文件" + +#: install/functions/NagInstallClass.php:650 install/functions/NagInstallClass.php:707 +msgid "SQL file is not readable or empty" +msgstr "SQL文件不可读或空" + +#: install/functions/NagInstallClass.php:778 install/functions/NagInstallClass.php:785 install/functions/NagInstallClass.php:813 +msgid "Inserting initial data to settings database has failed:" +msgstr "将初始数据插入到设置数据库失败:" + +#: install/functions/NagInstallClass.php:873 +msgid "Connot open/write to config/settings.php" +msgstr "不能打开/写到配置文件settings.php" + +#: install/functions/NagInstallClass.php:905 +msgid "Inserting path data to database has failed:" +msgstr "将路径数据插入数据库失败:" + +#: install/functions/NagInstallClass.php:936 +msgid "Check the permissions of the created paths!" +msgstr "检查创建的路径的权限!" + +#: install/functions/NagInstallClass.php:939 +msgid "NagiosQL config path is not writeable - only database values updated" +msgstr "NAGIOSQL配置路径不可写入-只更新数据库值" + +# prepend.adm +#: install/functions/NagInstallClass.php:969 install/functions/NagInstallClass.php:1017 install/functions/NagInstallClass.php:1069 +msgid "Database errors while converting to utf-8:" +msgstr "转换为UTF-8时的数据库错误:" + +#: install/functions/NagInstallClass.php:1008 install/functions/NagInstallClass.php:1060 install/step3.php:88 install/step3.php:177 +msgid "Database type not defined!" +msgstr "数据库类型没有定义!" + +#: install/index.php:69 msgid "Online Documentation" msgstr "在线文档" -#: install/index.php:99 +#: install/index.php:115 msgid "Database connection failed. Upgrade not available!" -msgstr "" +msgstr "数据库连接失败。升级不可用!" -#: install/index.php:105 +#: install/index.php:122 msgid "Settings table not available or wrong. Upgrade not available!" -msgstr "" +msgstr "设置表不可用或错误。升级不可用!" -#: install/index.php:116 -msgid "Installation cannot continue, please make sure you have the mysql extension loaded!" -msgstr "" +#: install/index.php:133 +msgid "Invalid database type in settings file (config/settings.php). Upgrade not available!" +msgstr "设置文件中的数据库类型无效(配置/设置.php)。升级不可用!" -#: install/index.php:121 -msgid "Installation cannot continue, postgres is not yet available in beta!" -msgstr "" - -#: install/index.php:124 -msgid "Installation cannot continue, please make sure you have the pgsql extension loaded!" -msgstr "" - -#: install/index.php:128 -msgid "Database type in settings file is wrong (config/settings.php). Upgrade not available!" -msgstr "" - -#: install/index.php:131 +#: install/index.php:137 msgid "Database values in settings file are missing (config/settings.php). Upgrade not available!" -msgstr "" +msgstr "设置文件中的数据库值丢失(配置/设置.php)。升级不可用!" -#: install/index.php:134 +#: install/index.php:141 msgid "Settings file not found or not readable (config/settings.php). Upgrade not available!" -msgstr "" +msgstr "未找到或不可读的设置文件(配置/设置.php)。升级不可用!" -#: install/index.php:144 -msgid "Default values file is not available or not readable (install/functions/initial_settings.php). Installation possible, but without predefined data!" -msgstr "" +#: install/index.php:152 +msgid "" +"Default values file is not available or not readable (install/functions/initial_settings.php). Installation possible, but without " +"predefined data!" +msgstr "默认值文件不可用或不可读(安装/函数/初始值设置.php)。安装可能,但没有预定义数据!" -#: install/index.php:150 -#: install/install.php:124 -msgid "Welcome to the NagiosQL Installation Wizard" +#: install/index.php:159 +msgid "Installation wizard" +msgstr "安装向导" + +#: install/index.php:160 +msgid "Welcome to the NagiosQL installation wizard" msgstr "欢迎使用NagiosQL安装向导" -#: install/index.php:151 +#: install/index.php:161 msgid "This wizard will help you to install and configure NagiosQL." msgstr "此向导将帮你安装并配置NagiosQL。" -#: install/index.php:152 +#: install/index.php:163 msgid "For questions please visit" msgstr "如有问题请访问" -#: install/index.php:153 +#: install/index.php:164 msgid "First let's check your local environment and find out if everything NagiosQL needs is available." msgstr "首先检查你的本地环境以及检查NagiosQL所需的环境是否可用。" -#: install/index.php:154 +#: install/index.php:166 msgid "The basic requirements are:" msgstr "基本所需软件:" -#: install/index.php:155 -msgid "PHP 5.2.0 or greater including:" -msgstr "PHP 5.2.0或以上版本,包括:" +#: install/index.php:167 +msgid "PHP 5.5.0 or greater including:" +msgstr "PHP 5.5.0或以上版本,包括:" -#: install/index.php:156 -#: install/index.php:157 -#: install/index.php:158 -#: install/index.php:161 -#: install/index.php:163 -#: install/index.php:164 -msgid "PHP Module:" -msgstr "PHP模块:" +#: install/index.php:168 +msgid "PHP database module:" +msgstr "PHP数据库模块:" -#: install/index.php:163 -#: install/index.php:164 -#: install/index.php:165 +#: install/index.php:169 +msgid "supported types are" +msgstr "支持的类型是" + +#: install/index.php:174 install/index.php:176 msgid "(optional)" msgstr "(可选)" -#: install/index.php:165 -msgid "PECL Extension:" +#: install/index.php:175 +msgid "PECL extension:" msgstr "PECL扩展:" -#: install/index.php:166 +#: install/index.php:177 msgid "php.ini options" msgstr "php.ini选项" -#: install/index.php:167 +#: install/index.php:178 msgid "file_uploads on (for upload features)" msgstr "file_uploads在(用于上传文件)" -#: install/index.php:168 +#: install/index.php:179 msgid "session.auto_start needs to be off" msgstr "session.auto_start需要设置为off" -#: install/index.php:169 -msgid "A MySQL database server" -msgstr "MySQL服务器" +#: install/index.php:180 +msgid "A database server" +msgstr "数据库服务端" -#: install/index.php:170 -msgid "Nagios 2.x/3.x" -msgstr "" +#: install/index.php:181 +msgid "Nagios 2.x/3.x/4.x" +msgstr "Nagios 2.x/3.x/4.x" -#: install/index.php:176 +#: install/index.php:182 +msgid "NagiosQL version" +msgstr "NagiosQL版本" + +#: install/index.php:184 +msgid "Online documentation" +msgstr "在线文档" + +#: install/index.php:188 msgid "START INSTALLATION" msgstr "开始安装" -#: install/index.php:177 +#: install/index.php:189 msgid "START UPDATE" msgstr "开始更新" -#: install/step1.php:80 +#: install/install.php:214 +msgid "Welcome to the NagiosQL Installation Wizard" +msgstr "欢迎使用NagiosQL安装向导" + +#: install/step1.php:74 install/step2.php:34 install/step3.php:38 msgid "Requirements" msgstr "需求" -#: install/step1.php:82 +#: install/step1.php:75 install/step1.php:77 install/step2.php:35 install/step2.php:37 install/step3.php:39 install/step3.php:41 +msgid "Installation" +msgstr "安装" + +#: install/step1.php:76 install/step2.php:36 install/step3.php:40 install/step3.php:301 msgid "Finish" msgstr "完成" -#: install/step1.php:83 +#: install/step1.php:78 msgid "Checking requirements" msgstr "检查前提条件" -#: install/step1.php:84 +#: install/step1.php:79 msgid "Checking Client" msgstr "检查客户端" -#: install/step1.php:85 +#: install/step1.php:80 msgid "Checking PHP version" msgstr "检查PHP版本" -#: install/step1.php:86 +#: install/step1.php:81 msgid "Checking PHP extensions" msgstr "检查PHP扩展" -#: install/step1.php:87 +#: install/step1.php:82 msgid "Checking available database interfaces" msgstr "检查可用的数据库接口" -#: install/step1.php:88 +#: install/step1.php:83 msgid "Checking php.ini/.htaccess settings" msgstr "检查php.ini/.htaccess配置" -#: install/step1.php:89 +#: install/step1.php:84 msgid "Checking System Permission" msgstr "检查系统权限" -#: install/step1.php:90 +#: install/step1.php:85 msgid "The following modules/extensions are required to run NagiosQL" msgstr "要运行NagiosQL需要下列模块/扩展。" -#: install/step1.php:91 +#: install/step1.php:87 msgid "The next couple of extensions are optional but recommended" msgstr "下列扩展是可选的但推荐。" -#: install/step1.php:92 +#: install/step1.php:89 msgid "Check which of the supported extensions are installed. At least one of them is required." msgstr "检查已安装的可支持扩展。需要至少其中的一个。" -#: install/step1.php:93 +#: install/step1.php:91 msgid "The following settings are required to run NagiosQL" msgstr "要运行NagiosQL需要下列配置" -#: install/step1.php:107 +#: install/step1.php:109 msgid "ENABLED" msgstr "启用" -#: install/step1.php:109 +#: install/step1.php:114 msgid "NOT ENABLED" msgstr "未启用" -#: install/step1.php:113 +#: install/step1.php:115 +msgid "After enabling Javascript, the page must be updated twice so that the status changes" +msgstr "启用JavaScript之后,必须更新页面两次,以便状态改变" + +#: install/step1.php:120 msgid "Version" msgstr "版本" -#: install/step1.php:115 -#: install/step1.php:128 -#: install/step1.php:141 -#: install/step1.php:158 -#: install/step1.php:178 -#: install/step1.php:182 -#: install/step1.php:194 -#: install/step1.php:201 -#: install/step1.php:203 -#: install/step1.php:213 -#: install/step1.php:220 -#: install/step1.php:227 -#: install/step1.php:234 -#: install/step1.php:241 -#: install/step1.php:248 +#: install/step1.php:124 install/step1.php:140 install/step1.php:155 install/step1.php:180 install/step1.php:208 +#: install/step1.php:212 install/step1.php:226 install/step1.php:236 install/step1.php:239 install/step1.php:252 +#: install/step1.php:261 install/step1.php:270 install/step1.php:279 install/step1.php:288 install/step1.php:297 msgid "OK" msgstr "完成" -#: install/step1.php:116 -#: install/step1.php:118 +#: install/step1.php:125 install/step1.php:129 msgid "detected" msgstr "检测到" -#: install/step1.php:119 +#: install/step1.php:130 msgid "or greater is required" msgstr "或者需要更高版本" -#: install/step1.php:131 -#: install/step1.php:144 -#: install/step1.php:162 +#: install/step1.php:143 install/step1.php:158 install/step1.php:187 msgid "Could be loaded. Please add in php.ini" msgstr "不能加载。请在php.ini加入。" -#: install/step1.php:132 -#: install/step1.php:145 -#: install/step1.php:163 -#: install/step1.php:175 +#: install/step1.php:145 install/step1.php:160 install/step1.php:189 install/step1.php:204 msgid "NOT AVAILABLE" msgstr "不可用" -#: install/step1.php:157 +#: install/step1.php:177 msgid "New installation only - updates are only supported using the same database interface!" -msgstr "" +msgstr "仅使用相同的数据库接口只支持新的安装!" -#: install/step1.php:175 +#: install/step1.php:205 msgid "cannot be empty and needs to be set" msgstr "不能为空,需要设置。" -#: install/step1.php:184 +#: install/step1.php:214 msgid "should be" msgstr "应该是" -#: install/step1.php:194 -#: install/step1.php:196 +#: install/step1.php:225 install/step1.php:228 msgid "Read test on settings file (config/settings.php)" msgstr "配置文件读取测试(config/settings.php)" -#: install/step1.php:198 +#: install/step1.php:231 msgid "Settings file does not exists (config/settings.php)" msgstr "配置文件不存在(config/settings.php)" -#: install/step1.php:198 +#: install/step1.php:232 msgid "will be created" msgstr "将被创建" -#: install/step1.php:201 -#: install/step1.php:205 +#: install/step1.php:235 install/step1.php:241 msgid "Write test on settings file (config/settings.php)" msgstr "配置文件写测试(config/settings.php)" -#: install/step1.php:203 -#: install/step1.php:208 +#: install/step1.php:238 install/step1.php:245 msgid "Write test on settings directory (config/)" msgstr "配置目录写测试(config/)" -#: install/step1.php:213 -#: install/step1.php:215 -msgid "Read test on a class file (functions/nag_class.php)" -msgstr "类文件读取测试(functions/nag_class.php)" +#: install/step1.php:251 install/step1.php:254 +msgid "Read test on one class file (functions/NagVisualClass.php)" +msgstr "" +"90%\n" +"match\n" +"类文件读取测试(functions/nag_class.php)" -#: install/step1.php:220 -#: install/step1.php:222 -msgid "Read test on startsite file (admin.php)" +#: install/step1.php:260 install/step1.php:263 +msgid "Read test on home page file (admin.php)" msgstr "开始站点文件读测试(admin.php)" -#: install/step1.php:227 -#: install/step1.php:229 -msgid "Read test on a template file (templates/index.tpl.htm)" +#: install/step1.php:269 install/step1.php:272 +msgid "Read test on one template file (templates/index.tpl.htm)" msgstr "模板文件读测试(templates/index.tpl.htm)" -#: install/step1.php:234 -#: install/step1.php:236 -msgid "Read test on a admin template file (templates/admin/admin_master.tpl.htm)" -msgstr "管理模板文件读取测试(templates/admin/admin_master.tpl.htm)" +#: install/step1.php:278 install/step1.php:281 +msgid "Read test on one admin template file (templates/admin/datalist.htm.tpl)" +msgstr "管理模板文件读取测试(templates/ admin /Distalist.HTM.TPL)" -#: install/step1.php:241 -#: install/step1.php:243 -msgid "Read test on a file template (templates/files/contacts.tpl.dat)" +#: install/step1.php:287 install/step1.php:290 +msgid "Read test on one file template (templates/files/contacts.tpl.dat)" msgstr "模板文件读取测试(templates/files/contacts.tpl.dat)" -#: install/step1.php:248 -#: install/step1.php:250 -msgid "Read test on a image file (images/pixel.gif)" +#: install/step1.php:296 install/step1.php:299 +msgid "Read test on one image file (images/pixel.gif)" msgstr "图片文件读取测试(images/pixel.gif)" -#: install/step1.php:254 +#: install/step1.php:304 msgid "There are some errors - please check your system settings and read the requirements of NagiosQL!" msgstr "有些错误-请检查你的系统配置并阅读NagiosQL的需求文档" -#: install/step1.php:255 -msgid "Read the INSTALLATION file from NagiosQL to find out, how to fix them." +#: install/step1.php:306 +msgid "Read the INSTALLATION file in the NagiosQL doc directory or the installation PDF file on our" msgstr "阅读NagiosQL的安装文件以找出解决问题的方法" -#: install/step1.php:256 +#: install/step1.php:310 +msgid "online documentation" +msgstr "在线文档" + +#: install/step1.php:311 +msgid "site to find out, how to fix them." +msgstr "在网站找出,如何修复它们。" + +#: install/step1.php:312 msgid "After that - refresh this page to proceed" msgstr "完成后-刷新页面以继续" -#: install/step1.php:259 +#: install/step1.php:316 msgid "Refresh" msgstr "刷新" -#: install/step1.php:261 -msgid "Environment test sucessfully passed" +#: install/step1.php:318 +msgid "Environment test completed successfully" msgstr "环境测试成功通过" -#: install/step1.php:264 +#: install/step1.php:323 install/step2.php:94 msgid "Next" msgstr "下一步" -#: install/step2.php:33 +#: install/step2.php:32 msgid "The NagiosQL first passwords are not equal!" -msgstr "" +msgstr "NAGIOSQL第一个密码不一致!" #: install/step2.php:38 msgid "Setup" @@ -3346,354 +3384,212 @@ msgstr "创建" msgid "Please complete the form below. Mandatory fields marked *" msgstr "请完成以下表格。强制项有*标记" -#: install/step2.php:40 +#: install/step2.php:41 msgid "Database Configuration" msgstr "数据库配置文件" -#: install/step2.php:41 +#: install/step2.php:42 msgid "Database Type" -msgstr "" +msgstr "数据库类型" -#: install/step2.php:43 +#: install/step2.php:56 msgid "Database Server" -msgstr "" +msgstr "数据库服务端" -#: install/step2.php:45 +#: install/step2.php:58 msgid "Local hostname or IP address" -msgstr "" +msgstr "本地主机名或者IP地址" -#: install/step2.php:51 +#: install/step2.php:64 msgid "Database Server Port" -msgstr "" +msgstr "数据库端口" -#: install/step2.php:55 +#: install/step2.php:68 msgid "NagiosQL DB User" msgstr "NagiosQL数据库用户" -#: install/step2.php:57 +#: install/step2.php:70 msgid "NagiosQL DB Password" msgstr "NagiosQL数据库密码" -#: install/step2.php:59 +#: install/step2.php:72 msgid "Administrative Database User" -msgstr "" +msgstr "管理数据库用户" -#: install/step2.php:61 +#: install/step2.php:74 msgid "Administrative Database Password" -msgstr "" +msgstr "管理数据库密码" -#: install/step2.php:62 +#: install/step2.php:75 msgid "Drop database if already exists?" msgstr "如果数据库存在是否删除?" -#: install/step2.php:64 +#: install/step2.php:81 msgid "NagiosQL User Setup" msgstr "创建NagiosQL用户" -#: install/step2.php:65 +#: install/step2.php:82 msgid "Initial NagiosQL User" msgstr "初始Nagios用户" -#: install/step2.php:67 +#: install/step2.php:84 msgid "Initial NagiosQL Password" msgstr "初始NagiosQL密码" -#: install/step2.php:69 +#: install/step2.php:86 msgid "Please repeat the password" msgstr "请重复输入密码" -#: install/step2.php:70 +#: install/step2.php:87 msgid "Nagios Configuration" msgstr "Nagios配置文件" -#: install/step2.php:71 +#: install/step2.php:88 msgid "Import Nagios sample config?" msgstr "导入Nagios参考配置" -#: install/step2.php:74 +#: install/step2.php:95 msgid "NagiosQL path values" -msgstr "" +msgstr "NagiosQL路径值" -#: install/step2.php:75 +#: install/step2.php:96 msgid "Create NagiosQL config paths?" -msgstr "" +msgstr "创建NAGIOSQL配置路径?" -#: install/step2.php:77 +#: install/step2.php:102 msgid "NagiosQL config path" -msgstr "" +msgstr "NagiosQL配置路径" -#: install/step2.php:79 +#: install/step2.php:104 msgid "Nagios config path" -msgstr "" +msgstr "Nagios配置路径" -#: install/step2.php:81 +#: install/step2.php:106 msgid "Both path values were stored in your configuration target settings for localhost." -msgstr "" +msgstr "两个路径值都存储在本地主机的配置目标设置中。" -#: install/step2.php:82 -msgid "If you select the create path option, be sure that the NagiosQL base path exist and the webserver demon has write access to it. So the installer will create the required subdirectories in your localhost's filesystem (hosts, services, backup etc.)" +#: install/step2.php:108 +msgid "" +"If you select the create path option, be sure that the NagiosQL base path exist and the webserver demon has write access to it. So " +"the installer will create the required subdirectories in your localhost's filesystem (hosts, services, backup etc.)" msgstr "" +"如果选择“创建路径”选项,请确保存在NGAiOSQL基础路径,并且WebServer进程有对其的访问权限。因此,安装程序将在本地主机文件系统(主机、服" +"务、备份等)中创建所需的子目录。" -#: install/step2.php:94 +#: install/step2.php:120 msgid "Please backup your database before proceeding!" msgstr "请继续前备份数据库!" -#: install/step3.php:40 +#: install/step3.php:42 msgid "Finishing Setup" msgstr "完成安装" -#: install/step3.php:42 +#: install/step3.php:44 msgid "Deploy NagiosQL settings" msgstr "部署NagiosQL配置" -#: install/step3.php:43 -msgid "Database server connection (privileged user)" -msgstr "" - -#: install/step3.php:44 -msgid "Database server version" -msgstr "" - #: install/step3.php:45 -msgid "Database server support" -msgstr "" +msgid "Database server connection (privileged user)" +msgstr "数据库服务器连接(特权用户)" #: install/step3.php:46 +msgid "Database server version" +msgstr "数据库服务器版本" + +#: install/step3.php:47 +msgid "Database server support" +msgstr "支持的数据库服务端" + +#: install/step3.php:48 msgid "Delete existing NagiosQL database" msgstr "删除现有的NagiosQL数据库" -#: install/step3.php:47 +#: install/step3.php:49 msgid "Creating new database" msgstr "创建新数据库" -#: install/step3.php:48 -msgid "Create NagiosQL database user" -msgstr "" - -#: install/step3.php:49 -msgid "Installing NagiosQL database tables" -msgstr "" - #: install/step3.php:50 +msgid "Installing NagiosQL database tables" +msgstr "安装NAGIOSQL数据库表" + +#: install/step3.php:51 +msgid "Create NagiosQL database user" +msgstr "创建NagiosQL数据库用户" + +#: install/step3.php:52 msgid "Set initial NagiosQL Administrator" msgstr "设置初始NagiosQL管理员" -#: install/step3.php:51 +#: install/step3.php:53 msgid "Database server connection (NagiosQL user)" -msgstr "" +msgstr "数据库服务器连接(NagiosQL用户)" -#: install/step3.php:52 +#: install/step3.php:54 msgid "Writing global settings to database" msgstr "将全局设置写入数据库" -#: install/step3.php:53 +#: install/step3.php:55 msgid "Writing database configuration to settings.php" msgstr "向settings.php写入数据库配置" -#: install/step3.php:54 +#: install/step3.php:56 msgid "Import Nagios sample data" msgstr "导入Nagios参考数据" -#: install/step3.php:55 +#: install/step3.php:57 msgid "Create and/or store NagiosQL path settings" -msgstr "" +msgstr "创建或保存NAGIOSQL路径设置" -#: install/step3.php:73 +#: install/step3.php:80 msgid "Updating existing NagiosQL database" msgstr "更新现有的NagiosQL数据库" -#: install/step3.php:80 +#: install/step3.php:113 msgid "Installed NagiosQL version" msgstr "已安装的NagiosQL版本" -#: install/step3.php:86 +#: install/step3.php:124 msgid "Upgrading from version" msgstr "升级自版本" -#: install/step3.php:86 +#: install/step3.php:125 msgid "to" msgstr "到" -#: install/step3.php:92 +#: install/step3.php:132 msgid "Converting database to utf8 character set" msgstr "将数据库转换为utf8字符集" -#: install/step3.php:98 +#: install/step3.php:138 msgid "Converting database tables to utf8 character set" msgstr "将数据库表转换为utf8字符集" -#: install/step3.php:104 +#: install/step3.php:145 msgid "Converting database fields to utf8 character set" msgstr "将数据库字段转换为utf8字符集" -#: install/step3.php:126 +#: install/step3.php:169 msgid "Create new NagiosQL database" msgstr "创建新NagiosQL数据库" -#: install/step3.php:133 +#: install/step3.php:202 msgid "Database already exists and drop database was not selected, please correct or manage manually" -msgstr "数据库已经存在并且删除数据库没有被选择,请改正或者手工操作" +msgstr "选择的数据库已存在并且删除,请手动更正或管理" -#: install/step3.php:137 -#: install/functions/install_class.php:115 -#: install/functions/install_class.php:159 -msgid "passed" -msgstr "通过" - -#: install/step3.php:146 +#: install/step3.php:218 msgid "unknown" -msgstr "" +msgstr "未知" -#: install/step3.php:211 +#: install/step3.php:293 msgid "Back" msgstr "返回" -#: install/step3.php:216 +#: install/step3.php:298 msgid "Please delete the install directory to continue!" msgstr "请删除安装目录以继续" -#: install/functions/install_class.php:110 -#: install/functions/install_class.php:154 -#: install/functions/install_class.php:188 -#: install/functions/install_class.php:229 -#: install/functions/install_class.php:303 -#: install/functions/install_class.php:335 -#: install/functions/install_class.php:413 -#: install/functions/install_class.php:529 -#: install/functions/install_class.php:768 -#: install/functions/install_class.php:814 -#: install/functions/install_class.php:901 -msgid "Database type not defined!" -msgstr "" - -#: install/functions/install_class.php:195 -#: install/functions/install_class.php:265 -msgid "supported" -msgstr "支持" - -#: install/functions/install_class.php:198 -msgid "not supported" -msgstr "不支持" - -#: install/functions/install_class.php:268 -msgid "Your NagiosQL installation is up to date - no further actions are needed!" -msgstr "" - -#: install/functions/install_class.php:272 -#: install/functions/install_class.php:279 -msgid "Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and above!" -msgstr "" - -# prepend.adm -#: install/functions/install_class.php:277 -msgid "Error while selecting settings table." -msgstr "" - -#: install/functions/install_class.php:308 -#: install/functions/install_class.php:340 -#: install/functions/install_class.php:419 -#: install/functions/install_class.php:421 -#: install/functions/install_class.php:494 -#: install/functions/install_class.php:534 -#: install/functions/install_class.php:625 -#: install/functions/install_class.php:675 -#: install/functions/install_class.php:732 -#: install/functions/install_class.php:740 -#: install/functions/install_class.php:773 -#: install/functions/install_class.php:819 -#: install/functions/install_class.php:906 -msgid "done" -msgstr "完成" - -#: install/functions/install_class.php:419 -msgid "Only added rights to existing user" -msgstr "" - -#: install/functions/install_class.php:483 -#: install/functions/install_class.php:488 -msgid "SQL file is not readable or empty" -msgstr "" - -# mutdialog.php -#: install/functions/install_class.php:501 -msgid "No SQL update files available" -msgstr "" - -#: install/functions/install_class.php:571 -#: install/functions/install_class.php:576 -#: install/functions/install_class.php:585 -#: install/functions/install_class.php:590 -#: install/functions/install_class.php:613 -#: install/functions/install_class.php:620 -msgid "Inserting initial data to settings database has failed:" -msgstr "" - -#: install/functions/install_class.php:679 -msgid "Connot open/write to config/settings.php" -msgstr "" - -#: install/functions/install_class.php:713 -#: install/functions/install_class.php:720 -msgid "Inserting path data to database has failed:" -msgstr "" - -#: install/functions/install_class.php:732 -msgid "Check the permissions of the created paths!" -msgstr "" - -#: install/functions/install_class.php:736 -msgid "NagiosQL config path is not writeable - only database values updated" -msgstr "" - -# prepend.adm -#: install/functions/install_class.php:776 -#: install/functions/install_class.php:822 -#: install/functions/install_class.php:909 -msgid "Database errors while converting to utf-8:" -msgstr "" - -#~ msgid "Polish" -#~ msgstr "Polish" -#~ msgid "Japanese" -#~ msgstr "Japanese" -#~ msgid "Spanish (Argentina)" -#~ msgstr "Spanish (Argentina)" -#~ msgid "PHP session module" -#~ msgstr "PHP session module" -#~ msgid "PHP gettext module" -#~ msgstr "PHP Module:" -#~ msgid "PHP ftp module" -#~ msgstr "PHP Module:" -#~ msgid "PHP ssh module" -#~ msgstr "PHP Module:" -#~ msgid "Could not connect to Updateserver" -#~ msgstr "Could not connect to update server" -#~ msgid "Error" -#~ msgstr "Error" -#~ msgid "An error occured during the version check" -#~ msgstr "An error occured during the version check" -#~ msgid "Checking for NagiosQL Updates" -#~ msgstr "Checking for NagiosQL Updates" -#~ msgid "You already have the latest development version installed" -#~ msgstr "You already have the latest development version installed" -#~ msgid "" -#~ "Entry cannot be deactivated because it is used by another configuration" -#~ msgstr "" -#~ "Entry cannot be deactivated because it is used by another configuration" -#~ msgid "Automatically check for online updates (internet access required!)" -#~ msgstr "Automatically check for online updates (internet access required!)" -#~ msgid "Connection to remote system failed (SSH2 connection)!" -#~ msgstr "Connection to remote system failed (SSH2 connection)!" -#~ msgid "Connection to remote system failed (FTP connection)!" -#~ msgstr "Connection to remote system failed (FTP connection)!" -#~ msgid "No dataset activated. Probably the dataset does not exist" -#~ msgstr "No dataset activated. Probably the dataset does not exist" -#~ msgid "No dataset deactivated. Probably the dataset does not exist" -#~ msgstr "No dataset deactivated. Probably the dataset does not exist" -#~ msgid "Relation information for " -#~ msgstr "Relational information for " -#~ msgid "Not installed" -#~ msgstr "Not installed" -#~ msgid "The following settings are optional but recommended" -#~ msgstr "The following settings are optional but recommended" +#~ msgid "Cgi config file" +#~ msgstr "Cgi config file" +#~ msgid "Password too short or password fields don" +#~ msgstr "Password too short or password fields don" diff --git a/config/main.css b/config/main.css index 7b6f1f1..93528a9 100644 --- a/config/main.css +++ b/config/main.css @@ -5,27 +5,25 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : CSS Main definition -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////*/ body { font-family: Arial, Helvetica, sans-serif; background-color: #FFFFFF; - margin: 0px; - padding: 0px; + margin: 0; + padding: 0; font-size: 12px; } #login { text-align: center; - margin:0pt auto; + margin:0 auto; max-width:80em; min-width:740px; } @@ -58,7 +56,7 @@ body { text-decoration: none; font-weight: bold; background-color: #FFFFFF; - padding: 2px 3px 0px 3px; + padding: 2px 3px 0 3px; border-top:1px solid #002C52; border-left:1px solid #002C52; border-right:1px solid #002C52; @@ -96,7 +94,7 @@ body { /********************/ h1,h2,h3 { color: #0c4271; - margin-top: 0px; + margin-top: 0; } h1 { text-align: left; @@ -113,8 +111,8 @@ h3 { /** Menu **********/ /********************/ .menutable { - margin: 0px; - padding: 0px; + margin: 0; + padding: 0; border: none; text-align:left; } @@ -125,6 +123,8 @@ h3 { .menutable a:hover { color: #FF00FF; } + +/*noinspection ALL*/ .menutable .menu_act { color: #FF0000; font-size: 12px; @@ -155,6 +155,8 @@ h3 { .menutable .menu a:hover { color: #FFFFFF; } + +/*noinspection ALL*/ .menutable .menu_sub { font-size: 11px; color: #666666; @@ -170,6 +172,8 @@ h3 { color: #666666; text-decoration: underline; } + +/*noinspection ALL*/ .menutable .menu_sub_act { font-size: 11px; font-weight: bold; diff --git a/doc/CHANGELOG b/doc/CHANGELOG index ee89715..785d58e 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,6 +1,19 @@ +CHANGELOG 3.4.0 +--------------- +- Support for PHP 7.x (developped and tested with PHP 7.2.4) +- Support for PHP < 5.5 dropped +- Code reworked to follow PSR1/PSR2 standards +- New class autoloader function +- Several minor bugfixes +- Moved sourcecode to GitLab +- FTP now supports encrypted communication (FTPS) - new option in config targets +- Full support for Nagios 4.x added (importance and service parents) +- Nagios cgi.cfg path is now handled by NagiosQL +- Nagios ressource.cfg path is now handled by NagiosQL + CHANGELOG 3.3.0 --------------- -- [OK] Support for PHP version 7.x +- [OK] Support for PHP version 7.0 (not 7.1 or higher) - [OK] Database interface changed from mysql to mysqli CHANGELOG 3.2.0 @@ -19,10 +32,3 @@ CHANGELOG 3.2.0 - [OK] Servicegroup support for servicedependencies and serviceescalations - [OK][BUG] Reworked service selection in servicedependencies and serviceescalations - [OK][BUG] Reworked right management (menu access / read rights) - -OPEN in 3.2.0 -------------- -- YUI3 - YUI3 is still BETA -- Reworking templates for better integration -- Support for different time zones of remote systems (timestamp/file_stamp) -- PosgresQL support (comes with 3.2.x) diff --git a/doc/INSTALLATION_deDE.txt b/doc/INSTALLATION_deDE.txt index cd61956..0da2e39 100644 --- a/doc/INSTALLATION_deDE.txt +++ b/doc/INSTALLATION_deDE.txt @@ -4,16 +4,13 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2008-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // -// Project : NagiosQL -// Component: Installations HowTo -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ -// SVN-ID : $Id: INSTALLATION_deDE.txt 2 2017-06-22 07:29:35Z martin $ +// Project : NagiosQL +// Component : Installations HowTo +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// @@ -22,9 +19,9 @@ ==================== * Webserver z.B. Apache 2.x - * MySQL 5.x oder neuer - * Nagios 2.x/3.x oder Nagios kompatible Monitoringsoftware - * PHP 5.2.0 oder groesser, inklusive: + * MySQL/MariaDB 5.x oder neuer + * Nagios 2.x/3.x/4.x oder Nagios kompatible Monitoringsoftware + * PHP 5.5.0 oder groesser, inklusive: * PHP Module: Session * PHP Module: MySQLi * PHP Module: gettext @@ -38,7 +35,7 @@ = Neuinstallation = =================== - 1. Download und entpacken von NagiosQL 3.3 in einem Apache zugaenglichen Verzeichnis. + 1. Download und entpacken von NagiosQL 3.4 in einem Apache zugaenglichen Verzeichnis. 2. Der Installationsassistent wird automatisch durch Eingabe von install/index.php gestartet. 3. Die gewuenschte Sprache auswaehlen (siehe Appendix 2.) 4. Zum Installieren von NagiosQL den Anweisungen folgen. @@ -47,14 +44,14 @@ = AKTUALISIERUNG = ================== - 1. Aktualisierungen von NagiosQL 1.x und 2.x sind leider nicht moeglich, bitte einfach eine neue Installation starten und + 1. Aktualisierungen von NagiosQL 1.x und 2.x sind leider nicht moeglich, bitte einfach eine neue Installation starten und dann die Nagios Konfiguration durch den Import einbinden. 2. Aktualisierungen von NagiosQL 3.x - a. Download und entpacken von NagiosQL 3.3 in ein NEUES Apache zugaenglichen Verzeichnis (DocumentRoot auf neues Verzeichnis + a. Download und entpacken von NagiosQL 3.4 in ein NEUES Apache zugaenglichen Verzeichnis (DocumentRoot auf neues Verzeichnis aendern) - b. Wird dieselbe Apachekonfiguration verwendet (altes NagiosQL Verzeichnis wegkopiert, neues NagiosQL Verzeichnis bekommt + b. Wird dieselbe Apachekonfiguration verwendet (altes NagiosQL Verzeichnis wegkopieren, neues NagiosQL Verzeichnis bekommt denselben Namen), sollte der Apache Demon vor dem Upgrade neu gestartet werden. - c. Verschiebe die alte config/settings.php Datei in das neue NagiosQL 3.3 Verzeichnis config/ + c. Verschiebe die alte config/settings.php Datei in das neue NagiosQL 3.4 Verzeichnis config/ d. Die alte Datenbank manuell sichern (z.Bsp. mit mysqldump) e. Der Installationsassistent wird durch den Aufruf von install/index.php gestartet f. Die gewuenschte Sprache waehlen (siehe auch Appendix 1.) und den Anweisungen folgen @@ -101,7 +98,7 @@ Oeffnen Sie nach erfolgter Installation die Support Seite unter Administration u ================ === Probleme === ================ -Zur Zeit gibt es keine bekannten Probleme. Support erreicht man ueber das Forum (http://www.nagiosql.org/forum.html) oder fuer Programmfehler den Bugtracker (http://dev.nagigosql.org) +Zur Zeit gibt es keine bekannten Probleme. Support erreicht man ueber das Forum (https://sourceforge.net/projects/nagiosql/) oder fuer Programmfehler den Bugtracker (http://dev.nagigosql.org) ================ === APPENDIX === diff --git a/doc/INSTALLATION_enGB.txt b/doc/INSTALLATION_enGB.txt index a2f0bac..0a87d5b 100644 --- a/doc/INSTALLATION_enGB.txt +++ b/doc/INSTALLATION_enGB.txt @@ -4,16 +4,13 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2008-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // -// Project : NagiosQL -// Component: Installation HowTo -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ -// SVN-ID : $Id: INSTALLATION_enGB.txt 2 2017-06-22 07:29:35Z martin $ +// Project : NagiosQL +// Component : Installation HowTo +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// @@ -22,9 +19,9 @@ ================ * Webserver like Apache 2.x - * MySQL 5.x or greater - * Nagios 2.x/3.x or Nagios compatible monitoring software - * PHP 5.2.0 or greater including: + * MySQL/MariaDB 5.x or greater + * Nagios 2.x/3.x/4.x or Nagios compatible monitoring software + * PHP 5.5.0 or greater including: * PHP Module: Session * PHP Module: MySQLi * PHP Module: gettext @@ -38,7 +35,7 @@ NEW INSTALLATION ================ - 1. Download and extract NagiosQL 3.3 to a directory within your Apache Document Root + 1. Download and extract NagiosQL 3.4 to a directory within your Apache Document Root 2. Start the Installation Wizard by opening install/index.php 3. Switch to your preferred language (see Appendix 1.) 4. Follow the instructions to install NagiosQL @@ -47,13 +44,13 @@ NEW INSTALLATION === UPGRADES === ================ - 1. Upgrade from NagiosQL 1.x and 2.x are not possible, you should better start at "New Installation" and after the installation is done, + 1. Upgrade from NagiosQL 1.x and 2.x are not possible, you should better start at "New Installation" and after the installation is done, import Nagios configuration files with NagiosQL - 2. Upgrade from NagiosQL 3.x - a. Download and extract NagiosQL 3.3 to a NEW directory and change your Apache DocumentRoot to the new directory + 2. Upgrade from NagiosQL 3.x + a. Download and extract NagiosQL 3.4 to a NEW directory and change your Apache DocumentRoot to the new directory b. If the same Apache configuration is used (old NagiosQL directory moved away and new NagiosQL directory moved to the old DocumentRoot), you should restart the apache demon before upgrade - b. Move your old config/settings.php file to the new NagiosQL 3.3 config/ folder + b. Move your old config/settings.php file to the new NagiosQL 3.4 config/ folder c. Backup your old NagiosQL database (as example with mysqldump) d. Start the Installation Wizard by opening install/index.php e. Switch to your preferred language (see Appendix) and follow the instructions @@ -101,7 +98,7 @@ After installation - go to administration - support and check your installation. ================ === PROBLEMS === ================ -There are currently no known issues. If you having questions, please visit our forum http://www.nagiosql.org/forum.html. If you probably found a bug, please help us and open a new bug report at http://dev.nagigosql.org +There are currently no known issues. If you having questions, please visit our forum https://sourceforge.net/projects/nagiosql/. If you probably found a bug, please help us and open a new bug report at http://dev.nagigosql.org ================ === APPENDIX === diff --git a/doc/LICENSE b/doc/LICENSE index a847d05..67ed4d3 100644 --- a/doc/LICENSE +++ b/doc/LICENSE @@ -1,36 +1,674 @@ -NagiosQL License - based on BSD License + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 -Copyright (c) 2005-2012, Martin Willisegger -All rights reserved. + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the NagiosQL team - www.nagiosql.org. -4. Neither the name of the NagiosQL team - www.nagiosql.org nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. + Preamble -THIS SOFTWARE IS PROVIDED BY THE NAGIOSQL TEAM AND THE COPYRIGHT HOLDER ''AS IS'' AND ANY -EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE NAGIOSQL TEAM AND THE COPYRIGHT HOLDER BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + The GNU General Public License is a free, copyleft license for +software and other kinds of works. -Additional conditions for NagiosQL + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. -a) Using NagiosQL bundled with commercial products is only allowed with - explicit approval of the copyright holder. -b) Using the code of NagiosQL to build a "fork" is only allowed with - explicit approval of the copyright holder. \ No newline at end of file + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + NagiosQL + Copyright (C) 2018 Martin + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + NagiosQL Copyright (C) 2018 Martin Willisegger + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/doc/LIZENZ b/doc/LIZENZ deleted file mode 100644 index fc0fb6c..0000000 --- a/doc/LIZENZ +++ /dev/null @@ -1,38 +0,0 @@ -Freie Übersetzung der BSD basierenden NagiosQL Lizenz - es gilt die englische Originalversion! - -Copyright (c) 2005-2012, Martin Willisegger - -Alle Rechte vorbehalten. - -Weiterverbreitung und Verwendung in nichtkompilierter oder kompilierter Form, mit oder ohne -Veränderung, sind unter den folgenden Bedingungen zulässig: - - 1. Weiterverbreitete nichtkompilierte Exemplare müssen das obige Copyright, - diese Liste der Bedingungen und den folgenden Haftungsausschluss im Quelltext enthalten. - 2. Weiterverbreitete kompilierte Exemplare müssen das obige Copyright, diese Liste der - Bedingungen und den folgenden Haftungsausschluss in der Dokumentation und/oder anderen - Materialien, die mit dem Exemplar verbreitet werden, enthalten. - 3. Alle Werbematerialien, die Eigenschaften oder die Benutzung erwähnen, müssen die folgende - Bemerkung enthalten: „Dieses Produkt enthält Software, die vom NagiosQL Team - www.nagiosql.org - entwickelt wurde.“ - 4. Weder der Name des vom NagiosQL Team - www.nagiosql.org noch die Namen der Beitragsleistenden - dürfen zum Kennzeichnen oder Bewerben von Produkten, die von dieser Software abgeleitet wurden, - ohne spezielle vorherige schriftliche Genehmigung verwendet werden. - -DIESE SOFTWARE WIRD VOM NAGIOSQL TEAM UND DEM RECHTEINHABER SOWIE DEN BEITRAGSLEISTENDEN OHNE -JEGLICHE SPEZIELLE ODER IMPLIZIERTE GARANTIEN ZUR VERFÜGUNG GESTELLT, DIE UNTER ANDEREM EINSCHLIESSEN: -DIE IMPLIZIERTE GARANTIE DER VERWENDBARKEIT DER SOFTWARE FÜR EINEN BESTIMMTEN ZWECK. AUF KEINEN FALL -IST DAS NAGIOSQL TEAM, DER RECHTEINHABER SOWIE DIE BEITRAGSLEISTENDEN FÜR IRGENDWELCHE DIREKTEN, -INDIREKTEN, ZUFÄLLIGEN, SPEZIELLEN, BEISPIELHAFTEN ODER FOLGESCHÄDEN (UNTER ANDEREM VERSCHAFFEN -VON ERSATZGÜTERN ODER -DIENSTLEISTUNGEN; EINSCHRÄNKUNG DER NUTZUNGSFÄHIGKEIT; VERLUST VON NUTZUNGSFÄHIGKEIT; -DATEN; PROFIT ODER GESCHÄFTSUNTERBRECHUNG), WIE AUCH IMMER VERURSACHT UND UNTER WELCHER VERPFLICHTUNG AUCH -IMMER, OB IN VERTRAG, STRIKTER VERPFLICHTUNG ODER UNERLAUBTER HANDLUNG (INKLUSIVE FAHRLÄSSIGKEIT) -VERANTWORTLICH, AUF WELCHEM WEG SIE AUCH IMMER DURCH DIE BENUTZUNG DIESER SOFTWARE ENTSTANDEN SIND, -SOGAR, WENN SIE AUF DIE MÖGLICHKEIT EINES SOLCHEN SCHADENS HINGEWIESEN WORDEN SIND. - -Zusätzliche Bedingungen zu NagiosQL - - a) Das bündeln von NagiosQL zusammen mit einem kommerziellen Produkt ist nur zulässig - mit ausdrücklicher Genehmigung des Copyright Inhabers. - b) Das Benutzen von Code von NagiosQL mit dem Zweck einen "Fork" zu erstellen ist nur - zulässig mit ausdrücklicher Genehmigung des Copyright Inhabers. \ No newline at end of file diff --git a/doc/README_SSH_KEY b/doc/README_SSH_KEY index f1ce02b..2d4d6df 100644 --- a/doc/README_SSH_KEY +++ b/doc/README_SSH_KEY @@ -8,7 +8,7 @@ Local system 2. Create a path for the ssh keys # mkdir /etc/nagiosql/ssh 2. Create a key pair (only rsa is supported!) -# ssh-keygen -t rsa +# ssh-keygen -t rsa -b 4096 Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): /etc/nagiosql/ssh/id_rsa -> empty passphrase! diff --git a/functions/Autoloader.php b/functions/Autoloader.php new file mode 100644 index 0000000..fb634e8 --- /dev/null +++ b/functions/Autoloader.php @@ -0,0 +1,64 @@ +preBasePath = $strBasePath; + } + + /** + * Load class from path + * @param string $strClassName Class name + */ + public function loadClass($strClassName) + { + $className = ltrim($strClassName, '\\'); + $fileName = ''; + $lastNsPos = strrpos($className, '\\'); + if ($lastNsPos != 0) { + $namespace = substr($className, 0, $lastNsPos); + $className = substr($className, $lastNsPos + 1); + $fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; + } + $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php'; + $strFilePath1 = $this->preBasePath.$fileName; + $strFilePath2 = $this->preBasePath.'install/'.$fileName; + if (file_exists($strFilePath1) && is_readable($strFilePath1)) { + require_once $strFilePath1; + } + if (file_exists($strFilePath2) && is_readable($strFilePath2)) { + require_once $strFilePath2; + } + } +} diff --git a/functions/MysqliDbClass.php b/functions/MysqliDbClass.php new file mode 100644 index 0000000..a941a4b --- /dev/null +++ b/functions/MysqliDbClass.php @@ -0,0 +1,412 @@ + DB server name +// ----------- $arrParams['port'] -> DB server port +// $arrParams['user'] -> DB server username +// $arrParams['password'] -> DB server password +// $arrParams['database'] -> DB server database name +// +/////////////////////////////////////////////////////////////////////////////////////////////// +namespace functions; + +class MysqliDbClass +{ + // Define class variables + public $error = false; // Will be filled in functions + public $strDBId; // Will be filled in functions + public $intLastId = 0; // Will be filled in functions + public $intAffectedRows = 0; // Will be filled in functions + public $strErrorMessage = ''; // Will be filled in functions + public $booSSLuse = false; // Defines if SSL is used or not + public $arrParams = array(); // Must be filled in while initialization + + /** + * MysqliDbClass constructor. + */ + public function __construct() + { + $this->arrParams['server'] = ''; + $this->arrParams['port'] = 0; + $this->arrParams['username'] = ''; + $this->arrParams['password'] = ''; + $this->arrParams['database'] = ''; + } + + /** + * MysqliDbClass destructor. + */ + public function __destruct() + { + $this->dbDisconnect(); + } + + /** + * Opens a connection to the database server and select a database + * @param int $intMode 1 = connect only / 0 = connect + dbselect + * @return bool true = successful / false = error + * Status messages are stored in class variable + */ + public function hasDBConnection($intMode = 0) + { + $booReturn = true; + $this->dbconnect(); + if ($this->error == true) { + $booReturn = false; + } + if (($booReturn == true) && ($intMode == 0)) { + $this->dbselect(); + if ($this->error == true) { + $booReturn = false; + } + } + return $booReturn; + } + + /** + * Sends an SQL statement to the server and returns the result of the first data field + * @param string $strSQL SQL Statement + * @return string = successful / = error + * Status messages are stored in class variable + */ + public function getFieldData($strSQL) + { + // Reset error variables + $this->strErrorMessage = ''; + $this->error = false; + $strReturn = ''; + // Send the SQL statement to the server + $resQuery = mysqli_query($this->strDBId, $strSQL); + // Error processing + if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == '')) { + // Return the field value from position 0/0 + $arrDataset = mysqli_fetch_array($resQuery, MYSQLI_NUM); + $strReturn = $arrDataset[0]; + } elseif (mysqli_error($this->strDBId) != '') { + $this->strErrorMessage .= mysqli_error($this->strDBId). '::'; + $this->error = true; + } + return $strReturn; + } + + /** + * Sends an SQL statement to the server and returns the result of the first data set + * @param string $strSQL SQL Statement + * @param array|null $arrDataset Result array (by reference) + * @return bool true = successful / false = error + * Status messages are stored in class variable + */ + public function hasSingleDataset($strSQL, &$arrDataset) + { + //$arrDataset = array(); + $booReturn = true; + // Reset error variables + $this->strErrorMessage = ''; + $this->error = false; + // Send the SQL statement to the server + $resQuery = mysqli_query($this->strDBId, $strSQL); + // Error processing + if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == '')) { + // Put the values into the array + $arrDataset = mysqli_fetch_array($resQuery, MYSQLI_ASSOC); + } elseif (mysqli_error($this->strDBId) != '') { + $this->strErrorMessage .= mysqli_error($this->strDBId). '::'; + $this->error = true; + $booReturn = false; + } + return $booReturn; + } + + /** + * Sends an SQL statement to the server and returns the result of all dataset in a data array + * @param string $strSQL SQL Statement + * @param array $arrDataset Result array (by reference) + * @param int $intDataCount Number of data result sets + * @return bool true = successful / false = error + * Status messages are stored in class variable + */ + public function hasDataArray($strSQL, &$arrDataset, &$intDataCount) + { + $arrDataset = array(); + $intDataCount = 0; + $booReturn = true; + // Reset error variables + $this->strErrorMessage = ''; + $this->error = false; + // Send the SQL statement to the server + $resQuery = mysqli_query($this->strDBId, $strSQL); + // Error processing + if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == '')) { + $intDataCount = mysqli_num_rows($resQuery); + $intCount = 0; + // Put the values into the array + while ($arrDataTemp = mysqli_fetch_array($resQuery, MYSQLI_ASSOC)) { + foreach ($arrDataTemp as $key => $value) { + $arrDataset[$intCount][$key] = $value; + } + $intCount++; + } + } elseif (mysqli_error($this->strDBId) != '') { + $this->strErrorMessage .= mysqli_error($this->strDBId). '::'; + $this->error = true; + $booReturn = false; + } + return $booReturn; + } + + /** + * Insert/update or delete data + * @param string $strSQL SQL Statement + * @return bool true = successful / false = error + * Status messages are stored in class variable + */ + public function insertData($strSQL) + { + // Reset error variables + $this->strErrorMessage = ''; + $this->error = false; + $booReturn = false; + // Send the SQL statement to the server + if ($strSQL != '') { + mysqli_query($this->strDBId, $strSQL); + // Error processing + if (mysqli_error($this->strDBId) == '') { + $this->intLastId = mysqli_insert_id($this->strDBId); + $this->intAffectedRows = mysqli_affected_rows($this->strDBId); + $booReturn = true; + } else { + $this->strErrorMessage .= mysqli_error($this->strDBId) . '::'; + $this->error = true; + } + } + return $booReturn; + } + + /** + * Count the sum of data records + * @param string $strSQL SQL Statement + * @return int = successful / 0 = no dataset or error + * Status messages are stored in class variable + */ + public function countRows($strSQL) + { + // Reset error variables + $this->strErrorMessage = ''; + $this->error = false; + $intReturn = 0; + // Send the SQL statement to the server + $resQuery = mysqli_query($this->strDBId, $strSQL); + // Error processing + if ($resQuery && (mysqli_error($this->strDBId) == '')) { + $intReturn = mysqli_num_rows($resQuery); + } else { + $this->strErrorMessage .= mysqli_error($this->strDBId); + $this->error = true; + } + return $intReturn; + } + + /** + * Returns a safe insert string for database manipulations + * @param string $strInput Input String + * @return string Output String + */ + public function realEscape($strInput) + { + return mysqli_real_escape_string($this->strDBId, $strInput); + } + + /** + * Initialize a mysql database connection + * @return bool true = successful / false = error + */ + private function dbinit() + { + $this->strDBId = mysqli_init(); + return true; + } + + /** + * Connect to database server + * @param string $dbserver Server name + * @param int $dbport TCP port + * @param string $dbuser Database user + * @param string $dbpasswd Database password + * @return bool true = successful / false = error + * Status messages are stored in class variable + */ + private function dbconnect($dbserver = null, $dbport = null, $dbuser = null, $dbpasswd = null) + { + // Reset error variables + $this->strErrorMessage = ''; + $this->error = false; + $booReturn = true; + // Get parameters + if ($dbserver == null) { + $dbserver = $this->arrParams['server']; + } + if ($dbport == null) { + $dbport = $this->arrParams['port']; + } + if ($dbuser == null) { + $dbuser = $this->arrParams['username']; + } + if ($dbpasswd == null) { + $dbpasswd = $this->arrParams['password']; + } + // Not all parameters available + if (($dbserver == '') || ($dbuser == '') || ($dbpasswd == '')) { + $this->strErrorMessage .= gettext('Missing server connection parameter!'). '::'; + $this->error = true; + $booReturn = false; + } + if ($booReturn == true) { + $this->dbinit(); + //if ($this->booSSLuse == true) { + // TO BE DEFINED + //} + $intErrorReporting = error_reporting(); + error_reporting(0); + if ($dbport == 0) { + $booReturn = mysqli_real_connect($this->strDBId, $dbserver, $dbuser, $dbpasswd); + } else { + $booReturn = mysqli_real_connect($this->strDBId, $dbserver, $dbuser, $dbpasswd, null, $dbport); + } + error_reporting($intErrorReporting); + // Connection fails + if ($booReturn == false) { + $this->strErrorMessage = '[' .$dbserver. '] ' .gettext('Connection to the database server has failed ' + . 'by reason:'). ' ::'; + $strError = mysqli_connect_error(); + $this->strErrorMessage .= $strError. '::'; + $this->error = true; + } + } + return $booReturn; + } + + /** + * Select a database + * @param string $database Database name + * @return bool true = successful / false = error + * Status messages are stored in class variable + */ + private function dbselect($database = null) + { + // Reset error variables + $this->strErrorMessage = ''; + $this->error = false; + $booReturn = true; + // Get parameters + if ($database == null) { + $database = $this->arrParams['database']; + } + // Not all parameters available + if ($database == '') { + $this->strErrorMessage .= gettext('Missing database connection parameter!'). '::'; + $this->error = true; + $booReturn = false; + } + if ($booReturn == true) { + $bolConnect = mysqli_select_db($this->strDBId, $database); + // Session cannot be etablished + if (!$bolConnect) { + $this->strErrorMessage .= '[' .$database. '] ' . + gettext('Connection to the database has failed by reason:'). ' ::'; + $this->strErrorMessage .= mysqli_error($this->strDBId). '::'; + $this->error = true; + $booReturn = false; + } + } + if ($booReturn == true) { + mysqli_query($this->strDBId, "set names 'utf8'"); + if (mysqli_error($this->strDBId) != '') { + $this->strErrorMessage .= mysqli_error($this->strDBId). '::'; + $this->error = true; + $booReturn = false; + } + } + if ($booReturn == true) { + mysqli_query($this->strDBId, "set session sql_mode = 'NO_ENGINE_SUBSTITUTION'"); + if (mysqli_error($this->strDBId) != '') { + $this->strErrorMessage .= mysqli_error($this->strDBId). '::'; + $this->error = true; + $booReturn = false; + } + } + return $booReturn; + } + + /* + /** + * Set SSL connection parameters + * @param string $sslkey SSL key + * @param string $sslcert SSL certificate + * @param string $sslca SSL CA file (optional) + * @param string $sslpath SSL certificate path (optional) + * @param string $sslcypher SSL cypher (optional) + * @return bool true = successful + * Status messages are stored in class variable + */ + /* + private function dbsetssl($sslkey, $sslcert, $sslca = null, $sslpath = null, $sslcypher = null) + { + // Reset error variables + $this->strErrorMessage = ""; + $this->error = false; + $booReturn = true; + // Values are missing + if (($sslkey == "") || ($sslcert == "")) { + $this->strErrorMessage = gettext("Missing MySQL SSL parameter!")."::"; + $this->error = true; + $booReturn = false; + } + if ($booReturn == true) { + mysqli_ssl_set($this->strDBId, $sslkey, $sslcert, $sslca, $sslpath, $sslcypher); + } + return($booReturn); + } + */ + + /** + * Close database server connectuon + * @return bool true = successful / false = error + */ + private function dbDisconnect() + { + mysqli_close($this->strDBId); + return true; + } +} diff --git a/functions/NagConfigClass.php b/functions/NagConfigClass.php new file mode 100644 index 0000000..b9b5d92 --- /dev/null +++ b/functions/NagConfigClass.php @@ -0,0 +1,2448 @@ +arrSettings = $arrSession['SETS']; + } + if (isset($arrSession['domain'])) { + $this->intDomainId = $arrSession['domain']; + } + $this->arrSession = $arrSession; + } + + /** + * Get domain configuration parameters. + * @param string $strConfigItem Configuration key + * @param string $strValue Configuration value (by reference) + * @return int 0 = successful / 1 = error + */ + public function getDomainData($strConfigItem, &$strValue) + { + // Variable definition + $intReturn = 0; + // Request domain data from database + $strSQL = 'SELECT `' .$strConfigItem. '` FROM `tbl_datadomain` WHERE `id` = ' .$this->intDomainId; + $strValue = $this->myDBClass->getFieldData($strSQL); + if ($strValue == '') { + $intReturn = 1; + } + return $intReturn; + } + + /** + * Get last modification date of a database table and any configuration files inside a directory. + * @param string $strTableName Name of the database table + * @param string $strConfigName Name of the configuration file + * @param int $intDataId ID of the dataset for service table + * @param array $arrTimeData Array with the timestamps of the files and the DB table (by reference) + * @param int $intTimeInfo Time status value (by reference) + * 0 = all files are newer than the database item + * 1 = some file are older than the database item + * 2 = one file is missing + * 3 = any files are missing + * 4 = no configuration targets defined + * @return int 0 = successful / 1 = error + * Status messages are stored in class variables + */ + public function lastModifiedDir($strTableName, $strConfigName, $intDataId, &$arrTimeData, &$intTimeInfo) + { + // Variable definitions + $intReturn = 0; + // Create file name + $strFileName = $strConfigName. '.cfg'; + // Get table times + $strActive = 0; + $arrTimeData = array(); + $arrTimeData['table'] = 'unknown'; + // Clear status cache + clearstatcache(); + // Get last change on dataset + if ($strTableName == 'tbl_host') { + $strSQL1 = "SELECT DATE_FORMAT(`last_modified`,'%Y-%m-%d %H:%i:%s') FROM `tbl_host` ". + "WHERE `host_name`='$strConfigName' AND `config_id`=".$this->intDomainId; + $strSQL2 = "SELECT `active` FROM `tbl_host` WHERE `host_name`='$strConfigName' ". + 'AND `config_id`=' .$this->intDomainId; + $arrTimeData['table'] = $this->myDBClass->getFieldData($strSQL1); + $strActive = $this->myDBClass->getFieldData($strSQL2); + } elseif ($strTableName == 'tbl_service') { + $strSQL1 = "SELECT DATE_FORMAT(`last_modified`,'%Y-%m-%d %H:%i:%s') FROM `tbl_service` ". + "WHERE `id`='$intDataId' AND `config_id`=".$this->intDomainId; + $strSQL2 = "SELECT * FROM `$strTableName` WHERE `config_name`='$strConfigName' ". + 'AND `config_id`=' .$this->intDomainId." AND `active`='1'"; + $arrTimeData['table'] = $this->myDBClass->getFieldData($strSQL1); + $intServiceCount = $this->myDBClass->countRows($strSQL2); + if ($intServiceCount != 0) { + $strActive = 1; + } + } else { + $intReturn = 1; + } + // Get config sets + $arrConfigId = array(); + $strTarget = ''; + $strBaseDir = ''; + $intTimeInfo = -1; + $intRetVal2 = $this->getConfigTargets($arrConfigId); + if ($intRetVal2 == 0) { + foreach ($arrConfigId as $intConfigId) { + // Get configuration file data + $this->getConfigValues($intConfigId, 'target', $strTarget); + // Get last change on dataset + if ($strTableName == 'tbl_host') { + $this->getConfigValues($intConfigId, 'hostconfig', $strBaseDir); + } elseif ($strTableName == 'tbl_service') { + $this->getConfigValues($intConfigId, 'serviceconfig', $strBaseDir); + } + $arrTimeData[$strTarget] = 'unknown'; + $intFileStampTemp = -1; + // Get time data + $intReturn = $this->getFileDate( + $intConfigId, + $strFileName, + $strBaseDir, + $intFileStampTemp, + $arrTimeData[$strTarget] + ); + if (($intFileStampTemp == 0) && ($strActive == '1')) { + $intTimeInfo = 2; + } + if (($strActive == '1') && (strtotime($arrTimeData['table']) > $intFileStampTemp)) { + $intTimeInfo = 1; + } + } + $intItems = \count($arrTimeData) - 1; + $intUnknown = 0; + $intUpToDate = 0; + foreach ($arrTimeData as $key) { + if ($key == 'unknown') { + $intUnknown++; + } + if (strtotime($arrTimeData['table']) < strtotime($key)) { + $intUpToDate++; + } + } + if ($intUnknown == $intItems) { + $intTimeInfo = 3; + } + if ($intUpToDate == $intItems) { + $intTimeInfo = 0; + } + } else { + $intTimeInfo = 4; + } + return $intReturn; + } + + /** + * Get configuration target IDs + * @param array $arrConfigId Configuration target IDs (by reference) + * @return int 0 = successful / 1 = error + */ + public function getConfigTargets(&$arrConfigId) + { + // Variable definition + $arrData = array(); + $arrConfigId = array(); + $intDataCount = 0; + $intReturn = 1; + // Request target ID + $strSQL = 'SELECT `targets` FROM `tbl_datadomain` WHERE `id`=' .$this->intDomainId; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrData as $elem) { + $arrConfigId[] = $elem['targets']; + } + $intReturn = 0; + } + return $intReturn; + } + + /** + * Get configuration domain values + * @param int $intConfigId Configuration ID + * @param string $strConfigKey Configuration key + * @param string $strValue Configuration value (by reference) + * @return int 0 = successful / 1 = error + */ + public function getConfigValues($intConfigId, $strConfigKey, &$strValue) + { + // Define variables + $intReturn = 1; + // Read database + $strSQL = 'SELECT `' .$strConfigKey. '` FROM `tbl_configtarget` WHERE `id`=' .$intConfigId; + $strValue = $this->myDBClass->getFieldData($strSQL); + if ($strValue != '') { + $intReturn = 0; + } + return $intReturn; + } + + /** + * Get last modification date of a configuration file. + * @param int $intConfigId Configuration ID + * @param string $strFile Configuration file name + * @param string $strBaseDir Base directory with configuration file + * @param int|bool $intFileStamp File timestamp (by reference) + * @param string $strTimeData Human readable string of file time stamp (by reference) + * @return int 0 = successful / 1 = error + */ + public function getFileDate($intConfigId, $strFile, $strBaseDir, &$intFileStamp, &$strTimeData) + { + $strMethod = 1; + $intReturn = 0; + // Get configuration file data + $this->getConfigValues($intConfigId, 'method', $strMethod); + $strTimeData = 'unknown'; + $intFileStamp = -1; + // Lokal file system + if (($strMethod == 1) && file_exists($strBaseDir. '/' .$strFile)) { + $intFileStamp = filemtime($strBaseDir. '/' .$strFile); + $strTimeData = date('Y-m-d H:i:s', $intFileStamp); + } elseif ($strMethod == 2) { // FTP file system + // Check connection + $intReturn = $this->getFTPConnection($intConfigId); + if ($intReturn == 0) { + $intFileStamp = ftp_mdtm($this->resConnectId, $strBaseDir . '/' . $strFile); + if ($intFileStamp != -1) { + $strTimeData = date('Y-m-d H:i:s', $intFileStamp); + } + } + } elseif ($strMethod == 3) { // SSH file system + // Check connection + $intReturn = $this->getSSHConnection($intConfigId); + // Check file date + $strFilePath = str_replace('//', '/', $strBaseDir.'/'.$strFile); + $strCommand = 'ls '.$strFilePath; + $arrResult = array(); + if (($intReturn == 0) && ($this->sendSSHCommand($strCommand, $arrResult) == 0) && + isset($arrResult[0]) && ($arrResult[0] == $strFilePath)) { + $arrInfo = ssh2_sftp_stat($this->resSFTP, $strFilePath); + $intFileStamp = $arrInfo['mtime']; + if ($intFileStamp != -1) { + $strTimeData = date('Y-m-d H:i:s', $intFileStamp); + } + } + } + return $intReturn; + } + + /** + * Open an FTP connection + * @param int $intConfigID Configuration ID + * @return int 0 = successful / 1 = error + * Status messages are stored in class variables + */ + public function getFTPConnection($intConfigID) + { + // Define variables + $intReturn = 0; + $arrError = array(); + // Already connected? + if (empty($this->resConnectId) || !\is_resource($this->resConnectId) || ($this->resConnectType != 'FTP')) { + // Define variables + $booLogin = false; + $this->getConfigValues($intConfigID, 'server', $strServer); + $this->getConfigValues($intConfigID, 'ftp_secure', $intFtpSecure); + // Set up basic connection + $this->resConnectServer = $strServer; + $this->resConnectType = 'FTP'; + // Secure FTP? + if ($intFtpSecure == 1) { + $this->resConnectId = ftp_ssl_connect($strServer); + } else { + $this->resConnectId = ftp_connect($strServer); + } + // Login with username and password + if ($this->resConnectId) { + $this->getConfigValues($intConfigID, 'user', $strUser); + $this->getConfigValues($intConfigID, 'password', $strPasswd); + $intErrorReporting = error_reporting(); + error_reporting('0'); + $booLogin = ftp_login($this->resConnectId, $strUser, $strPasswd); + $arrError = error_get_last(); + error_reporting($intErrorReporting); + if ($booLogin == false) { + ftp_close($this->resConnectId); + $this->resConnectServer = ''; + $this->resConnectType = 'none'; + $this->resConnectId = null; + $intReturn = 1; + } else { + // Change to PASV mode + ftp_pasv($this->resConnectId, true); + } + } + // Check connection + if ((!$this->resConnectId) || (!$booLogin)) { + $this->myDataClass->writeLog(translate('Connection to remote system failed (FTP connection):') . + ' ' . $strServer); + $this->processClassMessage(translate('Connection to remote system failed (FTP connection):') . + ' ' . $strServer . '::', $this->strErrorMessage); + if ($arrError !== null && ($arrError['message'] != '')) { + $this->processClassMessage($arrError['message'] . '::', $this->strErrorMessage); + } + } + } + return $intReturn; + } + + /** + * Open an SSH connection + * @param int $intConfigID Configuration ID + * @return int 0 = successful / 1 = error + * Status messages are stored in class variables + */ + public function getSSHConnection($intConfigID) + { + // Define variables + $intReturn = 0; + $strPasswordNote = ''; + // Already connected? + if (empty($this->resConnectId) || !\is_resource($this->resConnectId) || ($this->resConnectType != 'SSH')) { + // SSH Possible + if (!\function_exists('ssh2_connect')) { + $this->processClassMessage(translate('SSH module not loaded!'). '::', $this->strErrorMessage); + return 1; + } + // Define variables + $booLogin = false; + $this->getConfigValues($intConfigID, 'server', $strServer); + $this->resConnectServer = $strServer; + $this->resConnectType = 'SSH'; + $intErrorReporting = error_reporting(); + error_reporting(0); + $this->resConnectId = ssh2_connect($strServer); + $arrError = error_get_last(); + error_reporting($intErrorReporting); + // Check connection + if ($this->resConnectId) { + // Login with username and password + $this->getConfigValues($intConfigID, 'user', $strUser); + $this->getConfigValues($intConfigID, 'password', $strPasswd); + $this->getConfigValues($intConfigID, 'ssh_key_path', $strSSHKeyPath); + if ($strSSHKeyPath != '') { + $strPublicKey = str_replace('//', '/', $strSSHKeyPath.'/id_rsa.pub'); + $strPrivatKey = str_replace('//', '/', $strSSHKeyPath.'/id_rsa'); + // Check if ssh key file are readable + if (!file_exists($strPublicKey) || !is_readable($strPublicKey)) { + $this->myDataClass->writeLog(translate('SSH public key does not exist or is not readable') + . ' ' . $strSSHKeyPath.$strPublicKey); + $this->processClassMessage(translate('SSH public key does not exist or is not readable') + . ' ' . $strSSHKeyPath.$strPublicKey. '::', $this->strErrorMessage); + $intReturn = 1; + } + if (!file_exists($strPrivatKey) || !is_readable($strPrivatKey)) { + $this->myDataClass->writeLog(translate('SSH private key does not exist or is not readable') + . ' ' . $strPrivatKey); + $this->processClassMessage(translate('SSH private key does not exist or is not readable'). ' ' . + $strPrivatKey. '::', $this->strErrorMessage); + $intReturn = 1; + } + $intErrorReporting = error_reporting(); + error_reporting(0); + if ($strPasswd == '') { + $booLogin = ssh2_auth_pubkey_file( + $this->resConnectId, + $strUser, + $strSSHKeyPath. '/id_rsa.pub', + $strSSHKeyPath. '/id_rsa' + ); + } else { + $booLogin = ssh2_auth_pubkey_file( + $this->resConnectId, + $strUser, + $strSSHKeyPath. '/id_rsa.pub', + $strSSHKeyPath. '/id_rsa', + $strPasswd + ); + } + $arrError = error_get_last(); + error_reporting($intErrorReporting); + } else { + $intErrorReporting = error_reporting(); + error_reporting(0); + $booLogin = ssh2_auth_password($this->resConnectId, $strUser, $strPasswd); + $arrError = error_get_last(); + $strPasswordNote = 'If you are using ssh2 with user/password - you have to enable ' . + 'PasswordAuthentication in your sshd_config'; + error_reporting($intErrorReporting); + } + } else { + $this->myDataClass->writeLog(translate('Connection to remote system failed (SSH2 connection):'). + ' ' .$strServer); + $this->processClassMessage(translate('Connection to remote system failed (SSH2 connection):'). + ' ' .$strServer. '::', $this->strErrorMessage); + if ($arrError['message'] != '') { + $this->processClassMessage($arrError['message']. '::', $this->strErrorMessage); + } + $intReturn = 1; + } + // Check connection + if ((!$this->resConnectId) || (!$booLogin)) { + $this->myDataClass->writeLog(translate('Connection to remote system failed (SSH2 connection):'). + ' ' .$strServer); + $this->processClassMessage(translate('Connection to remote system failed (SSH2 connection):') + . ' ' .$strServer. '::', $this->strErrorMessage); + if ($arrError['message'] != '') { + $this->processClassMessage($arrError['message']. '::', $this->strErrorMessage); + } + if ($strPasswordNote !== null) { + $this->processClassMessage($strPasswordNote. '::', $this->strErrorMessage); + } + $this->resConnectServer = ''; + $this->resConnectType = 'none'; + $this->resConnectId = null; + $intReturn = 1; + } else { + // Etablish an SFTP connection ressource + $this->resSFTP = ssh2_sftp($this->resConnectId); + } + } + return $intReturn; + } + + /** + * Sends a command via SSH and stores the result in an array + * @param string $strCommand Command string + * @param array $arrResult Output as array (by reference) + * @param int $intLines Maximal length of output to read + * @return int 0 = successful / 1 = error + */ + public function sendSSHCommand($strCommand, &$arrResult, $intLines = 100) + { + // Define variables + $intCount1 = 0; // empty lines + $intCount2 = 0; // data lines + $booBreak = false; + $this->getConfigTargets($arrConfigSet); + // Check connection + $intReturn = $this->getSSHConnection($arrConfigSet[0]); + if (\is_resource($this->resConnectId)) { + // Send command + $resStream = ssh2_exec($this->resConnectId, $strCommand.'; echo __END__'); + if ($resStream) { + // read result + stream_set_blocking($resStream, true); + stream_set_timeout($resStream, 2); + do { + $strLine = stream_get_line($resStream, 1024, "\n"); + if ($strLine == '') { + $intCount1++; + } elseif (substr_count($strLine, '__END__') != 1) { + $arrResult[] = $strLine; + $intReturn = 0; + } elseif (substr_count($strLine, '__END__') == 1) { + $booBreak = true; + } + $intCount2++; + $arrStatus = stream_get_meta_data($resStream); + } while ($resStream && !feof($resStream) && ($intCount1 <= 10) && ($intCount2 <= $intLines) && + ($arrStatus['timed_out'] != true) && $booBreak == false); + fclose($resStream); + // Close SSH connection because of timing problems + unset($this->resConnectId); + //sleep(1); + } + } + return $intReturn; + } + + /** + * Merge message strings and check for duplicate messages + * @param string $strNewMessage New message to add + * @param string $strOldMessage Modified message string (by reference) + */ + public function processClassMessage($strNewMessage, &$strOldMessage) + { + $strNewMessage = str_replace('::::', '::', $strNewMessage); + if (($strOldMessage != '') && ($strNewMessage != '') && (substr_count($strOldMessage, $strNewMessage) == 0)) { + $strOldMessage .= $strNewMessage; + } elseif ($strOldMessage == '') { + $strOldMessage .= $strNewMessage; + } + } + + /** + * Get configuration target IDs + * @param array $arrConfigId Configuration target IDs (by reference) + * @return int 0 = successful / 1 = error + */ + public function getConfigSets(&$arrConfigId) + { + // Variable definition + $arrData = array(); + $arrConfigId = array(); + $intDataCount = 0; + $intReturn = 1; + // Request target ID + $strSQL = 'SELECT `targets` FROM `tbl_datadomain` WHERE `id`=' .$this->intDomainId; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrData as $elem) { + $arrConfigId[] = $elem['targets']; + } + $intReturn = 0; + } + return $intReturn; + } + + /** + * Moves an existing configuration file to the backup directory and removes then the original file + * @param string $strType Type of the configuration file + * @param string $strName Name of the configuration file + * @param int $intConfigID Configuration target ID + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function moveFile($strType, $strName, $intConfigID) + { + // Variable definitions + $strConfigDir = ''; + $strBackupDir = ''; + $intReturn = 0; + // Get directories + switch ($strType) { + case 'host': + $this->getConfigData($intConfigID, 'hostconfig', $strConfigDir); + $this->getConfigData($intConfigID, 'hostbackup', $strBackupDir); + break; + case 'service': + $this->getConfigData($intConfigID, 'serviceconfig', $strConfigDir); + $this->getConfigData($intConfigID, 'servicebackup', $strBackupDir); + break; + case 'basic': + $this->getConfigData($intConfigID, 'basedir', $strConfigDir); + $this->getConfigData($intConfigID, 'backupdir', $strBackupDir); + break; + case 'nagiosbasic': + $this->getConfigData($intConfigID, 'nagiosbasedir', $strConfigDir); + $this->getConfigData($intConfigID, 'backupdir', $strBackupDir); + break; + default: + $intReturn = 1; + } + if ($intReturn == 0) { + // Variable definition + $intMethod = 1; + $strDate = date('YmdHis'); + $strSourceFile = $strConfigDir. '/' .$strName; + $strDestinationFile = $strBackupDir. '/' .$strName. '_old_' .$strDate; + $booRetVal = false; + // Get connection method + $this->getConfigData($intConfigID, 'method', $intMethod); + // Local file system + if ($intMethod == 1) { + // Save configuration file + if (file_exists($strSourceFile)) { + if (is_writable($strBackupDir) && is_writable($strConfigDir)) { + copy($strSourceFile, $strDestinationFile); + unlink($strSourceFile); + } else { + $this->processClassMessage(translate('Cannot backup the old file because the permissions are ' + .'wrong - destination file: ').$strDestinationFile. '::', $this->strErrorMessage); + $intReturn = 1; + } + } else { + $this->processClassMessage(translate('Cannot backup the old file because the source file is ' + . 'missing - source file: ') . $strSourceFile . '::', $this->strErrorMessage); + $intReturn = 1; + } + } elseif ($intMethod == 2) { // Remote file (FTP) + // Check connection + $intReturn = $this->getFTPConnection($intConfigID); + if ($intReturn == 0) { + $strSourceFile = str_replace('//', '/', $strSourceFile); + $strDestinationFile = str_replace('//', '/', $strDestinationFile); + // Save configuration file + $intFileStamp = ftp_mdtm($this->resConnectId, $strSourceFile); + if ($intFileStamp > -1) { + $intErrorReporting = error_reporting(); + error_reporting(0); + $booRetVal = ftp_rename($this->resConnectId, $strSourceFile, $strDestinationFile); + error_reporting($intErrorReporting); + } else { + $this->processClassMessage(translate('Cannot backup the old file because the source file is ' + .'missing (remote FTP) - source file: '). $strSourceFile. '::', $this->strErrorMessage); + $intReturn = 1; + } + } + if (($booRetVal == false) && ($intReturn == 0)) { + $this->processClassMessage(translate('Cannot backup the old file because the permissions are ' + .'wrong (remote FTP) - destination file: ').$strDestinationFile. '::', $this->strErrorMessage); + $intReturn = 1; + } + } elseif ($intMethod == 3) { // Remote file (SFTP) + // Check connection + $intReturn = $this->getSSHConnection($intConfigID); + // Save configuration file + $arrResult = array(); + $strSourceFile = str_replace('//', '/', $strSourceFile); + $strDestinationFile = str_replace('//', '/', $strDestinationFile); + $strCommand = 'ls '.$strSourceFile; + if (($intReturn == 0) && ($this->sendSSHCommand($strCommand, $arrResult) == 0)) { + if (isset($arrResult[0]) && $arrResult[0] == $strSourceFile) { + $arrInfo = ssh2_sftp_stat($this->resSFTP, $strSourceFile); + if ($arrInfo['mtime'] > -1) { + $booRetVal = ssh2_sftp_rename($this->resSFTP, $strSourceFile, $strDestinationFile); + } + } else { + $this->processClassMessage(translate('Cannot backup the old file because the source file is ' + .'missing (remote SFTP) - source file: '). $strSourceFile. '::', $this->strErrorMessage); + $intReturn = 1; + } + } + if (($booRetVal == false) && ($intReturn == 0)) { + $this->processClassMessage(translate('Cannot backup the old file because the permissions are ' + .'wrong (remote SFTP) - destination file: ').$strDestinationFile. '::', $this->strErrorMessage); + $intReturn = 1; + } + } + } + return $intReturn; + } + + /** + * Remove a file + * @param string $strFileName Filename including path to remove + * @param int $intConfigID Configuration target ID + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function removeFile($strFileName, $intConfigID) + { + // Variable definitions + $intMethod = 1; + $intReturn = 0; + $booRetVal = false; + // Get connection method + $this->getConfigData($intConfigID, 'method', $intMethod); + // Local file system + if ($intMethod == 1) { + // Save configuration file + if (file_exists($strFileName)) { + if (is_writable($strFileName)) { + unlink($strFileName); + } else { + $this->processClassMessage(translate('Cannot delete the file (wrong permissions)!').'::'. + $strFileName. '::', $this->strErrorMessage); + $intReturn = 1; + } + } else { + $this->processClassMessage(translate('Cannot delete the file (file does not exist)!').'::'. + $strFileName. '::', $this->strErrorMessage); + $intReturn = 1; + } + } elseif ($intMethod == 2) { // Remote file (FTP) + // Check connection + $intReturn = $this->getFTPConnection($intConfigID); + if ($intReturn == 0) { + // Save configuration file + $intFileStamp = ftp_mdtm($this->resConnectId, $strFileName); + if ($intFileStamp > -1) { + $intErrorReporting = error_reporting(); + error_reporting(0); + $booRetVal = ftp_delete($this->resConnectId, $strFileName); + error_reporting($intErrorReporting); + } else { + $this->processClassMessage(translate('Cannot delete file because it does not exists (remote ' + . 'FTP)!'). '::', $this->strErrorMessage); + $intReturn = 1; + } + } + if ($booRetVal == false) { + $this->processClassMessage(translate('Cannot delete file because the permissions are incorrect ' + . '(remote FTP)!'). '::', $this->strErrorMessage); + $intReturn = 1; + } + } elseif ($intMethod == 3) { // Remote file (SFTP) + // Check connection + $intReturn = $this->getSSHConnection($intConfigID); + // Save configuration file + if (($intReturn == 0) && ($this->sendSSHCommand('ls '.$strFileName, $arrResult) == 0)) { + if (isset($arrResult[0])) { + $booRetVal = ssh2_sftp_unlink($this->resSFTP, $strFileName); + } else { + $this->processClassMessage(translate('Cannot delete file because it does not exists (remote ' + . 'SSH/SFTP)!'). '::', $this->strErrorMessage); + $intReturn = 1; + } + } + if (($intReturn == 0) && ($booRetVal == false)) { + $this->processClassMessage(translate('Cannot delete file because the permissions are incorrect ' + . '(remote SSH/SFTP)!'). '::', $this->strErrorMessage); + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * Get configuration domain parameters + * @param int $intConfigId Configuration ID + * @param string $strConfigItem Configuration key + * @param string $strValue Configuration value (by reference) + * @return int 0 = successful / 1 = error + */ + public function getConfigData($intConfigId, $strConfigItem, &$strValue) + { + $intReturn = 1; + $strSQL = 'SELECT `' .$strConfigItem. '` FROM `tbl_configtarget` WHERE `id` = ' .$intConfigId; + $strValue = $this->myDBClass->getFieldData($strSQL); + if ($strValue != '') { + $intReturn = 0; + } + return $intReturn; + } + + /** + * Check a directory for write access + * @param string $strPath Physical path + * @return int 0 = successful / 1 = error + */ + public function isDirWriteable($strPath) + { + // Define variables + $intReturnFile = 1; + $intReturnDir = 1; + $intReturn = 1; + // Is input path a file? + if (file_exists($strPath) && is_file($strPath)) { + $resFile = fopen($strPath, 'ab'); + if ($resFile) { + $intReturnFile = 0; + } + } else { + $intReturnFile = 0; + } + if (is_file($strPath)) { + $strDirectory = \dirname($strPath); + } else { + $strDirectory = $strPath; + } + $strFile = $strDirectory.'/'.uniqid(mt_rand(), true).'.tmp'; + // Check writing in directory directly + if (is_dir($strDirectory) && is_writable($strDirectory)) { + $resFile = fopen($strFile, 'wb'); + if ($resFile) { + $intReturnDir = 0; + unlink($strFile); + } + } else { + $intReturnDir = 0; + } + if (($intReturnDir == 0) && ($intReturnFile == 0)) { + $intReturn = 0; + } + return $intReturn; + } + + /** + * Copy a remote file + * @param string $strFileRemote Remote file name + * @param int $intConfigID Configuration target id + * @param string $strFileLocal Local file name + * @param int $intDirection 0 = from remote to local / 1 = from local to remote + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function remoteFileCopy($strFileRemote, $intConfigID, $strFileLocal, $intDirection = 0) + { + // Variable definitions + $intMethod = 3; + $intReturn = 0; + $arrTemp = array(); + // Get method + $this->getConfigData($intConfigID, 'method', $intMethod); + if ($intMethod == 2) { + // Check connection + $intReturn = $this->getFTPConnection($intConfigID); + if (($intReturn == 0) && ($intDirection == 0)) { + $intErrorReporting = error_reporting(); + error_reporting(0); + if (!ftp_get($this->resConnectId, $strFileLocal, $strFileRemote, FTP_ASCII)) { + $this->processClassMessage(translate('Cannot get the remote file (it does not exist or is not ' + . 'readable) - remote file: '). $strFileRemote. '::', $this->strErrorMessage); + $intReturn = 1; + } + error_reporting($intErrorReporting); + } elseif (($intReturn == 0) && ($intDirection == 1)) { + $intErrorReporting = error_reporting(); + error_reporting(0); + if (!ftp_put($this->resConnectId, $strFileRemote, $strFileLocal, FTP_ASCII)) { + $this->processClassMessage(translate('Cannot write the remote file (remote file is not writeable)' + . '- remote file: ').$strFileRemote. '::', $this->strErrorMessage); + $intReturn = 1; + } + error_reporting($intErrorReporting); + } + ftp_close($this->resConnectId); + } elseif ($intMethod == 3) { // Remote file (SFTP) + $intReturn = $this->getSSHConnection($intConfigID); + if (($intReturn == 0) && ($intDirection == 0)) { + // Copy file + $intErrorReporting = error_reporting(); + error_reporting(0); + if (!ssh2_scp_recv($this->resConnectId, $strFileRemote, $strFileLocal)) { + if ($this->sendSSHCommand('ls ' . $strFileRemote, $arrTemp) != 0) { + $this->processClassMessage(translate('Cannot get the remote file (it does not exist or is not ' + . 'readable) - remote file: ') .$strFileRemote. '::', $this->strErrorMessage); + } else { + $this->processClassMessage(translate('Remote file is not readable - remote file: ') + . $strFileRemote. '::', $this->strErrorMessage); + } + $intReturn = 1; + } + error_reporting($intErrorReporting); + } elseif (($intReturn == 0) && ($intDirection == 1)) { + if (file_exists($strFileLocal) && is_readable($strFileLocal)) { + $intErrorReporting = error_reporting(); + error_reporting(0); + if (!ssh2_scp_send($this->resConnectId, $strFileLocal, $strFileRemote, 0644)) { + $this->processClassMessage(translate('Cannot write a remote file (remote file is not writeable)' + .' - remote file: '). $strFileRemote . '::', $this->strErrorMessage); + $intReturn = 1; + } + error_reporting($intErrorReporting); + } else { + $this->processClassMessage(translate('Cannot copy a local file to remote because the local file '. + 'does not exist or is not readable - local file: '). + $strFileLocal . '::', $this->strErrorMessage); + $intReturn = 1; + } + } + } + return $intReturn; + } + + /** + * Add files of a given directory to an array + * @param string $strSourceDir Source directory + * @param string $strIncPattern Include file pattern + * @param string $strExcPattern Exclude file pattern + * @param array $arrOutput Output array (by reference) + * @param string $strErrorMessage Error messages (by reference) + */ + public function storeDirToArray($strSourceDir, $strIncPattern, $strExcPattern, &$arrOutput, &$strErrorMessage) + { + // Define variables + $arrDir = array(); + while (substr($strSourceDir, -1) == '/' or substr($strSourceDir, -1) == "\\") { + $strSourceDir = substr($strSourceDir, 0, -1); + } + $resHandle = opendir($strSourceDir); + if ($resHandle === false) { + if ($this->intDomainId != 0) { + $strErrorMessage .= translate('Could not open directory'). ': ' .$strSourceDir; + } + } else { + $booBreak = true; + while ($booBreak) { + if (!$arrDir[] = readdir($resHandle)) { + $booBreak = false; + } + } + closedir($resHandle); + sort($arrDir); + /** @var string $file */ + foreach ($arrDir as $file) { + /** @noinspection StrlenInEmptyStringCheckContextInspection */ + if (!preg_match("/^\.{1,2}/", $file) && \strlen($file)) { + if (is_dir($strSourceDir. '/' .$file)) { + $this->storeDirToArray( + $strSourceDir. '/' .$file, + $strIncPattern, + $strExcPattern, + $arrOutput, + $strErrorMessage + ); + } else { + if (preg_match('/' .$strIncPattern. '/', $file) && (($strExcPattern == '') || + !preg_match('/' .$strExcPattern. '/', $file))) { + if (0 === stripos(PHP_OS, 'WIN')) { + $strSourceDir=str_replace('/', "\\", $strSourceDir); + $arrOutput [] = $strSourceDir."\\".$file; + } else { + $arrOutput [] = $strSourceDir. '/' .$file; + } + } + } + } + } + } + } + + /** + * Determines the dates of the last data table change and the last modification to the configuration files + * @param string $strTableName Name of the data table + * @param array $arrTimeData Array with time data of table and all config files + * @param string $strCheckConfig Information string (text message) + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function lastModifiedFile($strTableName, &$arrTimeData, &$strCheckConfig) + { + // Variable definitions + $intEnableCommon = 0; + $arrDataset = array(); + $strFileName = ''; + $strCheckConfig = ''; + $intReturn = 0; + // Get configuration filename based on table name + $arrConfigData = $this->getConfData(); + if (isset($arrConfigData[$strTableName])) { + $strFileName = $arrConfigData[$strTableName]['filename']; + } else { + $intReturn = 1; + } + // Get table times + $arrTimeData = array(); + $arrTimeData['table'] = 'unknown'; + // Clear status cache + clearstatcache(); + $intRetVal1 = $this->getDomainData('enable_common', $intEnableCommon); + // Get last change of date table + if ($intRetVal1 == 0) { + $strSQLAdd = ''; + if ($intEnableCommon == 1) { + $strSQLAdd = 'OR `domainId`=0'; + } + $strSQL = 'SELECT `updateTime` FROM `tbl_tablestatus` ' + . 'WHERE (`domainId`=' .$this->intDomainId." $strSQLAdd) AND `tableName`='".$strTableName."' " + . 'ORDER BY `updateTime` DESC LIMIT 1'; + $booReturn = $this->myDBClass->hasSingleDataset($strSQL, $arrDataset); + if ($booReturn && isset($arrDataset['updateTime'])) { + $arrTimeData['table'] = $arrDataset['updateTime']; + } else { + $strSQL = 'SELECT `last_modified` FROM `' .$strTableName. '` ' + . 'WHERE `config_id`=' .$this->intDomainId. ' ORDER BY `last_modified` DESC LIMIT 1'; + $booReturn = $this->myDBClass->hasSingleDataset($strSQL, $arrDataset); + if (($booReturn == true) && isset($arrDataset['last_modified'])) { + $arrTimeData['table'] = $arrDataset['last_modified']; + } + } + } + // Get config sets + $arrConfigId = array(); + $strTarget = ''; + $strBaseDir = ''; + $intFileStampTemp = 0; + $intRetVal2 = $this->getConfigSets($arrConfigId); + if ($intRetVal2 == 0) { + foreach ($arrConfigId as $intConfigId) { + // Get configuration file data + $this->getConfigData($intConfigId, 'target', $strTarget); + $this->getConfigData($intConfigId, 'basedir', $strBaseDir); + // Get time data + $intReturn = $this->getFileDate( + $intConfigId, + $strFileName, + $strBaseDir, + $intFileStampTemp, + $arrTimeData[$strTarget] + ); + if ($intFileStampTemp != 0 && strtotime($arrTimeData['table']) > $intFileStampTemp) { + $strCheckConfig = translate('Warning: configuration file is out of date!'); + } + if ($arrTimeData[$strTarget] == 'unknown') { + $strCheckConfig = translate('Warning: configuration file is out of date!'); + } + } + } else { + $strCheckConfig = translate('Warning: no configuration target defined!'); + } + return $intReturn; + } + + /** + * Writes a configuration file including all datasets of a configuration table or returns the output as a text + * file for download. (Public master function) + * @param string $strTableName Table name + * @param int $intMode 0 = Write file to filesystem + * 1 = Return Textfile for download test + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function createConfig($strTableName, $intMode = 0) + { + // Define Variables + $intReturn = 0; + // Do not create configs in common domain + if ($this->intDomainId == 0) { + $this->processClassMessage(translate('It is not possible to write config files directly from the common ' + . 'domain!'). '::', $this->strErrorMessage); + $intReturn = 1; + } + if ($intReturn == 0) { + // Get configuration targets + $this->getConfigSets($arrConfigID); + if (($arrConfigID != 1) && \is_array($arrConfigID)) { + foreach ($arrConfigID as $intConfigID) { + $intReturn = $this->writeConfTemplate($intConfigID, $strTableName, $intMode); + } + } else { + $this->processClassMessage(translate('Warning: no configuration target defined!'). + '::', $this->strErrorMessage); + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * Writes a configuration file including one single datasets of a configuration table or returns the output as + * a text file for download. + * @param string $strTableName Table name + * @param int $intDbId Data ID + * @param int $intMode 0 = Write file to filesystem + * 1 = Return Textfile for download test + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function createConfigSingle($strTableName, $intDbId = 0, $intMode = 0) + { + // Define Variables + $arrData = array(); + $intDataCount = 0; + $setEnableCommon = 0; + $intReturn = 0; + $strDomainWhere = ' (`config_id`=' .$this->intDomainId. ') '; + // Read some settings and informations + $this->getDomainData('enable_common', $setEnableCommon); + // Variable rewritting + if ($setEnableCommon != 0) { + $strDomainWhere = str_replace(')', ' OR `config_id`=0)', $strDomainWhere); + } + // Do not create configs in common domain + if ($this->intDomainId == 0) { + $this->processClassMessage(translate('It is not possible to write config files directly from the common ' + . 'domain!'). '::', $this->strErrorMessage); + $intReturn = 1; + } + if ($intReturn == 0) { + if ($intDbId == 0) { + $strSQL = 'SELECT * FROM `' .$strTableName."` WHERE $strDomainWhere AND `active`='1' ORDER BY `id`"; + } else { + $strSQL = 'SELECT * FROM `' .$strTableName."` WHERE $strDomainWhere AND `active`='1' AND `id`=$intDbId"; + } + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if (($booReturn != false) && ($intDataCount != 0)) { + /** @noinspection ForeachInvariantsInspection */ + for ($i = 0; $i < $intDataCount; $i++) { + // Process form POST variable + $strChbName = 'chbId_' .$arrData[$i]['id']; + // Check if this POST variable exists or the data ID parameter matches + if ((($intDbId != 0) && ($intDbId == $arrData[$i]['id'])) || + (filter_input(INPUT_POST, $strChbName) !== null)) { + // Get configuration targets + $this->getConfigSets($arrConfigID); + if (($arrConfigID != 1) && \is_array($arrConfigID)) { + foreach ($arrConfigID as $intConfigID) { + $intReturn = $this->writeConfTemplate( + $intConfigID, + $strTableName, + $intMode, + $arrData, + $i + ); + } + } else { + $this->processClassMessage(translate('Warning: no configuration target defined!'). + '::', $this->strErrorMessage); + $intReturn = 1; + } + } + } + } else { + $this->myDataClass->writeLog(translate('Writing of the configuration failed - no dataset or not ' + . 'activated dataset found')); + $this->processClassMessage(translate('Writing of the configuration failed - no dataset or not ' + . 'activated dataset found'). '::', $this->strErrorMessage); + $intReturn = 1; + } + } + return $intReturn; + } + + + // PRIVATE functions + + /** + * Determines the configuration data for each database table + * @return array filename (configuration file name) + * order_field (database order field) + */ + public function getConfData() + { + $arrConfData['tbl_timeperiod'] = array('filename' => 'timeperiods.cfg', + 'order_field' => 'timeperiod_name'); + $arrConfData['tbl_command'] = array('filename' => 'commands.cfg', + 'order_field' => 'command_name'); + $arrConfData['tbl_contact'] = array('filename' => 'contacts.cfg', + 'order_field' => 'contact_name'); + $arrConfData['tbl_contacttemplate'] = array('filename' => 'contacttemplates.cfg', + 'order_field' => 'template_name'); + $arrConfData['tbl_contactgroup'] = array('filename' => 'contactgroups.cfg', + 'order_field' => 'contactgroup_name'); + $arrConfData['tbl_hosttemplate'] = array('filename' => 'hosttemplates.cfg', + 'order_field' => 'template_name'); + $arrConfData['tbl_servicetemplate'] = array('filename' => 'servicetemplates.cfg', + 'order_field' => 'template_name'); + $arrConfData['tbl_hostgroup'] = array('filename' => 'hostgroups.cfg', + 'order_field' => 'hostgroup_name'); + $arrConfData['tbl_servicegroup'] = array('filename' => 'servicegroups.cfg', + 'order_field' => 'servicegroup_name'); + $arrConfData['tbl_hostdependency'] = array('filename' => 'hostdependencies.cfg', + 'order_field' => 'dependent_host_name'); + $arrConfData['tbl_servicedependency'] = array('filename' => 'servicedependencies.cfg', + 'order_field' => 'config_name'); + $arrConfData['tbl_hostescalation'] = array('filename' => 'hostescalations.cfg', + 'order_field' => 'host_name`,`hostgroup_name'); + $arrConfData['tbl_serviceescalation'] = array('filename' => 'serviceescalations.cfg', + 'order_field' => 'config_name'); + $arrConfData['tbl_hostextinfo'] = array('filename' => 'hostextinfo.cfg', + 'order_field' => 'host_name'); + $arrConfData['tbl_serviceextinfo'] = array('filename' => 'serviceextinfo.cfg', + 'order_field' => 'host_name'); + return $arrConfData; + } + + /** + * Writes a configuration file including all datasets of a configuration table or returns the output as a text + * file for download. (Private worker function) + * @param int $intConfigID Configuration target ID + * @param string $strTableName Table name + * @param int $intMode 0 = Write file to filesystem + * 1 = Return Textfile for download test + * @param array $arrTableData Dataset array for host and services only + * @param int $intID Key for dataset array + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + /** @noinspection ArrayTypeOfParameterByDefaultValueInspection */ + private function writeConfTemplate($intConfigID, $strTableName, $intMode, $arrTableData = array(), $intID = 0) + { + // Variable definitions + $strSQL = ''; + $strOrderField = ''; + $strFileString = ''; + $arrTplOptions = array('use_preg' => false); + $strDomainWhere = ' (`config_id`=' . $this->intDomainId . ') '; + $intType = 0; + $intReturn = 0; + // Read some settings and informations + $this->getConfigData($intConfigID, 'utf8_decode', $setUTF8Decode); + $this->getDomainData('enable_common', $setEnableCommon); + $this->getConfigData($intConfigID, 'version', $intNagiosVersion); + $arrConfigData = $this->getConfData(); + if (isset($arrConfigData[$strTableName])) { + $strFileString = str_replace('.cfg', '', $arrConfigData[$strTableName]['filename']); + $strOrderField = $arrConfigData[$strTableName]['order_field']; + } + // Variable rewritting + if ($setEnableCommon != 0) { + $strDomainWhere = str_replace(')', ' OR `config_id`=0)', $strDomainWhere); + } + // Special processing for table host and service + $setTemplate = $strFileString. '.tpl.dat'; + if (($strTableName == 'tbl_host') || ($strTableName == 'tbl_service')) { + // Define variable names based on table name + switch ($strTableName) { + case 'tbl_host': + $strFileString = $arrTableData[$intID]['host_name']; + $intDomainId = $arrTableData[$intID]['config_id']; + $setTemplate = 'hosts.tpl.dat'; + $intType = 1; + $strSQL = 'SELECT * FROM `' . $strTableName . "` WHERE `host_name`='$strFileString' " + . "AND `active`='1' AND `config_id`=$intDomainId"; + break; + case 'tbl_service': + $strFileString = $arrTableData[$intID]['config_name']; + $intDomainId = $arrTableData[$intID]['config_id']; + $setTemplate = 'services.tpl.dat'; + $intType = 2; + $strSQL = 'SELECT * FROM `' . $strTableName . "` WHERE `config_name`='$strFileString' " + . "AND `active`='1' AND `config_id`=$intDomainId ORDER BY `service_description`"; + break; + } + } else { + $strSQL = 'SELECT * FROM `' .$strTableName."` WHERE $strDomainWhere AND `active`='1' ". + 'ORDER BY `' .$strOrderField. '`'; + } + $strFile = $strFileString. '.cfg'; + // Load configuration template file + $tplConf = new \HTML_Template_IT($this->arrSettings['path']['base_path']. '/templates/files/'); + $tplConf->loadTemplatefile($setTemplate, true, true); + $tplConf->setOptions($arrTplOptions); + $tplConf->setVariable('CREATE_DATE', date('Y-m-d H:i:s')); + $tplConf->setVariable('NAGIOS_QL_VERSION', $this->arrSettings['db']['version']); + $tplConf->setVariable('VERSION', $this->getVersionString($intConfigID)); + // Write data from configuration table + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn && ($intDataCount != 0) && ($strFileString != '')) { + // Process every data set + /** @noinspection ForeachInvariantsInspection */ + for ($i = 0; $i < $intDataCount; $i++) { + $intDataId = 0; + /** @noinspection ForeachSourceInspection */ + foreach ($arrData[$i] as $key => $value) { + if ($key == 'id') { + $intDataId = $value; + } + if ($key == 'config_name') { + $key = '#NAGIOSQL_CONFIG_NAME'; + } + // UTF8 decoded vaules + if ($setUTF8Decode == 1) { + $value = utf8_decode($value); + } + // Pass special fields (NagiosQL data fields not used by Nagios itselves) + if ($this->skipEntries($strTableName, $intNagiosVersion, $key, $value) == 1) { + continue; + } + // Get relation data + $intSkip = $this->getRelationData($strTableName, $tplConf, $arrData[$i], $key, $value); + // Rename field names + $this->renameFields($strTableName, $intConfigID, $intDataId, $key, $value, $intSkip); + // Inset data field + if ($intSkip != 1) { + // Insert fill spaces + $strFillLen = (30- \strlen($key)); + $strSpace = ' '; + for ($f = 0; $f < $strFillLen; $f++) { + $strSpace .= ' '; + } + // Write key and value to template + $tplConf->setVariable('ITEM_TITLE', $key.$strSpace); + // Short values + if (($intNagiosVersion != 3) || (\strlen($value) < 800)) { + $tplConf->setVariable('ITEM_VALUE', $value); + $tplConf->parse('configline'); + } else { // Long values + $arrValueTemp = explode(',', $value); + $strValueNew = ''; + $intArrCount = \count($arrValueTemp); + $intCounter = 0; + $strSpace = ' '; + for ($f = 0; $f < 30; $f++) { + $strSpace .= ' '; + } + foreach ($arrValueTemp as $elem) { + if (\strlen($strValueNew) < 800) { + $strValueNew .= $elem. ','; + } else { + if (substr($strValueNew, -1) == ',') { + $strValueNew = substr($strValueNew, 0, -1); + } + if ($intCounter < $intArrCount) { + $strValueNew .= ",\\"; + $tplConf->setVariable('ITEM_VALUE', $strValueNew); + $tplConf->parse('configline'); + $tplConf->setVariable('ITEM_TITLE', $strSpace); + } else { + $tplConf->setVariable('ITEM_VALUE', $strValueNew); + $tplConf->parse('configline'); + $tplConf->setVariable('ITEM_TITLE', $strSpace); + } + $strValueNew = $elem. ','; + } + $intCounter++; + } + if ($strValueNew != '') { + if (substr($strValueNew, -1) == ',') { + $strValueNew = substr($strValueNew, 0, -1); + } + $tplConf->setVariable('ITEM_VALUE', $strValueNew); + $tplConf->parse('configline'); + } + } + } + } + // Special processing for time periods + if ($strTableName == 'tbl_timeperiod') { + $arrDataTime = array(); + $strSQLTime = 'SELECT `definition`, `range` ' + . 'FROM `tbl_timedefinition` WHERE `tipId` = ' .$arrData[$i]['id']; + $booReturn = $this->myDBClass->hasDataArray($strSQLTime, $arrDataTime, $intDataCountTime); + if ($booReturn && $intDataCountTime != 0) { + foreach ($arrDataTime as $data) { + // Skip other values than weekdays in nagios version below 3 + if ($intNagiosVersion < 3) { + $arrWeekdays = array('monday','tuesday','wednesday','thursday','friday','saturday', + 'sunday'); + if (!\in_array($data['definition'], $arrWeekdays, true)) { + continue; + } + } + // Insert fill spaces + $strFillLen = (30- \strlen($data['definition'])); + $strSpace = ' '; + for ($f = 0; $f < $strFillLen; $f++) { + $strSpace .= ' '; + } + // Write key and value + $tplConf->setVariable('ITEM_TITLE', $data['definition'].$strSpace); + $tplConf->setVariable('ITEM_VALUE', $data['range']); + $tplConf->parse('configline'); + } + } + } + // Write configuration set + $tplConf->parse('configset'); + } + } elseif ($booReturn && ($intDataCount == 0) && ($strFileString != '')) { + $this->processClassMessage(translate('Error while selecting data from database:') + . '::', $this->strErrorMessage); + $this->processClassMessage($this->myDBClass->strErrorMessage, $this->strErrorMessage); + $intReturn = 1; + } else { + $this->myDataClass->writeLog(translate('Writing of the configuration failed - no dataset ' + . 'or not activated dataset found')); + $this->processClassMessage(translate('Writing of the configuration failed - no dataset ' + . 'or not activated dataset found'). '::', $this->strErrorMessage); + $intReturn = 1; + } + if ($intMode == 0) { + $intReturn = $this->getConfigFile($strFile, $intConfigID, $intType, $resCfgFile, $strCfgFile); + if ($intReturn == 0) { + $tplConf->parse(); + $strContent = $tplConf->get(); + $intReturn = $this->writeConfigFile( + $strContent, + $strFile, + $intType, + $intConfigID, + $resCfgFile, + $strCfgFile + ); + } + } elseif ($intMode == 1) { + $tplConf->show(); + } + return $intReturn; + } + + /** + * Get Nagios version string + * @param int $intConfigID Configuration target ID + * @return string Version string + */ + private function getVersionString($intConfigID) + { + $arrVersion = array( + 'Nagios 2.x config file', + 'Nagios 2.9 config file', + 'Nagios 3.x config file', + 'Nagios 4.x config file' + ); + $this->getConfigData($intConfigID, 'version', $intVersion); + if (($intVersion >= 1) && ($intVersion <= \count($arrVersion))) { + $strVersion = $arrVersion[$intVersion - 1]; + } else { + $strVersion = ''; + } + return $strVersion; + } + + /** + * Skip database values based on Nagios version + * @param string $strTableName Table name + * @param int $intVersionValue Nagios version value + * @param string $key Data key + * @param string $value Data value + * @return int + */ + private function skipEntries($strTableName, $intVersionValue, $key, &$value) + { + // Define variables + $arrOption = array(); + $intReturn = 0; + // Skip common fields + $strSpecial = 'id,active,last_modified,access_rights,access_group,config_id,template,nodelete,command_type,'; + $strSpecial .= 'import_hash'; + + // Skip fields of special tables + if ($strTableName == 'tbl_hosttemplate') { + $strSpecial .= ',parents_tploptions,hostgroups_tploptions,contacts_tploptions'; + $strSpecial .= ',contact_groups_tploptions,use_template_tploptions'; + } + if ($strTableName == 'tbl_servicetemplate') { + $strSpecial .= ',host_name_tploptions,hostgroup_name_tploptions,parents_tploptions,contacts_tploptions'; + $strSpecial .= ',servicegroups_tploptions,contact_groups_tploptions,use_template_tploptions'; + } + if ($strTableName == 'tbl_contact') { + $strSpecial .= ',use_template_tploptions,contactgroups_tploptions'; + $strSpecial .= ',host_notification_commands_tploptions,service_notification_commands_tploptions'; + } + if ($strTableName == 'tbl_contacttemplate') { + $strSpecial .= ',use_template_tploptions,contactgroups_tploptions'; + $strSpecial .= ',host_notification_commands_tploptions,service_notification_commands_tploptions'; + } + if ($strTableName == 'tbl_host') { + $strSpecial .= ',parents_tploptions,hostgroups_tploptions,contacts_tploptions'; + $strSpecial .= ',contact_groups_tploptions,use_template_tploptions'; + } + if ($strTableName == 'tbl_service') { + $strSpecial .= ',host_name_tploptions,hostgroup_name_tploptions,parents_tploptions'; + $strSpecial .= ',servicegroups_tploptions,contacts_tploptions,contact_groups_tploptions'; + $strSpecial .= ',use_template_tploptions'; + } + + // Pass fields based on nagios version lower than 3.x + if ($intVersionValue < 3) { + if ($strTableName == 'tbl_timeperiod') { + $strSpecial .= ',use_template,exclude,name'; + } + if (($strTableName == 'tbl_contact') || ($strTableName == 'tbl_contacttemplate')) { + $strSpecial .= ',host_notifications_enabled,service_notifications_enabled,can_submit_commands'; + $strSpecial .= ',retain_status_information,retain_nonstatus_information'; + $arrOption['host_notification_options'] = ',s'; + $arrOption['service_notification_options'] = ',s'; + } + if ($strTableName == 'tbl_contactgroup') { + $strSpecial .= ',contactgroup_members'; + } + if ($strTableName == 'tbl_hostgroup') { + $strSpecial .= ',hostgroup_members,notes,notes_url,action_url'; + } + if ($strTableName == 'tbl_servicegroup') { + $strSpecial .= ',servicegroup_members,notes,notes_url,action_url'; + } + if ($strTableName == 'tbl_hostdependency') { + $strSpecial .= ',dependent_hostgroup_name,hostgroup_name,dependency_period'; + } + if ($strTableName == 'tbl_hostescalation') { + $strSpecial .= ',contacts'; + } + if ($strTableName == 'tbl_servicedependency') { + $strSpecial .= ',dependent_hostgroup_name,hostgroup_name,dependency_period,dependent_servicegroup_name'; + $strSpecial .= ',servicegroup_name'; + } + if ($strTableName == 'tbl_serviceescalation') { + $strSpecial .= ',hostgroup_name,contacts,servicegroup_name'; + } + if (($strTableName == 'tbl_host') || ($strTableName == 'tbl_hosttemplate')) { + $strSpecial .= ',initial_state,flap_detection_options,contacts,notes,notes_url,action_url'; + $strSpecial .= ',icon_image,icon_image_alt,vrml_image,statusmap_image,2d_coords,3d_coords'; + $arrOption['notification_options'] = ',s'; + } + // Services + if (($strTableName == 'tbl_service') || ($strTableName == 'tbl_servicetemplate')) { + $strSpecial .= ',initial_state,flap_detection_options,contacts,notes,notes_url,action_url'; + $strSpecial .= ',icon_image,icon_image_alt'; + $arrOption['notification_options'] = ',s'; + } + } + // Pass fields based on nagios version higher than 2.x + if ($intVersionValue > 2) { + if ($strTableName == 'tbl_servicetemplate') { + $strSpecial .= ',parallelize_check '; + } + if ($strTableName == 'tbl_service') { + $strSpecial .= ',parallelize_check'; + } + } + // Pass fields based on nagios version lower than 4.x + if ($intVersionValue < 4) { + if (($strTableName == 'tbl_contact') || ($strTableName == 'tbl_contacttemplate')) { + $strSpecial .= ',minimum_importance'; + } + if ($strTableName == 'tbl_host') { + $strSpecial .= ',importance'; + } + if (($strTableName == 'tbl_service') || ($strTableName == 'tbl_servicetemplate')) { + $strSpecial .= ',importance,parents'; + } + } + if ($intVersionValue == 1) { + $strSpecial .= ''; + } + // Reduce option values + if (array_key_exists($key, $arrOption) && (\count($arrOption) != 0)) { + $value = str_replace(array($arrOption[$key], str_replace(',', '', $arrOption[$key])), '', $value); + if ($value == '') { + $intReturn = 1; + } + } + if ($intReturn == 0) { + // Skip entries + $arrSpecial = explode(',', $strSpecial); + if (($value == '') || \in_array($key, $arrSpecial, true)) { + $intReturn = 1; + } + } + if ($intReturn == 0) { + // Do not write config data (based on 'skip' option) + $strNoTwo = 'active_checks_enabled,passive_checks_enabled,obsess_over_host,check_freshness,'; + $strNoTwo .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,'; + $strNoTwo .= 'retain_nonstatus_information,notifications_enabled,parallelize_check,is_volatile,'; + $strNoTwo .= 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,'; + $strNoTwo .= 'obsess_over_service'; + foreach (explode(',', $strNoTwo) as $elem) { + if (($key == $elem) && ($value == '2')) { + $intReturn = 1; + } + if (($intVersionValue < 3) && ($key == $elem) && ($value == '3')) { + $intReturn = 1; + } + } + } + return $intReturn; + } + + /** + * Get related data + * @param string $strTableName Table name + * @param \HTML_Template_IT $resTemplate Template ressource + * @param array $arrData Dataset array + * @param string $strDataKey Data key + * @param string $strDataValue Data value + * @return int 0 = use data / 1 = skip data + * Status message is stored in message class variables + */ + private function getRelationData($strTableName, $resTemplate, $arrData, $strDataKey, &$strDataValue) + { + // Define Variables + $intReturn = 0; + $intSkipProc = 0; + $arrRelations = array(); + // Pass function for tbl_command + if ($strTableName == 'tbl_command') { + $intSkipProc = 1; + } + // Get relation info and store the value in a class variable (speedup export) + if (($intSkipProc == 0) && ($this->strRelTable != $strTableName)) { + $intReturn = $this->myDataClass->tableRelations($strTableName, $arrRelations); + $this->strRelTable = $strTableName; + $this->arrRelData = $arrRelations; + } elseif ($intSkipProc == 0) { + $arrRelations = $this->arrRelData; + $intReturn = 0; + } + if (($intSkipProc == 0) && (!\is_array($arrRelations)) && (\count($arrRelations) == 0)) { + $intSkipProc = 1; + $intReturn = 1; + } + if ($intSkipProc == 0) { + // Common domain is enabled? + $this->getDomainData('enable_common', $intCommonEnable); + if ($intCommonEnable == 1) { + $strDomainWhere1 = ' (`config_id`=' . $this->intDomainId . ' OR `config_id`=0) '; + } else { + $strDomainWhere1 = ' `config_id`=' . $this->intDomainId . ' '; + } + // Process relations + foreach ($arrRelations as $elem) { + if ($elem['fieldName'] == $strDataKey) { + // Process normal 1:n relations (1 = only data / 2 = including a * value) + if (($elem['type'] == 2) && (($strDataValue == 1) || ($strDataValue == 2))) { + $intReturn = $this->processRelation1($arrData, $strDataValue, $elem, $strDomainWhere1); + // Process normal 1:1 relations + } elseif ($elem['type'] == 1) { + $intReturn = $this->processRelation2($arrData, $strDataValue, $elem, $strDomainWhere1); + // Process normal 1:n relations with special table and idSort (template tables) + } elseif (($elem['type'] == 3) && ($strDataValue == 1)) { + $intReturn = $this->processRelation3($arrData, $strDataValue, $elem, $strDomainWhere1); + // Process special 1:n:str relations with string values (servicedependencies) + } elseif (($elem['type'] == 6) && (($strDataValue == 1) || ($strDataValue == 2))) { + $intReturn = $this->processRelation4($arrData, $strDataValue, $elem, $strDomainWhere1); + // Process special relations for free variables + } elseif (($elem['type'] == 4) && ($strDataValue == 1) && ($this->intNagVersion >= 3)) { + $intReturn = $this->processRelation5($resTemplate, $arrData, $elem); + // Process special relations for service groups + } elseif (($elem['type'] == 5) && ($strDataValue == 1)) { + $intReturn = $this->processRelation6($arrData, $strDataValue, $elem, $strDomainWhere1); + // Process special relations for service parents + } elseif (($elem['type'] == 7) && ($strDataValue == 1)) { + $intReturn = $this->processRelation7($arrData, $strDataValue, $elem); + // Process "*" + } elseif ($strDataValue == 2) { + $strDataValue = '*'; + } else { + $intReturn = 1; + } + } + } + } + return $intReturn; + } + + /** + * Rename field names + * @param string $strTableName Table name + * @param int $intConfigID Configuration target ID + * @param int $intDataId Data ID + * @param string $key Data key (by reference) + * @param string $value Data value (by reference) + * @param int $intSkip Skip value (by reference) 1 = skip / 0 = pass + */ + private function renameFields($strTableName, $intConfigID, $intDataId, &$key, &$value, &$intSkip) + { + if ($this->intNagVersion == 0) { + $this->getConfigData($intConfigID, 'version', $this->intNagVersion); + } + // Picture path + if ($this->strPicPath == 'none') { + $this->getConfigData($intConfigID, 'picturedir', $this->strPicPath); + } + if ($key == 'icon_image') { + $value = $this->strPicPath.$value; + } + if ($key == 'vrml_image') { + $value = $this->strPicPath.$value; + } + if ($key == 'statusmap_image') { + $value = $this->strPicPath.$value; + } + // Tables + if ($strTableName == 'tbl_host') { + if ($key == 'use_template') { + $key = 'use'; + } + $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,'; + $strVIValues .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,'; + $strVIValues .= 'retain_nonstatus_information,notifications_enabled'; + if (\in_array($key, explode(',', $strVIValues), true)) { + if ($value == -1) { + $value = 'null'; + } + if ($value == 3) { + $value = 'null'; + } + } + if ($key == 'parents') { + $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_host', $intDataId, $intSkip); + } + if ($key == 'hostgroups') { + $value = $this->checkTpl($value, 'hostgroups_tploptions', 'tbl_host', $intDataId, $intSkip); + } + if ($key == 'contacts') { + $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_host', $intDataId, $intSkip); + } + if ($key == 'contact_groups') { + $value = $this->checkTpl($value, 'contact_groups_tploptions', 'tbl_host', $intDataId, $intSkip); + } + if ($key == 'use') { + $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_host', $intDataId, $intSkip); + } + if ($key == 'check_command') { + $value = str_replace("\::bang::", "\!", $value); + } + if ($key == 'check_command') { + $value = str_replace('::bang::', "\!", $value); + } + } + if ($strTableName == 'tbl_service') { + if ($key == 'use_template') { + $key = 'use'; + } + if ($this->intNagVersion < 2) { + if ($key == 'check_interval') { + $key = 'normal_check_interval'; + } + if ($key == 'retry_interval') { + $key = 'retry_check_interval'; + } + } + $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,'; + $strVIValues .= 'obsess_over_service,check_freshness,event_handler_enabled,flap_detection_enabled,'; + $strVIValues .= 'process_perf_data,retain_status_information,retain_nonstatus_information,'; + $strVIValues .= 'notifications_enabled'; + if (\in_array($key, explode(',', $strVIValues), true)) { + if ($value == -1) { + $value = 'null'; + } + if ($value == 3) { + $value = 'null'; + } + } + if ($key == 'host_name') { + $value = $this->checkTpl($value, 'host_name_tploptions', 'tbl_service', $intDataId, $intSkip); + } + if ($key == 'hostgroup_name') { + $value = $this->checkTpl($value, 'hostgroup_name_tploptions', 'tbl_service', $intDataId, $intSkip); + } + if ($key == 'parents') { + $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_service', $intDataId, $intSkip); + } + if ($key == 'servicegroups') { + $value = $this->checkTpl($value, 'servicegroups_tploptions', 'tbl_service', $intDataId, $intSkip); + } + if ($key == 'contacts') { + $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_service', $intDataId, $intSkip); + } + if ($key == 'contact_groups') { + $value = $this->checkTpl($value, 'contact_groups_tploptions', 'tbl_service', $intDataId, $intSkip); + } + if ($key == 'use') { + $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_service', $intDataId, $intSkip); + } + if ($key == 'check_command') { + $value = str_replace("\::bang::", "\!", $value); + } + if ($key == 'check_command') { + $value = str_replace('::bang::', "\!", $value); + } + } + if ($strTableName == 'tbl_hosttemplate') { + if ($key == 'template_name') { + $key = 'name'; + } + if ($key == 'use_template') { + $key = 'use'; + } + $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,'; + $strVIValues .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,'; + $strVIValues .= 'retain_nonstatus_information,notifications_enabled'; + if (\in_array($key, explode(',', $strVIValues), true)) { + if ($value == -1) { + $value = 'null'; + } + if ($value == 3) { + $value = 'null'; + } + } + if ($key == 'parents') { + $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip); + } + if ($key == 'hostgroups') { + $value = $this->checkTpl($value, 'hostgroups_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip); + } + if ($key == 'contacts') { + $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip); + } + if ($key == 'contact_groups') { + $value = $this->checkTpl($value, 'contact_groups_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip); + } + if ($key == 'use') { + $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_hosttemplate', $intDataId, $intSkip); + } + } + if ($strTableName == 'tbl_servicetemplate') { + if ($key == 'template_name') { + $key = 'name'; + } + if ($key == 'use_template') { + $key = 'use'; + } + if ($this->intNagVersion < 2) { + if ($key == 'check_interval') { + $key = 'normal_check_interval'; + } + if ($key == 'retry_interval') { + $key = 'retry_check_interval'; + } + } + $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,'; + $strVIValues .= 'obsess_over_service,check_freshness,event_handler_enabled,flap_detection_enabled,'; + $strVIValues .= 'process_perf_data,retain_status_information,retain_nonstatus_information,'; + $strVIValues .= 'notifications_enabled'; + if (\in_array($key, explode(',', $strVIValues), true)) { + if ($value == -1) { + $value = 'null'; + } + if ($value == 3) { + $value = 'null'; + } + } + if ($key == 'host_name') { + $value = $this->checkTpl($value, 'host_name_tploptions', 'tbl_servicetemplate', $intDataId, $intSkip); + } + if ($key == 'hostgroup_name') { + $value = $this->checkTpl( + $value, + 'hostgroup_name_tploptions', + 'tbl_servicetemplate', + $intDataId, + $intSkip + ); + } + if ($key == 'parents') { + $value = $this->checkTpl($value, 'parents_tploptions', 'tbl_servicetemplate', $intDataId, $intSkip); + } + if ($key == 'servicegroups') { + $value = $this->checkTpl( + $value, + 'servicegroups_tploptions', + 'tbl_servicetemplate', + $intDataId, + $intSkip + ); + } + if ($key == 'contacts') { + $value = $this->checkTpl($value, 'contacts_tploptions', 'tbl_servicetemplate', $intDataId, $intSkip); + } + if ($key == 'contact_groups') { + $value = $this->checkTpl( + $value, + 'contact_groups_tploptions', + 'tbl_servicetemplate', + $intDataId, + $intSkip + ); + } + if ($key == 'use') { + $value = $this->checkTpl( + $value, + 'use_template_tploptions', + 'tbl_servicetemplate', + $intDataId, + $intSkip + ); + } + } + if ($strTableName == 'tbl_contact') { + if ($key == 'use_template') { + $key = 'use'; + } + $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,'; + $strVIValues .= 'retain_status_information,retain_nonstatus_information'; + if (\in_array($key, explode(',', $strVIValues), true)) { + if ($value == -1) { + $value = 'null'; + } + if ($value == 3) { + $value = 'null'; + } + } + if ($key == 'contactgroups') { + $value = $this->checkTpl($value, 'contactgroups_tploptions', 'tbl_contact', $intDataId, $intSkip); + } + if ($key == 'host_notification_commands') { + $value = $this->checkTpl( + $value, + 'host_notification_commands_tploptions', + 'tbl_contact', + $intDataId, + $intSkip + ); + } + if ($key == 'service_notification_commands') { + $value = $this->checkTpl( + $value, + 'service_notification_commands_tploptions', + 'tbl_contact', + $intDataId, + $intSkip + ); + } + if ($key == 'use') { + $value = $this->checkTpl($value, 'use_template_tploptions', 'tbl_contact', $intDataId, $intSkip); + } + } + if ($strTableName == 'tbl_contacttemplate') { + if ($key == 'template_name') { + $key = 'name'; + } + if ($key == 'use_template') { + $key = 'use'; + } + $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,'; + $strVIValues .= 'retain_status_information,retain_nonstatus_information'; + if (in_array($key, explode(',', $strVIValues), true)) { + if ($value == -1) { + $value = 'null'; + } + if ($value == 3) { + $value = 'null'; + } + } + if ($key == 'contactgroups') { + $value = $this->checkTpl( + $value, + 'contactgroups_tploptions', + 'tbl_contacttemplate', + $intDataId, + $intSkip + ); + } + if ($key == 'host_notification_commands') { + $value = $this->checkTpl( + $value, + 'host_notification_commands_tploptions', + 'tbl_contacttemplate', + $intDataId, + $intSkip + ); + } + if ($key == 'service_notification_commands') { + $value = $this->checkTpl( + $value, + 'service_notification_commands_tploptions', + 'tbl_contacttemplate', + $intDataId, + $intSkip + ); + } + if ($key == 'use') { + $value = $this->checkTpl( + $value, + 'use_template_tploptions', + 'tbl_contacttemplate', + $intDataId, + $intSkip + ); + } + } + if ((($strTableName == 'tbl_hosttemplate') || ($strTableName == 'tbl_servicetemplate') || + ($strTableName == 'tbl_contacttemplate')) && $key == 'register') { + $value = '0'; + } + if ($strTableName == 'tbl_timeperiod' && $key == 'use_template') { + $key = 'use'; + } + } + + /** + * Open configuration file + * @param string $strFile File name + * @param int $intConfigID Configuration ID + * @param int $intType Type ID + * @param resource|bool $resConfigFile Temporary or configuration file ressource (by reference) + * @param string $strConfigFile Configuration file name (by reference) + * @return int 0 = successful / 1 = error + */ + private function getConfigFile($strFile, $intConfigID, $intType, &$resConfigFile, &$strConfigFile) + { + // Variable definitions + $strBaseDir = ''; + $intMethod = 1; + $intReturn = 0; + // Get config data + if ($intType == 1) { + $this->getConfigData($intConfigID, 'hostconfig', $strBaseDir); + $strType = 'host'; + } elseif ($intType == 2) { + $this->getConfigData($intConfigID, 'serviceconfig', $strBaseDir); + $strType = 'service'; + } else { + $this->getConfigData($intConfigID, 'basedir', $strBaseDir); + $strType = 'basic'; + } + $this->getConfigData($intConfigID, 'method', $intMethod); + // Backup config file + $this->moveFile($strType, $strFile, $intConfigID); + // Variable definition + $strConfigFile = $strBaseDir. '/' .$strFile; + // Local file system + if ($intMethod == 1) { + // Save configuration file + if (is_writable($strConfigFile) || (!file_exists($strConfigFile) && is_writable($strBaseDir))) { + $resConfigFile = fopen($strConfigFile, 'wb'); + chmod($strConfigFile, 0644); + } else { + $this->myDataClass->writeLog(translate('Configuration write failed:'). ' ' .$strFile); + $this->processClassMessage(translate('Cannot open/overwrite the configuration file (check the ' + .'permissions)!'). '::', $this->strErrorMessage); + $intReturn = 1; + } + } elseif ($intMethod == 2) { // Remote file (FTP) + // Check connection + if (empty($this->resConnectId) || !\is_resource($this->resConnectId) || + ($this->resConnectType != 'FTP')) { + $intReturn = $this->getFTPConnection($intConfigID); + } + if ($intReturn == 0) { + // Open the config file + if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) { + $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql'); + } else { + $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql'); + } + $resConfigFile = fopen($strConfigFile, 'wb'); + } + } elseif ($intMethod == 3) { // Remote file (SFTP) + // Check connection + if (empty($this->resConnectId) || !\is_resource($this->resConnectId) || + ($this->resConnectType != 'SSH')) { + $intReturn = $this->getSSHConnection($intConfigID); + } + if ($intReturn == 0) { + if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) { + $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql'); + } else { + $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql'); + } + $resConfigFile = fopen($strConfigFile, 'wb'); + } + } + return $intReturn; + } + + /** + * Write configuration file + * @param string $strData Data string + * @param string $strFile File name + * @param int $intType Type ID + * @param int $intConfigID Configuration target ID + * @param resource $resConfigFile Temporary or configuration file ressource + * @param string $strConfigFile Configuration file name + * @return int 0 = successful / 1 = error + */ + private function writeConfigFile($strData, $strFile, $intType, $intConfigID, $resConfigFile, $strConfigFile) + { + // Variable definitions + $intReturn = 0; + // Get config data + if ($intType == 1) { + $this->getConfigData($intConfigID, 'hostconfig', $strBaseDir); + } elseif ($intType == 2) { + $this->getConfigData($intConfigID, 'serviceconfig', $strBaseDir); + } else { + $this->getConfigData($intConfigID, 'basedir', $strBaseDir); + } + $this->getConfigData($intConfigID, 'method', $intMethod); + $strData = str_replace("\r\n", "\n", $strData); + fwrite($resConfigFile, $strData); + // Local filesystem + if ($intMethod == 1) { + fclose($resConfigFile); + } elseif ($intMethod == 2) { // FTP access + // SSH Possible + if (!\function_exists('ftp_put')) { + $this->processClassMessage(translate('FTP module not loaded!'). '::', $this->strErrorMessage); + $intReturn = 1; + } else { + $intErrorReporting = error_reporting(); + error_reporting(0); + if (!ftp_put($this->resConnectId, $strBaseDir . '/' . $strFile, $strConfigFile, FTP_ASCII)) { + $arrError = error_get_last(); + error_reporting($intErrorReporting); + $this->processClassMessage(translate('Cannot open/overwrite the configuration file (FTP connection ' + .'failed)!') . '::', $this->strErrorMessage); + if ($arrError['message'] != '') { + $this->processClassMessage($arrError['message'] . '::', $this->strErrorMessage); + } + $intReturn = 1; + } + error_reporting($intErrorReporting); + ftp_close($this->resConnectId); + fclose($resConfigFile); + } + } elseif ($intMethod == 3) { // SSH access + // SSH Possible + if (!\function_exists('ssh2_scp_send')) { + $this->processClassMessage(translate('SSH module not loaded!'). '::', $this->strErrorMessage); + $intReturn = 1; + } else { + $intErrorReporting = error_reporting(); + error_reporting(0); + if (!ssh2_scp_send($this->resConnectId, $strConfigFile, $strBaseDir . '/' . $strFile, 0644)) { + $arrError = error_get_last(); + error_reporting($intErrorReporting); + $this->processClassMessage(translate('Cannot open/overwrite the configuration file (remote SFTP)!'). + '::', $this->strErrorMessage); + if ($arrError['message'] != '') { + $this->processClassMessage($arrError['message'] . '::', $this->strErrorMessage); + } + $this->resConnectId = null; + $intReturn = 1; + } + error_reporting($intErrorReporting); + fclose($resConfigFile); + unlink($strConfigFile); + $this->resConnectId = null; + } + } + if ($intReturn == 0) { + $this->myDataClass->writeLog(translate('Configuration successfully written:') . ' ' . $strFile); + $this->processClassMessage(translate('Configuration file successfully written!'). + '::', $this->strInfoMessage); + } + return $intReturn; + } + + /** + * Process special settings based on template option + * @param string $strValue Original data value + * @param string $strKeyField Template option field name + * @param string $strTable Table name + * @param int $intId Dataset ID + * @param int $intSkip Skip value (by reference) + * @return string Manipulated data value + */ + public function checkTpl($strValue, $strKeyField, $strTable, $intId, &$intSkip) + { + if ($this->intNagVersion < 3) { + return $strValue; + } + $strSQL = 'SELECT `' .$strKeyField. '` FROM `' .$strTable."` WHERE `id` = $intId"; + $intValue = $this->myDBClass->getFieldData($strSQL); + if ($intValue == 0) { + return('+' .$strValue); + } + if ($intValue == 1) { + $intSkip = 0; + return 'null'; + } + return $strValue; + } + + /** + * @param array $arrData Dataset array + * @param string $strDataValue Data value + * @param array $elem Relation data array + * @param string $strDomainWhere1 SQL WHERE add-in + * @return int 0 = use data / 1 = skip data + */ + private function processRelation1($arrData, &$strDataValue, $elem, $strDomainWhere1) + { + // Define variables + $arrDataRel = array(); + $intDataCountRel = 0; + $intReturn = 0; + // Get relation data + $strSQLRel = 'SELECT `' . $elem['tableName1'] . '`.`' . $elem['target1'] . '`, `' . $elem['linkTable'] . + '`.`exclude` FROM `' . $elem['linkTable'] . '` LEFT JOIN `' . $elem['tableName1'] . + '` ON `' . $elem['linkTable'] . '`.`idSlave` = `' . $elem['tableName1'] . '`.`id`' . + 'WHERE `idMaster`=' . $arrData['id'] . " AND `active`='1' AND $strDomainWhere1" . + 'ORDER BY `' . $elem['tableName1'] . '`.`' . $elem['target1'] . '`'; + $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel); + if ($booReturn && ($intDataCountRel != 0)) { + // Rewrite $strDataValue with returned relation data + if ($strDataValue == 2) { + $strDataValue = '*,'; + } else { + $strDataValue = ''; + } + foreach ($arrDataRel as $data) { + if ($data['exclude'] == 0) { + $strDataValue .= $data[$elem['target1']] . ','; + } elseif ($this->intNagVersion >= 3) { + $strDataValue .= '!' . $data[$elem['target1']] . ','; + } + } + $strDataValue = substr($strDataValue, 0, -1); + if ($strDataValue == '') { + $intReturn = 1; + } + } else { + if ($strDataValue == 2) { + $strDataValue = '*'; + } else { + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * @param array $arrData Dataset array + * @param string $strDataValue Data value + * @param array $elem Relation data array + * @param string $strDomainWhere1 SQL WHERE add-in + * @return int 0 = use data / 1 = skip data + */ + private function processRelation2($arrData, &$strDataValue, $elem, $strDomainWhere1) + { + // Define variables + $arrDataRel = array(); + $arrField = array(); + $intDataCountRel = 0; + $intReturn = 0; + $strCommand = ''; + // Get relation data + if (($elem['tableName1'] == 'tbl_command') && + (substr_count($arrData[$elem['fieldName']], '!') != 0)) { + $arrField = explode('!', $arrData[$elem['fieldName']]); + $strCommand = strstr($arrData[$elem['fieldName']], '!'); + $strSQLRel = 'SELECT `' . $elem['target1'] . '` FROM `' . $elem['tableName1'] . '`' . + 'WHERE `id`=' . $arrField[0] . " AND `active`='1' AND $strDomainWhere1"; + } else { + $strSQLRel = 'SELECT `' . $elem['target1'] . '` FROM `' . $elem['tableName1'] . '`' . + 'WHERE `id`=' . $arrData[$elem['fieldName']] . " AND `active`='1' AND $strDomainWhere1"; + } + $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel); + if ($booReturn && ($intDataCountRel != 0)) { + // Rewrite $strDataValue with returned relation data + if (($elem['tableName1'] == 'tbl_command') && (substr_count($strDataValue, '!') != 0)) { + $strDataValue = $arrDataRel[0][$elem['target1']] . $strCommand; + } else { + $strDataValue = $arrDataRel[0][$elem['target1']]; + } + } else { + if (($elem['tableName1'] == 'tbl_command') && (substr_count($strDataValue, '!') != 0) && + ($arrField[0] == -1)) { + $strDataValue = 'null'; + } else { + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * @param array $arrData Dataset array + * @param string $strDataValue Data value + * @param array $elem Relation data array + * @param string $strDomainWhere1 SQL WHERE add-in + * @return int 0 = use data / 1 = skip data + */ + private function processRelation3($arrData, &$strDataValue, $elem, $strDomainWhere1) + { + // Define variables + $arrDataRel = array(); + $intDataCountRel = 0; + $intReturn = 0; + // Get relation data + $strSQLRel = 'SELECT * FROM `' .$elem['linkTable']. '` WHERE `idMaster`=' .$arrData['id']. ' ORDER BY idSort'; + $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel); + if ($booReturn && ($intDataCountRel != 0)) { + // Rewrite $strDataValue with returned relation data + $strDataValue = ''; + foreach ($arrDataRel as $data) { + if ($data['idTable'] == 1) { + $strSQLName = 'SELECT `' .$elem['target1']. '` FROM `' .$elem['tableName1']. '`' . + "WHERE `active`='1' AND $strDomainWhere1 AND `id`=".$data['idSlave']; + } else { + $strSQLName = 'SELECT `' .$elem['target2']. '` FROM `' .$elem['tableName2']. '`' . + "WHERE `active`='1' AND $strDomainWhere1 AND `id`=".$data['idSlave']; + } + $strDataValue .= $this->myDBClass->getFieldData($strSQLName) . ','; + } + $strDataValue = substr($strDataValue, 0, -1); + } else { + $intReturn = 1; + } + return $intReturn; + } + + /** + * @param array $arrData Dataset array + * @param string $strDataValue Data value + * @param array $elem Relation data array + * @param string $strDomainWhere1 SQL WHERE add-in + * @return int 0 = use data / 1 = skip data + */ + private function processRelation4($arrData, &$strDataValue, $elem, $strDomainWhere1) + { + // Define variables + $arrDataRel = array(); + $intDataCountRel = 0; + $intReturn = 0; + // Get relation data + $strSQLRel = 'SELECT `' .$elem['linkTable']. '`.`strSlave`, `' .$elem['linkTable']. '`.`exclude` ' . + 'FROM `' .$elem['linkTable']. '` ' . + 'LEFT JOIN `tbl_service` ON `' .$elem['linkTable']. '`.`idSlave`=`tbl_service`.`id` ' . + 'WHERE `' .$elem['linkTable']. '`.`idMaster`=' .$arrData['id']." AND `active`='1' AND ". + $strDomainWhere1. ' ' . + 'ORDER BY `' .$elem['linkTable']. '`.`strSlave`'; + $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel); + if ($booReturn && ($intDataCountRel != 0)) { + // Rewrite $strDataValue with returned relation data + if ($strDataValue == 2) { + $strDataValue = '*,'; + } else { + $strDataValue = ''; + } + foreach ($arrDataRel as $data) { + if ($data['exclude'] == 0) { + $strDataValue .= $data['strSlave'] . ','; + } elseif ($this->intNagVersion >= 3) { + $strDataValue .= '!' . $data['strSlave'] . ','; + } + } + $strDataValue = substr($strDataValue, 0, -1); + if ($strDataValue == '') { + $intReturn = 1; + } + } else { + if ($strDataValue == 2) { + $strDataValue = '*'; + } else { + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * @param \HTML_Template_IT $resTemplate Template object + * @param array $arrData Dataset array + * @param array $elem Relation data array + * @return int 0 = use data / 1 = skip data + */ + private function processRelation5($resTemplate, $arrData, $elem) + { + // Define variables + $arrDataRel = array(); + $intDataCountRel = 0; + $strSQLRel = 'SELECT * FROM `tbl_variabledefinition` LEFT JOIN `' .$elem['linkTable']. '` ' . + 'ON `id`=`idSlave` WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `name`'; + $booReturn = $this->myDBClass->hasDataArray($strSQLRel, $arrDataRel, $intDataCountRel); + if ($booReturn && ($intDataCountRel != 0)) { + foreach ($arrDataRel as $vardata) { + // Insert fill spaces + $strFillLen = (30 - \strlen($vardata['name'])); + $strSpace = ' '; + for ($f = 0; $f < $strFillLen; $f++) { + $strSpace .= ' '; + } + $resTemplate->setVariable('ITEM_TITLE', $vardata['name'] . $strSpace); + $resTemplate->setVariable('ITEM_VALUE', $vardata['value']); + $resTemplate->parse('configline'); + } + } + return 1; + } + + /** + * @param array $arrData Dataset array + * @param string $strDataValue Data value + * @param array $elem Relation data array + * @param string $strDomainWhere1 SQL WHERE add-in + * @return int 0 = use data / 1 = skip data + */ + private function processRelation6($arrData, &$strDataValue, $elem, $strDomainWhere1) + { + // Define variables + $arrDataRel = array(); + $arrHG1 = array(); + $arrHG2 = array(); + $intDataCountRel = 0; + $intHG1 = 0; + $intHG2 = 0; + $intReturn = 0; + // Get relation data + $strSQLMaster = 'SELECT * FROM `' . $elem['linkTable'] . '` WHERE `idMaster`=' . $arrData['id']; + $booReturn = $this->myDBClass->hasDataArray($strSQLMaster, $arrDataRel, $intDataCountRel); + if ($booReturn && ($intDataCountRel != 0)) { + // Rewrite $strDataValue with returned relation data + $strDataValue = ''; + foreach ($arrDataRel as $data) { + if ($data['idSlaveHG'] != 0) { + $strSQLSrv = 'SELECT `' . $elem['target2'] . '` FROM `' . $elem['tableName2'] . + '` WHERE `id`=' . $data['idSlaveS']; + $strService = $this->myDBClass->getFieldData($strSQLSrv); + $strSQLHG1 = 'SELECT `host_name` FROM `tbl_host` ' . + 'LEFT JOIN `tbl_lnkHostgroupToHost` ON `id`=`idSlave` ' . + 'WHERE `idMaster`=' . $data['idSlaveHG'] . " AND `active`='1' AND $strDomainWhere1"; + $booReturn = $this->myDBClass->hasDataArray($strSQLHG1, $arrHG1, $intHG1); + if ($booReturn && ($intHG1 != 0)) { + foreach ($arrHG1 as $elemHG1) { + if (substr_count($strDataValue, $elemHG1['host_name'] . ',' . $strService) == 0) { + $strDataValue .= $elemHG1['host_name'] . ',' . $strService . ','; + } + } + } + $strSQLHG2 = 'SELECT `host_name` FROM `tbl_host` ' . + 'LEFT JOIN `tbl_lnkHostToHostgroup` ON `id`=`idMaster` ' . + 'WHERE `idSlave`=' . $data['idSlaveHG'] . " AND `active`='1' AND $strDomainWhere1"; + $booReturn = $this->myDBClass->hasDataArray($strSQLHG2, $arrHG2, $intHG2); + if ($booReturn && ($intHG2 != 0)) { + foreach ($arrHG2 as $elemHG2) { + if (substr_count($strDataValue, $elemHG2['host_name'] . ',' . $strService) == 0) { + $strDataValue .= $elemHG2['host_name'] . ',' . $strService . ','; + } + } + } + } else { + $strSQLHost = 'SELECT `' . $elem['target1'] . '` FROM `' . $elem['tableName1'] . '` ' . + 'WHERE `id`=' . $data['idSlaveH'] . " AND `active`='1' AND $strDomainWhere1"; + $strHost = $this->myDBClass->getFieldData($strSQLHost); + $strSQLSrv = 'SELECT `' . $elem['target2'] . '` FROM `' . $elem['tableName2'] . '` ' . + 'WHERE `id`=' . $data['idSlaveS'] . " AND `active`='1' AND $strDomainWhere1"; + $strService = $this->myDBClass->getFieldData($strSQLSrv); + if (($strHost != '') && ($strService != '') && + substr_count($strDataValue, $strHost . ',' . $strService) == 0) { + $strDataValue .= $strHost . ',' . $strService . ','; + } + } + } + $strDataValue = substr($strDataValue, 0, -1); + if ($strDataValue == '') { + $intReturn = 1; + } + } else { + $intReturn = 1; + } + return $intReturn; + } + + /** + * @param array $arrData Dataset array + * @param string $strDataValue Data value + * @param array $elem Relation data array + * @return int 0 = use data / 1 = skip data + */ + private function processRelation7($arrData, &$strDataValue, $elem) + { + $intReturn = 1; + // Get relation data + $strSQLMaster = 'SELECT * FROM `' . $elem['linkTable'] . '` WHERE `idMaster`=' . $arrData['id']; + $booReturn = $this->myDBClass->hasDataArray($strSQLMaster, $arrDataRel, $intDataCountRel); + if ($booReturn && ($intDataCountRel != 0)) { + // Rewrite $strDataValue with returned relation data + $strDataValue = ''; + /** @var array $arrDataRel */ + foreach ($arrDataRel as $data) { + $strSQL = 'SELECT host_name FROM tbl_host WHERE id=' .$data['idHost']; + $strHost = $this->myDBClass->getFieldData($strSQL); + $strSQL = 'SELECT service_description FROM tbl_service WHERE id=' .$data['idSlave']; + $strService = $this->myDBClass->getFieldData($strSQL); + $strDataValue .= $strHost . ',' . $strService . ','; + $intReturn = 0; + } + $strDataValue = substr($strDataValue, 0, -1); + } + return $intReturn; + } +} diff --git a/functions/NagContentClass.php b/functions/NagContentClass.php new file mode 100644 index 0000000..bd57d43 --- /dev/null +++ b/functions/NagContentClass.php @@ -0,0 +1,645 @@ +arrSettings = $arrSession['SETS']; + } + if (isset($arrSession['domain'])) { + $this->intDomainId = $arrSession['domain']; + } + $this->arrSession = $arrSession; + } + + /** + * Data list view - form initialization + * @param \HTML_Template_IT $objTemplate Form template object + */ + public function listViewInit($objTemplate) + { + // Language text replacements from fieldvars.php file + foreach ($this->arrDescription as $elem) { + $objTemplate->setVariable($elem['name'], $elem['string']); + } + // Some single replacements + $objTemplate->setVariable('LIMIT', $this->intLimit); + $objTemplate->setVariable('ACTION_MODIFY', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); + $objTemplate->setVariable('TABLE_NAME', $this->strTableName); + if (isset($this->arrSession['search'][$this->strSearchSession])) { + $objTemplate->setVariable('DAT_SEARCH', $this->arrSession['search'][$this->strSearchSession]); + } + $objTemplate->setVariable('MAX_ID', '0'); + $objTemplate->setVariable('MIN_ID', '0'); + } + + /** + * Data list view - value insertions + * @param \HTML_Template_IT $objTemplate Form template object + * @param array $arrData Database values + * @param int $intDLCount1 Total count of data lines for one page + * @param int $intDLCount2 Total count of data lines (all data) + * @param string $strField1 Field name for data field 1 + * @param string $strField2 Field name for data field 2 + * @param int $intLimit Actual data char limit for field 2 + */ + public function listData( + $objTemplate, + $arrData, + $intDLCount1, + $intDLCount2, + $strField1, + $strField2, + $intLimit = 0 + ) { + // Template block names + $strTplPart = 'datatable'; + $strTplRow = 'datarow'; + if ($this->strTableName == 'tbl_host') { + $strTplPart = 'datatablehost'; + $strTplRow = 'datarowhost'; + } + if ($this->strTableName == 'tbl_service') { + $strTplPart = 'datatableservice'; + $strTplRow = 'datarowservice'; + } + if (($this->strTableName == 'tbl_user') || ($this->strTableName == 'tbl_group') || + ($this->strTableName == 'tbl_datadomain') || ($this->strTableName == 'tbl_configtarget')) { + $strTplPart = 'datatablecommon'; + $strTplRow = 'datarowcommon'; + } + // Some single replacements + $objTemplate->setVariable('IMAGE_PATH_HEAD', $this->arrSettings['path']['base_url']. 'images/'); + $objTemplate->setVariable('CELLCLASS_L', 'tdlb'); + $objTemplate->setVariable('CELLCLASS_M', 'tdmb'); + $objTemplate->setVariable('DISABLED', 'disabled'); + $objTemplate->setVariable('DATA_FIELD_1', translate('No data')); + $objTemplate->setVariable('DATA_FIELD_2', ' '); + $objTemplate->setVariable('DATA_REGISTERED', ' '); + $objTemplate->setVariable('DATA_ACTIVE', ' '); + $objTemplate->setVariable('DATA_FILE', ' '); + $objTemplate->setVariable('PICTURE_CLASS', 'elementHide'); + $objTemplate->setVariable('DOMAIN_SPECIAL', ' '); + $objTemplate->setVariable('SORT_BY', $this->intSortBy); + // Inserting data values + if ($intDLCount1 != 0) { + $intMinID = 0; + $intMaxID = 0; + for ($i=0; $i<$intDLCount1; $i++) { + // Get biggest and smalest value + if ($i == 0) { + $intMinID = $arrData[$i]['id']; + $intMaxID = $arrData[$i]['id']; + } + if ($arrData[$i]['id'] < $intMinID) { + $intMinID = $arrData[$i]['id']; + } + if ($arrData[$i]['id'] > $intMaxID) { + $intMaxID = $arrData[$i]['id']; + } + $objTemplate->setVariable('MAX_ID', $intMaxID); + $objTemplate->setVariable('MIN_ID', $intMinID); + // Line colours + $strClassL = 'tdld'; + $strClassM = 'tdmd'; + if ($i%2 == 1) { + $strClassL = 'tdlb'; + $strClassM = 'tdmb'; + } + if (isset($arrData[$i]['register']) && ($arrData[$i]['register'] == 0)) { + $strRegister = translate('No'); + } else { + $strRegister = translate('Yes'); + } + if ($arrData[$i]['active'] == 0) { + $strActive = translate('No'); + } else { + $strActive = translate('Yes'); + } + // Get file date for hosts and services + $intTimeInfo = 0; + $arrTimeData = array(); + if ($this->strTableName == 'tbl_host') { + $intReturn = $this->myConfigClass->lastModifiedDir( + $this->strTableName, + $arrData[$i]['host_name'], + $arrData[$i]['id'], + $arrTimeData, + $intTimeInfo + ); + if ($intReturn == 1) { + $this->strErrorMessage = $this->myConfigClass->strErrorMessage; + } + } + if ($this->strTableName == 'tbl_service') { + $intReturn = $this->myConfigClass->lastModifiedDir( + $this->strTableName, + $arrData[$i]['config_name'], + $arrData[$i]['id'], + $arrTimeData, + $intTimeInfo + ); + if ($intReturn == 1) { + $this->strErrorMessage = $this->myConfigClass->strErrorMessage; + } + } + // Set datafields + foreach ($this->arrDescription as $elem) { + $objTemplate->setVariable($elem['name'], $elem['string']); + } + if ($arrData[$i][$strField1] == '') { + $arrData[$i][$strField1] = 'NOT DEFINED - ' .$arrData[$i]['id']; + } + $objTemplate->setVariable('DATA_FIELD_1', htmlentities($arrData[$i][$strField1], ENT_COMPAT, 'UTF-8')); + $objTemplate->setVariable('DATA_FIELD_1S', addslashes(htmlentities( + $arrData[$i][$strField1], + ENT_COMPAT, + 'UTF-8' + ))); + if ($strField2 == 'process_field') { + $arrData[$i]['process_field'] = $this->processField($arrData[$i], $this->strTableName); + } else { + $objTemplate->setVariable('DATA_FIELD_2S', addslashes(htmlentities( + $arrData[$i][$strField2], + ENT_COMPAT, + 'UTF-8' + ))); + } + if ($intLimit != 0) { + if (\strlen($arrData[$i][$strField2]) > $intLimit) { + $strAdd = ' ...'; + } else { + $strAdd = ''; + } + $objTemplate->setVariable('DATA_FIELD_2', htmlentities(substr( + $arrData[$i][$strField2], + 0, + $intLimit + ), ENT_COMPAT, 'UTF-8').$strAdd); + } else { + $objTemplate->setVariable('DATA_FIELD_2', htmlentities( + $arrData[$i][$strField2], + ENT_COMPAT, + 'UTF-8' + )); + } + $objTemplate->setVariable('DATA_REGISTERED', $strRegister); + if (substr_count($this->strTableName, 'template') != 0) { + $objTemplate->setVariable('DATA_REGISTERED', '-'); + } + $objTemplate->setVariable('DATA_ACTIVE', $strActive); + $objTemplate->setVariable('DATA_FILE', ''.translate('out-of-date').''); + if ($intTimeInfo == 4) { + $objTemplate->setVariable('DATA_FILE', translate('no target')); + } + if ($intTimeInfo == 3) { + $objTemplate->setVariable('DATA_FILE', ''.translate('missed').''); + } + if ($intTimeInfo == 2) { + $objTemplate->setVariable('DATA_FILE', ''.translate('missed').''); + } + if ($intTimeInfo == 0) { + $objTemplate->setVariable('DATA_FILE', translate('up-to-date')); + } + $objTemplate->setVariable('LINE_ID', $arrData[$i]['id']); + $objTemplate->setVariable('CELLCLASS_L', $strClassL); + $objTemplate->setVariable('CELLCLASS_M', $strClassM); + $objTemplate->setVariable('IMAGE_PATH', $this->arrSettings['path']['base_url']. 'images/'); + $objTemplate->setVariable('PICTURE_CLASS', 'elementShow'); + $objTemplate->setVariable('DOMAIN_SPECIAL', ''); + $objTemplate->setVariable('DISABLED', ''); + // Disable common domain objects + if (isset($arrData[$i]['config_id'])) { + if ($arrData[$i]['config_id'] != $this->intDomainId) { + $objTemplate->setVariable('PICTURE_CLASS', 'elementHide'); + $objTemplate->setVariable('DOMAIN_SPECIAL', ' [common]'); + $objTemplate->setVariable('DISABLED', 'disabled'); + } else { + // Inactive items should not be written/downloaded + if ($arrData[$i]['active'] == 0) { + $objTemplate->setVariable('ACTIVE_CONTROL', 'elementHide'); + } + } + } + // Check access rights for list objects + if (isset($arrData[$i]['access_group'])) { + if ($this->myVisClass->checkAccountGroup($arrData[$i]['access_group'], 'write') != 0) { + $objTemplate->setVariable('LINE_CONTROL', 'elementHide'); + } + } else { + if ($this->intGlobalWriteAccess != 0) { + $objTemplate->setVariable('LINE_CONTROL', 'elementHide'); + } + } + // Check global access rights for list objects + if ($this->intGlobalWriteAccess != 0) { + $objTemplate->setVariable('LINE_CONTROL', 'elementHide'); + } + $objTemplate->parse($strTplRow); + } + } else { + $objTemplate->setVariable('IMAGE_PATH', $this->arrSettings['path']['base_url']. 'images/'); + $objTemplate->parse($strTplRow); + } + $objTemplate->setVariable('BUTTON_CLASS', 'elementShow'); + if ($this->intDomainId == 0) { + $objTemplate->setVariable('BUTTON_CLASS', 'elementHide'); + } + // Check access rights for adding new objects + if ($this->intGlobalWriteAccess != 0) { + $objTemplate->setVariable('ADD_CONTROL', 'disabled="disabled"'); + } + // Show page numbers + $objTemplate->setVariable('PAGES', $this->myVisClass->buildPageLinks(filter_input( + INPUT_SERVER, + 'PHP_SELF', + FILTER_SANITIZE_STRING + ), $intDLCount2, $this->intLimit, $this->intSortBy, $this->strSortDir)); + $objTemplate->parse($strTplPart); + $objTemplate->show($strTplPart); + } + + /** + * Display information messages + * @param \HTML_Template_IT $objTemplate Form template object + * @param string $strErrorMessage Error messages + * @param string $strInfoMessage Information messages + * @param string $strConsistMessage Consistency messages + * @param array $arrTimeData Time data array + * @param string $strTimeInfoString Time information message + * @param int $intNoTime Status value for showing time information (0 = show time) + */ + public function showMessages( + $objTemplate, + $strErrorMessage, + $strInfoMessage, + $strConsistMessage, + $arrTimeData, + $strTimeInfoString, + $intNoTime = 0 + ) { + // Display info messages + if ($strInfoMessage != '') { + $objTemplate->setVariable('INFOMESSAGE', $strInfoMessage); + $objTemplate->parse('infomessage'); + } + // Display error messages + if ($strErrorMessage != '') { + $objTemplate->setVariable('ERRORMESSAGE', $strErrorMessage); + $objTemplate->parse('errormessage'); + } + // Display time informations + if (($this->intDomainId != 0) && ($intNoTime == 0)) { + foreach ($arrTimeData as $key => $elem) { + if ($key == 'table') { + $objTemplate->setVariable('LAST_MODIFIED_TABLE', translate('Last database update:'). ' ' . + $elem. ''); + $objTemplate->parse('table_time'); + } else { + $objTemplate->setVariable('LAST_MODIFIED_FILE', translate('Last file change of the configuration '. + 'target '). ' ' .$key. ': ' .$elem. ''); + $objTemplate->parse('file_time'); + } + } + if ($strTimeInfoString != '') { + $objTemplate->setVariable('MODIFICATION_STATUS', $strTimeInfoString); + $objTemplate->parse('modification_status'); + } + } + // Display consistency messages + if ($strConsistMessage != '') { + $objTemplate->setVariable('CONSIST_USAGE', $strConsistMessage); + $objTemplate->parse('consistency'); + } + $objTemplate->parse('msgfooter'); + $objTemplate->show('msgfooter'); + } + + /** + * Display page footer + * @param \HTML_Template_IT $objTemplate Form template object + * @param string $setFileVersion NagiosQL version + */ + public function showFooter($objTemplate, $setFileVersion) + { + $objTemplate->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); + $objTemplate->parse('footer'); + $objTemplate->show('footer'); + } + + /** + * Single data form initialization + * @param \HTML_Template_IT $objTemplate Form template object + * @param string $strChbFields Comma separated string of checkbox value names + */ + public function addFormInit($objTemplate, $strChbFields = '') + { + // Language text replacements from fieldvars.php file + foreach ($this->arrDescription as $elem) { + $objTemplate->setVariable($elem['name'], $elem['string']); + } + // Some single replacements + $objTemplate->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); + $objTemplate->setVariable('IMAGE_PATH', $this->arrSettings['path']['base_url']. 'images/'); + $objTemplate->setVariable('DOCUMENT_ROOT', $this->arrSettings['path']['base_url']); + $objTemplate->setVariable('ACT_CHECKED', 'checked'); + $objTemplate->setVariable('REG_CHECKED', 'checked'); + $objTemplate->setVariable('MODUS', 'insert'); + $objTemplate->setVariable('VERSION', $this->intVersion); + $objTemplate->setVariable('LIMIT', $this->intLimit); + $objTemplate->setVariable('RELATION_CLASS', 'elementHide'); + $objTemplate->setVariable('IFRAME_SRC', $this->arrSettings['path']['base_url']. 'admin/commandline.php'); + // Some conditional replacements + if ($this->strBrowser != 'msie') { + $objTemplate->setVariable('MSIE_DISABLED', 'disabled="disabled"'); + } + if ($this->intGroupAdm == 0) { + $objTemplate->setVariable('RESTRICT_GROUP_ADMIN', 'class="elementHide"'); + } + if ($this->arrSettings['common']['seldisable'] == 0) { + $objTemplate->setVariable('MSIE_DISABLED', ''); + } + if ($this->arrSettings['common']['tplcheck'] == 0) { + $objTemplate->setVariable('CHECK_BYPASS', 'return true;'); + $objTemplate->setVariable('CHECK_BYPASS_NEW', '1'); + } else { + $objTemplate->setVariable('CHECK_BYPASS_NEW', '0'); + } + // Some replacements based on nagios version + if ($this->intVersion < 3) { + $objTemplate->setVariable('VERSION_20_VISIBLE', 'elementShow'); + $objTemplate->setVariable('VERSION_30_VISIBLE', 'elementHide'); + $objTemplate->setVariable('VERSION_40_VISIBLE', 'elementHide'); + $objTemplate->setVariable('VERSION_20_MUST', 'inpmust'); + $objTemplate->setVariable('VERSION_30_MUST', ''); + $objTemplate->setVariable('VERSION_40_MUST', ''); + $objTemplate->setVariable('VERSION_20_STAR', '*'); + $objTemplate->setVariable('NAGIOS_VERSION', '2'); + } + if ($this->intVersion >= 3) { + $objTemplate->setVariable('VERSION_20_VISIBLE', 'elementHide'); + $objTemplate->setVariable('VERSION_30_VISIBLE', 'elementShow'); + $objTemplate->setVariable('VERSION_40_VISIBLE', 'elementHide'); + $objTemplate->setVariable('VERSION_20_MUST', ''); + $objTemplate->setVariable('VERSION_30_MUST', 'inpmust'); + $objTemplate->setVariable('VERSION_40_MUST', ''); + $objTemplate->setVariable('VERSION_20_STAR', ''); + $objTemplate->setVariable('NAGIOS_VERSION', '3'); + } + if ($this->intVersion >= 4) { + $objTemplate->setVariable('VERSION_40_VISIBLE', 'elementShow'); + $objTemplate->setVariable('VERSION_40_MUST', 'inpmust'); + $objTemplate->setVariable('NAGIOS_VERSION', '4'); + } + // Checkbox and radio field value replacements + if ($strChbFields != '') { + foreach (explode(',', $strChbFields) as $elem) { + $objTemplate->setVariable('DAT_' .$elem. '0_CHECKED', ''); + $objTemplate->setVariable('DAT_' .$elem. '1_CHECKED', ''); + $objTemplate->setVariable('DAT_' .$elem. '2_CHECKED', 'checked'); + } + } + } + + /** + * Single data form - value insertion + * @param \HTML_Template_IT $objTemplate Form template object + * @param array $arrModifyData Database values + * @param int $intLocked Data is locked (0 = no / 1 = yes) + * @param string $strInfo Information string + * @param string $strChbFields Comma separated string of checkbox value names + */ + public function addInsertData($objTemplate, $arrModifyData, $intLocked, $strInfo, $strChbFields = '') + { + // Insert text data values + foreach ($arrModifyData as $key => $value) { + if (($key == 'active') || ($key == 'register') || ($key == 'last_modified') || ($key == 'access_rights')) { + continue; + } + $objTemplate->setVariable('DAT_' .strtoupper($key), htmlentities($value, ENT_QUOTES, 'UTF-8')); + } + // Insert checkbox data values + if (isset($arrModifyData['active']) && ($arrModifyData['active'] != 1)) { + $objTemplate->setVariable('ACT_CHECKED', ''); + } + if (isset($arrModifyData['register']) && ($arrModifyData['register'] != 1)) { + $objTemplate->setVariable('REG_CHECKED', ''); + } + // Deselect any checkboxes + if ($strChbFields != '') { + foreach (explode(',', $strChbFields) as $elem) { + $objTemplate->setVariable('DAT_' .$elem. '0_CHECKED', ''); + $objTemplate->setVariable('DAT_' .$elem. '1_CHECKED', ''); + $objTemplate->setVariable('DAT_' .$elem. '2_CHECKED', ''); + } + } + // Change some status values in locked data sets + if ($intLocked != 0) { + $objTemplate->setVariable('ACT_DISABLED', 'disabled'); + $objTemplate->setVariable('ACT_CHECKED', 'checked'); + $objTemplate->setVariable('ACTIVE', '1'); + $objTemplate->setVariable('CHECK_MUST_DATA', $strInfo); + $objTemplate->setVariable('RELATION_CLASS', 'elementShow'); + } + // Change mode to modify + $objTemplate->setVariable('MODUS', 'modify'); + // Check write permission + if ($this->intWriteAccessId == 1) { + $objTemplate->setVariable('DISABLE_SAVE', 'disabled="disabled"'); + } + if ($this->intGlobalWriteAccess == 1) { + $objTemplate->setVariable('DISABLE_SAVE', 'disabled="disabled"'); + } + } + + /** + * Process field view + * @param array $arrData Data array + * @param string $strTableName Table name + * @return string String includung field data + */ + public function processField($arrData, $strTableName) + { + $strField = ''; + $arrDataHosts = array(); + $arrDataHostgroups = array(); + $arrDataService = array(); + $arrDataServices = array(); + // Hostdependency table + if ($strTableName == 'tbl_hostdependency') { + if ($arrData['dependent_host_name'] != 0) { + $strSQLHost = 'SELECT `host_name`, `exclude` FROM `tbl_host` ' . + 'LEFT JOIN `tbl_lnkHostdependencyToHost_DH` ON `id`=`idSlave` ' . + 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `host_name`'; + $this->myDBClass->hasDataArray($strSQLHost, $arrDataHosts, $intDCHost); + if ($intDCHost != 0) { + foreach ($arrDataHosts as $elem) { + if ($elem['exclude'] == 1) { + $strField .= 'H:!' .$elem['host_name']. ','; + } else { + $strField .= 'H:' .$elem['host_name']. ','; + } + } + } + } + if ($arrData['dependent_hostgroup_name'] != 0) { + $strSQLHost = 'SELECT `hostgroup_name`, `exclude` FROM `tbl_hostgroup` ' . + 'LEFT JOIN `tbl_lnkHostdependencyToHostgroup_DH` ON `id`=`idSlave` ' . + 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `hostgroup_name`'; + $this->myDBClass->hasDataArray($strSQLHost, $arrDataHostgroups, $intDCHostgroup); + if ($intDCHostgroup != 0) { + foreach ($arrDataHostgroups as $elem) { + if ($elem['exclude'] == 1) { + $strField .= 'HG:!' .$elem['hostgroup_name']. ','; + } else { + $strField .= 'HG:' .$elem['hostgroup_name']. ','; + } + } + } + } + } + // Hostescalation table + if ($strTableName == 'tbl_hostescalation') { + if ($arrData['host_name'] != 0) { + $strSQLHost = 'SELECT `host_name` FROM `tbl_host` ' . + 'LEFT JOIN `tbl_lnkHostescalationToHost` ON `id`=`idSlave` ' . + 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `host_name`'; + $this->myDBClass->hasDataArray($strSQLHost, $arrDataHosts, $intDCHost); + if ($intDCHost != 0) { + foreach ($arrDataHosts as $elem) { + $strField .= 'H:' .$elem['host_name']. ','; + } + } + } + if ($arrData['hostgroup_name'] != 0) { + $strSQLHost = 'SELECT `hostgroup_name` FROM `tbl_hostgroup` ' . + 'LEFT JOIN `tbl_lnkHostescalationToHostgroup` ON `id`=`idSlave` ' . + 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `hostgroup_name`'; + $this->myDBClass->hasDataArray($strSQLHost, $arrDataHostgroups, $intDCHostgroup); + if ($intDCHostgroup != 0) { + foreach ($arrDataHostgroups as $elem) { + $strField .= 'HG:' .$elem['hostgroup_name']. ','; + } + } + } + } + // Servicedependency table + if ($strTableName == 'tbl_servicedependency') { + if ($arrData['dependent_service_description'] == 2) { + $strField .= '*'; + } elseif ($arrData['dependent_service_description'] != 0) { + $strSQLService = 'SELECT `strSlave` FROM `tbl_lnkServicedependencyToService_DS` ' . + 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `strSlave`'; + $this->myDBClass->hasDataArray($strSQLService, $arrDataService, $intDCService); + if ($intDCService != 0) { + foreach ($arrDataService as $elem) { + $strField .= $elem['strSlave']. ','; + } + } + } + if ($strField == '') { + $strSQLService = 'SELECT `servicegroup_name` FROM `tbl_servicegroup` ' . + 'LEFT JOIN `tbl_lnkServicedependencyToServicegroup_DS` ON `idSlave`=`id` ' . + 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `servicegroup_name`'; + $this->myDBClass->hasDataArray($strSQLService, $arrDataService, $intDCService); + if ($intDCService != 0) { + foreach ($arrDataService as $elem) { + $strField .= $elem['servicegroup_name']. ','; + } + } + } + } + // Serviceescalation table + if ($strTableName == 'tbl_serviceescalation') { + if ($arrData['service_description'] == 2) { + $strField .= '*'; + } elseif ($arrData['service_description'] != 0) { + $strSQLService = 'SELECT `strSlave` FROM `tbl_lnkServiceescalationToService` ' . + 'WHERE `idMaster`=' .$arrData['id']; + $this->myDBClass->hasDataArray($strSQLService, $arrDataServices, $intDCServices); + if ($intDCServices != 0) { + foreach ($arrDataServices as $elem) { + $strField .= $elem['strSlave']. ','; + } + } + } + if ($strField == '') { + $strSQLService = 'SELECT `servicegroup_name` FROM `tbl_servicegroup` ' . + 'LEFT JOIN `tbl_lnkServiceescalationToServicegroup` ON `idSlave`=`id` ' . + 'WHERE `idMaster`=' .$arrData['id']. ' ORDER BY `servicegroup_name`'; + $this->myDBClass->hasDataArray($strSQLService, $arrDataService, $intDCService); + if ($intDCService != 0) { + foreach ($arrDataService as $elem) { + $strField .= $elem['servicegroup_name']. ','; + } + } + } + } + // Some string manipulations - remove comma on line end + if (substr($strField, -1) == ',') { + $strField = substr($strField, 0, -1); + } + return $strField; + } +} diff --git a/functions/NagDataClass.php b/functions/NagDataClass.php new file mode 100644 index 0000000..0b5eb81 --- /dev/null +++ b/functions/NagDataClass.php @@ -0,0 +1,1600 @@ +intDomainId = $arrSession['domain']; + } + if (isset($arrSession['username'])) { + $this->strUserName = $arrSession['username']; + } + $this->arrSession = $arrSession; + } + + /** + * Saving a given string to the logbook + * @param string $strLogMessage Message string + * @return int 0 = successful / 1 = error + */ + public function writeLog($strLogMessage) + { + // Variable definition + $strRemoteAdress = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP); + $intReturn = 0; + // Write log message to database + if ($strRemoteAdress != null) { + // Webinterface + $strUserName = $this->strUserName; + $strDomain = $this->myDBClass->getFieldData('SELECT `domain` FROM `tbl_datadomain` ' . + 'WHERE `id`=' .$this->intDomainId); + $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',". + "`time`=NOW(), `ipadress`='".$strRemoteAdress."', `domain`='$strDomain',". + "`entry`='".addslashes($strLogMessage)."'"); + if ($booReturn == false) { + $intReturn = 1; + } + } else { + // Scriptinginterface + $strUserName = 'scripting'; + $strRemoteUser = filter_input(INPUT_SERVER, 'REMOTE_USER', FILTER_SANITIZE_STRING); + $strHostname = filter_input(INPUT_SERVER, 'REMOTE_HOST', FILTER_SANITIZE_STRING); + $strSSHClient = filter_input(INPUT_SERVER, 'SSH_CLIENT', FILTER_SANITIZE_STRING); + if ($strRemoteUser != null) { + $strUserName .= ' - ' .$strRemoteUser; + } + $strDomain = $this->myDBClass->getFieldData('SELECT `domain` FROM `tbl_datadomain` ' . + 'WHERE `id`=' .$this->intDomainId); + if ($strHostname != null) { + $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',". + "`time`=NOW(), `ipadress`='".$strHostname."', `domain`='$strDomain', ". + "`entry`='".addslashes($strLogMessage)."'"); + } elseif ($strSSHClient != null) { + $arrSSHClient = explode(' ', $strSSHClient); + $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',". + "`time`=NOW(), `ipadress`='".$arrSSHClient[0]."', `domain`='$strDomain', ". + "`entry`='".addslashes($strLogMessage)."'"); + } else { + $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',". + "`time`=NOW(), `ipadress`='unknown', `domain`='$strDomain', ". + "`entry`='".addslashes($strLogMessage)."'"); + } + if ($booReturn == false) { + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * Sends an SQL string to the database server + * @param string $strSQL SQL Command + * @param int $intDataID Data ID of last inserted dataset (by reference) + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function dataInsert($strSQL, &$intDataID) + { + //Define variables + $intReturn = 0; + // Send the SQL command to the database server + $booReturn = $this->myDBClass->insertData($strSQL); + $intDataID = $this->myDBClass->intLastId; + // Was the SQL command processed successfully? + if ($booReturn) { + $this->processClassMessage(translate('Data were successfully inserted to the data base!'). + '::', $this->strInfoMessage); + } else { + $this->processClassMessage(translate('Error while inserting the data into the database:'). + '::' .$this->myDBClass->strErrorMessage. '::', $this->strErrorMessage); + $intReturn = 1; + } + return $intReturn; + } + + /** + * Merge message strings and check for duplicate messages + * @param string $strNewMessage New message to add + * @param string $strOldMessage Modified message string (by reference) + */ + public function processClassMessage($strNewMessage, &$strOldMessage) + { + $strNewMessage = str_replace('::::', '::', $strNewMessage); + if (($strOldMessage != '') && ($strNewMessage != '')) { + if (substr_count($strOldMessage, $strNewMessage) == 0) { + $strOldMessage .= $strNewMessage; + } + } else { + $strOldMessage .= $strNewMessage; + } + } + + /** + * Copies one or more records in a data table. Alternatively, an individual record ID + * are specified, or the values of the $_POST['chbId_n'] variable is used where n + * is the record ID. + * @param string $strTableName Table name + * @param string $strKeyField Key field of the table + * @param int $intDataId Single data ID to copy + * @param int $intDomainId Target domain ID + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function dataCopyEasy($strTableName, $strKeyField, $intDataId = 0, $intDomainId = -1) + { + // Define variables + $arrRelations = array(); + $intError = 0; + $intNumber = 0; + $intReturn = 0; + $strAccess = $this->myVisClass->getAccessGroups('write'); + if ($intDomainId == -1) { + $intDomainId = $this->intDomainId; + } + // Get all data ID from target table + $strAccWhere = "WHERE `access_group` IN ($strAccess)"; + if (($strTableName == 'tbl_user') || ($strTableName == 'tbl_group')) { + $strAccWhere = ''; + } + $strSQL = 'SELECT `id` FROM `' .$strTableName."` $strAccWhere ORDER BY `id`"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn == false) { + $this->processClassMessage(translate('Error while selecting data from database:'). + '::' .$this->myDBClass->strErrorMessage. '::', $this->strErrorMessage); + return 1; + } + if ($intDataCount != 0) { + for ($i=0; $i<$intDataCount; $i++) { + // Skip common domain value + if ($arrData[$i]['id'] == 0) { + continue; + } + // Build the name of the form variable + $strChbName = 'chbId_' .$arrData[$i]['id']; + // If a form variable with this name exists or a matching single data ID was passed + if (((filter_input(INPUT_POST, $strChbName, FILTER_SANITIZE_STRING) != null) && ($intDataId == 0)) || + ($intDataId == $arrData[$i]['id'])) { + // Get all data of this data ID + $strSQL = 'SELECT * FROM `' .$strTableName. '` WHERE `id`=' .$arrData[$i]['id']; + $this->myDBClass->hasSingleDataset($strSQL, $arrData[$i]); + // Build a temporary config name + $strNewName = $this->buildTempConfigName( + $strTableName, + $strKeyField, + $intDomainId, + $intDataCount, + $arrData, + $i + ); + // Build the INSERT command based on the table name + $strSQLInsert = $this->buildInsertSQL( + $strTableName, + $strKeyField, + $intDomainId, + $strNewName, + $arrData, + $i + ); + // Insert the master dataset + $intCheck = 0; + $booReturn = $this->myDBClass->insertData($strSQLInsert); + $intMasterId = $this->myDBClass->intLastId; + if ($booReturn == false) { + $intCheck++; + } + // Copy relations + if (($this->tableRelations($strTableName, $arrRelations) == 0) && ($intCheck == 0)) { + foreach ($arrRelations as $elem) { + // Normal 1:n relation + if ($elem['type'] == '2') { + $intCheck = $this->insertRelationType2($arrData, $i, $elem, $intMasterId, $intCheck); + } elseif ($elem['type'] == '3') { // 1:n relation for templates + $intCheck = $this->insertRelationType3($arrData, $i, $elem, $intMasterId, $intCheck); + } elseif ($elem['type'] == '4') { // Special relation for free variables + $intCheck = $this->insertRelationType4($arrData, $i, $elem, $intMasterId, $intCheck); + } elseif ($elem['type'] == '5') { // 1:n relation for tbl_lnkServicegroupToService + $intCheck = $this->insertRelationType5($arrData, $i, $elem, $intMasterId, $intCheck); + } elseif ($elem['type'] == '6') { // 1:n relation for services + $intCheck = $this->insertRelationType6($arrData, $i, $elem, $intMasterId, $intCheck); + } + } + // 1:n relation for time definitions + if ($strTableName == 'tbl_timeperiod') { + $intCheck = $this->insertRelationTimedefinition($arrData, $i, $intMasterId, $intCheck); + } + // 1:n relation for groups + if ($strTableName == 'tbl_group') { + $intCheck = $this->insertRelationGroup($arrData, $i, $intMasterId, $intCheck); + } + // 1:n relation fot service to host connections + if ($strTableName == 'tbl_host') { + $intCheck = $this->insertRelationHost($arrData, $i, $intMasterId, $intCheck); + } + } + // Write logfile + if ($intCheck != 0) { + // Error + $intError++; + $this->writeLog(translate('Data set copy failed - table [new name]:'). ' ' .$strTableName + . ' [' .$strNewName. ']'); + $this->processClassMessage(translate('Data set copy failed - table [new name]:'). ' ' . + $strTableName. ' [' .$strNewName. ']::', $this->strInfoMessage); + } else { + // Success + $this->writeLog(translate('Data set copied - table [new name]:'). ' ' .$strTableName. + ' [' .$strNewName. ']'); + $this->processClassMessage(translate('Data set copied - table [new name]:'). ' ' . + $strTableName. ' [' .$strNewName. ']::', $this->strInfoMessage); + } + $intNumber++; + } + } + // Error processing + if ($intNumber > 0) { + if ($intError == 0) { + // Success + $this->processClassMessage(translate('Data were successfully inserted to the data base!') + . '::', $this->strInfoMessage); + $this->updateStatusTable($strTableName); + } else { + // Error + $this->processClassMessage(translate('Error while inserting the data into the database:') + . '::' .$this->myDBClass->strErrorMessage, $this->strInfoMessage); + $intReturn = 1; + } + } else { + $this->processClassMessage(translate('No dataset copied. Maybe the dataset does not exist or you do '. + 'not have write permission.'). '::', $this->strErrorMessage); + $intReturn = 1; + } + } else { + $this->processClassMessage(translate('No dataset copied. Maybe the dataset does not exist or you do not '. + 'have write permission.'). '::', $this->strErrorMessage); + $intReturn = 1; + } + return $intReturn; + } + + /** + * Returns an array of all datafields of a table, which has an 1:1 or 1:n relation + * to another table. + * @param string $strTable Table name + * @param array $arrRelations Array with relations + * @return int 0 = successful / 1 = error + */ + public function tableRelations($strTable, &$arrRelations) + { + // Define variable + $arrRelations = array(); + $arrData = array(); + $intDC = 0; + $intReturn = 1; + // Get relation data + $strSQL = "SELECT * FROM `tbl_relationinformation` WHERE `master`='$strTable' AND `fullRelation`=0"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booReturn && ($intDC != 0)) { + foreach ($arrData as $elem) { + $arrRelations[] = array('tableName1' => $elem['tableName1'], 'tableName2' => $elem['tableName2'], + 'fieldName' => $elem['fieldName'], 'linkTable' => $elem['linkTable'], + 'target1' => $elem['target1'], 'target2' => $elem['target2'], + 'type' => $elem['type']); + } + $intReturn = 0; + } + return $intReturn; + } + + /** + * Update the date inside the status table (used for last modified date) + * @param string $strTable Table name + * @return int 0 = successful / 1 = error + */ + public function updateStatusTable($strTable) + { + // Define variable + $arrData = array(); + $intDC = 0; + $intReturn = 1; + // Does the entry exist? + $strSQL = "SELECT * FROM `tbl_tablestatus` WHERE `tableName`='$strTable' AND `domainId`=".$this->intDomainId; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booReturn && ($intDC != 0)) { + $strSQL = 'UPDATE `tbl_tablestatus` SET `updateTime`=NOW() ' . + "WHERE `tableName`='$strTable' AND `domainId`=".$this->intDomainId; + $booReturn = $this->dataInsert($strSQL, $intDataID); + if ($booReturn) { + $intReturn = 0; + } + } elseif ($booReturn) { + $strSQL = 'INSERT INTO `tbl_tablestatus` ' . + "SET `updateTime`=NOW(), `tableName`='$strTable', `domainId`=".$this->intDomainId; + $booReturn = $this->dataInsert($strSQL, $intDataID); + if ($booReturn) { + $intReturn = 0; + } + } + return $intReturn; + } + + /** + * Removes one or more dataset(s) from a table. Optinal a single data ID can be passed or the values will be + * processed through the POST variable $_POST['chbId_n'] where 'n' represents the data ID. + * -> This function does not delete any relation data! <- + * @param string $strTableName Table name + * @param int $intDataId Single data ID + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function dataDeleteEasy($strTableName, $intDataId = 0) + { + // Define variables + $strNoDelete = ''; + $intReturn = 0; + $arrData = array(); + // Special rule for tables with "nodelete" cells + if (($strTableName == 'tbl_datadomain') || ($strTableName == 'tbl_configtarget') || + ($strTableName == 'tbl_user')) { + $strNoDelete = "AND `nodelete` <> '1'"; + } + // Delete a single data set + if ($intDataId != 0) { + $strSQL = 'DELETE FROM `' .$strTableName."` WHERE `id` = $intDataId $strNoDelete"; + $booReturn = $this->myDBClass->insertData($strSQL); + if ($booReturn == false) { + $this->processClassMessage(translate('Delete failed because a database error:'). + '::' .$this->myDBClass->strErrorMessage. '::', $this->strInfoMessage); + $intReturn = 1; + } elseif ($this->myDBClass->intAffectedRows == 0) { + $this->processClassMessage(translate('No data deleted. The dataset probably does not exist or '. + 'is protected from deletion.'). '::', $this->strErrorMessage); + $intReturn = 1; + } else { + $this->strInfoMessage .= translate('Dataset successfully deleted. Affected rows:'). ' ' . + $this->myDBClass->intAffectedRows. '::'; + $this->writeLog(translate('Delete dataset id:')." $intDataId ".translate('- from table:'). + " $strTableName ".translate('- with affected rows:'). ' ' .$this->myDBClass->intAffectedRows); + $this->updateStatusTable($strTableName); + } + // Delete data sets based on form POST parameter + } else { + $strSQL = 'SELECT `id` FROM `' .$strTableName. '` WHERE 1=1 '; + $strSQL .= $strNoDelete; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn && ($intDataCount != 0)) { + $intDeleteCount = 0; + foreach ($arrData as $elem) { + $strChbName = 'chbId_' .$elem['id']; + // Should this data id to be deleted? + if ((filter_input(INPUT_POST, $strChbName) != null) && + (filter_input(INPUT_POST, $strChbName, FILTER_SANITIZE_STRING) == 'on')) { + $strSQL = 'DELETE FROM `' .$strTableName. '` WHERE `id` = ' .$elem['id']; + $booReturn = $this->myDBClass->insertData($strSQL); + if ($booReturn == false) { + $this->processClassMessage(translate('Delete failed because a database error:'). + '::' .$this->myDBClass->strErrorMessage. '::', $this->strInfoMessage); + $intReturn = 1; + } else { + $intDeleteCount += $this->myDBClass->intAffectedRows; + } + } + } + // Process messsages + if ($intDeleteCount == 0) { + $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist or '. + 'it is protected from delete.'). '::', $this->strErrorMessage); + $intReturn = 1; + } elseif ($intReturn == 0) { + $this->processClassMessage(translate('Dataset successfully deleted. Affected rows:'). ' ' . + $intDeleteCount. '::', $this->strInfoMessage); + $this->writeLog(translate('Deleted data from table:')." $strTableName ". + translate('- with affected rows:'). ' ' .$this->myDBClass->intAffectedRows); + $this->updateStatusTable($strTableName); + } + } else { + $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist or it is '. + 'protected from delete.'). '::', $this->strErrorMessage); + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * Removes one or more dataset(s) from a table. Optinal a single data ID can be passed or the values will be + * processed through the POST variable $_POST['chbId_n'] where 'n' represents the data ID. + * -> This function does also delete relation data! <- + * @param string $strTableName Table name + * @param int $intDataId Single data ID + * @param int $intForce Force deletion (1 = force, 1 = no force) + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function dataDeleteFull($strTableName, $intDataId = 0, $intForce = 0) + { + // Define variables + $arrRelations = array(); + $arrData = array(); + $arrConfigId = array(); + // Get write access groups + $strAccess = $this->myVisClass->getAccessGroups('write'); + // Get all relations + $this->fullTableRelations($strTableName, $arrRelations); + // Get all datasets + if ($strTableName == 'tbl_group') { + $strSQL = 'SELECT `id` FROM `' .$strTableName. '`'; + } else { + $strSQL = 'SELECT `id` FROM `' .$strTableName. '` ' . + 'WHERE `config_id`=' .$this->intDomainId." AND `access_group` IN ($strAccess)"; + } + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn && ($intDataCount != 0)) { + $intDeleteCount = 0; + $strInfoMessage = ''; + $strErrorMessage = ''; + + foreach ($arrData as $elem) { + $strChbName = 'chbId_' .$elem['id']; + // Single ID + if (($intDataId != 0) && ($intDataId != $elem['id'])) { + continue; + } + // Should this data id to be deleted? + if ((($intDataId == $elem['id']) || ((filter_input(INPUT_POST, $strChbName) != null) && + (filter_input(INPUT_POST, $strChbName, FILTER_SANITIZE_STRING) == 'on'))) && + (($this->infoRelation($strTableName, $elem['id'], 'id', 1) == 0) || ($intForce == 1))) { + // Delete relations + if (!\is_array($arrRelations)) { + $arrRelations = array(); + } + foreach ($arrRelations as $rel) { + $strSQL = ''; + // Process flags + $arrFlags = explode(',', $rel['flags']); + // Simple 1:n relation + if ($arrFlags[3] == 1) { + $strSQL = 'DELETE FROM `' .$rel['tableName1']. '` ' . + 'WHERE `' .$rel['fieldName']. '`=' .$elem['id']; + } + // Simple 1:1 relation + if ($arrFlags[3] == 0) { + // Delete relation + if ($arrFlags[2] == 0) { + $strSQL = 'DELETE FROM `' .$rel['tableName1']. '` ' . + 'WHERE `' .$rel['fieldName']. '`=' .$elem['id']; + // Set slave to 0 + } elseif ($arrFlags[2] == 2) { + $strSQL = 'UPDATE `' .$rel['tableName1']. '` SET `' .$rel['fieldName']. '`=0 ' . + 'WHERE `' .$rel['fieldName']. '`=' .$elem['id']; + } + } + // Special 1:n relation for variables + if ($arrFlags[3] == 2) { + $strSQL = 'SELECT * FROM `' .$rel['tableName1']. '` WHERE `idMaster`=' .$elem['id']; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrData as $vardata) { + $strSQL = 'DELETE FROM `tbl_variabledefinition` ' . + 'WHERE `id`=' .$vardata['idSlave']; + $this->myDBClass->insertData($strSQL); + } + } + $strSQL = 'DELETE FROM `' .$rel['tableName1']. '` WHERE `idMaster`=' .$elem['id']; + } + // Special 1:n relation for time definitions + if ($arrFlags[3] == 3) { + $strSQL = 'DELETE FROM `tbl_timedefinition` WHERE `tipId`=' .$elem['id']; + $this->myDBClass->insertData($strSQL); + } + if ($strSQL != '') { + $this->myDBClass->insertData($strSQL); + } + } + // Delete host configuration file + if (($strTableName == 'tbl_host') && ($this->intDomainId != 0)) { + $strSQL = 'SELECT `host_name` FROM `tbl_host` WHERE `id`=' .$elem['id']; + $strHost = $this->myDBClass->getFieldData($strSQL); + $this->myConfigClass->getConfigSets($arrConfigId); + if ($arrConfigId != 1) { + $intReturn = 0; + foreach ($arrConfigId as $intConfigId) { + $intReturn += $this->myConfigClass->moveFile( + 'host', + $strHost. '.cfg', + $intConfigId + ); + } + if ($intReturn == 0) { + $this->processClassMessage(translate('The assigned, no longer used configuration '. + 'files were deleted successfully!'). '::', $strInfoMessage); + $this->writeLog(translate('Host file deleted:'). ' ' .$strHost. '.cfg'); + } else { + $strErrorMessage .= translate('Errors while deleting the old configuration file - '. + 'please check!:'). ' ::' .$this->myConfigClass->strErrorMessage . '::'; + } + } + } + // Delete service configuration file + if (($strTableName == 'tbl_service') && ($this->intDomainId != 0)) { + $strSQL = 'SELECT `config_name` FROM `tbl_service` WHERE `id`=' .$elem['id']; + $strService = $this->myDBClass->getFieldData($strSQL); + $strSQL = "SELECT * FROM `tbl_service` WHERE `config_name` = '$strService'"; + $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($intDataCount == 1) { + $this->myConfigClass->getConfigSets($arrConfigId); + if ($arrConfigId != 1) { + $intReturn = 0; + foreach ($arrConfigId as $intConfigId) { + $intReturn += $this->myConfigClass->moveFile( + 'service', + $strService. '.cfg', + $intConfigId + ); + } + if ($intReturn == 0) { + $this->processClassMessage(translate('The assigned, no longer used '. + 'configuration files were deleted successfully!'). + '::', $strInfoMessage); + $this->writeLog(translate('Host file deleted:'). ' ' .$strService. '.cfg'); + } else { + $strErrorMessage .= translate('Errors while deleting the old configuration '. + 'file - please check!:'). '::' . + $this->myConfigClass->strErrorMessage. '::'; + } + } + } + } + // Delete main entry + $strSQL = 'DELETE FROM `' .$strTableName. '` WHERE `id`=' .$elem['id']; + $this->myDBClass->insertData($strSQL); + $intDeleteCount++; + } + } + // Process messages + if ($intDeleteCount == 0) { + $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist, it is '. + 'protected from deletion, you do not have write permission or it has relations to other '. + 'configurations which cannot be deleted. Use the "info" function for detailed informations '. + 'about relations!'). '::', $this->strErrorMessage); + return 1; + } + + $this->updateStatusTable($strTableName); + $this->processClassMessage(translate('Dataset successfully deleted. Affected rows:'). ' ' . + $intDeleteCount. '::', $this->strInfoMessage); + $this->writeLog(translate('Deleted data from table:')." $strTableName ". + translate('- with affected rows:'). ' ' .$intDeleteCount); + $this->processClassMessage($strInfoMessage, $this->strInfoMessage); + $this->processClassMessage($strErrorMessage, $this->strErrorMessage); + return 0; + } + $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist, it is '. + 'protected from deletion or you do not have write permission.'). '::' . + $this->myDBClass->strErrorMessage, $this->strErrorMessage); + return 1; + } + + /** + * Returns an array with any data fields from a table with existing relations to another table. This function + * returns also passive relations which are not used in configurations. + * This function is used for a full deletion of a configuration entry or to find out if a configuration is used + * in another way. + * @param string $strTable Table name + * @param array $arrRelations Array with relations + * @return int 0 = no field with relation / 1 = at least one field with relation + * Status message is stored in message class variables + * Data array: tableName Table include the relation data + * fieldName Field name include the relation data + * flags Pos 1 -> 0=Normal field / 1=Required field (field type) + * Pos 2 -> 0=delete / 1=keep data / 2=set to 0 (normal deletion option) + * Pos 3 -> 0=delete / 2=set to 0 (force deletion option) + * Pos 4 -> 0=1:1 / 1=1:n / (relation type) + * 2=1:n (variables) / 3=1:n (timedef) + */ + public function fullTableRelations($strTable, &$arrRelations) + { + // Define variable + $arrRelations = array(); + $arrData = array(); + $intDC = 0; + $intReturn = 0; + // Get relation data + $strSQL = "SELECT * FROM `tbl_relationinformation` WHERE `master`='$strTable' AND `fullRelation`=1"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booReturn && ($intDC != 0)) { + foreach ($arrData as $elem) { + $arrRelations[] = array('tableName1' => $elem['tableName1'], 'fieldName' => $elem['fieldName'], + 'target1' => $elem['target1'], 'targetKey' => $elem['targetKey'], + 'flags' => $elem['flags']); + } + $intReturn = 1; + } + return $intReturn; + } + + /** + * Searches any relation in the database and returns them as relation information + * @param string $strTable Database table name + * @param int $intMasterId Data ID from master table + * @param string $strMasterfield Info field name from master table + * @param int $intReporting Output as text - 0=yes, 1=no + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function infoRelation($strTable, $intMasterId, $strMasterfield, $intReporting = 0) + { + $intDeletion = 0; + $arrDSCount = array(); + $arrRelations = array(); + $arrData = array(); + $arrDataCheck = array(); + $intReturn = $this->fullTableRelations($strTable, $arrRelations); + if ($intReturn == 1) { + // Get master field data + $strNewMasterfield = str_replace(',', '`,`', $strMasterfield); + $strSQL = 'SELECT `' .$strNewMasterfield. '` FROM `' .$strTable."` WHERE `id` = $intMasterId"; + $this->myDBClass->hasSingleDataset($strSQL, $arrSource); + if (substr_count($strMasterfield, ',') != 0) { + $arrTarget = explode(',', $strMasterfield); + $strName = $arrSource[$arrTarget[0]]. '-' .$arrSource[$arrTarget[1]]; + } else { + $strName = $arrSource[$strMasterfield]; + } + $this->strInfoMessage .= '' .translate('Relation information for '). + $strName.translate(' of table ').$strTable. ':::'; + $this->strInfoMessage .= ''; + // Walk through relations + foreach ($arrRelations as $elem) { + // Process flags + $arrFlags = explode(',', $elem['flags']); + if ($elem['fieldName'] == 'check_command') { + $strSQL = 'SELECT * FROM `' .$elem['tableName1']. '` ' . + 'WHERE SUBSTRING_INDEX(`' .$elem['fieldName']."`,'!',1)= $intMasterId"; + } else { + $strSQL = 'SELECT * FROM `' .$elem['tableName1']. '` WHERE `' .$elem['fieldName']."`= $intMasterId"; + } + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + // Take only used relations + if ($booReturn && ($intDataCount != 0)) { + // Relation type + if ($arrFlags[3] == 1) { + foreach ($arrData as $data) { + if ($elem['fieldName'] == 'idMaster') { + $strRef = 'idSlave'; + // Process special tables + if ($elem['target1'] == 'tbl_service') { + if ($elem['tableName1'] == 'tbl_lnkServicegroupToService') { + $strRef = 'idSlaveS'; + } + } elseif ($elem['target1'] == 'tbl_host') { + if ($elem['tableName1'] == 'tbl_lnkServicegroupToService') { + $strRef = 'idSlaveH'; + } + } elseif ($elem['target1'] == 'tbl_hostgroup') { + if ($elem['tableName1'] == 'tbl_lnkServicegroupToService') { + $strRef = 'idSlaveHG'; + } + } + } else { + $strRef = 'idMaster'; + } + // Get data + $strSQL = 'SELECT * FROM `' .$elem['tableName1']. '` ' . + 'LEFT JOIN `' .$elem['target1']. '` ON `' .$strRef. '` = `id` ' . + 'WHERE `' .$elem['fieldName']. '` = ' .$data[$elem['fieldName']]. ' ' . + 'AND `' .$strRef. '`=' .$data[$strRef]; + $this->myDBClass->hasSingleDataset($strSQL, $arrDSTarget); + if (substr_count($elem['targetKey'], ',') != 0) { + $arrTarget = explode(',', $elem['targetKey']); + $strTarget = $arrDSTarget[$arrTarget[0]]. '-' .$arrDSTarget[$arrTarget[1]]; + } else { + $strTarget = $arrDSTarget[$elem['targetKey']]; + } + // If the field is market as "required", check for any other entries + if ($arrFlags[0] == 1) { + $strSQL = 'SELECT * FROM `' .$elem['tableName1']. '` ' . + 'WHERE `' .$strRef. '` = ' .$arrDSTarget[$strRef]; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDSCount, $intDCCount); + if ($booReturn && ($intDCCount > 1)) { + $this->strInfoMessage .= translate('Relation to ').$elem['target1']. + translate(', entry ').$strTarget. + ' - ' .translate('deletion possible'). + '::'; + } else { + $this->strInfoMessage .= translate('Relation to ').$elem['target1']. + translate(', entry ').$strTarget. + ' - ' . + translate('deletion not possible'). '::'; + $intDeletion = 1; + } + } else { + $this->strInfoMessage .= translate('Relation to ').$elem['target1']. + translate(', entry ').$strTarget. ' - ' . + translate('deletion possible'). '::'; + } + } + } elseif ($arrFlags[3] == 0) { + // Fetch remote entry + $strSQL = 'SELECT * FROM `' .$elem['tableName1']. '` ' + . 'WHERE `' .$elem['fieldName']."`=$intMasterId"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataCheck, $intDCCheck); + if ($booReturn && ($intDCCheck != 0)) { + foreach ($arrDataCheck as $data) { + if (substr_count($elem['targetKey'], ',') != 0) { + $arrTarget = explode(',', $elem['targetKey']); + $strTarget = $data[$arrTarget[0]]. '-' .$data[$arrTarget[1]]; + } else { + $strTarget = $data[$elem['targetKey']]; + } + if ($arrFlags[0] == 1) { + $this->strInfoMessage .= translate('Relation to ').$elem['tableName1']. + translate(', entry ').$strTarget. + ' - ' . + translate('deletion not possible'). '::'; + $intDeletion = 1; + } else { + $this->strInfoMessage .= translate('Relation to ').$elem['tableName1']. + translate(', entry ').$strTarget. + ' - ' . + translate('deletion possible'). '::'; + } + } + } + } + } + } + $this->strInfoMessage .= '::'; + } + if ($intReporting == 1) { + $this->strInfoMessage = ''; + } + return $intDeletion; + } + + /** + * Inserts any necessary dataset for an 1:n (optional 1:n:n) relation to the database table + * @param string $strTable Database table name + * @param int $intMasterId Data ID from master table + * @param array $arrSlaveId Array with all data IDs from slave table + * @param int $intMulti 0 = for 1:n relations + * 1 = for 1:n:n relations + * @return int 0 = successful / 1 = error + */ + public function dataInsertRelation($strTable, $intMasterId, $arrSlaveId, $intMulti = 0) + { + // Define variables + $intReturn = 0; + $intDataId = 0; + $strSQL = ''; + // Walk through the slave data ID array + foreach ($arrSlaveId as $elem) { + // Pass empty and '*' values + if ($elem == '0') { + continue; + } + if ($elem == '*') { + continue; + } + // Process exclude values + if (0 === strpos($elem, 'e')) { + $elem = str_replace('e', '', $elem); + $intExclude = 1; + } else { + $intExclude = 0; + } + // Define the SQL statement + if ($intMulti != 0) { + $arrValues = explode('::', $elem); + $strSQL = 'INSERT INTO `' .$strTable."` SET `idMaster`=$intMasterId, `idSlaveH`=".$arrValues[0] + . ', `idSlaveHG`=' .$arrValues[1]. ', `idSlaveS`=' .$arrValues[2].", `exclude`=$intExclude"; + } else { + if (($strTable == 'tbl_lnkServicedependencyToService_DS') || + ($strTable == 'tbl_lnkServicedependencyToService_S') || + ($strTable == 'tbl_lnkServiceescalationToService')) { + // Get service description + $strSQLSrv = "SELECT `service_description` FROM `tbl_service` WHERE id=$elem"; + $strService = $this->myDBClass->getFieldData($strSQLSrv); + $strSQL = 'INSERT INTO `' .$strTable."` SET `idMaster`=$intMasterId, `idSlave`=$elem, ". + "`strSlave`='".addslashes($strService)."', `exclude`=$intExclude"; + } elseif (($strTable == 'tbl_lnkServiceToService') || + ($strTable == 'tbl_lnkServicetemplateToService')) { + $arrValues = explode('-', $elem); + if (isset($arrValues[0]) && isset($arrValues[1])) { + $strSQL = 'INSERT INTO `' .$strTable."` SET `idMaster`=$intMasterId, `idSlave`=$arrValues[0], " + ." `idHost`=$arrValues[1]"; + } + } elseif (($strTable != 'tbl_lnkTimeperiodToTimeperiod') && + ($strTable != 'tbl_lnkDatadomainToConfigtarget')) { + $strSQL = 'INSERT INTO `' . $strTable . '` ' . + "SET `idMaster`=$intMasterId, `idSlave`=$elem, `exclude`=$intExclude"; + } else { + $strSQL = 'INSERT INTO `' .$strTable."` SET `idMaster`=$intMasterId, `idSlave`=$elem"; + } + } + // Insert data + $intReturn = $this->dataInsert($strSQL, $intDataId); + if ($intReturn != 0) { + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * Update the datasets for 1:n (optional 1:n:m) relations in the database table + * @param string $strTable Database table name + * @param int $intMasterId Data ID from master table + * @param array $arrSlaveId Array with all data IDs from slave table + * @param int $intMulti 0 = for 1:n relations + * 1 = for 1:n:n relations + * @return int 0 = successful / 1 = error + */ + public function dataUpdateRelation($strTable, $intMasterId, $arrSlaveId, $intMulti = 0) + { + $intReturn = 0; + // Remove any old relations + $intReturn1 = $this->dataDeleteRelation($strTable, $intMasterId); + if ($intReturn1 != 0) { + $intReturn = 1; + } + // Insert the new relations + if ($intReturn == 0) { + $intReturn2 = $this->dataInsertRelation($strTable, $intMasterId, $arrSlaveId, $intMulti); + if ($intReturn2 != 0) { + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * Removes any relation from the database + * @param string $strTable Database table name + * @param int $intMasterId Data ID from master table + * @return int 0 = successful / 1 = error + */ + public function dataDeleteRelation($strTable, $intMasterId) + { + // Define variables + $intDataId = 0; + // Define the SQL statement + $strSQL = 'DELETE FROM `' .$strTable."` WHERE `idMaster`=$intMasterId"; + return $this->dataInsert($strSQL, $intDataId); + } + + /** + * Deactivates one or many datasets in the table be setting 'active' to '0'. Alternatively, a single record + * ID can be specified or evaluated by the values of $_POST['chbId_n'] passed parameters, where n is the + * record ID must match. + * @param string $strTableName Table name + * @param int $intDataId Individual record ID, which is to be activate + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function dataDeactivate($strTableName, $intDataId = 0) + { + // Define variables + $intReturn = 1; + $arrData = array(); + // Get write access groups + $strAccess = $this->myVisClass->getAccessGroups('write'); + // Activate datasets + $strSQL = 'SELECT `id` FROM `' .$strTableName. '` ' . + 'WHERE `config_id`=' .$this->intDomainId." AND `access_group` IN ($strAccess)"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn && ($intDataCount != 0)) { + $intActivateCount = 0; + foreach ($arrData as $elem) { + $strChbName = 'chbId_' .$elem['id']; + // was the current record is marked for activate? + if ((($intDataId == $elem['id']) || ((filter_input(INPUT_POST, $strChbName) != null) && + (filter_input(INPUT_POST, $strChbName, FILTER_SANITIZE_STRING) == 'on'))) && + $this->infoRelation($strTableName, $elem['id'], 'id', 1) == 0) { + // Update dataset + if (($strTableName == 'tbl_service') || ($strTableName == 'tbl_host')) { + $strSQL = 'UPDATE `' .$strTableName."` SET `active`='0', `last_modified`=now() ". + 'WHERE `id`=' .$elem['id']; + } else { + $strSQL = 'UPDATE `' .$strTableName."` SET `active`='0' WHERE `id`=".$elem['id']; + } + $this->myDBClass->insertData($strSQL); + $intActivateCount++; + } + } + // Process informations + if ($intActivateCount == 0) { + $this->processClassMessage(translate('No dataset deactivated. Maybe the dataset does not exist, it '. + 'is protected from deactivation, no dataset was selected or you do not have write permission. '. + 'Use the "info" function for detailed informations about relations!'). + '::', $this->strErrorMessage); + } else { + $this->updateStatusTable($strTableName); + $this->processClassMessage(translate('Dataset successfully deactivated. Affected rows:'). ' ' . + $intActivateCount. '::', $this->strInfoMessage); + $this->writeLog(translate('Deactivate dataset from table:')." $strTableName ". + translate('- with affected rows:'). ' ' .$this->myDBClass->intAffectedRows); + $intReturn = 0; + } + } else { + $this->processClassMessage(translate('No dataset deactivated. Maybe the dataset does not exist or you '. + 'do not have write permission.'). '::', $this->strErrorMessage); + } + return $intReturn; + } + + /** + * Activates one or many datasets in the table be setting 'active' to '1'. Alternatively, a single record ID can + * be specified or evaluated by the values of $_POST['chbId_n'] passed parameters, where n is the record ID must + * match. + * @param string $strTableName Table name + * @param int $intDataId Individual record ID, which is to be activate + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function dataActivate($strTableName, $intDataId = 0) + { + // Define variables + $intReturn = 1; + $arrData = array(); + // Get write access groups + $strAccess = $this->myVisClass->getAccessGroups('write'); + // Activate datasets + $strSQL = 'SELECT `id` FROM `' .$strTableName. '` ' . + 'WHERE `config_id`=' .$this->intDomainId." AND `access_group` IN ($strAccess)"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn && ($intDataCount != 0)) { + $intActivateCount = 0; + foreach ($arrData as $elem) { + $strChbName = 'chbId_' .$elem['id']; + // was the current record is marked for activate? + if (($intDataId == $elem['id']) || ((filter_input(INPUT_POST, $strChbName) != null) && + (filter_input(INPUT_POST, $strChbName, FILTER_SANITIZE_STRING) == 'on'))) { + // Update dataset + if (($strTableName == 'tbl_service') || ($strTableName == 'tbl_host')) { + $strSQL = 'UPDATE `' .$strTableName."` SET `active`='1', `last_modified`=now() ". + 'WHERE `id`=' .$elem['id']; + } else { + $strSQL = 'UPDATE `' .$strTableName."` SET `active`='1' WHERE `id`=".$elem['id']; + } + $this->myDBClass->insertData($strSQL); + $intActivateCount++; + } + } + // Process informations + if ($intActivateCount == 0) { + $this->processClassMessage(translate('No dataset activated. Maybe the dataset does not exist, no '. + 'dataset was selected or you do not have write permission.'). '::', $this->strErrorMessage); + } else { + $this->updateStatusTable($strTableName); + $this->processClassMessage(translate('Dataset successfully activated. Affected rows:'). ' ' . + $intActivateCount. '::', $this->strInfoMessage); + $this->writeLog(translate('Activate dataset from table:')." $strTableName ". + translate('- with affected rows:'). ' ' .$this->myDBClass->intAffectedRows); + $intReturn = 0; + } + } else { + $this->processClassMessage(translate('No dataset activated. Maybe the dataset does not exist or you do '. + 'not have write permission.'). '::', $this->strErrorMessage); + } + return $intReturn; + } + + /** + * Updates the hash field im some configuration objects + * @param string $strTable Table name + * @param int $intId Data ID + * @return int 0 = successful / 1 = error + * Status message is stored in message class variables + */ + public function updateHash($strTable, $intId) + { + // Define variables + $strRawString = ''; + $arrData = array(); + $intDC = 0; + $intDataID = 0; + // Service table + if ($strTable == 'tbl_service') { + // Get any hosts and host_groups + $strSQL = 'SELECT `host_name` AS `item_name` FROM `tbl_host` ' . + "LEFT JOIN `tbl_lnkServiceToHost` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION SELECT `hostgroup_name` AS `item_name` FROM `tbl_hostgroup` ' . + 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `idSlave`=`id` ' . + 'WHERE `idMaster`=' .$intId. ' ORDER BY `item_name`'; + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booRet && ($intDC != 0)) { + foreach ($arrData as $elem) { + $strRawString .= $elem['item_name']. ','; + } + } + $strSQL = 'SELECT * FROM `tbl_service` WHERE `id`=' .$intId; + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booRet && ($intDC != 0)) { + if ($arrData[0]['service_description'] != '') { + $strRawString .= $arrData[0]['service_description']. ','; + } + if ($arrData[0]['display_name'] != '') { + $strRawString .= $arrData[0]['display_name']. ','; + } + if ($arrData[0]['check_command'] != '') { + $arrField = explode('!', $arrData[0]['check_command']); + $strCommand = strstr($arrData[0]['check_command'], '!'); + $strSQLRel = 'SELECT `command_name` FROM `tbl_command` WHERE `id`=' .$arrField[0]; + $strName = $this->myDBClass->getFieldData($strSQLRel); + $strRawString .= $strName.$strCommand. ','; + } + } + } + if (($strTable == 'tbl_hostdependency') || ($strTable == 'tbl_servicedependency')) { + // Get * values + $strSQL = 'SELECT * FROM `' .$strTable. '` WHERE `id`=' .$intId; + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booRet && ($intDC != 0)) { + if (isset($arrData[0]['dependent_host_name']) && ($arrData[0]['dependent_host_name'] == 2)) { + $strRawString .= 'any,'; + } + if (isset($arrData[0]['dependent_hostgroup_name']) && ($arrData[0]['dependent_hostgroup_name'] == 2)) { + $strRawString .= 'any,'; + } + if (isset($arrData[0]['host_name']) && ($arrData[0]['host_name'] == 2)) { + $strRawString .= 'any,'; + } + if (isset($arrData[0]['hostgroup_name']) && ($arrData[0]['hostgroup_name'] == 2)) { + $strRawString .= 'any,'; + } + if (isset($arrData[0]['dependent_service_description']) && + ($arrData[0]['dependent_service_description'] == 2)) { + $strRawString .= 'any,'; + } + if (isset($arrData[0]['service_description']) && ($arrData[0]['service_description'] == 2)) { + $strRawString .= 'any,'; + } + } + if ($strTable == 'tbl_hostdependency') { + // Get any hosts and host_groups + $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' . + "LEFT JOIN `tbl_lnkHostdependencyToHost_DH` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' . + "LEFT JOIN `tbl_lnkHostdependencyToHostgroup_DH` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' . + "LEFT JOIN `tbl_lnkHostdependencyToHost_H` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' . + 'LEFT JOIN `tbl_lnkHostdependencyToHostgroup_H` ON `idSlave`=`id` WHERE `idMaster`=' .$intId; + } + if ($strTable == 'tbl_servicedependency') { + // Get any hosts and host_groups + $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' . + "LEFT JOIN `tbl_lnkServicedependencyToHost_DH` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' . + 'LEFT JOIN `tbl_lnkServicedependencyToHostgroup_DH` ON `idSlave`=`id` ' . + "WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' . + "LEFT JOIN `tbl_lnkServicedependencyToHost_H` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' . + 'LEFT JOIN `tbl_lnkServicedependencyToHostgroup_H` ON `idSlave`=`id` ' . + "WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `strSlave` AS `item_name`, exclude ' . + "FROM `tbl_lnkServicedependencyToService_DS` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `strSlave` AS `item_name`, exclude ' . + "FROM `tbl_lnkServicedependencyToService_S` WHERE `idMaster`=$intId"; + } + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booRet && ($intDC != 0)) { + foreach ($arrData as $elem) { + if ($elem['exclude'] == 0) { + $strRawString .= $elem['item_name']. ','; + } else { + $strRawString .= 'not_' .$elem['item_name']. ','; + } + } + $strRawString = substr($strRawString, 0, -1); + } + } + if (($strTable == 'tbl_hostescalation') || ($strTable == 'tbl_serviceescalation')) { + // Get * values + $strSQL = 'SELECT * FROM `' .$strTable. '` WHERE `id`=' .$intId; + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booRet && ($intDC != 0)) { + if (isset($arrData[0]['host_name']) && ($arrData[0]['host_name'] == 2)) { + $strRawString .= 'any,'; + } + if (isset($arrData[0]['hostgroup_name']) && ($arrData[0]['hostgroup_name'] == 2)) { + $strRawString .= 'any,'; + } + if (isset($arrData[0]['contacts']) && ($arrData[0]['contacts'] == 2)) { + $strRawString .= 'any,'; + } + if (isset($arrData[0]['contact_groups']) && ($arrData[0]['contact_groups'] == 2)) { + $strRawString .= 'any,'; + } + if (isset($arrData[0]['service_description']) && ($arrData[0]['service_description'] == 2)) { + $strRawString .= 'any,'; + } + } + // Get any hosts, host_groups, contacts and contact_groups + if ($strTable == 'tbl_hostescalation') { + $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' . + "LEFT JOIN `tbl_lnkHostescalationToHost` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' . + "LEFT JOIN `tbl_lnkHostescalationToHostgroup` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `contact_name` AS `item_name`, exclude FROM `tbl_contact` ' . + "LEFT JOIN `tbl_lnkHostescalationToContact` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `contactgroup_name` AS `item_name`, exclude FROM `tbl_contactgroup` ' . + "LEFT JOIN `tbl_lnkHostescalationToContactgroup` ON `idSlave`=`id` WHERE `idMaster`=$intId"; + } + if ($strTable == 'tbl_serviceescalation') { + $strSQL = 'SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` ' . + "LEFT JOIN `tbl_lnkServiceescalationToHost` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` ' . + "LEFT JOIN `tbl_lnkServiceescalationToHostgroup` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `contact_name` AS `item_name`, exclude FROM `tbl_contact` ' . + "LEFT JOIN `tbl_lnkServiceescalationToContact` ON `idSlave`=`id` WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `contactgroup_name` AS `item_name`, exclude FROM `tbl_contactgroup` ' . + 'LEFT JOIN `tbl_lnkServiceescalationToContactgroup` ON `idSlave`=`id` ' . + "WHERE `idMaster`=$intId ". + 'UNION ALL SELECT `strSlave` AS `item_name`, exclude ' . + "FROM `tbl_lnkServiceescalationToService` WHERE `idMaster`=$intId"; + } + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booRet && ($intDC != 0)) { + foreach ($arrData as $elem) { + if ($elem['exclude'] == 0) { + $strRawString .= $elem['item_name']. ','; + } else { + $strRawString .= 'not_' .$elem['item_name']. ','; + } + } + $strRawString = substr($strRawString, 0, -1); + } + } + if ($strTable == 'tbl_serviceextinfo') { + // Get any hosts and host_groups + $strSQL = 'SELECT `tbl_host`.`host_name` AS `item_name` FROM `tbl_host` ' . + 'LEFT JOIN `tbl_serviceextinfo` ON `tbl_host`.`id`=`tbl_serviceextinfo`.`host_name` ' . + "WHERE `tbl_serviceextinfo`.`id`=$intId ". + 'UNION SELECT `tbl_service`.`service_description` AS `item_name` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_serviceextinfo` ON ' . + '`tbl_service`.`id`=`tbl_serviceextinfo`.`service_description` ' . + "WHERE `tbl_serviceextinfo`.`id`=$intId ORDER BY `item_name`"; + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booRet && ($intDC != 0)) { + foreach ($arrData as $elem) { + $strRawString .= $elem['item_name']. ','; + } + $strRawString = substr($strRawString, 0, -1); + } + } + // Remove blanks + while (substr_count($strRawString, ' ') != 0) { + $strRawString = str_replace(' ', '', $strRawString); + } + // Sort hash string + $arrTemp = explode(',', $strRawString); + sort($arrTemp); + $strRawString = implode(',', $arrTemp); + // Update has in database + $strSQL = 'UPDATE `' .$strTable."` SET `import_hash`='".sha1($strRawString)."' WHERE `id`='$intId'"; + //echo "Hash: ".$strRawString." --> ".sha1($strRawString)."
"; + return $this->dataInsert($strSQL, $intDataID); + } + + /** + * PRIVATE functions + */ + + /** + * Manually set some NULL values based on field names (key) + * @param string $strTableName Table name + * @param string $key Data key (field name) + * @param string $value Data value (field key) + * @return NULL|string Manipulated data value + */ + private function setNullValues($strTableName, $key, $value) + { + $arrNull = array('normal_check_interval', 'retry_check_interval', 'max_check_attempts', 'low_flap_threshold', + 'high_flap_threshold', 'freshness_threshold', 'notification_interval', 'first_notification_delay', + 'check_interval', 'retry_interval'); + if (\in_array($key, $arrNull, true) && ($value == '')) { + $value = 'NULL'; + } + // manually set some NULL values based on table name + if (($strTableName == 'tbl_serviceextinfo') && ($key == 'service_description')) { + $value = '0'; + } + // Do not copy the password in tbl_user + if (($strTableName == 'tbl_user') && ($key == 'password')) { + $value = 'xxxxxxx'; + } + // Do not copy nodelete and webserver authentification values in tbl_user + if ($key == 'nodelete') { + $value = '0'; + } + if ($key == 'wsauth') { + $value = '0'; + } + return $value; + } + + /** + * Insert a normal 1:n relation + * @param array $arrData Database value array + * @param integer $intID Database array key + * @param array $elem Link table information + * @param integer $intMasterId Data ID of master table + * @param integer $intCheck Check error counter (before processing) + * @return integer Check error counter (after processing) + */ + private function insertRelationType2($arrData, $intID, $elem, $intMasterId, $intCheck) + { + $arrRelData = array(); + $intRelDataCount = 0; + if ($arrData[$intID][$elem['fieldName']] != 0) { + $strSQL = 'SELECT `idSlave`, `exclude` FROM `' .$elem['linkTable']. '` ' . + 'WHERE `idMaster`=' .$arrData[$intID]['id']; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrRelData, $intRelDataCount); + if ($booReturn && ($intRelDataCount != 0)) { + foreach ($arrRelData as $elem2) { + $strSQLRel = 'INSERT INTO `' . $elem['linkTable'] . '` ' . + "SET `idMaster`=$intMasterId, `idSlave`=" . $elem2['idSlave'] . ', ' . + '`exclude`=' . $elem2['exclude']; + $booReturn = $this->myDBClass->insertData($strSQLRel); + if ($booReturn == false) { + $intCheck++; + } + } + } + } + return $intCheck; + } + + /** + * Insert a 1:n relation for templates + * @param array $arrData Database value array + * @param integer $intID Database array key + * @param array $elem Link table information + * @param integer $intMasterId Data ID of master table + * @param integer $intCheck Check error counter (before processing) + * @return integer Check error counter (after processing) + */ + private function insertRelationType3($arrData, $intID, $elem, $intMasterId, $intCheck) + { + $arrRelData = array(); + $intRelDataCount = 0; + if ($arrData[$intID][$elem['fieldName']] == 1) { + $strSQL = 'SELECT `idSlave`,`idSort`,`idTable` FROM `' . $elem['linkTable'] . '` ' . + 'WHERE `idMaster`=' . $arrData[$intID]['id']; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrRelData, $intRelDataCount); + if ($booReturn && ($intRelDataCount != 0)) { + foreach ($arrRelData as $elem2) { + $strSQLRel = 'INSERT INTO `' . $elem['linkTable'] . '` ' . + "SET `idMaster`=$intMasterId, `idSlave`=" . $elem2['idSlave'] . ', ' . + '`idTable`=' . $elem2['idTable'] . ', `idSort`=' . $elem2['idSort']; + $booReturn = $this->myDBClass->insertData($strSQLRel); + if ($booReturn == false) { + $intCheck++; + } + } + } + } + return $intCheck; + } + + /** + * Insert a special relation for free variables + * @param array $arrData Database value array + * @param integer $intID Database array key + * @param array $elem Link table information + * @param integer $intMasterId Data ID of master table + * @param integer $intCheck Check error counter (before processing) + * @return integer Check error counter (after processing) + */ + private function insertRelationType4($arrData, $intID, $elem, $intMasterId, $intCheck) + { + $arrRelData = array(); + $arrDataVar = array(); + $intRelDataCount = 0; + $intDCVar = 0; + if ($arrData[$intID][$elem['fieldName']] != 0) { + $strSQL = 'SELECT `idSlave` FROM `' . $elem['linkTable'] . '` ' . + 'WHERE `idMaster` = ' . $arrData[$intID]['id']; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrRelData, $intRelDataCount); + if ($booReturn && ($intRelDataCount != 0)) { + foreach ($arrRelData as $elem2) { + // Copy variables and link them to the new master + $strSQLVar = 'SELECT * FROM `tbl_variabledefinition` WHERE `id`=' . $elem2['idSlave']; + $booReturn = $this->myDBClass->hasDataArray($strSQLVar, $arrDataVar, $intDCVar); + if ($booReturn && ($intDCVar != 0)) { + $strSQLInsVar = 'INSERT INTO `tbl_variabledefinition` ' . + "SET `name`='" . addslashes($arrDataVar[0]['name']) . "', " . + "`value`='" . addslashes($arrDataVar[0]['value']) . "', " . + '`last_modified`=NOW()'; + $booReturn = $this->myDBClass->insertData($strSQLInsVar); + if ($booReturn == false) { + $intCheck++; + } + $strSQLRel = 'INSERT INTO `' . $elem['linkTable'] . '` ' . + "SET `idMaster`=$intMasterId, " . + '`idSlave`=' . $this->myDBClass->intLastId; + $booReturn = $this->myDBClass->insertData($strSQLRel); + if ($booReturn == false) { + $intCheck++; + } + } + } + } + } + return $intCheck; + } + + /** + * Insert a 1:n relation for tbl_lnkServicegroupToService + * @param array $arrData Database value array + * @param integer $intID Database array key + * @param array $elem Link table information + * @param integer $intMasterId Data ID of master table + * @param integer $intCheck Check error counter (before processing) + * @return integer Check error counter (after processing) + */ + private function insertRelationType5($arrData, $intID, $elem, $intMasterId, $intCheck) + { + $arrRelData = array(); + $intRelDataCount = 0; + if ($arrData[$intID][$elem['fieldName']] != 0) { + $strSQL = 'SELECT `idSlaveH`,`idSlaveHG`,`idSlaveS` ' . + 'FROM `' . $elem['linkTable'] . '` WHERE `idMaster`=' . $arrData[$intID]['id']; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrRelData, $intRelDataCount); + if ($booReturn && ($intRelDataCount != 0)) { + foreach ($arrRelData as $elem2) { + $strSQLRel = 'INSERT INTO `' . $elem['linkTable'] . '` ' . + "SET `idMaster`=$intMasterId, `idSlaveH`=" . $elem2['idSlaveH'] . ', ' . + '`idSlaveHG`=' . $elem2['idSlaveHG'] . ', `idSlaveS`=' . $elem2['idSlaveS']; + $booReturn = $this->myDBClass->insertData($strSQLRel); + if ($booReturn == false) { + $intCheck++; + } + } + } + } + return $intCheck; + } + + /** + * Insert a 1:n relation for services + * @param array $arrData Database value array + * @param integer $intID Database array key + * @param array $elem Link table information + * @param integer $intMasterId Data ID of master table + * @param integer $intCheck Check error counter (before processing) + * @return integer Check error counter (after processing) + */ + private function insertRelationType6($arrData, $intID, $elem, $intMasterId, $intCheck) + { + $arrRelData = array(); + $intRelDataCount = 0; + if ($arrData[$intID][$elem['fieldName']] != 0) { + $strSQL = 'SELECT `idSlave`, `strSlave`, `exclude` ' . + 'FROM `' . $elem['linkTable'] . '` WHERE `idMaster`=' . $arrData[$intID]['id']; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrRelData, $intRelDataCount); + if ($booReturn && ($intRelDataCount != 0)) { + foreach ($arrRelData as $elem2) { + $strSQLRel = 'INSERT INTO `' . $elem['linkTable'] . '` ' . + "SET `idMaster`=$intMasterId, `idSlave`=" . $elem2['idSlave'] . ', ' . + "`strSlave`='" . addslashes($elem2['strSlave']) . "', " . + '`exclude`=' . $elem2['exclude']; + $booReturn = $this->myDBClass->insertData($strSQLRel); + if ($booReturn == false) { + $intCheck++; + } + } + } + } + return $intCheck; + } + + /** + * Insert a 1:n relation for time definitions + * @param array $arrData Database value array + * @param integer $intID Database array key + * @param integer $intMasterId Data ID of master table + * @param integer $intCheck Check error counter (before processing) + * @return integer Check error counter (after processing) + */ + private function insertRelationTimedefinition($arrData, $intID, $intMasterId, $intCheck) + { + $arrRelDataTP = array(); + $intRelDataCountTP = 0; + $strSQL = 'SELECT * FROM `tbl_timedefinition` WHERE `tipId`=' . $arrData[$intID]['id']; + $this->myDBClass->hasDataArray($strSQL, $arrRelDataTP, $intRelDataCountTP); + if ($intRelDataCountTP != 0) { + foreach ($arrRelDataTP as $elem) { + $strSQLRel = 'INSERT INTO `tbl_timedefinition` (`tipId`,`definition`,`range`,' . + "`last_modified`) VALUES ($intMasterId,'" . addslashes($elem['definition']) . "'," . + "'" . addslashes($elem['range']) . "',now())"; + $booReturn = $this->myDBClass->insertData($strSQLRel); + if ($booReturn == false) { + $intCheck++; + } + } + } + return $intCheck; + } + + /** + * Insert a 1:n relation for user groups + * @param array $arrData Database value array + * @param integer $intID Database array key + * @param integer $intMasterId Data ID of master table + * @param integer $intCheck Check error counter (before processing) + * @return integer Check error counter (after processing) + */ + private function insertRelationGroup($arrData, $intID, $intMasterId, $intCheck) + { + $arrRelDataTP = array(); + $intRelDataCountTP = 0; + $strSQL = 'SELECT * FROM `tbl_lnkGroupToUser` WHERE `idMaster`=' . $arrData[$intID]['id']; + $this->myDBClass->hasDataArray($strSQL, $arrRelDataTP, $intRelDataCountTP); + if ($intRelDataCountTP != 0) { + foreach ($arrRelDataTP as $elem2) { + $strSQLRel = 'INSERT INTO `tbl_lnkGroupToUser` (`idMaster`,`idSlave`,`read`,`write`,`link`) ' . + "VALUES ($intMasterId,'" . $elem2['idSlave'] . "','" . $elem2['read'] . "',". + "'" . $elem2['write'] . "','" . $elem2['link'] . "')"; + $booReturn = $this->myDBClass->insertData($strSQLRel); + if ($booReturn == false) { + $intCheck++; + } + } + } + return $intCheck; + } + + /** + * Insert a 1:n relation fot service to host connections + * @param array $arrData Database value array + * @param integer $intID Database array key + * @param integer $intMasterId Data ID of master table + * @param integer $intCheck Check error counter (before processing) + * @return integer Check error counter (after processing) + */ + private function insertRelationHost($arrData, $intID, $intMasterId, $intCheck) + { + $arrRelDataSH = array(); + $intRelDataCountSH = 0; + $strSQL = 'SELECT * FROM `tbl_lnkServiceToHost` WHERE `idSlave`=' . $arrData[$intID]['id']; + $this->myDBClass->hasDataArray($strSQL, $arrRelDataSH, $intRelDataCountSH); + if ($intRelDataCountSH != 0) { + foreach ($arrRelDataSH as $elem2) { + $strSQLRel = 'INSERT INTO `tbl_lnkServiceToHost` (`idMaster`,`idSlave`,`exclude`) ' . + "VALUES ('" . $elem2['idMaster'] . "',$intMasterId,'" . $elem2['exclude'] . "')"; + $booReturn = $this->myDBClass->insertData($strSQLRel); + if ($booReturn == false) { + $intCheck++; + } + } + } + return $intCheck; + } + + /** + * Build an INSERT command based on the table name + * @param string $strTableName Table name + * @param string $strKeyField Configuration field name + * @param int $intDomainId Domain ID + * @param string $strNewName New configuration name + * @param array $arrData Data array + * @param int $intID Data array key + * @return string SQL INSERT command + */ + private function buildInsertSQL($strTableName, $strKeyField, $intDomainId, $strNewName, $arrData, $intID) + { + $strSQLInsert = 'INSERT INTO `' . $strTableName . '` SET `' . $strKeyField . "`='" . $strNewName . "'"; + /** @noinspection ForeachSourceInspection */ + foreach ($arrData[$intID] as $key => $value) { + if (($key != $strKeyField) && ($key != 'active') && ($key != 'last_modified') && + ($key != 'id') && ($key != 'config_id')) { + // manually set some NULL values based on field names + $value = $this->setNullValues($strTableName, $key, $value); + // If the data value is not "NULL", add single quotes to the value + if ($value != 'NULL') { + $strSQLInsert .= ',`' . $key . "`='" . addslashes($value) . "'"; + } else { + $strSQLInsert .= ',`' . $key . '`=' . $value; + } + } + } + if (($strTableName == 'tbl_user') || ($strTableName == 'tbl_group') || + ($strTableName == 'tbl_datadomain') || ($strTableName == 'tbl_configtarget')) { + $strSQLInsert .= ",`active`='0', `last_modified`=NOW()"; + } else { + $strSQLInsert .= ",`active`='0', `config_id`=$intDomainId, `last_modified`=NOW()"; + } + return $strSQLInsert; + } + + /** + * Build a temporary configuration name + * @param string $strTableName Table name + * @param string $strKeyField Configuration field name + * @param int $intDomainId Domain ID + * @param int $intCount Dataset counter + * @param array $arrData Data array + * @param int $intID Data array key + * @return string Temporary configuration name + */ + private function buildTempConfigName($strTableName, $strKeyField, $intDomainId, $intCount, $arrData, $intID) + { + // Define variables + $strNewName = ''; + for ($y = 1; $y <= $intCount; $y++) { + $strNewName = $arrData[$intID][$strKeyField] . " ($y)"; + if (($strTableName == 'tbl_user') || ($strTableName == 'tbl_group') || + ($strTableName == 'tbl_datadomain') || ($strTableName == 'tbl_configtarget')) { + $strSQL = 'SELECT `id` FROM `' . $strTableName . '` WHERE `' . $strKeyField . "`='$strNewName'"; + $booReturn = $this->myDBClass->getFieldData($strSQL); + } else { + $strSQL = 'SELECT `id` FROM `' . $strTableName . '` ' . + 'WHERE `' . $strKeyField . "`='$strNewName' AND `config_id`=$intDomainId"; + $booReturn = $this->myDBClass->getFieldData($strSQL); + } + // If the name is unused -> break the loop + if ($booReturn == false) { + break; + } + } + // Manually overwrite new name for extinfo tables + if ($strTableName == 'tbl_hostextinfo') { + $strNewName = '0'; + } + if ($strTableName == 'tbl_serviceextinfo') { + $strNewName = '0'; + } + return $strNewName; + } +} diff --git a/functions/NagImportClass.php b/functions/NagImportClass.php new file mode 100644 index 0000000..5ae3a55 --- /dev/null +++ b/functions/NagImportClass.php @@ -0,0 +1,1946 @@ +arrSettings = $arrSession['SETS']; + } + if (isset($arrSession['domain'])) { + $this->intDomainId = $arrSession['domain']; + } + } + + /** + * Import a config file and writes the values to the database + * @param string $strFileNameRaw Import file name + * @param int $intConfigId Configuration set id + * @param int $intOverwrite 0 = Do not replace existing data + * 1 = Replace existing data in tables + * @return int 0 = successful / 1 = error + * Status messages are stored in class variables + */ + public function fileImport($strFileNameRaw, $intConfigId, $intOverwrite = 0) + { + // Define variables + $intBlock = 0; + $intRemoveTmp = 0; + $strImportFile = ''; + $strConfLineTemp = ''; + $strBlockKey = ''; + $arrData = array(); + $strFileName = trim($strFileNameRaw); + // Get file + $intReturn = $this->getImportFile($intConfigId, $strFileName, $strImportFile, $intRemoveTmp); + // Open and read config file + if ($intReturn == 0) { + $resFile = fopen($strImportFile, 'rb'); + $intMultiple = 0; + while ($resFile && !feof($resFile)) { + // Read line and remove blank chars + $strConfLine = trim(fgets($resFile)); + // Process multi-line configuration instructions + if (substr($strConfLine, -1) == '\\') { + if ($intMultiple == 0) { + $strConfLineTemp = str_replace("\\", ',', $strConfLine); + $intMultiple = 1; + } else { + $strConfLineTemp .= str_replace("\\", ',', $strConfLine); + } + continue; + } + if ($intMultiple == 1) { + $strConfLine = $strConfLineTemp.$strConfLine; + $intMultiple = 0; + } + // Find NAGIOSQL variable + if (substr_count($strConfLine, '#NAGIOSQL_') != 0) { + $strConfLine = str_replace('#NAGIOSQL_CONFIG_NAME', '_NAGIOSQL_CONFIG_NAME', $strConfLine); + } + // Pass comments and empty lines + if (0 === strpos($strConfLine, '#')) { + continue; + } + if ($strConfLine == '') { + continue; + } + if (($intBlock == 1) && ($strConfLine == '{')) { + continue; + } + // Process line (remove blanks and cut comments) + $strLineTmp = str_replace("\;", ':semi:', $strConfLine); + $arrLine = preg_split("/[\s]+/", $strLineTmp); + $arrTemp = explode(';', implode(' ', $arrLine)); + $strNewLine = str_replace(':semi:', "\;", trim($arrTemp[0])); + // Find block begin + if ($arrLine[0] == 'define') { + $intBlock = 1; + $strBlockKey = str_replace('{', '', $arrLine[1]); + $arrData = array(); + continue; + } + // Store the block data to an array + if (($intBlock == 1) && ($arrLine[0] != '}')) { + $strExclude = 'template_name,alias,name,use'; + if (($strBlockKey == 'timeperiod') && (!\in_array($arrLine[0], explode(',', $strExclude), true))) { + $arrNewLine = explode(' ', $strNewLine); + $strTPKey = str_replace(' ' .$arrNewLine[\count($arrNewLine)-1], '', $strNewLine); + $strTPValue = $arrNewLine[\count($arrNewLine)-1]; + $arrData[$strTPKey] = array('key' => $strTPKey, + 'value' => $strTPValue); + } else { + $key = $arrLine[0]; + $value = str_replace($arrLine[0]. ' ', '', $strNewLine); + // Special retry_check_interval, normal_check_interval + if ($key == 'retry_check_interval') { + $key = 'retry_interval'; + } + if ($key == 'normal_check_interval') { + $key = 'check_interval'; + } + $arrData[$arrLine[0]] = array('key' => $key, 'value' => $value); + } + } + // Process data at end of block + if ((substr_count($strConfLine, '}') == 1) && ($arrData !== null) && \is_array($arrData)) { + $intBlock = 0; + $intRetVal = $this->importTable($strBlockKey, $arrData, $intOverwrite); + if ($intRetVal != 0) { + $intReturn = 1; + } + } elseif ($arrData === null) { + $this->strErrorMessage .= translate('No valid configuration found:'). ' ' .$strFileName. '::'; + $intReturn = 1; + } + } + if ($intRemoveTmp == 1) { + unlink($strImportFile); + } + } else { + $this->strErrorMessage .= translate('Import file does not exist or is not readable:'). ' ' .$strFileName + . '::'; + $intReturn = 1; + } + return $intReturn; + } + + // PRIVATE functions + + /** + * @param int $intConfigId Configuration set id + * @param string $strFileName Configuration file name + * @param string|bool $strImportFile Temporary file for data import (by reference) + * @param int $intRemoveTmp Remove temporary file (1 = yes / 0 = no) (by reference) + * @return int 0 = successful / 1 = error + * Status messages are stored in class variables + */ + private function getImportFile($intConfigId, $strFileName, &$strImportFile, &$intRemoveTmp) + { + $intMethod = 1; + $intReturn = 0; + $intRemoveTmp = 0; + $strImportFile = ''; + $strImportFileTmp = ''; + // File transfer method + if (substr_count($strFileName, 'nagiosql_local_imp') == 1) { + $intMethod = 1; + $intRetVal = 0; + } else { + $intRetVal = $this->myConfigClass->getConfigData($intConfigId, 'method', $intMethod); + } + if ($intRetVal != 0) { + $this->strErrorMessage .= translate('Unable to get configuration data:'). ' method::'; + $intReturn = 1; + } + if ($intReturn == 0) { + // Read import file + if ($intMethod == 1) { // Local file system + if (!is_readable($strFileName)) { + $this->strErrorMessage .= translate('Cannot open the data file (check the permissions)!'). ' ' . + $strFileName. '::'; + $intReturn = 1; + } else { + $strImportFileTmp = $strFileName; + } + } elseif ($intMethod == 2) { // FTP access + // Open ftp connection + $intRetVal = $this->myConfigClass->getFTPConnection($intConfigId); + if ($intRetVal != 0) { + $this->strErrorMessage .= $this->myConfigClass->strErrorMessage; + $intReturn = 1; + } else { + // Transfer file from remote server to a local temp file + if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) { + $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql_imp'); + } else { + $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql_imp'); + } + if (!ftp_get($this->myConfigClass->resConnectId, $strConfigFile, $strFileName, FTP_ASCII)) { + $this->strErrorMessage .= translate('Cannot receive the configuration file (FTP connection)!'). + '::'; + ftp_close($this->myConfigClass->resConnectId); + $intReturn = 1; + } else { + $intRemoveTmp = 1; + $strImportFileTmp = $strConfigFile; + } + } + } elseif ($intMethod == 3) { // SSH Access + // Open ssh connection + $intRetVal = $this->myConfigClass->getSSHConnection($intConfigId); + if ($intRetVal != 0) { + $this->strErrorMessage .= $this->myConfigClass->strErrorMessage; + $intReturn = 1; + } else { + // Transfer file from remote server to a local temp file + if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) { + $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql_imp'); + } else { + $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql_imp'); + } + if (!ssh2_scp_recv($this->myConfigClass->resConnectId, $strFileName, $strConfigFile)) { + $this->strErrorMessage .= translate('Cannot receive the configuration file (SSH connection)!'). + '::'; + $intReturn = 1; + } else { + $intRemoveTmp = 1; + $strImportFileTmp = $strConfigFile; + } + } + } + // Open and read config file + if (file_exists($strImportFileTmp) && is_readable($strImportFileTmp)) { + $strImportFile = $strImportFileTmp; + } else { + $intReturn = 1; + $intRemoveTmp = 0; + } + } + return $intReturn; + } + + /** + * Writes the block data to the database + * @param string $strBlockKey Config key (from define) + * @param array $arrImportData Imported block data + * @param int $intOverwrite 0 = Do not replace existing data + * 1 = Replace existing data in tables + * @return int 0 = successful / 1 = error + * Status messages are stored in class variables + */ + private function importTable($strBlockKey, $arrImportData, $intOverwrite) + { + // Define variables + $intIsTemplate = 0; + $intExists = 0; + $intInsertRelations = 0; + $intInsertVariables = 0; + $strHash = ''; + $strConfigName = ''; + $arrImportRelations = array(); + $arrFreeVariables = array(); + $arrRelations = array(); + // Block data from template or real configuration? + if (array_key_exists('name', $arrImportData) && (isset($arrImportData['register']) && + ($arrImportData['register']['value'] == 0))) { + $intIsTemplate = 1; + } + // Get table name and key for import + $intReturn = $this->getTableData($strBlockKey, $intIsTemplate, $strTable, $strKeyField); + if ($intReturn == 0) { + // Create an import hash if no key field is available + if ($strKeyField == '') { + $this->createHash($strTable, $arrImportData, $strHash, $strConfigName); + $arrImportData['config_name']['key'] = 'config_name'; + $arrImportData['config_name']['value'] = $strConfigName; + $strKeyField = 'config_name'; + } else { + $strHash = ''; + } + // Get relation data + $intRelation = $this->myDataClass->tableRelations($strTable, $arrRelations); + // Does this entry already exist? + if (($intIsTemplate == 0) && ($strKeyField != '') && isset($arrImportData[$strKeyField])) { + if ($strHash == '') { + // Special key field values + if ($strBlockKey == 'hostextinfo') { + $strSQL = 'SELECT `id`FROM `tbl_host` ' . + "WHERE `host_name`='".$arrImportData[$strKeyField]['value']."'"; + $intHost = (int)$this->myDBClass->getFieldData($strSQL); + $strSQL = 'SELECT `id` FROM `' .$strTable. '` ' . + 'WHERE `config_id`=' .$this->intDomainId. ' AND `' .$strKeyField."`='".$intHost."'"; + } else { + $strSQL = 'SELECT `id` FROM `' .$strTable. '` ' . + 'WHERE `config_id`=' .$this->intDomainId. ' AND ' . + '`' .$strKeyField."`='".$arrImportData[$strKeyField]['value']."'"; + } + } else { + $strSQL = 'SELECT `id` FROM `' .$strTable. '` ' . + 'WHERE `config_id`=' .$this->intDomainId." AND `import_hash`='".$strHash."'"; + } + $intExists = $this->myDBClass->getFieldData($strSQL); + if ($intExists == false) { + $intExists = 0; + } + } elseif (($intIsTemplate == 1) && ($strKeyField != '') && isset($arrImportData['name'])) { + $strSQL = 'SELECT `id` FROM `' .$strTable. '` ' . + 'WHERE `config_id`=' .$this->intDomainId. ' AND ' . + "`template_name`='".$arrImportData['name']['value']."'"; + $intExists = $this->myDBClass->getFieldData($strSQL); + if ($intExists == false) { + $intExists = 0; + } + } + // Entry exsists but should not be overwritten + if (($intExists != 0) && ($intOverwrite == 0)) { + if ($strKeyField == 'config_name') { + $strSQLConfig = 'SELECT `config_name` FROM `' .$strTable. '` WHERE `id`=' .$intExists; + $arrImportData[$strKeyField]['value'] = $this->myDBClass->getFieldData($strSQLConfig); + } + $this->strInfoMessage .= translate('Entry'). ' ' .$strKeyField. ' -> ' . + $arrImportData[$strKeyField]['value']. ' ' .translate('inside'). ' ' . + $strTable. ' ' .translate('exists and were not overwritten'). '::'; + } elseif (isset($arrImportData[$strKeyField]) && ($arrImportData[$strKeyField] == '*')) { + // Do not write "*" values + $this->strInfoMessage .= translate('Entry'). ' ' .$strKeyField. ' -> ' . + $arrImportData[$strKeyField]['value']. ' ' .translate('inside'). ' ' . + $strTable. ' ' .translate('were not written'). '::'; + } else { + // Define SQL statement - part 1 + $this->getSQLPart1( + $arrImportData, + $strHash, + $intExists, + $strTable, + $strKeyField, + $intRelation, + $arrRelations, + $strSQL1, + $strSQL2 + ); + // Read command configurations + list($strVCValues, $intWriteConfig, $strVIValues, $strRLValues, $strVWValues) = + $this->getImportValues($arrImportData, $strKeyField, $strSQL1, $strTable); + + + // Build value statemets + foreach ($arrImportData as $elem) { + // Write text values + $intCheckVC = $this->writeTextValues( + $elem, + $strVCValues, + $strSQL1, + $intIsTemplate, + $intExists, + $strTable + ); + // Write status values + $intCheckVI = $this->writeStatusValues($elem, $strVIValues, $strSQL1); + // Write integer values + $intCheckVW = $this->writeIntegerValues($elem, $strVWValues, $strSQL1); + // Write relations + $intCheckRel = $this->writeRelations($elem, $strRLValues, $arrImportRelations, $intInsertRelations); + // Write free variables + $intCheck = $intCheckVC+$intCheckVI+$intCheckVW+$intCheckRel; + if ($intCheck == 0) { + $arrTemp = array(); + $arrTemp['key'] = $elem['key']; + $arrTemp['value'] = $elem['value']; + $arrFreeVariables[] = $arrTemp; + $intInsertVariables = 1; + } + } + $strTemp1 = ''; + $strTemp2 = ''; + // Update database + if ($intWriteConfig == 1) { + $booResult = $this->myDBClass->insertData($strSQL1.$strSQL2); + } else { + $booResult = false; + } + if ($strKeyField == '') { + $strKey = $strConfigName; + } else { + $strKey = $strKeyField; + } + if ($booResult != true) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + if ($strKeyField != '') { + $this->strErrorMessage .= translate('Entry'). ' ' .$strKey. ' -> ' . + $arrImportData[$strKeyField]['value']. ' ' .translate('inside'). + ' ' .$strTable. ' ' .translate('could not be inserted:'). ' ' . + $this->myDBClass->strErrorMessage. '::'; + } + if ($strKeyField == '') { + $this->strErrorMessage .= translate('Entry'). ' ' .$strTemp1. ' -> ' . + $strTemp2.translate('inside'). ' ' .$strTable. ' ' .$strTable. + ' ' .translate('could not be inserted:'). ' ' .$this->myDBClass->strErrorMessage. '::'; + } + return 1; + } + if ($strKeyField != '') { + $this->strInfoMessage .= translate('Entry'). ' ' .$strKey. ' -> ' . + $arrImportData[$strKeyField]['value']. ' ' .translate('inside'). + ' ' .$strTable. ' ' .translate('successfully inserted'). '::'; + } + if ($strKeyField == '') { + $this->strInfoMessage .= translate('Entry'). ' ' .$strTemp1. ' -> ' . + $strTemp2. ' ' .translate('inside'). ' ' .$strTable. + ' ' .translate('successfully inserted'). '::'; + } + // Define data ID + if ($intExists != 0) { + $intDataId = $intExists; + } else { + $intDataId = $this->myDBClass->intLastId; + } + // Are there any relations to be filled in? + if ($intInsertRelations == 1) { + foreach ($arrImportRelations as $elem) { + foreach ($arrRelations as $reldata) { + if ($reldata['fieldName'] == $elem['key']) { + $strValue = $elem['value']; + $strKey = $elem['key']; + if ($elem['key'] == 'check_command') { + $this->writeRelation5($strValue, $intDataId, $strTable, $reldata); + } elseif ($reldata['type'] == 1) { + $this->writeRelation1( + $strKey, + $strValue, + $intDataId, + $strTable, + $reldata, + $arrImportData + ); + } elseif ($reldata['type'] == 2) { + $this->writeRelation2($strKey, $strValue, $intDataId, $strTable, $reldata); + } elseif ($reldata['type'] == 3) { + $this->writeRelation3($strValue, $intDataId, $strTable, $reldata); + } elseif ($reldata['type'] == 4) { + $this->writeRelation4($strKey, $strValue, $intDataId, $strTable, $reldata); + } elseif ($reldata['type'] == 5) { + $this->writeRelation6($strValue, $intDataId, $strTable, $reldata); + } elseif ($reldata['type'] == 6) { + $this->writeRelation7($strValue, $intDataId, $strTable, $reldata); + } elseif ($reldata['type'] == 7) { + $this->writeRelation8($strValue, $intDataId, $strTable, $reldata); + } + } + } + } + } + // Are there any free variables ore time definitions to be filled in? + if ($intInsertVariables == 1) { + if ($strTable == 'tbl_timeperiod') { + // Remove old values + $strSQL = "DELETE FROM `tbl_timedefinition` WHERE `tipId` = $intDataId"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + foreach ($arrFreeVariables as $elem) { + $strSQL = "INSERT INTO `tbl_timedefinition` SET `tipId` = $intDataId, ". + "`definition` = '".addslashes($elem['key'])."', ". + "`range` = '".addslashes($elem['value'])."'"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } + } else { + foreach ($arrFreeVariables as $elem) { + foreach ($arrRelations as $reldata) { + if ($reldata['type'] == 4) { + $this->writeRelation4( + $elem['key'], + $elem['value'], + $intDataId, + $strTable, + $reldata + ); + } + } + } + } + } + // Update Table times + $this->myDataClass->updateStatusTable($strTable); + } + } + return $intReturn; + } + + /** + * Get table name and key for import + * @param string $strBlockKey Block data key + * @param int $intIsTemplate Template data 1 = yes / 0 - no + * @param string $strTable Template name + * @param string $strKeyField Table key name + * @return int 0 = successful / 1 = error + */ + private function getTableData($strBlockKey, $intIsTemplate, &$strTable, &$strKeyField) + { + // Define variables + $intReturn = 0; + $arrTableData['command'] = array('tbl_command', 'command_name'); + $arrTableData['contactgroup'] = array('tbl_contactgroup', 'contactgroup_name'); + $arrTableData['contact'] = array('tbl_contact', 'contact_name'); + $arrTableData['timeperiod'] = array('tbl_timeperiod', 'timeperiod_name'); + $arrTableData['host'] = array('tbl_host', 'host_name'); + $arrTableData['service'] = array('tbl_service', ''); + $arrTableData['hostgroup'] = array('tbl_hostgroup', 'hostgroup_name'); + $arrTableData['servicegroup'] = array('tbl_servicegroup', 'servicegroup_name'); + $arrTableData['hostescalation'] = array('tbl_hostescalation', ''); + $arrTableData['serviceescalation'] = array('tbl_serviceescalation', ''); + $arrTableData['hostdependency'] = array('tbl_hostdependency', ''); + $arrTableData['servicedependency'] = array('tbl_servicedependency', ''); + $arrTableData['hostextinfo'] = array('tbl_hostextinfo', 'host_name'); + $arrTableData['serviceextinfo'] = array('tbl_serviceextinfo', ''); + $arrTableData['contactgroup'] = array('tbl_contactgroup', 'contactgroup_name'); + $arrTableDataTpl['contact'] = array('tbl_contacttemplate', 'name'); + $arrTableDataTpl['host'] = array('tbl_hosttemplate', 'name'); + $arrTableDataTpl['service'] = array('tbl_servicetemplate', 'name'); + + // Define table name and key + if (($intIsTemplate == 0) && isset($arrTableData[$strBlockKey])) { + $strTable = $arrTableData[$strBlockKey][0]; + /** @noinspection MultiAssignmentUsageInspection */ + $strKeyField = $arrTableData[$strBlockKey][1]; + } elseif (($intIsTemplate == 1) && isset($arrTableDataTpl[$strBlockKey])) { + $strTable = $arrTableDataTpl[$strBlockKey][0]; + /** @noinspection MultiAssignmentUsageInspection */ + $strKeyField = $arrTableDataTpl[$strBlockKey][1]; + } else { + $this->strErrorMessage .= translate('Table for import definition').$strBlockKey. + translate('is not available!') . '::'; + $intReturn = 1; + } + return $intReturn; + } + + /** + * Create a unique data hash from table data + * @param $strTable + * @param $arrBlockData + * @param $strHash + * @param $strConfigName + */ + public function createHash($strTable, $arrBlockData, &$strHash, &$strConfigName) + { + $strRawString = ''; + $strConfigName = 'imp_temporary'; + if ($strTable == 'tbl_service') { + // HASH from any host, any hostgroup and service description - step 1 + if (isset($arrBlockData['host_name'])) { + $strRawString .= $arrBlockData['host_name']['value']. ','; + } + if (isset($arrBlockData['hostgroup_name'])) { + $strRawString .= $arrBlockData['hostgroup_name']['value']. ','; + } + // Replace *, + and ! in HASH raw string + $strRawString = str_replace(array('*,', '!', '+'), array('any,', 'not_', ''), $strRawString); + // Create configuration name from NagiosQL variable if exists + if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) { + $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value']; + } else { + // Create configuration name from first two hosts / hostgroups + $arrConfig = explode(',', $strRawString); + if (isset($arrConfig[0]) && ($arrConfig[0] != '')) { + $strConfigName = 'imp_' .$arrConfig[0]; + } + if (isset($arrConfig[1]) && ($arrConfig[1] != '')) { + $strConfigName .= '_' .$arrConfig[1]; + } + } + // HASH from any host, any hostgroup and service description - step 2 + if (isset($arrBlockData['service_description'])) { + $strRawString .= $arrBlockData['service_description']['value']. ','; + } + if (isset($arrBlockData['display_name'])) { + $strRawString .= $arrBlockData['display_name']['value']. ','; + } + if (isset($arrBlockData['check_command'])) { + $strRawString .= $arrBlockData['check_command']['value']. ','; + } + } + if (($strTable == 'tbl_hostdependency') || ($strTable == 'tbl_servicedependency')) { + $strRawString1 = ''; + $strRawString2 = ''; + $strRawString3 = ''; + // HASH from any dependent host and any dependent hostgroup + if (isset($arrBlockData['dependent_host_name'])) { + $strRawString1 .= $arrBlockData['dependent_host_name']['value']. ','; + } + if (isset($arrBlockData['dependent_hostgroup_name'])) { + $strRawString1 .= $arrBlockData['dependent_hostgroup_name']['value']. ','; + } + if (isset($arrBlockData['host_name'])) { + $strRawString2 .= $arrBlockData['host_name']['value']. ','; + } + if (isset($arrBlockData['hostgroup_name'])) { + $strRawString2 .= $arrBlockData['hostgroup_name']['value']. ','; + } + if (isset($arrBlockData['dependent_service_description'])) { + $strRawString3 .= $arrBlockData['dependent_service_description']['value']. ','; + } + if (isset($arrBlockData['service_description'])) { + $strRawString3 .= $arrBlockData['service_description']['value']. ','; + } + if (isset($arrBlockData['dependent_servicegroup_name'])) { + $strRawString3 .= $arrBlockData['dependent_servicegroup_name']['value']. ','; + } + if (isset($arrBlockData['servicegroup_name'])) { + $strRawString3 .= $arrBlockData['servicegroup_name']['value']. ','; + } + // Replace *, + and ! in HASH raw string + $strRawString1 = str_replace('*,', 'any,', $strRawString1); + $strRawString2 = str_replace('*,', 'any,', $strRawString2); + $strRawString3 = str_replace('*,', 'any,', $strRawString3); + $strRawString1 = str_replace('!', 'not_', $strRawString1); + $strRawString2 = str_replace('!', 'not_', $strRawString2); + $strRawString3 = str_replace('!', 'not_', $strRawString3); + // Create configuration name from NagiosQL variable if exists + if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) { + $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value']; + } else { + $arrConfig1 = explode(',', $strRawString1); + $arrConfig2 = explode(',', $strRawString2); + $arrConfig3 = explode(',', $strRawString3); + if (isset($arrConfig1[0])) { + $strConfigName = 'imp_' .$arrConfig1[0]; + } + if (isset($arrConfig2[0])) { + $strConfigName .= '_' .$arrConfig2[0]; + } + if (isset($arrConfig3[0])) { + $strConfigName .= '_' .$arrConfig3[0]; + } + $strSQL = 'SELECT * FROM `' .$strTable."` WHERE `config_name`='$strConfigName'"; + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booRet && ($intDC != 0)) { + $intCounter = 1; + do { + $strConfigNameTemp = $strConfigName. '_' .$intCounter; + $strSQL = 'SELECT * FROM `' .$strTable."` WHERE `config_name`='$strConfigNameTemp'"; + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + $intCounter++; + } while ($booRet && ($intDC != 0)); + $strConfigName = $strConfigNameTemp; + } + } + // HASH string + $strRawString = $strRawString1.$strRawString2.$strRawString3; + $strRawString = substr($strRawString, 0, -1); + } + if (($strTable == 'tbl_hostescalation') || ($strTable == 'tbl_serviceescalation')) { + $strRawString1 = ''; + $strRawString2 = ''; + $strRawString3 = ''; + // HASH from any host and any hostgroup + if (isset($arrBlockData['host_name'])) { + $strRawString1 .= $arrBlockData['host_name']['value']. ','; + } + if (isset($arrBlockData['hostgroup_name'])) { + $strRawString1 .= $arrBlockData['hostgroup_name']['value']. ','; + } + if (isset($arrBlockData['contacts'])) { + $strRawString2 .= $arrBlockData['contacts']['value']. ','; + } + if (isset($arrBlockData['contact_groups'])) { + $strRawString2 .= $arrBlockData['contact_groups']['value']. ','; + } + if (isset($arrBlockData['service_description'])) { + $strRawString3 .= $arrBlockData['service_description']['value']. ','; + } + // Replace *, + and ! in HASH raw string + $strRawString1 = str_replace('*,', 'any,', $strRawString1); + $strRawString2 = str_replace('*,', 'any,', $strRawString2); + $strRawString3 = str_replace('*,', 'any,', $strRawString3); + $strRawString1 = str_replace('!', 'not_', $strRawString1); + $strRawString2 = str_replace('!', 'not_', $strRawString2); + $strRawString3 = str_replace('!', 'not_', $strRawString3); + // Create configuration name from NagiosQL variable if exists + if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) { + $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value']; + } else { + $arrConfig1 = explode(',', $strRawString1); + $arrConfig2 = explode(',', $strRawString2); + $arrConfig3 = explode(',', $strRawString3); + if (isset($arrConfig1[0])) { + $strConfigName = 'imp_' .$arrConfig1[0]; + } + if (isset($arrConfig2[0])) { + $strConfigName .= '_' .$arrConfig2[0]; + } + if (isset($arrConfig3[0])) { + $strConfigName .= '_' .$arrConfig3[0]; + } + $strSQL = 'SELECT * FROM `' .$strTable."` WHERE `config_name`='$strConfigName'"; + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + if ($booRet && ($intDC != 0)) { + $intCounter = 1; + do { + $strConfigNameTemp = $strConfigName. '_' .$intCounter; + $strSQL = 'SELECT * FROM `' .$strTable."` WHERE `config_name`='$strConfigNameTemp'"; + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDC); + $intCounter++; + } while ($booRet && ($intDC != 0)); + $strConfigName = $strConfigNameTemp; + } + } + // HASH string + $strRawString = $strRawString1.$strRawString2.$strRawString3; + $strRawString = substr($strRawString, 0, -1); + } + if ($strTable == 'tbl_serviceextinfo') { + // HASH from any host, any hostgroup and service description - step 1 + if (isset($arrBlockData['host_name'])) { + $strRawString .= $arrBlockData['host_name']['value']. ','; + } + if (isset($arrBlockData['service_description'])) { + $strRawString .= $arrBlockData['service_description']['value']. ','; + } + // HASH string + $strRawString = substr($strRawString, 0, -1); + // Create configuration name from NagiosQL variable if exists + if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) { + $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value']; + } else { + // Create configuration name from first two items + $arrConfig = explode(',', $strRawString); + if (isset($arrConfig[0]) && ($arrConfig[0] != '')) { + $strConfigName = 'imp_' .$arrConfig[0]; + } + if (isset($arrConfig[1]) && ($arrConfig[1] != '')) { + $strConfigName .= '_' .$arrConfig[1]; + } + } + } + while (substr_count($strRawString, ' ') != 0) { + $strRawString = str_replace(' ', '', $strRawString); + } + // Sort hash string + $arrTemp = explode(',', $strRawString); + sort($arrTemp); + $strRawString = implode(',', $arrTemp); + $strHash = sha1($strRawString); + //echo "Hash: ".$strRawString." --> ".$strHash."
"; + } + + /** + * @param array $arrImportData Imported block data + * @param string $strHash Unique data hash + * @param int $intExists Does the dataset already exist? + * @param string $strTable Table name + * @param string $strKeyField Table key file + * @param int $intRelation Relation type + * @param array $arrRelations Relation array + * @param string $strSQL1 SQL statement part 1 + * @param string $strSQL2 SQL statement part 2 + */ + private function getSQLPart1( + $arrImportData, + $strHash, + $intExists, + $strTable, + $strKeyField, + $intRelation, + $arrRelations, + &$strSQL1, + &$strSQL2 + ) { + // Define variables + $intActive = 1; + $arrData = array(); + $intDataCount = 0; + + if ($strHash != '') { + $strHash = " `import_hash`='" . $strHash . "', "; + } + if ($intExists != 0) { + // Update database + $strSQL1 = 'UPDATE `' .$strTable. '` SET '; + $strSQL2 = ' `config_id`=' .$this->intDomainId.", $strHash `active`='$intActive', ". + "`last_modified`=NOW() WHERE `id`=$intExists"; + // Keep config name while update + if (($strKeyField == 'config_name') && !isset($arrImportData['_NAGIOSQL_CONFIG_NAME'])) { + $strSQLConfig = 'SELECT `config_name` FROM `' .$strTable. '` WHERE `id`=' . $intExists; + $arrImportData['config_name']['value'] = $this->myDBClass->getFieldData($strSQLConfig); + } + // Remove free variables + if ($intRelation != 0) { + foreach ($arrRelations as $relVar) { + if ($relVar['type'] == 4) { + $strSQL = 'SELECT * FROM `' .$relVar['linkTable']."` WHERE `idMaster`=$intExists"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrData as $elem) { + $strSQL = 'DELETE FROM `tbl_variabledefinition` WHERE `id`=' .$elem['idSlave']; + $this->myDataClass->dataInsert($strSQL, $intInsertId); + } + } + $strSQL = 'DELETE FROM `' .$relVar['linkTable']."` WHERE `idMaster`=$intExists"; + $this->myDataClass->dataInsert($strSQL, $intInsertId); + } + } + } + } else { + // DB Eintrag einfügen + $test=''; + $strSQL1 = 'INSERT INTO `' .$strTable."` SET $test"; + $strSQL2 = ' `config_id`=' .$this->intDomainId.", $strHash `active`='$intActive', `last_modified`=NOW()"; + } + } + + /** + * @param array $arrImportData Imported block data + * @param string $strKeyField Table key file + * @param string $strSQL1 SQL statement part 1 + * @param string $strTable Table name + * @return array List of import values + */ + private function getImportValues($arrImportData, $strKeyField, &$strSQL1, $strTable) + { + // Description for the values + // -------------------------- + // $strVCValues = Simple text values, will be stored as varchar / null = 'null' as text value / empty = '' + // $strRLValues = Relations - values with relations to other tables + // $strVWValues = Integer values - will be stored as INT values / null = -1, / empty values as NULL + // $strVIValues = Decision values 0 = no, 1 = yes, 2 = skip, 3 = null + + // Define variables + $strVCValues = ''; + $strVIValues = ''; + $strRLValues = ''; + $strVWValues = ''; + $intWriteConfig = 0; + + // Read command configurations + if ($strKeyField == 'command_name') { + $strVCValues = 'command_name,command_line'; + // Find out command type + if (isset($arrImportData['command_line'])) { + if ((substr_count($arrImportData['command_line']['value'], 'ARG1') != 0) || + (substr_count($arrImportData['command_line']['value'], 'USER1') != 0)) { + $strSQL1 .= '`command_type` = 1,'; + } else { + $strSQL1 .= '`command_type` = 2,'; + } + } + $intWriteConfig = 1; + + // Read contact configurations + } elseif ($strKeyField == 'contact_name') { + $strVCValues = 'contact_name,alias,host_notification_options,service_notification_options,email,'; + $strVCValues .= 'pager,address1,address2,address3,address4,address5,address6,name'; + + $strVWValues = 'minimum_importance'; + + $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,'; + $strVIValues .= 'retain_status_information,retain_nonstatus_information'; + + $strRLValues = 'contactgroups,host_notification_period,service_notification_period,'; + $strRLValues .= 'host_notification_commands,service_notification_commands,use'; + $intWriteConfig = 1; + + // Read contactgroup configurations + } elseif ($strKeyField == 'contactgroup_name') { + $strVCValues = 'contactgroup_name,alias'; + + $strRLValues = 'members,contactgroup_members'; + $intWriteConfig = 1; + + // Read timeperiod configurations + } elseif ($strKeyField == 'timeperiod_name') { + $strVCValues = 'timeperiod_name,alias,name'; + + $strRLValues = 'use,exclude'; + $intWriteConfig = 1; + + // Read contacttemplate configurations + } elseif (($strKeyField == 'name') && ($strTable == 'tbl_contacttemplate')) { + $strVCValues = 'contact_name,alias,host_notification_options,service_notification_options,email,'; + $strVCValues .= 'pager,address1,address2,address3,address4,address5,address6,name'; + + $strVWValues = 'minimum_importance'; + + $strVIValues = 'host_notifications_enabled,service_notifications_enabled,can_submit_commands,'; + $strVIValues .= 'retain_status_information,retain_nonstatus_information'; + + $strRLValues = 'contactgroups,host_notification_period,service_notification_period,'; + $strRLValues .= 'host_notification_commands,service_notification_commands,use'; + $intWriteConfig = 1; + + // Read host configurations + } elseif ($strTable == 'tbl_host') { + $strVCValues = 'host_name,alias,display_name,address,initial_state,flap_detection_options,'; + $strVCValues .= 'notification_options,stalking_options,notes,notes_url,action_url,icon_image,'; + $strVCValues .= 'icon_image_alt,vrml_image,statusmap_image,2d_coords,3d_coords,name'; + + $strVWValues = 'max_check_attempts,retry_interval,check_interval,freshness_threshold,low_flap_threshold,'; + $strVWValues .= 'high_flap_threshold,notification_interval,first_notification_delay,importance'; + + $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,'; + $strVIValues .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,'; + $strVIValues .= 'retain_nonstatus_information,notifications_enabled'; + + $strRLValues = 'parents,hostgroups,check_command,use,check_period,event_handler,contacts,contact_groups,'; + $strRLValues .= 'notification_period'; + $intWriteConfig = 1; + + // Read hosttemplate configurations + } elseif (($strKeyField == 'name') && ($strTable == 'tbl_hosttemplate')) { + $strVCValues = 'template_name,alias,initial_state,flap_detection_options,notification_options,'; + $strVCValues .= 'stalking_options,notes,notes_url,action_url,icon_image,icon_image_alt,vrml_image,'; + $strVCValues .= 'statusmap_image,2d_coords,3d_coords,name'; + + $strVWValues = 'max_check_attempts,retry_interval,check_interval,freshness_threshold,low_flap_threshold,'; + $strVWValues .= 'high_flap_threshold,notification_interval,first_notification_delay,importance'; + + $strVIValues = 'active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,'; + $strVIValues .= 'event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,'; + $strVIValues .= 'retain_nonstatus_information,notifications_enabled'; + + $strRLValues = 'parents,hostgroups,check_command,use,check_period,event_handler,contacts,contact_groups,'; + $strRLValues .= 'notification_period'; + $intWriteConfig = 1; + + // Read hostgroup configurations + } elseif ($strKeyField == 'hostgroup_name') { + $strVCValues = 'hostgroup_name,alias,notes,notes_url,action_url'; + + $strRLValues = 'members,hostgroup_members'; + $intWriteConfig = 1; + + // Read service configurations + } elseif ($strTable == 'tbl_service') { + $strVCValues = 'service_description,display_name,initial_state,flap_detection_options,stalking_options,'; + $strVCValues .= 'notes,notes_url,action_url,icon_image,icon_image_alt,name,config_name,'; + $strVCValues .= 'notification_options'; + + $strVWValues = 'max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,'; + $strVWValues .= 'high_flap_threshold,notification_interval,first_notification_delay,importance'; + + $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,'; + $strVIValues .= 'obsess_over_service,check_freshness,event_handler_enabled,flap_detection_enabled,'; + $strVIValues .= 'process_perf_data,retain_status_information,retain_nonstatus_information,'; + $strVIValues .= 'notifications_enabled'; + + $strRLValues = 'host_name,hostgroup_name,servicegroups,use,check_command,check_period,event_handler,'; + $strRLValues .= 'notification_period,contacts,contact_groups,parents'; + $intWriteConfig = 1; + + // Read servicetemplate configurations + } elseif (($strKeyField == 'name') && ($strTable == 'tbl_servicetemplate')) { + $strVCValues = 'template_name,service_description,display_name,initial_state,flap_detection_options,'; + $strVCValues .= 'stalking_options,notes,notes_url,action_url,icon_image,icon_image_alt,name,'; + $strVCValues .= 'notification_options'; + + $strVWValues = 'max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,'; + $strVWValues .= 'high_flap_threshold,notification_interval,first_notification_delay,importance'; + + $strVIValues = 'is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,'; + $strVIValues .= 'obsess_over_service,check_freshness,event_handler_enabled,flap_detection_enabled,'; + $strVIValues .= 'process_perf_data,retain_status_information,retain_nonstatus_information,'; + $strVIValues .= 'notifications_enabled'; + + $strRLValues = 'host_name,hostgroup_name,servicegroups,use,check_command,check_period,event_handler,'; + $strRLValues .= 'notification_period,contacts,contact_groups,parents'; + $intWriteConfig = 1; + + // Read servicegroup configurations + } elseif ($strKeyField == 'servicegroup_name') { + $strVCValues = 'servicegroup_name,alias,notes,notes_url,action_url'; + + $strRLValues = 'members,servicegroup_members'; + $intWriteConfig = 1; + + // Read hostdependency configurations + } elseif ($strTable == 'tbl_hostdependency') { + $strVCValues = 'config_name,execution_failure_criteria,notification_failure_criteria'; + + $strVIValues = 'inherits_parent'; + + $strRLValues = 'dependent_host_name,dependent_hostgroup_name,host_name,hostgroup_name,dependency_period'; + $intWriteConfig = 1; + + // Read hostescalation configurations + } elseif ($strTable == 'tbl_hostescalation') { + $strVCValues = 'config_name,escalation_options'; + + $strVWValues = 'first_notification,last_notification,notification_interval'; + + $strRLValues = 'host_name,hostgroup_name,contacts,contact_groups,escalation_period'; + $intWriteConfig = 1; + + // Read hostextinfo configurations + } elseif ($strTable == 'tbl_hostextinfo') { + $strVCValues = 'notes,notes_url,action_url,icon_image,icon_image_alt,vrml_image,statusmap_image,'; + $strVCValues .= '2d_coords,3d_coords'; + + $strRLValues = 'host_name'; + $intWriteConfig = 1; + + // Read servicedependency configurations + } elseif ($strTable == 'tbl_servicedependency') { + $strVCValues = 'config_name,execution_failure_criteria,notification_failure_criteria'; + + $strVIValues = 'inherits_parent'; + + $strRLValues = 'dependent_host_name,dependent_hostgroup_name,dependent_service_description,host_name,'; + $strRLValues .= 'hostgroup_name,dependency_period,service_description,dependent_servicegroup_name,'; + $strRLValues .= 'servicegroup_name'; + $intWriteConfig = 1; + + // Read serviceescalation configurations + } elseif ($strTable == 'tbl_serviceescalation') { + $strVCValues = 'config_name,escalation_options'; + + $strVIValues = 'first_notification,last_notification,notification_interval'; + + $strRLValues = 'host_name,hostgroup_name,contacts,contact_groups,service_description,escalation_period,'; + $strRLValues .= 'servicegroup_name'; + $intWriteConfig = 1; + + // Serviceextinfo configurations + } elseif ($strTable == 'tbl_serviceextinfo') { + $strVCValues = 'notes,notes_url,action_url,icon_image,icon_image_alt'; + + $strRLValues = 'host_name,service_description'; + $intWriteConfig = 1; + } + + // Common values (all configurations) + if ($strVWValues == '') { + $strVWValues = 'register'; + } else { + $strVWValues .= ',register'; + } + return array($strVCValues, $intWriteConfig, $strVIValues, $strRLValues, $strVWValues); + } + + /** + * @param $elem + * @param $strVCValues + * @param $strSQL1 + * @param $intIsTemplate + * @param $intExists + * @param $strTable + * @return int + */ + private function writeTextValues($elem, $strVCValues, &$strSQL1, $intIsTemplate, $intExists, $strTable) + { + $intCheck = 0; + if (\in_array($elem['key'], explode(',', $strVCValues), true)) { + if (strtolower(trim($elem['value'])) == 'null') { + $strSQL1 .= '`' . $elem['key'] . "` = 'null',"; + } else { + $elem['value'] = addslashes($elem['value']); + if ($intIsTemplate == 1) { + if ($elem['key'] == 'name') { + $strSQL1 .= "template_name = '" . $elem['value'] . "',"; + } elseif (($elem['key'] == 'config_name') && ($intExists != 0)) { + // Do not overwrite config_names during an update! + $strSQLConfig = 'SELECT `config_name` FROM `' . $strTable . '` WHERE `id`=' . $intExists; + $elem['value'] = $this->myDBClass->getFieldData($strSQLConfig); + $strSQL1 .= '`' . $elem['key'] . "` = '" . $elem['value'] . "',"; + } else { + $strSQL1 .= '`' . $elem['key'] . "` = '" . $elem['value'] . "',"; + } + } else { + $strSQL1 .= '`' . $elem['key'] . "` = '" . $elem['value'] . "',"; + } + } + $intCheck = 1; + } + return $intCheck; + } + + /** + * @param $elem + * @param $strVIValues + * @param $strSQL1 + * @return int + */ + private function writeStatusValues($elem, $strVIValues, &$strSQL1) + { + $intCheck = 0; + if (\in_array($elem['key'], explode(',', $strVIValues), true)) { + if (strtolower(trim($elem['value'])) == 'null') { + $strSQL1 .= '`' . $elem['key'] . '` = 3,'; + } else { + $strSQL1 .= '`' . $elem['key'] . "` = '" . $elem['value'] . "',"; + } + $intCheck = 1; + } + return $intCheck; + } + + /** + * @param $elem + * @param $strVWValues + * @param $strSQL1 + * @return int + */ + private function writeIntegerValues($elem, $strVWValues, &$strSQL1) + { + $intCheck = 0; + if (\in_array($elem['key'], explode(',', $strVWValues), true)) { + if (strtolower(trim($elem['value'])) == 'null') { + $strSQL1 .= '`' . $elem['key'] . '` = -1,'; + } else { + $strSQL1 .= '`' . $elem['key'] . "` = '" . $elem['value'] . "',"; + } + $intCheck = 1; + } + return $intCheck; + } + + /** + * @param array $elem + * @param string $strRLValues + * @param array $arrImportRelations + * @param $intInsertRelations + * @return int + */ + private function writeRelations(&$elem, $strRLValues, &$arrImportRelations, &$intInsertRelations) + { + $intCheck = 0; + if (($intCheck == 0) && \in_array($elem['key'], explode(',', $strRLValues), true)) { + if ($elem['key'] == 'use') { + $elem['key'] = 'use_template'; + } + $arrTemp = array(); + $arrTemp['key'] = $elem['key']; + $arrTemp['value'] = $elem['value']; + $arrImportRelations[] = $arrTemp; + $intInsertRelations = 1; + $intCheck = 1; + } + return $intCheck; + } + + /** + * Inserts a relation type 1 (1:1) + * @param string $strKey Data field name + * @param string $strValue Data value + * @param int $intDataId Data ID + * @param string $strDataTable Data table (Master) + * @param array $arrRelData Relation data + * @param array $arrImportData Import Data + */ + public function writeRelation1($strKey, $strValue, $intDataId, $strDataTable, $arrRelData, $arrImportData) + { + // Define variables + $intSlaveId = 0; + if (strtolower(trim($strValue)) == 'null') { + // Update data in master table + $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = -1 WHERE `id` = ' + .$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } else { + // Decompose data value + $arrValues = explode(',', $strValue); + // Process data values + foreach ($arrValues as $elem) { + $strWhere = ''; + $strLink = ''; + $strAdd = ''; + // Special processing for serviceextinfo + if (($strDataTable == 'tbl_serviceextinfo') && ($strKey == 'service_description')) { + $strLink = 'LEFT JOIN `tbl_lnkServiceToHost` on `tbl_service`.`id`=`idMaster` ' . + 'LEFT JOIN `tbl_host` ON `idSlave`=`tbl_host`.`id`'; + $strWhere = "AND `tbl_host`.`host_name`='".$arrImportData['host_name']['value']."'"; + } + // Does the value already exist? + $strSQL = 'SELECT `' .$arrRelData['tableName1']. '`.`id` FROM `' .$arrRelData['tableName1']. + "` $strLink " . 'WHERE `' .$arrRelData['target1']."` = '".$elem."' $strWhere AND ". + '`' .$arrRelData['tableName1']."`.`active`='1' AND ". + '`' .$arrRelData['tableName1']. '`.`config_id`=' .$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + if ($strId != '') { + $intSlaveId = (int)$strId; + } + if ($intSlaveId == 0) { + // Insert a temporary value + if (($strDataTable == 'tbl_serviceextinfo') && ($arrRelData['tableName1'] == 'tbl_service')) { + $strAdd = "`config_name`='imp_tmp_by_serviceextinfo',"; + } + $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' . + 'SET `' .$arrRelData['target1']."` = '".$elem."', ". + "$strAdd `config_id`=".$this->intDomainId.", `active`='0', ". + '`last_modified`=NOW()'; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $intSlaveId = $this->myDBClass->intLastId; + + // Special processing for serviceextinfo + if (($strDataTable == 'tbl_serviceextinfo') && ($strKey == 'service_description')) { + $strSQL = 'SELECT `id` FROM `tbl_host` ' . + "WHERE `host_name`='".$arrImportData['host_name']['value']."'"; + $strId = $this->myDBClass->getFieldData($strSQL); + if ($strId != '') { + $strSQL = 'INSERT INTO `tbl_lnkServiceToHost` ' . + "SET `idMaster` = '".$intSlaveId."', `idSlave` = '".$strId."'"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $strSQL = "UPDATE `tbl_service` SET `host_name`=0 WHERE `id`='".$intSlaveId."'"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } + } + } + // Update data in master table + $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = ' .$intSlaveId. ' ' . + 'WHERE `id` = ' .$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } + } + } + + /** + * Inserts a relation type 2 (1:n) + * @param string $strKey Data field name + * @param string $strValue Data value + * @param int $intDataId Data ID + * @param string $strDataTable Data table (Master) + * @param array $arrRelData Relation data + */ + public function writeRelation2($strKey, $strValue, $intDataId, $strDataTable, $arrRelData) + { + // Does a tploption field exist? + $strSQL = 'SELECT * FROM `' .$strDataTable. '` WHERE `id` = ' .$intDataId; + $this->myDBClass->hasSingleDataset($strSQL, $arrDataset); + $strFieldName = $arrRelData['fieldName']. '_tploptions'; + if (isset($arrDataset[$strFieldName])) { + $intTplOption = 1; + } else { + $intTplOption = 0; + } + // Delete data from link table + $strSQL = 'DELETE FROM `' .$arrRelData['linkTable']. '` WHERE `idMaster` = ' .$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + // Define variables + if (strtolower(trim($strValue)) == 'null') { + // Update data in master table + if ($intTplOption == 1) { + $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = 0, ' . + '`' .$arrRelData['fieldName']. '_tploptions` = 1 WHERE `id` = ' .$intDataId; + } else { + $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = 0 WHERE `id` = ' . + $intDataId; + } + $this->myDBClass->insertData($strSQL); + } else { + if (0 === strpos(trim($strValue), '+')) { + $intOption = 0; + $strValue = str_replace('+', '', $strValue); + } else { + $intOption = 2; + } + // Decompose data value + $arrValues = explode(',', $strValue); + // Process data values + foreach ($arrValues as $elem) { + if ($elem != '*') { + $strWhere = ''; + $strLink = ''; + // Exclude values + if (0 === strpos($elem, '!')) { + $intExclude = 1; + $elem = substr($elem, 1); + } else { + $intExclude = 0; + } + if ((($strDataTable == 'tbl_servicedependency') || ($strDataTable == 'tbl_serviceescalation')) && + (substr_count($strKey, 'service') != 0) && (substr_count($strKey, 'group') == 0)) { + if (substr_count($strKey, 'depend') != 0) { + $strLink = 'LEFT JOIN `tbl_lnkServiceToHost` on `id`=`idMaster`'; + $strWhere = 'AND `idSlave` IN (' .substr($this->strList1, 0, -1). ')'; + } else { + $strLink = 'LEFT JOIN `tbl_lnkServiceToHost` on `id`=`idMaster`'; + $strWhere = 'AND `idSlave` IN (' .substr($this->strList2, 0, -1). ')'; + } + } + // Does the entry already exist? + $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName1']."` $strLink ". + 'WHERE `' .$arrRelData['target1']."` = '".$elem."' $strWhere AND ". + '`config_id`=' .$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + if ($strId != '') { + $intSlaveId = (int)$strId; + } else { + $intSlaveId = 0; + } + if (($intSlaveId == 0) && ($elem != '*')) { + // Insert a temporary value to the target table + $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' . + 'SET `' .$arrRelData['target1']."`='".$elem."', ". + '`config_id`=' .$this->intDomainId.", `active`='0', `last_modified`=NOW()"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $intSlaveId = $this->myDBClass->intLastId; + } + // Insert relations + $strSQL = 'INSERT INTO `' .$arrRelData['linkTable']. '` ' . + 'SET `idMaster` = ' .$intDataId. ', `idSlave` = ' .$intSlaveId. ', `exclude`=' .$intExclude; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + // Keep values + if (($strDataTable == 'tbl_servicedependency') || ($strDataTable == 'tbl_serviceescalation')) { + $strTemp = ''; + if (($strKey == 'dependent_host_name') || ($strKey == 'host_name')) { + $strTemp .= $intSlaveId. ','; + } elseif (($strKey == 'dependent_hostgroup_name') || ($strKey == 'hostgroup_name')) { + $arrDataHostgroups = array(); + $intDCHostgroups = 0; + $strSQL = 'SELECT DISTINCT `id` FROM `tbl_host` ' . + 'LEFT JOIN `tbl_lnkHostToHostgroup` ON `id`=`tbl_lnkHostToHostgroup`.`idMaster` ' . + 'LEFT JOIN `tbl_lnkHostgroupToHost` ON `id`=`tbl_lnkHostgroupToHost`.`idSlave` ' . + "WHERE (`tbl_lnkHostgroupToHost`.`idMaster` = $intSlaveId ". + "OR `tbl_lnkHostToHostgroup`.`idSlave` = $intSlaveId) ". + "AND `active`='1' AND `config_id`=".$this->intDomainId; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataHostgroups, $intDCHostgroups); + if ($booReturn && ($intDCHostgroups != 0)) { + foreach ($arrDataHostgroups as $elem2) { + $strTemp .= $elem2['id']. ','; + } + } + } + if (substr_count($strKey, 'dependent') != 0) { + $this->strList1 .= $strTemp; + } else { + $this->strList2 .= $strTemp; + } + } + } + // Update field values in master table + if (substr_count($strValue, '*') != 0) { + $intRelValue = 2; + } else { + $intRelValue = 1; + } + if ($intTplOption == 1) { + $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']."`=$intRelValue, ". + '`' .$arrRelData['fieldName']. '_tploptions` = ' .$intOption. ' WHERE `id` = ' .$intDataId; + } else { + $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']."`=$intRelValue ". + 'WHERE `id` = ' .$intDataId; + } + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } + } + } + + /** + * Inserts a relation type 3 (templates) + * @param string $strValue Data value + * @param int $intDataId Data ID + * @param string $strDataTable Data table (Master) + * @param array $arrRelData Relation data + */ + public function writeRelation3($strValue, $intDataId, $strDataTable, $arrRelData) + { + // Define variables + $intSlaveId = 0; + $intTable = 0; + $intSortNr = 1; + if (strtolower(trim($strValue)) == 'null') { + // Update data in master table + $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = 0, ' . + '`' .$arrRelData['fieldName']. '_tploptions` = 1 WHERE `id` = ' .$intDataId; + $this->myDBClass->insertData($strSQL); + } else { + if (0 === strpos(trim($strValue), '+')) { + $intOption = 0; + $strValue = str_replace('+', '', $strValue); + } else { + $intOption = 2; + } + // Remove old relations + $strSQL = 'DELETE FROM `' .$arrRelData['linkTable']. '` WHERE `idMaster` = ' .$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + // Decompose data value + $arrValues = explode(',', $strValue); + // Process data values + foreach ($arrValues as $elem) { + // Does the template already exist? (table 1) + $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName1']. '` ' . + 'WHERE `' .$arrRelData['target1']."` = '".$elem."' AND `config_id`=".$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + if ($strId != '') { + $intSlaveId = (int)$strId; + $intTable = 1; + } + if ($intSlaveId == 0) { + // Does the template already exist? (table 2) + $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName2']. '` ' . + 'WHERE `' .$arrRelData['target2']."` = '".$elem."' AND `config_id`=".$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + if ($strId != '') { + $intSlaveId = (int)$strId; + $intTable = 2; + } + } + if ($intSlaveId == 0) { + // Insert a temporary value to the target table + $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' . + 'SET `' .$arrRelData['target1']."` = '".$elem."', `config_id`=".$this->intDomainId. ', ' . + "`active`='0', `last_modified`=NOW()"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $intSlaveId = $this->myDBClass->intLastId; + $intTable = 1; + } + // Insert relations + $strSQL = 'INSERT INTO `' .$arrRelData['linkTable']. '` ' . + 'SET `idMaster` = ' .$intDataId. ', `idSlave`=' .$intSlaveId. ', `idSort`=' .$intSortNr. ', ' . + '`idTable` = ' .$intTable; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $intSortNr++; + $intSlaveId = 0; + // Update field data in master table + $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = 1, ' . + '`' .$arrRelData['fieldName']. '_tploptions` = ' .$intOption. ' WHERE `id` = ' .$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } + } + } + + /** + * Inserts a relation type 4 (free variables) + * @param string $strKey Data field name + * @param string $strValue Data value + * @param int $intDataId Data ID + * @param string $strDataTable Data table (Master) + * @param array $arrRelData Relation data + * @return int 0 = successful / 1 = error + */ + public function writeRelation4($strKey, $strValue, $intDataId, $strDataTable, $arrRelData) + { + // Define variables + $intReturn = 0; + // Remove empty variables + if (($strKey == '') || ($strValue == '')) { + $intReturn = 1; + } + // Remove NagiosQL variables + if ($strKey == '_NAGIOSQL_CONFIG_NAME') { + $intReturn = 1; + } + if ($intReturn == 0) { + // Remove old variables + $strSQL = 'SELECT * FROM '.$arrRelData['linkTable'].' WHERE idMaster='.$intDataId; + $booResult = $this->myDBClass->hasDataArray($strSQL, $arrLinkData, $intLinkCount); + if ($booResult && ($intLinkCount != 0)) { + /** @var array $arrLinkData */ + foreach ($arrLinkData as $elem) { + $strSQL1 = 'DELETE FROM tbl_variabledefinition WHERE id=' .$elem['idSlave']; + $booResult = $this->myDBClass->insertData($strSQL1); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $strSQL2 = 'DELETE FROM '.$arrRelData['linkTable'].' WHERE idMaster='.$elem['idMaster']; + $booResult = $this->myDBClass->insertData($strSQL2); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } + } + // Insert values to the table + $strSQL = "INSERT INTO `tbl_variabledefinition` SET `name` = '" . addslashes($strKey) . "', " . + "`value` = '" . addslashes($strValue) . "', `last_modified`=now()"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $intSlaveId = $this->myDBClass->intLastId; + // Insert relations to the table + $strSQL = 'INSERT INTO `' . $arrRelData['linkTable'] . '` ' . + 'SET `idMaster` = ' . $intDataId . ', `idSlave` = ' . $intSlaveId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + // Update data in master table + $strSQL = 'UPDATE `' . $strDataTable . '` SET `use_variables` = 1 WHERE `id` = ' . $intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } + return $intReturn; + } + + /** + * Inserts a relation type 5 (1:1 check command) + * @param string $strValue Data value + * @param int $intDataId Data ID + * @param string $strDataTable Data table (Master) + * @param array $arrRelData Relation data + */ + public function writeRelation5($strValue, $intDataId, $strDataTable, $arrRelData) + { + // Extract data values + $arrCommand = explode('!', $strValue); + $strValue = $arrCommand[0]; + // Define variables + $intSlaveId = 0; + if (strtolower(trim($strValue)) == 'null') { + // Update data in master table + $strSQL = 'UPDATE `' .$strDataTable. '` SET `' .$arrRelData['fieldName']. '` = -1 WHERE `id` = ' . + $intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } else { + // Decompose data values + $arrValues = explode(',', $strValue); + // Process data values + foreach ($arrValues as $elem) { + // Does the entry already exist? + $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName1']. '` ' . + 'WHERE `' .$arrRelData['target1']."` = '".$elem."' AND `config_id`=".$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + if ($strId != '') { + $intSlaveId = (int)$strId; + } + if ($intSlaveId == 0) { + // Insert a temporary value in target table + $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' . + 'SET `' .$arrRelData['target1']."` = '".$elem."', `config_id`=".$this->intDomainId. ', ' . + "`active`='0', `last_modified`=NOW()"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $intSlaveId = $this->myDBClass->intLastId; + } + // Update data in master table + $arrCommand[0] = $intSlaveId; + $strValue = implode('!', $arrCommand); + $strSQL = 'UPDATE `' .$strDataTable. '` ' . + 'SET `' .$arrRelData['fieldName']."`='".$this->myDBClass->realEscape($strValue)."' ". + 'WHERE `id` = ' .$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } + } + } + + /////////////////////////////////////////////////////////////////////////////////////////// + /** + * Inserts a relation type 5 (1:n:n service groups) + * @param string $strValue Data value + * @param int $intDataId Data ID + * @param string $strDataTable Data table (Master) + * @param array $arrRelData Relation data + */ + public function writeRelation6($strValue, $intDataId, $strDataTable, $arrRelData) + { + // Define variables + $intSlaveIdH = 0; + $intSlaveIdHG = 0; + // Decompose data value + $arrValues = explode(',', $strValue); + // Remove data from link table + $strSQL = 'DELETE FROM `' .$arrRelData['linkTable']. '` WHERE `idMaster` = ' .$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + // Check the sum of elements + if (\count($arrValues) % 2 != 0) { + $this->strErrorMessage .= translate('Error: incorrect number of arguments - cannot import service group ' . + 'members'). '::'; + } else { + // Process data values + $intCounter = 1; + foreach ($arrValues as $elem) { + if ($intCounter % 2 == 0) { + // Does the host entry already exist? + $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName1']. '` ' . + 'WHERE `' .$arrRelData['target1']."` = '".$strValue."' AND `active`='1' ". + 'AND `config_id`=' .$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + if ($strId != '') { + $intSlaveIdH = (int)$strId; + } + // Does a hostgroup entry already exist? + if ($intSlaveIdH == 0) { + $strSQL = "SELECT `id` FROM `tbl_hostgroup` WHERE `hostgroup_name` = '".$strValue."' ". + "AND `active`='1' AND `config_id`=".$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + if ($strId != '') { + $intSlaveIdHG = (int)$strId; + } + } + if (($intSlaveIdH == 0) && ($intSlaveIdHG == 0)) { + // Insert a temporary value in table + $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' . + 'SET `' .$arrRelData['target1']."` = '".$strValue."', ". + '`config_id`=' .$this->intDomainId.", `active`='0', `last_modified`=NOW()"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $intSlaveIdH = $this->myDBClass->intLastId; + } + // Does the service entry already exist? + if ($intSlaveIdH != 0) { + $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName2']. '` ' . + 'LEFT JOIN `tbl_lnkServiceToHost` ON `id` = `idMaster` ' . + 'WHERE `' .$arrRelData['target2']."` = '".$elem."' AND `idSlave` = ".$intSlaveIdH. ' ' . + 'AND `config_id`=' .$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + if ($strId == '') { + $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName2']. '` ' . + 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON ' . + '`id`=`tbl_lnkServiceToHostgroup`.`idMaster` ' . + 'LEFT JOIN `tbl_lnkHostgroupToHost` ON ' . + '`tbl_lnkHostgroupToHost`.`idMaster`=`tbl_lnkServiceToHostgroup`.`idSlave` ' . + 'WHERE `' .$arrRelData['target2']."` = '".$elem."' AND ". + '`tbl_lnkHostgroupToHost`.`idSlave` = ' .$intSlaveIdH. ' AND ' . + "`active`='1' AND `config_id`=".$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + } + if ($strId == '') { + $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName2']. '` ' . + 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON ' . + '`id` = `tbl_lnkServiceToHostgroup`.`idMaster` ' . + 'LEFT JOIN `tbl_lnkHostToHostgroup` ON ' . + '`tbl_lnkHostToHostgroup`.`idSlave`=`tbl_lnkServiceToHostgroup`.`idSlave` ' . + 'WHERE `' .$arrRelData['target2']."` = '".$elem."' AND ". + '`tbl_lnkHostToHostgroup`.`idMaster` = ' .$intSlaveIdH. ' AND ' . + "`active`='1' AND `config_id`=".$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + } + } elseif ($intSlaveIdHG != 0) { + $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName2']. '` ' . + 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `id` = `idMaster` ' . + 'WHERE `' .$arrRelData['target2']."` = '".$elem."' AND `idSlave`=".$intSlaveIdHG. ' ' . + "AND `active`='1' AND `config_id`=".$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + } + if ($strId != '') { + $intSlaveIdS = (int)$strId; + } else { + $intSlaveIdS = 0; + } + if ($intSlaveIdS == 0) { + // Insert a temporary value in table + $intHostName = 0; + $intHostgroupName = 0; + if ($intSlaveIdH != 0) { + $intHostName = 1; + } elseif ($intSlaveIdHG != 0) { + $intHostgroupName = 1; + } + $strSQL = 'INSERT INTO `' .$arrRelData['tableName2']. '` ' . + "SET `config_name`='imp_tmp_by_servicegroup', `host_name`=$intHostName, ". + "`hostgroup_name`=$intHostgroupName, `".$arrRelData['target2']."` = '".$elem."', ". + '`config_id`=' .$this->intDomainId.", `active`='0', `last_modified`=NOW()"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $intSlaveIdS = $this->myDBClass->intLastId; + // Make a relation from temp service to host / hostgroup + if ($intSlaveIdH != 0) { + $strSQL = 'INSERT INTO `tbl_lnkServiceToHost` ' . + "SET `idMaster`='".$intSlaveIdS."', `idSlave`=".$intSlaveIdH.", `exclude`='0'"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } elseif ($intSlaveIdHG != 0) { + $strSQL = 'INSERT INTO `tbl_lnkServiceToHostgroup` ' . + "SET `idMaster`='".$intSlaveIdS."', `idSlave`=".$intSlaveIdHG. ', ' . + "`exclude`='0'"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } + } + // Insert relation + $strSQL = 'INSERT INTO `' .$arrRelData['linkTable']. '` ' . + 'SET `idMaster`=' .$intDataId. ', `idSlaveH`=' .$intSlaveIdH. ', `idSlaveS`=' .$intSlaveIdS; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + // Update data in master table + $strSQL = 'UPDATE `' .$strDataTable. '` ' . + 'SET `' .$arrRelData['fieldName']. '` = 1 WHERE `id` = ' .$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } else { + $strValue = $elem; + } + $intCounter++; + } + } + } + + /** + * Inserts a relation type 6 (1:n:str) + * @param string $strValue Data value + * @param int $intDataId Data ID + * @param string $strDataTable Data table (Master) + * @param array $arrRelData Relation data + */ + public function writeRelation7($strValue, $intDataId, $strDataTable, $arrRelData) + { + // Delete data from link table + $strSQL = 'DELETE FROM `' .$arrRelData['linkTable']. '` WHERE `idMaster` = ' .$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + // Decompose data value + $arrValues = explode(',', $strValue); + // Process data values + foreach ($arrValues as $elem) { + if ($elem != '*') { + $strWhere = ''; + // Exclude values + if (0 === strpos($elem, '!')) { + $intExclude = 1; + $elem = substr($elem, 1); + } else { + $intExclude = 0; + } + // Does the entry already exist? + $strSQL = 'SELECT `id` FROM `' .$arrRelData['tableName1']. '` ' . + 'WHERE `' .$arrRelData['target1']."`='".$elem."' $strWhere ". + 'AND `config_id`=' .$this->intDomainId; + $strId = $this->myDBClass->getFieldData($strSQL); + if ($strId != '') { + $intSlaveId = (int)$strId; + } else { + $intSlaveId = 0; + } + if (($intSlaveId == 0) && ($elem != '*')) { + // Insert a temporary value to the target table + $strSQL = 'INSERT INTO `' .$arrRelData['tableName1']. '` ' . + 'SET `' .$arrRelData['target1']."` = '".$elem."', `host_name`=2, `hostgroup_name`=2, ". + "`config_name`='imp_tmp_by_servicedependency', `config_id`=".$this->intDomainId. ', ' . + "`active`='0', `last_modified`=NOW()"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $intSlaveId = $this->myDBClass->intLastId; + } + // Insert relations + $strSQL = 'INSERT INTO `' .$arrRelData['linkTable']. '` ' . + 'SET `idMaster` = ' .$intDataId. ', `idSlave` = ' .$intSlaveId.", `strSlave`='".$elem."', ". + '`exclude`=' .$intExclude; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } + // Update field values in master table + if (substr_count($strValue, '*') != 0) { + $intRelValue = 2; + } else { + $intRelValue = 1; + } + $strSQL = 'UPDATE `' .$strDataTable. '` ' . + 'SET `' .$arrRelData['fieldName']."` = $intRelValue WHERE `id` = ".$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } + } + + /** + * Inserts a relation type 6 (service and servicetemplate parents - 1:service:host) + * @param string $strValue Data value + * @param int $intDataId Data ID + * @param string $strDataTable Data table (Master) + * @param array $arrRelData Relation data + */ + public function writeRelation8($strValue, $intDataId, $strDataTable, $arrRelData) + { + // Decompose data value + $arrValues = explode(',', $strValue); + // Delete data from link table + $strSQL = 'DELETE FROM `' .$arrRelData['linkTable']. '` WHERE `idMaster` = ' .$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + // Check the sum of elements + /** @noinspection ExplodeMissUseInspection */ + if (count($arrValues) % 2 != 0) { + $this->strErrorMessage .= translate('Error: incorrect number of arguments - cannot import service parent ' . + 'members'). '::'; + } else { + // Process data values + $intCounter = 1; + $strHostName = ''; + foreach ($arrValues as $elem) { + if ($intCounter % 2 == 0) { + $strServiceName = $elem; + if (($strServiceName != '') && ($strHostName != '')) { + $strSQL = 'SELECT tbl_service.id AS id_1, C.id AS id_2, D.id AS id_3, E.id AS id_4 ' + . 'FROM tbl_service ' + . 'LEFT JOIN tbl_lnkServiceToHost ON tbl_service.id=tbl_lnkServiceToHost.idMaster ' + . 'LEFT JOIN tbl_lnkServiceToHostgroup ' + . 'ON tbl_service.id=tbl_lnkServiceToHostgroup.idMaster ' + . 'LEFT JOIN tbl_lnkHostgroupToHost AS A ON tbl_lnkServiceToHostgroup.idSlave=A.idMaster ' + . 'LEFT JOIN tbl_lnkHostToHostgroup AS B ON tbl_lnkServiceToHostgroup.idSlave=B.idSlave ' + . 'LEFT JOIN tbl_host AS C ON A.idSlave=C.id ' + . 'LEFT JOIN tbl_host AS D ON B.idMaster=D.id ' + . 'LEFT JOIN tbl_host AS E ON tbl_lnkServiceToHost.idSlave=E.id ' + . "WHERE tbl_service.service_description='".$strServiceName."' " + . "AND (C.host_name='".$strHostName."' OR D.host_name='".$strHostName."' " + . "OR E.host_name='".$strHostName."')"; + $booResult = $this->myDBClass->hasDataArray($strSQL, $arrDataset, $intCount); + if ($booResult && ($intCount == 1)) { + $intServiceId = 0; + $intHostId = 0; + $intId1 = $arrDataset[0]['id_1']; + $intId2 = $arrDataset[0]['id_2']; + $intId3 = $arrDataset[0]['id_3']; + $intId4 = $arrDataset[0]['id_4']; + if (($intId1!= null) && ($intId1 != 0) && ($intServiceId == 0)) { + $intServiceId = (int)$intId1; + } + $intHostSum = 0; + if (($intId2 != null) && ($intId2 != 0) && ($intHostId == 0)) { + $intHostId = (int)$intId2; + $intHostSum += $intHostId; + } + if (($intId3 != null) && ($intId3 != 0) && ($intHostId == 0)) { + $intHostId = (int)$intId3; + $intHostSum += $intHostId; + } + if (($intId4 != null) && ($intId4 != 0) && ($intHostId == 0)) { + $intHostId = (int)$intId4; + $intHostSum += $intHostId; + } + if (($intHostId == $intHostSum) && ($intServiceId != 0) && ($intHostId != 0)) { + $strSQL = 'INSERT INTO ' .$arrRelData['linkTable']. ' ' + . "SET idMaster=$intDataId, idSlave=$intServiceId, idHost=$intHostId"; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + $strSQL = 'UPDATE `' .$strDataTable. '` ' . + 'SET `' .$arrRelData['fieldName']. '` = 1 WHERE `id` = ' .$intDataId; + $booResult = $this->myDBClass->insertData($strSQL); + if ($booResult == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + } else { + $this->strErrorMessage .= translate('Error: cannot import the service parent member ') + . $strServiceName . '-' . $strHostName . '. ' + . translate('This combination is not unique!') . '::'; + } + } else { + $this->strErrorMessage .= translate('Error: cannot import the service parent member ') + . $strServiceName. '-' .$strHostName. '. ' + . translate('This combination is not unique or does not exist!').'::'; + } + } + } else { + $strHostName = $elem; + } + $intCounter++; + } + } + } +} diff --git a/functions/NagVisualClass.php b/functions/NagVisualClass.php new file mode 100644 index 0000000..6deb6fd --- /dev/null +++ b/functions/NagVisualClass.php @@ -0,0 +1,1452 @@ +arrSettings = $arrSession['SETS']; + } + if (isset($arrSession['domain'])) { + $this->intDomainId = $arrSession['domain']; + } + $this->arrSession = $arrSession; + } + + /** + * Search for browser type + * @return string Browser String + */ + public function browserCheck() + { + $strUserAgent = filter_input(INPUT_SERVER, 'HTTP_USER_AGENT', FILTER_SANITIZE_STRING); + // Define variables + $strBrowserString = 'unknown'; + if (false !== stripos($strUserAgent, 'msie')) { + $strBrowserString = 'msie'; + } elseif (false !== stripos($strUserAgent, 'firefox')) { + $strBrowserString = 'firefox'; + } elseif (false !== stripos($strUserAgent, 'opera')) { + $strBrowserString = 'opera'; + } elseif (false !== stripos($strUserAgent, 'chrome')) { + $strBrowserString = 'chrome'; + } + return $strBrowserString; + } + + /** + * Checks if an user has acces to an account group + * @param int $intGroupId Group ID + * @param string $strType Access type (read,write,link) + * @return int 0 = access granted / 1 = no access + */ + public function checkAccountGroup($intGroupId, $strType) + { + // Define variables + $intReturn = 0; + // Admin user or member og group 0 do not need permissions + if (($this->arrSession['userid'] != 1) && ($intGroupId != 0)) { + // Define variables + $arrDataMain = array(); + // Read database values + $strTypeValue = $this->getGroupValue($strType); + if ($strTypeValue != '') { + $strSQL = "SELECT * FROM `tbl_lnkGroupToUser` WHERE `idMaster`=$intGroupId AND ". + '`idSlave`=' .$this->arrSession['userid']." AND $strTypeValue"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataMain, $intDataCount); + if ($booReturn == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + if (($booReturn == false) || ($intDataCount == 0)) { + $intReturn = 1; + } + } + } + return $intReturn; + } + + /** + * Find out the actual position inside the menu tree and returns it as an info line + * @param int $intPageId Current content id + * @param string $strTop Label string for the root node + * @return string HTML info string + */ + public function getPosition($intPageId, $strTop = '') + { + // Define variables + $arrData = array(); + $intDataCount = 0; + $strPosition = ''; + // Read database values + $strSQL = 'SELECT B.`mnuName` AS `mainitem`, B.`mnuLink` AS `mainlink`, A.`mnuName` AS `subitem`, ' + . 'A.`mnuLink` AS `sublink` FROM `tbl_menu` AS A ' + . 'LEFT JOIN `tbl_menu` AS B ON A.`mnuTopId` = B.`mnuId` WHERE A.`mnuId`=' .$intPageId; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } elseif ($intDataCount != 0) { + $strMainLink = $this->arrSettings['path']['base_url'].$arrData[0]['mainlink']; + $strMain = $arrData[0]['mainitem']; + $strSubLink = $this->arrSettings['path']['base_url'].$arrData[0]['sublink']; + $strSub = $arrData[0]['subitem']; + if ($strTop != '') { + $strPosition .= "".$strTop. ' -> '; + } + if ($strMain != '') { + $strPosition .= "".translate($strMain)." -> ". + translate($strSub). ''; + } else { + $strPosition .= "".translate($strSub). ''; + } + } + return $strPosition; + } + + /** + * Returns any group ID with the requested access type + * @param string $strType Access type (read,write,link) + * @return string Comma separated string with group id's + */ + public function getAccessGroups($strType) + { + $strReturn = '0,'; + $arrData = array(); + // Admin has rights for all groups + if ($this->arrSession['userid'] == 1) { + $strSQL = 'SELECT `id` FROM `tbl_group`'; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intCount); + if ($booReturn == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } elseif ($intCount != 0) { + foreach ($arrData as $elem) { + $strReturn .= $elem['id']. ','; + } + } + } else { + $strTypeValue = $this->getGroupValue($strType); + $strSQL = 'SELECT `idMaster` FROM `tbl_lnkGroupToUser` ' . + 'WHERE `idSlave`=' . $this->arrSession['userid'] . " AND $strTypeValue"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrData, $intCount); + if ($booReturn == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } elseif ($intCount != 0) { + foreach ($arrData as $elem) { + $strReturn .= $elem['idMaster'] . ','; + } + } + } + if (substr($strReturn, -1) == ',') { + $strReturn = substr($strReturn, 0, -1); + } + return $strReturn; + } + + /** + * Generate the main menu HTML + * @param int $intPageId Current content id + * @param int $intCntId Menu group ID + * @return string HTML menu string + */ + public function getMenu($intPageId, $intCntId = 1) + { + // Define variables + $strQueryString = filter_input(INPUT_SERVER, 'QUERY_STRING', FILTER_SANITIZE_STRING); + $strPHPSelf = filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING); + + // Modify URL for visible/invisible menu + $strQuery = str_replace( + array('menu=visible&', 'menu=invisible&', 'menu=visible', 'menu=invisible'), + '', + $strQueryString + ); + if ($strQuery != '') { + $strVisible = str_replace('&', '&', $strPHPSelf. '?menu=visible&' .$strQuery); + $strInvisible = str_replace('&', '&', $strPHPSelf. '?menu=invisible&' .$strQuery); + } else { + $strVisible = $strPHPSelf. '?menu=visible'; + $strInvisible = $strPHPSelf. '?menu=invisible'; + } + $this->intPageId = $intPageId; + if (!isset($this->arrSession['menu']) || ($this->arrSession['menu'] != 'invisible')) { + // Menu visible + $strHTML = ''."\n"; + $strHTML .= ''."\n"; + $this->hasMenuRecursive(0, 'menu', $intCntId, $strHTML); + $strHTML .= ''."\n"; + $strHTML .= '
['.translate('Hide menu').']'."\n"; + $strHTML .= ''; + $strHTML .= ''."\n"; + } else { + // Menu invisible + $strHTML = ''."\n"; + $strHTML .= ''.translate('Show menu').''."\n"; + $strHTML .= ''."\n"; + } + return $strHTML; + } + + /** + * Add security features to text values + * @param string $strKey Process string + * @return string Modified process string + */ + public function tfSecure($strKey) + { + $strKey = stripslashes($strKey); + $strKey = $this->myDBClass->realEscape($strKey); + return $strKey; + } + + /** + * Build a string which contains links for additional pages. This is used in data lists + * with more items then defined in settings "lines per page limit" + * @param string $strSite Link to page + * @param int $intDataCount Sum of all data lines + * @param int $chkLimit Actual data limit + * @param string $strOrderBy OrderBy Field + * @param string $strOrderDir Order direction + * @return string Page site number string (HTML) + */ + public function buildPageLinks($strSite, $intDataCount, $chkLimit, $strOrderBy = '', $strOrderDir = '') + { + $intMaxLines = $this->arrSettings['common']['pagelines']; + $intCount = 1; + $intCheck = 0; + $strReturn = ''; + $strSiteHTML = "\n\n\n"; + } else { + $strSiteHTML .= "\n"; + } + $intCheck = 0; + } elseif ($intCheck == 0) { + $strSiteHTML .= "\n"; + $intCheck = 1; + } + $intCount++; + } + $strSiteHTML .= "\n
\n"; + for ($i=0; $i<$intDataCount; $i += $intMaxLines) { + $strLink1 = ""; + $strLink2 = "onclick=\"location.href='$strSite?limit=$i&orderby=$strOrderBy&orderdir=". + "$strOrderDir'\""; + if ((!(($chkLimit >= ($i+($intMaxLines*5))) || ($chkLimit <= ($i-($intMaxLines*5))))) || ($i==0) || + ($i>=($intDataCount-$intMaxLines))) { + if ($chkLimit == $i) { + $strSiteHTML .= "$intCount".$strLink1.$intCount."...
\n"; + if ($intCount > 2) { + $strReturn = $strSiteHTML; + } + return $strReturn; + } + + /** + * Builds a simple selection field inside a template + * @param string $strTable Table name (source data) + * @param string $strTabField Field name (source data) + * @param string $strTemplKey Template key + * @param int $intModeId 0=only data, 1=with empty line at the beginning, + * 2=with empty line and 'null' line at the beginning + * @param int $intSelId Selected data ID (from master table) + * @param int $intExclId Exclude ID + * @return int 0 = successful / 1 = error + */ + public function parseSelectSimple( + $strTable, + $strTabField, + $strTemplKey, + $intModeId = 0, + $intSelId = -9, + $intExclId = -9 + ) { + // Define variables + $intOption = 0; + $arrData = array(); + $intReturn = 1; + // Compute option value + if (($strTemplKey == 'hostcommand') || ($strTemplKey == 'servicecommand')) { + $intOption = 1; + } + if ($strTemplKey == 'eventhandler') { + $intOption = 2; + } + if ($strTemplKey == 'service_extinfo') { + $intOption = 7; + } + // Get version + $this->myConfigClass->getDomainData('version', $intVersion); + // Get raw data + $booRaw = $this->getSelectRawdata($strTable, $strTabField, $arrData, $intOption); + if ($booRaw == 0) { + // Insert an empty line in mode 1 + if (($intModeId == 1) || ($intModeId == 2)) { + $this->myContentTpl->setVariable('SPECIAL_STYLE', ''); + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), ' '); + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID', 0); + if ($intVersion < 3) { + $this->myContentTpl->setVariable('VERSION_20_MUST', 'inpmust'); + } + $this->myContentTpl->parse($strTemplKey); + } + // Insert a 'null' line in mode 2 + if ($intModeId == 2) { + $this->myContentTpl->setVariable('SPECIAL_STYLE', ''); + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), 'null'); + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID', -1); + if ($intVersion < 3) { + $this->myContentTpl->setVariable('VERSION_20_MUST', 'inpmust'); + } + if ($intSelId == -1) { + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey). '_SEL', 'selected'); + } + $this->myContentTpl->parse($strTemplKey); + } + // Insert data sets + foreach ($arrData as $elem) { + $this->myContentTpl->setVariable('SPECIAL_STYLE', ''); + if ($elem['key'] == $intExclId) { + continue; + } + if (isset($elem['active']) && $elem['active'] == 0) { + $strActive=' [inactive]'; + $this->myContentTpl->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + } + if (isset($elem['config_id']) && $elem['config_id'] == 0) { + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), htmlspecialchars( + $elem['value'], + ENT_QUOTES, + 'UTF-8' + ).' [common]'.$strActive); + } else { + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), htmlspecialchars( + $elem['value'], + ENT_QUOTES, + 'UTF-8' + ).$strActive); + } + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey). '_ID', $elem['key']); + if ($intVersion < 3) { + $this->myContentTpl->setVariable('VERSION_20_MUST', 'inpmust'); + } + if ($intSelId == $elem['key']) { + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey). '_SEL', 'selected'); + } + $this->myContentTpl->parse($strTemplKey); + } + $intReturn = 0; + } + return $intReturn; + } + + /** + * Builds a multi selection field inside a template + * @param string $strTable Table name (source data) + * @param string $strTabField Field name (source data) + * @param string $strTemplKey Template key + * @param string $strLinkTable Name of link table + * @param int $intModeId 0 = only data + * 1 = with empty line at the beginning + * 2 = with * line at the beginning + * @param int $intTypeId Type ID (from master table) + * @param int $intExclId Exclude ID + * @param string $strRefresh Session token for refresh mode + * @return int 0 = successful / 1 = error + */ + public function parseSelectMulti( + $strTable, + $strTabField, + $strTemplKey, + $strLinkTable, + $intModeId = 0, + $intTypeId = -9, + $intExclId = -9, + $strRefresh = '' + ) { + // Compute option value + $intOption = 2; + $intRefresh = 0; + $intReturn = 1; + $arrSelectedAdd = array(); + $arrData = array(); + $booSelAdd = false; + if ($strLinkTable == 'tbl_lnkServicegroupToService') { + $intOption = 3; + } + if ($strLinkTable == 'tbl_lnkServicedependencyToService_DS') { + $intOption = 4; + } + if ($strLinkTable == 'tbl_lnkServicedependencyToService_S') { + $intOption = 5; + } + if ($strLinkTable == 'tbl_lnkServiceescalationToService') { + $intOption = 6; + } + if ($strTemplKey == 'host_services') { + $intOption = 8; + } + if ($strTemplKey == 'service_parents') { + $intOption = 9; + } + if (($strLinkTable == 'tbl_lnkServiceToService') || ($strLinkTable == 'tbl_lnkServicetemplateToService')) { + $intOption = 10; + } + // Get version + $this->myConfigClass->getDomainData('version', $intVersion); + // Get raw data + $booRaw = $this->getSelectRawdata($strTable, $strTabField, $arrData, $intOption); + // Get selected data + $booSel = $this->getSelectedItems($strLinkTable, $arrSelected, $intOption); + // Get additional selected data + if ($strLinkTable == 'tbl_lnkHostToHostgroup') { + $booSelAdd = $this->getSelectedItems('tbl_lnkHostgroupToHost', $arrSelectedAdd, 8); + } + if ($strLinkTable == 'tbl_lnkHostgroupToHost') { + $booSelAdd = $this->getSelectedItems('tbl_lnkHostToHostgroup', $arrSelectedAdd, 8); + } + // Get browser + $strBrowser = $this->browserCheck(); + // Refresh processing (replaces selection array) + if ($strRefresh != '' && isset($this->arrSession['refresh']) && + isset($this->arrSession['refresh'][$strRefresh]) && + \is_array($this->arrSession['refresh'][$strRefresh])) { + $arrSelected = $this->arrSession['refresh'][$strRefresh]; + $intRefresh = 1; + $booSel = 0; + } + if ($booRaw == 0) { + $intCount = 0; + // Insert an empty line in mode 1 + if ($intModeId == 1) { + $this->myContentTpl->setVariable('SPECIAL_STYLE', ''); + $this->myContentTpl->setVariable('OPTION_DISABLED', ''); + if (($strBrowser == 'msie') && ($this->arrSettings['common']['seldisable'] != 0)) { + $this->myContentTpl->setVariable('OPTION_DISABLED', 'disabled="disabled"'); + } + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), ' '); + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID', 0); + if ($intVersion < 3) { + $this->myContentTpl->setVariable('VERSION_20_MUST', 'inpmust'); + } + $this->myContentTpl->parse($strTemplKey); + $intCount++; + } + // Insert an * line in mode 2 + if ($intModeId == 2) { + $this->myContentTpl->setVariable('SPECIAL_STYLE', ''); + $this->myContentTpl->setVariable('OPTION_DISABLED', ''); + if (($strBrowser == 'msie') && ($this->arrSettings['common']['seldisable'] != 0)) { + $this->myContentTpl->setVariable('OPTION_DISABLED', 'disabled="disabled"'); + } + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), '*'); + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID', '*'); + if ($intVersion < 3) { + $this->myContentTpl->setVariable('VERSION_20_MUST', 'inpmust'); + } + if ($intTypeId == 2) { + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey). '_SEL', 'selected'); + } + if (($intRefresh == 1) && \in_array('*', $arrSelected, true)) { + $this->myContentTpl->setVariable('DAT_' .strtoupper($strTemplKey). '_SEL', 'selected'); + $this->myContentTpl->setVariable('IE_' .strtoupper($strTemplKey). '_SEL', 'ieselected'); + } + $intCount++; + $this->myContentTpl->parse($strTemplKey); + } + // Insert data sets + foreach ($arrData as $elem) { + if ($elem['key'] == $intExclId) { + continue; + } + if (( $intOption == 10) && (strstr($elem['key'], '-', true) == $intExclId)) { + continue; + } + if ($elem['value'] == '') { + continue; + } + $intIsSelected = 0; + $intIsExcluded = 0; + $intIsForeign = 0; + $this->myContentTpl->setVariable('SPECIAL_STYLE', ''); + $this->myContentTpl->setVariable('OPTION_DISABLED', ''); + if (($strBrowser == 'msie') && ($this->arrSettings['common']['seldisable'] != 0)) { + $this->myContentTpl->setVariable('OPTION_DISABLED', 'disabled="disabled"'); + } + if (isset($elem['active']) && $elem['active'] == 0) { + $strActive=' [inactive]'; + $this->myContentTpl->setVariable('SPECIAL_STYLE', 'inactive_option'); + } else { + $strActive = ''; + } + if (isset($elem['config_id']) && $elem['config_id'] == 0) { + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), htmlspecialchars( + $elem['value'], + ENT_QUOTES, + 'UTF-8' + ).' [common]'.$strActive); + } else { + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), htmlspecialchars( + $elem['value'], + ENT_QUOTES, + 'UTF-8' + ).$strActive); + } + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey). '_ID', $elem['key']); + $this->myContentTpl->setVariable('CLASS_SEL', ''); + if ($intVersion < 3) { + $this->myContentTpl->setVariable('VERSION_20_MUST', 'inpmust'); + } + if (($booSel == 0) && \in_array($elem['key'], $arrSelected, true)) { + $intIsSelected = 1; + } + if (($booSel == 0) && \in_array($elem['value'], $arrSelected, true)) { + $intIsSelected = 1; + } + if ($booSelAdd !== null && ($booSelAdd == 0) && \in_array($elem['key'], $arrSelectedAdd, true)) { + $intIsForeign = 1; + } + if ($booSelAdd !== null && ($booSelAdd == 0) && \in_array($elem['value'], $arrSelectedAdd, true)) { + $intIsForeign = 1; + } + if (($intIsForeign == 1) && ($strActive == '')) { + $this->myContentTpl->setVariable('SPECIAL_STYLE', 'foreign_option'); + } + // Exclude rule + if (($booSel == 0) && \in_array('e' . $elem['key'], $arrSelected, true)) { + $intIsExcluded = 1; + } + if (($booSel == 0) && \in_array('e' . '::' . $elem['value'], $arrSelected, true)) { + $intIsExcluded = 1; + } + if ($intIsExcluded == 1) { + if (isset($elem['config_id']) && $elem['config_id'] == 0) { + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), '!'. + htmlspecialchars($elem['value'], ENT_QUOTES, 'UTF-8').' [common]'.$strActive); + } else { + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), '!'. + htmlspecialchars($elem['value'], ENT_QUOTES, 'UTF-8').$strActive); + } + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey). '_ID', 'e'.$elem['key']); + } + if (($intIsSelected == 1) || ($intIsExcluded == 1)) { + $this->myContentTpl->setVariable('DAT_' .strtoupper($strTemplKey). '_SEL', 'selected'); + $this->myContentTpl->setVariable('IE_' .strtoupper($strTemplKey). '_SEL', 'ieselected'); + } + $intCount++; + $this->myContentTpl->parse($strTemplKey); + } + if ($intCount == 0) { + // Insert an empty line to create valid HTML select fields + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), ' '); + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID', 0); + $this->myContentTpl->parse($strTemplKey); + } + $intReturn = 0; + } else { + // Insert an empty line to create valid HTML select fields + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey), ' '); + $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID', 0); + $this->myContentTpl->parse($strTemplKey); + } + return $intReturn; + } + + /** + * Merge message strings and check for duplicate messages + * @param string $strNewMessage Message to add + * @param string $strOldMessage Modified message string (by reference) + * @param string $strSeparate Separate string (
or \n) + */ + public function processMessage($strNewMessage, &$strOldMessage, $strSeparate = '
') + { + $strNewMessage = str_replace(array('::::', '::'), array('::', $strSeparate), $strNewMessage); + if (($strOldMessage != '') && ($strNewMessage != '')) { + if (substr_count($strOldMessage, $strNewMessage) == 0) { + if (substr_count(substr($strOldMessage, -5), $strSeparate) == 0) { + $strOldMessage .= $strSeparate.$strNewMessage; + } else { + $strOldMessage .= $strNewMessage; + } + } + } else { + $strOldMessage .= $strNewMessage; + } + } + + /** + * Returns an SQL fragment based on group access type + * @param string $strType Access type (read,write,link) + * @return string SQL fragment for group selection + */ + private function getGroupValue($strType) + { + // Define variables + $strTypeValue = ''; + // Select SQL by type + switch ($strType) { + case 'read': + $strTypeValue = "`read`='1'"; + break; + case 'write': + $strTypeValue = "`write`='1'"; + break; + case 'link': + $strTypeValue = "`link`='1'"; + break; + } + return $strTypeValue; + } + + /** + * Recursive function to build the main menu + * @param int intTopId ID of top menu point + * @param string $strCSS CSS class + * @param int $intCntId Menu group ID + * @param string $strMenuHTML HTML menu string (by Reference) + * @return bool + */ + private function hasMenuRecursive($intTopId, $strCSS, $intCntId, &$strMenuHTML) + { + // Define variables + $intLevel = substr_count($strCSS, '_sub') + 1; + $booReturn = false; + $arrData = array(); + // Define SQL + $strSQL = 'SELECT mnuId, mnuName, mnuTopId, mnuLink FROM tbl_menu ' . + "WHERE mnuTopId=$intTopId AND mnuCntId=$intCntId AND mnuActive <> 0 AND ". + 'mnuGrpId IN (' .$this->getAccessGroups('read'). ') ORDER BY mnuOrderId'; + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if (($booRet != false) && ($intDataCount != 0)) { + $strTemp = ''; + // Menu items + foreach ($arrData as $elem) { + $strName = translate($elem['mnuName']); + $strLink = $this->arrSettings['path']['base_url'].$elem['mnuLink']; + $strTemp .= ' '."\n"; + if (($elem['mnuId'] == $this->intPageId) || ($this->isMenuActive($elem['mnuId']) == true)) { + $strTemp .= ' '; + $strTemp .= ''.$strName.''."\n"; + $booReturn = true; + } else { + $strTemp .= ' '; + $strTemp .= ''.$strName.''."\n"; + } + $strTemp .= ' '."\n"; + // Recursive call to get submenu items + if ((($elem['mnuId'] == $this->intPageId) || ($this->isMenuActive($elem['mnuId']) == true)) && + $this->hasMenuRecursive($elem['mnuId'], $strCSS . '_sub', $intCntId, $strTemp) == true) { + $booReturn = true; + } + if ($intTopId == $this->intPageId) { + $booReturn = true; + } + } + if ($booReturn == true) { + $strMenuHTML .= $strTemp; + } elseif ($intLevel == 1) { + $strMenuHTML .= $strTemp; + } + } else { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + return $booReturn; + } + + /** + * Check if menu point is selected + * @param int $intMenuId Menu ID + * @return bool true if active + */ + public function isMenuActive($intMenuId) + { + $booReturn = false; + $arrData = array(); + $strSQL = 'SELECT mnuTopId FROM tbl_menu WHERE mnuId=' .$this->intPageId. ' AND mnuActive <> 0 ' . + 'AND mnuGrpId IN (' .$this->getAccessGroups('read'). ')'; + $booRet = $this->myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if (($booRet != false) && ($intDataCount != 0)) { + foreach ($arrData as $elem) { + if ($elem['mnuTopId'] == $intMenuId) { + $booReturn = true; + } + } + } else { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + return $booReturn; + } + + /** + * Get raw table data + * @param string $strTable Data table name + * @param string $strTabField Data field name + * @param array $arrData Raw data array (by reference) + * @param int $intOption Option value + * @return int 0 = successful / 1 = error + */ + public function getSelectRawdata($strTable, $strTabField, &$arrData, $intOption = 0) + { + // Define variables + $arrDataRaw = array(); + $intDataCount = 0; + $intReturn = 0; + // Get link rights + $strAccess = $this->getAccessGroups('link'); + // Common domain is enabled? + $this->myConfigClass->getDomainData('enable_common', $intCommonEnable); + if ($intCommonEnable == 1) { + $strDomainWhere1 = ' (`config_id`=' .$this->intDomainId. ' OR `config_id`=0) '; + $strDomainWhere2 = ' (`tbl_service`.`config_id`=' .$this->intDomainId. ' OR `tbl_service`.`config_id`=0) '; + } else { + $strDomainWhere1 = ' `config_id`=' .$this->intDomainId. ' '; + $strDomainWhere2 = ' `tbl_service`.`config_id`=' .$this->intDomainId. ' '; + } + // Define SQL commands + if ($strTable == 'tbl_group') { + $strSQL = $this->getRawDataSQLGroup($strTabField); + } elseif (($strTable == 'tbl_configtarget') || ($strTable == 'tbl_datadomain') || + ($strTable == 'tbl_language')) { + $strSQL = $this->getRawDataSQLDomain($strTable, $strTabField); + } elseif ($strTable == 'tbl_command') { + $strSQL = $this->getRawDataSQLCommand($strTabField, $strDomainWhere1, $strAccess, $intOption); + } elseif (($strTable == 'tbl_timeperiod') && ($strTabField == 'name')) { + $strSQL = $this->getRawDataSQLTimeperiod($strDomainWhere1, $strAccess); + } elseif (($strTable == 'tbl_service') && ($intOption == 3)) { + $strSQL = $this->getRawDataSQLService3($strDomainWhere2, $strAccess); + } elseif (($strTable == 'tbl_service') && (($intOption == 4) || ($intOption == 5) || ($intOption == 6))) { + $strSQL = $this->getRawDataSQLService456($strTabField, $intOption, $strDomainWhere1, $strAccess); + } elseif (($strTable == 'tbl_service') && ($intOption == 7)) { + if (isset($this->arrSession['refresh']) && isset($this->arrSession['refresh']['se_host'])) { + $intHostId = $this->arrSession['refresh']['se_host']; + $strSQL = $this->getRawDataSQLService7($strTabField, $strDomainWhere1, $intHostId, $strAccess); + } else { + $strSQL = ''; + } + } elseif ((($strTable == 'tbl_service') || ($strTable == 'tbl_servicetemplate')) && + (($intOption == 8) || ($intOption == 9))) { + // Service selection inside Host definition + $strSQL = $this->getRawDataSQLService89($strDomainWhere1, $strAccess); + } elseif ((($strTable == 'tbl_service') || ($strTable == 'tbl_servicetemplate')) && + + ($intOption == 10)) { + // Service selection inside Host definition + $strSQL = $this->getRawDataSQLService10($strDomainWhere2, $strAccess); + } else { + // Common statement + $strSQL = $this->getRawDataSQLCommon($strTable, $strTabField, $strDomainWhere1, $strAccess); + } + // Process data + if ($strSQL != '') { + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataRaw, $intDataCount); + if ($booReturn == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + $intReturn = 1; + } + } + if ($strTable == 'tbl_group') { + $arrTemp = array(); + $arrTemp['key'] = 0; + $arrTemp['value'] = translate('Unrestricted access'); + $arrData[] = $arrTemp; + } + if (($intReturn == 0) && ($intDataCount != 0)) { + foreach ($arrDataRaw as $elem) { + $arrData[] = $elem; + } + } elseif ($strTable != 'tbl_group') { + $arrData = array('key' => 0, 'value' => 'no data'); + $intReturn = 1; + } + return $intReturn; + } + + /** + * Inserts the domain list to the list view template (host and services only) + * @param \HTML_Template_IT $resTemplate Template object + */ + public function insertDomainList($resTemplate) + { + $arrDataDomain = array(); + $strSQL = "SELECT * FROM `tbl_datadomain` WHERE `active` <> '0' ORDER BY `domain`"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataDomain, $intDataCount); + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrDataDomain as $elem) { + // Check access rights + if ($this->checkAccountGroup($elem['access_group'], 'read') == 0) { + $resTemplate->setVariable('DOMAIN_ID', $elem['id']); + $resTemplate->setVariable('DOMAIN_NAME', $elem['domain']); + if ($this->arrSession['domain'] == $elem['id']) { + $resTemplate->setVariable('DOMAIN_SEL', 'selected'); + } + $resTemplate->parse('domainlist'); + } + } + } elseif (!$booReturn) { + $this->strErrorMessage .= translate('Error while selecting data from database:'). + '::' .$this->myDBClass->strErrorMessage; + } + } + + /** + * Adds a "/" after a parh string and replaces double "//" with "/" + * @param string $strPath Path string + * @return string Modified path string + */ + public function addSlash($strPath) + { + if ($strPath == '') { + return ''; + } + $strPath .= '/'; + while (substr_count($strPath, '//') != 0) { + $strPath = str_replace('//', '/', $strPath); + } + return $strPath; + } + + /////////////////////////////////////////////////////////////////////////////////////////// + // Function: Process "null" values + /////////////////////////////////////////////////////////////////////////////////////////// + // + // Replaces "NULL" with -1 + // + // Parameters: $strKey Process string + // + // Return value: Modified process string + // + /////////////////////////////////////////////////////////////////////////////////////////// + /** + * Replaces "NULL" with -1 + * @param string $strKey Process string + * @return string Modified process string + */ + public function checkNull($strKey) + { + $strReturn = $strKey; + if (strtoupper($strKey) == 'NULL') { + $strReturn = -1; + } + return $strReturn; + } + + + // PRIVATE functions + + /** + * Define SQL commands for group table + * @param string $strTabField Table field + * @return string SQL Statement + */ + private function getRawDataSQLGroup($strTabField) + { + $strSQL = 'SELECT `id` AS `key`, `' . $strTabField . '` AS `value`, `active` ' . + "FROM `tbl_group` WHERE `active`='1' AND `" . $strTabField . "` <> '' ". + 'AND `' . $strTabField . '` IS NOT NULL ORDER BY `' . $strTabField . '`'; + return $strSQL; + } + + /** + * Define SQL commands for configtarget, datadomain and language table + * @param string $strTable Table name + * @param string $strTabField Table field + * @return string SQL Statement + */ + private function getRawDataSQLDomain($strTable, $strTabField) + { + $strSQL = 'SELECT `id` AS `key`, `' . $strTabField . '` AS `value`, `active` ' . + 'FROM `' . $strTable . '` WHERE `' . $strTabField . "` <> '' AND `" . $strTabField . + '` IS NOT NULL ORDER BY `' . $strTabField . '`'; + return $strSQL; + } + + /** + * Define SQL commands for command table + * @param string $strTabField Table field + * @param string $strDomainWhere1 WHERE SQL domain part + * @param string $strAccess Access groups + * @param int $intOption Command type option + * @return string SQL Statement + */ + private function getRawDataSQLCommand($strTabField, $strDomainWhere1, $strAccess, $intOption) + { + $strSQL = 'SELECT `id` AS `key`, `' . $strTabField . '` AS `value`, `config_id`, `active` ' . + "FROM `tbl_command` WHERE $strDomainWhere1 AND `" . $strTabField . "` <> '' AND `" . + $strTabField . "` IS NOT NULL AND `access_group` IN ($strAccess) AND (`command_type` = 0 ". + 'OR `command_type` = ' . $intOption . ') ORDER BY `' . $strTabField . '`'; + return $strSQL; + } + + /** + * Define SQL commands for timeperiod table + * @param string $strDomainWhere1 WHERE SQL domain part + * @param string $strAccess Access groups + * @return string SQL Statement + */ + private function getRawDataSQLTimeperiod($strDomainWhere1, $strAccess) + { + $strSQL = 'SELECT `id` AS `key`, `name` AS `value`, `config_id`, `active` ' . + "FROM `tbl_timeperiod` WHERE $strDomainWhere1 AND `name` <> '' AND `name` IS NOT NULL ". + "AND `access_group` IN ($strAccess) ORDER BY value"; + return $strSQL; + } + + /** + * Define SQL commands for service table + * @param string $strDomainWhere2 WHERE SQL domain part + * @param string $strAccess Access groups + * @return string SQL Statement + */ + private function getRawDataSQLService3($strDomainWhere2, $strAccess) + { + $strSQLPart1 = "WHERE $strDomainWhere2 AND `tbl_service`.`service_description` <> '' " . + 'AND `tbl_service`.`service_description` IS NOT NULL AND `tbl_service`.`hostgroup_name` <> 0 ' . + "AND `tbl_service`.`access_group` IN ($strAccess) "; + $strSQL = "SELECT CONCAT_WS('::',`tbl_host`.`id`,'0',`tbl_service`.`id`) AS `key`, " . + "CONCAT('H:',`tbl_host`.`host_name`,',',`tbl_service`.`service_description`) AS `value`, " . + '`tbl_service`.`active` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_lnkServiceToHost` ON `tbl_service`.`id` = `tbl_lnkServiceToHost`.`idMaster` ' . + 'LEFT JOIN `tbl_host` ON `tbl_lnkServiceToHost`.`idSlave` = `tbl_host`.`id` ' . + str_replace('hostgroup_name', 'host_name', $strSQLPart1) . + 'UNION ' . + "SELECT CONCAT_WS('::','0',`tbl_hostgroup`.`id`,`tbl_service`.`id`) AS `key`, " . + "CONCAT('HG:',`tbl_hostgroup`.`hostgroup_name`,',',`tbl_service`.`service_description`) " . + 'AS `value`, `tbl_service`.`active` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id`=`tbl_lnkServiceToHostgroup`.`idMaster`' . + 'LEFT JOIN `tbl_hostgroup` ON `tbl_lnkServiceToHostgroup`.`idSlave` = `tbl_hostgroup`.`id` ' . + $strSQLPart1 . + 'UNION ' . + "SELECT CONCAT_WS('::',`tbl_host`.`id`,'0',`tbl_service`.`id`) AS `key`, " . + "CONCAT('HHG:',`tbl_host`.`host_name`,',',`tbl_service`.`service_description`) AS `value`, " . + '`tbl_service`.`active` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id`=`tbl_lnkServiceToHostgroup`.`idMaster`' . + 'LEFT JOIN `tbl_lnkHostgroupToHost` ON `tbl_lnkHostgroupToHost`.`idMaster` = ' . + '`tbl_lnkServiceToHostgroup`.`idSlave` ' . + 'LEFT JOIN `tbl_host` ON `tbl_lnkHostgroupToHost`.`idSlave` = `tbl_host`.`id` ' . + $strSQLPart1 . + 'UNION ' . + "SELECT CONCAT_WS('::',`tbl_host`.`id`,'0',`tbl_service`.`id`) AS `key`, " . + "CONCAT('HGH:',`tbl_host`.`host_name`,',',`tbl_service`.`service_description`) AS `value`, " . + '`tbl_service`.`active` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id`=`tbl_lnkServiceToHostgroup`.`idMaster` ' . + 'LEFT JOIN `tbl_lnkHostToHostgroup` ON `tbl_lnkHostToHostgroup`.`idSlave` = ' . + '`tbl_lnkServiceToHostgroup`.`idSlave` ' . + 'LEFT JOIN `tbl_host` ON `tbl_lnkHostToHostgroup`.`idMaster` = `tbl_host`.`id` ' . + $strSQLPart1 . + 'ORDER BY value'; + return $strSQL; + } + + /** + * Define SQL commands for service table + * @param string $strDomainWhere1 WHERE SQL domain part + * @param string $elem Host array + * @param string $strAccess Access groups + * @return string SQL Statement + */ + private function getRawDataSQLService4($strDomainWhere1, $elem, $strAccess) + { + $strSQL = 'SELECT `id`, `service_description` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_lnkServiceToHost` ON `tbl_service`.`id` = `tbl_lnkServiceToHost`.`idMaster` ' . + "WHERE $strDomainWhere1 AND `tbl_lnkServiceToHost`.`idSlave` = $elem AND `service_description`<>'' ". + "AND `service_description` IS NOT NULL AND `access_group` IN ($strAccess) " . + 'UNION ' . + 'SELECT `id`, `service_description` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id`=`tbl_lnkServiceToHostgroup`.`idMaster` ' . + 'LEFT JOIN `tbl_lnkHostToHostgroup` ON `tbl_lnkServiceToHostgroup`.`idSlave` = ' . + '`tbl_lnkHostToHostgroup`.`idSlave` ' . + "WHERE $strDomainWhere1 AND `tbl_lnkHostToHostgroup`.`idMaster`=$elem AND `service_description`<>'' ". + " AND `service_description` IS NOT NULL AND `access_group` IN ($strAccess) ". + 'UNION ' . + 'SELECT `id`, `service_description` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id`=`tbl_lnkServiceToHostgroup`.`idMaster` ' . + 'LEFT JOIN `tbl_lnkHostgroupToHost` ON `tbl_lnkServiceToHostgroup`.`idSlave` = ' . + '`tbl_lnkHostgroupToHost`.`idMaster` ' . + "WHERE $strDomainWhere1 AND `tbl_lnkHostgroupToHost`.`idSlave`=$elem AND `service_description`<>'' ". + "AND `service_description` IS NOT NULL AND `access_group` IN ($strAccess)"; + return $strSQL; + } + + /** + * Define SQL commands for service table + * @param string $strDomainWhere1 WHERE SQL domain part + * @param string $elem Hostgroup array + * @param string $strAccess Access groups + * @return string SQL Statement + */ + private function getRawDataSQLService5($strDomainWhere1, $elem, $strAccess) + { + $strSQL = 'SELECT `id`, `service_description` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id`=`tbl_lnkServiceToHostgroup`.`idMaster` ' . + "WHERE $strDomainWhere1 AND `tbl_lnkServiceToHostgroup`.`idSlave` = $elem ". + "AND `service_description` <> '' AND `service_description` IS NOT NULL AND `access_group` ". + "IN ($strAccess)"; + return $strSQL; + } + + /** + * Define SQL commands for service table + * @param string $strTabField Table field + * @param string $strWhere WHERE SQL domain part + * @param string $strServices Comma separated list of services + * @param string $strServicesId Comma separated list of services IDs + * @param string $strAccess Access groups + * @return string SQL Statement + */ + private function getRawDataSQLService6($strTabField, $strWhere, $strServices, $strServicesId, $strAccess) + { + $strSQL = 'SELECT `id` AS `key`, `' . $strTabField . '` AS `value`, `active` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_lnkServiceToHost` ON `tbl_service`.`id` = `tbl_lnkServiceToHost`.`idMaster` ' . + "WHERE $strWhere AND `tbl_service`.`service_description` IN ($strServices) ". + "AND `tbl_service`.`id` IN ($strServicesId) AND `" . $strTabField . "` <> '' AND `" . + $strTabField . "` IS NOT NULL AND `access_group` IN ($strAccess) GROUP BY `value` ". + 'UNION ' . + 'SELECT `id` AS `key`, `' . $strTabField . '` AS `value`, `active` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id`=`tbl_lnkServiceToHostgroup`.`idMaster` ' . + "WHERE $strWhere AND `tbl_service`.`service_description` IN ($strServices) ". + "AND `tbl_service`.`id` IN ($strServicesId) AND `" . $strTabField . "` <> '' AND `" . + $strTabField . "` IS NOT NULL AND `access_group` IN ($strAccess) GROUP BY `value` ". + 'UNION ' . + 'SELECT `id` AS `key`, `' . $strTabField . '` AS `value`, `active` FROM `tbl_service` ' . + "WHERE $strWhere AND `host_name`=2 OR `hostgroup_name`=2 AND `" . $strTabField . "` <> '' ". + 'AND `' . $strTabField . "` IS NOT NULL AND `access_group` IN ($strAccess) ". + 'GROUP BY `value` ORDER BY `value`'; + return $strSQL; + } + + /** + * Define SQL commands for service table + * @param string $strTabField Table field + * @param string $strDomainWhere1 WHERE SQL domain part + * @param int $intHostId Host ID + * @param string $strAccess Access groups + * @return string SQL Statement + */ + private function getRawDataSQLService7($strTabField, $strDomainWhere1, $intHostId, $strAccess) + { + $strSQL = 'SELECT `tbl_service`.`id` AS `key`, `tbl_service`.`' . $strTabField . '` AS `value`, ' . + '`tbl_service`.`active` FROM `tbl_service` ' . + 'LEFT JOIN `tbl_lnkServiceToHost` ON `tbl_service`.`id` = `tbl_lnkServiceToHost`.`idMaster` ' . + "WHERE $strDomainWhere1 AND `tbl_lnkServiceToHost`.`idSlave` = $intHostId AND `" . $strTabField . + "` <> '' AND `" . $strTabField . "` IS NOT NULL AND `access_group` IN ($strAccess) ". + 'ORDER BY `' . $strTabField . '`'; + return $strSQL; + } + + /** + * Define SQL commands for service table + * @param string $strDomainWhere1 WHERE SQL domain part + * @param string $strAccess Access groups + * @return string SQL Statement + */ + private function getRawDataSQLService89($strDomainWhere1, $strAccess) + { + $strSQL = "SELECT `tbl_service`.`id` AS `key`, CONCAT(`tbl_service`.`config_name`, ' - ', ". + '`tbl_service`.`service_description`) AS `value`, `active` ' . + "FROM `tbl_service` WHERE $strDomainWhere1 AND `tbl_service`.`config_name` <> '' ". + "AND `tbl_service`.`config_name` IS NOT NULL AND `tbl_service`.`service_description` <> '' ". + "AND `tbl_service`.`service_description` IS NOT NULL AND `access_group` IN ($strAccess) ". + 'ORDER BY `value`'; + return $strSQL; + } + + /** + * Define SQL commands for service table + * @param string $strDomainWhere2 WHERE SQL domain part for services + * @param string $strAccess Access groups + * @return string SQL Statement + */ + private function getRawDataSQLService10($strDomainWhere2, $strAccess) + { + $strSQL = 'SELECT CONCAT(tbl_service.id, "-", tbl_host.id) AS `key`, CONCAT(tbl_host.host_name, " - ", ' + . 'tbl_service.service_description) AS `value`, tbl_service.active ' + . 'FROM tbl_service ' + . 'LEFT JOIN tbl_lnkServiceToHost ON tbl_service.id=tbl_lnkServiceToHost.idMaster ' + . 'LEFT JOIN tbl_host ON tbl_lnkServiceToHost.idSlave=tbl_host.id ' + . 'WHERE '.$strDomainWhere2.' AND tbl_service.service_description <> "" ' + . 'AND tbl_service.service_description IS NOT NULL AND tbl_host.host_name IS NOT NULL ' + . 'AND tbl_service.access_group IN ('.$strAccess.') ' + . 'UNION ' + . 'SELECT CONCAT(tbl_service.id, "-", tbl_host.id) AS `key`, CONCAT(tbl_host.host_name, " - ", ' + . 'tbl_service.service_description) AS `value`, tbl_service.active ' + . 'FROM tbl_service ' + . 'LEFT JOIN tbl_lnkServiceToHostgroup ON tbl_service.id=tbl_lnkServiceToHostgroup.idMaster ' + . 'LEFT JOIN tbl_lnkHostgroupToHost ON tbl_lnkServiceToHostgroup.idSlave = ' + . 'tbl_lnkHostgroupToHost.idMaster ' + . 'LEFT JOIN tbl_host ON tbl_lnkHostgroupToHost.idSlave=tbl_host.id ' + . 'WHERE '.$strDomainWhere2.' AND tbl_service.service_description <> "" ' + . 'AND tbl_service.service_description IS NOT NULL AND tbl_host.host_name IS NOT NULL ' + . 'AND tbl_service.access_group IN ('.$strAccess.') ' + . 'ORDER BY `value`'; + return $strSQL; + } + + /** + * Define SQL commands for common tables + * @param string $strTable Table name + * @param string $strTabField Table field + * @param string $strDomainWhere1 WHERE SQL domain part + * @param string $strAccess Access groups + * @return string SQL Statement + */ + private function getRawDataSQLCommon($strTable, $strTabField, $strDomainWhere1, $strAccess) + { + $strSQL = 'SELECT `id` AS `key`, `' . $strTabField . '` AS `value`, `config_id`, `active` ' . + 'FROM `' . $strTable . "` WHERE $strDomainWhere1 AND `" . $strTabField . "` <> '' ". + 'AND `' . $strTabField . "` IS NOT NULL AND `access_group` IN ($strAccess) ". + 'ORDER BY `' . $strTabField . '`'; + return $strSQL; + } + + /** + * Define SQL commands for service table + * @param string $strTabField Table field + * @param int $intOption Option ID + * @param string $strDomainWhere1 WHERE SQL domain part + * @param string $strAccess Access groups + * @return string SQL Statement + */ + private function getRawDataSQLService456($strTabField, $intOption, $strDomainWhere1, $strAccess) + { + // Define variables + if ($intOption == 6) { + $strHostVar = 'se_host'; + $strHostGroupVar = 'se_hostgroup'; + } elseif ($intOption == 4) { + $strHostVar = 'sd_dependent_host'; + $strHostGroupVar = 'sd_dependent_hostgroup'; + } else { + $strHostVar = 'sd_host'; + $strHostGroupVar = 'sd_hostgroup'; + } + if (!isset($this->arrSession['refresh'])) { + $this->arrSession['refresh'] = array(); + } + $arrHosts = array(); + $arrHostgroups = array(); + $arrServices = array(); + $arrDataHost = array(); + $arrDataTmp = array(); + $arrHostTemp = array(); + $arrHostgroupTemp = array(); + $arrServicesId = array(); + $intDCHost = 0; + $intDataTmp = 0; + // Refresh mode - fill arrays + if (isset($this->arrSession['refresh'][$strHostVar]) && + \is_array($this->arrSession['refresh'][$strHostVar])) { + $arrHosts = $this->arrSession['refresh'][$strHostVar]; + } else { + if ($intOption == 4) { + $strSQL = 'SELECT `idSlave` FROM `tbl_lnkServicedependencyToHost_DH` ' + . 'WHERE `idMaster`=' . $this->intDataId; + } elseif ($intOption == 6) { + $strSQL = 'SELECT `idSlave` FROM `tbl_lnkServiceescalationToHost` ' + . 'WHERE `idMaster`=' . $this->intDataId; + } else { + $strSQL = 'SELECT `idSlave` FROM `tbl_lnkServicedependencyToHost_H` ' + . 'WHERE `idMaster`=' .$this->intDataId; + } + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataHost, $intDCHost); + if ($booReturn == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } elseif ($intDCHost != 0) { + $arrHostTemp = array(); + foreach ($arrDataHost as $elem) { + $arrHostTemp[] = $elem['idSlave']; + } + $arrHosts = $arrHostTemp; + } + } + if (isset($this->arrSession['refresh'][$strHostGroupVar]) && + \is_array($this->arrSession['refresh'][$strHostGroupVar])) { + $arrHostgroups = $this->arrSession['refresh'][$strHostGroupVar]; + } else { + if ($intOption == 4) { + $strSQL = 'SELECT `idSlave` FROM `tbl_lnkServicedependencyToHostgroup_DH` ' + . 'WHERE `idMaster`=' .$this->intDataId; + } elseif ($intOption == 6) { + $strSQL = 'SELECT `idSlave` FROM `tbl_lnkServiceescalationToHostgroup` ' + . 'WHERE `idMaster`=' . $this->intDataId; + } else { + $strSQL = 'SELECT `idSlave` FROM `tbl_lnkServicedependencyToHostgroup_H` ' + . 'WHERE `idMaster`=' .$this->intDataId; + } + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataHost, $intDCHost); + if ($booReturn == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } elseif ($intDCHost != 0) { + $arrHostgroupTemp = array(); + foreach ($arrDataHost as $elem) { + $arrHostgroupTemp[] = $elem['idSlave']; + } + $arrHostgroups = $arrHostgroupTemp; + } + } + if (\is_array($arrHosts) && (\count($arrHosts) == 1) && $arrHosts[0] == '') { + $arrHosts = array(); + } + if (\is_array($arrHostgroups) && (\count($arrHostgroups) == 1) && $arrHostgroups[0] == '') { + $arrHostgroups = array(); + } + if (\in_array('*', $arrHosts, true)) { + $strSQL = "SELECT id FROM tbl_host WHERE $strDomainWhere1 AND `access_group` IN ($strAccess)"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataHost, $intDCHost); + if ($booReturn == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + if ($booReturn && ($intDCHost != 0)) { + $arrHostTemp = array(); + foreach ($arrDataHost as $elem) { + if (\in_array('e' . $elem['id'], $this->arrSession['refresh'][$strHostVar], true)) { + continue; + } + $arrHostTemp[] = $elem['id']; + } + } + $strHosts = 1; + $arrHosts = $arrHostTemp; + } else { + $strHosts = \count($arrHosts) + 0; + } + // * Value in host groups -> disabled in NagiosQL 3.2 + if (\in_array('*', $arrHostgroups, true)) { + $strSQL = "SELECT id FROM tbl_hostgroup WHERE $strDomainWhere1 AND `access_group` " . + "IN ($strAccess)"; + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrDataHost, $intDCHost); + if ($booReturn == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + if ($booReturn && ($intDCHost != 0)) { + $arrHostgroupTemp = array(); + foreach ($arrDataHost as $elem) { + if (\in_array('e' . $elem['id'], $this->arrSession['refresh'][$strHostGroupVar], true)) { + continue; + } + $arrHostgroupTemp[] = $elem['id']; + } + } + $strHostsGroup = 1; + $arrHostgroups = $arrHostgroupTemp; + } else { + $strHostsGroup = \count($arrHostgroups) + 0; + } + // Special method - only host_name or hostgroup_name selected + if (($strHostVar == 'sd_dependent_host') && ($strHosts == 0) && ($strHostsGroup == 0)) { + if (\is_array($this->arrSession['refresh']['sd_host'])) { + $arrHosts = $this->arrSession['refresh']['sd_host']; + } + if (\is_array($this->arrSession['refresh']['sd_hostgroup'])) { + $arrHostgroups = $this->arrSession['refresh']['sd_hostgroup']; + } + if ((\count($arrHosts) == 1) && $arrHosts[0] == '') { + $arrHosts = array(); + } + if ((\count($arrHostgroups) == 1) && $arrHostgroups[0] == '') { + $arrHostgroups = array(); + } + $strHosts = \count($arrHosts) + 0; + $strHostsGroup = \count($arrHostgroups) + 0; + } + // If no hosts and hostgroups are selected show any service + if (($strHosts == 0) && ($strHostsGroup == 0)) { + $strSQL = 'SELECT `id` AS `key`, `' . $strTabField . '` AS `value`, `active` FROM `tbl_service` ' . + "WHERE $strDomainWhere1 AND `" . $strTabField . "` <> '' AND `" . $strTabField . '` ' . + "IS NOT NULL AND `access_group` IN ($strAccess) GROUP BY `value` ORDER BY `value`"; + } else { + if ($strHosts != 0) { + $intCounter = 0; + foreach ($arrHosts as $elem) { + if (($intCounter != 0) && (\count($arrServices) == 0)) { + continue; + } + $arrTempServ = array(); + $arrTempServId = array(); + $elem = str_replace('e', '', $elem); + $strSQLTmp = $this->getRawDataSQLService4($strDomainWhere1, $elem, $strAccess); + $booReturn = $this->myDBClass->hasDataArray($strSQLTmp, $arrDataTmp, $intDataTmp); + if ($booReturn && ($intDataTmp != 0)) { + foreach ($arrDataTmp as $elem2) { + if ($intCounter == 0) { + $arrTempServ[] = $elem2['service_description']; + $arrTempServId[] = $elem2['id']; + } elseif (\in_array($elem2['service_description'], $arrServices, true) && + !\in_array($elem2['service_description'], $arrTempServ, true)) { + $arrTempServ[] = $elem2['service_description']; + $arrTempServId[] = $elem2['id']; + } + } + } + $arrServices = $arrTempServ; + $arrServicesId = $arrTempServId; + $intCounter++; + } + } + if ($strHostsGroup != 0) { + $intCounter = 0; + foreach ($arrHostgroups as $elem) { + if (($intCounter != 0) && (\count($arrServices) == 0)) { + continue; + } + $arrTempServ = array(); + $arrTempServId = array(); + $elem = str_replace('e', '', $elem); + $strSQLTmp = $this->getRawDataSQLService5($strDomainWhere1, $elem, $strAccess); + $booReturn = $this->myDBClass->hasDataArray($strSQLTmp, $arrDataTmp, $intDataTmp); + if ($booReturn && ($intDataTmp != 0)) { + foreach ($arrDataTmp as $elem2) { + if ($intCounter == 0) { + $arrTempServ[] = $elem2['service_description']; + $arrTempServId[] = $elem2['id']; + } elseif (\in_array($elem2['service_description'], $arrServices, true) && + !\in_array($elem2['service_description'], $arrTempServ, true)) { + $arrTempServ[] = $elem2['service_description']; + $arrTempServId[] = $elem2['id']; + } + } + } + $arrServices = $arrTempServ; + $arrServicesId = $arrTempServId; + $intCounter++; + } + } + if (\count($arrServices) != 0) { + $strServices = "'" . implode("','", $arrServices) . "'"; + $strServicesId = implode(',', $arrServicesId); + $strSQL = $this->getRawDataSQLService6( + $strTabField, + $strDomainWhere1, + $strServices, + $strServicesId, + $strAccess + ); + } else { + $strSQL = ''; + } + } + return $strSQL; + } + + /** + * Get selected data + * @param string $strLinkTable Link table name + * @param array $arrSelect Result data array + * @param int $intOption Option parameter + * @return int 0 = successful / 1 = error + */ + private function getSelectedItems($strLinkTable, &$arrSelect, $intOption = 0) + { + // Define variables + $arrSelectedRaw = array(); + $intDataCount = 0; + $intReturn = 1; + // Define SQL commands + if ($intOption == 8) { + $strSQL = 'SELECT * FROM `' .$strLinkTable. '` WHERE `idSlave`=' .$this->intDataId; + } else { + $strSQL = 'SELECT * FROM `' .$strLinkTable. '` WHERE `idMaster`=' .$this->intDataId; + } + // Process data + $booReturn = $this->myDBClass->hasDataArray($strSQL, $arrSelectedRaw, $intDataCount); + if ($booReturn == false) { + $this->strErrorMessage .= $this->myDBClass->strErrorMessage; + } + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrSelectedRaw as $elem) { + // Multi tables + if ($strLinkTable == 'tbl_lnkServicegroupToService') { + if (isset($elem['exclude']) && ($elem['exclude'] == 1)) { + $arrSelect[] = 'e' .$elem['idSlaveH']. '::' .$elem['idSlaveHG']. '::' .$elem['idSlaveS']; + } else { + $arrSelect[] = $elem['idSlaveH']. '::' .$elem['idSlaveHG']. '::' .$elem['idSlaveS']; + } + // Servicedependencies and -escalations + } elseif (($strLinkTable == 'tbl_lnkServicedependencyToService_DS') || + ($strLinkTable == 'tbl_lnkServicedependencyToService_S') || + ($strLinkTable == 'tbl_lnkServiceescalationToService')) { + if (isset($elem['exclude']) && ($elem['exclude'] == 1)) { + $arrSelect[] = 'e::' .$elem['strSlave']; + } else { + $arrSelect[] = $elem['strSlave']; + } + // Service parents + } elseif (($strLinkTable == 'tbl_lnkServiceToService') || + ($strLinkTable == 'tbl_lnkServicetemplateToService')) { + $arrSelect[] = $elem['idSlave'].'-'.$elem['idHost']; + // Standard tables + } else { + if ($intOption == 8) { + if (isset($elem['exclude']) && ($elem['exclude'] == 1)) { + $arrSelect[] = 'e' .$elem['idMaster']; + } else { + $arrSelect[] = $elem['idMaster']; + } + } else { + if (isset($elem['exclude']) && ($elem['exclude'] == 1)) { + $arrSelect[] = 'e' .$elem['idSlave']; + } else { + $arrSelect[] = $elem['idSlave']; + } + } + } + } + $intReturn = 0; + } + return $intReturn; + } +} diff --git a/functions/common.js b/functions/common.js index b769ed9..c58de2a 100644 --- a/functions/common.js +++ b/functions/common.js @@ -1,435 +1,460 @@ -popup = false; +/* +(c) 2005-2018 by Martin Willisegger +Project : NagiosQL +Component : common JavaScript functions +Website : https://sourceforge.net/projects/nagiosql/ +Version : 3.4.0 +GIT Repo : https://gitlab.com/wizonet/NagiosQL + */ +let popup = false; function info(key1,key2,ver) { - if(popup&&popup.closed==false) popup.close(); - var top = (screen.availHeight - 240) / 2; - var left = (screen.availWidth - 320) / 2; - popup = window.open("info.php?key1=" + key1 + "&key2=" + key2 + "&version=" + ver, - "Information", - "width=320, height=240, top=" + top + ", left=" + left + ", SCROLLBARS=YES, MERNUBAR=NO, DEPENDENT=YES"); - popup.focus(); + if(popup && popup.closed === false) popup.close(); + const top = (screen.availHeight - 240) / 2; + const left = (screen.availWidth - 320) / 2; + popup = window.open("info.php?key1=" + key1 + "&key2=" + key2 + "&version=" + ver, + "Information", + "width=320, height=240, top=" + top + ", left=" + left + ", SCROLLBARS=YES, MERNUBAR=NO, DEPENDENT=YES"); + popup.focus(); } -var myFocusObject = new Object(); + +const myFocusObject = {}; + function checkfields(fields,frm,object) { - var error = false; - var ar_field = fields.split(","); - for (i=0;i function msginit(msg,header,type) { - YAHOO.namespace("msg.container"); - var handleOK = function() { - this.hide(); - //myFocusObject.myValue.focus(); - }; - if (type == 1) { - var iconobj = YAHOO.widget.SimpleDialog.ICON_WARN; - } - if (type == 2) { - var iconobj = YAHOO.widget.SimpleDialog.ICON_HELP; - } - YAHOO.msg.container.domainmsg = new YAHOO.widget.SimpleDialog("domainmsg", - { width: "300px", - fixedcenter: true, - visible: false, - draggable: false, - close: true, - text: msg, - modal: true, - icon: iconobj, - constraintoviewport: true, - buttons: [ { text:"Ok", handler:handleOK, isDefault:true } ] - } ); - YAHOO.msg.container.domainmsg.setHeader(header); - YAHOO.msg.container.domainmsg.render("msgcontainer"); - YAHOO.msg.container.domainmsg.show(); + let iconobj; + YAHOO.namespace("msg.container"); + const handleOK = function () { + this.hide(); + //myFocusObject.myValue.focus(); + }; + if (type === 1) { + iconobj = YAHOO.widget.SimpleDialog.ICON_WARN; + } + if (type === 2) { + iconobj = YAHOO.widget.SimpleDialog.ICON_HELP; + } + YAHOO.msg.container.domainmsg = new YAHOO.widget.SimpleDialog("domainmsg", + { width: "300px", + fixedcenter: true, + visible: false, + draggable: false, + close: true, + text: msg, + modal: true, + icon: iconobj, + constraintoviewport: true, + buttons: [ { text:"Ok", handler:handleOK, isDefault:true } ] + } ); + YAHOO.msg.container.domainmsg.setHeader(header); + YAHOO.msg.container.domainmsg.render("msgcontainer"); + YAHOO.msg.container.domainmsg.show(); } function confirminit(msg,header,type,yes,no,key) { - YAHOO.namespace("question.container"); - var handleYes = function() { - confOpenerYes(key); - this.hide(); - }; - var handleNo = function() { - this.hide(); - }; - if (type == 1) { - var iconobj = YAHOO.widget.SimpleDialog.ICON_WARN; - } - YAHOO.question.container.domainmsg = new YAHOO.widget.SimpleDialog("confirm1", - { width: "400px", - fixedcenter: true, - visible: false, - draggable: false, - close: true, - text: msg, - modal: true, - icon: iconobj, - constraintoviewport: true, - buttons: [ { text:yes, handler:handleYes, isDefault:true }, - { text:no, handler:handleNo }] - } ); - YAHOO.question.container.domainmsg.setHeader(header); - YAHOO.question.container.domainmsg.render("confirmcontainer"); - YAHOO.question.container.domainmsg.show(); + let iconobj; + YAHOO.namespace("question.container"); + const handleYes = function () { + // noinspection JSUnresolvedFunction + confOpenerYes(key); + this.hide(); + }; + const handleNo = function () { + this.hide(); + }; + if (type === 1) { + iconobj = YAHOO.widget.SimpleDialog.ICON_WARN; + } + YAHOO.question.container.domainmsg = new YAHOO.widget.SimpleDialog("confirm1", + { width: "400px", + fixedcenter: true, + visible: false, + draggable: false, + close: true, + text: msg, + modal: true, + icon: iconobj, + constraintoviewport: true, + buttons: [ { text:yes, handler:handleYes, isDefault:true }, + { text:no, handler:handleNo }] + } ); + YAHOO.question.container.domainmsg.setHeader(header); + YAHOO.question.container.domainmsg.render("confirmcontainer"); + YAHOO.question.container.domainmsg.show(); } function dialoginit(key1,key2,ver,header) { - YAHOO.namespace("dialog.container"); + YAHOO.namespace("dialog.container"); - var handleCancel = function() { - this.cancel(); - }; - var handleSuccess = function(o){ - if(o.responseText !== undefined){ - document.getElementById('dialogcontent').innerHTML = o.responseText; - } - } - var handleFailure = function(o){ - if(o.responseText !== undefined){ - document.getElementById('dialogcontent').innerHTML = "No information found"; - } - } - var callback = { - success:handleSuccess, - failure: handleFailure - }; - if (key2 == "updInfo") { - sUrl = "admin/info.php?key1=" + key1 + "&key2=" + key2 + "&version=" + ver; - } else { - sUrl = "info.php?key1=" + key1 + "&key2=" + key2 + "&version=" + ver; - } - var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); - - if (typeof YAHOO.dialog.container.infodialog == "undefined") { - YAHOO.dialog.container.infodialog = new YAHOO.widget.Dialog("infodialog", - { width : "50em", - visible : false, - draggable: true, - fixedcenter: true, - constraintoviewport : true, - buttons : [ { text:"Ok", handler:handleCancel, isDefault:true } ] - }); - - } - - YAHOO.dialog.container.infodialog.setHeader(header); - YAHOO.dialog.container.infodialog.render(); - YAHOO.dialog.container.infodialog.show(); + const handleCancel = function () { + this.cancel(); + }; + const handleSuccess = function (o) { + if (o.responseText !== undefined) { + document.getElementById('dialogcontent').innerHTML = o.responseText; + } + }; + const handleFailure = function (o) { + if (o.responseText !== undefined) { + document.getElementById('dialogcontent').innerHTML = "No information found"; + } + }; + const callback = { + success: handleSuccess, + failure: handleFailure + }; + let sUrl; + if (key2 === "updInfo") { + sUrl = "admin/info.php?key1=" + key1 + "&key2=" + key2 + "&version=" + ver; + } else { + sUrl = "info.php?key1=" + key1 + "&key2=" + key2 + "&version=" + ver; + } + + YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); + + if (typeof YAHOO.dialog.container.infodialog === "undefined") { + YAHOO.dialog.container.infodialog = new YAHOO.widget.Dialog("infodialog", + { width : "50em", + visible : false, + draggable: true, + fixedcenter: true, + constraintoviewport : true, + buttons : [ { text:"Ok", handler:handleCancel, isDefault:true } ] + }); + + } + + YAHOO.dialog.container.infodialog.setHeader(header); + YAHOO.dialog.container.infodialog.render(); + YAHOO.dialog.container.infodialog.show(); } -function calendarinit(lang,start,field,key,cont,obj) { - YAHOO.util.Event.onDOMReady(function(){ +function calendarinit(lang,start,field,key,cont,obj) { + YAHOO.util.Event.onDOMReady(function(){ - var dialog, calendar; - - calendar = new YAHOO.widget.Calendar(obj, { - iframe:false, - hide_blank_weeks:true, - START_WEEKDAY:start - }); - if (lang == "de_DE") { - calendar.cfg.setProperty("MONTHS_LONG", ["Januar", "Februar", "M\u00E4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]); - calendar.cfg.setProperty("WEEKDAYS_SHORT", ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]); - } - - function cancelHandler() { - this.hide(); - } - - function handleSelect(type,args,obj) { - var dates = args[0]; - var date = dates[0]; - var year = date[0], month = date[1], day = date[2]; - - var txtDate1 = document.getElementById(field); - if (month < 10) { month = "0" + month;} - if (day < 10) { day = "0" + day;} - txtDate1.value = year + "-" + month + "-" + day; - dialog.hide(); - } - - dialog = new YAHOO.widget.Dialog(cont, { - context:[field, "tl", "bl"], - width:"16em", - draggable:true, - close:true - }); - calendar.render(); - dialog.render(); - dialog.hide(); - - calendar.renderEvent.subscribe(function() { - dialog.fireEvent("changeContent"); - }); - calendar.selectEvent.subscribe(handleSelect, calendar.cal1, true); - - YAHOO.util.Event.on(key, "click", dialog.show, dialog, true); - }); + let dialog, calendar; + + calendar = new YAHOO.widget.Calendar(obj, { + iframe:false, + hide_blank_weeks:true, + START_WEEKDAY:start + }); + if (lang === "de_DE") { + calendar.cfg.setProperty("MONTHS_LONG", ["Januar", "Februar", "M\u00E4rz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]); + calendar.cfg.setProperty("WEEKDAYS_SHORT", ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"]); + } + + //function cancelHandler() { + // this.hide(); + //} + + //function handleSelect(type,args,obj) { + function handleSelect(type,args) { + const dates = args[0]; + const date = dates[0]; + const year = date[0]; + let month = date[1], day = date[2]; + + const txtDate1 = document.getElementById(field); + if (month < 10) { month = "0" + month;} + if (day < 10) { day = "0" + day;} + // noinspection JSUndefinedPropertyAssignment + txtDate1.value = year + "-" + month + "-" + day; + dialog.hide(); + } + + dialog = new YAHOO.widget.Dialog(cont, { + context:[field, "tl", "bl"], + width:"16em", + draggable:true, + close:true + }); + calendar.render(); + dialog.render(); + dialog.hide(); + + calendar.renderEvent.subscribe(function() { + dialog.fireEvent("changeContent"); + }); + // noinspection JSUnresolvedVariable + calendar.selectEvent.subscribe(handleSelect, calendar.cal1, true); + + YAHOO.util.Event.on(key, "click", dialog.show, dialog, true); + }); } - + // Open edit dialog for list boxes function openMutDlgInit(field,divbox,header,key,langkey1,langkey2,exclude) { - - YAHOO.util.Event.onDOMReady(function(){ - - var mutdialog; - - var handleSuccess = function(o){ - if(o.responseText !== undefined){ - document.getElementById(divbox+'content').innerHTML = o.responseText; - } - } - var handleFailure = function(o){ - if(o.responseText !== undefined){ - document.getElementById(divbox+'content').innerHTML = "No information found"; - } - } - var callback = { - success:handleSuccess, - failure: handleFailure - }; - sUrl = "mutdialog.php?object=" + field + "&exclude=" + exclude; - var request = YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); - - var handleSave = function() { - var source = document.getElementById(field); - var targetSelect = document.getElementById(field+'Selected'); - var targetAvail = document.getElementById(field+'Avail'); - for (i = 0; i < targetSelect.length; ++i) { - targetSelect.options[i].selected = true; - } - for (i = 0; i < source.length; ++i) { - source.options[i].selected = false; - source.options[i].className = source.options[i].className.replace(/ ieselected/g , ''); - } - for (i = 0; i < targetSelect.length; ++i) { - for (y = 0; y < source.length; ++y) { - var value1 = targetSelect.options[i].value.replace(/^e/g , ''); - var value2 = "e"+value1; - if ((source.options[y].value == value1) || (source.options[y].value == value2)) { - source.options[y].selected = true; - source.options[y].value = targetSelect.options[i].value; - source.options[y].text = targetSelect.options[i].text; - source.options[y].className = source.options[y].className+" ieselected"; - } - } - } - this.cancel(); - if ((typeof(update) == 'number') && (update == 1)) { - updateForm(field); - } - }; - var handleCancel = function() { - this.cancel(); - }; - mutdialog = new YAHOO.widget.Dialog(divbox, - { width : "60em", - fixedcenter : true, - visible : false, - draggable: true, - modal: true, - constraintoviewport : true, - buttons : [ { text:langkey1, handler:handleSave, isDefault:true }, - { text:langkey2, handler:handleCancel } ] - }); - - mutdialog.setHeader(header); - mutdialog.render(); - mutdialog.hide(); - mutdialog.beforeShowEvent.subscribe(function() { - getData(field); - }); - YAHOO.util.Event.on(key, "click", mutdialog.show, mutdialog, true); - }); + YAHOO.util.Event.onDOMReady(function(){ + + let mutdialog; + + const handleSuccess = function (o) { + if (o.responseText !== undefined) { + document.getElementById(divbox + 'content').innerHTML = o.responseText; + } + }; + const handleFailure = function (o) { + if (o.responseText !== undefined) { + document.getElementById(divbox + 'content').innerHTML = "No information found"; + } + }; + const callback = { + success: handleSuccess, + failure: handleFailure + }; + let sUrl; + sUrl = "mutdialog.php?object=" + field + "&exclude=" + exclude; + YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); + + const handleSave = function () { + const source = document.getElementById(field); + const targetSelect = document.getElementById(field + 'Selected'); + //const targetAvail = document.getElementById(field + 'Avail'); + for (let i = 0; i < targetSelect.length; ++i) { + targetSelect.options[i].selected = true; + } + for (let i = 0; i < source.length; ++i) { + source.options[i].selected = false; + source.options[i].className = source.options[i].className.replace(/ ieselected/g, ''); + } + for (let i = 0; i < targetSelect.length; ++i) { + for (let y = 0; y < source.length; ++y) { + const value1 = targetSelect.options[i].value.replace(/^e/g, ''); + const value2 = "e" + value1; + if ((source.options[y].value === value1) || (source.options[y].value === value2)) { + source.options[y].selected = true; + source.options[y].value = targetSelect.options[i].value; + source.options[y].text = targetSelect.options[i].text; + source.options[y].className = source.options[y].className + " ieselected"; + } + } + } + this.cancel(); + // noinspection JSUnresolvedVariable + if ((typeof(update) === 'number') && (update === 1)) { + // noinspection JSUnresolvedFunction + updateForm(field); + } + }; + const handleCancel = function () { + this.cancel(); + }; + mutdialog = new YAHOO.widget.Dialog(divbox, + { width : "60em", + fixedcenter : true, + visible : false, + draggable: true, + modal: true, + constraintoviewport : true, + buttons : [ { text:langkey1, handler:handleSave, isDefault:true }, + { text:langkey2, handler:handleCancel } ] + }); + + mutdialog.setHeader(header); + mutdialog.render(); + mutdialog.hide(); + mutdialog.beforeShowEvent.subscribe(function() { + getData(field); + }); + + YAHOO.util.Event.on(key, "click", mutdialog.show, mutdialog, true); + }); } // Additional functions for edit dialog function getData(field) { - var source = document.getElementById(field); - var targetSelect = document.getElementById(field+'Selected'); - var targetAvail = document.getElementById(field+'Avail'); - for (i=0; i < targetSelect.length; i++) { - targetSelect.options[i] = null; - } - targetSelect.length = 0; - for (i=0; i < targetAvail.length; i++) { - targetAvail.options[i] = null; - } - targetAvail.length = 0; - for (i = 0; i < source.length; ++i) { - if (source.options[i].selected == true) { - NeuerEintrag1 = new Option(source.options[i].text, source.options[i].value, false, false); - NeuerEintrag1.className = source.options[i].className.replace(/ ieselected/g , ''); - NeuerEintrag1.className = NeuerEintrag1.className.replace(/ inpmust/g , ''); - targetSelect.options[targetSelect.length] = NeuerEintrag1; - } - if (source.options[i].selected == false) { - if (source.options[i].text != "") { - NeuerEintrag2 = new Option(source.options[i].text, source.options[i].value, false, false); - NeuerEintrag2.className = source.options[i].className.replace(/ ieselected/g , ''); - NeuerEintrag2.className = NeuerEintrag2.className.replace(/ inpmust/g , ''); - targetAvail.options[targetAvail.length] = NeuerEintrag2; - } - } - } + const source = document.getElementById(field); + const targetSelect = document.getElementById(field + 'Selected'); + const targetAvail = document.getElementById(field + 'Avail'); + for (let i=0; i < targetSelect.length; i++) { + targetSelect.options[i] = null; + } + // noinspection JSUndefinedPropertyAssignment + targetSelect.length = 0; + for (let i=0; i < targetAvail.length; i++) { + targetAvail.options[i] = null; + } + // noinspection JSUndefinedPropertyAssignment + targetAvail.length = 0; + let NeuerEintrag1; + let NeuerEintrag2; + for (let i = 0; i < source.length; ++i) { + if (source.options[i].selected === true) { + NeuerEintrag1 = new Option(source.options[i].text, source.options[i].value, false, false); + NeuerEintrag1.className = source.options[i].className.replace(/ ieselected/g, ''); + NeuerEintrag1.className = NeuerEintrag1.className.replace(/ inpmust/g, ''); + targetSelect.options[targetSelect.length] = NeuerEintrag1; + } + if (source.options[i].selected === false) { + if (source.options[i].text !== "") { + NeuerEintrag2 = new Option(source.options[i].text, source.options[i].value, false, false); + NeuerEintrag2.className = source.options[i].className.replace(/ ieselected/g, ''); + NeuerEintrag2.className = NeuerEintrag2.className.replace(/ inpmust/g, ''); + targetAvail.options[targetAvail.length] = NeuerEintrag2; + } + } + } } // Insert selection function selValue(field) { - var targetSelect = document.getElementById(field+'Selected'); - var targetAvail = document.getElementById(field+'Avail'); - if (targetAvail.selectedIndex != -1) { - var DelOptions = new Array(); - for (i = 0; i < targetAvail.length; ++i) { - if (targetAvail.options[i].selected == true) { - NeuerEintrag = new Option(targetAvail.options[i].text, targetAvail.options[i].value, false, false); - NeuerEintrag.className = targetAvail.options[i].className; - targetSelect.options[targetSelect.length] = NeuerEintrag; - DelOptions.push(i); - } - } - sort(targetSelect); - DelOptions.reverse(); - for (var i = 0; i < DelOptions.length; ++i) { - targetAvail.options[DelOptions[i]] = null; - } - } + const targetSelect = document.getElementById(field + 'Selected'); + const targetAvail = document.getElementById(field + 'Avail'); + let NeuerEintrag; + if (targetAvail.selectedIndex !== -1) { + const DelOptions = []; + for (let i = 0; i < targetAvail.length; ++i) { + if (targetAvail.options[i].selected === true) { + NeuerEintrag = new Option(targetAvail.options[i].text, targetAvail.options[i].value, false, false); + NeuerEintrag.className = targetAvail.options[i].className; + targetSelect.options[targetSelect.length] = NeuerEintrag; + DelOptions.push(i); + } + } + sort(targetSelect); + DelOptions.reverse(); + for (let i=0; iarrSettings = $_SESSION['SETS']; - if (isset($_SESSION['domain'])) $this->intDomainId = $_SESSION['domain']; - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Get last change date of table and config files - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Determines the dates of the last data table change and the last modification to the - // configuration files - // - // Parameter: $strTableName Name of the data table - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - // $arrTimeData Array with time data of table and all config files - // $strCheckConfig Information string (text message) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function lastModifiedFile($strTableName,&$arrTimeData,&$strCheckConfig) { - // Get configuration filename based on table name - switch($strTableName) { - case "tbl_timeperiod": $strFile = "timeperiods.cfg"; break; - case "tbl_command": $strFile = "commands.cfg"; break; - case "tbl_contact": $strFile = "contacts.cfg"; break; - case "tbl_contacttemplate": $strFile = "contacttemplates.cfg"; break; - case "tbl_contactgroup": $strFile = "contactgroups.cfg"; break; - case "tbl_hosttemplate": $strFile = "hosttemplates.cfg"; break; - case "tbl_servicetemplate": $strFile = "servicetemplates.cfg"; break; - case "tbl_hostgroup": $strFile = "hostgroups.cfg"; break; - case "tbl_servicegroup": $strFile = "servicegroups.cfg"; break; - case "tbl_servicedependency": $strFile = "servicedependencies.cfg"; break; - case "tbl_hostdependency": $strFile = "hostdependencies.cfg"; break; - case "tbl_serviceescalation": $strFile = "serviceescalations.cfg"; break; - case "tbl_hostescalation": $strFile = "hostescalations.cfg"; break; - case "tbl_hostextinfo": $strFile = "hostextinfo.cfg"; break; - case "tbl_serviceextinfo": $strFile = "serviceextinfo.cfg"; break; - } - // Get table times - $strCheckConfig = ""; - $arrTimeData = ""; - $arrTimeData['table'] = "unknown"; - // Clear status cache - clearstatcache(); - if (isset($_SESSION['domain'])) $this->intDomainId = $_SESSION['domain']; - $this->getDomainData("enable_common",$strCommon); - // Get last change of date table - if ($strCommon == 1) { - $strSQL = "SELECT `updateTime` FROM `tbl_tablestatus` - WHERE (`domainId`=".$this->intDomainId." OR `domainId`=0) AND `tableName`='".$strTableName."' ORDER BY `updateTime` DESC LIMIT 1"; - } else { - $strSQL = "SELECT `updateTime` FROM `tbl_tablestatus` WHERE `domainId`=".$this->intDomainId." AND `tableName`='".$strTableName."'"; - } - $booReturn = $this->myDBClass->getSingleDataset($strSQL,$arrDataset); - if ($booReturn && isset($arrDataset['updateTime'])) { - $arrTimeData['table'] = $arrDataset['updateTime']; - } else { - $strSQL = "SELECT `last_modified` FROM `".$strTableName."` WHERE `config_id`=".$this->intDomainId." ORDER BY `last_modified` DESC LIMIT 1"; - $booReturn = $this->myDBClass->getSingleDataset($strSQL,$arrDataset); - if (($booReturn == true) && isset($arrDataset['last_modified'])) { - $arrTimeData['table'] = $arrDataset['last_modified']; - } - } - // Get config sets - $arrConfigId = $this->getConfigSets(); - if ($arrConfigId != 1) { - // Define variables - $strTimeFile = "unknown"; - $intFileStamp = time(); - foreach($arrConfigId AS $intConfigId) { - // Get configuration file data - $this->getConfigData($intConfigId,"target",$strTarget); - $this->getConfigData($intConfigId,"basedir",$strBaseDir); - $this->getConfigData($intConfigId,"method",$strMethod); - $arrTimeData[$strTarget] = "unknown"; - $intFileStampTemp = -1; - // Lokal file system - if (($strMethod == 1) && (file_exists($strBaseDir."/".$strFile))) { - $intFileStampTemp = filemtime($strBaseDir."/".$strFile); - $arrTimeData[$strTarget] = date("Y-m-d H:i:s",$intFileStampTemp); - // FTP file system - } else if ($strMethod == 2) { - // Check connection - if (!isset($this->resConnectId) || !is_resource($this->resConnectId) || ($this->resConnectType != "FTP")) { - $booReturn = $this->getFTPConnection($intConfigId); - if ($booReturn == 1) return(1); - } - $intFileStampTemp = ftp_mdtm($this->resConnectId, $strBaseDir."/".$strFile); - if ($intFileStampTemp != -1) $arrTimeData[$strTarget] = date("Y-m-d H:i:s",$intFileStampTemp); - ftp_close($this->resConnectId); - // SSH file system - } else if ($strMethod == 3) { - // Check connection - if (!isset($this->resConnectId) || !is_resource($this->resConnectId)) { - $booReturn = $this->getSSHConnection($intConfigId); - if ($booReturn == 1) return(1); - } - // Check file date - if (is_array($this->sendSSHCommand('ls '.str_replace("//","/",$strBaseDir."/".$strFile)))) { - $arrInfo = ssh2_sftp_stat($this->resSFTP,str_replace("//","/",$strBaseDir."/".$strFile)); - $intFileStampTemp = $arrInfo['mtime']; - if ($intFileStampTemp != -1) $arrTimeData[$strTarget] = date("Y-m-d H:i:s",$intFileStampTemp); - } - } - if (isset($intFileStampTemp)) { - if (strtotime($arrTimeData['table']) > $intFileStampTemp) { - $strCheckConfig = translate('Warning: configuration file is out of date!'); - } - } - if ($arrTimeData[$strTarget] == 'unknown') { - $strCheckConfig = translate('Warning: configuration file is out of date!'); - } - } - return(0); - } else { - $strCheckConfig = translate('Warning: no configuration target defined!'); - return(0); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Get last change date of table and config file - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Determines the dates of the last data table change and the last modification to the - // configuration file - // - // Parameter: $strTableName Name of the datatable - // $strConfigName Name of the configuration file - // $arrTimeData Array with timestamps of files/data item - // $intTimeStatus Time status value - // 0 = all files are newer than the database item - // 1 = some file are older than the database item - // 2 = one file is missing - // 3 = any files are missing - // 4 = no configuration targets defined - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function lastModifiedDir($strTableName,$strConfigName,$intDataId,&$arrTimeData,&$intTimeInfo) { - // Build file name - $strFile = $strConfigName.".cfg"; - // Get table times - $intTimeInfo = -1; - $arrTimeData = ""; - $arrTimeData['table'] = "unknown"; - // Clear status cache - clearstatcache(); - // Get last change on dataset - if ($strTableName == "tbl_host") { - $arrTimeData['table'] = $this->myDBClass->getFieldData("SELECT DATE_FORMAT(`last_modified`,'%Y-%m-%d %H:%i:%s') FROM `tbl_host` - WHERE `host_name`='".$strConfigName."' AND `config_id`=".$this->intDomainId); - $strActive = $this->myDBClass->getFieldData("SELECT `active` FROM `tbl_host` WHERE `host_name`='".$strConfigName."' - AND `config_id`=".$this->intDomainId); - } else if ($strTableName == "tbl_service") { - $arrTimeData['table'] = $this->myDBClass->getFieldData("SELECT DATE_FORMAT(`last_modified`,'%Y-%m-%d %H:%i:%s') FROM `tbl_service` - WHERE `id`='".$intDataId."' AND `config_id`=".$this->intDomainId); - $intServiceCount = $this->myDBClass->countRows("SELECT * FROM `$strTableName` WHERE `config_name`='".$strConfigName."' - AND `config_id`=".$this->intDomainId." AND `active`='1'"); - if ($intServiceCount == 0) {$strActive = 0;} else {$strActive = 1;} - } else { - return(1); - } - // Get config sets - $arrConfigId = $this->getConfigSets(); - if ($arrConfigId != 1) { - // Define variables - $strTimeFile = "unknown"; - $intFileStamp = time(); - foreach($arrConfigId AS $intConfigId) { - // Get configuration file data - $this->getConfigData($intConfigId,"target",$strTarget); - $this->getConfigData($intConfigId,"method",$strMethod); - // Get last change on dataset - if ($strTableName == "tbl_host") { - $booReturn = $this->getConfigData($intConfigId,"hostconfig",$strBaseDir); - } else if ($strTableName == "tbl_service") { - $booReturn = $this->getConfigData($intConfigId,"serviceconfig",$strBaseDir); - } - $arrTimeData[$strTarget] = "unknown"; - $intFileStampTemp = -1; - // Lokal file system - if (($strMethod == 1) && (file_exists($strBaseDir."/".$strFile))) { - $intFileStampTemp = filemtime($strBaseDir."/".$strFile); - $arrTimeData[$strTarget] = date("Y-m-d H:i:s",$intFileStampTemp); - // FTP file system - } else if ($strMethod == 2) { - // Check connection - if (!isset($this->resConnectId) || !is_resource($this->resConnectId) || ($this->resConnectType != "FTP")) { - $booReturn = $this->getFTPConnection($intConfigId); - if ($booReturn == 1) return(1); - } - $intFileStampTemp = ftp_mdtm($this->resConnectId, $strBaseDir."/".$strFile); - if ($intFileStampTemp != -1) $arrTimeData[$strTarget] = date("Y-m-d H:i:s",$intFileStampTemp); - ftp_close($this->resConnectId); - // SSH file system - } else if ($strMethod == 3) { - // Check connection - if (!isset($this->resConnectId) || !is_resource($this->resConnectId) || ($this->resConnectType != "SSH")) { - $booReturn = $this->getSSHConnection($intConfigId); - } - // Check file date - if (is_array($this->sendSSHCommand('ls '.str_replace("//","/",$strBaseDir."/".$strFile)))) { - $arrInfo = ssh2_sftp_stat($this->resSFTP,str_replace("//","/",$strBaseDir."/".$strFile)); - $intFileStampTemp = $arrInfo['mtime']; - if ($intFileStampTemp != -1) $arrTimeData[$strTarget] = date("Y-m-d H:i:s",$intFileStampTemp); - } - } - if (($intFileStampTemp == -1) && ($strActive == '1')) { - $intTimeInfo = 2; - return(0); - } - if ((strtotime($arrTimeData['table']) > $intFileStampTemp) && ($strActive == '1')) { - $intTimeInfo = 1; - return(0); - } - } - $intItems = count($arrTimeData) - 1; - $intUnknown = 0; - $intUpToDate = 0; - foreach($arrTimeData AS $elem => $key) { - if ($key == 'unknown') $intUnknown++; - if (strtotime($arrTimeData['table']) < strtotime($key)) $intUpToDate++; - } - if ($intUnknown == $intItems) $intTimeInfo = 3; - if ($intUpToDate == $intItems) $intTimeInfo = 0; - return(0); - } else { - $intTimeInfo = 4; - return(0); - } - } - - - - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Move a config file to the backup directory - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Moves an existing configuration file to the backup directory and removes then the - // original file - // - // Parameter: $strType Type of the configuration file - // $strName Name of the configuration file - // $intConfigID Configuration target ID - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function moveFile($strType,$strName,$intConfigID) { - // Get directories - switch ($strType) { - case "host": $this->getConfigData($intConfigID,"hostconfig",$strConfigDir); - $this->getConfigData($intConfigID,"hostbackup",$strBackupDir); - break; - case "service": $this->getConfigData($intConfigID,"serviceconfig",$strConfigDir); - $this->getConfigData($intConfigID,"servicebackup",$strBackupDir); - break; - case "basic": $this->getConfigData($intConfigID,"basedir",$strConfigDir); - $this->getConfigData($intConfigID,"backupdir",$strBackupDir); - break; - case "nagiosbasic": $this->getConfigData($intConfigID,"nagiosbasedir",$strConfigDir); - $this->getConfigData($intConfigID,"backupdir",$strBackupDir); - break; - default: return(1); - } - // Get tranfer method - $this->getConfigData($intConfigID,"method",$strMethod); - // Local file system - if ($strMethod == 1) { - // Save configuration file - if (file_exists($strConfigDir."/".$strName) && is_writable($strBackupDir) && is_writable($strConfigDir)) { - $strOldDate = date("YmdHis",time()); - copy($strConfigDir."/".$strName,$strBackupDir."/".$strName."_old_".$strOldDate); - unlink($strConfigDir."/".$strName); - } else if (!is_writable($strBackupDir)) { - $this->processClassMessage(translate('Cannot backup and delete the old configuration file (check the permissions)!')."::",$this->strErrorMessage); - return(1); - } - // Remote file (FTP) - } else if ($strMethod == 2) { - // Check connection - if (!isset($this->resConnectId) || !is_resource($this->resConnectId) || ($this->resConnectType != "FTP")) { - $booReturn = $this->getFTPConnection($intConfigID); - if ($booReturn == 1) return(1); - } - // Save configuration file - $intFileStamp = ftp_mdtm($this->resConnectId, $strConfigDir."/".$strName); - if ($intFileStamp > -1) { - $strOldDate = date("YmdHis",time()); - $intErrorReporting = error_reporting(); - error_reporting(0); - $intReturn = ftp_rename($this->resConnectId,$strConfigDir."/".$strName,$strBackupDir."/".$strName."_old_".$strOldDate); - if (!$intReturn) { - $this->processClassMessage(translate('Cannot backup the old configuration file because the permissions are wrong (remote FTP)!')."::",$this->strErrorMessage); - error_reporting($intErrorReporting); - return(1); - } - error_reporting($intErrorReporting); - } - // Remote file (SFTP) - } else if ($strMethod == 3) { - // Check connection - if (!isset($this->resConnectId) || !is_resource($this->resConnectId) || ($this->resConnectType != "SSH")) { - $booReturn = $this->getSSHConnection($intConfigID); - if ($booReturn == 1) return(1); - } - // Save configuration file - if (is_array($this->sendSSHCommand('ls '.str_replace("//","/",$strConfigDir."/".$strName)))) { - $arrInfo = ssh2_sftp_stat($this->resSFTP,str_replace("//","/",$strConfigDir."/".$strName)); - $intFileStamp = $arrInfo['mtime']; - if ($intFileStamp > -1) { - - $strOldDate = date("YmdHis",time()); - $intReturn = ssh2_sftp_rename($this->resSFTP,$strConfigDir."/".$strName,$strBackupDir."/".$strName."_old_".$strOldDate); - if (!$intReturn) { - $this->processClassMessage(translate('Cannot backup the old configuration file because the permissions are wrong (remote SFTP)!')."::",$this->strErrorMessage); - return(1); - } - } - } - } - return(0); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Remove a config file - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: $strType Filename including path to remove - // $intConfigID Configuration target ID - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function removeFile($strName,$intConfigID) { - // Get access method - $this->getConfigData($intConfigID,"method",$strMethod); - // Local file system - if ($strMethod == 1) { - // Remove file if exists - if (file_exists($strName)) { - if (is_writable($strName)) { - unlink($strName); - } else { - $this->processClassMessage(translate('Cannot delete the file (wrong permissions)!').'::'.$strName."::",$this->strErrorMessage); - return(1); - } - } else { - $this->processClassMessage(translate('Cannot delete the file (file does not exist)!').'::'.$strName."::",$this->strErrorMessage); - return(1); - } - // Remote file (FTP) - } else if ($strMethod == 2) { - // Check connection - if (!isset($this->resConnectId) || !is_resource($this->resConnectId)) { - $booReturn = $this->getFTPConnection($intConfigID); - if ($booReturn == 1) return(1); - } - // Remove file if exists - $intFileStamp = ftp_mdtm($this->resConnectId, $strName); - if ($intFileStamp > -1) { - $intErrorReporting = error_reporting(); - error_reporting(0); - $intReturn = ftp_delete($this->resConnectId,$strName); - if (!$intReturn) { - $this->processClassMessage(translate('Cannot delete file because the permissions are wrong (remote FTP)!')."::",$this->strErrorMessage); - error_reporting($intErrorReporting); - return(1); - } - error_reporting($intErrorReporting); - } else { - $this->processClassMessage(translate('Cannot delete file because it does not exists (remote FTP)!')."::",$this->strErrorMessage); - } - // Remote file (SSH) - } else if ($strMethod == 3) { - // Check connection - if (!isset($this->resConnectId) || !is_resource($this->resConnectId)) { - $booReturn = $this->getSSHConnection($intConfigID); - if ($booReturn == 1) return(1); - } - // Remove file if exists - if (is_array($this->sendSSHCommand('ls '.$strName))) { - $intReturn = ssh2_sftp_unlink($this->resSFTP,$strName); - if (!$intReturn) { - $this->processClassMessage(translate('Cannot delete file because the permissions are wrong (remote SFTP)!')."::",$this->strErrorMessage); - } - } else { - $this->processClassMessage(translate('Cannot delete file because it does not exists (remote SFTP)!')."::",$this->strErrorMessage); - } - } - return(0); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Copy a config file - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: $strFileRemote Remote file name - // $intConfigID Configuration target id - // $strLocalFile Local file name - // $intDirection 0 = from remote to local - // 1 = from local to remote - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function configCopy($strFileRemote,$intConfigID,$strFileLokal,$intDirection=0) { - // Get method - $this->getConfigData($intConfigID,"method",$strMethod); - if ($strMethod == 2) { - // Open ftp connection - if (!isset($this->resConnectId) || !is_resource($this->resConnectId)) { - $booReturn = $this->getFTPConnection($intConfigID); - if ($booReturn == 1) return(1); - } - if ($intDirection == 0) { - $intErrorReporting = error_reporting(); - error_reporting(0); - if (!ftp_get($this->resConnectId,$strFileLokal,$strFileRemote,FTP_ASCII)) { - $this->processClassMessage(translate('Cannot get the configuration file (FTP connection failed)!')."::",$this->strErrorMessage); - ftp_close($this->resConnectId); - error_reporting($intErrorReporting); - return(1); - } - error_reporting($intErrorReporting); - } - if ($intDirection == 1) { - $intErrorReporting = error_reporting(); - error_reporting(0); - if (!ftp_put($this->resConnectId,$strFileRemote,$strFileLokal,FTP_ASCII)) { - $this->processClassMessage(translate('Cannot write the configuration file (FTP connection failed)!')."::",$this->strErrorMessage); - ftp_close($this->resConnectId); - error_reporting($intErrorReporting); - return(1); - } - error_reporting($intErrorReporting); - } - return(0); - } else if ($strMethod == 3) { - // Open ssh connection - if (!isset($this->resConnectId) || !is_resource($this->resConnectId)) { - $booReturn = $this->getSSHConnection($intConfigID); - if ($booReturn == 1) return(1); - } - if ($intDirection == 0) { - if (is_array($this->sendSSHCommand('ls '.$strFileRemote))) { - $intErrorReporting = error_reporting(); - error_reporting(0); - if (!ssh2_scp_recv($this->resConnectId,$strFileRemote,$strFileLokal)) { - $this->processClassMessage(translate('Cannot get the configuration file (SSH connection failed)!')."::",$this->strErrorMessage); - error_reporting($intErrorReporting); - return(1); - } - error_reporting($intErrorReporting); - } else { - $this->processClassMessage(translate('Cannot get the configuration file (remote file does not exist)!')."::",$this->strErrorMessage); - return(1); - } - return(0); - } - if ($intDirection == 1) { - $intErrorReporting = error_reporting(); - error_reporting(0); - if (!ssh2_scp_send($this->resConnectId,$strFileLokal,$strFileRemote,0644)) { - $this->processClassMessage(translate('Cannot write the configuration file (SSH connection failed)!')."::",$this->strErrorMessage); - error_reporting($intErrorReporting); - return(1); - } - error_reporting($intErrorReporting); - return(0); - } - } - return(1); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Write a config file (full version) - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Writes a configuration file including all datasets of a configuration table or returns - // the output as a text file for download. - // - // Parameters: $strTableName Table name - // ----------- $intMode 0 = Write file to filesystem - // 1 = Return Textfile for download - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function createConfig($strTableName,$intMode=0) { - // Do not create configs in common domain - if ($this->intDomainId == 0) { - $this->processClassMessage(translate('It is not possible to write config files directly from the common domain!')."::",$this->strErrorMessage); - return(1); - } - // Get config strings - $this->getConfigStrings($strTableName,$strFileString,$strOrderField); - if ($strFileString == "") return 1; - $strFile = $strFileString.".cfg"; - $setTemplate = $strFileString.".tpl.dat"; - // Get configuration targets - $intFileWrite = 0; - $arrConfigID = $this->getConfigSets(); - if (($arrConfigID != 1) && is_array($arrConfigID)) { - foreach($arrConfigID AS $intConfigID) { - // Open configuration file in "write" mode - if ($intMode == 0) { - $booReturn = $this->getConfigFile($strFile,$intConfigID,0,$resConfigFile,$strConfigFile); - if ($booReturn == 1) return 1; - } - // Load config template file - $arrTplOptions = array('use_preg' => false); - $configtp = new HTML_Template_IT($this->arrSettings['path']['base_path']."/templates/files/"); - $configtp->loadTemplatefile($setTemplate, true, true); - $configtp->setOptions($arrTplOptions); - $configtp->setVariable("CREATE_DATE",date("Y-m-d H:i:s",time())); - $this->getConfigData($intConfigID,"version",$this->intNagVersion); - $configtp->setVariable("NAGIOS_QL_VERSION",$this->arrSettings['db']['version']); - if ($this->intNagVersion == 3) $strVersion = "Nagios 3.x config file"; - if ($this->intNagVersion == 2) $strVersion = "Nagios 2.9 config file"; - if ($this->intNagVersion == 1) $strVersion = "Nagios 2.x config file"; - $configtp->setVariable("VERSION",$strVersion); - // Get config data from given table and define file name - $this->getConfigData($intConfigID,"utf8_decode",$setUTF8Decode); - $this->getDomainData("enable_common",$setEnableCommon); - if ($setEnableCommon != 0) { - $strDomainWhere = " (`config_id`=".$this->intDomainId." OR `config_id`=0) "; - } else { - $strDomainWhere = " (`config_id`=".$this->intDomainId.") "; - } - $strSQL = "SELECT * FROM `".$strTableName."` WHERE $strDomainWhere AND `active`='1' ORDER BY `".$strOrderField."`"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn == false) { - $this->processClassMessage(translate('Error while selecting data from database:')."::",$this->strErrorMessage); - $this->processClassMessage($this->myDBClass->strErrorMessage,$this->strErrorMessage); - } else if ($intDataCount != 0) { - // Process every data set - for ($i=0;$i<$intDataCount;$i++) { - foreach($arrData[$i] AS $key => $value) { - $intSkip = 0; - if ($key == "id") $intDataId = $value; - if ($key == "config_name") $key = "#NAGIOSQL_CONFIG_NAME"; - - // UTF8 decoded vaules - if ($setUTF8Decode == 1) $value = utf8_decode($value); - - // Pass special fields (NagiosQL data fields not used by Nagios itselves) - if ($this->skipEntries($strTableName,$this->intNagVersion,$key,$value) == 1) continue; - - // Get relation data - $intSkip = $this->getRelationData($strTableName,$configtp,$arrData[$i],$key,$value); - - // Rename field names - $this->renameFields($strTableName,$intConfigID,$intDataId,$key,$value,$intSkip); - - // Inset data field - if ($intSkip != 1) { - // Insert fill spaces - $strFillLen = (30-strlen($key)); - $strSpace = " "; - for ($f=0;$f<$strFillLen;$f++) { - $strSpace .= " "; - } - // Write key and value to template - $configtp->setVariable("ITEM_TITLE",$key.$strSpace); - // Short values - if ((strlen($value) < 800) || ($this->intNagVersion != 3)) { - $configtp->setVariable("ITEM_VALUE",$value); - $configtp->parse("configline"); - // Long values - } else { - $arrValueTemp = explode(",",$value); - $strValueNew = ""; - $intArrCount = count($arrValueTemp); - $intCounter = 0; - $strSpace = " "; - for ($f=0;$f<30;$f++) { - $strSpace .= " "; - } - foreach($arrValueTemp AS $elem) { - if (strlen($strValueNew) < 800) { - $strValueNew .= $elem.","; - } else { - if (substr($strValueNew,-1) == ",") { - $strValueNew = substr($strValueNew,0,-1); - } - if ($intCounter < $intArrCount) { - $strValueNew = $strValueNew.",\\"; - $configtp->setVariable("ITEM_VALUE",$strValueNew); - $configtp->parse("configline"); - $configtp->setVariable("ITEM_TITLE",$strSpace); - } else { - $configtp->setVariable("ITEM_VALUE",$strValueNew); - $configtp->parse("configline"); - $configtp->setVariable("ITEM_TITLE",$strSpace); - } - $strValueNew = $elem.","; - } - $intCounter++; - } - if ($strValueNew != "") { - if (substr($strValueNew,-1) == ",") { - $strValueNew = substr($strValueNew,0,-1); - } - $configtp->setVariable("ITEM_VALUE",$strValueNew); - $configtp->parse("configline"); - $strValueNew = ""; - } - } - } - } - - // Special processing for time periods - if ($strTableName == "tbl_timeperiod") { - $strSQLTime = "SELECT `definition`, `range` FROM `tbl_timedefinition` WHERE `tipId` = ".$arrData[$i]['id']; - $booReturn = $this->myDBClass->getDataArray($strSQLTime,$arrDataTime,$intDataCountTime); - if ($booReturn && $intDataCountTime != 0) { - foreach ($arrDataTime AS $data) { - // Skip other values than weekdays in nagios version below 3 - if ($this->intNagVersion != 3) { - $arrWeekdays = array('monday','tuesday','wednesday','thursday','friday','saturday','sunday'); - if (!in_array($data['definition'],$arrWeekdays)) continue; - } - // Insert fill spaces - $strFillLen = (30-strlen($data['definition'])); - $strSpace = " "; - for ($f=0;$f<$strFillLen;$f++) { - $strSpace .= " "; - } - // Write key and value - $configtp->setVariable("ITEM_TITLE",$data['definition'].$strSpace); - $configtp->setVariable("ITEM_VALUE",$data['range']); - $configtp->parse("configline"); - } - } - } - // Write configuration set - $configtp->parse("configset"); - } - } else { - $this->myDataClass->writeLog(translate('Writing of the configuration failed - no dataset or not activated dataset found')); - $this->processClassMessage(translate('Writing of the configuration failed - no dataset or not activated dataset found')."::",$this->strErrorMessage); - $configtp->parse(); - $booReturn = $this->writeConfigFile($configtp->get(),$strFile,0,$intConfigID,$resConfigFile,$strConfigFile); - return(1); - } - $configtp->parse(); - // Write configuration file - if ($intMode == 0) { - $booReturn = $this->writeConfigFile($configtp->get(),$strFile,0,$intConfigID,$resConfigFile,$strConfigFile); - $intFileWrite += $booReturn; - // Return configuration file (download) - } else if ($intMode == 1) { - $configtp->show(); - return(0); - } - } - if ($intFileWrite != 0) return(1); - return(0); - } else { - $strCheckConfig = translate('Warning: no configuration target defined!'); - return(1); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Write a config file (single dataset version) - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Writes a configuration file including one single datasets of a configuration table or - // returns the output as a text file for download. - // - // Parameters: $strTableName Table name - // ----------- $intDbId Data ID - // $intMode 0 = Write file to filesystem - // 1 = Return Textfile fot download - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function createConfigSingle($strTableName,$intDbId = 0,$intMode = 0) { - // Do not create configs in common domain - if ($this->intDomainId == 0) { - $this->processClassMessage(translate('It is not possible to write config files directly from the common domain!')."::",$this->strErrorMessage); - return(1); - } - // Get all data from table - $this->getDomainData("enable_common",$setEnableCommon); - if ($setEnableCommon != 0) { - $strDomainWhere = " (`config_id`=".$this->intDomainId." OR `config_id`=0) "; - } else { - $strDomainWhere = " (`config_id`=".$this->intDomainId.") "; - } - if ($intDbId == 0) { - $strSQL = "SELECT * FROM `".$strTableName."` WHERE $strDomainWhere AND `active`='1' ORDER BY `id`"; - } else { - $strSQL = "SELECT * FROM `".$strTableName."` WHERE $strDomainWhere AND `active`='1' AND `id`=$intDbId"; - } - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if (($booReturn != false) && ($intDataCount != 0)) { - $intError = 0; - for ($i=0;$i<$intDataCount;$i++) { - // Process form POST variable - $strChbName = "chbId_".$arrData[$i]['id']; - // Check if this POST variable exists or the data ID parameter matches - if (isset($_POST[$strChbName]) || (($intDbId != 0) && ($intDbId == $arrData[$i]['id']))) { - // Define variable names based on table name - switch($strTableName) { - case "tbl_host": - $strConfigName = $arrData[$i]['host_name']; - $intDomainId = $arrData[$i]['config_id']; - $setTemplate = "hosts.tpl.dat"; - $intType = 1; - $strSQLData = "SELECT * FROM `".$strTableName."` WHERE `host_name`='$strConfigName' AND `active`='1' AND `config_id`=$intDomainId"; - break; - case "tbl_service": - $strConfigName = $arrData[$i]['config_name']; - $intDomainId = $arrData[$i]['config_id']; - $setTemplate = "services.tpl.dat"; - $intType = 2; - $strSQLData = "SELECT * FROM `".$strTableName."` WHERE `config_name`='$strConfigName' AND `active`='1' AND `config_id`=$intDomainId - ORDER BY `service_description`"; - break; - } - $strFile = $strConfigName.".cfg"; - // Get configuration targets - $arrConfigID = $this->getConfigSets(); - if (($arrConfigID != 1) && is_array($arrConfigID)) { - foreach($arrConfigID AS $intConfigID) { - $this->myDBClass->strErrorMessage = ""; - // Open configuration file in "write" mode - if ($intMode == 0) { - $booReturn = $this->getConfigFile($strFile,$intConfigID,$intType,$resConfigFile,$strConfigFile); - if ($booReturn == 1) { - return(1); - } - } - // Load config template file - $arrTplOptions = array('use_preg' => false); - $configtp = new HTML_Template_IT($this->arrSettings['path']['base_path']."/templates/files/"); - $configtp->loadTemplatefile($setTemplate, true, true); - $configtp->setOptions($arrTplOptions); - $configtp->setVariable("CREATE_DATE",date("Y-m-d H:i:s",time())); - if ($this->intNagVersion == 0) { - $this->getConfigData($intConfigID,"version",$this->intNagVersion); - } - $configtp->setVariable("NAGIOS_QL_VERSION",$this->arrSettings['db']['version']); - if ($this->intNagVersion == 3) $strVersion = "Nagios 3.x config file"; - if ($this->intNagVersion == 2) $strVersion = "Nagios 2.9 config file"; - if ($this->intNagVersion == 1) $strVersion = "Nagios 2.x config file"; - $configtp->setVariable("VERSION",$strVersion); - - // Alle passenden Datensätze holen - $booReturn = $this->myDBClass->getDataArray($strSQLData,$arrDataConfig,$intDataCountConfig); - if ($booReturn == false) { - $this->processClassMessage(translate('Error while selecting data from database:')."::".$this->myDBClass->strErrorMessage."::",$this->strErrorMessage); - } else if ($intDataCountConfig != 0) { - // Process every data set - for ($y=0;$y<$intDataCountConfig;$y++) { - foreach($arrDataConfig[$y] AS $key => $value) { - $intSkip = 0; - if ($key == "id") $intDataId = $value; - if ($key == "config_name") $key = "#NAGIOSQL_CONFIG_NAME"; - - // UTF8 decoded vaules - //if ($setUTF8Decode == 1) $value = utf8_decode($value); - - // Pass special fields (NagiosQL data fields not used by Nagios itselves) - if ($this->skipEntries($strTableName,$this->intNagVersion,$key,$value) == 1) continue; - - // Get relation data - $intSkip = $this->getRelationData($strTableName,$configtp,$arrDataConfig[$y],$key,$value); - - // Rename field names - $this->renameFields($strTableName,$intConfigID,$intDataId,$key,$value,$intSkip); - - // Inset data field - if ($intSkip != 1) { - // Insert fill spaces - $strFillLen = (30-strlen($key)); - $strSpace = " "; - for ($f=0;$f<$strFillLen;$f++) { - $strSpace .= " "; - } - // Write key and value to template - $configtp->setVariable("ITEM_TITLE",$key.$strSpace); - // Short values - if ((strlen($value) < 800) || ($this->intNagVersion != 3)) { - $configtp->setVariable("ITEM_VALUE",$value); - $configtp->parse("configline"); - // Long values - } else { - $arrValueTemp = explode(",",$value); - $strValueNew = ""; - $intArrCount = count($arrValueTemp); - $intCounter = 0; - $strSpace = " "; - for ($f=0;$f<30;$f++) { - $strSpace .= " "; - } - foreach($arrValueTemp AS $elem) { - if (strlen($strValueNew) < 800) { - $strValueNew .= $elem.","; - } else { - if (substr($strValueNew,-1) == ",") { - $strValueNew = substr($strValueNew,0,-1); - } - if ($intCounter < $intArrCount) { - $strValueNew = $strValueNew.",\\"; - $configtp->setVariable("ITEM_VALUE",$strValueNew); - $configtp->parse("configline"); - $configtp->setVariable("ITEM_TITLE",$strSpace); - } else { - $configtp->setVariable("ITEM_VALUE",$strValueNew); - $configtp->parse("configline"); - $configtp->setVariable("ITEM_TITLE",$strSpace); - } - $strValueNew = $elem.","; - } - $intCounter++; - } - if ($strValueNew != "") { - if (substr($strValueNew,-1) == ",") { - $strValueNew = substr($strValueNew,0,-1); - } - $configtp->setVariable("ITEM_VALUE",$strValueNew); - $configtp->parse("configline"); - $strValueNew = ""; - } - } - } - } - // Write configuration set - $configtp->parse("configset"); - } - $configtp->parse(); - // Write configuration file - if ($intMode == 0) { - $booReturn = $this->writeConfigFile($configtp->get(),$strFile,$intType,$intConfigID,$resConfigFile,$strConfigFile); - if ($booReturn == 1) $intError++; - // Return configuration file (download) - } else if ($intMode == 1) { - $configtp->show(); - } - } - } - } - } - } - } else { - $this->myDataClass->writeLog(translate('Writing of the configuration failed - no dataset or not activated dataset found')); - $this->processClassMessage(translate('Writing of the configuration failed - no dataset, not activated dataset found or you do not have write permission.')."::",$this->strErrorMessage); - return(1); - } - if ($intError == 0) return(0); - return(1); - } - - //3.1 HELP FUNCTIONS - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Get config parameters - /////////////////////////////////////////////////////////////////////////////////////////// - // $strTableName -> Table name - // $strFileString -> File name string - // $strOrderField -> Order field name (return value) - /////////////////////////////////////////////////////////////////////////////////////////// - function getConfigStrings($strTableName,&$strFileString,&$strOrderField) { - switch($strTableName) { - case "tbl_timeperiod": $strFileString = "timeperiods"; - $strOrderField = "timeperiod_name"; - break; - case "tbl_command": $strFileString = "commands"; - $strOrderField = "command_name"; - break; - case "tbl_contact": $strFileString = "contacts"; - $strOrderField = "contact_name"; - break; - case "tbl_contacttemplate": $strFileString = "contacttemplates"; - $strOrderField = "template_name"; - break; - case "tbl_contactgroup": $strFileString = "contactgroups"; - $strOrderField = "contactgroup_name"; - break; - case "tbl_hosttemplate": $strFileString = "hosttemplates"; - $strOrderField = "template_name"; - break; - case "tbl_hostgroup": $strFileString = "hostgroups"; - $strOrderField = "hostgroup_name"; - break; - case "tbl_servicetemplate": $strFileString = "servicetemplates"; - $strOrderField = "template_name"; - break; - case "tbl_servicegroup": $strFileString = "servicegroups"; - $strOrderField = "servicegroup_name"; - break; - case "tbl_hostdependency": $strFileString = "hostdependencies"; - $strOrderField = "dependent_host_name"; - break; - case "tbl_hostescalation": $strFileString = "hostescalations"; - $strOrderField = "host_name`,`hostgroup_name"; - break; - case "tbl_hostextinfo": $strFileString = "hostextinfo"; - $strOrderField = "host_name"; - break; - case "tbl_servicedependency": $strFileString = "servicedependencies"; - $strOrderField = "config_name"; - break; - case "tbl_serviceescalation": $strFileString = "serviceescalations"; - $strOrderField = "config_name"; - break; - case "tbl_serviceextinfo": $strFileString = "serviceextinfo"; - $strOrderField = "host_name"; - break; - default: $strFileString = ""; - $strOrderField = ""; - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Open configuration file - /////////////////////////////////////////////////////////////////////////////////////////// - // $strFile -> File name - // $intConfigID -> Configuration ID - // $intType -> Type ID - // $resConfigFile -> Temporary or configuration file ressource (return value) - // $strConfigFile -> Configuration file name (return value) - /////////////////////////////////////////////////////////////////////////////////////////// - function getConfigFile($strFile,$intConfigID,$intType,&$resConfigFile,&$strConfigFile) { - // Get config data - if ($intType == 1) { - $this->getConfigData($intConfigID,"hostconfig",$strBaseDir); - $this->getConfigData($intConfigID,"hostbackup",$strBackupDir); - $strType = 'host'; - } else if ($intType == 2) { - $this->getConfigData($intConfigID,"serviceconfig",$strBaseDir); - $this->getConfigData($intConfigID,"servicebackup",$strBackupDir); - $strType = 'service'; - } else { - $this->getConfigData($intConfigID,"basedir",$strBaseDir); - $this->getConfigData($intConfigID,"backupdir",$strBackupDir); - $strType = 'basic'; - } - $booReturn = $this->getConfigData($intConfigID,"method",$strMethod); - // Backup config file - $intReturn = $this->moveFile($strType,$strFile,$intConfigID); - if ($intReturn == 1) return(1); - // Method 1 - local file system - if ($strMethod == 1) { - // Open the config file - if (is_writable($strBaseDir."/".$strFile) || ((!file_exists($strBaseDir."/".$strFile) && (is_writable($strBaseDir))) )) { - $strConfigFile = $strBaseDir."/".$strFile; - $resConfigFile = fopen($strConfigFile,"w"); - chmod($strConfigFile, 0644); - } else { - $this->myDataClass->writeLog(translate('Configuration write failed:')." ".$strFile); - $this->processClassMessage(translate('Cannot open/overwrite the configuration file (check the permissions)!')."::",$this->strErrorMessage); - return(1); - } - // Method 2 - ftp access - } else if ($strMethod == 2) { - // Set up basic connection - $booReturn = $this->getConfigData($intConfigID,"server",$strServer); - $this->resConnectId = ftp_connect($strServer); - // Login with username and password - $booReturn = $this->getConfigData($intConfigID,"user",$strUser); - $booReturn = $this->getConfigData($intConfigID,"password",$strPasswd); - $login_result = ftp_login($this->resConnectId, $strUser, $strPasswd); - // Check connection - if ((!$this->resConnectId) || (!$login_result)) { - $this->myDataClass->writeLog(translate('Configuration write failed (FTP connection failed):')." ".$strFile); - $this->processClassMessage(translate('Cannot open/overwrite the configuration file (FTP connection failed)!')."::",$this->strErrorMessage); - return(1); - } else { - // Open the config file - if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) { - $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql'); - } else { - $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql'); - } - $resConfigFile = fopen($strConfigFile,"w"); - } - // Method 3 - ssh access - } else if ($strMethod == 3) { - // Check connection - if (!isset($this->resConnectId) || !is_resource($this->resConnectId)) { - $booReturn = $this->getSSHConnection(); - if ($booReturn == 1) return(1); - } - // Open the config file - if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) { - $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql'); - } else { - $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql'); - } - $resConfigFile = fopen($strConfigFile,"w"); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Write configuration file - /////////////////////////////////////////////////////////////////////////////////////////// - // $strData -> Data string - // $strFile -> File name - // $intType -> Type ID - // $intConfigID -> Configuration target ID - // $resConfigFile -> Temporary or configuration file ressource - // $strConfigFile -> Configuration file name - /////////////////////////////////////////////////////////////////////////////////////////// - function writeConfigFile($strData,$strFile,$intType,$intConfigID,$resConfigFile,$strConfigFile) { - // Get config data - if ($intType == 1) { - $this->getConfigData($intConfigID,"hostconfig",$strBaseDir); - } else if ($intType == 2) { - $this->getConfigData($intConfigID,"serviceconfig",$strBaseDir); - } else { - $this->getConfigData($intConfigID,"basedir",$strBaseDir); - } - $booReturn = $this->getConfigData($intConfigID,"method",$strMethod); - $strData = str_replace("\r\n","\n",$strData); - fwrite($resConfigFile,$strData); - // Local filesystem - if ($strMethod == 1) { - fclose($resConfigFile); - // FTP access - } else if ($strMethod == 2) { - // SSH Possible - if (!function_exists('ftp_put')) { - $this->processClassMessage(translate('FTP module not loaded!')."::",$this->strErrorMessage); - return(1); - } - $intErrorReporting = error_reporting(); - error_reporting(0); - if (!ftp_put($this->resConnectId,$strBaseDir."/".$strFile,$strConfigFile,FTP_ASCII)) { - $arrError = error_get_last(); - error_reporting($intErrorReporting); - $this->processClassMessage(translate('Cannot open/overwrite the configuration file (FTP connection failed)!')."::",$this->strErrorMessage); - if ($arrError['message'] != "") $this->processClassMessage($arrError['message']."::",$this->strErrorMessage); - ftp_close($this->resConnectId); - fclose($resConfigFile); - unlink($strConfigFile); - return(1); - } - error_reporting($intErrorReporting); - ftp_close($this->resConnectId); - fclose($resConfigFile); - // SSH access - } else if ($strMethod == 3) { - // SSH Possible - if (!function_exists('ssh2_scp_send')) { - $this->processClassMessage(translate('SSH module not loaded!')."::",$this->strErrorMessage); - return(1); - } - $intErrorReporting = error_reporting(); - error_reporting(0); - if (!ssh2_scp_send($this->resConnectId,$strConfigFile,$strBaseDir."/".$strFile,0644)) { - $arrError = error_get_last(); - error_reporting($intErrorReporting); - $this->processClassMessage(translate('Cannot open/overwrite the configuration file (remote SFTP)!')."::",$this->strErrorMessage); - if ($arrError['message'] != "") $this->processClassMessage($arrError['message']."::",$this->strErrorMessage); - $this->resConnectId = null; - return(1); - } - $arrError = error_get_last(); - error_reporting($intErrorReporting); - fclose($resConfigFile); - unlink($strConfigFile); - $this->resConnectId = null; - } - $this->myDataClass->writeLog(translate('Configuration successfully written:')." ".$strFile); - $this->processClassMessage(translate('Configuration file successfully written!')."::",$this->strInfoMessage); - return(0); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Return related value - /////////////////////////////////////////////////////////////////////////////////////////// - // $strTableName -> Table name - // $resTemplate -> Template ressource - // $arrData -> Dataset array - // $strDataKey -> Data key - // $strDataValue -> Data value (return value) - /////////////////////////////////////////////////////////////////////////////////////////// - function getRelationData($strTableName,$resTemplate,$arrData,$strDataKey,&$strDataValue) { - // Pass function for tbl_command - if ($strTableName == 'tbl_command') return(0); - // Get relation info and store the value in a class variable (speedup export) - if ($this->strRelTable != $strTableName) { - $intReturn = $this->myDataClass->tableRelations($strTableName,$arrRelations); - $this->strRelTable = $strTableName; - $this->arrRelData = $arrRelations; - } else { - $arrRelations = $this->arrRelData; - $intReturn = 1; - } - if (($intReturn == 0) || (!is_array($arrRelations))) return(1); - // Common domain is enabled? - $this->getDomainData("enable_common",$intCommonEnable); - if ($intCommonEnable == 1) { - $strDomainWhere1 = " (`config_id`=".$this->intDomainId." OR `config_id`=0) "; - $strDomainWhere2 = " (`tbl_service`.`config_id`=".$this->intDomainId." OR `tbl_service`.`config_id`=0) "; - } else { - $strDomainWhere1 = " `config_id`=".$this->intDomainId." "; - $strDomainWhere2 = " `tbl_service`.`config_id`=".$this->intDomainId." "; - } - // Process relations - foreach($arrRelations AS $elem) { - if ($elem['fieldName'] == $strDataKey) { - // Process normal 1:n relations (1 = only data / 2 = including a * value) - if (($elem['type'] == 2) && (($strDataValue == 1) || ($strDataValue == 2))) { - $strSQLRel = "SELECT `".$elem['tableName1']."`.`".$elem['target1']."`, `".$elem['linkTable']."`.`exclude` FROM `".$elem['linkTable']."` - LEFT JOIN `".$elem['tableName1']."` ON `".$elem['linkTable']."`.`idSlave` = `".$elem['tableName1']."`.`id` - WHERE `idMaster`=".$arrData['id']." AND `active`='1' AND $strDomainWhere1 - ORDER BY `".$elem['tableName1']."`.`".$elem['target1']."`"; - $booReturn = $this->myDBClass->getDataArray($strSQLRel,$arrDataRel,$intDataCountRel); - if ($booReturn && ($intDataCountRel != 0)) { - // Rewrite $strDataValue with returned relation data - if ($strDataValue == 2) {$strDataValue = "*,";} else {$strDataValue = "";} - foreach ($arrDataRel AS $data) { - if ($data['exclude'] == 0) { - $strDataValue .= $data[$elem['target1']].","; - } else if ($this->intNagVersion >=3) { - $strDataValue .= "!".$data[$elem['target1']].","; - } - } - $strDataValue = substr($strDataValue,0,-1); - if ($strDataValue == "") return(1); - } else { - if ($strDataValue == 2) {$strDataValue = "*";} else {return(1);} - } - // Process normal 1:1 relations - } else if ($elem['type'] == 1) { - if (($elem['tableName1'] == "tbl_command") && (substr_count($arrData[$elem['fieldName']],"!") != 0)) { - $arrField = explode("!",$arrData[$elem['fieldName']]); - $strCommand = strchr($arrData[$elem['fieldName']],"!"); - $strSQLRel = "SELECT `".$elem['target1']."` FROM `".$elem['tableName1']."` - WHERE `id`=".$arrField[0]." AND `active`='1' AND $strDomainWhere1"; - } else { - $strSQLRel = "SELECT `".$elem['target1']."` FROM `".$elem['tableName1']."` - WHERE `id`=".$arrData[$elem['fieldName']]." AND `active`='1' AND $strDomainWhere1"; - } - $booReturn = $this->myDBClass->getDataArray($strSQLRel,$arrDataRel,$intDataCountRel); - if ($booReturn && ($intDataCountRel != 0)) { - // Rewrite $strDataValue with returned relation data - if (($elem['tableName1'] == "tbl_command") && (substr_count($strDataValue,"!") != 0)) { - $strDataValue = $arrDataRel[0][$elem['target1']].$strCommand; - } else { - $strDataValue = $arrDataRel[0][$elem['target1']]; - } - } else { - if (($elem['tableName1'] == "tbl_command") && (substr_count($strDataValue,"!") != 0) && ($arrField[0] == -1)) { - $strDataValue = "null"; - } else { - return(1); - } - } - // Process normal 1:n relations with special table and idSort (template tables) - } else if (($elem['type'] == 3) && ($strDataValue == 1)) { - $strSQLMaster = "SELECT * FROM `".$elem['linkTable']."` WHERE `idMaster` = ".$arrData['id']." ORDER BY idSort"; - $booReturn = $this->myDBClass->getDataArray($strSQLMaster,$arrDataMaster,$intDataCountMaster); - if ($booReturn && ($intDataCountMaster != 0)) { - // Rewrite $strDataValue with returned relation data - $strDataValue = ""; - foreach ($arrDataMaster AS $data) { - if ($data['idTable'] == 1) { - $strSQLName = "SELECT `".$elem['target1']."` FROM `".$elem['tableName1']."` WHERE `active`='1' AND $strDomainWhere1 AND `id` = ".$data['idSlave']; - } else { - $strSQLName = "SELECT `".$elem['target2']."` FROM `".$elem['tableName2']."` WHERE `active`='1' AND $strDomainWhere1 AND `id` = ".$data['idSlave']; - } - $strDataValue .= $this->myDBClass->getFieldData($strSQLName).","; - } - $strDataValue = substr($strDataValue,0,-1); - } else { - return(1); - } - // Process special 1:n:str relations with string values (servicedependencies) - } else if (($elem['type'] == 6) && (($strDataValue == 1) || ($strDataValue == 2))) { - $strSQLRel = "SELECT `".$elem['linkTable']."`.`strSlave`, `".$elem['linkTable']."`.`exclude` - FROM `".$elem['linkTable']."` - LEFT JOIN `tbl_service` ON `".$elem['linkTable']."`.`idSlave`=`tbl_service`.`id` - WHERE `".$elem['linkTable']."`.`idMaster`=".$arrData['id']." AND `active`='1' AND $strDomainWhere1 - ORDER BY `".$elem['linkTable']."`.`strSlave`"; - $booReturn = $this->myDBClass->getDataArray($strSQLRel,$arrDataRel,$intDataCountRel); - if ($booReturn && ($intDataCountRel != 0)) { - // Rewrite $strDataValue with returned relation data - if ($strDataValue == 2) {$strDataValue = "*,";} else {$strDataValue = "";} - foreach ($arrDataRel AS $data) { - if ($data['exclude'] == 0) { - $strDataValue .= $data['strSlave'].","; - } else if ($this->intNagVersion >=3) { - $strDataValue .= "!".$data['strSlave'].","; - } - } - $strDataValue = substr($strDataValue,0,-1); - if ($strDataValue == "") return(1); - } else { - if ($strDataValue == 2) {$strDataValue = "*";} else {return(1);} - } - // Process special relations for free variables - } else if (($elem['type'] == 4) && ($strDataValue == 1) && ($this->intNagVersion >= 3)) { - $strSQLVar = "SELECT * FROM `tbl_variabledefinition` LEFT JOIN `".$elem['linkTable']."` ON `id` = `idSlave` - WHERE `idMaster`=".$arrData['id']." ORDER BY `name`"; - $booReturn = $this->myDBClass->getDataArray($strSQLVar,$arrDSVar,$intDCVar); - if ($booReturn && ($intDCVar != 0)) { - foreach ($arrDSVar AS $vardata) { - // Insert fill spaces - $strFillLen = (30-strlen($vardata['name'])); - $strSpace = " "; - for ($f=0;$f<$strFillLen;$f++) { - $strSpace .= " "; - } - $resTemplate->setVariable("ITEM_TITLE",$vardata['name'].$strSpace); - $resTemplate->setVariable("ITEM_VALUE",$vardata['value']); - $resTemplate->parse("configline"); - } - } - return(1); - // Process special relations for service groups - } else if (($elem['type'] == 5) && ($strDataValue == 1)) { - $strSQLMaster = "SELECT * FROM `".$elem['linkTable']."` WHERE `idMaster` = ".$arrData['id']; - $booReturn = $this->myDBClass->getDataArray($strSQLMaster,$arrDataMaster,$intDataCountMaster); - if ($booReturn && ($intDataCountMaster != 0)) { - // Rewrite $strDataValue with returned relation data - $strDataValue = ""; - foreach ($arrDataMaster AS $data) { - if ($data['idSlaveHG'] != 0) { - $strService = $this->myDBClass->getFieldData("SELECT `".$elem['target2']."` FROM `".$elem['tableName2']. - "` WHERE `id` = ".$data['idSlaveS']); - $strSQLHG1 = "SELECT `host_name` FROM `tbl_host` LEFT JOIN `tbl_lnkHostgroupToHost` ON `id`=`idSlave` - WHERE `idMaster`=".$data['idSlaveHG']." AND `active`='1' AND $strDomainWhere1"; - $booReturn = $this->myDBClass->getDataArray($strSQLHG1,$arrHG1,$intHG1); - if ($booReturn && ($intHG1 != 0)) { - foreach ($arrHG1 AS $elemHG1) { - if (substr_count($strDataValue,$elemHG1['host_name'].",".$strService) == 0) { - $strDataValue .= $elemHG1['host_name'].",".$strService.","; - } - } - } - $strSQLHG2 = "SELECT `host_name` FROM `tbl_host` LEFT JOIN `tbl_lnkHostToHostgroup` ON `id`=`idMaster` - WHERE `idSlave`=".$data['idSlaveHG']." AND `active`='1' AND $strDomainWhere1"; - $booReturn = $this->myDBClass->getDataArray($strSQLHG2,$arrHG2,$intHG2); - if ($booReturn && ($intHG2 != 0)) { - foreach ($arrHG2 AS $elemHG2) { - if (substr_count($strDataValue,$elemHG2['host_name'].",".$strService) == 0) { - $strDataValue .= $elemHG2['host_name'].",".$strService.","; - } - } - } - } else { - $strHost = $this->myDBClass->getFieldData("SELECT `".$elem['target1']."` FROM `".$elem['tableName1']."` ". - "WHERE `id` = ".$data['idSlaveH']." AND `active`='1' AND $strDomainWhere1"); - $strService = $this->myDBClass->getFieldData("SELECT `".$elem['target2']."` FROM `".$elem['tableName2']."` ". - "WHERE `id` = ".$data['idSlaveS']." AND `active`='1' AND $strDomainWhere1"); - if (($strHost != "") && ($strService != "")) { - if (substr_count($strDataValue,$strHost.",".$strService) == 0) { - $strDataValue .= $strHost.",".$strService.","; - } - } - } - } - $strDataValue = substr($strDataValue,0,-1); - if ($strDataValue == "") return(1); - } else { - return(1); - } - // Process "*" - } else if ($strDataValue == 2) { - $strDataValue = "*"; - } else { - return(1); - } - } - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Rename field names - /////////////////////////////////////////////////////////////////////////////////////////// - // $strTableName -> Table name - // $intConfigID -> Configuration target ID - // $intDataId -> Data ID - // $key -> Data key (return value) - // $value -> Data value (return value) - // $intSkip -> Skip value (return value) - /////////////////////////////////////////////////////////////////////////////////////////// - function renameFields($strTableName,$intConfigID,$intDataId,&$key,&$value,&$intSkip) { - if ($this->intNagVersion == 0) { - $this->getConfigData($intConfigID,"version",$this->intNagVersion); - } - // Picture path - if ($this->strPicPath == "none") { - $this->getConfigData($intConfigID,"picturedir",$this->strPicPath); - } - if ($key == "icon_image") $value = $this->strPicPath.$value; - if ($key == "vrml_image") $value = $this->strPicPath.$value; - if ($key == "statusmap_image") $value = $this->strPicPath.$value; - // Tables - if ($strTableName == "tbl_host") { - if ($key == "use_template") $key = "use"; - $strVIValues = "active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,event_handler_enabled,"; - $strVIValues .= "flap_detection_enabled,process_perf_data,retain_status_information,retain_nonstatus_information,"; - $strVIValues .= "notifications_enabled"; - if (in_array($key,explode(",",$strVIValues))) { - if ($value == -1) $value = "null"; - if ($value == 3) $value = "null"; - } - if ($key == "parents") $value = $this->checkTpl($value,"parents_tploptions","tbl_host",$intDataId,$intSkip); - if ($key == "hostgroups") $value = $this->checkTpl($value,"hostgroups_tploptions","tbl_host",$intDataId,$intSkip); - if ($key == "contacts") $value = $this->checkTpl($value,"contacts_tploptions","tbl_host",$intDataId,$intSkip); - if ($key == "contact_groups") $value = $this->checkTpl($value,"contact_groups_tploptions","tbl_host",$intDataId,$intSkip); - if ($key == "use") $value = $this->checkTpl($value,"use_template_tploptions","tbl_host",$intDataId,$intSkip); - if ($key == "check_command") $value = str_replace("\::bang::","\!",$value); - if ($key == "check_command") $value = str_replace("::bang::","\!",$value); - } - if ($strTableName == "tbl_service") { - if ($key == "use_template") $key = "use"; - if (($this->intNagVersion != 3) && ($this->intNagVersion != 2)) { - if ($key == "check_interval") $key = "normal_check_interval"; - if ($key == "retry_interval") $key = "retry_check_interval"; - } - $strVIValues = "is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,obsess_over_service,"; - $strVIValues .= "check_freshness,event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,"; - $strVIValues .= "retain_nonstatus_information,notifications_enabled"; - if (in_array($key,explode(",",$strVIValues))) { - if ($value == -1) $value = "null"; - if ($value == 3) $value = "null"; - } - if ($key == "host_name") $value = $this->checkTpl($value,"host_name_tploptions","tbl_service",$intDataId,$intSkip); - if ($key == "hostgroup_name") $value = $this->checkTpl($value,"hostgroup_name_tploptions","tbl_service",$intDataId,$intSkip); - if ($key == "servicegroups") $value = $this->checkTpl($value,"servicegroups_tploptions","tbl_service",$intDataId,$intSkip); - if ($key == "contacts") $value = $this->checkTpl($value,"contacts_tploptions","tbl_service",$intDataId,$intSkip); - if ($key == "contact_groups") $value = $this->checkTpl($value,"contact_groups_tploptions","tbl_service",$intDataId,$intSkip); - if ($key == "use") $value = $this->checkTpl($value,"use_template_tploptions","tbl_service",$intDataId,$intSkip); - if ($key == "check_command") $value = str_replace("\::bang::","\!",$value); - if ($key == "check_command") $value = str_replace("::bang::","\!",$value); - } - if ($strTableName == "tbl_hosttemplate") { - if ($key == "template_name") $key = "name"; - if ($key == "use_template") $key = "use"; - $strVIValues = "active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,event_handler_enabled,"; - $strVIValues .= "flap_detection_enabled,process_perf_data,retain_status_information,retain_nonstatus_information,"; - $strVIValues .= "notifications_enabled"; - if (in_array($key,explode(",",$strVIValues))) { - if ($value == -1) $value = "null"; - if ($value == 3) $value = "null"; - } - if ($key == "parents") $value = $this->checkTpl($value,"parents_tploptions","tbl_hosttemplate",$intDataId,$intSkip); - if ($key == "hostgroups") $value = $this->checkTpl($value,"hostgroups_tploptions","tbl_hosttemplate",$intDataId,$intSkip); - if ($key == "contacts") $value = $this->checkTpl($value,"contacts_tploptions","tbl_hosttemplate",$intDataId,$intSkip); - if ($key == "contact_groups") $value = $this->checkTpl($value,"contact_groups_tploptions","tbl_hosttemplate",$intDataId,$intSkip); - if ($key == "use") $value = $this->checkTpl($value,"use_template_tploptions","tbl_hosttemplate",$intDataId,$intSkip); - } - if ($strTableName == "tbl_servicetemplate") { - if ($key == "template_name") $key = "name"; - if ($key == "use_template") $key = "use"; - if (($this->intNagVersion != 3) && ($this->intNagVersion != 2)) { - if ($key == "check_interval") $key = "normal_check_interval"; - if ($key == "retry_interval") $key = "retry_check_interval"; - } - $strVIValues = "is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,obsess_over_service,"; - $strVIValues .= "check_freshness,event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,"; - $strVIValues .= "retain_nonstatus_information,notifications_enabled"; - if (in_array($key,explode(",",$strVIValues))) { - if ($value == -1) $value = "null"; - if ($value == 3) $value = "null"; - } - if ($key == "host_name") $value = $this->checkTpl($value,"host_name_tploptions","tbl_servicetemplate",$intDataId,$intSkip); - if ($key == "hostgroup_name") $value = $this->checkTpl($value,"hostgroup_name_tploptions","tbl_servicetemplate",$intDataId,$intSkip); - if ($key == "servicegroups") $value = $this->checkTpl($value,"servicegroups_tploptions","tbl_servicetemplate",$intDataId,$intSkip); - if ($key == "contacts") $value = $this->checkTpl($value,"contacts_tploptions","tbl_servicetemplate",$intDataId,$intSkip); - if ($key == "contact_groups") $value = $this->checkTpl($value,"contact_groups_tploptions","tbl_servicetemplate",$intDataId,$intSkip); - if ($key == "use") $value = $this->checkTpl($value,"use_template_tploptions","tbl_servicetemplate",$intDataId,$intSkip); - } - if ($strTableName == "tbl_contact") { - if ($key == "use_template") $key = "use"; - $strVIValues = "host_notifications_enabled,service_notifications_enabled,can_submit_commands,retain_status_information,"; - $strVIValues = "retain_nonstatus_information"; - if (in_array($key,explode(",",$strVIValues))) { - if ($value == -1) $value = "null"; - if ($value == 3) $value = "null"; - } - if ($key == "contactgroups") $value = $this->checkTpl($value,"contactgroups_tploptions","tbl_contact",$intDataId,$intSkip); - if ($key == "host_notification_commands") { - $value = $this->checkTpl($value,"host_notification_commands_tploptions","tbl_contact",$intDataId,$intSkip);} - if ($key == "service_notification_commands") { - $value = $this->checkTpl($value,"service_notification_commands_tploptions","tbl_contact",$intDataId,$intSkip);} - if ($key == "use") $value = $this->checkTpl($value,"use_template_tploptions","tbl_contact",$intDataId,$intSkip); - } - if ($strTableName == "tbl_contacttemplate") { - if ($key == "template_name") $key = "name"; - if ($key == "use_template") $key = "use"; - $strVIValues = "host_notifications_enabled,service_notifications_enabled,can_submit_commands,retain_status_information,"; - $strVIValues = "retain_nonstatus_information"; - if (in_array($key,explode(",",$strVIValues))) { - if ($value == -1) $value = "null"; - if ($value == 3) $value = "null"; - } - if ($key == "contactgroups") $value = $this->checkTpl($value,"contactgroups_tploptions","tbl_contacttemplate",$intDataId,$intSkip); - if ($key == "host_notification_commands") { - $value = $this->checkTpl($value,"host_notification_commands_tploptions","tbl_contacttemplate",$intDataId,$intSkip);} - if ($key == "service_notification_commands") { - $value = $this->checkTpl($value,"service_notification_commands_tploptions","tbl_contacttemplate",$intDataId,$intSkip);} - if ($key == "use") $value = $this->checkTpl($value,"use_template_tploptions","tbl_contacttemplate",$intDataId,$intSkip); - } - if (($strTableName == "tbl_hosttemplate") || ($strTableName == "tbl_servicetemplate") || ($strTableName == "tbl_contacttemplate")) { - if ($key == "register") $value = "0"; - } - if ($strTableName == "tbl_timeperiod") { - if ($key == "use_template") $key = "use"; - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Skip database values - /////////////////////////////////////////////////////////////////////////////////////////// - // $strTableName -> Table name - // $strVersionValue -> NagiosQL version value - // $key -> Data key - // $value -> Data value - /////////////////////////////////////////////////////////////////////////////////////////// - function skipEntries($strTableName,$strVersionValue,$key,&$value) { - // Common fields - $strSpecial = "id,active,last_modified,access_rights,access_group,config_id,template,nodelete,command_type,import_hash"; - $arrOption = array(); - // Fields for special tables - if ($strTableName == "tbl_hosttemplate") $strSpecial .= ",parents_tploptions,hostgroups_tploptions,contacts_tploptions". - ",contact_groups_tploptions,use_template_tploptions"; - if ($strTableName == "tbl_servicetemplate") $strSpecial .= ",host_name_tploptions,hostgroup_name_tploptions,contacts_tploptions". - ",servicegroups_tploptions,contact_groups_tploptions,use_template_tploptions"; - if ($strTableName == "tbl_contact") $strSpecial .= ",use_template_tploptions,contactgroups_tploptions". - ",host_notification_commands_tploptions,service_notification_commands_tploptions"; - if ($strTableName == "tbl_contacttemplate") $strSpecial .= ",use_template_tploptions,contactgroups_tploptions". - ",host_notification_commands_tploptions,service_notification_commands_tploptions"; - if ($strTableName == "tbl_host") $strSpecial .= ",parents_tploptions,hostgroups_tploptions,contacts_tploptions". - ",contact_groups_tploptions,use_template_tploptions"; - if ($strTableName == "tbl_service") $strSpecial .= ",host_name_tploptions,hostgroup_name_tploptions,servicegroups_tploptions". - ",contacts_tploptions,contact_groups_tploptions,use_template_tploptions"; - - // Pass special fields based on nagios version - if ($strVersionValue != 3) { - // Timeperiod - if ($strTableName == "tbl_timeperiod") $strSpecial .= ",use_template,exclude,name"; - // Contact - if ($strTableName == "tbl_contact") { $strSpecial .= ",host_notifications_enabled,service_notifications_enabled,can_submit_commands,". - "retain_status_information,retain_nonstatus_information"; - $arrOption['host_notification_options'] = ",s"; - $arrOption['service_notification_options'] = ",s"; } - // Contacttemplate - if ($strTableName == "tbl_contacttemplate") { $strSpecial .= ",host_notifications_enabled,service_notifications_enabled,can_submit_commands,". - "retain_status_information,retain_nonstatus_information"; - $arrOption['host_notification_options'] = ",s"; - $arrOption['service_notification_options'] = ",s"; } - // Contactgroup - if ($strTableName == "tbl_contactgroup") $strSpecial .= ",contactgroup_members"; - // Hostgroup - if ($strTableName == "tbl_hostgroup") $strSpecial .= ",hostgroup_members,notes,notes_url,action_url"; - // Servicegroup - if ($strTableName == "tbl_servicegroup") $strSpecial .= ",servicegroup_members,notes,notes_url,action_url"; - // Hostdependencies - if ($strTableName == "tbl_hostdependency") $strSpecial .= ",dependent_hostgroup_name,hostgroup_name,dependency_period"; - // Hostescalations - if ($strTableName == "tbl_hostescalation") $strSpecial .= ",contacts"; - // Servicedependencies - if ($strTableName == "tbl_servicedependency") $strSpecial .= ",dependent_hostgroup_name,hostgroup_name,dependency_period,dependent_servicegroup_name". - ",servicegroup_name"; - // Serviceescalations - if ($strTableName == "tbl_serviceescalation") $strSpecial .= ",hostgroup_name,contacts,servicegroup_name"; - // Hosts - if ($strTableName == "tbl_host") { $strSpecial .= ",initial_state,flap_detection_options,contacts,notes,notes_url,action_url". - ",icon_image,icon_image_alt,vrml_image,statusmap_image,2d_coords,3d_coords"; - $arrOption['notification_options'] = ",s"; } - // Services - if ($strTableName == "tbl_service") { $strSpecial .= ",initial_state,flap_detection_options,contacts,notes,notes_url,action_url". - ",icon_image,icon_image_alt"; - $arrOption['notification_options'] = ",s"; } - // Hosttemplates - if ($strTableName == "tbl_hosttemplate") { $strSpecial .= ",initial_state,flap_detection_options,contacts,notes,notes_url,action_url". - ",icon_image,icon_image_alt,vrml_image,statusmap_image,2d_coords,3d_coords"; - $arrOption['notification_options'] = ",s"; } - // Servicetemplates - if ($strTableName == "tbl_servicetemplate") { $strSpecial .= ",initial_state,flap_detection_options,contacts,notes,notes_url,action_url". - ",icon_image,icon_image_alt"; - $arrOption['notification_options'] = ",s"; } - } - if ($strVersionValue == 3) { - // Servicetemplate - if ($strTableName == "tbl_servicetemplate") $strSpecial .= ",parallelize_check "; - // Service - if ($strTableName == "tbl_service") $strSpecial .= ",parallelize_check"; - - } - if ($strVersionValue == 1) { - $strSpecial .= ""; - } - // Reduce option values - if ((count($arrOption) != 0) && array_key_exists($key,$arrOption)) { - $value = str_replace($arrOption[$key],'',$value); - $value = str_replace(str_replace(',','',$arrOption[$key]),'',$value); - if ($value == '') return(1); - } - // Skip entries - $arrSpecial = explode(",",$strSpecial); - if (($value == "") || (in_array($key,$arrSpecial))) return(1); - - // Do not write config data (based on 'skip' option) - $strNoTwo = "active_checks_enabled,passive_checks_enabled,obsess_over_host,check_freshness,event_handler_enabled,flap_detection_enabled,"; - $strNoTwo .= "process_perf_data,retain_status_information,retain_nonstatus_information,notifications_enabled,parallelize_check,is_volatile,"; - $strNoTwo .= "host_notifications_enabled,service_notifications_enabled,can_submit_commands,obsess_over_service"; - $booTest = 0; - foreach(explode(",",$strNoTwo) AS $elem){ - if (($key == $elem) && ($value == "2")) $booTest = 1; - if (($this->intNagVersion != 3) && ($key == $elem) && ($value == "3")) $booTest = 1; - } - if ($booTest == 1) return(1); - return(0); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Open an SSH connection - /////////////////////////////////////////////////////////////////////////////////////////// - function getSSHConnection($intConfigID) { - // SSH Possible - if (!function_exists('ssh2_connect')) { - $this->processClassMessage(translate('SSH module not loaded!')."::",$this->strErrorMessage); - return(1); - } - // Set up basic connection - $this->getConfigData($intConfigID,"server",$strServer); - $this->resConnectServer = $strServer; - $this->resConnectType = "SSH"; - $intErrorReporting = error_reporting(); - error_reporting(0); - $this->resConnectId = ssh2_connect($strServer); - $arrError = error_get_last(); - error_reporting($intErrorReporting); - // Check connection - if (!$this->resConnectId) { - $this->myDataClass->writeLog(translate('Connection to remote system failed (SSH2 connection):')." ".$strServer); - $this->processClassMessage(translate('Connection to remote system failed (SSH2 connection):')." ".$strServer."::",$this->strErrorMessage); - if ($arrError['message'] != "") $this->processClassMessage($arrError['message']."::",$this->strErrorMessage); - $this->resConnectServer = ""; - $this->resConnectType = "none"; - return(1); - } - // Login with username and password - $this->getConfigData($intConfigID,"user",$strUser); - $this->getConfigData($intConfigID,"password",$strPasswd); - $this->getConfigData($intConfigID,"ssh_key_path",$strSSHKeyPath); - if ($strSSHKeyPath != "") { - $strPublicKey = str_replace("//","/",$strSSHKeyPath."/id_rsa.pub"); - $strPrivatKey = str_replace("//","/",$strSSHKeyPath."/id_rsa"); - // Check if ssh key file are readable - if (!file_exists($strPublicKey) || !is_readable($strPublicKey)) { - $this->myDataClass->writeLog(translate('SSH public key does not exist or is not readable')." ".$strSSHKeyPath.$strPublicKey); - $this->processClassMessage(translate('SSH public key does not exist or is not readable')." ".$strSSHKeyPath.$strPublicKey."::",$this->strErrorMessage); - return(1); - } - if (!file_exists($strPrivatKey) || !is_readable($strPrivatKey)) { - $this->myDataClass->writeLog(translate('SSH private key does not exist or is not readable')." ".$strPrivatKey); - $this->processClassMessage(translate('SSH private key does not exist or is not readable')." ".$strPrivatKey."::",$this->strErrorMessage); - return(1); - } - $intErrorReporting = error_reporting(); - error_reporting(0); - if ($strPasswd == "") { - $login_result = ssh2_auth_pubkey_file($this->resConnectId, $strUser, $strSSHKeyPath."/id_rsa.pub", $strSSHKeyPath."/id_rsa"); - } else { - $login_result = ssh2_auth_pubkey_file($this->resConnectId, $strUser, $strSSHKeyPath."/id_rsa.pub", $strSSHKeyPath."/id_rsa",$strPasswd); - } - $arrError = error_get_last(); - error_reporting($intErrorReporting); - } else { - $intErrorReporting = error_reporting(); - error_reporting(0); - $login_result = ssh2_auth_password($this->resConnectId,$strUser,$strPasswd); - $arrError = error_get_last(); - $strPasswordNote = "If you are using ssh2 with user/password - you have to enable PasswordAuthentication in your sshd_config"; - error_reporting($intErrorReporting); - } - // Check connection - if ((!$this->resConnectId) || (!$login_result)) { - $this->myDataClass->writeLog(translate('Connection to remote system failed (SSH2 connection):')." ".$strServer); - $this->processClassMessage(translate('Connection to remote system failed (SSH2 connection):')." ".$strServer."::",$this->strErrorMessage); - if ($arrError['message'] != "") $this->processClassMessage($arrError['message']."::",$this->strErrorMessage); - if (isset($strPasswordNote)) $this->processClassMessage($strPasswordNote."::",$this->strErrorMessage); - $this->resConnectServer = ""; - $this->resConnectType = "none"; - $this->resConnectId = null; - return(1); - } - // Etablish an SFTP connection ressource - $this->resSFTP = ssh2_sftp($this->resConnectId); - return(0); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Sends a command via SSH and stores the result in an array - /////////////////////////////////////////////////////////////////////////////////////////// - // $strCommand -> Command - // $intLines -> Read max output lines - // This functions returs a result array or false in case of error - /////////////////////////////////////////////////////////////////////////////////////////// - function sendSSHCommand($strCommand,$intLines=100) { - $intCount1 = 0; - $intCount2 = 0; - $booResult = false; - if (is_resource($this->resConnectId)) { - $resStream = ssh2_exec($this->resConnectId, $strCommand.'; echo "__END__";'); - if ($resStream) { - stream_set_blocking($resStream,1); - stream_set_timeout($resStream,2); - do { - $strLine = stream_get_line($resStream,1024,"\n"); - if ($strLine == "") { - $intCount1++; - } else if (substr_count($strLine,"__END__") != 1) { - $arrResult[] = $strLine; - $booResult = true; - } - $intCount2++; - $arrStatus = stream_get_meta_data($resStream); - } while ($resStream && !(feof($resStream)) && ($intCount1 <= 10) && ($intCount2 <= $intLines) && ($arrStatus['timed_out'] != true)); - fclose($resStream); - if ($booResult) { - if ($arrStatus['timed_out'] == true) { - //echo "timed_out".var_dump($arrResult)."
"; - } - return $arrResult; - } else { - return true; - } - } - } - return false; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Open an FTP connection - /////////////////////////////////////////////////////////////////////////////////////////// - function getFTPConnection($intConfigID) { - // Set up basic connection - $this->getConfigData($intConfigID,"server",$strServer); - $this->resConnectServer = $strServer; - $this->resConnectType = "FTP"; - $this->resConnectId = ftp_connect($strServer); - // Login with username and password - if ($this->resConnectId) { - $this->getConfigData($intConfigID,"user",$strUser); - $this->getConfigData($intConfigID,"password",$strPasswd); - $intErrorReporting = error_reporting(); - error_reporting('0'); - $login_result = ftp_login($this->resConnectId,$strUser,$strPasswd); - $arrError = error_get_last(); - error_reporting($intErrorReporting); - if ($login_result == false) { - $strFTPError = $arrError['message']; - ftp_close($this->resConnectId); - $this->resConnectServer = ""; - $this->resConnectType = "none"; - } - } - // Check connection - if ((!$this->resConnectId) || (!$login_result)) { - $this->myDataClass->writeLog(translate('Connection to remote system failed (FTP connection):')." ".$strServer); - $this->processClassMessage(translate('Connection to remote system failed (FTP connection):')." ".$strServer."::",$this->strErrorMessage); - if (isset($arrError) && ($arrError['message'] != "")) $this->processClassMessage($arrError['message']."::",$this->strErrorMessage); - return(1); - } - return(0); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Get configuration set IDs - /////////////////////////////////////////////////////////////////////////////////////////// - // $strTableName -> Configuration table name - // Return value -> Array including configuration target IDs - /////////////////////////////////////////////////////////////////////////////////////////// - function getConfigSets($strTableName = '') { - $arrConfigId = array(); - if ($strTableName == '') { - $strSQL = "SELECT `targets` FROM `tbl_datadomain` WHERE `id` = ".$this->intDomainId; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn && ($intDataCount != 0)) { - foreach ($arrData AS $elem) { - $arrConfigId[] = $elem['targets']; - } - return($arrConfigId); - } - } - return(1); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Get configuration domain parameters - /////////////////////////////////////////////////////////////////////////////////////////// - // $intConfigId -> Configuration ID - // $strConfigItem -> Configuration key - // $strValue -> Configuration value (return value) - /////////////////////////////////////////////////////////////////////////////////////////// - function getConfigData($intConfigId,$strConfigItem,&$strValue) { - $strSQL = "SELECT `".$strConfigItem."` FROM `tbl_configtarget` WHERE `id` = ".$intConfigId; - $strValue = $this->myDBClass->getFieldData($strSQL); - if ($strValue != "" ) return(0); - return(1); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Get data domain parameters - /////////////////////////////////////////////////////////////////////////////////////////// - // $strConfigItem -> Configuration key - // $strValue -> Configuration value (return value) - /////////////////////////////////////////////////////////////////////////////////////////// - function getDomainData($strConfigItem,&$strValue) { - $strSQL = "SELECT `".$strConfigItem."` FROM `tbl_datadomain` WHERE `id` = ".$this->intDomainId; - $strValue = $this->myDBClass->getFieldData($strSQL); - if ($strValue != "" ) return(0); - return(1); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Process special settings based on template option - /////////////////////////////////////////////////////////////////////////////////////////// - // $strValue -> Original data value - // $strKeyField -> Template option field name - // $strTable -> Table name - // $intId -> Dataset ID - // $intSkip -> Skip value (return value) - // This function returns the manipulated data value - /////////////////////////////////////////////////////////////////////////////////////////// - function checkTpl($strValue,$strKeyField,$strTable,$intId,&$intSkip) { - if ($this->intNagVersion < 3) return($strValue); - $strSQL = "SELECT `".$strKeyField."` FROM `".$strTable."` WHERE `id` = $intId"; - $intValue = $this->myDBClass->getFieldData($strSQL); - if ($intValue == 0) return("+".$strValue); - if ($intValue == 1) { - $intSkip = 0; - return("null"); - } - return($strValue); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Check directory for write access - /////////////////////////////////////////////////////////////////////////////////////////// - // $path -> Physical path - // This function returns true if writeable or false if not - // This is a 3rd party function and not written by the NagiosQL developper team - /////////////////////////////////////////////////////////////////////////////////////////// - function dir_is_writable($path) { - if ($path == "") return false; - //will work in despite of Windows ACLs bug - //NOTE: use a trailing slash for folders!!! - //see http://bugs.php.net/bug.php?id=27609 - //see http://bugs.php.net/bug.php?id=30931 - if ($path{strlen($path)-1}=='/') // recursively return a temporary file path - return $this->dir_is_writable($path.uniqid(mt_rand()).'.tmp'); - else if (is_dir($path)) - return $this->dir_is_writable($path.'/'.uniqid(mt_rand()).'.tmp'); - // check tmp file for read/write capabilities - $rm = file_exists($path); - $f = @fopen($path, 'a'); - if ($f===false) - return false; - fclose($f); - if (!$rm) - unlink($path); - return true; - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Processing message strings - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Merge message strings and check for duplicate messages - // - // Parameters: $strNewMessage Message to add - // $strSeparate Separate string (
or \n) - // - // Return value: &$strOldMessage Modified message string - // - /////////////////////////////////////////////////////////////////////////////////////////// - function processClassMessage($strNewMessage,&$strOldMessage) { - $strNewMessage = str_replace("::::","::",$strNewMessage); - if (($strOldMessage != "") && ($strNewMessage != "")) { - if (substr_count($strOldMessage,$strNewMessage) == 0) { - $strOldMessage .= $strNewMessage; - } - } else { - $strOldMessage .= $strNewMessage; - } - // Reset message variable (prevent duplicates) - $strNewMessage = ""; - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Add files of a given directory to an array - /////////////////////////////////////////////////////////////////////////////////////////// - function DirToArray($sPath, $include, $exclude, &$output,&$errMessage) { - while (substr($sPath,-1) == "/" OR substr($sPath,-1) == "\\") { - $sPath=substr($sPath, 0, -1); - } - $handle = @opendir($sPath); - if( $handle === false ) { - if ($this->intDomainId != 0) { - $errMessage .= translate('Could not open directory').": ".$sPath."
"; - } - } else { - while ($arrDir[] = readdir($handle)) {} - closedir($handle); - sort($arrDir); - foreach($arrDir as $file) { - if (!preg_match("/^\.{1,2}/", $file) and strlen($file)) { - if (is_dir($sPath."/".$file)) { - $this->DirToArray($sPath."/".$file, $include, $exclude, $output, $errMessage); - } else { - if (preg_match("/".$include."/",$file) && (($exclude == "") || !preg_match("/".$exclude."/", $file))) { - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $sPath=str_replace("/", "\\", $sPath); - $output [] = $sPath."\\".$file; - } else { - $output [] = $sPath."/".$file; - } - } - } - } - } - } - } -} -?> \ No newline at end of file diff --git a/functions/content_class.php b/functions/content_class.php deleted file mode 100644 index ee3e9cc..0000000 --- a/functions/content_class.php +++ /dev/null @@ -1,509 +0,0 @@ -arrSettings = $_SESSION['SETS']; - if (isset($_SESSION['domain'])) $this->intDomainId = $_SESSION['domain']; - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Single data form initialization - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: $objTemplate Form template object - // $strChbFields Comma separated string of checkbox value names - // - // Return values: none - // - /////////////////////////////////////////////////////////////////////////////////////////// - function addFormInit($objTemplate,$strChbFields='') { - // Language text replacements from fieldvars.php file - foreach($this->arrDescription AS $elem) { - $objTemplate->setVariable($elem['name'],$elem['string']); - } - // Some single replacements - $objTemplate->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); - $objTemplate->setVariable("IMAGE_PATH",$this->arrSettings['path']['base_url']."images/"); - $objTemplate->setVariable("DOCUMENT_ROOT",$this->arrSettings['path']['base_url']); - $objTemplate->setVariable("ACT_CHECKED","checked"); - $objTemplate->setVariable("REG_CHECKED","checked"); - $objTemplate->setVariable("MODUS","insert"); - $objTemplate->setVariable("VERSION",$this->intVersion); - $objTemplate->setVariable("LIMIT",$this->intLimit); - $objTemplate->setVariable("RELATION_CLASS","elementHide"); - $objTemplate->setVariable("IFRAME_SRC",$this->arrSettings['path']['base_url']."admin/commandline.php"); - // Some conditional replacements - if ($this->strBrowser != "msie") $objTemplate->setVariable("MSIE_DISABLED","disabled=\"disabled\""); - if ($this->intGroupAdm == 0) $objTemplate->setVariable("RESTRICT_GROUP_ADMIN","class=\"elementHide\""); - if ($this->arrSettings['common']['seldisable'] == 0) $objTemplate->setVariable("MSIE_DISABLED",""); - if ($this->arrSettings['common']['tplcheck'] == 0) $objTemplate->setVariable("CHECK_BYPASS","return true;"); - // Some replacements based on nagios version - if ($this->intVersion == 3) { - $objTemplate->setVariable("VERSION_20_VISIBLE","elementHide"); - $objTemplate->setVariable("VERSION_30_VISIBLE","elementShow"); - $objTemplate->setVariable("VERSION_20_MUST",""); - $objTemplate->setVariable("VERSION_30_MUST","inpmust"); - $objTemplate->setVariable("VERSION_20_STAR",""); - $objTemplate->setVariable("NAGIOS_VERSION","3"); - } else { - $objTemplate->setVariable("VERSION_20_VISIBLE","elementShow"); - $objTemplate->setVariable("VERSION_30_VISIBLE","elementHide"); - $objTemplate->setVariable("VERSION_20_MUST","inpmust"); - $objTemplate->setVariable("VERSION_30_MUST",""); - $objTemplate->setVariable("VERSION_20_STAR","*"); - $objTemplate->setVariable("NAGIOS_VERSION","2"); - } - // Checkbox and radio field value replacements - if ($strChbFields != '') { - foreach (explode(",",$strChbFields) AS $elem) { - $objTemplate->setVariable("DAT_".$elem."0_CHECKED",""); - $objTemplate->setVariable("DAT_".$elem."1_CHECKED",""); - $objTemplate->setVariable("DAT_".$elem."2_CHECKED","checked"); - } - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Single data form - value insertions - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: $objTemplate Form template object - // $arrModifyData Database values - // $intLocked Data is locked (0=no / 1=yes) - // $strInfo Information string - // $strChbFields Comma separated string of checkbox value names - // - // Return values: none - // - /////////////////////////////////////////////////////////////////////////////////////////// - function addInsertData($objTemplate,$arrModifyData,$intLocked,$strInfo,$strChbFields = '') { - // Insert text data values - foreach($arrModifyData AS $key => $value) { - if (($key == "active") || ($key == "register") || ($key == "last_modified") || ($key == "access_rights")) continue; - $objTemplate->setVariable("DAT_".strtoupper($key),htmlentities($value,ENT_QUOTES,'UTF-8')); - } - // Insert checkbox data values - if ((isset($arrModifyData['active'])) && ($arrModifyData['active'] != 1)) $objTemplate->setVariable("ACT_CHECKED",""); - if ((isset($arrModifyData['register'])) && ($arrModifyData['register'] != 1)) $objTemplate->setVariable("REG_CHECKED",""); - // Deselect any checkboxes - if ($strChbFields != '') { - foreach (explode(",",$strChbFields) AS $elem) { - $objTemplate->setVariable("DAT_".$elem."0_CHECKED",""); - $objTemplate->setVariable("DAT_".$elem."1_CHECKED",""); - $objTemplate->setVariable("DAT_".$elem."2_CHECKED",""); - } - } - // Change some status values in locked data sets - if ($intLocked != 0) { - $objTemplate->setVariable("ACT_DISABLED","disabled"); - $objTemplate->setVariable("ACT_CHECKED","checked"); - $objTemplate->setVariable("ACTIVE","1"); - $objTemplate->setVariable("CHECK_MUST_DATA",$strInfo); - $objTemplate->setVariable("RELATION_CLASS","elementShow"); - } - // Change mode to modify - $objTemplate->setVariable("MODUS","modify"); - // Check write permission - if ($this->intWriteAccessId == 1) $objTemplate->setVariable("DISABLE_SAVE","disabled=\"disabled\""); - if ($this->intGlobalWriteAccess == 1) $objTemplate->setVariable("DISABLE_SAVE","disabled=\"disabled\""); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: List view - form initialization - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: $objTemplate Form template object - // - // Return values: none - // - /////////////////////////////////////////////////////////////////////////////////////////// - function listViewInit($objTemplate) { - // Language text replacements from fieldvars.php file - foreach($this->arrDescription AS $elem) { - $objTemplate->setVariable($elem['name'],$elem['string']); - } - // Some single replacements - $objTemplate->setVariable("LIMIT",$this->intLimit); - $objTemplate->setVariable("ACTION_MODIFY",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); - $objTemplate->setVariable("TABLE_NAME",$this->strTableName); - $objTemplate->setVariable("DAT_SEARCH",$_SESSION['search'][$this->strSearchSession]); - $objTemplate->setVariable("MAX_ID","0"); - $objTemplate->setVariable("MIN_ID","0"); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: List view - value insertions - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: $objTemplate Form template object - // $arrData Database values - // $intDataCount Total count of data lines for one page - // $intLineCount Total count of data lines (all data) - // $strField1 Field name for data field 1 - // $strField2 Field name for data field 2 - // $intLimit2 Actual data char limit for field 2 - // - // Return values: none - // - /////////////////////////////////////////////////////////////////////////////////////////// - function listData($objTemplate,$arrData,$intDataCount,$intLineCount,$strField1,$strField2,$intLimit2=0) { - // Template block names - $strTplPart = 'datatable'; - $strTplRow = 'datarow'; - if ($this->strTableName == "tbl_host") { - $strTplPart = 'datatablehost'; - $strTplRow = 'datarowhost'; - } - if ($this->strTableName == "tbl_service") { - $strTplPart = 'datatableservice'; - $strTplRow = 'datarowservice'; - } - if (($this->strTableName == "tbl_user") || ($this->strTableName == "tbl_group") || ($this->strTableName == "tbl_datadomain") || ($this->strTableName == "tbl_configtarget")) { - $strTplPart = 'datatablecommon'; - $strTplRow = 'datarowcommon'; - } - // Some single replacements - $objTemplate->setVariable("IMAGE_PATH_HEAD",$this->arrSettings['path']['base_url']."images/"); - $objTemplate->setVariable("CELLCLASS_L","tdlb"); - $objTemplate->setVariable("CELLCLASS_M","tdmb"); - $objTemplate->setVariable("DISABLED","disabled"); - $objTemplate->setVariable("DATA_FIELD_1",translate('No data')); - $objTemplate->setVariable("DATA_FIELD_2"," "); - $objTemplate->setVariable("DATA_REGISTERED"," "); - $objTemplate->setVariable("DATA_ACTIVE"," "); - $objTemplate->setVariable("DATA_FILE"," "); - $objTemplate->setVariable("PICTURE_CLASS","elementHide"); - $objTemplate->setVariable("DOMAIN_SPECIAL"," "); - $objTemplate->setVariable("SORT_BY",$this->intSortBy); - // Inserting data values - if ($intDataCount != 0) { - for ($i=0;$i<$intDataCount;$i++) { - // Get biggest and smalest value - if ($i == 0) {$y = $arrData[$i]['id']; $z = $arrData[$i]['id'];} - if ($arrData[$i]['id'] < $y) $y = $arrData[$i]['id']; - if ($arrData[$i]['id'] > $z) $z = $arrData[$i]['id']; - $objTemplate->setVariable("MAX_ID",$z); - $objTemplate->setVariable("MIN_ID",$y); - // Line colours - $strClassL = "tdld"; $strClassM = "tdmd"; - if ($i%2 == 1) {$strClassL = "tdlb"; $strClassM = "tdmb";} - if ((isset($arrData[$i]['register'])) && ($arrData[$i]['register'] == 0)) {$strRegister = translate('No');} else {$strRegister = translate('Yes');} - if ($arrData[$i]['active'] == 0) {$strActive = translate('No');} else {$strActive = translate('Yes');} - // Get file date for hosts and services - $intTimeInfo = 0; - if ($this->strTableName == "tbl_host") { - $intReturn = $this->myConfigClass->lastModifiedDir($this->strTableName,$arrData[$i]['host_name'],$arrData[$i]['id'],$arrTimeData,$intTimeInfo); - if ($intReturn == 1) $this->strErrorMessage = $this->myConfigClass->strErrorMessage; - } - if ($this->strTableName == "tbl_service") { - $intReturn = $this->myConfigClass->lastModifiedDir($this->strTableName,$arrData[$i]['config_name'],$arrData[$i]['id'],$arrTimeData,$intTimeInfo); - if ($intReturn == 1) $this->strErrorMessage = $this->myConfigClass->strErrorMessage; - } - // Set datafields - foreach($this->arrDescription AS $elem) { - $objTemplate->setVariable($elem['name'],$elem['string']); - } - if ($arrData[$i][$strField1] == '') $arrData[$i][$strField1] = "NOT DEFINED - ".$arrData[$i]['id']; - $objTemplate->setVariable("DATA_FIELD_1",htmlentities($arrData[$i][$strField1],ENT_COMPAT,'UTF-8')); - $objTemplate->setVariable("DATA_FIELD_1S",addslashes(htmlentities($arrData[$i][$strField1],ENT_COMPAT,'UTF-8'))); - if ($strField2 == 'process_field') { - $arrData[$i]['process_field'] = $this->processField2($arrData[$i],$this->strTableName); - } else { - $objTemplate->setVariable("DATA_FIELD_2S",addslashes(htmlentities($arrData[$i][$strField2],ENT_COMPAT,'UTF-8'))); - } - if ($intLimit2 != 0) { - if (strlen($arrData[$i][$strField2]) > $intLimit2) {$strAdd = " ...";} else {$strAdd = "";} - $objTemplate->setVariable("DATA_FIELD_2",htmlentities(substr($arrData[$i][$strField2],0,$intLimit2),ENT_COMPAT,'UTF-8').$strAdd); - } else { - $objTemplate->setVariable("DATA_FIELD_2",htmlentities($arrData[$i][$strField2],ENT_COMPAT,'UTF-8')); - } - $objTemplate->setVariable("DATA_REGISTERED",$strRegister); - if (substr_count($this->strTableName,'template') != 0) $objTemplate->setVariable("DATA_REGISTERED","-"); - $objTemplate->setVariable("DATA_ACTIVE",$strActive); - $objTemplate->setVariable("DATA_FILE","".translate('out-of-date').""); - if ($intTimeInfo == 4) $objTemplate->setVariable("DATA_FILE",translate('no target')); - if ($intTimeInfo == 3) $objTemplate->setVariable("DATA_FILE","".translate('missed').""); - if ($intTimeInfo == 2) $objTemplate->setVariable("DATA_FILE","".translate('missed').""); - if ($intTimeInfo == 1) $objTemplate->setVariable("DATA_FILE","".translate('out-of-date').""); - if ($intTimeInfo == 0) $objTemplate->setVariable("DATA_FILE",translate('up-to-date')); - $objTemplate->setVariable("LINE_ID",$arrData[$i]['id']); - $objTemplate->setVariable("CELLCLASS_L",$strClassL); - $objTemplate->setVariable("CELLCLASS_M",$strClassM); - $objTemplate->setVariable("IMAGE_PATH",$this->arrSettings['path']['base_url']."images/"); - $objTemplate->setVariable("PICTURE_CLASS","elementShow"); - $objTemplate->setVariable("DOMAIN_SPECIAL",""); - $objTemplate->setVariable("DISABLED",""); - // Disable common domain objects - if (isset($arrData[$i]['config_id'])) { - if ($arrData[$i]['config_id'] != $this->intDomainId) { - $objTemplate->setVariable("PICTURE_CLASS","elementHide"); - $objTemplate->setVariable("DOMAIN_SPECIAL"," [common]"); - $objTemplate->setVariable("DISABLED","disabled"); - } else { - // Inactive items should not be written/downloaded - if ($arrData[$i]['active'] == 0) $objTemplate->setVariable("ACTIVE_CONTROL","elementHide"); - } - } - // Check access rights for list objects - if (isset($arrData[$i]['access_group'])) { - if ($this->myVisClass->checkAccGroup($arrData[$i]['access_group'],'write') != 0) $objTemplate->setVariable("LINE_CONTROL","elementHide"); - } else { - if ($this->intGlobalWriteAccess != 0) $objTemplate->setVariable("LINE_CONTROL","elementHide"); - } - // Check global access rights for list objects - if ($this->intGlobalWriteAccess != 0) $objTemplate->setVariable("LINE_CONTROL","elementHide"); - $objTemplate->parse($strTplRow); - } - } else { - $objTemplate->setVariable("IMAGE_PATH",$this->arrSettings['path']['base_url']."images/"); - $objTemplate->parse($strTplRow); - } - $objTemplate->setVariable("BUTTON_CLASS","elementShow"); - if ($this->intDomainId == 0) $objTemplate->setVariable("BUTTON_CLASS","elementHide"); - // Check access rights for adding new objects - if ($this->intGlobalWriteAccess != 0) $objTemplate->setVariable("ADD_CONTROL","disabled=\"disabled\""); - // Show page numbers - $objTemplate->setVariable("PAGES",$this->myVisClass->buildPageLinks(filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING),$intLineCount,$this->intLimit,$this->intSortBy,$this->strSortDir)); - $objTemplate->parse($strTplPart); - $objTemplate->show($strTplPart); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Display information messages - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: $objTemplate Form template object - // $strErrorMessage String including error messages - // $strInfoMessage String including information messages - // $strConsistMessage String including consistency messages - // $arrTimeData Array including time data - // $strTimeInfoString String including time information message - // $intNoTime Status value for showing time information (0=show time) - // - // Return values: none - // - /////////////////////////////////////////////////////////////////////////////////////////// - function showMessages($objTemplate,$strErrorMessage,$strInfoMessage,$strConsistMessage,$arrTimeData,$strTimeInfoString,$intNoTime=0) { - // Display info messages - if ($strInfoMessage != "") { - $objTemplate->setVariable("INFOMESSAGE",$strInfoMessage); - $objTemplate->parse('infomessage'); - } - // Display error messages - if ($strErrorMessage != "") { - $objTemplate->setVariable("ERRORMESSAGE",$strErrorMessage); - $objTemplate->parse('errormessage'); - } - // Display time informations - if (($this->intDomainId != 0) && ($intNoTime == 0)) { - foreach($arrTimeData AS $key => $elem) { - if ($key == 'table') { - $objTemplate->setVariable("LAST_MODIFIED_TABLE",translate('Last database update:')." ".$elem.""); - $objTemplate->parse('table_time'); - } else { - $objTemplate->setVariable("LAST_MODIFIED_FILE",translate('Last file change of the configuration target ')." ".$key.": ".$elem.""); - $objTemplate->parse('file_time'); - } - } - if ($strTimeInfoString != "") { - $objTemplate->setVariable("MODIFICATION_STATUS",$strTimeInfoString); - $objTemplate->parse('modification_status'); - } - } - // Display consistency messages - if ($strConsistMessage != "") { - $objTemplate->setVariable("CONSIST_USAGE",$strConsistMessage); - $objTemplate->parse('consistency'); - } - $objTemplate->parse("msgfooter"); - $objTemplate->show("msgfooter"); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Display page footer - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: $objTemplate Form template object - // $setFileVersion NagiosQL version - // - // Return values: none - // - /////////////////////////////////////////////////////////////////////////////////////////// - function showFooter($objTemplate,$setFileVersion) { - $objTemplate->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); - $objTemplate->parse("footer"); - $objTemplate->show("footer"); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // --- HELP functions --- - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Process list view field 2 - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: $arrData Data array - // $strTableName Table name - // - // Return values: String includung field 2 data - // - /////////////////////////////////////////////////////////////////////////////////////////// - function processField2($arrData,$strTableName) { - $strField = ""; - // Hostdependency table - if ($strTableName == "tbl_hostdependency") { - if ($arrData['dependent_host_name'] != 0) { - $strSQLHost = "SELECT `host_name`, `exclude` FROM `tbl_host` LEFT JOIN `tbl_lnkHostdependencyToHost_DH` ON `id`=`idSlave` - WHERE `idMaster`=".$arrData['id']." ORDER BY `host_name`"; - $booReturn = $this->myDBClass->getDataArray($strSQLHost,$arrDataHosts,$intDCHost); - if ($intDCHost != 0) { - foreach($arrDataHosts AS $elem) { - if ($elem['exclude'] == 1) { - $strField .= "H:!".$elem['host_name'].","; - } else { - $strField .= "H:".$elem['host_name'].","; - } - } - } - } - if ($arrData['dependent_hostgroup_name'] != 0) { - $strSQLHost = "SELECT `hostgroup_name`, `exclude` FROM `tbl_hostgroup` LEFT JOIN `tbl_lnkHostdependencyToHostgroup_DH` ON `id`=`idSlave` - WHERE `idMaster`=".$arrData['id']." ORDER BY `hostgroup_name`"; - $booReturn = $this->myDBClass->getDataArray($strSQLHost,$arrDataHostgroups,$intDCHostgroup); - if ($intDCHostgroup != 0) { - foreach($arrDataHostgroups AS $elem) { - if ($elem['exclude'] == 1) { - $strField .= "HG:!".$elem['hostgroup_name'].","; - } else { - $strField .= "HG:".$elem['hostgroup_name'].","; - } - } - } - } - } - // Hostescalation table - if ($strTableName == "tbl_hostescalation") { - if ($arrData['host_name'] != 0) { - $strSQLHost = "SELECT `host_name` FROM `tbl_host` LEFT JOIN `tbl_lnkHostescalationToHost` ON `id`=`idSlave` - WHERE `idMaster`=".$arrData['id']." ORDER BY `host_name`"; - $booReturn = $this->myDBClass->getDataArray($strSQLHost,$arrDataHosts,$intDCHost); - if ($intDCHost != 0) { - foreach($arrDataHosts AS $elem) { - $strField .= "H:".$elem['host_name'].","; - } - } - } - if ($arrData['hostgroup_name'] != 0) { - $strSQLHost = "SELECT `hostgroup_name` FROM `tbl_hostgroup` LEFT JOIN `tbl_lnkHostescalationToHostgroup` ON `id`=`idSlave` - WHERE `idMaster`=".$arrData['id']." ORDER BY `hostgroup_name`"; - $booReturn = $this->myDBClass->getDataArray($strSQLHost,$arrDataHostgroups,$intDCHostgroup); - if ($intDCHostgroup != 0) { - foreach($arrDataHostgroups AS $elem) { - $strField .= "HG:".$elem['hostgroup_name'].","; - } - } - } - } - // Servicedependency table - if ($strTableName == "tbl_servicedependency") { - if ($arrData['dependent_service_description'] == 2) { - $strField .= "*"; - } else if ($arrData['dependent_service_description'] != 0) { - $strSQLService = "SELECT `strSlave` FROM `tbl_lnkServicedependencyToService_DS` WHERE `idMaster`=".$arrData['id']." ORDER BY `strSlave`"; - $booReturn = $this->myDBClass->getDataArray($strSQLService,$arrDataService,$intDCService); - if ($intDCService != 0) { - foreach($arrDataService AS $elem) { - $strField .= $elem['strSlave'].","; - } - } - } - if ($strField == "") { - $strSQLService = "SELECT `servicegroup_name` FROM `tbl_servicegroup` - LEFT JOIN `tbl_lnkServicedependencyToServicegroup_DS` ON `idSlave`=`id` - WHERE `idMaster`=".$arrData['id']." ORDER BY `servicegroup_name`"; - $booReturn = $this->myDBClass->getDataArray($strSQLService,$arrDataService,$intDCService); - if ($intDCService != 0) { - foreach($arrDataService AS $elem) { - $strField .= $elem['servicegroup_name'].","; - } - } - } - } - // Serviceescalation table - if ($strTableName == "tbl_serviceescalation") { - if ($arrData['service_description'] == 2) { - $strField .= "*"; - } else if ($arrData['service_description'] != 0) { - $strSQLService = "SELECT `strSlave` FROM `tbl_lnkServiceescalationToService` WHERE `idMaster`=".$arrData['id']; - $booReturn = $this->myDBClass->getDataArray($strSQLService,$arrDataServices,$intDCServices); - if ($intDCServices != 0) { - foreach($arrDataServices AS $elem) { - $strField .= $elem['strSlave'].","; - } - } - } - if ($strField == "") { - $strSQLService = "SELECT `servicegroup_name` FROM `tbl_servicegroup` - LEFT JOIN `tbl_lnkServiceescalationToServicegroup` ON `idSlave`=`id` - WHERE `idMaster`=".$arrData['id']." ORDER BY `servicegroup_name`"; - $booReturn = $this->myDBClass->getDataArray($strSQLService,$arrDataService,$intDCService); - if ($intDCService != 0) { - foreach($arrDataService AS $elem) { - $strField .= $elem['servicegroup_name'].","; - } - } - } - } - // Some string manipulations - remove comma on line end - if (substr($strField,-1) == ',') $strField = substr($strField,0,-1); - return($strField); - } -} -?> \ No newline at end of file diff --git a/functions/data_class.php b/functions/data_class.php deleted file mode 100644 index f55a01d..0000000 --- a/functions/data_class.php +++ /dev/null @@ -1,1290 +0,0 @@ -arrSettings = $_SESSION['SETS']; - if (isset($_SESSION['domain'])) $this->intDomainId = $_SESSION['domain']; - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Write data to the database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Sends an SQL string to the database server - // - // Parameters: $strSQL SQL Command - // - // Return value: $intDataID Data ID of last inserted dataset - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dataInsert($strSQL,&$intDataID) { - // Send the SQL command to the database server - $booReturn = $this->myDBClass->insertData($strSQL); - $intDataID = $this->myDBClass->intLastId; - // Was the SQL command processed successfully? - if ($booReturn) { - $this->processClassMessage(translate('Data were successfully inserted to the data base!')."::",$this->strInfoMessage); - return(0); - } else { - $this->processClassMessage(translate('Error while inserting the data to the data base:')."::".$this->myDBClass->strErrorMessage."::",$this->strErrorMessage); - return(1); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Delete data from the database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Removes one or more dataset(s) from a table. Optinal a single data ID can be passed - // or the values will be processed through the POST variable $_POST['chbId_n'] where 'n' - // represents the data ID. - // - // This function does not delete relation data! - // - // Parameters: $strTableName Table name - // $_POST[] Form variable (Checkboxes "chbId_n" n=DBId) - // $intDataId Single data ID - // $intTableId Table id for special relations - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dataDeleteEasy($strTableName,$intDataId=0) { - // Special rule for tables with "nodelete" cells - if (($strTableName == "tbl_datadomain") || ($strTableName == "tbl_configtarget") || ($strTableName == "tbl_user")) { - $strNoDelete = "AND `nodelete` <> '1'"; - } else { - $strNoDelete = ""; - } - // Delete a single data set - if ($intDataId != 0) { - $strSQL = "DELETE FROM `".$strTableName."` WHERE `id` = $intDataId $strNoDelete"; - $booReturn = $this->myDBClass->insertData($strSQL); - if ($booReturn == false) { - $this->processClassMessage(translate('Delete failed because a database error:')."::".$this->myDBClass->strErrorMessage."::",$this->strInfoMessage); - return(1); - } else if ($this->myDBClass->intAffectedRows == 0) { - $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist or it is protected from delete.')."::",$this->strErrorMessage); - return(1); - } else { - $this->strInfoMessage .= translate('Dataset successfully deleted. Affected rows:')." ".$this->myDBClass->intAffectedRows."::"; - $this->writeLog(translate('Delete dataset id:')." $intDataId ".translate('- from table:')." $strTableName ".translate('- with affected rows:')." ".$this->myDBClass->intAffectedRows); - $this->updateStatusTable($strTableName); - return(0); - } - // Delete data sets based on form POST parameter - } else { - $strSQL = "SELECT `id` FROM `".$strTableName."` WHERE 1=1 $strNoDelete"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn && ($intDataCount != 0)) { - $intDeleteCount = 0; - foreach ($arrData AS $elem) { - $strChbName = "chbId_".$elem['id']; - // Should this data id to be deleted? - if (isset($_POST[$strChbName]) && ($_POST[$strChbName] == "on")) { - $strSQL = "DELETE FROM `".$strTableName."` WHERE `id` = ".$elem['id']; - $booReturn = $this->myDBClass->insertData($strSQL); - if ($booReturn == false) { - $this->processClassMessage(translate('Delete failed because a database error:')."::".$this->myDBClass->strErrorMessage."::",$this->strInfoMessage); - return(1); - } else { - $intDeleteCount = $intDeleteCount + $this->myDBClass->intAffectedRows; - } - } - } - // Process messsages - if ($intDeleteCount == 0) { - $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist or it is protected from delete.')."::",$this->strErrorMessage); - return(1); - } else { - $this->processClassMessage(translate('Dataset successfully deleted. Affected rows:')." ".$intDeleteCount."::",$this->strInfoMessage); - $this->writeLog(translate('Delete data from table:')." $strTableName ".translate('- with affected rows:')." ".$this->myDBClass->intAffectedRows); - $this->updateStatusTable($strTableName); - return(0); - } - } else { - $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist or it is protected from delete.')."::",$this->strErrorMessage); - return(1); - } - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Delete data from the database with relations - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Removes one or more dataset(s) from a table. Optinal a single data ID can be passed - // or the values will be processed through the POST variable $_POST['chbId_n'] where 'n' - // represents the data ID. - // - // This function does also delete relation data! - // - // Parameters: $strTableName Table name - // $_POST[] Form variable (Checkboxes "chbId_n" n=DBId) - // $intDataId Single data ID - // $intForce Force deletion (1=force, 1=no force) - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dataDeleteFull($strTableName,$intDataId=0,$intForce=0) { - // Get write access groups - $strAccess = $this->myVisClass->getAccGroups('write'); - // Get all relations - $this->fullTableRelations($strTableName,$arrRelations); - // Delete a single data set - if ($intDataId != 0) { - $strChbName = "chbId_".$intDataId; - $_POST[$strChbName] = "on"; - } - // Get all datasets - if ($strTableName == 'tbl_group') { - $strSQL = "SELECT `id` FROM `".$strTableName."`"; - } else { - $strSQL = "SELECT `id` FROM `".$strTableName."` WHERE `config_id`=".$this->intDomainId." AND `access_group` IN ($strAccess)"; - } - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn && ($intDataCount != 0)) { - $intDeleteCount = 0; - $strFileMessage = ""; - foreach ($arrData AS $elem) { - $strChbName = "chbId_".$elem['id']; - // Single ID - if (($intDataId != 0) && ($intDataId != $elem['id'])) continue; - // Should this data id to be deleted? - if (isset($_POST[$strChbName]) && ($_POST[$strChbName] == "on")) { - // Check if deletion is possible (relations) - if (($this->infoRelation($strTableName,$elem['id'],"id",1) == 0) || ($intForce == 1)) { - // Delete relations - if (!is_array($arrRelations)) $arrRelations = array(); - foreach($arrRelations AS $rel) { - $strSQL = ""; - // Process flags - $arrFlags = explode(",",$rel['flags']); - // Simple 1:n relation - if ($arrFlags[3] == 1) { - $strSQL = "DELETE FROM `".$rel['tableName1']."` WHERE `".$rel['fieldName']."`=".$elem['id']; - } - // Simple 1:1 relation - if ($arrFlags[3] == 0) { - // Delete relation - if ($arrFlags[2] == 0) { - $strSQL = "DELETE FROM `".$rel['tableName1']."` WHERE `".$rel['fieldName']."`=".$elem['id']; - // Set slave to 0 - } else if ($arrFlags[2] == 2) { - $strSQL = "UPDATE `".$rel['tableName1']."` SET `".$rel['fieldName']."`=0 WHERE `".$rel['fieldName']."`=".$elem['id']; - } - } - // Special 1:n relation for variables - if ($arrFlags[3] == 2) { - $strSQL = "SELECT * FROM `".$rel['tableName1']."` WHERE `idMaster`=".$elem['id']; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn && ($intDataCount != 0)) { - foreach ($arrData AS $vardata) { - $strSQL = "DELETE FROM `tbl_variabledefinition` WHERE `id`=".$vardata['idSlave']; - $booReturn = $this->myDBClass->insertData($strSQL); - } - } - $strSQL = "DELETE FROM `".$rel['tableName1']."` WHERE `idMaster`=".$elem['id']; - } - // Special 1:n relation for time definitions - if ($arrFlags[3] == 3) { - $strSQL = "DELETE FROM `tbl_timedefinition` WHERE `tipId`=".$elem['id']; - $booReturn = $this->myDBClass->insertData($strSQL); - } - if ($strSQL != "") { - $booReturn = $this->myDBClass->insertData($strSQL); - } - } - // Delete host configuration file - if (($strTableName == "tbl_host") && ($this->intDomainId != 0)) { - $strSQL = "SELECT `host_name` FROM `tbl_host` WHERE `id`=".$elem['id']; - $strHost = $this->myDBClass->getFieldData($strSQL); - $arrConfigId = $this->myConfigClass->getConfigSets(); - if ($arrConfigId != 1) { - $intReturn = 0; - foreach($arrConfigId AS $intConfigId) { - $this->myConfigClass->resConnectType = "none"; - $this->resConnectId = ""; - $intReturn += $this->myConfigClass->moveFile("host",$strHost.".cfg",$intConfigId); - } - if ($intReturn == 0) { - $this->processClassMessage(translate('The assigned, no longer used configuration files were deleted successfully!')."::",$strFileMessage); - $this->writeLog(translate('Host file deleted:')." ".$strHost.".cfg"); - } else { - $strFileMessage .= translate('Errors while deleting the old configuration file - please check!:')."::".$this->myConfigClass->strErrorMessage."::"; - } - } - } - // Delete service configuration file - if (($strTableName == "tbl_service") && ($this->intDomainId != 0)) { - $strSQL = "SELECT `config_name` FROM `tbl_service` WHERE `id`=".$elem['id']; - $strService = $this->myDBClass->getFieldData($strSQL); - $strSQL = "SELECT * FROM `tbl_service` WHERE `config_name` = '$strService'"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($intDataCount == 1) { - $arrConfigId = $this->myConfigClass->getConfigSets(); - if ($arrConfigId != 1) { - $intReturn = 0; - foreach($arrConfigId AS $intConfigId) { - $this->myConfigClass->resConnectType = "none"; - $this->resConnectId = ""; - $intReturn += $this->myConfigClass->moveFile("service",$strService.".cfg",$intConfigId); - } - if ($intReturn == 0) { - $this->processClassMessage(translate('The assigned, no longer used configuration files were deleted successfully!')."::",$strFileMessage); - $this->writeLog(translate('Host file deleted:')." ".$strService.".cfg"); - } else { - $strFileMessage .= translate('Errors while deleting the old configuration file - please check!:')."::".$this->myConfigClass->strErrorMessage."::"; - } - } - } - } - // delete main entry - $strSQL = "DELETE FROM `".$strTableName."` WHERE `id`=".$elem['id']; - $booReturn = $this->myDBClass->insertData($strSQL); - $intDeleteCount++; - } - } - } - // Process messages - if ($intDeleteCount == 0) { - $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist, it is protected from deletion, you do not have write permission or it has relations to other configurations which cannot be deleted. Use the "info" function for detailed informations about relations!')."::",$this->strErrorMessage); - return(1); - } else { - $this->updateStatusTable($strTableName); - $this->processClassMessage(translate('Dataset successfully deleted. Affected rows:')." ".$intDeleteCount."::",$this->strInfoMessage); - $this->writeLog(translate('Delete data from table:')." $strTableName ".translate('- with affected rows:')." ".$intDeleteCount); - $this->processClassMessage($strFileMessage,$this->strInfoMessage); - return(0); - } - } else { - $this->processClassMessage(translate('No data deleted. Probably the dataset does not exist, it is protected from deletion or you do not have write permission.')."::".$this->myDBClass->strErrorMessage,$this->strErrorMessage); - return(1); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Copy dataset - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Copies one or more records in a data table. Alternatively, an individual record ID - // are specified, or the values of the $_POST['chbId_n'] variable is used where n - // is the record ID. - // - // Parameters: $strTableName Table name - // $strKeyField Key field of the table - // $_POST[] Form variable (check boxes "chbId_n" n=DBId) - // $intDataId Singe data ID to copy - // $intDomainId Target domain ID - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dataCopyEasy($strTableName,$strKeyField,$intDataId=0,$intDomainId=-1) { - // Get write access groups - $strAccess = $this->myVisClass->getAccGroups('write'); - // Declare variables - $intError = 0; - $intNumber = 0; - if ($intDomainId == -1) $intDomainId = $this->intDomainId; - // Get all data ID from target table - $strAccWhere = "WHERE `access_group` IN ($strAccess)"; - if (($strTableName == "tbl_user") || ($strTableName == "tbl_group")) $strAccWhere = ""; - $booReturn = $this->myDBClass->getDataArray("SELECT `id` FROM `".$strTableName."` $strAccWhere ORDER BY `id`",$arrData,$intDataCount); - if ($booReturn == false) { - $this->processClassMessage(translate('Error while selecting data from database:')."::".$this->myDBClass->strErrorMessage."::",$this->strErrorMessage); - return(1); - } else if ($intDataCount != 0) { - for ($i=0;$i<$intDataCount;$i++) { - // Skip common domain value - if ($arrData[$i]['id'] == 0) continue; - // Build the name of the form variable - $strChbName = "chbId_".$arrData[$i]['id']; - // If a form variable with this name exists or a matching single data ID was passed - if ((isset($_POST[$strChbName]) && ($intDataId == 0)) || ($intDataId == $arrData[$i]['id'])) { - // Get all data of this data ID - $this->myDBClass->getSingleDataset("SELECT * FROM `".$strTableName."` WHERE `id`=".$arrData[$i]['id'],$arrData[$i]); - // Build a temporary config name - for ($y=1;$y<=$intDataCount;$y++) { - $strNewName = $arrData[$i][$strKeyField]." ($y)"; - if (($strTableName == "tbl_user") || ($strTableName == "tbl_group") || ($strTableName == "tbl_datadomain") || ($strTableName == "tbl_configtarget")) { - $booReturn = $this->myDBClass->getFieldData("SELECT `id` FROM `".$strTableName."` WHERE `".$strKeyField."`='$strNewName'"); - } else { - $booReturn = $this->myDBClass->getFieldData("SELECT `id` FROM `".$strTableName."` WHERE `".$strKeyField."`='$strNewName' AND `config_id`=$intDomainId"); - } - // If the name is unused -> break the loop - if ($booReturn == false) break; - } - // Manually overwrite new name for extinfo tables - if ($strTableName == "tbl_hostextinfo") $strNewName="0"; - if ($strTableName == "tbl_serviceextinfo") $strNewName="0"; - // Build the INSERT command based on the table name - $strSQLInsert = "INSERT INTO `".$strTableName."` SET `".$strKeyField."`='$strNewName',"; - foreach($arrData[$i] AS $key => $value) { - if (($key != $strKeyField) && ($key != "active") && ($key != "last_modified") && ($key != "id") && ($key != "config_id")) { - // manually set some NULL values based on field names - if (($key == "normal_check_interval") && ($value == "")) $value="NULL"; - if (($key == "retry_check_interval") && ($value == "")) $value="NULL"; - if (($key == "max_check_attempts") && ($value == "")) $value="NULL"; - if (($key == "low_flap_threshold") && ($value == "")) $value="NULL"; - if (($key == "high_flap_threshold") && ($value == "")) $value="NULL"; - if (($key == "freshness_threshold") && ($value == "")) $value="NULL"; - if (($key == "notification_interval") && ($value == "")) $value="NULL"; - if (($key == "first_notification_delay") && ($value == "")) $value="NULL"; - if (($key == "check_interval") && ($value == "")) $value="NULL"; - if (($key == "retry_interval") && ($value == "")) $value="NULL"; - // manually set some NULL values based on table name - if (($strTableName == "tbl_serviceextinfo") && ($key == "service_description")) $value="0"; - // Do not copy the password in tbl_user - if (($strTableName == "tbl_user") && ($key == "password")) $value="xxxxxxx"; - // Do not copy nodelete and webserver authentification values in tbl_user - if ($key == "nodelete") $value="0"; - if ($key == "wsauth") $value="0"; - // If the data value is not "NULL", add single quotes to the value - if ($value != "NULL") { - $strSQLInsert .= "`".$key."`='".addslashes($value)."',"; - } else { - $strSQLInsert .= "`".$key."`=".$value.","; - } - } - } - if (($strTableName == "tbl_user") || ($strTableName == "tbl_group") || ($strTableName == "tbl_datadomain") || ($strTableName == "tbl_configtarget")) { - $strSQLInsert .= "`active`='0', `last_modified`=NOW()"; - } else { - $strSQLInsert .= "`active`='0', `config_id`=$intDomainId, `last_modified`=NOW()"; - } - // Insert the master dataset - $intCheck = 0; - $booReturn = $this->myDBClass->insertData($strSQLInsert); - $intMasterId = $this->myDBClass->intLastId; - if ($booReturn == false) $intCheck++; - - // Copy relations - if (($this->tableRelations($strTableName,$arrRelations) != 0) && ($intCheck == 0)){ - foreach ($arrRelations AS $elem) { - // Normal 1:n relation - if ($elem['type'] == "2") { - if ($arrData[$i][$elem['fieldName']] != 0) { - $strSQL = "SELECT `idSlave`, `exclude` FROM `".$elem['linkTable']."` WHERE `idMaster` = ".$arrData[$i]['id']; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrRelData,$intRelDataCount); - if ($booReturn && ($intRelDataCount != 0)) { - foreach ($arrRelData AS $elem2) { - $strSQLRel = "INSERT INTO `".$elem['linkTable']."` - SET `idMaster`=$intMasterId, `idSlave`=".$elem2['idSlave'].", `exclude`=".$elem2['exclude']; - $booReturn = $this->myDBClass->insertData($strSQLRel); - if ($booReturn == false) $intCheck++; - } - } - } - // 1:n relation for templates - } else if ($elem['type'] == "3") { - if ($arrData[$i][$elem['fieldName']] == 1) { - $strSQL = "SELECT `idSlave`,`idSort`,`idTable` FROM `".$elem['linkTable']."` WHERE `idMaster`=".$arrData[$i]['id']; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrRelData,$intRelDataCount); - if ($booReturn && ($intRelDataCount != 0)) { - foreach ($arrRelData AS $elem2) { - $strSQLRel = "INSERT INTO `".$elem['linkTable']."` - SET `idMaster`=$intMasterId, `idSlave`=".$elem2['idSlave'].", `idTable`=".$elem2['idTable'].", - `idSort`=".$elem2['idSort']; - $booReturn = $this->myDBClass->insertData($strSQLRel); - if ($booReturn == false) $intCheck++; - } - } - } - // Special relation for free variables - } else if ($elem['type'] == "4") { - if ($arrData[$i][$elem['fieldName']] != 0) { - $strSQL = "SELECT `idSlave` FROM `".$elem['linkTable']."` WHERE `idMaster` = ".$arrData[$i]['id']; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrRelData,$intRelDataCount); - if ($booReturn && ($intRelDataCount != 0)) { - foreach ($arrRelData AS $elem2) { - // Copy variables and link them to the new master - $strSQL_Var = "SELECT * FROM `tbl_variabledefinition` WHERE `id`=".$elem2['idSlave']; - $booReturn = $this->myDBClass->getDataArray($strSQL_Var,$arrData_Var,$intDC_Var); - if ($booReturn && ($intDC_Var != 0)) { - $strSQL_InsVar = "INSERT INTO `tbl_variabledefinition` - SET `name`='".addslashes($arrData_Var[0]['name'])."', `value`='".addslashes($arrData_Var[0]['value'])."', - `last_modified`=NOW()"; - $booReturn = $this->myDBClass->insertData($strSQL_InsVar); - if ($booReturn == false) $intCheck++; - $strSQLRel = "INSERT INTO `".$elem['linkTable']."` - SET `idMaster`=$intMasterId, `idSlave`=".$this->myDBClass->intLastId; - $booReturn = $this->myDBClass->insertData($strSQLRel); - if ($booReturn == false) $intCheck++; - } - } - } - } - // 1:n relation for tbl_lnkServicegroupToService - } else if ($elem['type'] == "5") { - if ($arrData[$i][$elem['fieldName']] != 0) { - $strSQL = "SELECT `idSlaveH`,`idSlaveHG`,`idSlaveS` - FROM `".$elem['linkTable']."` WHERE `idMaster`=".$arrData[$i]['id']; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrRelData,$intRelDataCount); - if ($booReturn && ($intRelDataCount != 0)) { - foreach ($arrRelData AS $elem2) { - $strSQLRel = "INSERT INTO `".$elem['linkTable']."` SET `idMaster`=$intMasterId, - `idSlaveH`=".$elem2['idSlaveH'].",`idSlaveHG`=".$elem2['idSlaveHG'].", - `idSlaveS`=".$elem2['idSlaveS']; - $booReturn = $this->myDBClass->insertData($strSQLRel); - if ($booReturn == false) $intCheck++; - } - } - } - // 1:n relation for services - } else if ($elem['type'] == "6") { - if ($arrData[$i][$elem['fieldName']] != 0) { - $strSQL = "SELECT `idSlave`, `strSlave`, `exclude` - FROM `".$elem['linkTable']."` WHERE `idMaster`=".$arrData[$i]['id']; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrRelData,$intRelDataCount); - if ($booReturn && ($intRelDataCount != 0)) { - foreach ($arrRelData AS $elem2) { - $strSQLRel = "INSERT INTO `".$elem['linkTable']."` - SET `idMaster`=$intMasterId, `idSlave`=".$elem2['idSlave'].", - `strSlave`='".addslashes($elem2['strSlave'])."', `exclude`=".$elem2['exclude']; - $booReturn = $this->myDBClass->insertData($strSQLRel); - if ($booReturn == false) $intCheck++; - } - } - } - } - } - // 1:n relation for time definitions - if ($strTableName == "tbl_timeperiod") { - $strSQL = "SELECT * FROM `tbl_timedefinition` WHERE `tipId`=".$arrData[$i]['id']; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrRelDataTP,$intRelDataCountTP); - if ($intRelDataCountTP != 0) { - foreach ($arrRelDataTP AS $elem) { - $strSQLRel = "INSERT INTO `tbl_timedefinition` (`tipId`,`definition`,`range`,`last_modified`) - VALUES ($intMasterId,'".addslashes($elem['definition'])."','".addslashes($elem['range'])."',now())"; - $booReturn = $this->myDBClass->insertData($strSQLRel); - if ($booReturn == false) $intCheck++; - } - } - } - // 1:n relation for groups - if ($strTableName == "tbl_group") { - $strSQL = "SELECT * FROM `".$elem['linkTable']."` WHERE `idMaster`=".$arrData[$i]['id']; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrRelDataTP,$intRelDataCountTP); - if ($intRelDataCountTP != 0) { - foreach ($arrRelDataTP AS $elem2) { - $strSQLRel = "INSERT INTO `".$elem['linkTable']."` (`idMaster`,`idSlave`,`read`,`write`,`link`) - VALUES ($intMasterId,'".$elem2['idSlave']."','".$elem2['read']."','".$elem2['write']."','".$elem2['link']."')"; - $booReturn = $this->myDBClass->insertData($strSQLRel); - if ($booReturn == false) $intCheck++; - } - } - } - // 1:n relation fot service to host connections - if ($strTableName == "tbl_host") { - $strSQL = "SELECT * FROM `tbl_lnkServiceToHost` WHERE `idSlave`=".$arrData[$i]['id']; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrRelDataSH,$intRelDataCountSH); - if ($intRelDataCountSH != 0) { - foreach ($arrRelDataSH AS $elem2) { - $strSQLRel = "INSERT INTO `tbl_lnkServiceToHost` (`idMaster`,`idSlave`,`exclude`) - VALUES ('".$elem2['idMaster']."',$intMasterId,'".$elem2['exclude']."')"; - $booReturn = $this->myDBClass->insertData($strSQLRel); - if ($booReturn == false) $intCheck++; - } - } - } - } - // Write logfile - if ($intCheck != 0) { - // Error - $intError++; - $this->writeLog(translate('Data set copy failed - table [new name]:')." ".$strTableName." [".$strNewName."]"); - $this->processClassMessage(translate('Data set copy failed - table [new name]:')." ".$strTableName." [".$strNewName."]::",$this->strInfoMessage); - } else { - // Success - $this->writeLog(translate('Data set copied - table [new name]:')." ".$strTableName." [".$strNewName."]"); - $this->processClassMessage(translate('Data set copied - table [new name]:')." ".$strTableName." [".$strNewName."]::",$this->strInfoMessage); - } - $intNumber++; - } - } - // Error processing - if ($intNumber > 0) { - if ($intError == 0) { - // Success - $this->processClassMessage(translate('Data were successfully inserted to the data base!')."::",$this->strInfoMessage); - $this->updateStatusTable($strTableName); - return(0); - } else { - // Error - $this->processClassMessage(translate('Error while inserting the data to the data base:')."::".$this->myDBClass->strErrorMessage,$this->strInfoMessage); - return(1); - } - } else { - $this->processClassMessage(translate('No dataset copied. Maybe the dataset does not exist or you do not have write permission.')."::",$this->strErrorMessage); - return(1); - } - } else { - $this->processClassMessage(translate('No dataset copied. Maybe the dataset does not exist or you do not have write permission.')."::",$this->strErrorMessage); - return(1); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Activate datasets - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Activates one or many datasets in the table be setting 'active' to '1'. Alternatively, - // a single record ID can be specified or evaluated by the values of $_POST['chbId_n'] - // passed parameters, where n is the record ID must match. - // - // This function only modifies the data from a single table! - // - // Parameters: $strTableName table name - // $_POST[] form output (checkboxes "chbId_n" n=DBId) - // $intDataId Individual record ID, which is to be activate - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dataActivate($strTableName,$intDataId = 0) { - // Get write access groups - $strAccess = $this->myVisClass->getAccGroups('write'); - // Activate a single dataset - if ($intDataId != 0) { - $strChbName = "chbId_".$intDataId; - $_POST[$strChbName] = "on"; - } - // Activate datasets - $strSQL = "SELECT `id` FROM `".$strTableName."` WHERE `config_id`=".$this->intDomainId." AND `access_group` IN ($strAccess)"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn && ($intDataCount != 0)) { - $intActivateCount = 0; - foreach ($arrData AS $elem) { - $strChbName = "chbId_".$elem['id']; - // was the current record is marked for activate? - if (isset($_POST[$strChbName]) && ($_POST[$strChbName] == "on")) { - // Update dataset - if (($strTableName == "tbl_service") || ($strTableName == "tbl_host")) { - $strSQL = "UPDATE `".$strTableName."` SET `active`='1', `last_modified`=now() WHERE `id`=".$elem['id']; - } else { - $strSQL = "UPDATE `".$strTableName."` SET `active`='1' WHERE `id`=".$elem['id']; - } - $booReturn = $this->myDBClass->insertData($strSQL); - $intActivateCount++; - } - } - // Process informations - if ($intActivateCount == 0) { - $this->processClassMessage(translate('No dataset activated. Maybe the dataset does not exist, no dataset was selected or you do not have write permission.')."::",$this->strErrorMessage); - return(1); - } else { - $this->updateStatusTable($strTableName); - $this->processClassMessage(translate('Dataset successfully activated. Affected rows:')." ".$intActivateCount."::",$this->strInfoMessage); - $this->writeLog(translate('Activate dataset from table:')." $strTableName ".translate('- with affected rows:')." ".$this->myDBClass->intAffectedRows); - return(0); - } - } else { - $this->processClassMessage(translate('No dataset activated. Maybe the dataset does not exist or you do not have write permission.')."::",$this->strErrorMessage); - return(1); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Deactivate datasets - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Deactivates one or many datasets in the table be setting 'active' to '0'. Alternatively, - // a single record ID can be specified or evaluated by the values of $_POST['chbId_n'] - // passed parameters, where n is the record ID must match. - // - // This function only modifies the data from a single table! - // - // Parameters: $strTableName table name - // $_POST[] form output (checkboxes "chbId_n" n=DBId) - // $intDataId Individual record ID, which is to be activate - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dataDeactivate($strTableName,$intDataId = 0) { - // Get write access groups - $strAccess = $this->myVisClass->getAccGroups('write'); - // Dectivate a single dataset - if ($intDataId != 0) { - $strChbName = "chbId_".$intDataId; - $_POST[$strChbName] = "on"; - } - // Activate datasets - $strSQL = "SELECT `id` FROM `".$strTableName."` WHERE `config_id`=".$this->intDomainId." AND `access_group` IN ($strAccess)"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn && ($intDataCount != 0)) { - $intActivateCount = 0; - foreach ($arrData AS $elem) { - $strChbName = "chbId_".$elem['id']; - // was the current record is marked for activate? - if (isset($_POST[$strChbName]) && ($_POST[$strChbName] == "on")) { - // Verify that the dataset can be deactivated - if ($this->infoRelation($strTableName,$elem['id'],"id",1) == 0) { - // Update dataset - if (($strTableName == "tbl_service") || ($strTableName == "tbl_host")) { - $strSQL = "UPDATE `".$strTableName."` SET `active`='0', `last_modified`=now() WHERE `id`=".$elem['id']; - } else { - $strSQL = "UPDATE `".$strTableName."` SET `active`='0' WHERE `id`=".$elem['id']; - } - $booReturn = $this->myDBClass->insertData($strSQL); - $intActivateCount++; - } - } - } - // Process informations - if ($intActivateCount == 0) { - $this->processClassMessage(translate('No dataset deactivated. Maybe the dataset does not exist, it is protected from deactivation, no dataset was selected or you do not have write permission. Use the "info" function for detailed informations about relations!')."::",$this->strErrorMessage); - return(1); - } else { - $this->updateStatusTable($strTableName); - $this->processClassMessage(translate('Dataset successfully deactivated. Affected rows:')." ".$intActivateCount."::",$this->strInfoMessage); - $this->writeLog(translate('Activate dataset from table:')." $strTableName ".translate('- with affected rows:')." ".$this->myDBClass->intAffectedRows); - return(0); - } - } else { - $this->processClassMessage(translate('No dataset deactivated. Maybe the dataset does not exist or you do not have write permission.')."::",$this->strErrorMessage); - return(1); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Write log book - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Saves a given string to the logbook - // - // Parameters: $strLogMessage Message string - // $_SESSION['username'] User name - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function writeLog($strLogMessage) { - // Write string to database - if (isset($_SERVER) && isset($_SERVER["REMOTE_ADDR"])) { - // Webinterface - $strUserName = (isset($_SESSION['username']) && ($_SESSION['username'] != "")) ? $_SESSION['username'] : "unknown"; - $strDomain = $this->myDBClass->getFieldData("SELECT `domain` FROM `tbl_datadomain` WHERE `id`=".$this->intDomainId); - $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',`time`=NOW(), `ipadress`='".$_SERVER["REMOTE_ADDR"]."', `domain`='$strDomain', `entry`='".addslashes($strLogMessage)."'"); - if ($booReturn == false) return(1); - return(0); - } else { - // Scriptinginterface - $strUserName = "scripting"; - if (isset($_SERVER['USER'])) $strUserName .= " - ".$_SERVER['USER']; - $strDomain = $this->myDBClass->getFieldData("SELECT `domain` FROM `tbl_datadomain` WHERE `id`=".$this->intDomainId); - if (isset($_SERVER["HOSTNAME"])) { - $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',`time`=NOW(), `ipadress`='".$_SERVER["HOSTNAME"]."', `domain`='$strDomain', `entry`='".addslashes($strLogMessage)."'"); - } else if (isset($_SERVER["SSH_CLIENT"])) { - $arrSSHClient = explode(" ",$_SERVER["SSH_CLIENT"]); - $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',`time`=NOW(), `ipadress`='".$arrSSHClient[0]."', `domain`='$strDomain', `entry`='".addslashes($strLogMessage)."'"); - } else { - $booReturn = $this->myDBClass->insertData("INSERT INTO `tbl_logbook` SET `user`='".$strUserName."',`time`=NOW(), `ipadress`='unknown', `domain`='$strDomain', `entry`='".addslashes($strLogMessage)."'"); - } - if ($booReturn == false) return(1); - return(0); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Write relations to the database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Inserts any necessary dataset for an 1:n (optional 1:n:n) relation to the - // database table - // - // Parameters: $strTable Database table name - // $intMasterId Data ID from master table - // $arrSlaveId Array with all data IDs from slave table - // $intMulti 0 = for 1:n relations - // 1 = for 1:n:n relations - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dataInsertRelation($strTable,$intMasterId,$arrSlaveId,$intMulti=0) { - // Walk through the slave data ID array - foreach($arrSlaveId AS $elem) { - // Pass empty and '*' values - if ($elem == '0') continue; - if ($elem == '*') continue; - // Process exclude values - if (substr($elem,0,1) == "e") { - $elem = str_replace("e","",$elem); - $intExclude = 1; - } else { - $intExclude = 0; - } - // Define the SQL statement - if ($intMulti != 0) { - $arrValues = ""; - $arrValues = explode("::",$elem); - $strSQL = "INSERT INTO `".$strTable."` SET `idMaster`=$intMasterId, `idSlaveH`=".$arrValues[0].", - `idSlaveHG`=".$arrValues[1].", `idSlaveS`=".$arrValues[2].", `exclude`=$intExclude"; - } else { - if (($strTable == 'tbl_lnkServicedependencyToService_DS') || - ($strTable == 'tbl_lnkServicedependencyToService_S') || - ($strTable == 'tbl_lnkServiceescalationToService')) { - // Get service description - $strService = $this->myDBClass->getFieldData("SELECT `service_description` FROM `tbl_service` WHERE id=$elem"); - $strSQL = "INSERT INTO `".$strTable."` SET `idMaster`=$intMasterId, `idSlave`=$elem, - `strSlave`='".addslashes($strService)."', `exclude`=$intExclude"; - } else if (($strTable != 'tbl_lnkTimeperiodToTimeperiod') && ($strTable != 'tbl_lnkDatadomainToConfigtarget')) { - $strSQL = "INSERT INTO `".$strTable."` SET `idMaster`=$intMasterId, `idSlave`=$elem, `exclude`=$intExclude"; - } else { - $strSQL = "INSERT INTO `".$strTable."` SET `idMaster`=$intMasterId, `idSlave`=$elem"; - } - } - // Insert data - $intReturn = $this->dataInsert($strSQL,$intDataID); - if ($intReturn != 0) return(1); - } - return(0); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Update relations in the database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Update the datasets for 1:n (optional 1:n:m) relations in the database table - // - // Parameters: $strTable Database table name - // $intMasterId Data ID from master table - // $arrSlaveId Array with all data IDs from slave table - // $intMulti 0 = for 1:n relations - // 1 = for 1:n:n relations - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dataUpdateRelation($strTable,$intMasterId,$arrSlaveId,$intMulti=0) { - // Remove any old relations - $intReturn1 = $this->dataDeleteRelation($strTable,$intMasterId); - if ($intReturn1 != 0) return(1); - // Insert the new relations - $intReturn2 = $this->dataInsertRelation($strTable,$intMasterId,$arrSlaveId,$intMulti); - if ($intReturn2 != 0) return(1); - return(0); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Remove relations from the database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Removes any relation from the database - // - // Parameters: $strTable Database table name - // $intMasterId Data ID from master table - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dataDeleteRelation($strTable,$intMasterId) { - // Define the SQL statement - $strSQL = "DELETE FROM `".$strTable."` WHERE `idMaster`=$intMasterId"; - // Send statement - $intReturn = $this->dataInsert($strSQL,$intDataID); - if ($intReturn != 0) return(1); - return(0); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Scan database for relations - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Searches any relation in the database and returns them as relation information - // - // Parameters: $strTable Database table name - // $intMasterId Data ID from master table - // $strMasterfield Info field name from master table - // $intReporting Output as text - 0=yes, 1=no - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function infoRelation($strTable,$intMasterId,$strMasterfield,$intReporting=0) { - $intReturn = $this->fullTableRelations($strTable,$arrRelations); - $intDeletion = 0; - if ($intReturn == 1) { - // Get master field data - $strNewMasterfield = str_replace(',','`,`',$strMasterfield); - $strSQL = "SELECT `".$strNewMasterfield."` FROM `".$strTable."` WHERE `id` = $intMasterId"; - $this->myDBClass->getSingleDataset($strSQL,$arrSource); - if (substr_count($strMasterfield,",") != 0) { - $arrTarget = explode(",",$strMasterfield); - $strName = $arrSource[$arrTarget[0]]."-".$arrSource[$arrTarget[1]]; - } else { - $strName = $arrSource[$strMasterfield]; - } - $this->strInfoMessage .= "".translate("Relation information for ").$strName.translate(" of table ").$strTable.":::"; - $this->strInfoMessage .= ""; - // Walk through relations - foreach ($arrRelations AS $elem) { - // Process flags - $arrFlags = explode(",",$elem['flags']); - if ($elem['fieldName'] == "check_command") { - $strSQL = "SELECT * FROM `".$elem['tableName1']."` WHERE SUBSTRING_INDEX(`".$elem['fieldName']."`,'!',1)= $intMasterId"; - } else { - $strSQL = "SELECT * FROM `".$elem['tableName1']."` WHERE `".$elem['fieldName']."`= $intMasterId"; - } - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - // Take only used relations - if ($booReturn && ($intDataCount != 0)) { - // Relation type - if ($arrFlags[3] == 1) { - foreach ($arrData AS $data) { - if ($elem['fieldName'] == "idMaster") { - $strRef = "idSlave"; - // Process special tables - if ($elem['target1'] == "tbl_service") { - if ($elem['tableName1'] == "tbl_lnkServicegroupToService") { - $strRef = "idSlaveS"; - } - } else if ($elem['target1'] == "tbl_host") { - if ($elem['tableName1'] == "tbl_lnkServicegroupToService") { - $strRef = "idSlaveH"; - } - } else if ($elem['target1'] == "tbl_hostgroup") { - if ($elem['tableName1'] == "tbl_lnkServicegroupToService") { - $strRef = "idSlaveHG"; - } - } - } else { - $strRef = "idMaster"; - } - // Get data - $strSQL = "SELECT * FROM `".$elem['tableName1']."` - LEFT JOIN `".$elem['target1']."` ON `".$strRef."` = `id` - WHERE `".$elem['fieldName']."` = ".$data[$elem['fieldName']]." - AND `".$strRef."`=".$data[$strRef]; - $this->myDBClass->getSingleDataset($strSQL,$arrDSTarget); - if (substr_count($elem['targetKey'],",") != 0) { - $arrTarget = explode(",",$elem['targetKey']); - $strTarget = $arrDSTarget[$arrTarget[0]]."-".$arrDSTarget[$arrTarget[1]]; - } else { - $strTarget = $arrDSTarget[$elem['targetKey']]; - } - // If the field is market as "required", check for any other entries - if ($arrFlags[0] == 1) { - $strSQL = "SELECT * FROM `".$elem['tableName1']."` - WHERE `".$strRef."` = ".$arrDSTarget[$strRef]; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrDSCount,$intDCCount); - if ($booReturn && ($intDCCount > 1)) { - $this->strInfoMessage .= translate("Relation to ").$elem['target1'].translate(", entry ").$strTarget." - ".translate("deletion possible")."::"; - } else { - $this->strInfoMessage .= translate("Relation to ").$elem['target1'].translate(", entry ").$strTarget." - ".translate("deletion not possible")."::"; - $intDeletion = 1; - } - } else { - $this->strInfoMessage .= translate("Relation to ").$elem['target1'].translate(", entry ").$strTarget." - ".translate("deletion possible")."::"; - } - } - } else if ($arrFlags[3] == 0) { - // Fetch remote entry - $strSQL = "SELECT * FROM `".$elem['tableName1']."` WHERE `".$elem['fieldName']."`=$intMasterId"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrDataCheck,$intDCCheck); - if ($booReturn && ($intDCCheck != 0)) { - foreach ($arrDataCheck AS $data) { - if (substr_count($elem['targetKey'],",") != 0) { - $arrTarget = explode(",",$elem['targetKey']); - $strTarget = $data[$arrTarget[0]]."-".$data[$arrTarget[1]]; - } else { - $strTarget = $data[$elem['targetKey']]; - } - if ($arrFlags[0] == 1) { - $this->strInfoMessage .= translate("Relation to ").$elem['tableName1'].translate(", entry ").$strTarget." - ".translate("deletion not possible")."::"; - $intDeletion = 1; - } else { - $this->strInfoMessage .= translate("Relation to ").$elem['tableName1'].translate(", entry ").$strTarget." - ".translate("deletion possible")."::"; - } - } - } - } - } - } - $this->strInfoMessage .= "::"; - } - if ($intReporting == 1) $this->strInfoMessage = ""; - return($intDeletion); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Update the status table - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Update the date inside the status table (used for last modified date) - // - // Parameters: $strTable Table name - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function updateStatusTable($strTable) { - // Does the entry exist - $strSQL = "SELECT * FROM `tbl_tablestatus` WHERE `tableName`='$strTable' AND `domainId`=".$this->intDomainId; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booReturn && ($intDC != 0)) { - $strSQL = "UPDATE `tbl_tablestatus` SET `updateTime`=NOW() WHERE `tableName`='$strTable' AND `domainId`=".$this->intDomainId; - $booReturn = $this->dataInsert($strSQL,$intDataID); - if ($booReturn) return(0); - } else if ($booReturn) { - $strSQL = "INSERT INTO `tbl_tablestatus` SET `updateTime`=NOW(), `tableName`='$strTable', `domainId`=".$this->intDomainId; - $booReturn = $this->dataInsert($strSQL,$intDataID); - if ($booReturn) return(0); - } - return(1); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Get relation data for a table - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Returns an array of all datafields of a table, which has an 1:1 or 1:n relation - // to anothe table. - // - // Parameters: $strTable Table name - // - // Link type: 1 -> 1:1 Relation - // 2 -> 1:n Relation - // 3 -> 1:n Relation for templates - // 4 -> 1:n Relation for free variables - // - // Return values: $arrRelations Array with relations - // 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function tableRelations($strTable,&$arrRelations) { - // Define variable - $arrRelations = ""; - // Get relation data - $strSQL = "SELECT * FROM tbl_relationinformation WHERE master='$strTable' AND fullRelation=0"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booReturn && ($intDC != 0)) { - foreach ($arrData AS $elem) { - $arrRelations[] = array('tableName1' => $elem['tableName1'], 'tableName2' => $elem['tableName2'], - 'fieldName' => $elem['fieldName'], 'linkTable' => $elem['linkTable'], - 'target1' => $elem['target1'], 'target2' => $elem['target2'], - 'type' => $elem['type']); - } - return(1); - } else { - return(0); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Get full relation data for a table - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Returns an array with any data fields from a table with existing relations to another - // table. This function returns also passive relations which are not used in - // configurations - // - // This function is used for a full deletion of a configuration entry or to find out - // if a configuration is used in another way. - // - // Parameters: $strTable Table name - // - // Data array: tableName Table include the relation data - // fieldName Field name include the relation data - // flags Pos 1 -> 0=Normal field / 1=Required field (field type) - // Pos 2 -> 0=delete / 1=keep data / 2=set to 0 (normal deletion option) - // Pos 3 -> 0=delete / 2=set to 0 (force deletion option) - // Pos 4 -> 0=1:1 / 1=1:n / (relation type) - // 2=1:n (variables) / 3=1:n (timedef) - // - // - // Return values: $arrRelations Array with relations - // 0 = no field with relation - // 1 = at least one field with relation - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function fullTableRelations($strTable,&$arrRelations) { - // Define variable - $arrRelations = ""; - // Get relation data - $strSQL = "SELECT * FROM tbl_relationinformation WHERE master='$strTable' AND fullRelation=1"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booReturn && ($intDC != 0)) { - foreach ($arrData AS $elem) { - $arrRelations[] = array('tableName1' => $elem['tableName1'], 'fieldName' => $elem['fieldName'], - 'target1' => $elem['target1'], 'targetKey' => $elem['targetKey'], - 'flags' => $elem['flags']); - } - return(1); - } else { - return(0); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Update configuration hash - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Updates the hash field im some configuration objects - // - // Parameters: $strTable Table name - // $intId Data ID - // - // Return values: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function updateHash($strTable,$intId) { - $strRawString = ""; - if ($strTable == "tbl_service") { - // Get any hosts and host_groups - $strSQL = "SELECT `host_name` AS `item_name` FROM `tbl_host` LEFT JOIN `tbl_lnkServiceToHost` ON `idSlave`=`id` WHERE `idMaster`=".$intId; - $strSQL .= " UNION SELECT `hostgroup_name` AS `item_name` FROM `tbl_hostgroup` LEFT JOIN `tbl_lnkServiceToHostgroup` ON `idSlave`=`id` - WHERE `idMaster`=".$intId." ORDER BY `item_name`"; - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booRet && ($intDC != 0)) { - foreach ($arrData AS $elem) { - $strRawString .= $elem['item_name'].","; - } - } - $strSQL = "SELECT * FROM `tbl_service` WHERE `id`=".$intId; - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booRet && ($intDC != 0)) { - if ($arrData[0]['service_description'] != "") $strRawString .= $arrData[0]['service_description'].","; - if ($arrData[0]['display_name'] != "") $strRawString .= $arrData[0]['display_name'].","; - if ($arrData[0]['check_command'] != "") { - $arrField = explode("!",$arrData[0]['check_command']); - $strCommand = strchr($arrData[0]['check_command'],"!"); - $strSQLRel = "SELECT `command_name` FROM `tbl_command` - WHERE `id`=".$arrField[0]; - $strName = $this->myDBClass->getFieldData($strSQLRel); - $strRawString .= $strName.$strCommand.","; - } - } - } - if (($strTable == "tbl_hostdependency") || ($strTable == "tbl_servicedependency")) { - // Get * values - $strSQL = "SELECT * FROM `".$strTable."` WHERE `id`=".$intId; - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booRet && ($intDC != 0)) { - if (isset($arrData[0]['dependent_host_name']) && ($arrData[0]['dependent_host_name'] == 2)) $strRawString .= "any,"; - if (isset($arrData[0]['dependent_hostgroup_name']) && ($arrData[0]['dependent_hostgroup_name'] == 2)) $strRawString .= "any,"; - if (isset($arrData[0]['host_name']) && ($arrData[0]['host_name'] == 2)) $strRawString .= "any,"; - if (isset($arrData[0]['hostgroup_name']) && ($arrData[0]['hostgroup_name'] == 2)) $strRawString .= "any,"; - if (isset($arrData[0]['dependent_service_description']) && ($arrData[0]['dependent_service_description'] == 2)) $strRawString .= "any,"; - if (isset($arrData[0]['service_description']) && ($arrData[0]['service_description'] == 2)) $strRawString .= "any,"; - } - if ($strTable == "tbl_hostdependency") { - // Get any hosts and host_groups - $strSQL = "SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` - LEFT JOIN `tbl_lnkHostdependencyToHost_DH` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` - LEFT JOIN `tbl_lnkHostdependencyToHostgroup_DH` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` - LEFT JOIN `tbl_lnkHostdependencyToHost_H` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` - LEFT JOIN `tbl_lnkHostdependencyToHostgroup_H` ON `idSlave`=`id` WHERE `idMaster`=".$intId; - } - if ($strTable == "tbl_servicedependency") { - // Get any hosts and host_groups - $strSQL = "SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` - LEFT JOIN `tbl_lnkServicedependencyToHost_DH` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` - LEFT JOIN `tbl_lnkServicedependencyToHostgroup_DH` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` - LEFT JOIN `tbl_lnkServicedependencyToHost_H` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` - LEFT JOIN `tbl_lnkServicedependencyToHostgroup_H` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `strSlave` AS `item_name`, exclude FROM `tbl_lnkServicedependencyToService_DS` - WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `strSlave` AS `item_name`, exclude FROM `tbl_lnkServicedependencyToService_S` - WHERE `idMaster`=".$intId." "; - } - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booRet && ($intDC != 0)) { - foreach ($arrData AS $elem) { - if ($elem['exclude'] == 0) { - $strRawString .= $elem['item_name'].","; - } else { - $strRawString .= "not_".$elem['item_name'].","; - } - } - $strRawString = substr($strRawString,0,-1); - } - } - if (($strTable == "tbl_hostescalation") || ($strTable == "tbl_serviceescalation")) { - // Get * values - $strSQL = "SELECT * FROM `".$strTable."` WHERE `id`=".$intId; - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booRet && ($intDC != 0)) { - if (isset($arrData[0]['host_name']) && ($arrData[0]['host_name'] == 2)) $strRawString .= "any,"; - if (isset($arrData[0]['hostgroup_name']) && ($arrData[0]['hostgroup_name'] == 2)) $strRawString .= "any,"; - if (isset($arrData[0]['contacts']) && ($arrData[0]['contacts'] == 2)) $strRawString .= "any,"; - if (isset($arrData[0]['contact_groups']) && ($arrData[0]['contact_groups'] == 2)) $strRawString .= "any,"; - if (isset($arrData[0]['service_description']) && ($arrData[0]['service_description'] == 2)) $strRawString .= "any,"; - - } - // Get any hosts, host_groups, contacts and contact_groups - if ($strTable == "tbl_hostescalation") { - $strSQL = "SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` - LEFT JOIN `tbl_lnkHostescalationToHost` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` - LEFT JOIN `tbl_lnkHostescalationToHostgroup` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `contact_name` AS `item_name`, exclude FROM `tbl_contact` - LEFT JOIN `tbl_lnkHostescalationToContact` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `contactgroup_name` AS `item_name`, exclude FROM `tbl_contactgroup` - LEFT JOIN `tbl_lnkHostescalationToContactgroup` ON `idSlave`=`id` WHERE `idMaster`=".$intId; - } - if ($strTable == "tbl_serviceescalation") { - $strSQL = "SELECT `host_name` AS `item_name`, exclude FROM `tbl_host` - LEFT JOIN `tbl_lnkServiceescalationToHost` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `hostgroup_name` AS `item_name`, exclude FROM `tbl_hostgroup` - LEFT JOIN `tbl_lnkServiceescalationToHostgroup` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `contact_name` AS `item_name`, exclude FROM `tbl_contact` - LEFT JOIN `tbl_lnkServiceescalationToContact` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `contactgroup_name` AS `item_name`, exclude FROM `tbl_contactgroup` - LEFT JOIN `tbl_lnkServiceescalationToContactgroup` ON `idSlave`=`id` WHERE `idMaster`=".$intId." "; - $strSQL .= "UNION ALL SELECT `strSlave` AS `item_name`, exclude FROM `tbl_lnkServiceescalationToService` - WHERE `idMaster`=".$intId; - } - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booRet && ($intDC != 0)) { - foreach ($arrData AS $elem) { - if ($elem['exclude'] == 0) { - $strRawString .= $elem['item_name'].","; - } else { - $strRawString .= "not_".$elem['item_name'].","; - } - } - $strRawString = substr($strRawString,0,-1); - } - } - if ($strTable == "tbl_serviceextinfo") { - // Get any hosts and host_groups - $strSQL = "SELECT `tbl_host`.`host_name` AS `item_name` FROM `tbl_host` - LEFT JOIN `tbl_serviceextinfo` ON `tbl_host`.`id`=`tbl_serviceextinfo`.`host_name` WHERE `tbl_serviceextinfo`.`id`=".$intId." "; - $strSQL .= "UNION SELECT `tbl_service`.`service_description` AS `item_name` FROM `tbl_service` - LEFT JOIN `tbl_serviceextinfo` ON `tbl_service`.`id`=`tbl_serviceextinfo`.`service_description` WHERE `tbl_serviceextinfo`.`id`=".$intId." - ORDER BY `item_name`"; - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booRet && ($intDC != 0)) { - foreach ($arrData AS $elem) { - $strRawString .= $elem['item_name'].","; - } - $strRawString = substr($strRawString,0,-1); - } - } - // Remove blanks - while (substr_count($strRawString," ") != 0) { - $strRawString = str_replace(" ","",$strRawString); - } - // Sort hash string - $arrTemp = explode(",",$strRawString); - sort($arrTemp); - $strRawString = implode(",",$arrTemp); - // Update has in database - $strSQL = "UPDATE `".$strTable."` SET `import_hash`='".sha1($strRawString)."' WHERE `id`='$intId'"; - $intReturn = $this->dataInsert($strSQL,$intDataID); - //echo "Hash: ".$strRawString." --> ".sha1($strRawString)."
"; - return($intReturn); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Processing message strings - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Merge message strings and check for duplicate messages - // - // Parameters: $strNewMessage Message to add - // $strSeparate Separate string (
or \n) - // - // Return value: &$strOldMessage Modified message string - // - /////////////////////////////////////////////////////////////////////////////////////////// - function processClassMessage($strNewMessage,&$strOldMessage) { - $strNewMessage = str_replace("::::","::",$strNewMessage); - if (($strOldMessage != "") && ($strNewMessage != "")) { - if (substr_count($strOldMessage,$strNewMessage) == 0) { - $strOldMessage .= $strNewMessage; - } - } else { - $strOldMessage .= $strNewMessage; - } - // Reset message variable (prevent duplicates) - $strNewMessage = ""; - } -} -?> \ No newline at end of file diff --git a/functions/import_class.php b/functions/import_class.php deleted file mode 100644 index edfbe69..0000000 --- a/functions/import_class.php +++ /dev/null @@ -1,1459 +0,0 @@ -arrSettings = $_SESSION['SETS']; - if (isset($_SESSION['domain'])) $this->intDomainId = $_SESSION['domain']; - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Data import from file - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Import a config file and writes the values to the database - // - // Parameters: $strFileName Import file name - // $intConfigId Configuration set id - // $intOverwrite 0 = Do not replace existing data - // 1 = Replace existing data in tables - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function fileImport($strFileName,$intConfigId,$intOverwrite=0) { - // Define variables - $intBlock = 0; - $intRemoveTmp = 0; - $strFileName = trim($strFileName); - $intReturn = $this->myConfigClass->getConfigData($intConfigId,"method",$intMethod); - if ($intReturn != 0) { $this->strErrorMessage .= translate('Unable to get configuration data:')." method::"; return(1); } - // Read import file - // Local file system - if ($intMethod == 1) { - if (!is_readable($strFileName)) { - $this->strErrorMessage .= translate('Cannot open the data file (check the permissions)!')." ".$strFileName."::"; - return(1); - } - // FTP access - } else if ($intMethod == 2) { - // Open ftp connection - $intReturn = $this->myConfigClass->getFTPConnection($intConfigId); - if ($intReturn != 0) { $this->strErrorMessage .= $this->myConfigClass->strErrorMessage; return(1); } - // Transfer file from remote server to a local temp file - if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) { - $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql_imp'); - } else { - $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql_imp'); - } - if (!ftp_get($this->myConfigClass->resConnectId,$strConfigFile,$strFileName,FTP_ASCII)) { - $this->strErrorMessage .= translate('Cannot receive the configuration file (FTP connection)!')."::";; - ftp_close($conn_id); - return(1); - } - $intRemoveTmp = 1; - $strFileName = $strConfigFile; - // SSH Access - } else if ($intMethod == 3) { - // Open ssh connection - $intReturn = $this->myConfigClass->getSSHConnection($intConfigId); - if ($intReturn != 0) { $this->strErrorMessage .= $this->myConfigClass->strErrorMessage; return(1); } - // Transfer file from remote server to a local temp file - if (isset($this->arrSettings['path']) && isset($this->arrSettings['path']['tempdir'])) { - $strConfigFile = tempnam($this->arrSettings['path']['tempdir'], 'nagiosql_imp'); - } else { - $strConfigFile = tempnam(sys_get_temp_dir(), 'nagiosql_imp'); - } - if (!ssh2_scp_recv($this->myConfigClass->resConnectId,$strFileName,$strConfigFile)) { - $this->strErrorMessage .= translate('Cannot receive the configuration file (SSH connection)!')."::";; - return(1); - } - $intRemoveTmp = 1; - $strFileName = $strConfigFile; - } - // Open and read config file - if (file_exists($strFileName) && is_readable($strFileName)) { - $resFile = fopen($strFileName,"r"); - $intMultiple = 0; - while($resFile && !feof($resFile)) { - $strConfLine = fgets($resFile); - // Remove blank chars - $strConfLine = trim($strConfLine); - // Process multi-line configuration instructions - if (substr($strConfLine,-1) == '\\') { - if ($intMultiple == 0) { - $strConfLineTemp = str_replace("\\",",",$strConfLine); - $intMultiple = 1; - } else { - $strConfLineTemp .= str_replace("\\",",",$strConfLine); - } - continue; - } - if ($intMultiple == 1) { - $strConfLine = $strConfLineTemp.$strConfLine; - $intMultiple = 0; - } - // Find NAGIOSQL variable - if (substr_count($strConfLine,"#NAGIOSQL_") != 0) { - $strConfLine = str_replace("#NAGIOSQL_CONFIG_NAME","_NAGIOSQL_CONFIG_NAME",$strConfLine); - } - // Pass comments and empty lines - if (substr($strConfLine,0,1) == "#") continue; - if ($strConfLine == "") continue; - if (($intBlock == 1) && ($strConfLine == "{")) continue; - // Process line (remove blanks and cut comments) - $strLineTmp = str_replace("\;",":semi:",$strConfLine); - $arrLine = preg_split("/[\s]+/", $strLineTmp); - $arrTemp = explode(";",implode(" ",$arrLine)); - $strNewLine = trim($arrTemp[0]); - $strNewLine = str_replace(":semi:","\;",$strNewLine); - // Find block begin - if ($arrLine[0] == "define") { - $intBlock = 1; - $strBlockKey = str_replace("{","",$arrLine[1]); - $arrData = ""; - continue; - } - // Store the block data to an array - if (($intBlock == 1) && ($arrLine[0] != "}")) { - $strExclude = "template_name,alias,name,use"; - if (($strBlockKey == "timeperiod") && (!in_array($arrLine[0],explode(",",$strExclude)))) { - $arrNewLine = explode(" ",$strNewLine); - $strTPKey = str_replace(" ".$arrNewLine[count($arrNewLine)-1],"",$strNewLine); - $strTPValue = $arrNewLine[count($arrNewLine)-1]; - $arrData[$strTPKey] = array("key" => $strTPKey, - "value" => $strTPValue); - } else { - $key = $arrLine[0]; - $value = str_replace($arrLine[0]." ","",$strNewLine); - // Special retry_check_interval, normal_check_interval - if ($key == "retry_check_interval") $key = "retry_interval"; - if ($key == "normal_check_interval") $key = "check_interval"; - $arrData[$arrLine[0]] = array("key" => $key, "value" => $value); - } - } - // Process data at end of block - if ((substr_count($strConfLine,"}") == 1) && (isset($arrData)) && (is_array($arrData))) { - $intBlock = 0; - $intReturn = $this->importTable($strBlockKey,$arrData,$intOverwrite,$strFileName); - if ($intReturn != 0) { if ($intRemoveTmp == 1) unlink($strFileName); return(1); } - } else if (!isset($arrData)) { - $this->strErrorMessage .= translate('No valid configuration found:')." ".$strFileName."::"; - if ($intRemoveTmp == 1) unlink($strFileName); - return(1); - } - } - if ($intRemoveTmp == 1) { - unlink($strFileName); - } - } else { - $this->strErrorMessage .= translate('Import file does not exist or is not readable:')." ".$strFileName."::";; - return(1); - } - return(0); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Import table - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Writes the block data to the database - // - // Parameters: $strBlockKey Config key (from define) - // $arrImportData Imported block data - // $strFileName Name of config file - // $intOverwrite 0 = Do not replace existing data - // 1 = Replace existing data in tables - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function importTable($strBlockKey,$arrImportData,$intOverwrite,$strFileName) { - // Define variables - $intExists = 0; - $intInsertRelations = 0; - $intInsertVariables = 0; - $intIsTemplate = 0; - $strVCValues = ""; - $strRLValues = ""; - $strVWValues = ""; - $strVIValues = ""; - $intWriteConfig = 0; - $strWhere = ""; - $strSkip = ""; - $this->strList1 = ""; - $this->strList2 = ""; - // Block data from template or real configuration? - if (array_key_exists("name",$arrImportData) && (isset($arrImportData['register']) && ($arrImportData['register']['value'] == 0))) { - $intIsTemplate = 1; - } - // Define table name - if ($intIsTemplate == 0) { - switch($strBlockKey) { - case "command": $strTable = "tbl_command"; $strKeyField = "command_name"; break; - case "contactgroup": $strTable = "tbl_contactgroup"; $strKeyField = "contactgroup_name"; break; - case "contact": $strTable = "tbl_contact"; $strKeyField = "contact_name"; break; - case "timeperiod": $strTable = "tbl_timeperiod"; $strKeyField = "timeperiod_name"; break; - case "host": $strTable = "tbl_host"; $strKeyField = "host_name"; break; - case "service": $strTable = "tbl_service"; $strKeyField = ""; break; - case "hostgroup": $strTable = "tbl_hostgroup"; $strKeyField = "hostgroup_name"; break; - case "servicegroup": $strTable = "tbl_servicegroup"; $strKeyField = "servicegroup_name"; break; - case "hostescalation": $strTable = "tbl_hostescalation"; $strKeyField = ""; break; - case "serviceescalation": $strTable = "tbl_serviceescalation"; $strKeyField = ""; break; - case "hostdependency": $strTable = "tbl_hostdependency"; $strKeyField = ""; break; - case "servicedependency": $strTable = "tbl_servicedependency"; $strKeyField = ""; break; - case "hostextinfo": $strTable = "tbl_hostextinfo"; $strKeyField = "host_name"; break; - case "serviceextinfo": $strTable = "tbl_serviceextinfo"; $strKeyField = ""; break; - } - } else { - switch($strBlockKey) { - case "contact": $strTable = "tbl_contacttemplate"; $strKeyField = "name"; break; - case "host": $strTable = "tbl_hosttemplate"; $strKeyField = "name"; break; - case "service": $strTable = "tbl_servicetemplate"; $strKeyField = "name"; break; - } - } - if (!isset($strTable) || ($strTable == "")) { - $this->strErrorMessage .= translate('Table for import definition').$strBlockKey.translate('is not available!')."::";; - return(1); - } - - // Create an import hash if no key field is available - if ($strKeyField == "") { - $this->createHash($strTable,$arrImportData,$strHash,$strConfigName); - $arrImportData['config_name']['key'] = "config_name"; - $arrImportData['config_name']['value'] = $strConfigName; - $strKeyField = "config_name"; - } else { - $strHash = ""; - } - - // Get relation data - $intRelation = $this->myDataClass->tableRelations($strTable,$arrRelations); - // Does this entry already exist? - if ($intIsTemplate == 0) { - if (($strKeyField != "") && isset($arrImportData[$strKeyField])) { - if ($strHash == "") { - // Special key field values - if ($strBlockKey == "hostextinfo") { - $strSQL = "SELECT `id`FROM `tbl_host` WHERE `host_name`='".$arrImportData[$strKeyField]['value']."'"; - $intHost = $this->myDBClass->getFieldData($strSQL)+0; - $strSQL = "SELECT `id` FROM `".$strTable."` - WHERE `config_id`=".$this->intDomainId." AND `".$strKeyField."`='".$intHost."'"; - - } else { - $strSQL = "SELECT `id` FROM `".$strTable."` - WHERE `config_id`=".$this->intDomainId." AND `".$strKeyField."`='".$arrImportData[$strKeyField]['value']."'"; - } - } else { - $strSQL = "SELECT `id` FROM `".$strTable."` - WHERE `config_id`=".$this->intDomainId." AND `import_hash`='".$strHash."'"; - } - $intExists = $this->myDBClass->getFieldData($strSQL); - if ($intExists == false) $intExists = 0; - } - } else { - if (($strKeyField != "") && isset($arrImportData['name'])) { - $strSQL = "SELECT `id` FROM `".$strTable."` - WHERE `config_id`=".$this->intDomainId." AND `template_name`='".$arrImportData['name']['value']."'"; - $intExists = $this->myDBClass->getFieldData($strSQL); - if ($intExists == false) $intExists = 0; - } - } - // Entry exsists but should not be overwritten - if (($intExists != 0) && ($intOverwrite == 0)) { - if ($strKeyField == 'config_name') { - $strSQLConfig = "SELECT `config_name` FROM `".$strTable."` WHERE `id`=".$intExists; - $arrImportData[$strKeyField]['value'] = $this->myDBClass->getFieldData($strSQLConfig); - } - $this->strInfoMessage .= translate('Entry')." ".$strKeyField." -> ".$arrImportData[$strKeyField]['value']." ".translate('inside')." ".$strTable." ".translate('exists and were not overwritten')."::"; - return(0); - } - // Do not write "*" values - if (isset($arrImportData[$strKeyField]) && ($arrImportData[$strKeyField] == "*")) { - $this->strInfoMessage .= translate('Entry')." ".$strKeyField." -> ".$arrImportData[$strKeyField]['value']." ".translate('inside')." ".$strTable." ".translate('were not written')."::"; - return(0); - } - // Activate entry - $intActive = 1; - - // Define SQL statement - part 1 - if ($strHash == "") {$strHash = "";} else {$strHash = " `import_hash`='".$strHash."', ";} - if ($intExists != 0) { - // Update database - $strSQL1 = "UPDATE `".$strTable."` SET "; - $strSQL2 = " `config_id`=".$this->intDomainId.", $strHash `active`='$intActive', `last_modified`=NOW() WHERE `id`=$intExists"; - // Keep config name while update - if (($strKeyField == 'config_name') && (!isset($arrImportData['_NAGIOSQL_CONFIG_NAME']))) { - $strSQLConfig = "SELECT `config_name` FROM `".$strTable."` WHERE `id`=".$intExists; - $arrImportData['config_name']['value'] = $this->myDBClass->getFieldData($strSQLConfig); - } - // Remove free variables - if ($intRelation != 0) { - foreach ($arrRelations AS $relVar) { - if ($relVar['type'] == 4) { - $strSQL = "SELECT * FROM `".$relVar['linkTable']."` WHERE `idMaster`=$intExists"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn && ($intDataCount != 0)) { - foreach ($arrData AS $elem) { - $strSQL = "DELETE FROM `tbl_variabledefinition` WHERE `id`=".$elem['idSlave']; - $booReturn = $this->myDataClass->dataInsert($strSQL,$intInsertId); - } - } - $strSQL = "DELETE FROM `".$relVar['linkTable']."` WHERE `idMaster`=$intExists"; - $booReturn = $this->myDataClass->dataInsert($strSQL,$intInsertId); - } - } - } - } else { - // DB Eintrag einfügen - $strSQL1 = "INSERT INTO `".$strTable."` SET "; - $strSQL2 = " `config_id`=".$this->intDomainId.", $strHash `active`='$intActive', `last_modified`=NOW()"; - } - - // Description for the values - // -------------------------- - // $strVCValues = Simple text values, will be stored as varchar / null = 'null' as text value / empty = '' - // $strRLValues = Relations - values with relations to other tables - // $strVWValues = Integer values - will be stored as INT values / null = -1, / empty values as NULL - // $strVIValues = Decision values 0 = no, 1 = yes, 2 = skip, 3 = null - - // Read command configurations - if ($strKeyField == "command_name") { - $strVCValues = "command_name,command_line"; - // Find out command type - if (isset($arrImportData['command_line'])) { - if ((substr_count($arrImportData['command_line']['value'],"ARG1") != 0) || - (substr_count($arrImportData['command_line']['value'],"USER1") != 0)) { - $strSQL1 .= "`command_type` = 1,"; - } else { - $strSQL1 .= "`command_type` = 2,"; - } - } - $intWriteConfig = 1; - - // Read contact configurations - } else if ($strKeyField == "contact_name") { - $strVCValues = "contact_name,alias,host_notification_options,service_notification_options,email,"; - $strVCValues .= "pager,address1,address2,address3,address4,address5,address6,name"; - - $strVIValues = "host_notifications_enabled,service_notifications_enabled,can_submit_commands,retain_status_information,"; - $strVIValues .= "retain_nonstatus_information"; - - $strRLValues = "contactgroups,host_notification_period,service_notification_period,host_notification_commands,"; - $strRLValues .= "service_notification_commands,use"; - $intWriteConfig = 1; - - // Read contactgroup configurations - } else if ($strKeyField == "contactgroup_name") { - $strVCValues = "contactgroup_name,alias"; - - $strRLValues = "members,contactgroup_members"; - $intWriteConfig = 1; - - // Read timeperiod configurations - } else if ($strKeyField == "timeperiod_name") { - $strVCValues = "timeperiod_name,alias,name"; - - $strRLValues = "use,exclude"; - $intWriteConfig = 1; - - // Read contacttemplate configurations - } else if (($strKeyField == "name") && ($strTable == "tbl_contacttemplate")) { - $strVCValues = "contact_name,alias,host_notification_options,service_notification_options,email,"; - $strVCValues .= "pager,address1,address2,address3,address4,address5,address6,name"; - - $strVIValues = "host_notifications_enabled,service_notifications_enabled,can_submit_commands,retain_status_information,"; - $strVIValues .= "retain_nonstatus_information"; - - $strRLValues = "contactgroups,host_notification_period,service_notification_period,host_notification_commands,"; - $strRLValues .= "service_notification_commands,use"; - $intWriteConfig = 1; - - // Read host configurations - } else if ($strTable == "tbl_host") { - $strVCValues = "host_name,alias,display_name,address,initial_state,flap_detection_options,notification_options,"; - $strVCValues .= "stalking_options,notes,notes_url,action_url,icon_image,icon_image_alt,vrml_image,statusmap_image,"; - $strVCValues .= "2d_coords,3d_coords,name"; - - $strVWValues = "max_check_attempts,retry_interval,check_interval,freshness_threshold,low_flap_threshold,"; - $strVWValues .= "high_flap_threshold,notification_interval,first_notification_delay,"; - - $strVIValues = "active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,event_handler_enabled,"; - $strVIValues .= "flap_detection_enabled,process_perf_data,retain_status_information,retain_nonstatus_information,"; - $strVIValues .= "notifications_enabled"; - - $strRLValues = "parents,hostgroups,check_command,use,check_period,event_handler,contacts,contact_groups,"; - $strRLValues .= "notification_period"; - $intWriteConfig = 1; - - // Read hosttemplate configurations - } else if (($strKeyField == "name") && ($strTable == "tbl_hosttemplate")) { - $strVCValues = "template_name,alias,initial_state,flap_detection_options,notification_options,"; - $strVCValues .= "stalking_options,notes,notes_url,action_url,icon_image,icon_image_alt,vrml_image,statusmap_image,"; - $strVCValues .= "2d_coords,3d_coords,name"; - - $strVWValues = "max_check_attempts,retry_interval,check_interval,freshness_threshold,low_flap_threshold,"; - $strVWValues .= "high_flap_threshold,notification_interval,first_notification_delay,"; - - $strVIValues = "active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,event_handler_enabled,"; - $strVIValues .= "flap_detection_enabled,process_perf_data,retain_status_information,retain_nonstatus_information,"; - $strVIValues .= "notifications_enabled"; - - $strRLValues = "parents,hostgroups,check_command,use,check_period,event_handler,contacts,contact_groups,"; - $strRLValues .= "notification_period"; - $intWriteConfig = 1; - - // Read hostgroup configurations - } else if ($strKeyField == "hostgroup_name") { - $strVCValues = "hostgroup_name,alias,notes,notes_url,action_url"; - - $strRLValues = "members,hostgroup_members"; - $intWriteConfig = 1; - - // Read service configurations - } else if ($strTable == "tbl_service") { - $strVCValues = "service_description,display_name,initial_state,flap_detection_options,stalking_options,notes,notes_url,"; - $strVCValues .= "action_url,icon_image,icon_image_alt,name,config_name,notification_options"; - - $strVWValues = "max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,"; - $strVWValues .= "high_flap_threshold,notification_interval,first_notification_delay"; - - $strVIValues = "is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,obsess_over_service,"; - $strVIValues .= "check_freshness,event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,"; - $strVIValues .= "retain_nonstatus_information,notifications_enabled"; - - $strRLValues = "host_name,hostgroup_name,servicegroups,use,check_command,check_period,event_handler,notification_period,contacts,contact_groups"; - $intWriteConfig = 1; - - // Read servicetemplate configurations - } else if (($strKeyField == "name") && ($strTable == "tbl_servicetemplate")) { - $strVCValues = "template_name,service_description,display_name,initial_state,flap_detection_options,stalking_options,notes,notes_url,"; - $strVCValues .= "action_url,icon_image,icon_image_alt,name,notification_options"; - - $strVWValues = "max_check_attempts,check_interval,retry_interval,freshness_threshold,low_flap_threshold,"; - $strVWValues .= "high_flap_threshold,notification_interval,first_notification_delay"; - - $strVIValues = "is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,obsess_over_service,"; - $strVIValues .= "check_freshness,event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,"; - $strVIValues .= "retain_nonstatus_information,notifications_enabled"; - - $strRLValues = "host_name,hostgroup_name,servicegroups,use,check_command,check_period,event_handler,notification_period,contacts,contact_groups"; - $intWriteConfig = 1; - - // Read servicegroup configurations - } else if ($strKeyField == "servicegroup_name") { - $strVCValues = "servicegroup_name,alias,notes,notes_url,action_url"; - - $strRLValues = "members,servicegroup_members"; - $intWriteConfig = 1; - - // Read hostdependency configurations - } else if ($strTable == "tbl_hostdependency") { - $strVCValues = "config_name,execution_failure_criteria,notification_failure_criteria"; - - $strVIValues = "inherits_parent"; - - $strRLValues = "dependent_host_name,dependent_hostgroup_name,host_name,hostgroup_name,dependency_period"; - $intWriteConfig = 1; - - // Read hostescalation configurations - } else if ($strTable == "tbl_hostescalation") { - $strVCValues = "config_name,escalation_options"; - - $strVWValues = "first_notification,last_notification,notification_interval"; - - $strRLValues = "host_name,hostgroup_name,contacts,contact_groups,escalation_period"; - $intWriteConfig = 1; - - // Read hostextinfo configurations - } else if ($strTable == "tbl_hostextinfo") { - $strVCValues = "notes,notes_url,action_url,icon_image,icon_image_alt,vrml_image,statusmap_image,2d_coords,3d_coords"; - - $strRLValues = "host_name"; - $intWriteConfig = 1; - - // Read servicedependency configurations - } else if ($strTable == "tbl_servicedependency") { - $strVCValues = "config_name,execution_failure_criteria,notification_failure_criteria"; - - $strVIValues = "inherits_parent"; - - $strRLValues = "dependent_host_name,dependent_hostgroup_name,dependent_service_description,host_name,"; - $strRLValues .= "hostgroup_name,dependency_period,service_description,dependent_servicegroup_name,servicegroup_name"; - $intWriteConfig = 1; - - // Read serviceescalation configurations - } else if ($strTable == "tbl_serviceescalation") { - $strVCValues = "config_name,escalation_options"; - - $strVIValues = "first_notification,last_notification,notification_interval"; - - $strRLValues = "host_name,hostgroup_name,contacts,contact_groups,service_description,escalation_period,servicegroup_name"; - $intWriteConfig = 1; - - // Serviceextinfo configurations - } else if ($strTable == "tbl_serviceextinfo") { - $strVCValues = "notes,notes_url,action_url,icon_image,icon_image_alt"; - - $strRLValues = "host_name,service_description"; - $intWriteConfig = 1; - } - - // Common values (all configurations) - if ($strVWValues == "") { $strVWValues = "register"; } else { $strVWValues .= ",register"; } - - // Build value statemets - foreach ($arrImportData AS $elem) { - // Decompose command - if ($elem['key'] == "check_command") { - $arrValues = explode("!",$elem['value']); - } - $intCheck = 0; - // Write text values - if (in_array($elem['key'],explode(",",$strVCValues))) { - if (strtolower(trim($elem['value'])) == "null") { - $strSQL1 .= "`".$elem['key']."` = 'null',"; - } else { - $elem['value'] = addslashes($elem['value']); - if ($intIsTemplate == 1) { - if ($elem['key'] == "name") { - $strSQL1 .= "template_name = '".$elem['value']."',"; - } else if (($elem['key'] == "config_name") && ($intExists != 0)) { - // Do not overwrite config_names during an update! - $strSQLConfig = "SELECT `config_name` FROM `".$strTable."` WHERE `id`=".$intExists; - $elem['value'] = $this->myDBClass->getFieldData($strSQLConfig); - $strSQL1 .= "`".$elem['key']."` = '".$elem['value']."',"; - } else { - $strSQL1 .= "`".$elem['key']."` = '".$elem['value']."',"; - } - } else { - $strSQL1 .= "`".$elem['key']."` = '".$elem['value']."',"; - } - } - $intCheck = 1; - } - // Write status values - if (in_array($elem['key'],explode(",",$strVIValues))) { - if (strtolower(trim($elem['value'])) == "null") { - $strSQL1 .= "`".$elem['key']."` = 3,"; - } else { - $strSQL1 .= "`".$elem['key']."` = '".$elem['value']."',"; - } - $intCheck = 1; - } - // Write integer values - if (in_array($elem['key'],explode(",",$strVWValues))) { - if (strtolower(trim($elem['value'])) == "null") { - $strSQL1 .= "`".$elem['key']."` = -1,"; - } else { - $strSQL1 .= "`".$elem['key']."` = '".$elem['value']."',"; - } - $intCheck = 1; - } - // Write relations - if (($intCheck == 0) && (in_array($elem['key'],explode(",",$strRLValues)))) { - if ($elem['key'] == "use") $elem['key'] = "use_template"; - $arrTemp = ""; - $arrTemp['key'] = $elem['key']; - $arrTemp['value'] = $elem['value']; - $arrImportRelations[] = $arrTemp; - $intInsertRelations = 1; - $intCheck = 1; - } - // Write free variables - if ($intCheck == 0) { - if (!in_array($elem['key'],explode(",",$strSkip))) { - $arrTemp = ""; - $arrTemp['key'] = $elem['key']; - $arrTemp['value'] = $elem['value']; - $arrFreeVariables[] = $arrTemp; - $intInsertVariables = 1; - } - } - } - $strTemp1 = ""; - $strTemp2 = ""; - // Update database - if ($intWriteConfig == 1) { - $booResult = $this->myDBClass->insertData($strSQL1.$strSQL2); - } else { - $booResult = false; - } - if ($strKeyField == "") {$strKey = $strConfigName;} else {$strKey = $strKeyField;} - if ($booResult != true) { - $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - if ($strKeyField != "") $this->strErrorMessage .= translate('Entry')." ".$strKey." -> ".$arrImportData[$strKeyField]['value']." ".translate('inside')." ".$strTable." ".translate('could not be inserted:')." ".$this->myDBClass->strErrorMessage."::"; - if ($strKeyField == "") $this->strErrorMessage .= translate('Entry')." ".$strTemp1." -> ".$strTemp2.translate('inside')." ".$strTable." ".$strTable." ".translate('could not be inserted:')." ".$this->myDBClass->strErrorMessage."::"; - return(1); - } else { - if ($strKeyField != "") $this->strInfoMessage .= translate('Entry')." ".$strKey." -> ".$arrImportData[$strKeyField]['value']." ".translate('inside')." ".$strTable." ".translate('successfully inserted')."::"; - if ($strKeyField == "") $this->strInfoMessage .= translate('Entry')." ".$strTemp1." -> ".$strTemp2." ".translate('inside')." ".$strTable." ".translate('successfully inserted')."::"; - // Define data ID - if ($intExists != 0) { - $intDatasetId = $intExists; - } else { - $intDatasetId = $this->myDBClass->intLastId; - } - // Are there any relations to be filled in? - if ($intInsertRelations == 1) { - foreach ($arrImportRelations AS $elem) { - foreach ($arrRelations AS $reldata) { - if ($reldata['fieldName'] == $elem['key']) { - if ($elem['key'] == "check_command") { - $this->writeRelation_5($elem['key'],$elem['value'],$intDatasetId,$strTable,$reldata); - } else if ($reldata['type'] == 1) { - $this->writeRelation_1($elem['key'],$elem['value'],$intDatasetId,$strTable,$reldata,$arrImportData); - } else if ($reldata['type'] == 2) { - $this->writeRelation_2($elem['key'],$elem['value'],$intDatasetId,$strTable,$reldata); - } else if ($reldata['type'] == 3) { - $this->writeRelation_3($elem['key'],$elem['value'],$intDatasetId,$strTable,$reldata); - } else if ($reldata['type'] == 4) { - $this->writeRelation_4($elem['key'],$elem['value'],$intDatasetId,$strTable,$reldata); - } else if ($reldata['type'] == 5) { - $this->writeRelation_6($elem['key'],$elem['value'],$intDatasetId,$strTable,$reldata); - } else if ($reldata['type'] == 6) { - $this->writeRelation_7($elem['key'],$elem['value'],$intDatasetId,$strTable,$reldata); - } - } - } - } - } - // Are there any free variables ore time definitions to be filled in? - if ($intInsertVariables == 1) { - if ($strTable == "tbl_timeperiod") { - // Remove old values - $strSQL = "DELETE FROM `tbl_timedefinition` WHERE `tipId` = $intDatasetId"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - foreach ($arrFreeVariables AS $elem) { - $strSQL = "INSERT INTO `tbl_timedefinition` SET `tipId` = $intDatasetId, - `definition` = '".addslashes($elem['key'])."', `range` = '".addslashes($elem['value'])."'"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } - } else { - foreach ($arrFreeVariables AS $elem) { - foreach ($arrRelations AS $reldata) { - if ($reldata['type'] == 4) { - $this->writeRelation_4($elem['key'],$elem['value'],$intDatasetId,$strTable,$reldata); - } - } - } - } - } - // Update Table times - $this->myDataClass->updateStatusTable($strTable); - return(0); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Create HASH - /////////////////////////////////////////////////////////////////////////////////////////// - function createHash($strTable,$arrBlockData,&$strHash,&$strConfigName) { - $strRawString = ""; - $strConfigName = "imp_temporary"; - if ($strTable == "tbl_service") { - // HASH from any host, any hostgroup and service description - step 1 - if (isset($arrBlockData['host_name'])) $strRawString .= $arrBlockData['host_name']['value'].","; - if (isset($arrBlockData['hostgroup_name'])) $strRawString .= $arrBlockData['hostgroup_name']['value'].","; - // Replace *, + and ! in HASH raw string - $strRawString = str_replace("*,","any,",$strRawString); - $strRawString = str_replace("!","not_",$strRawString); - $strRawString = str_replace("+","",$strRawString); - // Create configuration name from NagiosQL variable if exists - if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) { - $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value']; - } else { - // Create configuration name from first two hosts / hostgroups - $arrConfig = explode(",",$strRawString); - if (isset($arrConfig[0]) && ($arrConfig[0] != "")) $strConfigName = "imp_".$arrConfig[0]; - if (isset($arrConfig[1]) && ($arrConfig[1] != "")) $strConfigName .= "_".$arrConfig[1]; - } - // HASH from any host, any hostgroup and service description - step 2 - if (isset($arrBlockData['service_description'])) $strRawString .= $arrBlockData['service_description']['value'].","; - if (isset($arrBlockData['display_name'])) $strRawString .= $arrBlockData['display_name']['value'].","; - if (isset($arrBlockData['check_command'])) $strRawString .= $arrBlockData['check_command']['value'].","; - } - if (($strTable == "tbl_hostdependency") || ($strTable == "tbl_servicedependency")) { - $strRawString1 = ""; - $strRawString2 = ""; - $strRawString3 = ""; - // HASH from any dependent host and any dependent hostgroup - if (isset($arrBlockData['dependent_host_name'])) $strRawString1 .= $arrBlockData['dependent_host_name']['value'].","; - if (isset($arrBlockData['dependent_hostgroup_name'])) $strRawString1 .= $arrBlockData['dependent_hostgroup_name']['value'].","; - if (isset($arrBlockData['host_name'])) $strRawString2 .= $arrBlockData['host_name']['value'].","; - if (isset($arrBlockData['hostgroup_name'])) $strRawString2 .= $arrBlockData['hostgroup_name']['value'].","; - if (isset($arrBlockData['dependent_service_description'])) $strRawString3 .= $arrBlockData['dependent_service_description']['value'].","; - if (isset($arrBlockData['service_description'])) $strRawString3 .= $arrBlockData['service_description']['value'].","; - if (isset($arrBlockData['dependent_servicegroup_name'])) $strRawString3 .= $arrBlockData['dependent_servicegroup_name']['value'].","; - if (isset($arrBlockData['servicegroup_name'])) $strRawString3 .= $arrBlockData['servicegroup_name']['value'].","; - // Replace *, + and ! in HASH raw string - $strRawString1 = str_replace("*,","any,",$strRawString1); - $strRawString2 = str_replace("*,","any,",$strRawString2); - $strRawString3 = str_replace("*,","any,",$strRawString3); - $strRawString1 = str_replace("!","not_",$strRawString1); - $strRawString2 = str_replace("!","not_",$strRawString2); - $strRawString3 = str_replace("!","not_",$strRawString3); - // Create configuration name from NagiosQL variable if exists - if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) { - $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value']; - } else { - $arrConfig1 = explode(",",$strRawString1); - $arrConfig2 = explode(",",$strRawString2); - $arrConfig3 = explode(",",$strRawString3); - if (isset($arrConfig1[0])) $strConfigName = "imp_".$arrConfig1[0]; - if (isset($arrConfig2[0])) $strConfigName .= "_".$arrConfig2[0]; - if (isset($arrConfig3[0])) $strConfigName .= "_".$arrConfig3[0]; - $strSQL = "SELECT * FROM `".$strTable."` WHERE `config_name`='$strConfigName'"; - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booRet && ($intDC != 0)) { - $intCounter = 1; - do { - $strConfigNameTemp = $strConfigName."_".$intCounter; - $strSQL = "SELECT * FROM `".$strTable."` WHERE `config_name`='$strConfigNameTemp'"; - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - $intCounter++; - } while ($booRet && ($intDC != 0)); - $strConfigName = $strConfigNameTemp; - } - } - // HASH string - $strRawString = $strRawString1.$strRawString2.$strRawString3; - $strRawString = substr($strRawString,0,-1); - } - if (($strTable == "tbl_hostescalation") || ($strTable == "tbl_serviceescalation")) { - $strRawString1 = ""; - $strRawString2 = ""; - $strRawString3 = ""; - // HASH from any host and any hostgroup - if (isset($arrBlockData['host_name'])) $strRawString1 .= $arrBlockData['host_name']['value'].","; - if (isset($arrBlockData['hostgroup_name'])) $strRawString1 .= $arrBlockData['hostgroup_name']['value'].","; - if (isset($arrBlockData['contacts'])) $strRawString2 .= $arrBlockData['contacts']['value'].","; - if (isset($arrBlockData['contact_groups'])) $strRawString2 .= $arrBlockData['contact_groups']['value'].","; - if (isset($arrBlockData['service_description'])) $strRawString3 .= $arrBlockData['service_description']['value'].","; - // Replace *, + and ! in HASH raw string - $strRawString1 = str_replace("*,","any,",$strRawString1); - $strRawString2 = str_replace("*,","any,",$strRawString2); - $strRawString3 = str_replace("*,","any,",$strRawString3); - $strRawString1 = str_replace("!","not_",$strRawString1); - $strRawString2 = str_replace("!","not_",$strRawString2); - $strRawString3 = str_replace("!","not_",$strRawString3); - // Create configuration name from NagiosQL variable if exists - if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) { - $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value']; - } else { - $arrConfig1 = explode(",",$strRawString1); - $arrConfig2 = explode(",",$strRawString2); - $arrConfig3 = explode(",",$strRawString3); - if (isset($arrConfig1[0])) $strConfigName = "imp_".$arrConfig1[0]; - if (isset($arrConfig2[0])) $strConfigName .= "_".$arrConfig2[0]; - if (isset($arrConfig3[0])) $strConfigName .= "_".$arrConfig3[0]; - $strSQL = "SELECT * FROM `".$strTable."` WHERE `config_name`='$strConfigName'"; - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - if ($booRet && ($intDC != 0)) { - $intCounter = 1; - do { - $strConfigNameTemp = $strConfigName."_".$intCounter; - $strSQL = "SELECT * FROM `".$strTable."` WHERE `config_name`='$strConfigNameTemp'"; - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDC); - $intCounter++; - } while ($booRet && ($intDC != 0)); - $strConfigName = $strConfigNameTemp; - } - } - // HASH string - $strRawString = $strRawString1.$strRawString2.$strRawString3; - $strRawString = substr($strRawString,0,-1); - } - if ($strTable == "tbl_serviceextinfo") { - // HASH from any host, any hostgroup and service description - step 1 - if (isset($arrBlockData['host_name'])) $strRawString .= $arrBlockData['host_name']['value'].","; - if (isset($arrBlockData['service_description'])) $strRawString .= $arrBlockData['service_description']['value'].","; - // HASH string - $strRawString = substr($strRawString,0,-1); - // Create configuration name from NagiosQL variable if exists - if (isset($arrBlockData['_NAGIOSQL_CONFIG_NAME'])) { - $strConfigName = $arrBlockData['_NAGIOSQL_CONFIG_NAME']['value']; - } else { - // Create configuration name from first two items - $arrConfig = explode(",",$strRawString); - if (isset($arrConfig[0]) && ($arrConfig[0] != "")) $strConfigName = "imp_".$arrConfig[0]; - if (isset($arrConfig[1]) && ($arrConfig[1] != "")) $strConfigName .= "_".$arrConfig[1]; - } - } - while (substr_count($strRawString," ") != 0) { - $strRawString = str_replace(" ","",$strRawString); - } - // Sort hash string - $arrTemp = explode(",",$strRawString); - sort($arrTemp); - $strRawString = implode(",",$arrTemp); - $strHash = sha1($strRawString); - //echo "Hash: ".$strRawString." --> ".$strHash."
"; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Insert relation 1 - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Inserts a relation type 1 (1:1) - // - // Parameters: $strKey Data field name - // $strValue Data value - // $intDataId Data ID - // $strDataTable Data table (Master) - // $arrRelData Relation data - // $arrImportData Import Data - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function writeRelation_1($strKey,$strValue,$intDataId,$strDataTable,$arrRelData,$arrImportData) { - // Define variables - $intSlaveId = 0; - if (strtolower(trim($strValue)) == "null") { - // Update data in master table - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = -1 WHERE `id` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } else { - // Decompose data value - $arrValues = explode(",",$strValue); - // Process data values - foreach ($arrValues AS $elem) { - $strWhere = ""; - $strLink = ""; - $strAdd = ""; - // Special processing for serviceextinfo - if (($strDataTable == "tbl_serviceextinfo") && ($strKey == "service_description")) { - $strLink = "LEFT JOIN `tbl_lnkServiceToHost` on `tbl_service`.`id`=`idMaster` - LEFT JOIN `tbl_host` ON `idSlave`=`tbl_host`.`id`"; - $strWhere = "AND `tbl_host`.`host_name`='".$arrImportData['host_name']['value']."'"; - } - // Does the value already exist? - $strSQL = "SELECT `".$arrRelData['tableName1']."`.`id` FROM `".$arrRelData['tableName1']."` $strLink - WHERE `".$arrRelData['target1']."` = '".$elem."' $strWhere AND `".$arrRelData['tableName1']."`.`active`='1' - AND `".$arrRelData['tableName1']."`.`config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - if ($strId != "") { - $intSlaveId = $strId+0; - } - if ($intSlaveId == 0) { - // Insert a temporary value - if (($strDataTable == "tbl_serviceextinfo") && ($arrRelData['tableName1'] == 'tbl_service')) $strAdd = "`config_name`='imp_tmp_by_serviceextinfo',"; - $strSQL = "INSERT INTO `".$arrRelData['tableName1']."` SET `".$arrRelData['target1']."` = '".$elem."', - $strAdd `config_id`=".$this->intDomainId.", `active`='0', `last_modified`=NOW()"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - $intSlaveId = $this->myDBClass->intLastId; - - // Special processing for serviceextinfo - if (($strDataTable == "tbl_serviceextinfo") && ($strKey == "service_description")) { - $strSQL = "SELECT `id` FROM `tbl_host` WHERE `host_name`='".$arrImportData['host_name']['value']."'"; - $strId = $this->myDBClass->getFieldData($strSQL); - if ($strId != "") { - $strSQL = "INSERT INTO `tbl_lnkServiceToHost` SET `idMaster` = '".$intSlaveId."', - `idSlave` = '".$strId."'"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - $strSQL = "UPDATE `tbl_service` SET `host_name`=0 WHERE `id`='".$intSlaveId."'"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } - } - } - // Update data in master table - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = ".$intSlaveId." WHERE `id` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Insert relation 2 - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Inserts a relation type 2 (1:n) - // - // Parameters: $strKey Data field name - // $strValue Data value - // $intDataId Data ID - // $strDataTable Data table (Master) - // $arrRelData Relation data - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function writeRelation_2($strKey,$strValue,$intDataId,$strDataTable,$arrRelData) { - // Does a tploption field exist? - $strSQL = "SELECT * FROM `".$strDataTable."` WHERE `id` = ".$intDataId; - $booResult = $this->myDBClass->getSingleDataset($strSQL,$arrDataset); - if (isset($arrDataset[$arrRelData['fieldName']."_tploptions"])) { - $intTplOption = 1; - } else { - $intTplOption = 0; - } - // Delete data from link table - $strSQL = "DELETE FROM `".$arrRelData['linkTable']."` WHERE `idMaster` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - // Define variables - $intSlaveId = 0; - if (strtolower(trim($strValue)) == "null") { - // Update data in master table - if ($intTplOption == 1) { - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = 0, - `".$arrRelData['fieldName']."_tploptions` = 1 WHERE `id` = ".$intDataId; - } else { - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = 0 WHERE `id` = ".$intDataId; - } - $booResult = $this->myDBClass->insertData($strSQL); - } else { - if (substr(trim($strValue),0,1) == "+") { - $intOption = 0; - $strValue = str_replace("+","",$strValue); - } else { - $intOption = 2; - } - // Decompose data value - $arrValues = explode(",",$strValue); - // Process data values - foreach ($arrValues AS $elem) { - if ($elem != "*") { - $strWhere = ""; - $strLink = ""; - // Exclude values - if (substr($elem,0,1) == "!") { - $intExclude = 1; - $elem = substr($elem,1); - } else { - $intExclude = 0; - } - if ((($strDataTable == "tbl_servicedependency") || ($strDataTable == "tbl_serviceescalation")) && - (substr_count($strKey,"service") != 0) && (substr_count($strKey,"group") == 0)) { - if (substr_count($strKey,"depend") != 0) { - $strLink = "LEFT JOIN `tbl_lnkServiceToHost` on `id`=`idMaster`"; - $strWhere = "AND `idSlave` IN (".substr($this->strList1,0,-1).")"; - } else { - $strLink = "LEFT JOIN `tbl_lnkServiceToHost` on `id`=`idMaster`"; - $strWhere = "AND `idSlave` IN (".substr($this->strList2,0,-1).")"; - } - } - // Does the entry already exist? - $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` $strLink WHERE `".$arrRelData['target1']."` = '".$elem."' - $strWhere AND `config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - if ($strId != "") { - $intSlaveId = $strId+0; - } else { - $intSlaveId = 0; - } - if (($intSlaveId == 0) && ($elem != "*")) { - // Insert a temporary value to the target table - $strSQL = "INSERT INTO `".$arrRelData['tableName1']."` SET `".$arrRelData['target1']."` = '".$elem."', - `config_id`=".$this->intDomainId.", `active`='0', `last_modified`=NOW()"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - $intSlaveId = $this->myDBClass->intLastId; - } - // Insert relations - $strSQL = "INSERT INTO `".$arrRelData['linkTable']."` SET `idMaster` = ".$intDataId.", `idSlave` = ".$intSlaveId.", - `exclude`=".$intExclude; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - // Keep values - if (($strDataTable == "tbl_servicedependency") || ($strDataTable == "tbl_serviceescalation")) { - $strTemp = ""; - if (($strKey == "dependent_host_name") || ($strKey == "host_name")) { - $strTemp .= $intSlaveId.","; - } else if (($strKey == "dependent_hostgroup_name") || ($strKey == "hostgroup_name")) { - $arrDataHg2 = ""; - $strSQL = "SELECT DISTINCT `id` FROM `tbl_host` - LEFT JOIN `tbl_lnkHostToHostgroup` ON `id` = `tbl_lnkHostToHostgroup`.`idMaster` - LEFT JOIN `tbl_lnkHostgroupToHost` ON `id` = `tbl_lnkHostgroupToHost`.`idSlave` - WHERE (`tbl_lnkHostgroupToHost`.`idMaster` = $intSlaveId - OR `tbl_lnkHostToHostgroup`.`idSlave` = $intSlaveId) - AND `active`='1' AND `config_id`=".$this->intDomainId; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrDataHostgroups,$intDCHostgroups); - if ($booReturn && ($intDCHostgroups != 0)) { - foreach ($arrDataHostgroups AS $elem) { - $strTemp .= $elem['id'].","; - } - } - } - if (substr_count($strKey,"dependent") != 0) { - $this->strList1 .= $strTemp; - } else { - $this->strList2 .= $strTemp; - } - } - } - // Update field values in master table - if (substr_count($strValue,"*") != 0) { - $intRelValue = 2; - } else { - $intRelValue = 1; - } - if ($intTplOption == 1) { - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = $intRelValue, - `".$arrRelData['fieldName']."_tploptions` = ".$intOption." WHERE `id` = ".$intDataId; - } else { - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = $intRelValue WHERE `id` = ".$intDataId; - } - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Insert relation 3 - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Inserts a relation type 3 (templates) - // - // Parameters: $strKey Data field name - // $strValue Data value - // $intDataId Data ID - // $strDataTable Data table (Master) - // $arrRelData Relation data - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function writeRelation_3($strKey,$strValue,$intDataId,$strDataTable,$arrRelData) { - // Define variables - $intSlaveId = 0; - $intTable = 0; - $intSortNr = 1; - if (strtolower(trim($strValue)) == "null") { - // Update data in master table - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = 0, - `".$arrRelData['fieldName']."_tploptions` = 1 WHERE `id` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - } else { - if (substr(trim($strValue),0,1) == "+") { - $intOption = 0; - $strValue = str_replace("+","",$strValue); - } else { - $intOption = 2; - } - // Remove old relations - $strSQL = "DELETE FROM `".$arrRelData['linkTable']."` WHERE `idMaster` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - // Decompose data value - $arrValues = explode(",",$strValue); - // Process data values - foreach ($arrValues AS $elem) { - // Does the template already exist? (table 1) - $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."' - AND `config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - if ($strId != "") { - $intSlaveId = $strId+0; - $intTable = 1; - } - if ($intSlaveId == 0) { - // Does the template already exist? (table 2) - $strSQL = "SELECT `id` FROM `".$arrRelData['tableName2']."` WHERE `".$arrRelData['target2']."` = '".$elem."' - AND `config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - if ($strId != "") { - $intSlaveId = $strId+0; - $intTable = 2; - } - } - if ($intSlaveId == 0) { - // Insert a temporary value to the target table - $strSQL = "INSERT INTO `".$arrRelData['tableName1']."` SET `".$arrRelData['target1']."` = '".$elem."', - `config_id`=".$this->intDomainId.", `active`='0', `last_modified`=NOW()"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - $intSlaveId = $this->myDBClass->intLastId; - $intTable = 1; - } - // Insert relations - $strSQL = "INSERT INTO `".$arrRelData['linkTable']."` SET `idMaster` = ".$intDataId.", `idSlave` = ".$intSlaveId.", - `idSort` = ".$intSortNr.", `idTable` = ".$intTable; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - $intSortNr++; - $intSlaveId = 0; - // Update field data in master table - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = 1, - `".$arrRelData['fieldName']."_tploptions` = ".$intOption." WHERE `id` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Insert relation 4 - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Inserts a relation type 4 (free variables) - // - // Parameters: $strKey Data field name - // $strValue Data value - // $intDataId Data ID - // $strDataTable Data table (Master) - // $arrRelData Relation data - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function writeRelation_4($strKey,$strValue,$intDataId,$strDataTable,$arrRelData) { - // Remove empty variables - if (($strKey == "") || ($strValue == "")) return(1); - // Remove NagiosQL variables - if ($strKey == "_NAGIOSQL_CONFIG_NAME") return(1); - // Insert values to the table - $strSQL = "INSERT INTO `tbl_variabledefinition` SET `name` = '".addslashes($strKey)."', - `value` = '".addslashes($strValue)."', `last_modified`=now()"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - $intSlaveId = $this->myDBClass->intLastId; - // Insert relations to the table - $strSQL = "INSERT INTO `".$arrRelData['linkTable']."` SET `idMaster` = ".$intDataId.", `idSlave` = ".$intSlaveId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - // Update data in master table - $strSQL = "UPDATE `".$strDataTable."` SET `use_variables` = 1 WHERE `id` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Insert relation 5 - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Inserts a relation type 5 (1:1 check command) - // - // Parameters: $strKey Data field name - // $strValue Data value - // $intDataId Data ID - // $strDataTable Data table (Master) - // $arrRelData Relation data - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function writeRelation_5($strKey,$strValue,$intDataId,$strDataTable,$arrRelData) { - // Extract data values - $arrCommand = explode("!",$strValue); - $strValue = $arrCommand[0]; - // Define variables - $intSlaveId = 0; - if (strtolower(trim($strValue)) == "null") { - // Update data in master table - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = -1 WHERE `id` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } else { - // Decompose data values - $arrValues = explode(",",$strValue); - // Process data values - foreach ($arrValues AS $elem) { - // Does the entry already exist? - $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."' - AND `config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - if ($strId != "") { - $intSlaveId = $strId+0; - } - if ($intSlaveId == 0) { - // Insert a temporary value in target table - $strSQL = "INSERT INTO `".$arrRelData['tableName1']."` SET `".$arrRelData['target1']."` = '".$elem."', - `config_id`=".$this->intDomainId.", `active`='0', `last_modified`=NOW()"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - $intSlaveId = $this->myDBClass->intLastId; - } - // Update data in master table - $arrCommand[0] = $intSlaveId; - $strValue = implode("!",$arrCommand); - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = '".$this->myDBClass->real_escape($strValue)."' WHERE `id` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Insert relation 6 - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Inserts a relation type 5 (1:n:n service groups) - // - // Parameters: $strKey Data field name - // $strValue Data value - // $intDataId Data ID - // $strDataTable Data table (Master) - // $arrRelData Relation data - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function writeRelation_6($strKey,$strValue,$intDataId,$strDataTable,$arrRelData) { - // Define variables - $intSlaveId = 0; - $intSlaveIdS = 0; - $intSlaveIdH = 0; - $intSlaveIdHG = 0; - // Decompose data value - $arrValues = explode(",",$strValue); - // Remove data from link table - $strSQL = "DELETE FROM `".$arrRelData['linkTable']."` WHERE `idMaster` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - // Check the sum of elements - if (count($arrValues) % 2 != 0) { - $this->strErrorMessage .= translate("Error: wrong number of arguments - cannot import service group members")."::"; - } else { - // Process data values - $intCounter = 1; - foreach ($arrValues AS $elem) { - if ($intCounter % 2 == 0) { - // Does the host entry already exist? - $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` - WHERE `".$arrRelData['target1']."` = '".$strValue."' AND `active`='1' AND `config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - if ($strId != "") { - $intSlaveIdH = $strId+0; - } - // Does a hostgroup entry already exist? - if ($intSlaveIdH == 0) { - $strSQL = "SELECT `id` FROM `tbl_hostgroup` - WHERE `hostgroup_name` = '".$strValue."' AND `active`='1' AND `config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - if ($strId != "") { - $intSlaveIdHG = $strId+0; - } - } - if (($intSlaveIdH == 0) && ($intSlaveIdHG == 0)) { - // Insert a temporary value in table - $strSQL = "INSERT INTO `".$arrRelData['tableName1']."` SET `".$arrRelData['target1']."` = '".$strValue."', - `config_id`=".$this->intDomainId.", `active`='0', `last_modified`=NOW()"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - $intSlaveIdH = $this->myDBClass->intLastId; - } - // Does the service entry already exist? - if ($intSlaveIdH != 0) { - $strSQL = "SELECT `id` FROM `".$arrRelData['tableName2']."` - LEFT JOIN `tbl_lnkServiceToHost` ON `id` = `idMaster` - WHERE `".$arrRelData['target2']."` = '".$elem."' AND `idSlave` = ".$intSlaveIdH." AND `config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - if ($strId == "") { - $strSQL = "SELECT `id` FROM `".$arrRelData['tableName2']."` - LEFT JOIN `tbl_lnkServiceToHostgroup` ON `id` = `tbl_lnkServiceToHostgroup`.`idMaster` - LEFT JOIN `tbl_lnkHostgroupToHost` ON `tbl_lnkHostgroupToHost`.`idMaster` = `tbl_lnkServiceToHostgroup`.`idSlave` - WHERE `".$arrRelData['target2']."` = '".$elem."' AND `tbl_lnkHostgroupToHost`.`idSlave` = ".$intSlaveIdH." AND - `active`='1' AND `config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - } - if ($strId == "") { - $strSQL = "SELECT `id` FROM `".$arrRelData['tableName2']."` - LEFT JOIN `tbl_lnkServiceToHostgroup` ON `id` = `tbl_lnkServiceToHostgroup`.`idMaster` - LEFT JOIN `tbl_lnkHostToHostgroup` ON `tbl_lnkHostToHostgroup`.`idSlave` = `tbl_lnkServiceToHostgroup`.`idSlave` - WHERE `".$arrRelData['target2']."` = '".$elem."' AND `tbl_lnkHostToHostgroup`.`idMaster` = ".$intSlaveIdH." AND - `active`='1' AND `config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - } - } else if ($intSlaveIdHG != 0) { - $strSQL = "SELECT `id` FROM `".$arrRelData['tableName2']."` - LEFT JOIN `tbl_lnkServiceToHostgroup` ON `id` = `idMaster` - WHERE `".$arrRelData['target2']."` = '".$elem."' AND `idSlave` = ".$intSlaveIdHG." AND `active`='1' AND `config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - } - if ($strId != "") { - $intSlaveIdS = $strId+0; - } else { - $intSlaveIdS = 0; - } - if ($intSlaveIdS == 0) { - // Insert a temporary value in table - $intHostName = 0; - $intHostgroupName = 0; - if ($intSlaveIdH != 0) { - $intHostName = 1; - } else if ($intSlaveIdHG != 0) { - $intHostgroupName = 1; - } - $strSQL = "INSERT INTO `".$arrRelData['tableName2']."` SET `config_name`='imp_tmp_by_servicegroup', `host_name`=$intHostName, - `hostgroup_name`=$intHostgroupName, `".$arrRelData['target2']."` = '".$elem."', `config_id`=".$this->intDomainId.", - `active`='0', `last_modified`=NOW()"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - $intSlaveIdS = $this->myDBClass->intLastId; - // Make a relation from temp service to host / hostgroup - if ($intSlaveIdH != 0) { - $strSQL = "INSERT INTO `tbl_lnkServiceToHost` SET `idMaster` = '".$intSlaveIdS."', - `idSlave`=".$intSlaveIdH.", `exclude`='0'"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } else if ($intSlaveIdHG != 0) { - $strSQL = "INSERT INTO `tbl_lnkServiceToHostgroup` SET `idMaster` = '".$intSlaveIdS."', - `idSlave`=".$intSlaveIdHG.", `exclude`='0'"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } - } - // Insert relation - $strSQL = "INSERT INTO `".$arrRelData['linkTable']."` - SET `idMaster` = ".$intDataId.", `idSlaveH` = ".$intSlaveIdH.", `idSlaveS` = ".$intSlaveIdS; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - // Update data in master table - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = 1 WHERE `id` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } else { - $strValue = $elem; - } - $intCounter++; - } - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Insert relation 7 - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Inserts a relation type 6 (1:n:str) - // - // Parameters: $strKey Data field name - // $strValue Data value - // $intDataId Data ID - // $strDataTable Data table (Master) - // $arrRelData Relation data - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function writeRelation_7($strKey,$strValue,$intDataId,$strDataTable,$arrRelData) { - // Delete data from link table - $strSQL = "DELETE FROM `".$arrRelData['linkTable']."` WHERE `idMaster` = ".$intDataId; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - // Define variables - $intSlaveId = 0; - // Decompose data value - $arrValues = explode(",",$strValue); - // Process data values - foreach ($arrValues AS $elem) { - if ($elem != "*") { - $strWhere = ""; - $strLink = ""; - // Exclude values - if (substr($elem,0,1) == "!") { - $intExclude = 1; - $elem = substr($elem,1); - } else { - $intExclude = 0; - } - // Does the entry already exist? - $strSQL = "SELECT `id` FROM `".$arrRelData['tableName1']."` WHERE `".$arrRelData['target1']."` = '".$elem."' - $strWhere AND `config_id`=".$this->intDomainId; - $strId = $this->myDBClass->getFieldData($strSQL); - if ($strId != "") { - $intSlaveId = $strId+0; - } else { - $intSlaveId = 0; - } - if (($intSlaveId == 0) && ($elem != "*")) { - // Insert a temporary value to the target table - $strSQL = "INSERT INTO `".$arrRelData['tableName1']."` SET `".$arrRelData['target1']."` = '".$elem."', - `host_name`=2, `hostgroup_name`=2, `config_name`='imp_tmp_by_servicedependency', `config_id`=".$this->intDomainId.", - `active`='0', `last_modified`=NOW()"; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - $intSlaveId = $this->myDBClass->intLastId; - } - // Insert relations - $strSQL = "INSERT INTO `".$arrRelData['linkTable']."` SET `idMaster` = ".$intDataId.", `idSlave` = ".$intSlaveId.", - `strSlave`='".$elem."', `exclude`=".$intExclude; - $booResult = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } - // Update field values in master table - if (substr_count($strValue,"*") != 0) { - $intRelValue = 2; - } else { - $intRelValue = 1; - } - $strSQL = "UPDATE `".$strDataTable."` SET `".$arrRelData['fieldName']."` = $intRelValue WHERE `id` = ".$intDataId; - $booRes = $this->myDBClass->insertData($strSQL); - if ($booResult == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - } - } -} -?> \ No newline at end of file diff --git a/functions/mysqli_class.php b/functions/mysqli_class.php deleted file mode 100644 index 9e999ab..0000000 --- a/functions/mysqli_class.php +++ /dev/null @@ -1,440 +0,0 @@ - DB server name -// ----------- $arrParams['port'] -> DB server port -// $arrParams['user'] -> DB server username -// $arrParams['password'] -> DB server password -// $arrParams['database'] -> DB server database name -// -/////////////////////////////////////////////////////////////////////////////////////////////// -class mysqlidb { - // Define class variables - var $error = false; // Will be filled in functions - var $strDBId = ""; // Will be filled in functions - var $intLastId = 0; // Will be filled in functions - var $intAffectedRows = 0; // Will be filled in functions - var $strErrorMessage = ""; // Will be filled in functions - var $booSSLuse = false; // Defines if SSL is used or not - var $arrParams = ""; // Must be filled in while initialization - var $arrSQLdef = ""; // Must be filled in while initialization - var $strSQLQuote1 = "`"; // Quote char for table or row names - var $strSQLQuote2 = "'"; // Quote char for table or row names - - /////////////////////////////////////////////////////////////////////////////////////////// - // Class constructor - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Activities during initialisation - // - /////////////////////////////////////////////////////////////////////////////////////////// - function __construct() { - $this->arrParams['server'] = ""; - $this->arrParams['port'] = 0; - $this->arrParams['username'] = ""; - $this->arrParams['password'] = ""; - $this->arrParams['database'] = ""; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Connect to database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Opens a connection to the database server and select a database - // - // - // Return value: true successful - // false error - // Status message is stored in class variable $this->strErrorMessage - // - /////////////////////////////////////////////////////////////////////////////////////////// - function getdatabase() { - $this->dbconnect(); - if ($this->error == true) { - return false; - } - $this->dbselect(); - if ($this->error == true) { - return false; - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Get a single dataset field value - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Sends an SQL statement to the server and returns the result of the first data field - // - // Parameters: $strSQL SQL Statement - // - // Return value: = successful - // = error - // Status message is stored in class variable $this->strErrorMessage - // - /////////////////////////////////////////////////////////////////////////////////////////// - function getFieldData($strSQL) { - // Reset error variables - $this->strErrorMessage = ""; - $this->error = false; - // Send the SQL statement to the server - $resQuery = mysqli_query($this->strDBId,$strSQL); - // Error processing - if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == "")) { - // Return the field value from position 0/0 - $arrDataset = mysqli_fetch_array($resQuery,MYSQLI_NUM); - return $arrDataset[0]; - } else if (mysqli_error($this->strDBId) != "") { - $this->strErrorMessage .= mysqli_error($this->strDBId)."::"; - $this->error = true; - return(""); - } - return(""); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Get a single dataset - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Sends an SQL statement to the server and returns the result of the first data set - // - // Parameters: $strSQL SQL Statement - // $arrDataset Return value including the data set - // - // Return value: true = successful - // false = error - // Status message is stored in class variable $this->strErrorMessage - // - /////////////////////////////////////////////////////////////////////////////////////////// - function getSingleDataset($strSQL,&$arrDataset) { - $arrDataset = ""; - // Reset error variables - $this->strErrorMessage = ""; - $this->error = false; - // Send the SQL statement to the server - $resQuery = mysqli_query($this->strDBId,$strSQL); - // Error processing - if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == "")) { - // Put the values into the array - $arrDataset = mysqli_fetch_array($resQuery,MYSQLI_ASSOC); - return true; - } else if (mysqli_error($this->strDBId) != "") { - $this->strErrorMessage .= mysqli_error($this->strDBId)."::"; - $this->error = true; - return false; - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Get a full data part - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Sends an SQL statement to the server and returns the result inside a data array - // - // Parameters: $strSQL SQL Statement - // $arrDataset Return value including the data records - // $intDataCount Return value including the number of the records - // - // Return value: true = successful - // false = error - // Status message is stored in class variable $this->strErrorMessage - // - /////////////////////////////////////////////////////////////////////////////////////////// - function getDataArray($strSQL,&$arrDataset,&$intDataCount) { - $arrDataset = ""; - $intDataCount = 0; - // Reset error variables - $this->strErrorMessage = ""; - $this->error = false; - // Send the SQL statement to the server - $resQuery = mysqli_query($this->strDBId,$strSQL); - // Error processing - if ($resQuery && (mysqli_num_rows($resQuery) != 0) && (mysqli_error($this->strDBId) == "")) { - $intDataCount = mysqli_num_rows($resQuery); - $i = 0; - // Put the values into the array - while ($arrDataTemp = mysqli_fetch_array($resQuery,MYSQLI_ASSOC)) { - foreach ($arrDataTemp AS $key => $value) { - $arrDataset[$i][$key] = $value; - } - $i++; - } - return true; - } else if (mysqli_error($this->strDBId) != "") { - $this->strErrorMessage .= mysqli_error($this->strDBId)."::"; - $this->error = true; - return false; - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Insert/update/delete data - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Insert/update or delete data - // - // Parameters: $strSQL SQL Statement - // $this->intLastId Dataset insert ID - // $this->intAffectedRows The number of the affected records - // - // Return value: true = successful - // false = error - // Status message is stored in class variable $this->strErrorMessage - // - /////////////////////////////////////////////////////////////////////////////////////////// - function insertData($strSQL) { - // Reset error variables - $this->strErrorMessage = ""; - $this->error = false; - // Send the SQL statement to the server - $resQuery = mysqli_query($this->strDBId,$strSQL); - // Error processing - if (mysqli_error($this->strDBId) == "") { - $this->intLastId = mysqli_insert_id($this->strDBId); - $this->intAffectedRows = mysqli_affected_rows($this->strDBId); - return true; - } else { - $this->strErrorMessage .= mysqli_error($this->strDBId)."::"; - $this->error = true; - return false; - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Counts data rows - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Counts the number of records - // - // Parameters: $strSQL SQL Statement - // - // Return value: = successful - // 0 = no datasets or error - // Status message is stored in class variable $this->strErrorMessage - // - /////////////////////////////////////////////////////////////////////////////////////////// - function countRows($strSQL) { - // Reset error variables - $this->strErrorMessage = ""; - $this->error = false; - // Send the SQL statement to the server - $resQuery = mysqli_query($this->strDBId,$strSQL); - // Error processing - if ($resQuery && (mysqli_error($this->strDBId) == "")) { - return mysqli_num_rows($resQuery); - } else { - $this->strErrorMessage .= mysqli_error($this->strDBId); - $this->error = true; - return 0; - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Use mysqli_real_escape_string - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Returns a safe insert string for database manipulations - // - // Value: $strInput Input String - // - // Return value: $strOutput Output String - // - /////////////////////////////////////////////////////////////////////////////////////////// - function real_escape($strInput) { - return mysqli_real_escape_string($this->strDBId,$strInput); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Assistant functions - // - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Initialize a mysql database connection - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Return value: true - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dbinit() { - $this->strDBId = mysqli_init(); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Connect to database server - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameters: $dbserver Server name - // $dbuser Database user - // $dbpasswd Database password - // $dbname Database name - // $dbport TCP port - // - // Return value: true successful - // false error - // Status message is stored in class variable $this->strErrorMessage - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dbconnect($dbserver=NULL,$dbport=NULL,$dbuser=NULL,$dbpasswd=NULL) { - // Reset error variables - $this->strErrorMessage = ""; - $this->error = false; - // Get parameters - if ($dbserver == NULL) $dbserver = $this->arrParams['server']; - if ($dbport == NULL) $dbport = $this->arrParams['port']; - if ($dbuser == NULL) $dbuser = $this->arrParams['username']; - if ($dbpasswd == NULL) $dbpasswd = $this->arrParams['password']; - // Not all parameters available - if (($dbserver == "") || ($dbuser == "") || ($dbpasswd == "")) { - $this->strErrorMessage .= gettext("Missing server connection parameter!")."::"; - $this->error = true; - return false; - } - $this->dbinit(); - if ($this->booSSLuse == true) { - // TO BE DEFINED - } - $intErrorReporting = error_reporting(); - error_reporting(0); - if ($dbport == 0) { - $booReturn = mysqli_real_connect($this->strDBId,$dbserver,$dbuser,$dbpasswd); - } else { - $booReturn = mysqli_real_connect($this->strDBId,$dbserver,$dbuser,$dbpasswd,NULL,$dbport); - } - $arrError = error_get_last(); - error_reporting($intErrorReporting); - // Connection fails - if($booReturn == false) { - $this->strErrorMessage = "[".$dbserver."] ".gettext("Connection to the database server has failed by reason:")." ::"; - if (mysqli_connect_error($this->strDBId) != "") $this->strErrorMessage .= mysqli_connect_error($this->strDBId)."::"; - $this->error = true; - return false; - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: select database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameters: $database Database name - // - // Return value: true = successful - // false = error - // Status message is stored in class variable $this->strErrorMessage - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dbselect($database=NULL) { - // Reset error variables - $this->strErrorMessage = ""; - $this->error = false; - // Get parameters - if ($database == NULL) $database = $this->arrParams['database']; - // Not all parameters available - if ($database == "") { - $this->strErrorMessage .= gettext("Missing database connection parameter!")."::"; - $this->error = true; - return false; - } - $bolConnect = mysqli_select_db($this->strDBId,$database); - // Session cannot be etablished - if(!$bolConnect) { - $this->strErrorMessage .= "[".$database."] ".gettext("Connection to the database has failed by reason:")." ::"; - $this->strErrorMessage .= mysqli_error($this->strDBId)."::"; - $this->error = true; - return false; - } - $resQuery = mysqli_query($this->strDBId,"set names 'utf8'"); - if (mysqli_error($this->strDBId) != "") { - $this->strErrorMessage .= mysqli_error($this->strDBId)."::"; - $this->error = true; - return false; - } - $resQuery = mysqli_query($this->strDBId,"set session sql_mode = 'NO_ENGINE_SUBSTITUTION'"); - if (mysqli_error($this->strDBId) != "") { - $this->strErrorMessage .= mysqli_error($this->strDBId)."::"; - $this->error = true; - return false; - } - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Set SSL parameters - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameters: $sslkey SSL key - // $sslcert SSL certificate - // $sslca SSL CA file (optional) - // $sslpath SSL certificate path (optional) - // $sslcypher SSL cypher (optional) - // - // Return value: true successful - // The mysqli_ssl_set function always returns TRUE! - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dbsetssl($sslkey,$sslcert,$sslca=NULL,$sslpath=NULL,$sslcypher=NULL) { - // Reset error variables - $this->strErrorMessage = ""; - $this->error = false; - // Values are missing - if (($sslkey == "") || ($sslcert == "")) { - $this->strErrorMessage = gettext("Missing MySQL SSL parameter!")."::"; - $this->error = true; - return false; - } - mysqli_ssl_set($this->strDBId,$sslkey,$sslcert,$sslca,$sslpath,$sslcypher); - return true; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Close database server connectuon - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Value: none - // - // Return value: true if successful, false if failed - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dbdisconnect() { - mysqli_close($this->strDBId); - return true; - } -} -?> \ No newline at end of file diff --git a/functions/nag_class.php b/functions/nag_class.php deleted file mode 100644 index e901bb8..0000000 --- a/functions/nag_class.php +++ /dev/null @@ -1,1048 +0,0 @@ -arrSettings = $_SESSION['SETS']; - if (isset($_SESSION['domain'])) $this->intDomainId = $_SESSION['domain']; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Get menu position - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Determines the actual position inside the menu tree and returns it as an info line - // - // Parameters: $intPageId Current content id - // $strTop Label string for the root node - // - // Return value: HTML info string - // - /////////////////////////////////////////////////////////////////////////////////////////// - function getPosition($intPageId,$strTop="") { - $strPosition = ""; - $strSQL = "SELECT B.`mnuName` AS `mainitem`, B.`mnuLink` AS `mainlink`, A.`mnuName` AS `subitem`, A.`mnuLink` AS `sublink` - FROM `tbl_menu` AS A LEFT JOIN `tbl_menu` AS B ON A.`mnuTopId` = B.`mnuId` - WHERE A.`mnuId`=$intPageId"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - if ($booReturn && ($intDataCount != 0)) { - $strMainLink = $this->arrSettings['path']['base_url'].$arrData[0]['mainlink']; - $strMain = $arrData[0]['mainitem']; - $strSubLink = $this->arrSettings['path']['base_url'].$arrData[0]['sublink']; - $strSub = $arrData[0]['subitem']; - if ($strTop != "") { - $strPosition .= "".$strTop." -> "; - } - if ($strMain != "") { - $strPosition .= "".translate($strMain)." -> ".translate($strSub).""; - } else { - $strPosition .= "".translate($strSub).""; - } - } - return $strPosition; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Display main menu - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Build the main menu and display them - // - // Parameters: $intPageId Current content id - // $intCntId Menu group ID - // - // Return value: HTML menu string - // - /////////////////////////////////////////////////////////////////////////////////////////// - function getMenu($intPageId,$intCntId=1) { - // Modify URL for visible/invisible menu - $strQuery = str_replace("menu=visible&","",$_SERVER['QUERY_STRING']); - $strQuery = str_replace("menu=invisible&","",$strQuery); - $strQuery = str_replace("menu=visible","",$strQuery); - $strQuery = str_replace("menu=invisible","",$strQuery); - if ($strQuery != "") { - $strURIVisible = str_replace("&","&",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)."?menu=visible&".$strQuery); - $strURIInvisible = str_replace("&","&",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)."?menu=invisible&".$strQuery); - } else { - $strURIVisible = filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)."?menu=visible"; - $strURIInvisible = filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)."?menu=invisible"; - } - $this->intPageId = $intPageId; - if (!(isset($_SESSION['menu'])) || ($_SESSION['menu'] != "invisible")) { - // Menu visible - $strMenuHTML = "\n"; - $strMenuHTML .= "\n"; - $this->getMenuRecursive(0,$strMenuHTML,'menu',$intCntId); - $strMenuHTML .= "
\n"; - $strMenuHTML .= "
[".translate('Hide menu')."]\n"; - $strMenuHTML .= ""; - $strMenuHTML .= "\n"; - } else { - // Menu invisible - $strMenuHTML = "\n"; - $strMenuHTML .= "arrSettings['path']['base_url']."images/menu.gif\" alt=\"".translate('Show menu')."\" border=\"0\" >\n"; - $strMenuHTML .= "\n"; - } - return($strMenuHTML); - - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Menu help functions - /////////////////////////////////////////////////////////////////////////////////////////// - // Recursive function to build the main menu - function getMenuRecursive($intTopId,&$strMenuHTML,$strCSS,$intCntId) { - // Check depth - $intLevel = substr_count($strCSS,'_sub') + 1; - // Define SQL - $strSQL = "SELECT mnuId, mnuName, mnuTopId, mnuLink FROM tbl_menu - WHERE mnuTopId=$intTopId AND mnuCntId=$intCntId AND mnuActive <> 0 AND mnuGrpId IN (".$this->getAccGroups('read').") ORDER BY mnuOrderId"; - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if (($booRet != false) && ($intDataCount != 0)) { - $strMenuHTMLTemp = ""; - $booReturn1 = false; - // Menu items - foreach ($arrData AS $elem) { - $strName = translate($elem['mnuName']); - $strLink = $this->arrSettings['path']['base_url'].$elem['mnuLink']; - $strMenuHTMLTemp .= " \n"; - if (($elem['mnuId'] == $this->intPageId) || ($this->checkMenuActive($elem['mnuId']) == true)) { - $strMenuHTMLTemp .= " "; - $strMenuHTMLTemp .= "".$strName."\n"; - $booReturn1 = true; - } else { - $strMenuHTMLTemp .= " "; - $strMenuHTMLTemp .= "".$strName."\n"; - } - $strMenuHTMLTemp .= " \n"; - // Recursive call to get submenu items - if (($elem['mnuId'] == $this->intPageId) || ($this->checkMenuActive($elem['mnuId']) == true)) { - if ($this->getMenuRecursive($elem['mnuId'],$strMenuHTMLTemp,$strCSS."_sub",$intCntId) == true) $booReturn1 = true; - } - if ($intTopId == $this->intPageId) $booReturn1 = true; - } - if ($booReturn1 == true) { - $strMenuHTML .= $strMenuHTMLTemp; - return true; - } else { - if ($intLevel == 1) { - $strMenuHTML .= $strMenuHTMLTemp; - } - return false; - } - } else { - $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - return false; - } - } - // Function to find active top menu items - function checkMenuActive($intMenuId) { - $strSQL = "SELECT mnuTopId FROM tbl_menu WHERE mnuId=".$this->intPageId." AND mnuActive <> 0 AND mnuGrpId IN (".$this->getAccGroups('read').")"; - $booRet = $this->myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if (($booRet != false) && ($intDataCount != 0)) { - foreach ($arrData AS $elem) { - if ($elem['mnuTopId'] == $intMenuId) return true; - } - return false; - } else { - $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - return false; - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Process "null" values - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Replaces "NULL" with -1 - // - // Parameters: $strKey Process string - // - // Return value: Modified process string - // - /////////////////////////////////////////////////////////////////////////////////////////// - function checkNull($strKey) { - if (strtoupper($strKey) == "NULL") { - return("-1"); - } - return($strKey); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Process text values - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Add security features to text values - // - // Parameters: $strKey Process string - // - // Return value: Modified process string - // - /////////////////////////////////////////////////////////////////////////////////////////// - function tfSecure($strKey) { - $strKey = stripslashes($strKey); - $strKey = $this->myDBClass->real_escape($strKey); - return($strKey); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Check browser - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Checks the remote browser - // - // Return value: Browser String - // - /////////////////////////////////////////////////////////////////////////////////////////// - function browserCheck() { - if(stristr($_SERVER['HTTP_USER_AGENT'], 'msie')) { - return("msie"); - } else if(stristr($_SERVER['HTTP_USER_AGENT'], 'firefox')) { - return("firefox"); - } else if(stristr($_SERVER['HTTP_USER_AGENT'], 'opera')) { - return("opera"); - } - return("unknown"); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Processing path strings - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Adds a "/" after a parh string and replaces double "//" with "/" - // - // Parameters: $strPath Path string - // - // Return value: Modified path string - // - /////////////////////////////////////////////////////////////////////////////////////////// - function addSlash($strPath) { - if ($strPath == "") return(""); - $strPath = $strPath."/"; - while(substr_count($strPath,"//") != 0) { - $strPath = str_replace("//","/",$strPath); - } - return ($strPath); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Processing message strings - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Merge message strings and check for duplicate messages - // - // Parameters: $strNewMessage Message to add - // $strSeparate Separate string (
or \n) - // - // Return value: &$strOldMessage Modified message string - // - /////////////////////////////////////////////////////////////////////////////////////////// - function processMessage($strNewMessage,&$strOldMessage,$strSeparate="
") { - $strNewMessage = str_replace("::::","::",$strNewMessage); - $strNewMessage = str_replace("::",$strSeparate,$strNewMessage); - if (($strOldMessage != "") && ($strNewMessage != "")) { - if (substr_count($strOldMessage,$strNewMessage) == 0) { - if (substr_count(substr($strOldMessage,-5),$strSeparate) == 0) { - $strOldMessage .= $strSeparate.$strNewMessage; - } else { - $strOldMessage .= $strNewMessage; - } - } - } else { - $strOldMessage .= $strNewMessage; - } - // Reset message variable (prevent duplicates) - $strNewMessage = ""; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Check account group - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Checks if an user has acces to an account group - // - // Parameters: $intGroupId Group ID - // $strType Access type (read,write,link) - // - // Return value: 0 = access granted - // 1 = no access - // - /////////////////////////////////////////////////////////////////////////////////////////// - function checkAccGroup($intGroupId,$strType) { - // Admin braucht keine Berechtigung - if ($_SESSION['userid'] == 1) return(0); - // Gruppe 0 hat uneingeschränkte Rechte - if ($intGroupId == 0) return(0); - // Datenbank abfragen - switch($strType) { - case 'read': $strTypeValue = "`read`='1'"; break; - case 'write': $strTypeValue = "`write`='1'"; break; - case 'link': $strTypeValue = "`link`='1'"; break; - default: return(1); - } - $strSQL = "SELECT * FROM `tbl_lnkGroupToUser` WHERE `idMaster` = $intGroupId - AND `idSlave`=".$_SESSION['userid']." AND $strTypeValue"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrDataMain,$intDataCount); - if ($booReturn == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - if (($booReturn != false) && ($intDataCount != 0)) { - return(0); - } - return(1); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Returns read groups - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Returns any group ID with read access for the submitted user id - // - // Parameters: $strType Access type (read,write,link) - // - // Return value: Comma separated string with group id's - // - /////////////////////////////////////////////////////////////////////////////////////////// - function getAccGroups($strType) { - $strReturn = "0,"; - // Admin becomes rights to all groups - if ($_SESSION['userid'] == 1) { - $strSQL = "SELECT `id`FROM `tbl_group`"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intCount); - if ($booReturn == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - if ($booReturn && ($intCount != 0)) { - foreach ( $arrData AS $elem ) { - $strReturn .= $elem['id'].","; - } - } - $strReturn = substr($strReturn,0,-1); - return $strReturn; - } - switch($strType) { - case 'read': $strTypeValue = "`read`='1'"; break; - case 'write': $strTypeValue = "`write`='1'"; break; - case 'link': $strTypeValue = "`link`='1'"; break; - default: $strTypeValue = "'1'='2'"; - } - $strSQL = "SELECT `idMaster` FROM `tbl_lnkGroupToUser` WHERE `idSlave`=".$_SESSION['userid']." AND $strTypeValue"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrData,$intCount); - if ($booReturn == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - if ($booReturn && ($intCount != 0)) { - foreach ( $arrData AS $elem ) { - $strReturn .= $elem['idMaster'].","; - } - } - $strReturn = substr($strReturn,0,-1); - return $strReturn; - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Build site numbers - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Build a string which contains links for additional pages. This is used in data lists - // with more items then defined in settings "lines per page limit" - // - // Parameters: $strSite Link to page - // $intDataCount Sum of all data lines - // $chkLimit Actual data limit - // $strOrderBy OrderBy Field - // $strOrderDir Order direction - // - // Return value: HTML string - // - /////////////////////////////////////////////////////////////////////////////////////////// - function buildPageLinks($strSite,$intDataCount,$chkLimit,$strOrderBy="",$strOrderDir="") { - $intMaxLines = $this->arrSettings['common']['pagelines']; - $intCount = 1; - $intCheck = 0; - $strSiteHTML = "\n\n\n"; - for ($i=0;$i<$intDataCount;$i=$i+$intMaxLines) { - $strLink1 = ""; - $strLink2 = "onclick=\"location.href='".$strSite."?limit=$i&orderby=$strOrderBy&orderdir=$strOrderDir'\""; - if ((!(($chkLimit >= ($i+($intMaxLines*5))) || ($chkLimit <= ($i-($intMaxLines*5))))) || ($i==0) || ($i>=($intDataCount-$intMaxLines))) { - if ($chkLimit == $i) { - $strSiteHTML .= "\n"; - } else { - $strSiteHTML .= "\n"; - } - $intCheck = 0; - } else if ($intCheck == 0) { - $strSiteHTML .= "\n"; - $intCheck = 1; - } - $intCount++; - } - $strSiteHTML .= "\n
".translate('Page').": $intCount".$strLink1.$intCount."...
\n"; - if ($intCount > 2) { - return($strSiteHTML); - } else { - return(""); - } - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Insert Domain list - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Inserts the domain list to the list view template - // - // Parameters: $resTemplate Template object - // - // Return value: HTML string - // - /////////////////////////////////////////////////////////////////////////////////////////// - function insertDomainList($resTemplate) { - $strSQL = "SELECT * FROM `tbl_datadomain` WHERE `active` <> '0' ORDER BY `domain`"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrDataDomain,$intDataCount); - if ($booReturn == false) { - $strErrorMessage .= translate('Error while selecting data from database:')."::".$myDBClass->strErrorMessage; - } else { - if ($intDataCount != 0) { - foreach($arrDataDomain AS $elem) { - // Check acces rights - if ($this->checkAccGroup($elem['access_group'],'read') == 0) { - $resTemplate->setVariable("DOMAIN_ID",$elem['id']); - $resTemplate->setVariable("DOMAIN_NAME",$elem['domain']); - if ($_SESSION['domain'] == $elem['id']) { - $resTemplate->setVariable("DOMAIN_SEL","selected"); - } - $resTemplate->parse("domainlist"); - } - } - } - } - } - - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Parse selection field (simple) - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Builds a simple selection field inside a template - // - // Parameters: $strTable Table name (source data) - // $strTabField Field name (source data) - // $strTemplKey Template key - // $intModeId 0=only data, 1=with empty line at the beginning, - // 2=with empty line and 'null' line at the beginning - // $intSelId Selected data ID (from master table) - // $intExclId Exclude ID - // - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function parseSelectSimple($strTable,$strTabField,$strTemplKey,$intModeId=0,$intSelId=-9,$intExclId=-9) { - // Compute option value - $intOption = 0; - if ($strTemplKey == 'hostcommand') $intOption = 1; - if ($strTemplKey == 'servicecommand') $intOption = 1; - if ($strTemplKey == 'eventhandler') $intOption = 2; - if ($strTemplKey == 'service_extinfo') $intOption = 7; - // Get version - $this->myConfigClass->getDomainData("version",$intVersion); - // Get link rights - $strAccess = $this->getAccGroups('link'); - // Get raw data - $booRaw = $this->getSelectRawdata($strTable,$strTabField,$arrData,$intOption); - if ($booRaw == 0) { - // Insert an empty line in mode 1 - if (($intModeId == 1) || ($intModeId == 2)) { - $this->myContentTpl->setVariable("SPECIAL_STYLE",""); - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey)," "); - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID',0); - if ($intVersion != 3) $this->myContentTpl->setVariable("VERSION_20_MUST","inpmust"); - $this->myContentTpl->parse($strTemplKey); - } - // Insert a 'null' line in mode 2 - if ($intModeId == 2) { - $this->myContentTpl->setVariable("SPECIAL_STYLE",""); - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey),"null"); - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID',-1); - if ($intVersion != 3) $this->myContentTpl->setVariable("VERSION_20_MUST","inpmust"); - if ($intSelId == -1) $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey)."_SEL","selected"); - $this->myContentTpl->parse($strTemplKey); - } - // Insert data sets - foreach ($arrData AS $elem) { - $this->myContentTpl->setVariable("SPECIAL_STYLE",""); - if ($elem['key'] == $intExclId) continue; - if (isset($elem['active']) && $elem['active'] == 0) { - $strActive=' [inactive]'; - $this->myContentTpl->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - } - if (isset($elem['config_id']) && $elem['config_id'] == 0) { - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey),htmlspecialchars($elem['value'],ENT_QUOTES,'UTF-8').' [common]'.$strActive); - } else { - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey),htmlspecialchars($elem['value'],ENT_QUOTES,'UTF-8').$strActive); - } - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey)."_ID",$elem['key']); - if ($intVersion != 3) $this->myContentTpl->setVariable("VERSION_20_MUST","inpmust"); - if ($intSelId == $elem['key']) { - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey)."_SEL","selected"); - } - $this->myContentTpl->parse($strTemplKey); - } - return(0); - } - return(1); - } - - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Parse selection field (multi) - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Builds a multi selection field inside a template - // - // Parameters: $strTable Table name (source data) - // $strTabField Field name (source data) - // $strTemplKey Template key - // $intDataId Data ID of master table - // $intModeId 0 = only data - // 1 = with empty line at the beginning - // 2 = with * line at the beginning - // $intTypeId Type ID (from master table) - // $intExclId Exclude ID - // $strRefresh Session token for refresh mode - // - // - // Return value: 0 = successful - // 1 = error - // Status message is stored in message class variables - // - /////////////////////////////////////////////////////////////////////////////////////////// - function parseSelectMulti($strTable,$strTabField,$strTemplKey,$strLinkTable,$intModeId=0,$intTypeId=-9,$intExclId=-9,$strRefresh='') { - // Compute option value - $intOption = 0; - $intRefresh = 0; - if ($strLinkTable == 'tbl_lnkContactToCommandHost') $intOption = 2; - if ($strLinkTable == 'tbl_lnkContactToCommandService') $intOption = 2; - if ($strLinkTable == 'tbl_lnkContacttemplateToCommandHost') $intOption = 2; - if ($strLinkTable == 'tbl_lnkContacttemplateToCommandService') $intOption = 2; - if ($strLinkTable == 'tbl_lnkServicegroupToService') $intOption = 3; - if ($strLinkTable == 'tbl_lnkServicedependencyToService_DS') $intOption = 4; - if ($strLinkTable == 'tbl_lnkServicedependencyToService_S') $intOption = 5; - if ($strLinkTable == 'tbl_lnkServiceescalationToService') $intOption = 6; - if ($strTemplKey == 'host_services') $intOption = 8; - // Get version - $this->myConfigClass->getDomainData("version",$intVersion); - // Get raw data - $booRaw = $this->getSelectRawdata($strTable,$strTabField,$arrData,$intOption); - // Get selected data - $booSel = $this->getSelectedItems($strLinkTable,$arrSelected,$intOption); - // Get additional selected data - if ($strLinkTable == 'tbl_lnkHostToHostgroup') { - $booSelAdd = $this->getSelectedItems("tbl_lnkHostgroupToHost",$arrSelectedAdd,8); - } - if ($strLinkTable == 'tbl_lnkHostgroupToHost') { - $booSelAdd = $this->getSelectedItems("tbl_lnkHostToHostgroup",$arrSelectedAdd,8); - } - // Get browser - $strBrowser = $this->browserCheck(); - // Refresh processing (replaces selection array) - if ($strRefresh != '') { - if (isset($_SESSION['refresh']) && isset($_SESSION['refresh'][$strRefresh]) && is_array($_SESSION['refresh'][$strRefresh])) { - $arrSelected = $_SESSION['refresh'][$strRefresh]; - $intRefresh = 1; - $booSel = 0; - } - } - if ($booRaw == 0) { - $intCount = 0; - // Insert an empty line in mode 1 - if ($intModeId == 1) { - $this->myContentTpl->setVariable("SPECIAL_STYLE",""); - $this->myContentTpl->setVariable("OPTION_DISABLED",""); - if (($strBrowser == "msie") && ($this->arrSettings['common']['seldisable'] != 0)) $this->myContentTpl->setVariable("OPTION_DISABLED","disabled=\"disabled\""); - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey)," "); - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID',0); - if ($intVersion != 3) $this->myContentTpl->setVariable("VERSION_20_MUST","inpmust"); - $this->myContentTpl->parse($strTemplKey); - $intCount++; - } - // Insert an * line in mode 2 - if ($intModeId == 2) { - $this->myContentTpl->setVariable("SPECIAL_STYLE",""); - $this->myContentTpl->setVariable("OPTION_DISABLED",""); - if (($strBrowser == "msie") && ($this->arrSettings['common']['seldisable'] != 0)) $this->myContentTpl->setVariable("OPTION_DISABLED","disabled=\"disabled\""); - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey),"*"); - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID',"*"); - if ($intVersion != 3) $this->myContentTpl->setVariable("VERSION_20_MUST","inpmust"); - if ($intTypeId == 2) $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey)."_SEL","selected"); - if (($intRefresh == 1) && (in_array('*',$arrSelected))) { - $this->myContentTpl->setVariable("DAT_".strtoupper($strTemplKey)."_SEL","selected"); - $this->myContentTpl->setVariable("IE_".strtoupper($strTemplKey)."_SEL","ieselected"); - } - $intCount++; - $this->myContentTpl->parse($strTemplKey); - } - // Insert data sets - foreach ($arrData AS $elem) { - if ($elem['key'] == $intExclId) continue; - if ($elem['value'] == "") continue; - $intIsSelected = 0; - $intIsExcluded = 0; - $intIsForeign = 0; - $this->myContentTpl->setVariable("SPECIAL_STYLE",""); - $this->myContentTpl->setVariable("OPTION_DISABLED",""); - if (($strBrowser == "msie") && ($this->arrSettings['common']['seldisable'] != 0)) $this->myContentTpl->setVariable("OPTION_DISABLED","disabled=\"disabled\""); - if (isset($elem['active']) && $elem['active'] == 0) { - $strActive=' [inactive]'; - $this->myContentTpl->setVariable("SPECIAL_STYLE","inactive_option"); - } else { - $strActive = ""; - } - if (isset($elem['config_id']) && $elem['config_id'] == 0) { - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey),htmlspecialchars($elem['value'],ENT_QUOTES,'UTF-8').' [common]'.$strActive); - } else { - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey),htmlspecialchars($elem['value'],ENT_QUOTES,'UTF-8').$strActive); - } - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey)."_ID",$elem['key']); - $this->myContentTpl->setVariable('CLASS_SEL',""); - if ($intVersion != 3) $this->myContentTpl->setVariable("VERSION_20_MUST","inpmust"); - if (($booSel == 0) && (in_array($elem['key'],$arrSelected))) $intIsSelected = 1; - if (($booSel == 0) && (in_array($elem['value'],$arrSelected))) $intIsSelected = 1; - if (isset($booSelAdd) && ($booSelAdd == 0) && (in_array($elem['key'],$arrSelectedAdd))) $intIsForeign = 1; - if (isset($booSelAdd) && ($booSelAdd == 0) && (in_array($elem['value'],$arrSelectedAdd))) $intIsForeign = 1; - if (($intIsForeign == 1) && ($strActive == "")) { - $this->myContentTpl->setVariable("SPECIAL_STYLE","foreign_option"); - } - // Exclude rule - if (($booSel == 0) && (in_array("e".$elem['key'],$arrSelected))) $intIsExcluded = 1; - if (($booSel == 0) && (in_array("e"."::".$elem['value'],$arrSelected))) $intIsExcluded = 1; - if ($intIsExcluded == 1) { - if (isset($elem['config_id']) && $elem['config_id'] == 0) { - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey),'!'.htmlspecialchars($elem['value'],ENT_QUOTES,'UTF-8').' [common]'.$strActive); - } else { - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey),'!'.htmlspecialchars($elem['value'],ENT_QUOTES,'UTF-8').$strActive); - } - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey)."_ID",'e'.$elem['key']); - } - if (($intIsSelected == 1) || ($intIsExcluded == 1)) { - $this->myContentTpl->setVariable("DAT_".strtoupper($strTemplKey)."_SEL","selected"); - $this->myContentTpl->setVariable("IE_".strtoupper($strTemplKey)."_SEL","ieselected"); - } - $intCount++; - $this->myContentTpl->parse($strTemplKey); - } - if ($intCount == 0) { - // Insert an empty line to create valid HTML select fields - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey)," "); - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID',0); - $this->myContentTpl->parse($strTemplKey); - } - return(0); - } - // Insert an empty line to create valid HTML select fields - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey)," "); - $this->myContentTpl->setVariable('DAT_'.strtoupper($strTemplKey).'_ID',0); - $this->myContentTpl->parse($strTemplKey); - return(1); - } - - //3.1 HELP FUNCTIONS - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Get raw data - /////////////////////////////////////////////////////////////////////////////////////////// - // $strTable -> Table name - // $strTabField -> Data field name - // $arrData -> Raw data array - // $intOption -> Option value - // Return value -> 0=successful / 1=error - /////////////////////////////////////////////////////////////////////////////////////////// - function getSelectRawdata($strTable,$strTabField,&$arrData,$intOption=0) { - // Get link rights - $strAccess = $this->getAccGroups('link'); - // Common domain is enabled? - $this->myConfigClass->getDomainData("enable_common",$intCommonEnable); - if ($intCommonEnable == 1) { - $strDomainWhere1 = " (`config_id`=".$this->intDomainId." OR `config_id`=0) "; - $strDomainWhere2 = " (`tbl_service`.`config_id`=".$this->intDomainId." OR `tbl_service`.`config_id`=0) "; - } else { - $strDomainWhere1 = " `config_id`=".$this->intDomainId." "; - $strDomainWhere2 = " `tbl_service`.`config_id`=".$this->intDomainId." "; - } - // Define SQL commands - if ($strTable == 'tbl_group') { - $strSQL = "SELECT `id` AS `key`, `".$strTabField."` AS `value`, `active` FROM `".$strTable."` WHERE `active`='1' - AND `".$strTabField."` <> '' AND `".$strTabField."` IS NOT NULL ORDER BY `".$strTabField."`"; - } else if (($strTable == 'tbl_configtarget') || ($strTable == 'tbl_datadomain') || ($strTable == 'tbl_language')) { - $strSQL = "SELECT `id` AS `key`, `".$strTabField."` AS `value`, `active` FROM `".$strTable."` WHERE `".$strTabField."` <> '' AND - `".$strTabField."` IS NOT NULL ORDER BY `".$strTabField."`"; - } else if (($strTable == 'tbl_command') && ($intOption == 1)) { - $strSQL = "SELECT `id` AS `key`, `".$strTabField."` AS `value`, `config_id`, `active` FROM `".$strTable."` WHERE $strDomainWhere1 - AND `".$strTabField."` <> '' AND `".$strTabField."` IS NOT NULL AND `access_group` IN ($strAccess) - AND (`command_type` = 0 OR `command_type` = 1) ORDER BY `".$strTabField."`"; - } else if (($strTable == 'tbl_command') && ($intOption == 2)) { - $strSQL = "SELECT `id` AS `key`, `".$strTabField."` AS `value`, `config_id`, `active` FROM `".$strTable."` WHERE $strDomainWhere1 - AND `".$strTabField."` <> '' AND `".$strTabField."` IS NOT NULL AND `access_group` IN ($strAccess) - AND (`command_type` = 0 OR `command_type` = 2) ORDER BY `".$strTabField."`"; - } else if (($strTable == 'tbl_timeperiod') && ($strTabField == 'name')) { - $strSQL = "SELECT `id` AS `key`, `timeperiod_name` AS `value`, `config_id`, `active` FROM `tbl_timeperiod` WHERE $strDomainWhere1 - AND `timeperiod_name` <> '' AND `timeperiod_name` IS NOT NULL AND `access_group` IN ($strAccess) - UNION - SELECT `id` AS `key`, `name` AS `value`, `config_id`, `active` FROM `tbl_timeperiod` WHERE $strDomainWhere1 - AND `name` <> '' AND `name` IS NOT NULL AND `name` <> `timeperiod_name` AND `access_group` IN ($strAccess) - ORDER BY value"; - } else if (($strTable == 'tbl_service') && ($intOption == 3)) { - // Service groups - $strSQL = "SELECT CONCAT_WS('::',`tbl_host`.`id`,'0',`tbl_service`.`id`) AS `key`, - CONCAT('H:',`tbl_host`.`host_name`,',',`tbl_service`.`service_description`) AS `value`, `tbl_service`.`active` FROM `tbl_service` - LEFT JOIN `tbl_lnkServiceToHost` ON `tbl_service`.`id` = `tbl_lnkServiceToHost`.`idMaster` - LEFT JOIN `tbl_host` ON `tbl_lnkServiceToHost`.`idSlave` = `tbl_host`.`id` - WHERE $strDomainWhere2 AND `tbl_service`.`service_description` <> '' - AND `tbl_service`.`service_description` IS NOT NULL AND `tbl_service`.`host_name` <> 0 AND `tbl_service`.`access_group` IN ($strAccess) - UNION - SELECT CONCAT_WS('::','0',`tbl_hostgroup`.`id`,`tbl_service`.`id`) AS `key`, - CONCAT('HG:',`tbl_hostgroup`.`hostgroup_name`,',',`tbl_service`.`service_description`) AS `value`, `tbl_service`.`active` FROM `tbl_service` - LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id` = `tbl_lnkServiceToHostgroup`.`idMaster` - LEFT JOIN `tbl_hostgroup` ON `tbl_lnkServiceToHostgroup`.`idSlave` = `tbl_hostgroup`.`id` - WHERE $strDomainWhere2 AND `tbl_service`.`service_description` <> '' - AND `tbl_service`.`service_description` IS NOT NULL AND `tbl_service`.`hostgroup_name` <> 0 AND `tbl_service`.`access_group` IN ($strAccess) - UNION - SELECT CONCAT_WS('::',`tbl_host`.`id`,'0',`tbl_service`.`id`) AS `key`, - CONCAT('HHG:',`tbl_host`.`host_name`,',',`tbl_service`.`service_description`) AS `value`, `tbl_service`.`active` FROM `tbl_service` - LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id` = `tbl_lnkServiceToHostgroup`.`idMaster` - LEFT JOIN `tbl_lnkHostgroupToHost` ON `tbl_lnkHostgroupToHost`.`idMaster` = `tbl_lnkServiceToHostgroup`.`idSlave` - LEFT JOIN `tbl_host` ON `tbl_lnkHostgroupToHost`.`idSlave` = `tbl_host`.`id` - WHERE $strDomainWhere2 AND `tbl_service`.`service_description` <> '' - AND `tbl_service`.`service_description` IS NOT NULL AND `tbl_service`.`hostgroup_name` <> 0 AND `tbl_service`.`access_group` IN ($strAccess) - UNION - SELECT CONCAT_WS('::',`tbl_host`.`id`,'0',`tbl_service`.`id`) AS `key`, - CONCAT('HGH:',`tbl_host`.`host_name`,',',`tbl_service`.`service_description`) AS `value`, `tbl_service`.`active` FROM `tbl_service` - LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id` = `tbl_lnkServiceToHostgroup`.`idMaster` - LEFT JOIN `tbl_lnkHostToHostgroup` ON `tbl_lnkHostToHostgroup`.`idSlave` = `tbl_lnkServiceToHostgroup`.`idSlave` - LEFT JOIN `tbl_host` ON `tbl_lnkHostToHostgroup`.`idMaster` = `tbl_host`.`id` - WHERE $strDomainWhere2 AND `tbl_service`.`service_description` <> '' - AND `tbl_service`.`service_description` IS NOT NULL AND `tbl_service`.`hostgroup_name` <> 0 AND `tbl_service`.`access_group` IN ($strAccess) - ORDER BY value"; - } else if (($strTable == 'tbl_service') && (($intOption == 4) || ($intOption == 5) || ($intOption == 6))) { - // Define session variables - if ($intOption == 6) { - $strHostVar = 'se_host'; - $strHostGroupVar = 'se_hostgroup'; - } else if ($intOption == 4) { - $strHostVar = 'sd_dependent_host'; - $strHostGroupVar = 'sd_dependent_hostgroup'; - } else { - $strHostVar = 'sd_host'; - $strHostGroupVar = 'sd_hostgroup'; - } - $arrHosts = $_SESSION['refresh'][$strHostVar]; - $arrHostgroups = $_SESSION['refresh'][$strHostGroupVar]; - $arrServices = array(); - $arrServiceId = array(); - if ((count($arrHosts) == 1) && $arrHosts[0] == "") $arrHosts = array(); - if ((count($arrHostgroups) == 1) && $arrHostgroups[0] == "") $arrHostgroups = array(); - if (isset($_SESSION['refresh']) && - (isset($_SESSION['refresh']['sd_dependent_service']) && is_array($_SESSION['refresh']['sd_dependent_service'])) || - (isset($_SESSION['refresh']['sd_service']) && is_array($_SESSION['refresh']['sd_service'])) || - (isset($_SESSION['refresh']['se_service']) && is_array($_SESSION['refresh']['se_service']))){ - // * Value in hosts -> disabled in NagiosQL 3.2 - if (in_array('*',$_SESSION['refresh'][$strHostVar])) { - $strSQL = "SELECT id FROM tbl_host WHERE $strDomainWhere1 - AND `access_group` IN ($strAccess)"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrDataHost,$intDCHost); - if ($booReturn == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - if ($booReturn && ($intDCHost != 0)) { - $arrHostTemp = ''; - foreach ($arrDataHost AS $elem) { - if (in_array("e".$elem['id'],$_SESSION['refresh'][$strHostVar])) continue; - $arrHostTemp[] = $elem['id']; - } - } - $strHosts = 1; - $arrHosts = $arrHostTemp; - } else { - $strHosts = count($arrHosts)+0; - } - // * Value in host groups -> disabled in NagiosQL 3.2 - if (in_array('*',$_SESSION['refresh'][$strHostGroupVar])) { - $strSQL = "SELECT id FROM tbl_hostgroup WHERE $strDomainWhere1 - AND `access_group` IN ($strAccess)"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrDataHost,$intDCHost); - if ($booReturn == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - if ($booReturn && ($intDCHost != 0)) { - $arrHostgroupTemp = ''; - foreach ($arrDataHost AS $elem) { - if (in_array("e".$elem['id'],$_SESSION['refresh'][$strHostGroupVar])) continue; - $arrHostgroupTemp[] = $elem['id']; - } - } - $strHostsGroup = 1; - $arrHostgroups = $arrHostgroupTemp; - } else { - $strHostsGroup = count($arrHostgroups)+0; - } - // Special method - only host_name or hostgroup_name selected - if (($strHostVar == 'sd_dependent_host') && ($strHosts == 0) && ($strHostsGroup == 0)) { - $arrHosts = $_SESSION['refresh']['sd_host']; - $arrHostgroups = $_SESSION['refresh']['sd_hostgroup']; - if ((count($arrHosts) == 1) && $arrHosts[0] == "") $arrHosts = array(); - if ((count($arrHostgroups) == 1) && $arrHostgroups[0] == "") $arrHostgroups = array(); - $strHosts = count($arrHosts)+0; - $strHostsGroup = count($arrHostgroups)+0; - } - // If no hosts and hostgroups are selected show any service - if (($strHosts == 0) && ($strHostsGroup == 0)) { - $strSQL = "SELECT `id` AS `key`, `".$strTabField."` AS `value`, `active` FROM `tbl_service` - WHERE $strDomainWhere1 - AND `".$strTabField."` <> '' AND `".$strTabField."` IS NOT NULL AND `access_group` IN ($strAccess) - GROUP BY `value` ORDER BY `value`"; - } else { - if ($strHosts != 0) { - $intCounter = 0; - foreach ($arrHosts AS $elem) { - if (($intCounter != 0) && (count($arrServices) == 0)) continue; - $arrTempServ = array(); - $arrTempServId = array(); - $elem = str_replace("e","",$elem); - $strSQLTmp = "SELECT `id`, `service_description` FROM `tbl_service` - LEFT JOIN `tbl_lnkServiceToHost` ON `tbl_service`.`id` = `tbl_lnkServiceToHost`.`idMaster` - WHERE $strDomainWhere1 - AND `tbl_lnkServiceToHost`.`idSlave` = $elem - AND `service_description` <> '' AND `service_description` IS NOT NULL AND `access_group` IN ($strAccess) - UNION - SELECT `id`, `service_description` FROM `tbl_service` - LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id` = `tbl_lnkServiceToHostgroup`.`idMaster` - LEFT JOIN `tbl_lnkHostToHostgroup` ON `tbl_lnkServiceToHostgroup`.`idSlave` = `tbl_lnkHostToHostgroup`.`idSlave` - WHERE $strDomainWhere1 - AND `tbl_lnkHostToHostgroup`.`idMaster` = $elem - AND `service_description` <> '' AND `service_description` IS NOT NULL AND `access_group` IN ($strAccess) - UNION - SELECT `id`, `service_description` FROM `tbl_service` - LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id` = `tbl_lnkServiceToHostgroup`.`idMaster` - LEFT JOIN `tbl_lnkHostgroupToHost` ON `tbl_lnkServiceToHostgroup`.`idSlave` = `tbl_lnkHostgroupToHost`.`idMaster` - WHERE $strDomainWhere1 - AND `tbl_lnkHostgroupToHost`.`idSlave` = $elem - AND `service_description` <> '' AND `service_description` IS NOT NULL AND `access_group` IN ($strAccess)"; - $booReturn = $this->myDBClass->getDataArray($strSQLTmp,$arrDataTmp,$intDataTmp); - if ($booReturn && ($intDataTmp != 0)) { - foreach ($arrDataTmp AS $elem2) { - if ($intCounter == 0) { - $arrTempServ[] = $elem2['service_description']; - $arrTempServId[] = $elem2['id']; - } else if (in_array($elem2['service_description'],$arrServices) && !in_array($elem2['service_description'],$arrTempServ)) { - $arrTempServ[] = $elem2['service_description']; - $arrTempServId[] = $elem2['id']; - } - } - } - $arrServices = $arrTempServ; - $arrServicesId = $arrTempServId; - $intCounter++; - } - } - if ($strHostsGroup != 0) { - if ($strHosts == 0) $intCounter = 0; - foreach ($arrHostgroups AS $elem) { - if (($intCounter != 0) && (count($arrServices) == 0)) continue; - $arrTempServ = array(); - $arrTempServId = array(); - $elem = str_replace("e","",$elem); - $strSQLTmp = "SELECT `id`, `service_description` FROM `tbl_service` - LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id` = `tbl_lnkServiceToHostgroup`.`idMaster` - WHERE $strDomainWhere1 - AND `tbl_lnkServiceToHostgroup`.`idSlave` = $elem - AND `service_description` <> '' AND `service_description` IS NOT NULL AND `access_group` IN ($strAccess)"; - $booReturn = $this->myDBClass->getDataArray($strSQLTmp,$arrDataTmp,$intDataTmp); - if ($booReturn && ($intDataTmp != 0)) { - foreach ($arrDataTmp AS $elem2) { - if ($intCounter == 0) { - $arrTempServ[] = $elem2['service_description']; - $arrTempServId[] = $elem2['id']; - } else if (in_array($elem2['service_description'],$arrServices) && !in_array($elem2['service_description'],$arrTempServ)) { - $arrTempServ[] = $elem2['service_description']; - $arrTempServId[] = $elem2['id']; - } - } - } - $arrServices = $arrTempServ; - $arrServicesId = $arrTempServId; - $intCounter++; - } - } - if (count($arrServices) != 0) { - $strServices = "'".implode("','",$arrServices)."'"; - $strServicesId = implode(",",$arrServicesId); - $strSQL = "SELECT `id` AS `key`, `".$strTabField."` AS `value`, `active` FROM `tbl_service` - LEFT JOIN `tbl_lnkServiceToHost` ON `tbl_service`.`id` = `tbl_lnkServiceToHost`.`idMaster` - WHERE $strDomainWhere1 - AND `tbl_service`.`service_description` IN ($strServices) - AND `tbl_service`.`id` IN ($strServicesId) - AND `".$strTabField."` <> '' AND `".$strTabField."` IS NOT NULL AND `access_group` IN ($strAccess) - GROUP BY `value` - UNION - SELECT `id` AS `key`, `".$strTabField."` AS `value`, `active` FROM `tbl_service` - LEFT JOIN `tbl_lnkServiceToHostgroup` ON `tbl_service`.`id` = `tbl_lnkServiceToHostgroup`.`idMaster` - WHERE $strDomainWhere1 - AND `tbl_service`.`service_description` IN ($strServices) - AND `tbl_service`.`id` IN ($strServicesId) - AND `".$strTabField."` <> '' AND `".$strTabField."` IS NOT NULL AND `access_group` IN ($strAccess) - GROUP BY `value` - UNION - SELECT `id` AS `key`, `".$strTabField."` AS `value`, `active` FROM `tbl_service` - WHERE $strDomainWhere1 - AND `host_name`=2 OR `hostgroup_name`=2 - AND `".$strTabField."` <> '' AND `".$strTabField."` IS NOT NULL AND `access_group` IN ($strAccess) - GROUP BY `value` ORDER BY `value`"; - } else { - $strSQL = ""; - } - } - } else { - $strSQL = ""; - } - } else if (($strTable == 'tbl_service') && ($intOption == 7)) { - if (isset($_SESSION['refresh']) && isset($_SESSION['refresh']['se_host'])) { - $strHostId = $_SESSION['refresh']['se_host']; - $strSQL = "SELECT `tbl_service`.`id` AS `key`, `tbl_service`.`".$strTabField."` AS `value`, `tbl_service`.`active` FROM `tbl_service` - LEFT JOIN `tbl_lnkServiceToHost` ON `tbl_service`.`id` = `tbl_lnkServiceToHost`.`idMaster` - WHERE $strDomainWhere1 AND `tbl_lnkServiceToHost`.`idSlave` = $strHostId - AND `".$strTabField."` <> '' AND `".$strTabField."` IS NOT NULL AND `access_group` IN ($strAccess) ORDER BY `".$strTabField."`"; - } else { - $strSQL = ""; - } - } else if (($strTable == 'tbl_service') && ($intOption == 8)) { - // Service selection inside Host definition - $strSQL = "SELECT `tbl_service`.`id` AS `key`, CONCAT(`tbl_service`.`config_name`, ' - ', `tbl_service`.`service_description`) AS `value`, `active` - FROM `tbl_service` WHERE $strDomainWhere1 AND `tbl_service`.`config_name` <> '' - AND `tbl_service`.`config_name` IS NOT NULL AND `tbl_service`.`service_description` <> '' AND `tbl_service`.`service_description` IS NOT NULL - AND `access_group` IN ($strAccess) ORDER BY `value"; - } else { - // Common statement - $strSQL = "SELECT `id` AS `key`, `".$strTabField."` AS `value`, `config_id`, `active` FROM `".$strTable."` WHERE $strDomainWhere1 - AND `".$strTabField."` <> '' AND `".$strTabField."` IS NOT NULL AND `access_group` IN ($strAccess) ORDER BY `".$strTabField."`"; - } - // Process data - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrDataRaw,$intDataCount); - if (($booReturn == false) && ($strSQL != "")) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - if ($strTable == 'tbl_group') { - $arrTemp = ""; - $arrTemp['key'] = 0; - $arrTemp['value'] = translate('Unrestricted access'); - $arrData[] = $arrTemp; - } - if ($booReturn && ($intDataCount != 0)) { - foreach ($arrDataRaw AS $elem) { - $arrData[] = $elem; - } - return(0); - } else { - if ($strTable == 'tbl_group') return(0); - $arrData = array('key' => 0, 'value' => 'no data'); - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Help function: Get selected data - /////////////////////////////////////////////////////////////////////////////////////////// - // $strLinkTable -> Link table name - // $arrSelect -> Selected data array - // $intOption -> Option parameter - // Return value -> 0=successful / 1=error - /////////////////////////////////////////////////////////////////////////////////////////// - function getSelectedItems($strLinkTable,&$arrSelect,$intOption=0) { - // Define SQL commands - if ($intOption == 8) { - $strSQL = "SELECT * FROM `".$strLinkTable."` WHERE `idSlave`=".$this->dataId; - } else { - $strSQL = "SELECT * FROM `".$strLinkTable."` WHERE `idMaster`=".$this->dataId; - } - // Process data - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrSelectedRaw,$intDataCount); - if ($booReturn == false) $this->strErrorMessage .= $this->myDBClass->strErrorMessage; - if ($booReturn && ($intDataCount != 0)) { - foreach($arrSelectedRaw AS $elem) { - // Multi tables - if ($strLinkTable == 'tbl_lnkServicegroupToService') { - if (isset($elem['exclude']) && ($elem['exclude'] == 1)) { - $arrSelect[] = "e".$elem['idSlaveH']."::".$elem['idSlaveHG']."::".$elem['idSlaveS']; - } else { - $arrSelect[] = $elem['idSlaveH']."::".$elem['idSlaveHG']."::".$elem['idSlaveS']; - } - // Servicedependencies and -escalations - } else if (($strLinkTable == 'tbl_lnkServicedependencyToService_DS') || - ($strLinkTable == 'tbl_lnkServicedependencyToService_S') || - ($strLinkTable == 'tbl_lnkServiceescalationToService')) { - if (isset($elem['exclude']) && ($elem['exclude'] == 1)) { - $arrSelect[] = "e::".$elem['strSlave']; - } else { - $arrSelect[] = $elem['strSlave']; - } - // Standard tables - } else { - if ($intOption == 8) { - if (isset($elem['exclude']) && ($elem['exclude'] == 1)) { - $arrSelect[] = "e".$elem['idMaster']; - } else { - $arrSelect[] = $elem['idMaster']; - } - } else { - if (isset($elem['exclude']) && ($elem['exclude'] == 1)) { - $arrSelect[] = "e".$elem['idSlave']; - } else { - $arrSelect[] = $elem['idSlave']; - } - } - } - } - return(0); - } else { - return(1); - } - } -} -?> \ No newline at end of file diff --git a/functions/prepend_adm.php b/functions/prepend_adm.php index a9a2734..2c7023d 100644 --- a/functions/prepend_adm.php +++ b/functions/prepend_adm.php @@ -2,51 +2,46 @@ /////////////////////////////////////////////////////////////////////////////// // // NagiosQL +// /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Preprocessing script -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// -//error_reporting(E_ALL); error_reporting(E_ALL & ~E_STRICT); // -// Security Protection -// =================== -if (isset($_GET['SETS']) || isset($_POST['SETS'])) { - $SETS = ""; -} -// // Timezone settings (>=PHP5.1) // ============================ -if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")) { - @date_default_timezone_set(@date_default_timezone_get()); +if (function_exists('date_default_timezone_set') and function_exists('date_default_timezone_get')) { + date_default_timezone_set(date_default_timezone_get()); } // // Process post/get parameters // =========================== -$chkInsName = isset($_POST['tfUsername']) ? $_POST['tfUsername'] : ""; -$chkInsPasswd = isset($_POST['tfPassword']) ? $_POST['tfPassword'] : ""; -$chkLogout = isset($_GET['logout']) ? htmlspecialchars($_GET['logout'], ENT_QUOTES, 'utf-8') : "rr"; +$chkInsName = filter_input(INPUT_POST, 'tfUsername', FILTER_SANITIZE_STRING); +$chkInsPasswd = filter_input(INPUT_POST, 'tfPassword', FILTER_SANITIZE_STRING); +$chkLogout = filter_input(INPUT_GET, 'logout', FILTER_SANITIZE_STRING, array('options' => array('default' => 'rr'))); // // Define common variables // ======================= -$strErrorMessage = ""; // All error messages (red) -$strInfoMessage = ""; // All information messages (green) -$strConsistMessage = ""; // Consistency message -$tplHeaderVar = ""; -$chkDomainId = 0; -$chkGroupAdm = 0; -$intError = 0; -$setDBVersion = "unknown"; -$setFileVersion = "3.3.0"; +if ((filter_input(INPUT_GET, 'SETS') != null) || (filter_input(INPUT_POST, 'SETS') != null)) { + $SETS = ''; // For security reason +} +$strErrorMessage = ''; // All error messages (red) +$strInfoMessage = ''; // All information messages (green) +$strConsistMessage = ''; // Consistency message +$tplHeaderVar = ''; +$chkDomainId = 0; +$chkGroupAdm = 0; +$intError = 0; +$setDBVersion = 'unknown'; +$setFileVersion = '3.4.0'; // // Start PHP session // ================= @@ -54,530 +49,647 @@ session_start(); // // Check path settings // =================== -if (!isset($_SESSION['SETS']['path']['base_url']) || !isset($_SESSION['SETS']['path']['base_path'])) { - if (substr_count($_SERVER['SCRIPT_NAME'],"index.php") != 0) { - $preBasePath = str_replace("//","/",dirname($_SERVER['SCRIPT_FILENAME'])."/"); - $preBaseURL = str_replace("//","/",dirname($_SERVER['SCRIPT_NAME'])."/"); - $_SESSION['SETS']['path']['base_url'] = $preBaseURL; - $_SESSION['SETS']['path']['base_path'] = $preBasePath; - } else { - header("Location: ../index.php"); - exit; - } +if (substr_count(filter_input(INPUT_SERVER, 'SCRIPT_NAME', FILTER_SANITIZE_STRING), 'index.php') != 0) { + $preBasePath = str_replace('//', '/', dirname(filter_input( + INPUT_SERVER, + 'SCRIPT_FILENAME', + FILTER_SANITIZE_STRING + )). '/'); + $preBaseURL = str_replace('//', '/', dirname(filter_input( + INPUT_SERVER, + 'SCRIPT_NAME', + FILTER_SANITIZE_STRING + )). '/'); + $_SESSION['SETS']['path']['base_url'] = $preBaseURL; + $_SESSION['SETS']['path']['base_path'] = $preBasePath; +} elseif (!isset($_SESSION['SETS']['path']['base_url']) || !isset($_SESSION['SETS']['path']['base_path'])) { + header('Location: ../index.php'); + exit; } else { - if (substr_count($_SERVER['SCRIPT_NAME'],"index.php") != 0) { - $preBasePath_tmp = str_replace("//","/",dirname($_SERVER['SCRIPT_FILENAME'])."/"); - $preBaseURL_tmp = str_replace("//","/",dirname($_SERVER['SCRIPT_NAME'])."/"); - if ($preBaseURL_tmp != $_SESSION['SETS']['path']['base_url']) { - $_SESSION['SETS']['path']['base_url'] = $preBaseURL_tmp; - $_SESSION['SETS']['path']['base_path'] = $preBasePath_tmp; - } - } - $preBasePath = $_SESSION['SETS']['path']['base_path']; - $preBaseURL = $_SESSION['SETS']['path']['base_url']; + $preBaseURL = $_SESSION['SETS']['path']['base_url']; + $preBasePath = $_SESSION['SETS']['path']['base_path']; } // // Start installer // =============== $preIniFile = $preBasePath.'config/settings.php'; -if (!file_exists($preIniFile) OR ! is_readable($preIniFile)) { - header("Location: ".$preBaseURL."install/index.php"); +if (!file_exists($preIniFile) || !is_readable($preIniFile)) { + header('Location: '.$preBaseURL.'install/index.php'); + exit; } // // Read file settings // ================== -$SETS = parse_ini_file($preBasePath.'config/settings.php',true); -if (!isset($_SESSION['SETS']['db'])) $_SESSION['SETS']['db'] = $SETS['db']; +$SETS = parse_ini_file($preBasePath.'config/settings.php', true); +if (!isset($_SESSION['SETS']['db'])) { + $_SESSION['SETS']['db'] = $SETS['db']; +} // -// Include external function/class files - part 1 -// ============================================== -include("mysqli_class.php"); -require("translator.php"); +// Include external function/class files +// ===================================== +require $preBasePath.'functions/Autoloader.php'; +require $preBasePath.'functions/translator.php'; +functions\Autoloader::register($preBasePath); // // Initialize classes - part 1 // =========================== -$myDBClass = new mysqlidb; -$myDBClass->arrParams = $SETS['db']; -$myDBClass->getDatabase(); +$myDBClass = new functions\MysqliDbClass; +$myDBClass->arrParams = $_SESSION['SETS']['db']; +$myDBClass->hasDBConnection(); if ($myDBClass->error == true) { - $strDBMessage = $myDBClass->strErrorMessage; - $booError = $myDBClass->error; + $strDBMessage = $myDBClass->strErrorMessage; + $booError = $myDBClass->error; + $intError = 1; } // // Get additional configuration from the table tbl_settings // ======================================================== if ($intError == 0) { - $strSQL = "SELECT `category`,`name`,`value` FROM `tbl_settings`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $strErrorMessage .= translate('Error while selecting data from database:')."::".$myDBClass->strErrorMessage; - $intError = 1; - } else if ($intDataCount != 0) { - if (isset($_SESSION['SETS']['data']['locale']) && ($_SESSION['SETS']['data']['locale'] != "")) $strStoreLanguage = $_SESSION['SETS']['data']['locale']; - // Save additional configuration information - for ($i=0;$i<$intDataCount;$i++) { - // We use the path settings from file - if ($arrDataLines[$i]['name'] == 'base_url') continue; - if ($arrDataLines[$i]['name'] == 'base_path') continue; - $SETS[$arrDataLines[$i]['category']][$arrDataLines[$i]['name']] = $arrDataLines[$i]['value']; - } - if (isset($strStoreLanguage) && ($strStoreLanguage != "")) $SETS['data']['locale'] = $strStoreLanguage; - } + $strSQL = 'SELECT `category`,`name`,`value` FROM `tbl_settings`'; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn == false) { + $strErrorMessage .= translate('Error while selecting data from database:'). '::' .$myDBClass->strErrorMessage; + $intError = 1; + } elseif ($intDataCount != 0) { + if (isset($_SESSION['SETS']['data']['locale']) && ($_SESSION['SETS']['data']['locale'] != '')) { + $strStoreLanguage = $_SESSION['SETS']['data']['locale']; + } + // Save additional configuration information + for ($i = 0; $i < $intDataCount; $i++) { + // We use the path settings from file + if ($arrDataLines[$i]['name'] == 'base_url') { + continue; + } + if ($arrDataLines[$i]['name'] == 'base_path') { + continue; + } + $SETS[$arrDataLines[$i]['category']][$arrDataLines[$i]['name']] = $arrDataLines[$i]['value']; + } + if (isset($strStoreLanguage) && ($strStoreLanguage != '')) { + $SETS['data']['locale'] = $strStoreLanguage; + } + } } // // Enable PHP gettext functionality // ================================ if ($intError == 0) { - $arrLocale = explode(".",$SETS['data']['locale']); - $strDomain = $arrLocale[0]; - $strLocale = setlocale(LC_ALL, $SETS['data']['locale'], $SETS['data']['locale'].".utf-8", $SETS['data']['locale'].".utf-8", $SETS['data']['locale'].".utf8", "en_GB", "en_GB.utf-8", "en_GB.utf8"); - if (!isset($strLocale)) { - $strErrorMessage .= translate("Error in setting the correct locale, please report this error with the associated output of 'locale -a' to bugs@nagiosql.org")."::"; - $intError = 1; - } - putenv("LC_ALL=".$SETS['data']['locale'].".utf-8"); - putenv("LANG=".$SETS['data']['locale'].".utf-8"); - bindtextdomain($strDomain, $preBasePath."config/locale"); - bind_textdomain_codeset($strDomain, $SETS['data']['encoding']); - textdomain($strDomain); + $arrLocale = explode('.', $SETS['data']['locale']); + $strDomain = $arrLocale[0]; + $strLocale = setlocale( + LC_ALL, + $SETS['data']['locale'], + $SETS['data']['locale']. '.utf-8', + $SETS['data']['locale']. '.utf-8', + $SETS['data']['locale']. '.utf8', + 'en_GB', + 'en_GB.utf-8', + 'en_GB.utf8' + ); + if (!isset($strLocale)) { + $strErrorMessage .= translate('Error setting the correct locale. Please report this error with the associated ' + . "output of 'locale -a'"). '::'; + $intError = 1; + } + putenv('LC_ALL=' .$SETS['data']['locale']. '.utf-8'); + putenv('LANG=' .$SETS['data']['locale']. '.utf-8'); + bindtextdomain($strDomain, $preBasePath. 'config/locale'); + bind_textdomain_codeset($strDomain, $SETS['data']['encoding']); + textdomain($strDomain); } -// -// Update class data -// ================= -$myDBClass->arrSettings = $SETS; // // Include external function/class files // ===================================== -include("nag_class.php"); -include("data_class.php"); -include("config_class.php"); -include("content_class.php"); -require_once($preBasePath.'libraries/pear/HTML/Template/IT.php'); +require_once $preBasePath.'libraries/pear/HTML/Template/IT.php'; if (isset($preFieldvars) && ($preFieldvars == 1)) { - require($preBasePath.'config/fieldvars.php'); + require $preBasePath.'config/fieldvars.php'; } // // Check path settings // =================== if (!isset($SETS['path']['base_path']) || ($preBasePath != $SETS['path']['base_path'])) { - $SETS['path']['base_path'] = $preBasePath; + $SETS['path']['base_path'] = $preBasePath; } if (!isset($SETS['path']['base_url']) || ($preBaseURL != $SETS['path']['base_url'])) { - $SETS['path']['base_url'] = $preBaseURL; + $SETS['path']['base_url'] = $preBaseURL; } // // Add data to the session // ======================= -$_SESSION['SETS'] = $SETS; -$_SESSION['strLoginMessage'] = ""; -$_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url']."admin.php"; -if (!isset($_SESSION['logged_in'])) $_SESSION['logged_in'] = 0; -if (isset($chkLogout) && ($chkLogout == "yes")) { - $_SESSION = array(); - $_SESSION['SETS'] = $SETS; - $_SESSION['logged_in'] = 0; - $_SESSION['userid'] = 0; - $_SESSION['groupadm'] = 0; - $_SESSION['strLoginMessage'] = ""; - $_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url']."admin.php"; - // Get default language - $strSQL = "SELECT `value` FROM `tbl_settings` WHERE `category`='data' AND `name`='locale'"; - $strLocale = $myDBClass->getFieldData($strSQL); - if ($strLocale != "") { - $_SESSION['SETS']['data']['locale'] = $strLocale; - $SETS['data']['locale'] = $strLocale; - } - $arrLocale = explode(".",$SETS['data']['locale']); - $strDomain = $arrLocale[0]; - $strLocale = setlocale(LC_ALL, $SETS['data']['locale'], $SETS['data']['locale'].".utf-8", $SETS['data']['locale'].".utf-8", $SETS['data']['locale'].".utf8", "en_GB", "en_GB.utf-8", "en_GB.utf8"); - if (!isset($strLocale)) { - $strErrorMessage .= translate("Error in setting the correct locale, please report this error with the associated output of 'locale -a' to bugs@nagiosql.org")."::"; - $intError = 1; - } - putenv("LC_ALL=".$SETS['data']['locale'].".utf-8"); - putenv("LANG=".$SETS['data']['locale'].".utf-8"); - bindtextdomain($strDomain, $preBasePath ."config/locale"); - bind_textdomain_codeset($strDomain, $SETS['data']['encoding']); - textdomain($strDomain); +$_SESSION['SETS'] = $SETS; +$_SESSION['strLoginMessage'] = ''; +$_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url']. 'admin.php'; +if (!isset($_SESSION['logged_in'])) { + $_SESSION['logged_in'] = 0; +} +// Reload locale after logout +if (isset($chkLogout) && ($chkLogout == 'yes')) { + $_SESSION = array(); + $_SESSION['SETS'] = $SETS; + $_SESSION['logged_in'] = 0; + $_SESSION['userid'] = 0; + $_SESSION['groupadm'] = 0; + $_SESSION['strLoginMessage'] = ''; + $_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url']. 'admin.php'; + // Get default language + $strSQL = "SELECT `value` FROM `tbl_settings` WHERE `category`='data' AND `name`='locale'"; + $strLocaleDB = $myDBClass->getFieldData($strSQL); + if ($strLocaleDB != '') { + $_SESSION['SETS']['data']['locale'] = $strLocaleDB; + $SETS['data']['locale'] = $strLocaleDB; + } + $arrLocale = explode('.', $SETS['data']['locale']); + $strDomain = $arrLocale[0]; + $strLocale = setlocale( + LC_ALL, + $SETS['data']['locale'], + $SETS['data']['locale']. '.utf-8', + $SETS['data']['locale']. '.utf-8', + $SETS['data']['locale']. '.utf8', + 'en_GB', + 'en_GB.utf-8', + 'en_GB.utf8' + ); + if (!isset($strLocale)) { + $strErrorMessage .= translate('Error in setting the correct locale, please report this error with the ' + . "associated output of 'locale -a' to bugs@nagiosql.org"). '::'; + $intError = 1; + } + putenv('LC_ALL=' .$SETS['data']['locale']. '.utf-8'); + putenv('LANG=' .$SETS['data']['locale']. '.utf-8'); + bindtextdomain($strDomain, $preBasePath . 'config/locale'); + bind_textdomain_codeset($strDomain, $SETS['data']['encoding']); + textdomain($strDomain); +} +// Hide menu +if (filter_input(INPUT_GET, 'menu') != null) { + if (filter_input(INPUT_GET, 'menu', FILTER_SANITIZE_STRING) == 'visible') { + $_SESSION['menu'] = 'visible'; + } elseif (filter_input(INPUT_GET, 'menu', FILTER_SANITIZE_STRING) == 'invisible') { + $_SESSION['menu'] = 'invisible'; + } } -if (isset($_GET['menu']) && (htmlspecialchars($_GET['menu'], ENT_QUOTES, 'utf-8') == "visible")) $_SESSION['menu'] = "visible"; -if (isset($_GET['menu']) && (htmlspecialchars($_GET['menu'], ENT_QUOTES, 'utf-8') == "invisible")) $_SESSION['menu'] = "invisible"; // // Initialize classes // ================== -$myVisClass = new nagvisual; -$myDataClass = new nagdata; -$myConfigClass = new nagconfig; -$myContentClass = new nagcontent; +$myVisClass = new functions\NagVisualClass($_SESSION); +$myDataClass = new functions\NagDataClass($_SESSION); +$myConfigClass = new functions\NagConfigClass($_SESSION); +$myContentClass = new functions\NagContentClass($_SESSION); // // Propagating the classes themselves // ================================== -$myVisClass->myDBClass =& $myDBClass; -$myVisClass->myDataClass =& $myDataClass; -$myVisClass->myConfigClass =& $myConfigClass; -$myDataClass->myDBClass =& $myDBClass; -$myDataClass->myVisClass =& $myVisClass; -$myDataClass->myConfigClass =& $myConfigClass; -$myConfigClass->myDBClass =& $myDBClass; -$myConfigClass->myVisClass =& $myVisClass; -$myConfigClass->myDataClass =& $myDataClass; -$myContentClass->myVisClass =& $myVisClass; -$myContentClass->myDBClass =& $myDBClass; -$myContentClass->myConfigClass =& $myConfigClass; -if (isset($arrDescription)) $myContentClass->arrDescription = $arrDescription; -$strErrorMessage = str_replace("::","
",$strErrorMessage); +$myVisClass->myDBClass =& $myDBClass; +$myVisClass->myConfigClass =& $myConfigClass; +// +$myDataClass->myDBClass =& $myDBClass; +$myDataClass->myVisClass =& $myVisClass; +$myDataClass->myConfigClass =& $myConfigClass; +// +$myConfigClass->myDBClass =& $myDBClass; +$myConfigClass->myDataClass =& $myDataClass; +// +$myContentClass->myDBClass =& $myDBClass; +$myContentClass->myVisClass =& $myVisClass; +$myContentClass->myConfigClass =& $myConfigClass; +if (isset($arrDescription)) { + $myContentClass->arrDescription = $arrDescription; +} // // Version management // ================== if ($intError == 0) { - $setDBVersion = $SETS['db']['version']; + $setDBVersion = $SETS['db']['version']; } // // Version check // ============= -if (version_compare($setFileVersion,$setDBVersion,'>') AND (file_exists($preBasePath."install") && is_readable($preBasePath."install"))) { - header("Location: ". $_SESSION['SETS']['path']['base_url']."install/index.php"); +if (version_compare($setFileVersion, $setDBVersion, '>') && (file_exists($preBasePath. 'install') && + is_readable($preBasePath. 'install'))) { + header('Location: '. $_SESSION['SETS']['path']['base_url'].'install/index.php'); + exit; } -// +// // Browser Check // ============= $preBrowser = $myVisClass->browserCheck(); // // Login process // ============== -if (isset($_SERVER['REMOTE_USER']) && ($_SERVER['REMOTE_USER'] != "") && ($_SESSION['logged_in'] == 0) && - ($chkLogout != "yes") && ($chkInsName == "")) { - $strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".$_SERVER['REMOTE_USER']."' AND `wsauth`='1' AND `active`='1'"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataUser,$intDataCount); - if ($booReturn && ($intDataCount == 1)) { - // Set session variables - $_SESSION['username'] = $arrDataUser[0]['username']; - $_SESSION['userid'] = $arrDataUser[0]['id']; - $_SESSION['groupadm'] = $arrDataUser[0]['admin_enable']; - $_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url']."admin.php"; - $_SESSION['timestamp'] = time(); - $_SESSION['logged_in'] = 1; - $_SESSION['domain'] = $arrDataUser[0]['domain']; - // Update language settings - $strSQL = "SELECT `locale` FROM `tbl_language` WHERE `id`='".$arrDataUser[0]['language']."' AND `active`='1'"; - $strUserLocale = $myDBClass->getFieldData($strSQL); - if ($strUserLocale != "") { - $_SESSION['SETS']['data']['locale'] = $strUserLocale; - $SETS['data']['locale'] = $strUserLocale; - } - // Update last login time - $strSQLUpdate = "UPDATE `tbl_user` SET `last_login`=NOW() WHERE `username`='".$myDBClass->real_escape($chkInsName)."'"; - $booReturn = $myDBClass->insertData($strSQLUpdate); - $myDataClass->writeLog(translate('Webserver login successfull')); - $_SESSION['strLoginMessage'] = ""; - // Redirect to start page - header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['startsite']); - } +$strRemoteUser = filter_input(INPUT_SERVER, 'REMOTE_USER', FILTER_SANITIZE_STRING); +if (isset($strRemoteUser) && ($strRemoteUser != '') && ($_SESSION['logged_in'] == 0) && + ($chkLogout != 'yes') && ($chkInsName == '')) { + $strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".$strRemoteUser."' AND `wsauth`='1' AND `active`='1'"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataUser, $intDataCount); + if ($booReturn && ($intDataCount == 1)) { + // Set session variables + $_SESSION['username'] = $arrDataUser[0]['username']; + $_SESSION['userid'] = $arrDataUser[0]['id']; + $_SESSION['groupadm'] = $arrDataUser[0]['admin_enable']; + $_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url']. 'admin.php'; + $_SESSION['timestamp'] = time(); + $_SESSION['logged_in'] = 1; + $_SESSION['domain'] = $arrDataUser[0]['domain']; + // Update language settings + $strSQL = 'SELECT `locale` FROM `tbl_language` ' + . "WHERE `id`='".$arrDataUser[0]['language']."' AND `active`='1'"; + $strUserLocale = $myDBClass->getFieldData($strSQL); + if ($strUserLocale != '') { + $_SESSION['SETS']['data']['locale'] = $strUserLocale; + $SETS['data']['locale'] = $strUserLocale; + } + // Update last login time + $strSQLUpdate = 'UPDATE `tbl_user` SET `last_login`=NOW() ' + . "WHERE `username`='".$myDBClass->realEscape($chkInsName)."'"; + $booReturn = $myDBClass->insertData($strSQLUpdate); + $myDataClass->strUserName = $arrDataUser[0]['username']; + $myDataClass->writeLog(translate('Webserver login successfull')); + $_SESSION['strLoginMessage'] = ''; + // Redirect to start page + header('Location: ' .$_SESSION['SETS']['path']['protocol']. '://' . + filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING).$_SESSION['startsite']); + exit; + } } -if (($_SESSION['logged_in'] == 0) && isset($chkInsName) && ($chkInsName != "") && ($intError == 0)) { - $chkInsName = $myDBClass->real_escape($chkInsName); - $chkInsPasswd = $myDBClass->real_escape($chkInsPasswd); - $strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".$chkInsName."' - AND `password`=MD5('".$chkInsPasswd."') AND `active`='1'"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataUser,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - $_SESSION['strLoginMessage'] = $strErrorMessage; - } else if ($intDataCount == 1) { - // Set session variables - $_SESSION['username'] = $arrDataUser[0]['username']; - $_SESSION['userid'] = $arrDataUser[0]['id']; - $_SESSION['groupadm'] = $arrDataUser[0]['admin_enable']; - $_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url'] ."admin.php"; - $_SESSION['timestamp'] = time(); - $_SESSION['logged_in'] = 1; - $_SESSION['domain'] = $arrDataUser[0]['domain']; - // Update language settings - $strSQL = "SELECT `locale` FROM `tbl_language` WHERE `id`='".$arrDataUser[0]['language']."' AND `active`='1'"; - $strUserLocale = $myDBClass->getFieldData($strSQL); - if ($strUserLocale != "") { - $_SESSION['SETS']['data']['locale'] = $strUserLocale; - $SETS['data']['locale'] = $strUserLocale; - } - // Update last login time - $strSQLUpdate = "UPDATE `tbl_user` SET `last_login`=NOW() WHERE `username`='".$myDBClass->real_escape($chkInsName)."'"; - $booReturn = $myDBClass->insertData($strSQLUpdate); - $myDataClass->writeLog(translate('Login successfull')); - $_SESSION['strLoginMessage'] = ""; - // Redirect to start page - header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['startsite']); - } else { - $_SESSION['strLoginMessage'] = translate('Login failed!'); - $myDataClass->writeLog(translate('Login failed!')." - Username: ".$chkInsName); - $preNoMain = 0; - } -} -if (($_SESSION['logged_in'] == 0) && (!isset($intPageID) || ($intPageID != 0)) && (!isset($chkInsName) || ($chkInsName == ""))) { - header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['SETS']['path']['base_url']."index.php"); +if (($_SESSION['logged_in'] == 0) && isset($chkInsName) && ($chkInsName != '') && ($intError == 0)) { + $chkInsName = $myDBClass->realEscape($chkInsName); + $chkInsPasswd = $myDBClass->realEscape($chkInsPasswd); + $strSQL = 'SELECT * FROM `tbl_user` ' + . "WHERE `username`='".$chkInsName."' AND `password`=MD5('".$chkInsPasswd."') AND `active`='1'"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataUser, $intDataCount); + if ($booReturn == false) { + $strErrorMessage = str_replace('::', '
', $strErrorMessage); + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + $_SESSION['strLoginMessage'] = $strErrorMessage; + } elseif ($intDataCount == 1) { + // Set session variables + $_SESSION['username'] = $arrDataUser[0]['username']; + $_SESSION['userid'] = $arrDataUser[0]['id']; + $_SESSION['groupadm'] = $arrDataUser[0]['admin_enable']; + $_SESSION['startsite'] = $_SESSION['SETS']['path']['base_url'] . 'admin.php'; + $_SESSION['timestamp'] = time(); + $_SESSION['logged_in'] = 1; + $_SESSION['domain'] = $arrDataUser[0]['domain']; + // Update language settings + $strSQL = 'SELECT `locale` FROM `tbl_language` ' + . "WHERE `id`='".$arrDataUser[0]['language']."' AND `active`='1'"; + $strUserLocale = $myDBClass->getFieldData($strSQL); + if ($strUserLocale != '') { + $_SESSION['SETS']['data']['locale'] = $strUserLocale; + $SETS['data']['locale'] = $strUserLocale; + } + // Update last login time + $strSQLUpdate = 'UPDATE `tbl_user` SET `last_login`=NOW() ' + . "WHERE `username`='".$myDBClass->realEscape($chkInsName)."'"; + $booReturn = $myDBClass->insertData($strSQLUpdate); + $myDataClass->strUserName = $arrDataUser[0]['username']; + $myDataClass->writeLog(translate('Login successfull')); + $_SESSION['strLoginMessage'] = ''; + // Redirect to start page + header('Location: ' .$_SESSION['SETS']['path']['protocol']. '://' . + filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING).$_SESSION['startsite']); + exit; + } else { + $_SESSION['strLoginMessage'] = translate('Login failed!'); + $myDataClass->writeLog(translate('Login failed!'). ' - Username: ' .$chkInsName); + $preNoMain = 0; + } +} +if (($_SESSION['logged_in'] == 0) && (!isset($intPageID) || ($intPageID != 0)) && + (!isset($chkInsName) || ($chkInsName == ''))) { + header('Location: ' .$_SESSION['SETS']['path']['protocol']. '://' . + filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING). + $_SESSION['SETS']['path']['base_url']. 'index.php'); + exit; } if (!isset($_SESSION['userid']) && ($_SESSION['logged_in'] == 1)) { - $_SESSION['logged_in'] = 0; - header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['SETS']['path']['base_url']."index.php"); + $_SESSION['logged_in'] = 0; + header('Location: ' .$_SESSION['SETS']['path']['protocol']. '://' . + filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING). + $_SESSION['SETS']['path']['base_url']. 'index.php'); + exit; } // // Review and update login // ======================= if (($_SESSION['logged_in'] == 1) && ($intError == 0)) { - $strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".$myDBClass->real_escape($_SESSION['username'])."'"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataUser,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else if ($intDataCount == 1) { - // Time expired? - if (time() - $_SESSION['timestamp'] > $_SESSION['SETS']['security']['logofftime']) { - // Force new login - $myDataClass->writeLog(translate('Session timeout reached - Seconds:')." ".(time() - $_SESSION['timestamp']." - User: ".$_SESSION['username'])); - $_SESSION['logged_in'] = 0; - - header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['SETS']['path']['base_url']."index.php"); - } else { - // Check rights - if (isset($preAccess) && ($preAccess == 1) && (isset($prePageId) && ($prePageId != 0))) { - $strKey = $myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=$prePageId"); - $intResult = $myVisClass->checkAccGroup($strKey,'read'); - // If no rights - redirect to index page - if ($intResult != 0) { - $myDataClass->writeLog(translate('Restricted site accessed:')." ".filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); - header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['SETS']['path']['base_url']."index.php"); - } - } - // Update login time - $_SESSION['timestamp'] = time(); - if (isset($preContent) && ($preContent == "index.tpl.htm")) { - header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['startsite']); - } - } - } else { - // Force new login - $myDataClass->writeLog(translate('User not found in database')); - $_SESSION['logged_in'] = 0; - header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['SETS']['path']['base_url']."index.php"); - } + $strSQL = "SELECT * FROM `tbl_user` WHERE `username`='".$myDBClass->realEscape($_SESSION['username'])."'"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataUser, $intDataCount); + if ($booReturn == false) { + $strErrorMessage = str_replace('::', '
', $strErrorMessage); + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } elseif ($intDataCount == 1) { + // Time expired? + if (time() - $_SESSION['timestamp'] > $_SESSION['SETS']['security']['logofftime']) { + // Force new login + $myDataClass->writeLog(translate('Session timeout reached - Seconds:'). ' ' . + (time() - $_SESSION['timestamp']. ' - User: ' .$_SESSION['username'])); + $_SESSION['logged_in'] = 0; + + header('Location: ' .$_SESSION['SETS']['path']['protocol']. '://' . + filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING). + $_SESSION['SETS']['path']['base_url']. 'index.php'); + exit; + } + // Check rights + if (isset($preAccess) && ($preAccess == 1) && (isset($prePageId) && ($prePageId != 0))) { + $strKey = $myDBClass->getFieldData("SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=$prePageId"); + $intResult = $myVisClass->checkAccountGroup($strKey, 'read'); + // If no rights - redirect to index page + if ($intResult != 0) { + $myDataClass->writeLog(translate('Restricted site accessed:'). ' ' . + filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); + header('Location: ' .$_SESSION['SETS']['path']['protocol']. '://' . + filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING). + $_SESSION['SETS']['path']['base_url']. 'index.php'); + exit; + } + } + // Update login time + $_SESSION['timestamp'] = time(); + if (isset($preContent) && ($preContent == 'index.htm.tpl')) { + header('Location: ' .$_SESSION['SETS']['path']['protocol']. '://' . + filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING).$_SESSION['startsite']); + exit; + } + } else { + // Force new login + $myDataClass->writeLog(translate('User not found in database')); + $_SESSION['logged_in'] = 0; + header('Location: ' .$_SESSION['SETS']['path']['protocol']. '://' . + filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING). + $_SESSION['SETS']['path']['base_url']. 'index.php'); + exit; + } } // // Check access to current site // ============================ if (isset($prePageId) && ($prePageId != 1)) { if (!isset($_SESSION['userid'])) { - header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['SETS']['path']['base_url']."index.php"); - } - $strSQL = "SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=$prePageId"; - $prePageKey = $myDBClass->getFieldData($strSQL)+0; - if ($myVisClass->checkAccGroup($prePageKey,'read') != 0) { - header("Location: ".$_SESSION['SETS']['path']['protocol']."://".$_SERVER['HTTP_HOST'].$_SESSION['startsite']); - } + header('Location: ' .$_SESSION['SETS']['path']['protocol']. '://' . + filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING). + $_SESSION['SETS']['path']['base_url']. 'index.php'); + exit; + } + $strSQL = "SELECT `mnuGrpId` FROM `tbl_menu` WHERE `mnuId`=$prePageId"; + $prePageKey = (int)$myDBClass->getFieldData($strSQL); + if ($myVisClass->checkAccountGroup($prePageKey, 'read') != 0) { + header('Location: ' .$_SESSION['SETS']['path']['protocol']. '://' . + filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING). + $_SESSION['startsite']); + exit; + } } // // Insert main template // ==================== -if (isset($preContent) && ($preContent != "") && (!isset($preNoMain) || ($preNoMain != 1))) { - $arrTplOptions = array('use_preg' => false); - $maintp = new HTML_Template_IT($preBasePath ."templates/"); - $maintp->loadTemplatefile("main.tpl.htm", true, true); - $maintp->setOptions($arrTplOptions); - $maintp->setVariable("META_DESCRIPTION","NagiosQL System Monitoring Administration Tool"); - $maintp->setVariable("AUTHOR","NagiosQL Team"); - $maintp->setVariable("LANGUAGE","de"); - $maintp->setVariable("PUBLISHER","www.nagiosql.org"); - if ($_SESSION['logged_in'] == 1) { - $maintp->setVariable("ADMIN","
".translate('Administration').""); - //$maintp->setVariable("PLUGINS","".translate('Plugins').""); - } - $maintp->setVariable("BASE_PATH",$_SESSION['SETS']['path']['base_url']); - $maintp->setVariable("ROBOTS","noindex,nofollow"); - $maintp->setVariable("PAGETITLE","NagiosQL - Version ".$setDBVersion); - $maintp->setVariable("IMAGEDIR",$_SESSION['SETS']['path']['base_url'] ."images/"); - if (isset($prePageId) && ($intError == 0)) $maintp->setVariable("POSITION",$myVisClass->getPosition($prePageId,translate('Admin'))); - $maintp->parse("header"); - $tplHeaderVar = $maintp->get("header"); - // - // Read domain list - // ================ - if (($_SESSION['logged_in'] == 1) && ($intError == 0)) { - $intDomain = isset($_POST['selDomain']) ? $_POST['selDomain'] : -1; - if ($intDomain != -1) { - $_SESSION['domain'] = $intDomain; - $myVisClass->intDomainId = $intDomain; - $myDataClass->intDomainId = $intDomain; - $myConfigClass->intDomainId = $intDomain; - $myContentClass->intDomainId = $intDomain; - } - $strSQL = "SELECT * FROM `tbl_datadomain` WHERE `active` <> '0' ORDER BY `domain`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataDomain,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - $intDomain = 0; - if ($intDataCount > 0) { - foreach($arrDataDomain AS $elem) { - $intIsDomain = 0; - // Check access rights - if ($myVisClass->checkAccGroup($elem['access_group'],'read') == 0) { - $maintp->setVariable("DOMAIN_VALUE",$elem['id']); - $maintp->setVariable("DOMAIN_TEXT",$elem['domain']); - if (isset($_SESSION['domain']) && ($_SESSION['domain'] == $elem['id'])) { - $maintp->setVariable("DOMAIN_SELECTED","selected"); - $intDomain = $elem['id']; - $intIsDomain = 1; - } - if ($intDomain == -1) { - $intDomain = $elem['id']; - $intIsDomain = 1; - } - $maintp->parse("domainsel"); - } - if ($intIsDomain == 0) { - // Select available an domain - $strDomAcc = $myVisClass->getAccGroups('read'); - $strSQL = "SELECT id FROM `tbl_datadomain` WHERE `active` <> '0' AND `access_group` IN (".$strDomAcc.") ORDER BY domain LIMIT 1"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataDomain,$intDataCount); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - } else { - if ($intDataCount != 0) $intDomain = $arrDataDomain[0]['id']; - } - } - } - $maintp->setVariable("DOMAIN_INFO",translate("Domain").":"); - $maintp->parse("dselect"); - $tplHeaderVar .= $maintp->get("dselect"); - } - } - } - // - // Show login information - // ====================== - if ($_SESSION['logged_in'] == 1) { - $maintp->setVariable("LOGIN_INFO",translate('Logged in:')." ".$_SESSION['username']); - $maintp->setVariable("LOGOUT_INFO","".translate('Logout').""); - } else { - $maintp->setVariable("LOGOUT_INFO"," "); - } - // - // Build content menu - // ================== - if (isset($prePageId) && ($prePageId != 0)) $maintp->setVariable("MAINMENU",$myVisClass->getMenu($prePageId)); - $maintp->parse("header2"); - $tplHeaderVar .= $maintp->get("header2"); - if (!isset($preShowHeader) || $preShowHeader == 1) { - echo $tplHeaderVar; - } +if (isset($preContent) && ($preContent != '') && (!isset($preNoMain) || ($preNoMain != 1))) { + $arrTplOptions = array('use_preg' => false); + $maintp = new HTML_Template_IT($preBasePath . 'templates/'); + $maintp->loadTemplatefile('main.htm.tpl', true, true); + $maintp->setOptions($arrTplOptions); + $maintp->setVariable('META_DESCRIPTION', 'NagiosQL System Monitoring Administration Tool'); + $maintp->setVariable('AUTHOR', 'NagiosQL Team'); + $maintp->setVariable('LANGUAGE', 'de'); + $maintp->setVariable('PUBLISHER', 'NagiosQL @ Sourceforge'); + if ($_SESSION['logged_in'] == 1) { + $maintp->setVariable('ADMIN', '' .translate('Administration'). ''); + //$maintp->setVariable("PLUGINS","".translate('Plugins').""); + } + $maintp->setVariable('BASE_PATH', $_SESSION['SETS']['path']['base_url']); + $maintp->setVariable('ROBOTS', 'noindex,nofollow'); + $maintp->setVariable('PAGETITLE', 'NagiosQL - Version ' .$setDBVersion); + $maintp->setVariable('IMAGEDIR', $_SESSION['SETS']['path']['base_url'] . 'images/'); + if (isset($prePageId) && ($intError == 0)) { + $maintp->setVariable('POSITION', $myVisClass->getPosition($prePageId, translate('Administration'))); + } + $maintp->parse('header'); + $tplHeaderVar = $maintp->get('header'); + // + // Read domain list + // ================ + if (($_SESSION['logged_in'] == 1) && ($intError == 0)) { + $intDomain = filter_input( + INPUT_POST, + 'selDomain', + FILTER_VALIDATE_INT, + array('options' => array('default' => -1)) + ); + if ($intDomain != -1) { + $_SESSION['domain'] = $intDomain; + $myVisClass->intDomainId = $intDomain; + $myDataClass->intDomainId = $intDomain; + $myConfigClass->intDomainId = $intDomain; + $myContentClass->intDomainId = $intDomain; + } + $arrDataDomain = array(); + $strSQL = "SELECT * FROM `tbl_datadomain` WHERE `active` <> '0' ORDER BY `domain`"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataDomain, $intDataCount); + if ($booReturn == false) { + $strErrorMessage = str_replace('::', '
', $strErrorMessage); + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + $intDomain = 0; + if ($intDataCount > 0) { + foreach ($arrDataDomain as $elem) { + $intIsDomain = 0; + // Check access rights + if ($myVisClass->checkAccountGroup($elem['access_group'], 'read') == 0) { + $maintp->setVariable('DOMAIN_VALUE', $elem['id']); + $maintp->setVariable('DOMAIN_TEXT', $elem['domain']); + if (isset($_SESSION['domain']) && ($_SESSION['domain'] == $elem['id'])) { + $maintp->setVariable('DOMAIN_SELECTED', 'selected'); + $intDomain = $elem['id']; + $intIsDomain = 1; + } + if ($intDomain == -1) { + $intDomain = $elem['id']; + $intIsDomain = 1; + } + $maintp->parse('domainsel'); + } + if ($intIsDomain == 0) { + // Select available an domain + $strDomAcc = $myVisClass->getAccessGroups('read'); + $strSQL = 'SELECT id FROM `tbl_datadomain` ' + . "WHERE `active` <> '0' AND `access_group` IN (".$strDomAcc. ') ' + . 'ORDER BY domain LIMIT 1'; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataDomain, $intDataCount); + if ($booReturn == false) { + $strErrorMessage = str_replace('::', '
', $strErrorMessage); + $myVisClass->processMessage( + translate('Error while selecting data from database:'), + $strErrorMessage + ); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } else { + if ($intDataCount != 0) { + $intDomain = $arrDataDomain[0]['id']; + } + } + } + } + $maintp->setVariable('DOMAIN_INFO', translate('Domain'). ':'); + $maintp->parse('dselect'); + $tplHeaderVar .= $maintp->get('dselect'); + } + } + } + // + // Show login information + // ====================== + if ($_SESSION['logged_in'] == 1) { + $maintp->setVariable('LOGIN_INFO', translate('Logged in:'). ' ' .$_SESSION['username']); + $maintp->setVariable('LOGOUT_INFO', '' .translate('Logout'). ''); + } else { + $maintp->setVariable('LOGOUT_INFO', ' '); + } + // + // Build content menu + // ================== + if (isset($prePageId) && ($prePageId != 0)) { + $maintp->setVariable('MAINMENU', $myVisClass->getMenu($prePageId)); + } + $maintp->parse('header2'); + $tplHeaderVar .= $maintp->get('header2'); + if (!isset($preShowHeader) || $preShowHeader == 1) { + echo $tplHeaderVar; + } } // // Insert content and master template // ====================================== -if (isset($preContent) && ($preContent != "")) { - $arrTplOptions = array('use_preg' => false); - if (!file_exists($preBasePath ."templates/".$preContent) || !is_readable($preBasePath ."templates/".$preContent)) { - echo "".translate('Warning - template file not found or not readable, please check your file permissions! - File: '); - echo str_replace("//","/",$preBasePath ."templates/".$preContent)."
"; - exit; - } - $conttp = new HTML_Template_IT($preBasePath ."templates/"); - $conttp->loadTemplatefile($preContent, true, true); - $conttp->setOptions($arrTplOptions); - $strRootPath = $_SESSION['SETS']['path']['base_url']; - if (substr($strRootPath,-1) != "/") { - $conttp->setVariable("BASE_PATH",$strRootPath); - $conttp->setVariable("IMAGE_PATH",$strRootPath."images/"); - } else { - $conttp->setVariable("BASE_PATH",$strRootPath); - $conttp->setVariable("IMAGE_PATH",$strRootPath."images/"); - } - $mastertp = new HTML_Template_IT($preBasePath ."templates/"); - $mastertp->loadTemplatefile("admin/admin_master.tpl.htm", true, true); - $mastertp->setOptions($arrTplOptions); -} elseif (isset($pluginTemplate) && ($pluginTemplate != "")) { -// -// Insert Plugin Template -// ====================== - $arrTplOptions = array('use_preg' => false); - $conttp = new HTML_Template_IT($preBasePath ."plugins/".$pluginType."/".$pluginName."/templates/default/"); - $conttp->loadTemplatefile($pluginTemplate, true, true); - $conttp->setOptions($arrTplOptions); - $strRootPath = $_SESSION['SETS']['path']['base_url']; - if (substr($strRootPath,-1) != "/") { - $conttp->setVariable("BASE_PATH",$strRootPath."/plugins/".$pluginType."/".$pluginName."/"); - $conttp->setVariable("IMAGE_PATH",$strRootPath."/plugins/".$pluginType."/".$pluginName."/images/"); - } else { - $conttp->setVariable("BASE_PATH",$strRootPath."/plugins/".$pluginType."/".$pluginName."/"); - $conttp->setVariable("IMAGE_PATH",$strRootPath."/plugins/".$pluginType."/".$pluginName."/images/"); - } - $mastertp = new HTML_Template_IT($preBasePath ."templates/"); - $mastertp->loadTemplatefile("admin/admin_master.tpl.htm", true, true); - $mastertp->setOptions($arrTplOptions); +if (isset($preContent) && ($preContent != '')) { + $arrTplOptions = array('use_preg' => false); + if (!file_exists($preBasePath . 'templates/' .$preContent) || + !is_readable($preBasePath . 'templates/' .$preContent)) { + echo '' .translate('Warning - template file not found or not readable, please ' + . 'check your file permissions! - File: '); + echo str_replace('//', '/', $preBasePath . 'templates/' .$preContent). '
'; + exit; + } + $conttp = new HTML_Template_IT($preBasePath . 'templates/'); + $conttp->loadTemplatefile($preContent, true, true); + $conttp->setOptions($arrTplOptions); + $strRootPath = $_SESSION['SETS']['path']['base_url']; + if (substr($strRootPath, -1) != '/') { + $conttp->setVariable('BASE_PATH', $strRootPath); + $conttp->setVariable('IMAGE_PATH', $strRootPath. 'images/'); + } else { + $conttp->setVariable('BASE_PATH', $strRootPath); + $conttp->setVariable('IMAGE_PATH', $strRootPath. 'images/'); + } + $mastertp = new HTML_Template_IT($preBasePath . 'templates/'); + if (isset($preListTpl) && ($preListTpl != '')) { + $mastertp->loadTemplatefile($preListTpl, true, true); + } + $mastertp->setOptions($arrTplOptions); } // // Process standard get/post parameters // ==================================== -$arrSortDir = array("ASC","DESC"); -$arrSortBy = array("1","2"); -$chkModus = isset($_GET['modus']) ? htmlspecialchars($_GET['modus'], ENT_QUOTES, 'utf-8') : "display"; -$chkModus = isset($_POST['modus']) ? htmlspecialchars($_POST['modus'], ENT_QUOTES, 'utf-8') : "display"; -$chkHidModify = isset($_POST['hidModify']) ? htmlspecialchars($_POST['hidModify'], ENT_QUOTES, 'utf-8') : ""; -$chkSelModify = isset($_POST['selModify']) ? htmlspecialchars($_POST['selModify'], ENT_QUOTES, 'utf-8') : ""; -$hidSortDir = (isset($_POST['hidSortDir']) && in_array($_POST['hidSortDir'],$arrSortDir)) ? $_POST['hidSortDir'] : "ASC"; -$hidSortBy = (isset($_POST['hidSortBy']) && in_array($_POST['hidSortBy'],$arrSortBy)) ? $_POST['hidSortBy'] : 1; -$chkLimit = isset($_POST['hidLimit']) ? $_POST['hidLimit']+0 : 0; -$chkSelTargetDomain = isset($_POST['selTargetDomain']) ? $_POST['selTargetDomain']+0 : 0; -$chkListId = isset($_POST['hidListId']) ? $_POST['hidListId']+0 : 0; -$chkDataId = isset($_POST['hidId']) ? $_POST['hidId']+0 : 0; -$chkActive = isset($_POST['chbActive']) ? $_POST['chbActive']+0 : 0; -$chkRegister = isset($_POST['chbRegister']) ? $_POST['chbRegister']+0 : 0; -$hidActive = isset($_POST['hidActive']) ? $_POST['hidActive']+0 : 0; -$hidSort = isset($_POST['hidSort']) ? $_POST['hidSort']+0 : 0; -$chkStatus = isset($_POST['hidStatus']) ? $_POST['hidStatus']+0 : 0; -if (isset($_GET['orderby']) && ($_GET['orderby'] != "")) $hidSortBy = $_GET['orderby']; -if (isset($_GET['orderdir']) && ($_GET['orderdir'] != "")) $hidSortDir = $_GET['orderdir']; +$arrSortDir = array('ASC', 'DESC'); +$arrSortBy = array(1, 2); +$chkModus = 'display'; +$chkModusGet = filter_input(INPUT_GET, 'modus', 513, array('options' => array('default' => 'display'))); +$chkOrderBy = filter_input(INPUT_GET, 'orderby', FILTER_SANITIZE_STRING); +$chkOrderDir = filter_input(INPUT_GET, 'orderdir', FILTER_SANITIZE_STRING); +$chkLimitGet = filter_input(INPUT_GET, 'limit', FILTER_VALIDATE_INT); +$chkModusPost = filter_input(INPUT_POST, 'modus', 513, array('options' => array('default' => 'display'))); +$chkHidModify = filter_input(INPUT_POST, 'hidModify', FILTER_SANITIZE_STRING); +$chkSelModify = filter_input(INPUT_POST, 'selModify', FILTER_SANITIZE_STRING); +$hidSortDir = filter_input(INPUT_POST, 'hidSortDir', FILTER_SANITIZE_STRING); +$hidSortBy = filter_input(INPUT_POST, 'hidSortBy', FILTER_VALIDATE_INT); +$chkLimit = filter_input(INPUT_POST, 'hidLimit', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkSelTarDom = filter_input(INPUT_POST, 'selTarDom', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkListId = filter_input(INPUT_POST, 'hidListId', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkDataId = filter_input(INPUT_POST, 'hidId', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkActive = filter_input(INPUT_POST, 'chbActive', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkRegister = filter_input(INPUT_POST, 'chbRegister', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$hidActive = filter_input(INPUT_POST, 'hidActive', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$hidSort = filter_input(INPUT_POST, 'hidSort', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkStatus = filter_input(INPUT_POST, 'hidStatus', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +if ($chkModusGet != 'display') { + $chkModus = $chkModusGet; +} +if ($chkModusPost != 'display') { + $chkModus = $chkModusPost; +} +if (!in_array($hidSortDir, $arrSortDir, true)) { + $hidSortDir = 'ASC'; +} +if (!in_array($hidSortBy, $arrSortBy, true)) { + $hidSortBy = 1; +} +if (in_array($chkOrderDir, $arrSortDir, true)) { + $hidSortDir = $chkOrderDir; +} +if (in_array($chkOrderBy, $arrSortBy, true)) { + $hidSortBy = $chkOrderBy; +} // // Setting some variables // ====================== -if ($chkModus == "add") $chkSelModify = ""; -if ($chkHidModify != "") $chkSelModify = $chkHidModify; -if (isset($_GET['limit'])) $chkLimit = htmlspecialchars($_GET['limit'], ENT_QUOTES, 'utf-8'); -if (isset($_SESSION['domain'])) $chkDomainId = $_SESSION['domain']; -if (isset($_SESSION['groupadm'])) $chkGroupAdm = $_SESSION['groupadm']; -if (isset($_SESSION['strLoginMessage'])) $_SESSION['strLoginMessage'] .= $strErrorMessage; -$myConfigClass->getDomainData("version",$intVersion); -$myConfigClass->getDomainData("enable_common",$setEnableCommon); +if ($chkModus == 'add') { + $chkSelModify = ''; +} +if ($chkHidModify != '') { + $chkSelModify = $chkHidModify; +} +if (isset($chkLimitGet)) { + $chkLimit = $chkLimitGet; +} +if (isset($_SESSION['domain'])) { + $chkDomainId = $_SESSION['domain']; +} +if (isset($_SESSION['groupadm'])) { + $chkGroupAdm = $_SESSION['groupadm']; +} +if (isset($_SESSION['strLoginMessage'])) { + $_SESSION['strLoginMessage'] .= str_replace('::', '
', $strErrorMessage); +} +$myConfigClass->getDomainData('version', $intVersion); +$myConfigClass->getDomainData('enable_common', $setEnableCommon); if (isset($preTableName)) { - if ($setEnableCommon != 0) { - $strDomainWhere = " (`$preTableName`.`config_id`=$chkDomainId OR `$preTableName`.`config_id`=0) "; - $strDomainWhere2 = " (`config_id`=$chkDomainId OR `config_id`=0) "; - } else { - $strDomainWhere = " (`$preTableName`.`config_id`=$chkDomainId) "; - $strDomainWhere2 = " (`config_id`=$chkDomainId) "; - } + if ($setEnableCommon != 0) { + $strDomainWhere = " (`$preTableName`.`config_id`=$chkDomainId OR `$preTableName`.`config_id`=0) "; + $strDomainWhere2 = " (`config_id`=$chkDomainId OR `config_id`=0) "; + } else { + $strDomainWhere = " (`$preTableName`.`config_id`=$chkDomainId) "; + $strDomainWhere2 = " (`config_id`=$chkDomainId) "; + } } // Row sort variables -if ($hidSortDir == "ASC") { $setSortDir = "DESC"; } else { $setSortDir = "ASC"; } -if (isset($preContent) && ($preContent != "")) { - if ($hidSortBy == 2) { - $mastertp->setVariable("SORT_IMAGE_1",""); - } else { - $hidSortBy = 1; - $mastertp->setVariable("SORT_IMAGE_2",""); - } - $setSortPicture = $_SESSION['SETS']['path']['base_url']."images/sort_".strtolower($hidSortDir).".png"; - $mastertp->setVariable("SORT_DIR_".$hidSortBy,$setSortDir); - $mastertp->setVariable("SORT_IMAGE_".$hidSortBy,"\"$hidSortDir\""); - $mastertp->setVariable("SORT_DIR",$hidSortDir); - $mastertp->setVariable("SORT_BY",$hidSortBy); +if ($hidSortDir == 'ASC') { + $setSortDir = 'DESC'; +} else { + $setSortDir = 'ASC'; +} +if (isset($preContent) && ($preContent != '')) { + if ($hidSortBy == 2) { + $mastertp->setVariable('SORT_IMAGE_1', ''); + } else { + $hidSortBy = 1; + $mastertp->setVariable('SORT_IMAGE_2', ''); + } + $setSortPicture = $_SESSION['SETS']['path']['base_url']. 'images/sort_' .strtolower($hidSortDir). '.png'; + $mastertp->setVariable('SORT_DIR_' .$hidSortBy, $setSortDir); + $mastertp->setVariable('SORT_IMAGE_' .$hidSortBy, "\"$hidSortDir\""); + $mastertp->setVariable('SORT_DIR', $hidSortDir); + $mastertp->setVariable('SORT_BY', $hidSortBy); } // // Set class variables // =================== -if (isset($preContent) && ($preContent != "")) { - $myVisClass->myContentTpl = $conttp; - $myVisClass->dataId = $chkListId; +if (isset($preContent) && ($preContent != '')) { + $myVisClass->myContentTpl = $conttp; + $myVisClass->intDataId = $chkListId; } -?> \ No newline at end of file diff --git a/functions/prepend_content.php b/functions/prepend_content.php index 24abfa2..d82b0f5 100644 --- a/functions/prepend_content.php +++ b/functions/prepend_content.php @@ -2,517 +2,539 @@ /////////////////////////////////////////////////////////////////////////////// // // NagiosQL +// /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Preprocessing script for content pages -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:53:38 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 5 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // // Define common variables // ======================= -$intLineCount = 0; // Database line count -$intWriteAccessId = 0; // Write access to data id ($chkDataId) -$intReadAccessId = 0; // Read access to data id ($chkListId) -$intDataWarning = 0; // Missing data indicator -$intNoTime = 0; // Show modified time list (0=show) -$strSearchWhere = ""; // SQL WHERE addon for searching -$strSearchWhere2 = ""; // SQL WHERE addon for configuration selection list +$intLineCount = 0; // Database line count +$intWriteAccessId = 0; // Write access to data id ($chkDataId) +$intReadAccessId = 0; // Read access to data id ($chkListId) +$intDataWarning = 0; // Missing data indicator +$intNoTime = 0; // Show modified time list (0=show) +$strSearchWhere = ''; // SQL WHERE addon for searching +$strSearchWhere2 = ''; // SQL WHERE addon for configuration selection list +$chkTfValue3 = ''; +$chkTfValue5 = ''; // // Define missing variables used in this prepend file // ================================================== -if (!isset($preTableName)) $preTableName = ""; // Predefined variable table name -if (!isset($preSearchSession)) $preSearchSession = ""; // Predefined variable search session +if (!isset($preTableName)) { + $preTableName = ''; +} // Predefined variable table name +if (!isset($preSearchSession)) { + $preSearchSession = ''; +} // Predefined variable search session // // Store some variables to content class // ===================================== -$myContentClass->intLimit = $chkLimit; -$myContentClass->intVersion = $intVersion; -$myContentClass->strBrowser = $preBrowser; -$myContentClass->intGroupAdm = $chkGroupAdm; -$myContentClass->strTableName = $preTableName; -$myContentClass->strSearchSession = $preSearchSession; -$myContentClass->intSortBy = $hidSortBy; -$myContentClass->strSortDir = $hidSortDir; +$myContentClass->intLimit = $chkLimit; +/** @var int $intVersion - defined in prepend_adm.php */ +$myContentClass->intVersion = $intVersion; +$myContentClass->strBrowser = $preBrowser; +$myContentClass->intGroupAdm = $chkGroupAdm; +$myContentClass->strTableName = $preTableName; +$myContentClass->strSearchSession = $preSearchSession; +$myContentClass->intSortBy = $hidSortBy; +$myContentClass->strSortDir = $hidSortDir; // // Process get parameters // ====================== -$chkFromLine = isset($_GET['from_line']) ? filter_var($_GET['from_line'], FILTER_SANITIZE_NUMBER_INT) : 0; +$chkFromLine = filter_input(INPUT_GET, 'from_line', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); // // Process post parameters // ======================= -$chkTfSearch = isset($_POST['txtSearch']) ? $_POST['txtSearch'] : ""; // Search field -$chkSelAccGr = isset($_POST['selAccGr']) ? $_POST['selAccGr']+0 : 0; // Access group -$chkSelCnfName = isset($_POST['selCnfName']) ? $_POST['selCnfName'] : ""; // Config name selection field +$chkTfSearchRaw = filter_input(INPUT_POST, 'txtSearch', FILTER_SANITIZE_STRING); +$chkSelAccGr = filter_input(INPUT_POST, 'selAccGr', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkSelCnfName = filter_input(INPUT_POST, 'selCnfName', FILTER_SANITIZE_STRING); // -$chkTfValue1 = isset($_POST['tfValue1']) ? $_POST['tfValue1'] : ""; // Common text field value -$chkTfValue2 = isset($_POST['tfValue2']) ? $_POST['tfValue2'] : ""; // Common text field value -$chkTfValue3 = isset($_POST['tfValue3']) ? $_POST['tfValue3'] : ""; // Common text field value -$chkTfValue4 = isset($_POST['tfValue4']) ? $_POST['tfValue4'] : ""; // Common text field value -$chkTfValue5 = isset($_POST['tfValue5']) ? $_POST['tfValue5'] : ""; // Common text field value -$chkTfValue6 = isset($_POST['tfValue6']) ? $_POST['tfValue6'] : ""; // Common text field value -$chkTfValue7 = isset($_POST['tfValue7']) ? $_POST['tfValue7'] : ""; // Common text field value -$chkTfValue8 = isset($_POST['tfValue8']) ? $_POST['tfValue8'] : ""; // Common text field value -$chkTfValue9 = isset($_POST['tfValue9']) ? $_POST['tfValue9'] : ""; // Common text field value -$chkTfValue10 = isset($_POST['tfValue10']) ? $_POST['tfValue10'] : ""; // Common text field value -$chkTfValue11 = isset($_POST['tfValue11']) ? $_POST['tfValue11'] : ""; // Common text field value -$chkTfValue12 = isset($_POST['tfValue12']) ? $_POST['tfValue12'] : ""; // Common text field value -$chkTfValue13 = isset($_POST['tfValue13']) ? $_POST['tfValue13'] : ""; // Common text field value -$chkTfValue14 = isset($_POST['tfValue14']) ? $_POST['tfValue14'] : ""; // Common text field value -$chkTfValue15 = isset($_POST['tfValue15']) ? $_POST['tfValue15'] : ""; // Common text field value -$chkTfValue16 = isset($_POST['tfValue16']) ? $_POST['tfValue16'] : ""; // Common text field value -$chkTfValue17 = isset($_POST['tfValue17']) ? $_POST['tfValue17'] : ""; // Common text field value -$chkTfValue18 = isset($_POST['tfValue18']) ? $_POST['tfValue18'] : ""; // Common text field value -$chkTfValue19 = isset($_POST['tfValue19']) ? $_POST['tfValue19'] : ""; // Common text field value -$chkTfValue20 = isset($_POST['tfValue20']) ? $_POST['tfValue20'] : ""; // Common text field value -$chkTfArg1 = isset($_POST['tfArg1']) ? $_POST['tfArg1'] : ""; // Common argument text field value -$chkTfArg2 = isset($_POST['tfArg2']) ? $_POST['tfArg2'] : ""; // Common argument text field value -$chkTfArg3 = isset($_POST['tfArg3']) ? $_POST['tfArg3'] : ""; // Common argument text field value -$chkTfArg4 = isset($_POST['tfArg4']) ? $_POST['tfArg4'] : ""; // Common argument text field value -$chkTfArg5 = isset($_POST['tfArg5']) ? $_POST['tfArg5'] : ""; // Common argument text field value -$chkTfArg6 = isset($_POST['tfArg6']) ? $_POST['tfArg6'] : ""; // Common argument text field value -$chkTfArg7 = isset($_POST['tfArg7']) ? $_POST['tfArg7'] : ""; // Common argument text field value -$chkTfArg8 = isset($_POST['tfArg8']) ? $_POST['tfArg8'] : ""; // Common argument text field value -$chkMselValue1 = isset($_POST['mselValue1']) ? $_POST['mselValue1'] : array(""); // Common multi select field value -$chkMselValue2 = isset($_POST['mselValue2']) ? $_POST['mselValue2'] : array(""); // Common multi select field value -$chkMselValue3 = isset($_POST['mselValue3']) ? $_POST['mselValue3'] : array(""); // Common multi select field value -$chkMselValue4 = isset($_POST['mselValue4']) ? $_POST['mselValue4'] : array(""); // Common multi select field value -$chkMselValue5 = isset($_POST['mselValue5']) ? $_POST['mselValue5'] : array(""); // Common multi select field value -$chkMselValue6 = isset($_POST['mselValue6']) ? $_POST['mselValue6'] : array(""); // Common multi select field value -$chkMselValue7 = isset($_POST['mselValue7']) ? $_POST['mselValue7'] : array(""); // Common multi select field value -$chkMselValue8 = isset($_POST['mselValue8']) ? $_POST['mselValue8'] : array(""); // Common multi select field value -$chkChbValue1 = isset($_POST['chbValue1']) ? $_POST['chbValue1']+0 : 0; // Common checkbox field value -$chkChbValue2 = isset($_POST['chbValue2']) ? $_POST['chbValue2']+0 : 0; // Common checkbox field value -$chkDatValue1 = isset($_POST['datValue1']) ? $_POST['datValue1'] : ""; // Common file selection field -$chkTaValue1 = isset($_POST['taValue1']) ? $_POST['taValue1'] : ""; // Common text area value -$chkTaFileText = isset($_POST['taFileText']) ? $_POST['taFileText'] : ""; // Common text area value for file import (not SQL) -$chkSelValue1 = isset($_POST['selValue1']) ? $_POST['selValue1']+0 : 0; // Common select field value -$chkSelValue2 = isset($_POST['selValue2']) ? $_POST['selValue2']+0 : 0; // Common select field value -$chkSelValue3 = isset($_POST['selValue3']) ? $_POST['selValue3']+0 : 0; // Common select field value -$chkSelValue4 = isset($_POST['selValue4']) ? $_POST['selValue4']+0 : 0; // Common select field value -$chkSelValue5 = isset($_POST['selValue5']) ? $_POST['selValue5']+0 : 0; // Common select field value -$chkRadValue1 = isset($_POST['radValue1']) ? $_POST['radValue1']+0 : 2; // Common radio field value -$chkRadValue2 = isset($_POST['radValue2']) ? $_POST['radValue2']+0 : 2; // Common radio field value -$chkRadValue3 = isset($_POST['radValue3']) ? $_POST['radValue3']+0 : 2; // Common radio field value -$chkRadValue4 = isset($_POST['radValue4']) ? $_POST['radValue4']+0 : 2; // Common radio field value -$chkRadValue5 = isset($_POST['radValue5']) ? $_POST['radValue5']+0 : 2; // Common radio field value -$chkRadValue6 = isset($_POST['radValue6']) ? $_POST['radValue6']+0 : 2; // Common radio field value -$chkRadValue7 = isset($_POST['radValue7']) ? $_POST['radValue7']+0 : 2; // Common radio field value -$chkRadValue8 = isset($_POST['radValue8']) ? $_POST['radValue8']+0 : 2; // Common radio field value -$chkRadValue9 = isset($_POST['radValue9']) ? $_POST['radValue9']+0 : 2; // Common radio field value -$chkRadValue10 = isset($_POST['radValue10']) ? $_POST['radValue10']+0 : 2; // Common radio field value -$chkRadValue11 = isset($_POST['radValue11']) ? $_POST['radValue11']+0 : 2; // Common radio field value -$chkRadValue12 = isset($_POST['radValue12']) ? $_POST['radValue12']+0 : 2; // Common radio field value -$chkRadValue13 = isset($_POST['radValue13']) ? $_POST['radValue13']+0 : 2; // Common radio field value -$chkRadValue14 = isset($_POST['radValue14']) ? $_POST['radValue14']+0 : 2; // Common radio field value -$chkRadValue15 = isset($_POST['radValue15']) ? $_POST['radValue15']+0 : 2; // Common radio field value -$chkRadValue16 = isset($_POST['radValue16']) ? $_POST['radValue16']+0 : 2; // Common radio field value -$chkRadValue17 = isset($_POST['radValue17']) ? $_POST['radValue17']+0 : 2; // Common radio field value -$chkChbGr1a = isset($_POST['chbGr1a']) ? $_POST['chbGr1a']."," : ""; // Common checkbox group -$chkChbGr1b = isset($_POST['chbGr1b']) ? $_POST['chbGr1b']."," : ""; // Common checkbox group -$chkChbGr1c = isset($_POST['chbGr1c']) ? $_POST['chbGr1c']."," : ""; // Common checkbox group -$chkChbGr1d = isset($_POST['chbGr1d']) ? $_POST['chbGr1d']."," : ""; // Common checkbox group -$chkChbGr1e = isset($_POST['chbGr1e']) ? $_POST['chbGr1e']."," : ""; // Common checkbox group -$chkChbGr1f = isset($_POST['chbGr1f']) ? $_POST['chbGr1f']."," : ""; // Common checkbox group -$chkChbGr1g = isset($_POST['chbGr1g']) ? $_POST['chbGr1g']."," : ""; // Common checkbox group -$chkChbGr1h = isset($_POST['chbGr1h']) ? $_POST['chbGr1h']."," : ""; // Common checkbox group -$chkChbGr2a = isset($_POST['chbGr2a']) ? $_POST['chbGr2a']."," : ""; // Common checkbox group -$chkChbGr2b = isset($_POST['chbGr2b']) ? $_POST['chbGr2b']."," : ""; // Common checkbox group -$chkChbGr2c = isset($_POST['chbGr2c']) ? $_POST['chbGr2c']."," : ""; // Common checkbox group -$chkChbGr2d = isset($_POST['chbGr2d']) ? $_POST['chbGr2d']."," : ""; // Common checkbox group -$chkChbGr2e = isset($_POST['chbGr2e']) ? $_POST['chbGr2e']."," : ""; // Common checkbox group -$chkChbGr2f = isset($_POST['chbGr2f']) ? $_POST['chbGr2f']."," : ""; // Common checkbox group -$chkChbGr2g = isset($_POST['chbGr2g']) ? $_POST['chbGr2g']."," : ""; // Common checkbox group -$chkChbGr2h = isset($_POST['chbGr2h']) ? $_POST['chbGr2h']."," : ""; // Common checkbox group -$chkChbGr3a = isset($_POST['chbGr3a']) ? $_POST['chbGr3a']."," : ""; // Common checkbox group -$chkChbGr3b = isset($_POST['chbGr3b']) ? $_POST['chbGr3b']."," : ""; // Common checkbox group -$chkChbGr3c = isset($_POST['chbGr3c']) ? $_POST['chbGr3c']."," : ""; // Common checkbox group -$chkChbGr3d = isset($_POST['chbGr3d']) ? $_POST['chbGr3d']."," : ""; // Common checkbox group -$chkChbGr4a = isset($_POST['chbGr4a']) ? $_POST['chbGr4a']."," : ""; // Common checkbox group -$chkChbGr4b = isset($_POST['chbGr4b']) ? $_POST['chbGr4b']."," : ""; // Common checkbox group -$chkChbGr4c = isset($_POST['chbGr4c']) ? $_POST['chbGr4c']."," : ""; // Common checkbox group -$chkChbGr4d = isset($_POST['chbGr4d']) ? $_POST['chbGr4d']."," : ""; // Common checkbox group -$chkButValue1 = isset($_POST['butValue1']) ? $_POST['butValue1'] : ""; // Common button value -$chkButValue2 = isset($_POST['butValue2']) ? $_POST['butValue2'] : ""; // Common button value -$chkButValue3 = isset($_POST['butValue3']) ? $_POST['butValue3'] : ""; // Common button value -$chkButValue4 = isset($_POST['butValue4']) ? $_POST['butValue4'] : ""; // Common button value -$chkButValue5 = isset($_POST['butValue5']) ? $_POST['butValue5'] : ""; // Common button value -$chkTfNullVal1 = (isset($_POST['tfNullVal1']) && ($_POST['tfNullVal1'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal1'])+0 : "NULL"; // Common text NULL field value -$chkTfNullVal2 = (isset($_POST['tfNullVal2']) && ($_POST['tfNullVal2'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal2'])+0 : "NULL"; // Common text NULL field value -$chkTfNullVal3 = (isset($_POST['tfNullVal3']) && ($_POST['tfNullVal3'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal3'])+0 : "NULL"; // Common text NULL field value -$chkTfNullVal4 = (isset($_POST['tfNullVal4']) && ($_POST['tfNullVal4'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal4'])+0 : "NULL"; // Common text NULL field value -$chkTfNullVal5 = (isset($_POST['tfNullVal5']) && ($_POST['tfNullVal5'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal5'])+0 : "NULL"; // Common text NULL field value -$chkTfNullVal6 = (isset($_POST['tfNullVal6']) && ($_POST['tfNullVal6'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal6'])+0 : "NULL"; // Common text NULL field value -$chkTfNullVal7 = (isset($_POST['tfNullVal7']) && ($_POST['tfNullVal7'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal7'])+0 : "NULL"; // Common text NULL field value -$chkTfNullVal8 = (isset($_POST['tfNullVal8']) && ($_POST['tfNullVal8'] != "")) ? $myVisClass->checkNull($_POST['tfNullVal8'])+0 : "NULL"; // Common text NULL field value +// Common text field value +for ($i = 1; $i <= 22; $i++) { + $tmpVar = 'chkTfValue'.$i; + $$tmpVar = filter_input(INPUT_POST, 'tfValue'.$i, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES); + if (get_magic_quotes_gpc() == 0) { + $$tmpVar = addslashes($$tmpVar); + } + if (isset($$tmpVar)) { + $$tmpVar = $myVisClass->tfSecure($$tmpVar); + } +} +// Common argument text field value +for ($i = 1; $i <= 8; $i++) { + $tmpVar = 'chkTfArg'.$i; + $$tmpVar = filter_input(INPUT_POST, 'tfArg'.$i, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES); + if (get_magic_quotes_gpc() == 0) { + $$tmpVar = addslashes($$tmpVar); + } + if (isset($$tmpVar)) { + $$tmpVar = $myVisClass->tfSecure($$tmpVar); + } +} + +// Common multi select field value +for ($i = 1; $i <= 8; $i++) { + $tmpVar = 'chkMselValue'.$i; + $tmpVar2 = 'intMselValue'.$i; + $$tmpVar = filter_input(INPUT_POST, 'mselValue'.$i, FILTER_SANITIZE_STRING, FILTER_FORCE_ARRAY); + // Multiselect data processing + if ((${$tmpVar}[0] == '') || (${$tmpVar}[0] == '0')) { + $$tmpVar2 = 0; + } elseif (${$tmpVar}[0] == '*') { + $$tmpVar2 = 2; + } else { + $$tmpVar2 = 1; + } +} +// Common select field value +for ($i = 1; $i <= 5; $i++) { + $tmpVar = 'chkSelValue'.$i; + $$tmpVar = filter_input(INPUT_POST, 'selValue'.$i, FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +} +//Common radio field value +for ($i = 1; $i <= 18; $i++) { + $tmpVar = 'chkRadValue'.$i; + $$tmpVar = filter_input(INPUT_POST, 'radValue'.$i, FILTER_VALIDATE_INT, array('options' => array('default' => 2))); +} +// Common checkbox group +$arrChar = explode(';', 'a;b;c;d;e;f;g;h'); +for ($i = 1; $i <= 4; $i++) { + foreach ($arrChar as $elem) { + $tmpVar = 'chkChbGr'.$i.$elem; + $$tmpVar = filter_input(INPUT_POST, 'chbGr'.$i.$elem, FILTER_SANITIZE_STRING); + if ($$tmpVar != '') { + $$tmpVar .= ','; + } + } +} +// Common button value +for ($i = 1; $i <= 5; $i++) { + $tmpVar = 'chkButValue'.$i; + $$tmpVar = filter_input(INPUT_POST, 'butValue'.$i, FILTER_SANITIZE_STRING); +} +// Common text NULL field value +for ($i = 1; $i <= 9; $i++) { + $tmpVar = 'chkTfNullVal'.$i; + $$tmpVar = filter_input(INPUT_POST, 'tfNullVal'.$i, FILTER_SANITIZE_STRING); + if (isset($$tmpVar) && ($$tmpVar != '')) { + $myVisClass->checkNull($$tmpVar); + } else { + $$tmpVar = 'NULL'; + } +} +// Common checkbox field value +$chkChbValue1 = filter_input(INPUT_POST, 'chbValue1', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +$chkChbValue2 = filter_input(INPUT_POST, 'chbValue2', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); +// Common file selection field +$chkDatValue1 = filter_input(INPUT_POST, 'datValue1', FILTER_SANITIZE_STRING); +// Common text area value +$chkTaValue1Raw = filter_input(INPUT_POST, 'taValue1', FILTER_SANITIZE_FULL_SPECIAL_CHARS); +// Common text area value for file import (not SQL) +$chkTaFileTextRaw = filter_input(INPUT_POST, 'taFileText', FILTER_UNSAFE_RAW); // // Quote special characters // ========================== if (get_magic_quotes_gpc() == 0) { - $chkTfSearch = addslashes($chkTfSearch); - $chkTfValue1 = addslashes($chkTfValue1); - $chkTfValue2 = addslashes($chkTfValue2); - $chkTfValue3 = addslashes($chkTfValue3); - $chkTfValue4 = addslashes($chkTfValue4); - $chkTfValue5 = addslashes($chkTfValue5); - $chkTfValue6 = addslashes($chkTfValue6); - $chkTfValue7 = addslashes($chkTfValue7); - $chkTfValue8 = addslashes($chkTfValue8); - $chkTfValue9 = addslashes($chkTfValue9); - $chkTfValue10 = addslashes($chkTfValue10); - $chkTfValue11 = addslashes($chkTfValue11); - $chkTfValue12 = addslashes($chkTfValue12); - $chkTfValue13 = addslashes($chkTfValue13); - $chkTfValue14 = addslashes($chkTfValue14); - $chkTfValue15 = addslashes($chkTfValue15); - $chkTfValue16 = addslashes($chkTfValue16); - $chkTfValue17 = addslashes($chkTfValue17); - $chkTfValue18 = addslashes($chkTfValue18); - $chkTfValue19 = addslashes($chkTfValue19); - $chkTfValue20 = addslashes($chkTfValue20); - $chkTaValue1 = addslashes($chkTaValue1); - $chkTfArg1 = addslashes($chkTfArg1); - $chkTfArg2 = addslashes($chkTfArg2); - $chkTfArg3 = addslashes($chkTfArg3); - $chkTfArg4 = addslashes($chkTfArg4); - $chkTfArg5 = addslashes($chkTfArg5); - $chkTfArg6 = addslashes($chkTfArg6); - $chkTfArg7 = addslashes($chkTfArg7); - $chkTfArg8 = addslashes($chkTfArg8); - $chkTaFileText = addslashes($chkTaFileText); + $chkTfSearchRaw = addslashes($chkTfSearchRaw); + $chkTaValue1Raw = addslashes($chkTaValue1Raw); + $chkTaFileTextRaw = addslashes($chkTaFileTextRaw); } // // Security function for text fields // ================================= -$chkTfSearch = $myVisClass->tfSecure($chkTfSearch); -$chkTfValue1 = $myVisClass->tfSecure($chkTfValue1); -$chkTfValue2 = $myVisClass->tfSecure($chkTfValue2); -$chkTfValue3 = $myVisClass->tfSecure($chkTfValue3); -$chkTfValue4 = $myVisClass->tfSecure($chkTfValue4); -$chkTfValue5 = $myVisClass->tfSecure($chkTfValue5); -$chkTfValue6 = $myVisClass->tfSecure($chkTfValue6); -$chkTfValue7 = $myVisClass->tfSecure($chkTfValue7); -$chkTfValue8 = $myVisClass->tfSecure($chkTfValue8); -$chkTfValue9 = $myVisClass->tfSecure($chkTfValue9); -$chkTfValue10 = $myVisClass->tfSecure($chkTfValue10); -$chkTfValue11 = $myVisClass->tfSecure($chkTfValue11); -$chkTfValue12 = $myVisClass->tfSecure($chkTfValue12); -$chkTfValue13 = $myVisClass->tfSecure($chkTfValue13); -$chkTfValue14 = $myVisClass->tfSecure($chkTfValue14); -$chkTfValue15 = $myVisClass->tfSecure($chkTfValue15); -$chkTfValue16 = $myVisClass->tfSecure($chkTfValue16); -$chkTfValue17 = $myVisClass->tfSecure($chkTfValue17); -$chkTfValue18 = $myVisClass->tfSecure($chkTfValue18); -$chkTfValue19 = $myVisClass->tfSecure($chkTfValue19); -$chkTfValue20 = $myVisClass->tfSecure($chkTfValue20); -$chkTfArg1 = $myVisClass->tfSecure($chkTfArg1); -$chkTfArg2 = $myVisClass->tfSecure($chkTfArg2); -$chkTfArg3 = $myVisClass->tfSecure($chkTfArg3); -$chkTfArg4 = $myVisClass->tfSecure($chkTfArg4); -$chkTfArg5 = $myVisClass->tfSecure($chkTfArg5); -$chkTfArg6 = $myVisClass->tfSecure($chkTfArg6); -$chkTfArg7 = $myVisClass->tfSecure($chkTfArg7); -$chkTfArg8 = $myVisClass->tfSecure($chkTfArg8); -$chkTaValue1 = $myVisClass->tfSecure($chkTaValue1); -$chkTaFileText = stripslashes($chkTaFileText); -// -// Multiselect data processing -// =========================== -if (($chkMselValue1[0] == "") || ($chkMselValue1[0] == "0")) {$intMselValue1 = 0;} else {$intMselValue1 = 1;} -if ($chkMselValue1[0] == "*") $intMselValue1 = 2; -if (($chkMselValue2[0] == "") || ($chkMselValue2[0] == "0")) {$intMselValue2 = 0;} else {$intMselValue2 = 1;} -if ($chkMselValue2[0] == "*") $intMselValue2 = 2; -if (($chkMselValue3[0] == "") || ($chkMselValue3[0] == "0")) {$intMselValue3 = 0;} else {$intMselValue3 = 1;} -if ($chkMselValue3[0] == "*") $intMselValue3 = 2; -if (($chkMselValue4[0] == "") || ($chkMselValue4[0] == "0")) {$intMselValue4 = 0;} else {$intMselValue4 = 1;} -if ($chkMselValue4[0] == "*") $intMselValue4 = 2; -if (($chkMselValue5[0] == "") || ($chkMselValue5[0] == "0")) {$intMselValue5 = 0;} else {$intMselValue5 = 1;} -if ($chkMselValue5[0] == "*") $intMselValue5 = 2; -if (($chkMselValue6[0] == "") || ($chkMselValue6[0] == "0")) {$intMselValue6 = 0;} else {$intMselValue6 = 1;} -if ($chkMselValue6[0] == "*") $intMselValue6 = 2; -if (($chkMselValue7[0] == "") || ($chkMselValue7[0] == "0")) {$intMselValue7 = 0;} else {$intMselValue7 = 1;} -if ($chkMselValue7[0] == "*") $intMselValue7 = 2; -if (($chkMselValue8[0] == "") || ($chkMselValue8[0] == "0")) {$intMselValue8 = 0;} else {$intMselValue8 = 1;} -if ($chkMselValue8[0] == "*") $intMselValue8 = 2; +$chkTfSearch = $myVisClass->tfSecure($chkTfSearchRaw); +$chkTaValue1 = $myVisClass->tfSecure($chkTaValue1Raw); +$chkTaFileText = stripslashes($chkTaFileTextRaw); // // Search/sort/filter - session data // ================================= -if (!isset($_SESSION['search']) || !isset($_SESSION['search'][$preSearchSession])) $_SESSION['search'][$preSearchSession] = ""; -if (!isset($_SESSION['search']) || !isset($_SESSION['search']['config_selection'])) $_SESSION['search']['config_selection'] = ""; -if (($chkModus == "checkform") || ($chkModus == "filter")) { - $_SESSION['search'][$preSearchSession] = $chkTfSearch; - $_SESSION['search']['config_selection'] = $chkSelCnfName; +if (!isset($_SESSION['search']) || !isset($_SESSION['search'][$preSearchSession])) { + $_SESSION['search'][$preSearchSession] = ''; +} +if (!isset($_SESSION['search']) || !isset($_SESSION['search']['config_selection'])) { + $_SESSION['search']['config_selection'] = ''; +} +if (($chkModus == 'checkform') || ($chkModus == 'filter')) { + $_SESSION['search'][$preSearchSession] = $chkTfSearch; + $_SESSION['search']['config_selection'] = $chkSelCnfName; + $myContentClass->arrSession = $_SESSION; } // // Process additional templates/variables // ====================================== -if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && (count($_SESSION['templatedefinition']) != 0)) { - $intTemplates = 1; +if (isset($_SESSION['templatedefinition']) && is_array($_SESSION['templatedefinition']) && + (count($_SESSION['templatedefinition']) != 0)) { + $intTemplates = 1; } else { - $intTemplates = 0; + $intTemplates = 0; } -if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && (count($_SESSION['variabledefinition']) != 0)) { - $intVariables = 1; +if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition']) && + (count($_SESSION['variabledefinition']) != 0)) { + $intVariables = 1; } else { - $intVariables = 0; + $intVariables = 0; } // // Common SQL parts // ================ -if ($hidActive == 1) $chkActive = 1; -if ($chkGroupAdm == 1) {$strGroupSQL = "`access_group`=$chkSelAccGr, ";} else {$strGroupSQL = "";} -$preSQLCommon1 = "$strGroupSQL `active`='$chkActive', `register`='$chkRegister', `config_id`=$chkDomainId, `last_modified`=NOW()"; +if ($hidActive == 1) { + $chkActive = 1; +} +if ($chkGroupAdm == 1) { + $strGroupSQL = "`access_group`=$chkSelAccGr, "; +} else { + $strGroupSQL = ''; +} +$preSQLCommon1 = "$strGroupSQL `active`='$chkActive', `register`='$chkRegister', `config_id`=$chkDomainId, " + . '`last_modified`=NOW()'; $preSQLCommon2 = "$strGroupSQL `active`='$chkActive', `register`='0', `config_id`=$chkDomainId, `last_modified`=NOW()"; -$intRet1=0;$intRet2=0;$intRet3=0;$intRet4=0;$intRet5=0;$intRet6=0;$intRet7=0;$intRet8=0; +$intRet1 = 0; +$intRet2 = 0; +$intRet3 = 0; +$intRet4 = 0; +$intRet5 = 0; +$intRet6 = 0; +$intRet7 = 0; +$intRet8 = 0; // // Check read and write access // =========================== if (isset($prePageKey)) { - $intGlobalReadAccess = $myVisClass->checkAccGroup($prePageKey,'read'); // Global read access (0 = access granted) - $intGlobalWriteAccess = $myVisClass->checkAccGroup($prePageKey,'write'); // Global write access (0 = access granted) - $myContentClass->intGlobalWriteAccess = $intGlobalWriteAccess; + // Global read access (0 = access granted) + $intGlobalReadAccess = $myVisClass->checkAccountGroup($prePageKey, 'read'); + // Global write access (0 = access granted) + $intGlobalWriteAccess = $myVisClass->checkAccountGroup($prePageKey, 'write'); + $myContentClass->intGlobalWriteAccess = $intGlobalWriteAccess; } if (!isset($preNoAccessGrp) || ($preNoAccessGrp == 0)) { - if ($chkDataId != 0) { - $strSQLWrite = "SELECT `access_group` FROM `$preTableName` WHERE id=$chkDataId"; - $intWriteAccessId = $myVisClass->checkAccGroup(($myDBClass->getFieldData($strSQLWrite)+0),'write'); - $myContentClass->intWriteAccessId = $intWriteAccessId; - } - if ($chkListId != 0) { - $strSQLWrite = "SELECT `access_group` FROM `$preTableName` WHERE id=$chkListId"; - $intReadAccessId = $myVisClass->checkAccGroup(($myDBClass->getFieldData($strSQLWrite)+0),'read'); - $intWriteAccessId = $myVisClass->checkAccGroup(($myDBClass->getFieldData($strSQLWrite)+0),'write'); - $myContentClass->intWriteAccessId = $intWriteAccessId; - } + if ($chkDataId != 0) { + $strSQLWrite = "SELECT `access_group` FROM `$preTableName` WHERE `id`=".$chkDataId; + $intWriteAccessId = $myVisClass->checkAccountGroup((int)$myDBClass->getFieldData($strSQLWrite), 'write'); + $myContentClass->intWriteAccessId = $intWriteAccessId; + } + if ($chkListId != 0) { + $strSQLWrite = "SELECT `access_group` FROM `$preTableName` WHERE `id`=".$chkListId; + $intReadAccessId = $myVisClass->checkAccountGroup((int)$myDBClass->getFieldData($strSQLWrite), 'read'); + $intWriteAccessId = $myVisClass->checkAccountGroup((int)$myDBClass->getFieldData($strSQLWrite), 'write'); + $myContentClass->intWriteAccessId = $intWriteAccessId; + } } // // Data processing // =============== -if (($chkModus == "make") && ($intGlobalWriteAccess == 0)) { - $intError = 0; - $intSuccess = 0; - // Get write access groups - $strAccess = $myVisClass->getAccGroups('write'); - // Write configuration file - if ($preTableName == 'tbl_host') { - $strSQL = "SELECT `id` FROM `$preTableName` WHERE $strDomainWhere AND `access_group` IN ($strAccess) AND `active`='1'"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($booReturn && ($intDataCount != 0)) { - foreach ($arrData AS $data) { - $intReturn = $myConfigClass->createConfigSingle("$preTableName",$data['id']); - if ($intReturn == 1){ - $intError++; - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } else { - $intSuccess++; - } - } - } else { - $myVisClass->processMessage(translate('Some configuration files were not written. Dataset not activated, not found or you do not have write permission!'),$strErrorMessage); - } - if ($intSuccess != 0) $myVisClass->processMessage(translate('Configuration files successfully written!'),$strInfoMessage); - if ($intError != 0) $myVisClass->processMessage(translate('Some configuration files were not written. Dataset not activated, not found or you do not have write permission!'),$strErrorMessage); - } else if ($preTableName == 'tbl_service') { - $strSQL = "SELECT `id`, `$preKeyField` FROM `$preTableName` WHERE $strDomainWhere AND `access_group` IN ($strAccess) AND `active`='1' GROUP BY `$preKeyField`, `id`"; - $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn == false) $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - if ($booReturn && ($intDataCount != 0)) { - foreach ($arrData AS $data) { - $intReturn = $myConfigClass->createConfigSingle("$preTableName",$data['id']); - if ($intReturn == 1){ - $intError++; - $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - } else { - $intSuccess++; - } - } - } else { - $myVisClass->processMessage(translate('Some configuration files were not written. Dataset not activated, not found or you do not have write permission!'),$strErrorMessage); - } - if ($intSuccess != 0) $myVisClass->processMessage(translate('Configuration files successfully written!'),$strInfoMessage); - if ($intError != 0) $myVisClass->processMessage(translate('Some configuration files were not written. Dataset not activated, not found or you do not have write permission!'),$strErrorMessage); - } else { - $intReturn = $myConfigClass->createConfig($preTableName,0); - if ($intReturn == 1) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - if ($intReturn == 0) $myVisClass->processMessage($myConfigClass->strInfoMessage,$strInfoMessage); - } - $chkModus = "display"; -} else if (($chkModus == "checkform") && ($chkSelModify == "info")) { - // Display additional relation information - if ($preTableName == 'tbl_service') { - $intReturn = $myDataClass->infoRelation($preTableName,$chkListId,"$preKeyField,service_description"); - } else { - $intReturn = $myDataClass->infoRelation($preTableName,$chkListId,$preKeyField); - } - $myVisClass->processMessage($myDataClass->strInfoMessage,$strConsistMessage); - $chkModus = "display"; -} else if (($chkModus == "checkform") && ($chkSelModify == "delete") && ($intGlobalWriteAccess == 0)) { - // Delete selected datasets - if (($preTableName == 'tbl_user') && ($chkTfValue5 == "Admin")) { - $myVisClass->processMessage(translate("Admin can't be deleted"),$strErrorMessage); - $intReturn = 0; - } else if ((($preTableName == 'tbl_datadomain') || ($preTableName == 'tbl_configtarget')) && ($chkTfValue3 == "localhost")) { - $myVisClass->processMessage(translate("Localhost can't be deleted"),$strErrorMessage); - $intReturn = 0; - } else if (($preTableName == 'tbl_user') || ($preTableName == 'tbl_datadomain') || ($preTableName == 'tbl_configtarget')) { - $intReturn = $myDataClass->dataDeleteEasy($preTableName,$chkListId); - } else { - $intReturn = $myDataClass->dataDeleteFull($preTableName,$chkListId); - } - if ($intReturn == 1) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intReturn == 0) $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $chkModus = "display"; -} else if (($chkModus == "checkform") && ($chkSelModify == "copy") && ($intGlobalWriteAccess == 0)) { - // Copy selected datasets - $intReturn = $myDataClass->dataCopyEasy($preTableName,$preKeyField,$chkListId,$chkSelTargetDomain); - if ($intReturn == 1) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intReturn == 0) $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $chkModus = "display"; -} else if (($chkModus == "checkform") && ($chkSelModify == "activate") && ($intGlobalWriteAccess == 0)) { - // Activate selected datasets - $intReturn = $myDataClass->dataActivate($preTableName,$chkListId); - if ($intReturn == 1) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intReturn == 0) $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - $chkModus = "display"; -} else if (($chkModus == "checkform") && ($chkSelModify == "deactivate") && ($intGlobalWriteAccess == 0)) { - // Deactivate selected datasets - $intReturn = $myDataClass->dataDeactivate($preTableName,$chkListId); - if ($intReturn == 1) $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - if ($intReturn == 0) $myVisClass->processMessage($myDataClass->strInfoMessage,$strInfoMessage); - // Remove deactivated files - if ($preTableName == 'tbl_host') { - if ($chkListId != 0) { - $strChbName = "chbId_".$chkListId; - $_POST[$strChbName] = "on"; - } - // Get write access groups - $strAccess = $myVisClass->getAccGroups('write'); - // Getting data sets - $strSQL = "SELECT `id`, `host_name` FROM `".$preTableName."` WHERE `active`='0' AND `access_group` IN ($strAccess) AND `config_id`=".$chkDomainId; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn && ($intDataCount != 0) && ($chkDomainId != 0)) { - $arrConfigID = $myConfigClass->getConfigSets(); - $intError = 0; - $intSuccess = 0; - if (($arrConfigID != 1) && is_array($arrConfigID)) { - foreach ($arrData AS $elem) { - $strChbName = "chbId_".$elem['id']; - // was the current record is marked for deactivate? - if (isset($_POST[$strChbName]) && ($_POST[$strChbName] == "on")) { - $intCount = 0; - $intReturn = 0; - foreach($arrConfigID AS $intConfigID) { - $intReturn += $myConfigClass->moveFile("host",$elem['host_name'].".cfg",$intConfigID); - if ($intReturn == 0) { - $myDataClass->writeLog(translate('Host file deleted:')." ".$elem['host_name'].".cfg"); - $intCount++; - } - } - if ($intReturn == 0) $intSuccess++; - if ($intReturn != 0) $intError++; - } - } - if (($intSuccess != 0) && ($intCount != 0)) { - $myVisClass->processMessage(translate('The assigned, no longer used configuration files were deleted successfully!').$intCount,$strInfoMessage); - } - if ($intError != 0) { - $myVisClass->processMessage(translate('Errors while deleting the old configuration file - please check!:'),$strErrorMessage); - } - } - } else if ($chkDomainId == 0) { - $myVisClass->processMessage(translate('Common files cannot be removed from target systems - please check manually'),$strErrorMessage); - } - } else if ($preTableName == 'tbl_service') { - if ($chkListId != 0) { - $strChbName = "chbId_".$chkListId; - $_POST[$strChbName] = "on"; - } - // Get write access groups - $strAccess = $myVisClass->getAccGroups('write'); - // Getting data sets - $strSQL = "SELECT `id`, `config_name` FROM `".$preTableName."` WHERE `active`='0' AND `access_group` IN ($strAccess) AND `config_id`=".$chkDomainId; - $booReturn = $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - if ($booReturn && ($intDataCount != 0) && ($chkDomainId != 0)) { - $arrConfigID = $myConfigClass->getConfigSets(); - $intError = 0; - $intSuccess = 0; - if (($arrConfigID != 1) && is_array($arrConfigID)) { - $intCount = 0; - foreach ($arrData AS $elem) { - $strChbName = "chbId_".$elem['id']; - // was the current record is marked for deactivate? - if (isset($_POST[$strChbName]) && ($_POST[$strChbName] == "on")) { - $intServiceCount = $myDBClass->countRows("SELECT * FROM `$preTableName` WHERE `$preKeyField`='".$elem['config_name']."' - AND `config_id`=$chkDomainId AND `active`='1'"); - if ($intServiceCount == 0) { - $intReturn = 0; - foreach($arrConfigID AS $intConfigID) { - $intReturn += $myConfigClass->moveFile("service",$elem['config_name'].".cfg",$intConfigID); - if ($intReturn == 0) $myDataClass->writeLog(translate('Service file deleted:')." ".$elem['config_name'].".cfg"); - $intCount++; - } - if ($intReturn == 0) $intSuccess++; - if ($intReturn != 0) $intError++; - } - } - } - if (($intSuccess != 0) && ($intCount != 0)) { - $myVisClass->processMessage(translate('The assigned, no longer used configuration files were deleted successfully!'),$strInfoMessage); - } - if ($intError != 0) { - $myVisClass->processMessage(translate('Errors while deleting the old configuration file - please check!:'),$strErrorMessage); - } - } - } else if ($chkDomainId == 0) { - $myVisClass->processMessage(translate('Common files cannot be removed from target systems - please check manually'),$strErrorMessage); - } - } - $chkModus = "display"; -} else if (($chkModus == "checkform") && ($chkSelModify == "modify")) { - // Open the dataset to modify - if ($intReadAccessId == 0) { - $booReturn = $myDBClass->getSingleDataset("SELECT * FROM `$preTableName` WHERE `id`=".$chkListId,$arrModifyData); - if ($booReturn == false) { - $myVisClass->processMessage(translate('Error while selecting data from database:'),$strErrorMessage); - $myVisClass->processMessage($myDBClass->strErrorMessage,$strErrorMessage); - $chkModus = "display"; - } else { - $chkModus = "add"; - } - } else { - $myVisClass->processMessage(translate('No permission to open configuration!'),$strErrorMessage); - $chkModus = "display"; - } -} else if (($chkModus == "checkform") && ($chkSelModify == "config") && ($intGlobalWriteAccess == 0)) { - // Write configuration file (hosts and services) - $intDSId = (int)substr(array_search("on",$_POST),6); - if (isset($chkListId) && ($chkListId != 0)) $intDSId = $chkListId; - $intValCount = 0; - foreach($_POST AS $key => $elem) { - if ($elem == "on") $intValCount++; - } - if ($intValCount > 1) $intDSId = 0; - $intReturn = $myConfigClass->createConfigSingle($preTableName,$intDSId); - if ($intReturn == 1) $myVisClass->processMessage($myConfigClass->strErrorMessage,$strErrorMessage); - if ($intReturn == 0) $myVisClass->processMessage($myConfigClass->strInfoMessage,$strInfoMessage); - $chkModus = "display"; +if (($chkModus == 'make') && ($intGlobalWriteAccess == 0)) { + $intError = 0; + $intSuccess = 0; + // Get write access groups + $strAccess = $myVisClass->getAccessGroups('write'); + // Write configuration file + if ($preTableName == 'tbl_host') { + /** @var string $strDomainWhere - defined in prepend_adm.php */ + $strSQL = "SELECT `id` FROM `$preTableName` " + . "WHERE $strDomainWhere AND `access_group` IN ($strAccess) AND `active`='1'"; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrData as $data) { + $intReturn = $myConfigClass->createConfigSingle($preTableName, $data['id']); + if ($intReturn == 1) { + $intError++; + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } else { + $intSuccess++; + } + } + } else { + $myVisClass->processMessage(translate('Some configuration files were not written. Dataset not activated, ' + . 'not found or you do not have write permission!'), $strErrorMessage); + } + if ($intSuccess != 0) { + $myVisClass->processMessage(translate('Configuration files successfully written!'), $strInfoMessage); + } + if ($intError != 0) { + $myVisClass->processMessage(translate('Some configuration files were not written. Dataset not activated, ' + . 'not found or you do not have write permission!'), $strErrorMessage); + } + } elseif ($preTableName == 'tbl_service') { + /** @var string $strDomainWhere - defined in prepend_adm.php */ + $strSQL = "SELECT `id`, `$preKeyField` FROM `$preTableName` " + . "WHERE $strDomainWhere AND `access_group` IN ($strAccess) AND `active`='1' " + . "GROUP BY `$preKeyField`, `id`"; + $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn == false) { + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + } + if ($booReturn && ($intDataCount != 0)) { + foreach ($arrData as $data) { + $intReturn = $myConfigClass->createConfigSingle($preTableName, $data['id']); + if ($intReturn == 1) { + $intError++; + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } else { + $intSuccess++; + } + } + } else { + $myVisClass->processMessage(translate('Some configuration files were not written. Dataset not activated, ' + . 'not found or you do not have write permission!'), $strErrorMessage); + } + if ($intSuccess != 0) { + $myVisClass->processMessage(translate('Configuration files successfully written!'), $strInfoMessage); + } + if ($intError != 0) { + $myVisClass->processMessage(translate('Some configuration files were not written. Dataset not activated, ' + . 'not found or you do not have write permission!'), $strErrorMessage); + } + } else { + $intReturn = $myConfigClass->createConfig($preTableName, 0); + if ($intReturn == 1) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + if ($intReturn == 0) { + $myVisClass->processMessage($myConfigClass->strInfoMessage, $strInfoMessage); + } + } + $chkModus = 'display'; +} elseif (($chkModus == 'checkform') && ($chkSelModify == 'info')) { + // Display additional relation information + if ($preTableName == 'tbl_service') { + $intReturn = $myDataClass->infoRelation($preTableName, $chkListId, "$preKeyField,service_description"); + } else { + $intReturn = $myDataClass->infoRelation($preTableName, $chkListId, $preKeyField); + } + $myVisClass->processMessage($myDataClass->strInfoMessage, $strConsistMessage); + $chkModus = 'display'; +} elseif (($chkModus == 'checkform') && ($chkSelModify == 'delete') && ($intGlobalWriteAccess == 0)) { + $intReturn = 1; + // Delete selected datasets + if (($preTableName == 'tbl_user') && ($chkTfValue5 == 'Admin')) { + $myVisClass->processMessage(translate('Admin cannot be deleted'), $strErrorMessage); + $intReturn = 0; + } elseif ((($preTableName == 'tbl_datadomain') || ($preTableName == 'tbl_configtarget')) && + ($chkTfValue3 == 'localhost')) { + $myVisClass->processMessage(translate("Localhost can't be deleted"), $strErrorMessage); + $intReturn = 0; + } elseif (($preTableName == 'tbl_user') || ($preTableName == 'tbl_datadomain') || + ($preTableName == 'tbl_configtarget')) { + $intReturn = $myDataClass->dataDeleteEasy($preTableName, $chkListId); + } else { + $strInfoMessageTmp = $strInfoMessage; + if ($preTableName == 'tbl_service') { + $intRetVal = $myDataClass->infoRelation($preTableName, $chkListId, "$preKeyField,service_description"); + } else { + $intRetVal = $myDataClass->infoRelation($preTableName, $chkListId, $preKeyField); + } + if ($intRetVal == 0) { + $strInfoMessage = $strInfoMessageTmp; + $intReturn = $myDataClass->dataDeleteFull($preTableName, $chkListId); + } + } + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + $chkModus = 'display'; +} elseif (($chkModus == 'checkform') && ($chkSelModify == 'copy') && ($intGlobalWriteAccess == 0)) { + // Copy selected datasets + $intReturn = $myDataClass->dataCopyEasy($preTableName, $preKeyField, $chkListId, $chkSelTarDom); + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intReturn == 0) { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + } + $chkModus = 'display'; +} elseif (($chkModus == 'checkform') && ($chkSelModify == 'activate') && ($intGlobalWriteAccess == 0)) { + // Activate selected datasets + $intReturn = $myDataClass->dataActivate($preTableName, $chkListId); + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intReturn == 0) { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + } + $chkModus = 'display'; +} elseif (($chkModus == 'checkform') && ($chkSelModify == 'deactivate') && ($intGlobalWriteAccess == 0)) { + // Deactivate selected datasets + $intReturn = $myDataClass->dataDeactivate($preTableName, $chkListId); + if ($intReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } + if ($intReturn == 0) { + $myVisClass->processMessage($myDataClass->strInfoMessage, $strInfoMessage); + } + // Remove deactivated files + if ($preTableName == 'tbl_host') { + if ($chkListId != 0) { + $strChbName = 'chbId_' .$chkListId; + $_POST[$strChbName] = 'on'; + } + // Get write access groups + $strAccess = $myVisClass->getAccessGroups('write'); + // Getting data sets + $strSQL = 'SELECT `id`, `host_name` FROM `' .$preTableName. '` ' + . "WHERE `active`='0' AND `access_group` IN ($strAccess) AND `config_id`=".$chkDomainId; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn && ($intDataCount != 0) && ($chkDomainId != 0)) { + $intReturn = $myConfigClass->getConfigTargets($arrConfigID); + $intError = 0; + $intSuccess = 0; + if (($arrConfigID != 1) && is_array($arrConfigID)) { + foreach ($arrData as $elem) { + $strChbName = 'chbId_' .$elem['id']; + // was the current record is marked for deactivate? + if ((filter_input(INPUT_POST, $strChbName) != null) && + (filter_input(INPUT_POST, $strChbName, FILTER_SANITIZE_STRING) == 'on')) { + $intCount = 0; + $intReturn = 0; + foreach ($arrConfigID as $intConfigID) { + $intReturn += $myConfigClass->moveFile('host', $elem['host_name']. '.cfg', $intConfigID); + if ($intReturn == 0) { + $myDataClass->writeLog(translate('Host file deleted:'). ' ' .$elem['host_name'] + . '.cfg'); + $intCount++; + } + } + if ($intReturn == 0) { + $intSuccess++; + } + if ($intReturn != 0) { + $intError++; + } + } + } + if (($intSuccess != 0) && ($intCount != 0)) { + $myVisClass->processMessage(translate('The assigned, no longer used configuration files were ' + . 'deleted successfully!').$intCount, $strInfoMessage); + } + if ($intError != 0) { + $myVisClass->processMessage(translate('Errors while deleting the old configuration file - please ' + . 'check!:'), $strErrorMessage); + } + } + } elseif ($chkDomainId == 0) { + $myVisClass->processMessage(translate('Common files cannot be removed from target systems - please check ' + . 'manually'), $strErrorMessage); + } + } elseif ($preTableName == 'tbl_service') { + if ($chkListId != 0) { + $strChbName = 'chbId_' .$chkListId; + $_POST[$strChbName] = 'on'; + } + // Get write access groups + $strAccess = $myVisClass->getAccessGroups('write'); + // Getting data sets + $strSQL = 'SELECT `id`, `config_name` FROM `' .$preTableName. '` ' + . "WHERE `active`='0' AND `access_group` IN ($strAccess) AND `config_id`=".$chkDomainId; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + if ($booReturn && ($intDataCount != 0) && ($chkDomainId != 0)) { + $intReturn = $myConfigClass->getConfigTargets($arrConfigID); + $intError = 0; + $intSuccess = 0; + if (($arrConfigID != 1) && is_array($arrConfigID)) { + $intCount = 0; + foreach ($arrData as $elem) { + $strChbName = 'chbId_' .$elem['id']; + // was the current record is marked for deactivate? + if (filter_input(INPUT_POST, $strChbName) && (filter_input(INPUT_POST, $strChbName) == 'on')) { + $intServiceCount = $myDBClass->countRows("SELECT * FROM `$preTableName` " + . "WHERE `$preKeyField`='".$elem['config_name']."' " + . "AND `config_id`=$chkDomainId AND `active`='1'"); + if ($intServiceCount == 0) { + $intReturn = 0; + foreach ($arrConfigID as $intConfigID) { + $intReturn += $myConfigClass->moveFile( + 'service', + $elem['config_name']. '.cfg', + $intConfigID + ); + if ($intReturn == 0) { + $myDataClass->writeLog(translate('Service file deleted:'). ' ' . + $elem['config_name']. '.cfg'); + } + $intCount++; + } + if ($intReturn == 0) { + $intSuccess++; + } + if ($intReturn != 0) { + $intError++; + } + } + } + } + if (($intSuccess != 0) && ($intCount != 0)) { + $myVisClass->processMessage(translate('The assigned, no longer used configuration files were ' + . 'deleted successfully!'), $strInfoMessage); + } + if ($intError != 0) { + $myVisClass->processMessage(translate('Errors while deleting the old configuration file - please ' + . 'check!:'), $strErrorMessage); + } + } + } elseif ($chkDomainId == 0) { + $myVisClass->processMessage(translate('Common files cannot be removed from target systems - please check ' + . 'manually'), $strErrorMessage); + } + } + $chkModus = 'display'; +} elseif (($chkModus == 'checkform') && ($chkSelModify == 'modify')) { + // Open the dataset to modify + if ($intReadAccessId == 0) { + $booReturn = $myDBClass->hasSingleDataset("SELECT * FROM `$preTableName` " + . 'WHERE `id`=' .$chkListId, $arrModifyData); + if ($booReturn == false) { + $myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage); + $myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage); + $chkModus = 'display'; + } else { + $chkModus = 'add'; + } + } else { + $myVisClass->processMessage(translate('No permission to open configuration!'), $strErrorMessage); + $chkModus = 'display'; + } +} elseif (($chkModus == 'checkform') && ($chkSelModify == 'config') && ($intGlobalWriteAccess == 0)) { + // Write configuration file (hosts and services) + $intDSId = (int)substr(array_search('on', filter_input_array(INPUT_POST), true), 6); + if (isset($chkListId) && ($chkListId != 0)) { + $intDSId = $chkListId; + } + $intValCount = 0; + foreach (filter_input_array(INPUT_POST) as $key => $elem) { + if ($elem == 'on') { + $intValCount++; + } + } + if ($intValCount > 1) { + $intDSId = 0; + } + $intReturn = $myConfigClass->createConfigSingle($preTableName, $intDSId); + if ($intReturn == 1) { + $myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage); + } + if ($intReturn == 0) { + $myVisClass->processMessage($myConfigClass->strInfoMessage, $strInfoMessage); + } + $chkModus = 'display'; } -// +// // Some common list view functions // =============================== -if ($chkModus != "add") { - // Get Group id's with READ - $strAccess = $myVisClass->getAccGroups('read'); - // Include domain list - $myVisClass->insertDomainList($mastertp); - // Process filter string +if ($chkModus != 'add') { + // Get Group id's with READ + $strAccess = $myVisClass->getAccessGroups('read'); + // Include domain list + /** @var HTML_Template_IT $mastertp */ + $myVisClass->insertDomainList($mastertp); + // Process filter string } -?> \ No newline at end of file diff --git a/functions/prepend_scripting.php b/functions/prepend_scripting.php index 011833d..f7d3138 100644 --- a/functions/prepend_scripting.php +++ b/functions/prepend_scripting.php @@ -5,108 +5,99 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Preprocessing script for scripting files -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:48:25 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 4 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// -error_reporting(E_ALL); +//error_reporting(E_ALL); //error_reporting(E_ERROR); // // Security Protection // =================== if (isset($_GET['SETS']) || isset($_POST['SETS'])) { - $SETS = ""; + $SETS = ''; } // // Timezone settings (>=PHP5.1) // ============================ -if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")) { - @date_default_timezone_set(@date_default_timezone_get()); +if (function_exists('date_default_timezone_set') and function_exists('date_default_timezone_get')) { + @date_default_timezone_set(@date_default_timezone_get()); } // // Define common variables // ======================= $chkDomainId = 0; -$intError = 0; +$intError = 0; // // Define path constants // -define('BASE_PATH', str_replace("functions","",dirname(__FILE__))); +//define('BASE_PATH', str_replace("functions", "", dirname(__FILE__))); // // Read settings file // ================== -$preBasePath = str_replace("functions","",dirname(__FILE__)); +$preBasePath = str_replace('functions', '', __DIR__); $preIniFile = $preBasePath.'config/settings.php'; // // Read file settings // ================== -$SETS = parse_ini_file($preIniFile,true); +$SETS = parse_ini_file($preIniFile, true); // // Include external function/class files - part 1 // ============================================== -include("mysqli_class.php"); +require $preBasePath.'functions/Autoloader.php'; +functions\Autoloader::register($preBasePath); // // Initialize classes - part 1 // =========================== -$myDBClass = new mysqlidb; +$myDBClass = new functions\MysqliDbClass(); $myDBClass->arrParams = $SETS['db']; -$myDBClass->getDatabase(); +$myDBClass->hasDBConnection(); if ($myDBClass->error == true) { - $strDBMessage = $myDBClass->strErrorMessage; - $booError = $myDBClass->error; + $strDBMessage = $myDBClass->strErrorMessage; + $booError = $myDBClass->error; } // // Get additional configuration from the table tbl_settings // ======================================================== if ($intError == 0) { - $strSQL = "SELECT `category`,`name`,`value` FROM `tbl_settings`"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - echo str_replace("::","\n","Error while selecting data from database: ".$myDBClass->strErrorMessage); - $intError = 1; - } else if ($intDataCount != 0) { - for ($i=0;$i<$intDataCount;$i++) { - $SETS[$arrDataLines[$i]['category']][$arrDataLines[$i]['name']] = $arrDataLines[$i]['value']; - } - } + $strSQL = 'SELECT `category`,`name`,`value` FROM `tbl_settings`'; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn == false) { + echo str_replace('::', "\n", 'Error while selecting data from database: ' .$myDBClass->strErrorMessage); + $intError = 1; + } elseif ($intDataCount != 0) { + for ($i=0; $i<$intDataCount; $i++) { + $SETS[$arrDataLines[$i]['category']][$arrDataLines[$i]['name']] = $arrDataLines[$i]['value']; + } + } } else { - echo "Could not load configuration settings from database - abort\n"; - exit; + echo "Could not load configuration settings from database - abort\n"; + exit; } // // Include external function/class files // ===================================== -include("translator.php"); -include("data_class.php"); -include("config_class.php"); -include("import_class.php"); -require_once($preBasePath.'libraries/pear/HTML/Template/IT.php'); +include 'translator.php'; // // Initialize classes // ================== -$myDataClass = new nagdata; -$myConfigClass = new nagconfig; -$myImportClass = new nagimport; +$arrSession = array(); +$arrSession['SETS'] = $SETS; +$myDataClass = new functions\NagDataClass($arrSession); +$myConfigClass = new functions\NagConfigClass($arrSession); +$myImportClass = new functions\NagImportClass($arrSession); // // Propagating the classes themselves // ================================== -$myDataClass->myDBClass =& $myDBClass; -$myDataClass->myConfigClass =& $myConfigClass; -$myConfigClass->myDBClass =& $myDBClass; -$myConfigClass->myDataClass =& $myDataClass; -$myImportClass->myDataClass =& $myDataClass; -$myImportClass->myDBClass =& $myDBClass; -$myImportClass->myConfigClass =& $myConfigClass; -// -// Set class variables -// =================== -$myDataClass->arrSettings = $SETS; -$myConfigClass->arrSettings = $SETS; -?> \ No newline at end of file +$myDataClass->myDBClass =& $myDBClass; +$myDataClass->myConfigClass =& $myConfigClass; +$myConfigClass->myDBClass =& $myDBClass; +$myConfigClass->myDataClass =& $myDataClass; +$myImportClass->myDataClass =& $myDataClass; +$myImportClass->myDBClass =& $myDBClass; +$myImportClass->myConfigClass =& $myConfigClass; diff --git a/functions/tinyMCE/jscripts/tiny_mce/langs/en.js b/functions/tinyMCE/jscripts/tiny_mce/langs/en.js index 8a80d46..3b3e138 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/langs/en.js +++ b/functions/tinyMCE/jscripts/tiny_mce/langs/en.js @@ -1,223 +1,223 @@ -tinyMCE.addI18n({en:{ -common:{ -edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", -apply:"Apply", -insert:"Insert", -update:"Update", -cancel:"Cancel", -close:"Close", -browse:"Browse", -class_name:"Class", -not_set:"-- Not set --", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", -clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", -popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", -invalid_data:"{#field} is invalid", -invalid_data_number:"{#field} must be a number", -invalid_data_min:"{#field} must be a number greater than {#min}", -invalid_data_size:"{#field} must be a number or percentage", -more_colors:"More colors" -}, -colors:{ -'000000':'Black', -'993300':'Burnt orange', -'333300':'Dark olive', -'003300':'Dark green', -'003366':'Dark azure', -'000080':'Navy Blue', -'333399':'Indigo', -'333333':'Very dark gray', -'800000':'Maroon', -'FF6600':'Orange', -'808000':'Olive', -'008000':'Green', -'008080':'Teal', -'0000FF':'Blue', -'666699':'Grayish blue', -'808080':'Gray', -'FF0000':'Red', -'FF9900':'Amber', -'99CC00':'Yellow green', -'339966':'Sea green', -'33CCCC':'Turquoise', -'3366FF':'Royal blue', -'800080':'Purple', -'999999':'Medium gray', -'FF00FF':'Magenta', -'FFCC00':'Gold', -'FFFF00':'Yellow', -'00FF00':'Lime', -'00FFFF':'Aqua', -'00CCFF':'Sky blue', -'993366':'Brown', -'C0C0C0':'Silver', -'FF99CC':'Pink', -'FFCC99':'Peach', -'FFFF99':'Light yellow', -'CCFFCC':'Pale green', -'CCFFFF':'Pale cyan', -'99CCFF':'Light sky blue', -'CC99FF':'Plum', -'FFFFFF':'White' -}, -contextmenu:{ -align:"Alignment", -left:"Left", -center:"Center", -right:"Right", -full:"Full" -}, -insertdatetime:{ -date_fmt:"%Y-%m-%d", -time_fmt:"%H:%M:%S", -insertdate_desc:"Insert date", -inserttime_desc:"Insert time", -months_long:"January,February,March,April,May,June,July,August,September,October,November,December", -months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", -day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", -day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" -}, -print:{ -print_desc:"Print" -}, -preview:{ -preview_desc:"Preview" -}, -directionality:{ -ltr_desc:"Direction left to right", -rtl_desc:"Direction right to left" -}, -layer:{ -insertlayer_desc:"Insert new layer", -forward_desc:"Move forward", -backward_desc:"Move backward", -absolute_desc:"Toggle absolute positioning", -content:"New layer..." -}, -save:{ -save_desc:"Save", -cancel_desc:"Cancel all changes" -}, -nonbreaking:{ -nonbreaking_desc:"Insert non-breaking space character" -}, -iespell:{ -iespell_desc:"Run spell checking", -download:"ieSpell not detected. Do you want to install it now?" -}, -advhr:{ -advhr_desc:"Horizontal rule" -}, -emotions:{ -emotions_desc:"Emotions" -}, -searchreplace:{ -search_desc:"Find", -replace_desc:"Find/Replace" -}, -advimage:{ -image_desc:"Insert/edit image" -}, -advlink:{ -link_desc:"Insert/edit link" -}, -xhtmlxtras:{ -cite_desc:"Citation", -abbr_desc:"Abbreviation", -acronym_desc:"Acronym", -del_desc:"Deletion", -ins_desc:"Insertion", -attribs_desc:"Insert/Edit Attributes" -}, -style:{ -desc:"Edit CSS Style" -}, -paste:{ -paste_text_desc:"Paste as Plain Text", -paste_word_desc:"Paste from Word", -selectall_desc:"Select All", -plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.", -plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode." -}, -paste_dlg:{ -text_title:"Use CTRL+V on your keyboard to paste the text into the window.", -text_linebreaks:"Keep linebreaks", -word_title:"Use CTRL+V on your keyboard to paste the text into the window." -}, -table:{ -desc:"Inserts a new table", -row_before_desc:"Insert row before", -row_after_desc:"Insert row after", -delete_row_desc:"Delete row", -col_before_desc:"Insert column before", -col_after_desc:"Insert column after", -delete_col_desc:"Remove column", -split_cells_desc:"Split merged table cells", -merge_cells_desc:"Merge table cells", -row_desc:"Table row properties", -cell_desc:"Table cell properties", -props_desc:"Table properties", -paste_row_before_desc:"Paste table row before", -paste_row_after_desc:"Paste table row after", -cut_row_desc:"Cut table row", -copy_row_desc:"Copy table row", -del:"Delete table", -row:"Row", -col:"Column", -cell:"Cell" -}, -autosave:{ -unload_msg:"The changes you made will be lost if you navigate away from this page.", -restore_content:"Restore auto-saved content.", -warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?." -}, -fullscreen:{ -desc:"Toggle fullscreen mode" -}, -media:{ -desc:"Insert / edit embedded media", -edit:"Edit embedded media" -}, -fullpage:{ -desc:"Document properties" -}, -template:{ -desc:"Insert predefined template content" -}, -visualchars:{ -desc:"Visual control characters on/off." -}, -spellchecker:{ -desc:"Toggle spellchecker", -menu:"Spellchecker settings", -ignore_word:"Ignore word", -ignore_words:"Ignore all", -langs:"Languages", -wait:"Please wait...", -sug:"Suggestions", -no_sug:"No suggestions", -no_mpell:"No misspellings found.", -learn_word:"Learn word" -}, -pagebreak:{ -desc:"Insert page break." -}, -advlist:{ -types:"Types", -def:"Default", -lower_alpha:"Lower alpha", -lower_greek:"Lower greek", -lower_roman:"Lower roman", -upper_alpha:"Upper alpha", -upper_roman:"Upper roman", -circle:"Circle", -disc:"Disc", -square:"Square" -}, -aria:{ -rich_text_area:"Rich Text Area" -}, -wordcount:{ -words: 'Words: ' -} +tinyMCE.addI18n({en:{ +common:{ +edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", +apply:"Apply", +insert:"Insert", +update:"Update", +cancel:"Cancel", +close:"Close", +browse:"Browse", +class_name:"Class", +not_set:"-- Not set --", +clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", +clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", +popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", +invalid_data:"{#field} is invalid", +invalid_data_number:"{#field} must be a number", +invalid_data_min:"{#field} must be a number greater than {#min}", +invalid_data_size:"{#field} must be a number or percentage", +more_colors:"More colors" +}, +colors:{ +'000000':'Black', +'993300':'Burnt orange', +'333300':'Dark olive', +'003300':'Dark green', +'003366':'Dark azure', +'000080':'Navy Blue', +'333399':'Indigo', +'333333':'Very dark gray', +'800000':'Maroon', +'FF6600':'Orange', +'808000':'Olive', +'008000':'Green', +'008080':'Teal', +'0000FF':'Blue', +'666699':'Grayish blue', +'808080':'Gray', +'FF0000':'Red', +'FF9900':'Amber', +'99CC00':'Yellow green', +'339966':'Sea green', +'33CCCC':'Turquoise', +'3366FF':'Royal blue', +'800080':'Purple', +'999999':'Medium gray', +'FF00FF':'Magenta', +'FFCC00':'Gold', +'FFFF00':'Yellow', +'00FF00':'Lime', +'00FFFF':'Aqua', +'00CCFF':'Sky blue', +'993366':'Brown', +'C0C0C0':'Silver', +'FF99CC':'Pink', +'FFCC99':'Peach', +'FFFF99':'Light yellow', +'CCFFCC':'Pale green', +'CCFFFF':'Pale cyan', +'99CCFF':'Light sky blue', +'CC99FF':'Plum', +'FFFFFF':'White' +}, +contextmenu:{ +align:"Alignment", +left:"Left", +center:"Center", +right:"Right", +full:"Full" +}, +insertdatetime:{ +date_fmt:"%Y-%m-%d", +time_fmt:"%H:%M:%S", +insertdate_desc:"Insert date", +inserttime_desc:"Insert time", +months_long:"January,February,March,April,May,June,July,August,September,October,November,December", +months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", +day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", +day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" +}, +print:{ +print_desc:"Print" +}, +preview:{ +preview_desc:"Preview" +}, +directionality:{ +ltr_desc:"Direction left to right", +rtl_desc:"Direction right to left" +}, +layer:{ +insertlayer_desc:"Insert new layer", +forward_desc:"Move forward", +backward_desc:"Move backward", +absolute_desc:"Toggle absolute positioning", +content:"New layer..." +}, +save:{ +save_desc:"Save", +cancel_desc:"Cancel all changes" +}, +nonbreaking:{ +nonbreaking_desc:"Insert non-breaking space character" +}, +iespell:{ +iespell_desc:"Run spell checking", +download:"ieSpell not detected. Do you want to install it now?" +}, +advhr:{ +advhr_desc:"Horizontal rule" +}, +emotions:{ +emotions_desc:"Emotions" +}, +searchreplace:{ +search_desc:"Find", +replace_desc:"Find/Replace" +}, +advimage:{ +image_desc:"Insert/edit image" +}, +advlink:{ +link_desc:"Insert/edit link" +}, +xhtmlxtras:{ +cite_desc:"Citation", +abbr_desc:"Abbreviation", +acronym_desc:"Acronym", +del_desc:"Deletion", +ins_desc:"Insertion", +attribs_desc:"Insert/Edit Attributes" +}, +style:{ +desc:"Edit CSS Style" +}, +paste:{ +paste_text_desc:"Paste as Plain Text", +paste_word_desc:"Paste from Word", +selectall_desc:"Select All", +plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.", +plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode." +}, +paste_dlg:{ +text_title:"Use CTRL+V on your keyboard to paste the text into the window.", +text_linebreaks:"Keep linebreaks", +word_title:"Use CTRL+V on your keyboard to paste the text into the window." +}, +table:{ +desc:"Inserts a new table", +row_before_desc:"Insert row before", +row_after_desc:"Insert row after", +delete_row_desc:"Delete row", +col_before_desc:"Insert column before", +col_after_desc:"Insert column after", +delete_col_desc:"Remove column", +split_cells_desc:"Split merged table cells", +merge_cells_desc:"Merge table cells", +row_desc:"Table row properties", +cell_desc:"Table cell properties", +props_desc:"Table properties", +paste_row_before_desc:"Paste table row before", +paste_row_after_desc:"Paste table row after", +cut_row_desc:"Cut table row", +copy_row_desc:"Copy table row", +del:"Delete table", +row:"Row", +col:"Column", +cell:"Cell" +}, +autosave:{ +unload_msg:"The changes you made will be lost if you navigate away from this page.", +restore_content:"Restore auto-saved content.", +warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?." +}, +fullscreen:{ +desc:"Toggle fullscreen mode" +}, +media:{ +desc:"Insert / edit embedded media", +edit:"Edit embedded media" +}, +fullpage:{ +desc:"Document properties" +}, +template:{ +desc:"Insert predefined template content" +}, +visualchars:{ +desc:"Visual control characters on/off." +}, +spellchecker:{ +desc:"Toggle spellchecker", +menu:"Spellchecker settings", +ignore_word:"Ignore word", +ignore_words:"Ignore all", +langs:"Languages", +wait:"Please wait...", +sug:"Suggestions", +no_sug:"No suggestions", +no_mpell:"No misspellings found.", +learn_word:"Learn word" +}, +pagebreak:{ +desc:"Insert page break." +}, +advlist:{ +types:"Types", +def:"Default", +lower_alpha:"Lower alpha", +lower_greek:"Lower greek", +lower_roman:"Lower roman", +upper_alpha:"Upper alpha", +upper_roman:"Upper roman", +circle:"Circle", +disc:"Disc", +square:"Square" +}, +aria:{ +rich_text_area:"Rich Text Area" +}, +wordcount:{ +words: 'Words: ' +} }}); \ No newline at end of file diff --git a/functions/tinyMCE/jscripts/tiny_mce/license.txt b/functions/tinyMCE/jscripts/tiny_mce/license.txt index 60d6d4c..1837b0a 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/license.txt +++ b/functions/tinyMCE/jscripts/tiny_mce/license.txt @@ -1,504 +1,504 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/safari/blank.htm b/functions/tinyMCE/jscripts/tiny_mce/plugins/safari/blank.htm new file mode 100644 index 0000000..266808c --- /dev/null +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/safari/blank.htm @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/safari/editor_plugin.js b/functions/tinyMCE/jscripts/tiny_mce/plugins/safari/editor_plugin.js new file mode 100644 index 0000000..4e1a680 --- /dev/null +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/safari/editor_plugin.js @@ -0,0 +1 @@ +(function(){var Event=tinymce.dom.Event,grep=tinymce.grep,each=tinymce.each,inArray=tinymce.inArray,isOldWebKit=tinymce.isOldWebKit;function isEmpty(d,e,f){var w,n;w=d.createTreeWalker(e,NodeFilter.SHOW_ALL,null,false);while(n=w.nextNode()){if(f){if(!f(n))return false;}if(n.nodeType==3&&n.nodeValue&&/[^\s\u00a0]+/.test(n.nodeValue))return false;if(n.nodeType==1&&/^(HR|IMG|TABLE)$/.test(n.nodeName))return false;}return true;};tinymce.create('tinymce.plugins.Safari',{init:function(ed){var t=this,dom;if(!tinymce.isWebKit)return;t.editor=ed;t.webKitFontSizes=['x-small','small','medium','large','x-large','xx-large','-webkit-xxx-large'];t.namedFontSizes=['xx-small','x-small','small','medium','large','x-large','xx-large'];ed.addCommand('CreateLink',function(u,v){var n=ed.selection.getNode(),dom=ed.dom,a;if(n&&(/^(left|right)$/i.test(dom.getStyle(n,'float',1))||/^(left|right)$/i.test(dom.getAttrib(n,'align')))){a=dom.create('a',{href:v},n.cloneNode());n.parentNode.replaceChild(a,n);ed.selection.select(a);}else ed.getDoc().execCommand("CreateLink",false,v);});ed.onPaste.add(function(ed,e){function removeStyles(e){e=e.target;if(e.nodeType==1){e.style.cssText='';each(ed.dom.select('*',e),function(e){e.style.cssText='';});}};Event.add(ed.getDoc(),'DOMNodeInserted',removeStyles);window.setTimeout(function(){Event.remove(ed.getDoc(),'DOMNodeInserted',removeStyles);},0);});ed.onKeyUp.add(function(ed,e){var h,b;if(e.keyCode==46||e.keyCode==8){b=ed.getBody();h=b.innerHTML;if(b.childNodes.length==1&&!/<(img|hr)/.test(h)&&tinymce.trim(h.replace(/<[^>]+>/g,'')).length==0)ed.setContent('',{format:'raw'});}});ed.addCommand('FormatBlock',function(u,v){var dom=ed.dom,e=dom.getParent(ed.selection.getNode(),dom.isBlock);if(e)dom.replace(dom.create(v),e,1);else ed.getDoc().execCommand("FormatBlock",false,v);});ed.addCommand('mceInsertContent',function(u,v){ed.getDoc().execCommand("InsertText",false,'mce_marker');ed.getBody().innerHTML=ed.getBody().innerHTML.replace(/mce_marker/g,v+'XX');ed.selection.select(ed.dom.get('_mce_tmp'));ed.getDoc().execCommand("Delete",false,' ');});ed.onKeyPress.add(function(ed,e){var se,li,lic,r1,r2,n,sel,doc,be,af,pa;if(e.keyCode==13){sel=ed.selection;se=sel.getNode();if(e.shiftKey||ed.settings.force_br_newlines&&se.nodeName!='LI'){t._insertBR(ed);Event.cancel(e);}if(li=dom.getParent(se,'LI')){lic=dom.getParent(li,'OL,UL');doc=ed.getDoc();pa=dom.create('p');dom.add(pa,'br',{mce_bogus:"1"});if(isEmpty(doc,li)){if(n=dom.getParent(lic.parentNode,'LI,OL,UL'))return;n=dom.getParent(lic,'p,h1,h2,h3,h4,h5,h6,div')||lic;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(li);r2=doc.createRange();r2.setStartAfter(li);r2.setEndAfter(n);be=r1.cloneContents();af=r2.cloneContents();if(!isEmpty(doc,af))dom.insertAfter(af,n);dom.insertAfter(pa,n);if(!isEmpty(doc,be))dom.insertAfter(be,n);dom.remove(n);n=pa.firstChild;r1=doc.createRange();r1.setStartBefore(n);r1.setEndBefore(n);sel.setRng(r1);return Event.cancel(e);}}}});ed.onClick.add(function(ed,e){e=e.target;if(e.nodeName=='IMG'){t.selElm=e;ed.selection.select(e);}else t.selElm=null;});ed.onInit.add(function(){t._fixWebKitSpans();if(isOldWebKit)t._patchSafari2x(ed);});ed.onSetContent.add(function(){dom=ed.dom;each(['strong','b','em','u','strike','sub','sup','a'],function(v){each(grep(dom.select(v)).reverse(),function(n){var nn=n.nodeName.toLowerCase(),st;if(nn=='a'){if(n.name)dom.replace(dom.create('img',{mce_name:'a',name:n.name,'class':'mceItemAnchor'}),n);return;}switch(nn){case'b':case'strong':if(nn=='b')nn='strong';st='font-weight: bold;';break;case'em':st='font-style: italic;';break;case'u':st='text-decoration: underline;';break;case'sub':st='vertical-align: sub;';break;case'sup':st='vertical-align: super;';break;case'strike':st='text-decoration: line-through;';break;}dom.replace(dom.create('span',{mce_name:nn,style:st,'class':'Apple-style-span'}),n,1);});});});ed.onPreProcess.add(function(ed,o){dom=ed.dom;each(grep(o.node.getElementsByTagName('span')).reverse(),function(n){var v,bg;if(o.get){if(dom.hasClass(n,'Apple-style-span')){bg=n.style.backgroundColor;switch(dom.getAttrib(n,'mce_name')){case'font':if(!ed.settings.convert_fonts_to_spans)dom.setAttrib(n,'style','');break;case'strong':case'em':case'sub':case'sup':dom.setAttrib(n,'style','');break;case'strike':case'u':if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');else dom.setAttrib(n,'mce_name','');break;default:if(!ed.settings.inline_styles)dom.setAttrib(n,'style','');}if(bg)n.style.backgroundColor=bg;}}if(dom.hasClass(n,'mceItemRemoved'))dom.remove(n,1);});});ed.onPostProcess.add(function(ed,o){o.content=o.content.replace(/
<\/(h[1-6]|div|p|address|pre)>/g,'');o.content=o.content.replace(/ id=\"undefined\"/g,'');});},getInfo:function(){return{longname:'Safari compatibility',author:'Moxiecode Systems AB',authorurl:'http://tinymce.moxiecode.com',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/safari',version:tinymce.majorVersion+"."+tinymce.minorVersion};},_fixWebKitSpans:function(){var t=this,ed=t.editor;if(!isOldWebKit){Event.add(ed.getDoc(),'DOMNodeInserted',function(e){e=e.target;if(e&&e.nodeType==1)t._fixAppleSpan(e);});}else{ed.onExecCommand.add(function(){each(ed.dom.select('span'),function(n){t._fixAppleSpan(n);});ed.nodeChanged();});}},_fixAppleSpan:function(e){var ed=this.editor,dom=ed.dom,fz=this.webKitFontSizes,fzn=this.namedFontSizes,s=ed.settings,st,p;if(dom.getAttrib(e,'mce_fixed'))return;if(e.nodeName=='SPAN'&&e.className=='Apple-style-span'){st=e.style;if(!s.convert_fonts_to_spans){if(st.fontSize){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'size',inArray(fz,st.fontSize)+1);}if(st.fontFamily){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'face',st.fontFamily);}if(st.color){dom.setAttrib(e,'mce_name','font');dom.setAttrib(e,'color',dom.toHex(st.color));}if(st.backgroundColor){dom.setAttrib(e,'mce_name','font');dom.setStyle(e,'background-color',st.backgroundColor);}}else{if(st.fontSize)dom.setStyle(e,'fontSize',fzn[inArray(fz,st.fontSize)]);}if(st.fontWeight=='bold')dom.setAttrib(e,'mce_name','strong');if(st.fontStyle=='italic')dom.setAttrib(e,'mce_name','em');if(st.textDecoration=='underline')dom.setAttrib(e,'mce_name','u');if(st.textDecoration=='line-through')dom.setAttrib(e,'mce_name','strike');if(st.verticalAlign=='super')dom.setAttrib(e,'mce_name','sup');if(st.verticalAlign=='sub')dom.setAttrib(e,'mce_name','sub');dom.setAttrib(e,'mce_fixed','1');}},_patchSafari2x:function(ed){var t=this,setContent,getNode,dom=ed.dom,lr;if(ed.windowManager.onBeforeOpen){ed.windowManager.onBeforeOpen.add(function(){r=ed.selection.getRng();});}ed.selection.select=function(n){this.getSel().setBaseAndExtent(n,0,n,1);};getNode=ed.selection.getNode;ed.selection.getNode=function(){return t.selElm||getNode.call(this);};ed.selection.getRng=function(){var t=this,s=t.getSel(),d=ed.getDoc(),r,rb,ra,di;if(s.anchorNode){r=d.createRange();try{rb=d.createRange();rb.setStart(s.anchorNode,s.anchorOffset);rb.collapse(1);ra=d.createRange();ra.setStart(s.focusNode,s.focusOffset);ra.collapse(1);di=rb.compareBoundaryPoints(rb.START_TO_END,ra)<0;r.setStart(di?s.anchorNode:s.focusNode,di?s.anchorOffset:s.focusOffset);r.setEnd(di?s.focusNode:s.anchorNode,di?s.focusOffset:s.anchorOffset);lr=r;}catch(ex){}}return r||lr;};setContent=ed.selection.setContent;ed.selection.setContent=function(h,s){var r=this.getRng(),b;try{setContent.call(this,h,s);}catch(ex){b=dom.create('body');b.innerHTML=h;each(b.childNodes,function(n){r.insertNode(n.cloneNode(true));});}};},_insertBR:function(ed){var dom=ed.dom,s=ed.selection,r=s.getRng(),br;r.insertNode(br=dom.create('br'));r.setStartAfter(br);r.setEndAfter(br);s.setRng(r);if(s.getSel().focusNode==br.previousSibling){s.select(dom.insertAfter(dom.doc.createTextNode('\u00a0'),br));s.collapse(1);}ed.getWin().scrollTo(0,dom.getPos(s.getRng().startContainer).y);}});tinymce.PluginManager.add('safari',tinymce.plugins.Safari);})(); \ No newline at end of file diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css b/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css index ecdf58c..3e2eaf3 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/css/searchreplace.css @@ -1,6 +1,6 @@ -.panel_wrapper {height:85px;} -.panel_wrapper div.current {height:85px;} - -/* IE */ -* html .panel_wrapper {height:100px;} -* html .panel_wrapper div.current {height:100px;} +.panel_wrapper {height:85px;} +.panel_wrapper div.current {height:85px;} + +/* IE */ +* html .panel_wrapper {height:100px;} +* html .panel_wrapper div.current {height:100px;} diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js b/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js index 80284b9..b1630ca 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/js/searchreplace.js @@ -1,142 +1,142 @@ -tinyMCEPopup.requireLangPack(); - -var SearchReplaceDialog = { - init : function(ed) { - var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); - - t.switchMode(m); - - f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); - - // Focus input field - f[m + '_panel_searchstring'].focus(); - - mcTabs.onChange.add(function(tab_id, panel_id) { - t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); - }); - }, - - switchMode : function(m) { - var f, lm = this.lastMode; - - if (lm != m) { - f = document.forms[0]; - - if (lm) { - f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; - f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; - f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; - f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; - } - - mcTabs.displayTab(m + '_tab', m + '_panel'); - document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; - document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; - this.lastMode = m; - } - }, - - searchNext : function(a) { - var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; - - // Get input - f = document.forms[0]; - s = f[m + '_panel_searchstring'].value; - b = f[m + '_panel_backwardsu'].checked; - ca = f[m + '_panel_casesensitivebox'].checked; - rs = f['replace_panel_replacestring'].value; - - if (tinymce.isIE) { - r = ed.getDoc().selection.createRange(); - } - - if (s == '') - return; - - function fix() { - // Correct Firefox graphics glitches - // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? - r = se.getRng().cloneRange(); - ed.getDoc().execCommand('SelectAll', false, null); - se.setRng(r); - }; - - function replace() { - ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE - }; - - // IE flags - if (ca) - fl = fl | 4; - - switch (a) { - case 'all': - // Move caret to beginning of text - ed.execCommand('SelectAll'); - ed.selection.collapse(true); - - if (tinymce.isIE) { - ed.focus(); - r = ed.getDoc().selection.createRange(); - - while (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - replace(); - fo = 1; - - if (b) { - r.moveEnd("character", -(rs.length)); // Otherwise will loop forever - } - } - - tinyMCEPopup.storeSelection(); - } else { - while (w.find(s, ca, b, false, false, false, false)) { - replace(); - fo = 1; - } - } - - if (fo) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); - else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - return; - - case 'current': - if (!ed.selection.isCollapsed()) - replace(); - - break; - } - - se.collapse(b); - r = se.getRng(); - - // Whats the point - if (!s) - return; - - if (tinymce.isIE) { - ed.focus(); - r = ed.getDoc().selection.createRange(); - - if (r.findText(s, b ? -1 : 1, fl)) { - r.scrollIntoView(); - r.select(); - } else - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - - tinyMCEPopup.storeSelection(); - } else { - if (!w.find(s, ca, b, false, false, false, false)) - tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); - else - fix(); - } - } -}; - -tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); +tinyMCEPopup.requireLangPack(); + +var SearchReplaceDialog = { + init : function(ed) { + var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode"); + + t.switchMode(m); + + f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string"); + + // Focus input field + f[m + '_panel_searchstring'].focus(); + + mcTabs.onChange.add(function(tab_id, panel_id) { + t.switchMode(tab_id.substring(0, tab_id.indexOf('_'))); + }); + }, + + switchMode : function(m) { + var f, lm = this.lastMode; + + if (lm != m) { + f = document.forms[0]; + + if (lm) { + f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value; + f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked; + f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked; + f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked; + } + + mcTabs.displayTab(m + '_tab', m + '_panel'); + document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none"; + document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none"; + this.lastMode = m; + } + }, + + searchNext : function(a) { + var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0; + + // Get input + f = document.forms[0]; + s = f[m + '_panel_searchstring'].value; + b = f[m + '_panel_backwardsu'].checked; + ca = f[m + '_panel_casesensitivebox'].checked; + rs = f['replace_panel_replacestring'].value; + + if (tinymce.isIE) { + r = ed.getDoc().selection.createRange(); + } + + if (s == '') + return; + + function fix() { + // Correct Firefox graphics glitches + // TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? + r = se.getRng().cloneRange(); + ed.getDoc().execCommand('SelectAll', false, null); + se.setRng(r); + }; + + function replace() { + ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE + }; + + // IE flags + if (ca) + fl = fl | 4; + + switch (a) { + case 'all': + // Move caret to beginning of text + ed.execCommand('SelectAll'); + ed.selection.collapse(true); + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + while (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + replace(); + fo = 1; + + if (b) { + r.moveEnd("character", -(rs.length)); // Otherwise will loop forever + } + } + + tinyMCEPopup.storeSelection(); + } else { + while (w.find(s, ca, b, false, false, false, false)) { + replace(); + fo = 1; + } + } + + if (fo) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced')); + else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + return; + + case 'current': + if (!ed.selection.isCollapsed()) + replace(); + + break; + } + + se.collapse(b); + r = se.getRng(); + + // Whats the point + if (!s) + return; + + if (tinymce.isIE) { + ed.focus(); + r = ed.getDoc().selection.createRange(); + + if (r.findText(s, b ? -1 : 1, fl)) { + r.scrollIntoView(); + r.select(); + } else + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + + tinyMCEPopup.storeSelection(); + } else { + if (!w.find(s, ca, b, false, false, false, false)) + tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound')); + else + fix(); + } + } +}; + +tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog); diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js b/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js index 370959a..3dd3453 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/langs/en_dlg.js @@ -1,16 +1,16 @@ -tinyMCE.addI18n('en.searchreplace_dlg',{ -searchnext_desc:"Find again", -notfound:"The search has been completed. The search string could not be found.", -search_title:"Find", -replace_title:"Find/Replace", -allreplaced:"All occurrences of the search string were replaced.", -findwhat:"Find what", -replacewith:"Replace with", -direction:"Direction", -up:"Up", -down:"Down", -mcase:"Match case", -findnext:"Find next", -replace:"Replace", -replaceall:"Replace all" +tinyMCE.addI18n('en.searchreplace_dlg',{ +searchnext_desc:"Find again", +notfound:"The search has been completed. The search string could not be found.", +search_title:"Find", +replace_title:"Find/Replace", +allreplaced:"All occurrences of the search string were replaced.", +findwhat:"Find what", +replacewith:"Replace with", +direction:"Direction", +up:"Up", +down:"Down", +mcase:"Match case", +findnext:"Find next", +replace:"Replace", +replaceall:"Replace all" }); \ No newline at end of file diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm b/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm index 5a22d8a..bac5a18 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/searchreplace/searchreplace.htm @@ -1,100 +1,100 @@ - - - - {#searchreplace_dlg.replace_title} - - - - - - - - -
- - -
-
- - - - - - - - - - - -
- - - - - - - - - -
- - - - - -
-
-
- -
- - - - - - - - - - - - - - - -
- - - - - - - - - -
- - - - - -
-
-
- -
- -
- - - - -
-
- - + + + + {#searchreplace_dlg.replace_title} + + + + + + + + +
+ + +
+
+ + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + +
+
+
+ +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + +
+
+
+ +
+ +
+ + + + +
+
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/cell.htm b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/cell.htm index 4afb6af..b62fa54 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/cell.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/cell.htm @@ -1,178 +1,178 @@ - - - - {#table_dlg.cell_title} - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- -
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
- - - - - -
 
-
- - - - - -
 
-
-
-
-
- -
-
- -
- - - -
-
- - + + + + {#table_dlg.cell_title} + + + + + + + + +
+ + +
+
+
+ {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ +
+
+
+ +
+
+ {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + +
 
+
+ + + + + +
 
+
+ + + + + +
 
+
+
+
+
+ +
+
+ +
+ + + +
+
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/cell.css b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/cell.css index a067ecd..a47cc1a 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/cell.css +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/cell.css @@ -1,17 +1,17 @@ -/* CSS file for cell dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#class { - width: 150px; +/* CSS file for cell dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#class { + width: 150px; } \ No newline at end of file diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/row.css b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/row.css index 1f7755d..0e397db 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/row.css +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/row.css @@ -1,25 +1,25 @@ -/* CSS file for row dialog in the table plugin */ - -.panel_wrapper div.current { - height: 200px; -} - -.advfield { - width: 200px; -} - -#action { - margin-bottom: 3px; -} - -#rowtype,#align,#valign,#class,#height { - width: 150px; -} - -#height { - width: 50px; -} - -.col2 { - padding-left: 20px; -} +/* CSS file for row dialog in the table plugin */ + +.panel_wrapper div.current { + height: 200px; +} + +.advfield { + width: 200px; +} + +#action { + margin-bottom: 3px; +} + +#rowtype,#align,#valign,#class,#height { + width: 150px; +} + +#height { + width: 50px; +} + +.col2 { + padding-left: 20px; +} diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/table.css b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/table.css index d11c3f6..8f10783 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/table.css +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/css/table.css @@ -1,13 +1,13 @@ -/* CSS file for table dialog in the table plugin */ - -.panel_wrapper div.current { - height: 245px; -} - -.advfield { - width: 200px; -} - -#class { - width: 150px; -} +/* CSS file for table dialog in the table plugin */ + +.panel_wrapper div.current { + height: 245px; +} + +.advfield { + width: 200px; +} + +#class { + width: 150px; +} diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/js/cell.js b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/js/cell.js index 45e6061..38bbe79 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/js/cell.js +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/js/cell.js @@ -1,284 +1,284 @@ -tinyMCEPopup.requireLangPack(); - -var ed; - -function init() { - ed = tinyMCEPopup.editor; - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') - - var inst = ed; - var tdElm = ed.dom.getParent(ed.selection.getStart(), "td,th"); - var formObj = document.forms[0]; - var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style")); - - // Get table cell data - var celltype = tdElm.nodeName.toLowerCase(); - var align = ed.dom.getAttrib(tdElm, 'align'); - var valign = ed.dom.getAttrib(tdElm, 'valign'); - var width = trimSize(getStyle(tdElm, 'width', 'width')); - var height = trimSize(getStyle(tdElm, 'height', 'height')); - var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); - var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); - var className = ed.dom.getAttrib(tdElm, 'class'); - var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - var id = ed.dom.getAttrib(tdElm, 'id'); - var lang = ed.dom.getAttrib(tdElm, 'lang'); - var dir = ed.dom.getAttrib(tdElm, 'dir'); - var scope = ed.dom.getAttrib(tdElm, 'scope'); - - // Setup form - addClassesToList('class', 'table_cell_styles'); - TinyMCE_EditableSelects.init(); - - if (!ed.dom.hasClass(tdElm, 'mceSelected')) { - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.backgroundimage.value = backgroundimage; - formObj.width.value = width; - formObj.height.value = height; - formObj.id.value = id; - formObj.lang.value = lang; - formObj.style.value = ed.dom.serializeStyle(st); - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'valign', valign); - selectByValue(formObj, 'class', className, true, true); - selectByValue(formObj, 'celltype', celltype); - selectByValue(formObj, 'dir', dir); - selectByValue(formObj, 'scope', scope); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); - } else - tinyMCEPopup.dom.hide('action'); -} - -function updateAction() { - var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0]; - - tinyMCEPopup.restoreSelection(); - el = ed.selection.getStart(); - tdElm = ed.dom.getParent(el, "td,th"); - trElm = ed.dom.getParent(el, "tr"); - tableElm = ed.dom.getParent(el, "table"); - - // Cell is selected - if (ed.dom.hasClass(tdElm, 'mceSelected')) { - // Update all selected sells - tinymce.each(ed.dom.select('td.mceSelected,th.mceSelected'), function(td) { - updateCell(td); - }); - - ed.addVisual(); - ed.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - return; - } - - switch (getSelectValue(formObj, 'action')) { - case "cell": - var celltype = getSelectValue(formObj, 'celltype'); - var scope = getSelectValue(formObj, 'scope'); - - function doUpdate(s) { - if (s) { - updateCell(tdElm); - - ed.addVisual(); - ed.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - } - }; - - if (ed.getParam("accessibility_warnings", 1)) { - if (celltype == "th" && scope == "") - tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate); - else - doUpdate(1); - - return; - } - - updateCell(tdElm); - break; - - case "row": - var cell = trElm.firstChild; - - if (cell.nodeName != "TD" && cell.nodeName != "TH") - cell = nextCell(cell); - - do { - cell = updateCell(cell, true); - } while ((cell = nextCell(cell)) != null); - - break; - - case "all": - var rows = tableElm.getElementsByTagName("tr"); - - for (var i=0; i 0) { - tinymce.each(tableElm.rows, function(tr) { - var i; - - for (i = 0; i < tr.cells.length; i++) { - if (dom.hasClass(tr.cells[i], 'mceSelected')) { - updateRow(tr, true); - return; - } - } - }); - - inst.addVisual(); - inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - tinyMCEPopup.close(); - return; - } - - switch (action) { - case "row": - updateRow(trElm); - break; - - case "all": - var rows = tableElm.getElementsByTagName("tr"); - - for (var i=0; i 0) { + tinymce.each(tableElm.rows, function(tr) { + var i; + + for (i = 0; i < tr.cells.length; i++) { + if (dom.hasClass(tr.cells[i], 'mceSelected')) { + updateRow(tr, true); + return; + } + } + }); + + inst.addVisual(); + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + tinyMCEPopup.close(); + return; + } + + switch (action) { + case "row": + updateRow(trElm); + break; + + case "all": + var rows = tableElm.getElementsByTagName("tr"); + + for (var i=0; i colLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); - return false; - } else if (rowLimit && rows > rowLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); - return false; - } else if (cellLimit && cols * rows > cellLimit) { - tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); - return false; - } - - // Update table - if (action == "update") { - dom.setAttrib(elm, 'cellPadding', cellpadding, true); - dom.setAttrib(elm, 'cellSpacing', cellspacing, true); - dom.setAttrib(elm, 'border', border); - dom.setAttrib(elm, 'align', align); - dom.setAttrib(elm, 'frame', frame); - dom.setAttrib(elm, 'rules', rules); - dom.setAttrib(elm, 'class', className); - dom.setAttrib(elm, 'style', style); - dom.setAttrib(elm, 'id', id); - dom.setAttrib(elm, 'summary', summary); - dom.setAttrib(elm, 'dir', dir); - dom.setAttrib(elm, 'lang', lang); - - capEl = inst.dom.select('caption', elm)[0]; - - if (capEl && !caption) - capEl.parentNode.removeChild(capEl); - - if (!capEl && caption) { - capEl = elm.ownerDocument.createElement('caption'); - - if (!tinymce.isIE) - capEl.innerHTML = '
'; - - elm.insertBefore(capEl, elm.firstChild); - } - - if (width && inst.settings.inline_styles) { - dom.setStyle(elm, 'width', width); - dom.setAttrib(elm, 'width', ''); - } else { - dom.setAttrib(elm, 'width', width, true); - dom.setStyle(elm, 'width', ''); - } - - // Remove these since they are not valid XHTML - dom.setAttrib(elm, 'borderColor', ''); - dom.setAttrib(elm, 'bgColor', ''); - dom.setAttrib(elm, 'background', ''); - - if (height && inst.settings.inline_styles) { - dom.setStyle(elm, 'height', height); - dom.setAttrib(elm, 'height', ''); - } else { - dom.setAttrib(elm, 'height', height, true); - dom.setStyle(elm, 'height', ''); - } - - if (background != '') - elm.style.backgroundImage = "url('" + background + "')"; - else - elm.style.backgroundImage = ''; - -/* if (tinyMCEPopup.getParam("inline_styles")) { - if (width != '') - elm.style.width = getCSSSize(width); - }*/ - - if (bordercolor != "") { - elm.style.borderColor = bordercolor; - elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; - elm.style.borderWidth = border == "" ? "1px" : border; - } else - elm.style.borderColor = ''; - - elm.style.backgroundColor = bgcolor; - elm.style.height = getCSSSize(height); - - inst.addVisual(); - - // Fix for stange MSIE align bug - //elm.outerHTML = elm.outerHTML; - - inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); - - // Repaint if dimensions changed - if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) - inst.execCommand('mceRepaint'); - - tinyMCEPopup.close(); - return true; - } - - // Create new table - html += ''); - - tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { - if (patt) - patt += ','; - - patt += n + ' ._mce_marker'; - }); - - tinymce.each(inst.dom.select(patt), function(n) { - inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); - }); - - dom.setOuterHTML(dom.select('br._mce_marker')[0], html); - } else - inst.execCommand('mceInsertContent', false, html); - - tinymce.each(dom.select('table[data-mce-new]'), function(node) { - var td = dom.select('td', node); - - try { - // IE9 might fail to do this selection - inst.selection.select(td[0], true); - inst.selection.collapse(); - } catch (ex) { - // Ignore - } - - dom.setAttrib(node, 'data-mce-new', ''); - }); - - inst.addVisual(); - inst.execCommand('mceEndUndoLevel'); - - tinyMCEPopup.close(); -} - -function makeAttrib(attrib, value) { - var formObj = document.forms[0]; - var valueElm = formObj.elements[attrib]; - - if (typeof(value) == "undefined" || value == null) { - value = ""; - - if (valueElm) - value = valueElm.value; - } - - if (value == "") - return ""; - - // XML encode it - value = value.replace(/&/g, '&'); - value = value.replace(/\"/g, '"'); - value = value.replace(//g, '>'); - - return ' ' + attrib + '="' + value + '"'; -} - -function init() { - tinyMCEPopup.resizeToInnerSize(); - - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); - document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); - document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); - - var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); - var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; - var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; - var inst = tinyMCEPopup.editor, dom = inst.dom; - var formObj = document.forms[0]; - var elm = dom.getParent(inst.selection.getNode(), "table"); - - action = tinyMCEPopup.getWindowArg('action'); - - if (!action) - action = elm ? "update" : "insert"; - - if (elm && action != "insert") { - var rowsAr = elm.rows; - var cols = 0; - for (var i=0; i cols) - cols = rowsAr[i].cells.length; - - cols = cols; - rows = rowsAr.length; - - st = dom.parseStyle(dom.getAttrib(elm, "style")); - border = trimSize(getStyle(elm, 'border', 'borderWidth')); - cellpadding = dom.getAttrib(elm, 'cellpadding', ""); - cellspacing = dom.getAttrib(elm, 'cellspacing', ""); - width = trimSize(getStyle(elm, 'width', 'width')); - height = trimSize(getStyle(elm, 'height', 'height')); - bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); - bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); - align = dom.getAttrib(elm, 'align', align); - frame = dom.getAttrib(elm, 'frame'); - rules = dom.getAttrib(elm, 'rules'); - className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); - id = dom.getAttrib(elm, 'id'); - summary = dom.getAttrib(elm, 'summary'); - style = dom.serializeStyle(st); - dir = dom.getAttrib(elm, 'dir'); - lang = dom.getAttrib(elm, 'lang'); - background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; - - orgTableWidth = width; - orgTableHeight = height; - - action = "update"; - formObj.insert.value = inst.getLang('update'); - } - - addClassesToList('class', "table_styles"); - TinyMCE_EditableSelects.init(); - - // Update form - selectByValue(formObj, 'align', align); - selectByValue(formObj, 'tframe', frame); - selectByValue(formObj, 'rules', rules); - selectByValue(formObj, 'class', className, true, true); - formObj.cols.value = cols; - formObj.rows.value = rows; - formObj.border.value = border; - formObj.cellpadding.value = cellpadding; - formObj.cellspacing.value = cellspacing; - formObj.width.value = width; - formObj.height.value = height; - formObj.bordercolor.value = bordercolor; - formObj.bgcolor.value = bgcolor; - formObj.id.value = id; - formObj.summary.value = summary; - formObj.style.value = style; - formObj.dir.value = dir; - formObj.lang.value = lang; - formObj.backgroundimage.value = background; - - updateColor('bordercolor_pick', 'bordercolor'); - updateColor('bgcolor_pick', 'bgcolor'); - - // Resize some elements - if (isVisible('backgroundimagebrowser')) - document.getElementById('backgroundimage').style.width = '180px'; - - // Disable some fields in update mode - if (action == "update") { - formObj.cols.disabled = true; - formObj.rows.disabled = true; - } -} - -function changedSize() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - -/* var width = formObj.width.value; - if (width != "") - st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; - else - st['width'] = "";*/ - - var height = formObj.height.value; - if (height != "") - st['height'] = getCSSSize(height); - else - st['height'] = ""; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedBackgroundImage() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedBorder() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - // Update border width if the element has a color - if (formObj.border.value != "" && formObj.bordercolor.value != "") - st['border-width'] = formObj.border.value + "px"; - - formObj.style.value = dom.serializeStyle(st); -} - -function changedColor() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - st['background-color'] = formObj.bgcolor.value; - - if (formObj.bordercolor.value != "") { - st['border-color'] = formObj.bordercolor.value; - - // Add border-width if it's missing - if (!st['border-width']) - st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; - } - - formObj.style.value = dom.serializeStyle(st); -} - -function changedStyle() { - var formObj = document.forms[0]; - var st = dom.parseStyle(formObj.style.value); - - if (st['background-image']) - formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); - else - formObj.backgroundimage.value = ''; - - if (st['width']) - formObj.width.value = trimSize(st['width']); - - if (st['height']) - formObj.height.value = trimSize(st['height']); - - if (st['background-color']) { - formObj.bgcolor.value = st['background-color']; - updateColor('bgcolor_pick','bgcolor'); - } - - if (st['border-color']) { - formObj.bordercolor.value = st['border-color']; - updateColor('bordercolor_pick','bordercolor'); - } -} - -tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); + +var action, orgTableWidth, orgTableHeight, dom = tinyMCEPopup.editor.dom; + +function insertTable() { + var formObj = document.forms[0]; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption, frame, rules; + var html = '', capEl, elm; + var cellLimit, rowLimit, colLimit; + + tinyMCEPopup.restoreSelection(); + + if (!AutoValidator.validate(formObj)) { + tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.'); + return false; + } + + elm = dom.getParent(inst.selection.getNode(), 'table'); + + // Get form data + cols = formObj.elements['cols'].value; + rows = formObj.elements['rows'].value; + border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0; + cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : ""; + cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : ""; + align = getSelectValue(formObj, "align"); + frame = getSelectValue(formObj, "tframe"); + rules = getSelectValue(formObj, "rules"); + width = formObj.elements['width'].value; + height = formObj.elements['height'].value; + bordercolor = formObj.elements['bordercolor'].value; + bgcolor = formObj.elements['bgcolor'].value; + className = getSelectValue(formObj, "class"); + id = formObj.elements['id'].value; + summary = formObj.elements['summary'].value; + style = formObj.elements['style'].value; + dir = formObj.elements['dir'].value; + lang = formObj.elements['lang'].value; + background = formObj.elements['backgroundimage'].value; + caption = formObj.elements['caption'].checked; + + cellLimit = tinyMCEPopup.getParam('table_cell_limit', false); + rowLimit = tinyMCEPopup.getParam('table_row_limit', false); + colLimit = tinyMCEPopup.getParam('table_col_limit', false); + + // Validate table size + if (colLimit && cols > colLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit)); + return false; + } else if (rowLimit && rows > rowLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit)); + return false; + } else if (cellLimit && cols * rows > cellLimit) { + tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit)); + return false; + } + + // Update table + if (action == "update") { + dom.setAttrib(elm, 'cellPadding', cellpadding, true); + dom.setAttrib(elm, 'cellSpacing', cellspacing, true); + dom.setAttrib(elm, 'border', border); + dom.setAttrib(elm, 'align', align); + dom.setAttrib(elm, 'frame', frame); + dom.setAttrib(elm, 'rules', rules); + dom.setAttrib(elm, 'class', className); + dom.setAttrib(elm, 'style', style); + dom.setAttrib(elm, 'id', id); + dom.setAttrib(elm, 'summary', summary); + dom.setAttrib(elm, 'dir', dir); + dom.setAttrib(elm, 'lang', lang); + + capEl = inst.dom.select('caption', elm)[0]; + + if (capEl && !caption) + capEl.parentNode.removeChild(capEl); + + if (!capEl && caption) { + capEl = elm.ownerDocument.createElement('caption'); + + if (!tinymce.isIE) + capEl.innerHTML = '
'; + + elm.insertBefore(capEl, elm.firstChild); + } + + if (width && inst.settings.inline_styles) { + dom.setStyle(elm, 'width', width); + dom.setAttrib(elm, 'width', ''); + } else { + dom.setAttrib(elm, 'width', width, true); + dom.setStyle(elm, 'width', ''); + } + + // Remove these since they are not valid XHTML + dom.setAttrib(elm, 'borderColor', ''); + dom.setAttrib(elm, 'bgColor', ''); + dom.setAttrib(elm, 'background', ''); + + if (height && inst.settings.inline_styles) { + dom.setStyle(elm, 'height', height); + dom.setAttrib(elm, 'height', ''); + } else { + dom.setAttrib(elm, 'height', height, true); + dom.setStyle(elm, 'height', ''); + } + + if (background != '') + elm.style.backgroundImage = "url('" + background + "')"; + else + elm.style.backgroundImage = ''; + +/* if (tinyMCEPopup.getParam("inline_styles")) { + if (width != '') + elm.style.width = getCSSSize(width); + }*/ + + if (bordercolor != "") { + elm.style.borderColor = bordercolor; + elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle; + elm.style.borderWidth = border == "" ? "1px" : border; + } else + elm.style.borderColor = ''; + + elm.style.backgroundColor = bgcolor; + elm.style.height = getCSSSize(height); + + inst.addVisual(); + + // Fix for stange MSIE align bug + //elm.outerHTML = elm.outerHTML; + + inst.nodeChanged(); + inst.execCommand('mceEndUndoLevel'); + + // Repaint if dimensions changed + if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) + inst.execCommand('mceRepaint'); + + tinyMCEPopup.close(); + return true; + } + + // Create new table + html += ''); + + tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { + if (patt) + patt += ','; + + patt += n + ' ._mce_marker'; + }); + + tinymce.each(inst.dom.select(patt), function(n) { + inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); + }); + + dom.setOuterHTML(dom.select('br._mce_marker')[0], html); + } else + inst.execCommand('mceInsertContent', false, html); + + tinymce.each(dom.select('table[data-mce-new]'), function(node) { + var td = dom.select('td', node); + + try { + // IE9 might fail to do this selection + inst.selection.select(td[0], true); + inst.selection.collapse(); + } catch (ex) { + // Ignore + } + + dom.setAttrib(node, 'data-mce-new', ''); + }); + + inst.addVisual(); + inst.execCommand('mceEndUndoLevel'); + + tinyMCEPopup.close(); +} + +function makeAttrib(attrib, value) { + var formObj = document.forms[0]; + var valueElm = formObj.elements[attrib]; + + if (typeof(value) == "undefined" || value == null) { + value = ""; + + if (valueElm) + value = valueElm.value; + } + + if (value == "") + return ""; + + // XML encode it + value = value.replace(/&/g, '&'); + value = value.replace(/\"/g, '"'); + value = value.replace(//g, '>'); + + return ' ' + attrib + '="' + value + '"'; +} + +function init() { + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); + document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); + document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor'); + + var cols = 2, rows = 2, border = tinyMCEPopup.getParam('table_default_border', '0'), cellpadding = tinyMCEPopup.getParam('table_default_cellpadding', ''), cellspacing = tinyMCEPopup.getParam('table_default_cellspacing', ''); + var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = ""; + var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "", rules = "", frame = ""; + var inst = tinyMCEPopup.editor, dom = inst.dom; + var formObj = document.forms[0]; + var elm = dom.getParent(inst.selection.getNode(), "table"); + + action = tinyMCEPopup.getWindowArg('action'); + + if (!action) + action = elm ? "update" : "insert"; + + if (elm && action != "insert") { + var rowsAr = elm.rows; + var cols = 0; + for (var i=0; i cols) + cols = rowsAr[i].cells.length; + + cols = cols; + rows = rowsAr.length; + + st = dom.parseStyle(dom.getAttrib(elm, "style")); + border = trimSize(getStyle(elm, 'border', 'borderWidth')); + cellpadding = dom.getAttrib(elm, 'cellpadding', ""); + cellspacing = dom.getAttrib(elm, 'cellspacing', ""); + width = trimSize(getStyle(elm, 'width', 'width')); + height = trimSize(getStyle(elm, 'height', 'height')); + bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor')); + bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor')); + align = dom.getAttrib(elm, 'align', align); + frame = dom.getAttrib(elm, 'frame'); + rules = dom.getAttrib(elm, 'rules'); + className = tinymce.trim(dom.getAttrib(elm, 'class').replace(/mceItem.+/g, '')); + id = dom.getAttrib(elm, 'id'); + summary = dom.getAttrib(elm, 'summary'); + style = dom.serializeStyle(st); + dir = dom.getAttrib(elm, 'dir'); + lang = dom.getAttrib(elm, 'lang'); + background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + formObj.caption.checked = elm.getElementsByTagName('caption').length > 0; + + orgTableWidth = width; + orgTableHeight = height; + + action = "update"; + formObj.insert.value = inst.getLang('update'); + } + + addClassesToList('class', "table_styles"); + TinyMCE_EditableSelects.init(); + + // Update form + selectByValue(formObj, 'align', align); + selectByValue(formObj, 'tframe', frame); + selectByValue(formObj, 'rules', rules); + selectByValue(formObj, 'class', className, true, true); + formObj.cols.value = cols; + formObj.rows.value = rows; + formObj.border.value = border; + formObj.cellpadding.value = cellpadding; + formObj.cellspacing.value = cellspacing; + formObj.width.value = width; + formObj.height.value = height; + formObj.bordercolor.value = bordercolor; + formObj.bgcolor.value = bgcolor; + formObj.id.value = id; + formObj.summary.value = summary; + formObj.style.value = style; + formObj.dir.value = dir; + formObj.lang.value = lang; + formObj.backgroundimage.value = background; + + updateColor('bordercolor_pick', 'bordercolor'); + updateColor('bgcolor_pick', 'bgcolor'); + + // Resize some elements + if (isVisible('backgroundimagebrowser')) + document.getElementById('backgroundimage').style.width = '180px'; + + // Disable some fields in update mode + if (action == "update") { + formObj.cols.disabled = true; + formObj.rows.disabled = true; + } +} + +function changedSize() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + +/* var width = formObj.width.value; + if (width != "") + st['width'] = tinyMCEPopup.getParam("inline_styles") ? getCSSSize(width) : ""; + else + st['width'] = "";*/ + + var height = formObj.height.value; + if (height != "") + st['height'] = getCSSSize(height); + else + st['height'] = ""; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBackgroundImage() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-image'] = "url('" + formObj.backgroundimage.value + "')"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedBorder() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + // Update border width if the element has a color + if (formObj.border.value != "" && formObj.bordercolor.value != "") + st['border-width'] = formObj.border.value + "px"; + + formObj.style.value = dom.serializeStyle(st); +} + +function changedColor() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + st['background-color'] = formObj.bgcolor.value; + + if (formObj.bordercolor.value != "") { + st['border-color'] = formObj.bordercolor.value; + + // Add border-width if it's missing + if (!st['border-width']) + st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px"; + } + + formObj.style.value = dom.serializeStyle(st); +} + +function changedStyle() { + var formObj = document.forms[0]; + var st = dom.parseStyle(formObj.style.value); + + if (st['background-image']) + formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1"); + else + formObj.backgroundimage.value = ''; + + if (st['width']) + formObj.width.value = trimSize(st['width']); + + if (st['height']) + formObj.height.value = trimSize(st['height']); + + if (st['background-color']) { + formObj.bgcolor.value = st['background-color']; + updateColor('bgcolor_pick','bgcolor'); + } + + if (st['border-color']) { + formObj.bordercolor.value = st['border-color']; + updateColor('bordercolor_pick','bordercolor'); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/langs/en_dlg.js b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/langs/en_dlg.js index 8352d9f..db5555c 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/langs/en_dlg.js +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/langs/en_dlg.js @@ -1,74 +1,74 @@ -tinyMCE.addI18n('en.table_dlg',{ -general_tab:"General", -advanced_tab:"Advanced", -general_props:"General properties", -advanced_props:"Advanced properties", -rowtype:"Row in table part", -title:"Insert/Modify table", -width:"Width", -height:"Height", -cols:"Columns", -rows:"Rows", -cellspacing:"Cellspacing", -cellpadding:"Cellpadding", -border:"Border", -align:"Alignment", -align_default:"Default", -align_left:"Left", -align_right:"Right", -align_middle:"Center", -row_title:"Table row properties", -cell_title:"Table cell properties", -cell_type:"Cell type", -valign:"Vertical alignment", -align_top:"Top", -align_bottom:"Bottom", -bordercolor:"Border color", -bgcolor:"Background color", -merge_cells_title:"Merge table cells", -id:"Id", -style:"Style", -langdir:"Language direction", -langcode:"Language code", -mime:"Target MIME type", -ltr:"Left to right", -rtl:"Right to left", -bgimage:"Background image", -summary:"Summary", -td:"Data", -th:"Header", -cell_cell:"Update current cell", -cell_row:"Update all cells in row", -cell_all:"Update all cells in table", -row_row:"Update current row", -row_odd:"Update odd rows in table", -row_even:"Update even rows in table", -row_all:"Update all rows in table", -thead:"Table Head", -tbody:"Table Body", -tfoot:"Table Foot", -scope:"Scope", -rowgroup:"Row Group", -colgroup:"Col Group", -col_limit:"You've exceeded the maximum number of columns of {$cols}.", -row_limit:"You've exceeded the maximum number of rows of {$rows}.", -cell_limit:"You've exceeded the maximum number of cells of {$cells}.", -missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", -caption:"Table caption", -frame:"Frame", -frame_none:"none", -frame_groups:"groups", -frame_rows:"rows", -frame_cols:"cols", -frame_all:"all", -rules:"Rules", -rules_void:"void", -rules_above:"above", -rules_below:"below", -rules_hsides:"hsides", -rules_lhs:"lhs", -rules_rhs:"rhs", -rules_vsides:"vsides", -rules_box:"box", -rules_border:"border" +tinyMCE.addI18n('en.table_dlg',{ +general_tab:"General", +advanced_tab:"Advanced", +general_props:"General properties", +advanced_props:"Advanced properties", +rowtype:"Row in table part", +title:"Insert/Modify table", +width:"Width", +height:"Height", +cols:"Columns", +rows:"Rows", +cellspacing:"Cellspacing", +cellpadding:"Cellpadding", +border:"Border", +align:"Alignment", +align_default:"Default", +align_left:"Left", +align_right:"Right", +align_middle:"Center", +row_title:"Table row properties", +cell_title:"Table cell properties", +cell_type:"Cell type", +valign:"Vertical alignment", +align_top:"Top", +align_bottom:"Bottom", +bordercolor:"Border color", +bgcolor:"Background color", +merge_cells_title:"Merge table cells", +id:"Id", +style:"Style", +langdir:"Language direction", +langcode:"Language code", +mime:"Target MIME type", +ltr:"Left to right", +rtl:"Right to left", +bgimage:"Background image", +summary:"Summary", +td:"Data", +th:"Header", +cell_cell:"Update current cell", +cell_row:"Update all cells in row", +cell_all:"Update all cells in table", +row_row:"Update current row", +row_odd:"Update odd rows in table", +row_even:"Update even rows in table", +row_all:"Update all rows in table", +thead:"Table Head", +tbody:"Table Body", +tfoot:"Table Foot", +scope:"Scope", +rowgroup:"Row Group", +colgroup:"Col Group", +col_limit:"You've exceeded the maximum number of columns of {$cols}.", +row_limit:"You've exceeded the maximum number of rows of {$rows}.", +cell_limit:"You've exceeded the maximum number of cells of {$cells}.", +missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.", +caption:"Table caption", +frame:"Frame", +frame_none:"none", +frame_groups:"groups", +frame_rows:"rows", +frame_cols:"cols", +frame_all:"all", +rules:"Rules", +rules_void:"void", +rules_above:"above", +rules_below:"below", +rules_hsides:"hsides", +rules_lhs:"lhs", +rules_rhs:"rhs", +rules_vsides:"vsides", +rules_box:"box", +rules_border:"border" }); \ No newline at end of file diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/merge_cells.htm b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/merge_cells.htm index d231090..788acf6 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/merge_cells.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/merge_cells.htm @@ -1,32 +1,32 @@ - - - - {#table_dlg.merge_cells_title} - - - - - - -
-
- {#table_dlg.merge_cells_title} - - - - - - - - - -
:
:
-
- -
- - -
-
- - + + + + {#table_dlg.merge_cells_title} + + + + + + +
+
+ {#table_dlg.merge_cells_title} + + + + + + + + + +
:
:
+
+ +
+ + +
+
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/row.htm b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/row.htm index c197ff6..430c221 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/row.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/row.htm @@ -1,157 +1,157 @@ - - - - {#table_dlg.row_title} - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- - - - - -
 
-
- - - - - - -
 
-
-
-
-
-
- -
-
- -
- - - -
-
- - + + + + {#table_dlg.row_title} + + + + + + + + +
+ + +
+
+
+ {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
+
+
+ +
+
+ {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ + + + + +
 
+
+ + + + + + +
 
+
+
+
+
+
+ +
+
+ +
+ + + +
+
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/table.htm b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/table.htm index 4a873b0..fea75b0 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/plugins/table/table.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/plugins/table/table.htm @@ -1,188 +1,188 @@ - - - - {#table_dlg.title} - - - - - - - - - - -
- - -
-
-
- {#table_dlg.general_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
-
- -
-
- {#table_dlg.advanced_props} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - -
 
-
- -
- -
- -
- - - - - -
 
-
- - - - - -
 
-
-
-
-
- -
- - -
-
- - + + + + {#table_dlg.title} + + + + + + + + + + +
+ + +
+
+
+ {#table_dlg.general_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ {#table_dlg.advanced_props} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
 
+
+ +
+ +
+ +
+ + + + + +
 
+
+ + + + + +
 
+
+
+
+
+ +
+ + +
+
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/about.htm b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/about.htm index 7a97cb7..fe36603 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/about.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/about.htm @@ -1,52 +1,52 @@ - - - - {#advanced_dlg.about_title} - - - - - - - -
-
-

{#advanced_dlg.about_title}

-

Version: ()

-

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL - by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

-

Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

-

For more information about this software visit the TinyMCE website.

- -
- Got Moxie? -
-
- -
-
-

{#advanced_dlg.about_loaded}

- -
-
- -

 

-
-
- -
-
-
-
- -
- -
- - + + + + {#advanced_dlg.about_title} + + + + + + + +
+
+

{#advanced_dlg.about_title}

+

Version: ()

+

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL + by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

+

Copyright © 2003-2008, Moxiecode Systems AB, All rights reserved.

+

For more information about this software visit the TinyMCE website.

+ +
+ Got Moxie? +
+
+ +
+
+

{#advanced_dlg.about_loaded}

+ +
+
+ +

 

+
+
+ +
+
+
+
+ +
+ +
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/anchor.htm b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/anchor.htm index 75c93b7..dc53312 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/anchor.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/anchor.htm @@ -1,26 +1,26 @@ - - - - {#advanced_dlg.anchor_title} - - - - -
- - - - - - - - -
{#advanced_dlg.anchor_title}
- -
- - -
-
- - + + + + {#advanced_dlg.anchor_title} + + + + +
+ + + + + + + + +
{#advanced_dlg.anchor_title}
+ +
+ + +
+
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/charmap.htm b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/charmap.htm index 2c3b3f2..8f172f3 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/charmap.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/charmap.htm @@ -1,51 +1,51 @@ - - - - {#advanced_dlg.charmap_title} - - - - - - - - - - - - - - - -
- - - - - - - - - -
 
 
-
- - - - - - - - - - - - - - - - -
 
 
 
-
- - + + + + {#advanced_dlg.charmap_title} + + + + + + + + + + + + + + + +
+ + + + + + + + + +
 
 
+
+ + + + + + + + + + + + + + + + +
 
 
 
+
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/color_picker.htm b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/color_picker.htm index ad1bb0f..e7f19ab 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/color_picker.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/color_picker.htm @@ -1,74 +1,74 @@ - - - - {#advanced_dlg.colorpicker_title} - - - - - - -
- - -
-
-
- {#advanced_dlg.colorpicker_picker_title} -
- - -
- -
- -
-
-
-
- -
-
- {#advanced_dlg.colorpicker_palette_title} -
- -
- -
-
-
- -
-
- {#advanced_dlg.colorpicker_named_title} -
- -
- -
- -
- {#advanced_dlg.colorpicker_name} -
-
-
-
- -
- - -
- -
- -
-
-
- - + + + + {#advanced_dlg.colorpicker_title} + + + + + + +
+ + +
+
+
+ {#advanced_dlg.colorpicker_picker_title} +
+ + +
+ +
+ +
+
+
+
+ +
+
+ {#advanced_dlg.colorpicker_palette_title} +
+ +
+ +
+
+
+ +
+
+ {#advanced_dlg.colorpicker_named_title} +
+ +
+ +
+ +
+ {#advanced_dlg.colorpicker_name} +
+
+
+
+ +
+ + +
+ +
+ +
+
+
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/image.htm b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/image.htm index b8ba729..884890f 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/image.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/image.htm @@ -1,80 +1,80 @@ - - - - {#advanced_dlg.image_title} - - - - - - -
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
- x -
-
-
- -
- - -
-
- - + + + + {#advanced_dlg.image_title} + + + + + + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
 
+ x +
+
+
+ +
+ + +
+
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/about.js b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/about.js index 5b35845..daf4909 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/about.js +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/about.js @@ -1,73 +1,73 @@ -tinyMCEPopup.requireLangPack(); - -function init() { - var ed, tcont; - - tinyMCEPopup.resizeToInnerSize(); - ed = tinyMCEPopup.editor; - - // Give FF some time - window.setTimeout(insertHelpIFrame, 10); - - tcont = document.getElementById('plugintablecontainer'); - document.getElementById('plugins_tab').style.display = 'none'; - - var html = ""; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - - tinymce.each(ed.plugins, function(p, n) { - var info; - - if (!p.getInfo) - return; - - html += ''; - - info = p.getInfo(); - - if (info.infourl != null && info.infourl != '') - html += ''; - else - html += ''; - - if (info.authorurl != null && info.authorurl != '') - html += ''; - else - html += ''; - - html += ''; - html += ''; - - document.getElementById('plugins_tab').style.display = ''; - - }); - - html += ''; - html += '
' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
'; - - tcont.innerHTML = html; - - tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; - tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; -} - -function insertHelpIFrame() { - var html; - - if (tinyMCEPopup.getParam('docs_url')) { - html = ''; - document.getElementById('iframecontainer').innerHTML = html; - document.getElementById('help_tab').style.display = 'block'; - document.getElementById('help_tab').setAttribute("aria-hidden", "false"); - } -} - -tinyMCEPopup.onInit.add(init); +tinyMCEPopup.requireLangPack(); + +function init() { + var ed, tcont; + + tinyMCEPopup.resizeToInnerSize(); + ed = tinyMCEPopup.editor; + + // Give FF some time + window.setTimeout(insertHelpIFrame, 10); + + tcont = document.getElementById('plugintablecontainer'); + document.getElementById('plugins_tab').style.display = 'none'; + + var html = ""; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + + tinymce.each(ed.plugins, function(p, n) { + var info; + + if (!p.getInfo) + return; + + html += ''; + + info = p.getInfo(); + + if (info.infourl != null && info.infourl != '') + html += ''; + else + html += ''; + + if (info.authorurl != null && info.authorurl != '') + html += ''; + else + html += ''; + + html += ''; + html += ''; + + document.getElementById('plugins_tab').style.display = ''; + + }); + + html += ''; + html += '
' + ed.getLang('advanced_dlg.about_plugin') + '' + ed.getLang('advanced_dlg.about_author') + '' + ed.getLang('advanced_dlg.about_version') + '
' + info.longname + '' + info.longname + '' + info.author + '' + info.author + '' + info.version + '
'; + + tcont.innerHTML = html; + + tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion; + tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate; +} + +function insertHelpIFrame() { + var html; + + if (tinyMCEPopup.getParam('docs_url')) { + html = ''; + document.getElementById('iframecontainer').innerHTML = html; + document.getElementById('help_tab').style.display = 'block'; + document.getElementById('help_tab').setAttribute("aria-hidden", "false"); + } +} + +tinyMCEPopup.onInit.add(init); diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/anchor.js b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/anchor.js index e528e4f..7b55635 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/anchor.js +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/anchor.js @@ -1,42 +1,42 @@ -tinyMCEPopup.requireLangPack(); - -var AnchorDialog = { - init : function(ed) { - var action, elm, f = document.forms[0]; - - this.editor = ed; - elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - v = ed.dom.getAttrib(elm, 'name'); - - if (v) { - this.action = 'update'; - f.anchorName.value = v; - } - - f.insert.value = ed.getLang(elm ? 'update' : 'insert'); - }, - - update : function() { - var ed = this.editor, elm, name = document.forms[0].anchorName.value; - - if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { - tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); - return; - } - - tinyMCEPopup.restoreSelection(); - - if (this.action != 'update') - ed.selection.collapse(1); - - elm = ed.dom.getParent(ed.selection.getNode(), 'A'); - if (elm) - elm.name = name; - else - ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '')); - - tinyMCEPopup.close(); - } -}; - -tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); +tinyMCEPopup.requireLangPack(); + +var AnchorDialog = { + init : function(ed) { + var action, elm, f = document.forms[0]; + + this.editor = ed; + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + v = ed.dom.getAttrib(elm, 'name'); + + if (v) { + this.action = 'update'; + f.anchorName.value = v; + } + + f.insert.value = ed.getLang(elm ? 'update' : 'insert'); + }, + + update : function() { + var ed = this.editor, elm, name = document.forms[0].anchorName.value; + + if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) { + tinyMCEPopup.alert('advanced_dlg.anchor_invalid'); + return; + } + + tinyMCEPopup.restoreSelection(); + + if (this.action != 'update') + ed.selection.collapse(1); + + elm = ed.dom.getParent(ed.selection.getNode(), 'A'); + if (elm) + elm.name = name; + else + ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, '')); + + tinyMCEPopup.close(); + } +}; + +tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog); diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/charmap.js b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/charmap.js index 1cead6d..78bc080 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/charmap.js +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/charmap.js @@ -1,355 +1,355 @@ -/** - * charmap.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -tinyMCEPopup.requireLangPack(); - -var charmap = [ - [' ', ' ', true, 'no-break space'], - ['&', '&', true, 'ampersand'], - ['"', '"', true, 'quotation mark'], -// finance - ['¢', '¢', true, 'cent sign'], - ['€', '€', true, 'euro sign'], - ['£', '£', true, 'pound sign'], - ['¥', '¥', true, 'yen sign'], -// signs - ['©', '©', true, 'copyright sign'], - ['®', '®', true, 'registered sign'], - ['™', '™', true, 'trade mark sign'], - ['‰', '‰', true, 'per mille sign'], - ['µ', 'µ', true, 'micro sign'], - ['·', '·', true, 'middle dot'], - ['•', '•', true, 'bullet'], - ['…', '…', true, 'three dot leader'], - ['′', '′', true, 'minutes / feet'], - ['″', '″', true, 'seconds / inches'], - ['§', '§', true, 'section sign'], - ['¶', '¶', true, 'paragraph sign'], - ['ß', 'ß', true, 'sharp s / ess-zed'], -// quotations - ['‹', '‹', true, 'single left-pointing angle quotation mark'], - ['›', '›', true, 'single right-pointing angle quotation mark'], - ['«', '«', true, 'left pointing guillemet'], - ['»', '»', true, 'right pointing guillemet'], - ['‘', '‘', true, 'left single quotation mark'], - ['’', '’', true, 'right single quotation mark'], - ['“', '“', true, 'left double quotation mark'], - ['”', '”', true, 'right double quotation mark'], - ['‚', '‚', true, 'single low-9 quotation mark'], - ['„', '„', true, 'double low-9 quotation mark'], - ['<', '<', true, 'less-than sign'], - ['>', '>', true, 'greater-than sign'], - ['≤', '≤', true, 'less-than or equal to'], - ['≥', '≥', true, 'greater-than or equal to'], - ['–', '–', true, 'en dash'], - ['—', '—', true, 'em dash'], - ['¯', '¯', true, 'macron'], - ['‾', '‾', true, 'overline'], - ['¤', '¤', true, 'currency sign'], - ['¦', '¦', true, 'broken bar'], - ['¨', '¨', true, 'diaeresis'], - ['¡', '¡', true, 'inverted exclamation mark'], - ['¿', '¿', true, 'turned question mark'], - ['ˆ', 'ˆ', true, 'circumflex accent'], - ['˜', '˜', true, 'small tilde'], - ['°', '°', true, 'degree sign'], - ['−', '−', true, 'minus sign'], - ['±', '±', true, 'plus-minus sign'], - ['÷', '÷', true, 'division sign'], - ['⁄', '⁄', true, 'fraction slash'], - ['×', '×', true, 'multiplication sign'], - ['¹', '¹', true, 'superscript one'], - ['²', '²', true, 'superscript two'], - ['³', '³', true, 'superscript three'], - ['¼', '¼', true, 'fraction one quarter'], - ['½', '½', true, 'fraction one half'], - ['¾', '¾', true, 'fraction three quarters'], -// math / logical - ['ƒ', 'ƒ', true, 'function / florin'], - ['∫', '∫', true, 'integral'], - ['∑', '∑', true, 'n-ary sumation'], - ['∞', '∞', true, 'infinity'], - ['√', '√', true, 'square root'], - ['∼', '∼', false,'similar to'], - ['≅', '≅', false,'approximately equal to'], - ['≈', '≈', true, 'almost equal to'], - ['≠', '≠', true, 'not equal to'], - ['≡', '≡', true, 'identical to'], - ['∈', '∈', false,'element of'], - ['∉', '∉', false,'not an element of'], - ['∋', '∋', false,'contains as member'], - ['∏', '∏', true, 'n-ary product'], - ['∧', '∧', false,'logical and'], - ['∨', '∨', false,'logical or'], - ['¬', '¬', true, 'not sign'], - ['∩', '∩', true, 'intersection'], - ['∪', '∪', false,'union'], - ['∂', '∂', true, 'partial differential'], - ['∀', '∀', false,'for all'], - ['∃', '∃', false,'there exists'], - ['∅', '∅', false,'diameter'], - ['∇', '∇', false,'backward difference'], - ['∗', '∗', false,'asterisk operator'], - ['∝', '∝', false,'proportional to'], - ['∠', '∠', false,'angle'], -// undefined - ['´', '´', true, 'acute accent'], - ['¸', '¸', true, 'cedilla'], - ['ª', 'ª', true, 'feminine ordinal indicator'], - ['º', 'º', true, 'masculine ordinal indicator'], - ['†', '†', true, 'dagger'], - ['‡', '‡', true, 'double dagger'], -// alphabetical special chars - ['À', 'À', true, 'A - grave'], - ['Á', 'Á', true, 'A - acute'], - ['Â', 'Â', true, 'A - circumflex'], - ['Ã', 'Ã', true, 'A - tilde'], - ['Ä', 'Ä', true, 'A - diaeresis'], - ['Å', 'Å', true, 'A - ring above'], - ['Æ', 'Æ', true, 'ligature AE'], - ['Ç', 'Ç', true, 'C - cedilla'], - ['È', 'È', true, 'E - grave'], - ['É', 'É', true, 'E - acute'], - ['Ê', 'Ê', true, 'E - circumflex'], - ['Ë', 'Ë', true, 'E - diaeresis'], - ['Ì', 'Ì', true, 'I - grave'], - ['Í', 'Í', true, 'I - acute'], - ['Î', 'Î', true, 'I - circumflex'], - ['Ï', 'Ï', true, 'I - diaeresis'], - ['Ð', 'Ð', true, 'ETH'], - ['Ñ', 'Ñ', true, 'N - tilde'], - ['Ò', 'Ò', true, 'O - grave'], - ['Ó', 'Ó', true, 'O - acute'], - ['Ô', 'Ô', true, 'O - circumflex'], - ['Õ', 'Õ', true, 'O - tilde'], - ['Ö', 'Ö', true, 'O - diaeresis'], - ['Ø', 'Ø', true, 'O - slash'], - ['Œ', 'Œ', true, 'ligature OE'], - ['Š', 'Š', true, 'S - caron'], - ['Ù', 'Ù', true, 'U - grave'], - ['Ú', 'Ú', true, 'U - acute'], - ['Û', 'Û', true, 'U - circumflex'], - ['Ü', 'Ü', true, 'U - diaeresis'], - ['Ý', 'Ý', true, 'Y - acute'], - ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], - ['Þ', 'Þ', true, 'THORN'], - ['à', 'à', true, 'a - grave'], - ['á', 'á', true, 'a - acute'], - ['â', 'â', true, 'a - circumflex'], - ['ã', 'ã', true, 'a - tilde'], - ['ä', 'ä', true, 'a - diaeresis'], - ['å', 'å', true, 'a - ring above'], - ['æ', 'æ', true, 'ligature ae'], - ['ç', 'ç', true, 'c - cedilla'], - ['è', 'è', true, 'e - grave'], - ['é', 'é', true, 'e - acute'], - ['ê', 'ê', true, 'e - circumflex'], - ['ë', 'ë', true, 'e - diaeresis'], - ['ì', 'ì', true, 'i - grave'], - ['í', 'í', true, 'i - acute'], - ['î', 'î', true, 'i - circumflex'], - ['ï', 'ï', true, 'i - diaeresis'], - ['ð', 'ð', true, 'eth'], - ['ñ', 'ñ', true, 'n - tilde'], - ['ò', 'ò', true, 'o - grave'], - ['ó', 'ó', true, 'o - acute'], - ['ô', 'ô', true, 'o - circumflex'], - ['õ', 'õ', true, 'o - tilde'], - ['ö', 'ö', true, 'o - diaeresis'], - ['ø', 'ø', true, 'o slash'], - ['œ', 'œ', true, 'ligature oe'], - ['š', 'š', true, 's - caron'], - ['ù', 'ù', true, 'u - grave'], - ['ú', 'ú', true, 'u - acute'], - ['û', 'û', true, 'u - circumflex'], - ['ü', 'ü', true, 'u - diaeresis'], - ['ý', 'ý', true, 'y - acute'], - ['þ', 'þ', true, 'thorn'], - ['ÿ', 'ÿ', true, 'y - diaeresis'], - ['Α', 'Α', true, 'Alpha'], - ['Β', 'Β', true, 'Beta'], - ['Γ', 'Γ', true, 'Gamma'], - ['Δ', 'Δ', true, 'Delta'], - ['Ε', 'Ε', true, 'Epsilon'], - ['Ζ', 'Ζ', true, 'Zeta'], - ['Η', 'Η', true, 'Eta'], - ['Θ', 'Θ', true, 'Theta'], - ['Ι', 'Ι', true, 'Iota'], - ['Κ', 'Κ', true, 'Kappa'], - ['Λ', 'Λ', true, 'Lambda'], - ['Μ', 'Μ', true, 'Mu'], - ['Ν', 'Ν', true, 'Nu'], - ['Ξ', 'Ξ', true, 'Xi'], - ['Ο', 'Ο', true, 'Omicron'], - ['Π', 'Π', true, 'Pi'], - ['Ρ', 'Ρ', true, 'Rho'], - ['Σ', 'Σ', true, 'Sigma'], - ['Τ', 'Τ', true, 'Tau'], - ['Υ', 'Υ', true, 'Upsilon'], - ['Φ', 'Φ', true, 'Phi'], - ['Χ', 'Χ', true, 'Chi'], - ['Ψ', 'Ψ', true, 'Psi'], - ['Ω', 'Ω', true, 'Omega'], - ['α', 'α', true, 'alpha'], - ['β', 'β', true, 'beta'], - ['γ', 'γ', true, 'gamma'], - ['δ', 'δ', true, 'delta'], - ['ε', 'ε', true, 'epsilon'], - ['ζ', 'ζ', true, 'zeta'], - ['η', 'η', true, 'eta'], - ['θ', 'θ', true, 'theta'], - ['ι', 'ι', true, 'iota'], - ['κ', 'κ', true, 'kappa'], - ['λ', 'λ', true, 'lambda'], - ['μ', 'μ', true, 'mu'], - ['ν', 'ν', true, 'nu'], - ['ξ', 'ξ', true, 'xi'], - ['ο', 'ο', true, 'omicron'], - ['π', 'π', true, 'pi'], - ['ρ', 'ρ', true, 'rho'], - ['ς', 'ς', true, 'final sigma'], - ['σ', 'σ', true, 'sigma'], - ['τ', 'τ', true, 'tau'], - ['υ', 'υ', true, 'upsilon'], - ['φ', 'φ', true, 'phi'], - ['χ', 'χ', true, 'chi'], - ['ψ', 'ψ', true, 'psi'], - ['ω', 'ω', true, 'omega'], -// symbols - ['ℵ', 'ℵ', false,'alef symbol'], - ['ϖ', 'ϖ', false,'pi symbol'], - ['ℜ', 'ℜ', false,'real part symbol'], - ['ϑ','ϑ', false,'theta symbol'], - ['ϒ', 'ϒ', false,'upsilon - hook symbol'], - ['℘', '℘', false,'Weierstrass p'], - ['ℑ', 'ℑ', false,'imaginary part'], -// arrows - ['←', '←', true, 'leftwards arrow'], - ['↑', '↑', true, 'upwards arrow'], - ['→', '→', true, 'rightwards arrow'], - ['↓', '↓', true, 'downwards arrow'], - ['↔', '↔', true, 'left right arrow'], - ['↵', '↵', false,'carriage return'], - ['⇐', '⇐', false,'leftwards double arrow'], - ['⇑', '⇑', false,'upwards double arrow'], - ['⇒', '⇒', false,'rightwards double arrow'], - ['⇓', '⇓', false,'downwards double arrow'], - ['⇔', '⇔', false,'left right double arrow'], - ['∴', '∴', false,'therefore'], - ['⊂', '⊂', false,'subset of'], - ['⊃', '⊃', false,'superset of'], - ['⊄', '⊄', false,'not a subset of'], - ['⊆', '⊆', false,'subset of or equal to'], - ['⊇', '⊇', false,'superset of or equal to'], - ['⊕', '⊕', false,'circled plus'], - ['⊗', '⊗', false,'circled times'], - ['⊥', '⊥', false,'perpendicular'], - ['⋅', '⋅', false,'dot operator'], - ['⌈', '⌈', false,'left ceiling'], - ['⌉', '⌉', false,'right ceiling'], - ['⌊', '⌊', false,'left floor'], - ['⌋', '⌋', false,'right floor'], - ['⟨', '〈', false,'left-pointing angle bracket'], - ['⟩', '〉', false,'right-pointing angle bracket'], - ['◊', '◊', true, 'lozenge'], - ['♠', '♠', true, 'black spade suit'], - ['♣', '♣', true, 'black club suit'], - ['♥', '♥', true, 'black heart suit'], - ['♦', '♦', true, 'black diamond suit'], - [' ', ' ', false,'en space'], - [' ', ' ', false,'em space'], - [' ', ' ', false,'thin space'], - ['‌', '‌', false,'zero width non-joiner'], - ['‍', '‍', false,'zero width joiner'], - ['‎', '‎', false,'left-to-right mark'], - ['‏', '‏', false,'right-to-left mark'], - ['­', '­', false,'soft hyphen'] -]; - -tinyMCEPopup.onInit.add(function() { - tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); - addKeyboardNavigation(); -}); - -function addKeyboardNavigation(){ - var tableElm, cells, settings; - - cells = tinyMCEPopup.dom.select(".charmaplink", "charmapgroup"); - - settings ={ - root: "charmapgroup", - items: cells - }; - - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); -} - -function renderCharMapHTML() { - var charsPerRow = 20, tdWidth=20, tdHeight=20, i; - var html = '
'+ - ''; - var cols=-1; - - for (i=0; i' - + '' - + charmap[i][1] - + ''; - if ((cols+1) % charsPerRow == 0) - html += ''; - } - } - - if (cols % charsPerRow > 0) { - var padd = charsPerRow - (cols % charsPerRow); - for (var i=0; i '; - } - - html += '
'; - html = html.replace(/<\/tr>/g, ''); - - return html; -} - -function insertChar(chr) { - tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); - - // Refocus in window - if (tinyMCEPopup.isWindow) - window.focus(); - - tinyMCEPopup.editor.focus(); - tinyMCEPopup.close(); -} - -function previewChar(codeA, codeB, codeN) { - var elmA = document.getElementById('codeA'); - var elmB = document.getElementById('codeB'); - var elmV = document.getElementById('codeV'); - var elmN = document.getElementById('codeN'); - - if (codeA=='#160;') { - elmV.innerHTML = '__'; - } else { - elmV.innerHTML = '&' + codeA; - } - - elmB.innerHTML = '&' + codeA; - elmA.innerHTML = '&' + codeB; - elmN.innerHTML = codeN; -} +/** + * charmap.js + * + * Copyright 2009, Moxiecode Systems AB + * Released under LGPL License. + * + * License: http://tinymce.moxiecode.com/license + * Contributing: http://tinymce.moxiecode.com/contributing + */ + +tinyMCEPopup.requireLangPack(); + +var charmap = [ + [' ', ' ', true, 'no-break space'], + ['&', '&', true, 'ampersand'], + ['"', '"', true, 'quotation mark'], +// finance + ['¢', '¢', true, 'cent sign'], + ['€', '€', true, 'euro sign'], + ['£', '£', true, 'pound sign'], + ['¥', '¥', true, 'yen sign'], +// signs + ['©', '©', true, 'copyright sign'], + ['®', '®', true, 'registered sign'], + ['™', '™', true, 'trade mark sign'], + ['‰', '‰', true, 'per mille sign'], + ['µ', 'µ', true, 'micro sign'], + ['·', '·', true, 'middle dot'], + ['•', '•', true, 'bullet'], + ['…', '…', true, 'three dot leader'], + ['′', '′', true, 'minutes / feet'], + ['″', '″', true, 'seconds / inches'], + ['§', '§', true, 'section sign'], + ['¶', '¶', true, 'paragraph sign'], + ['ß', 'ß', true, 'sharp s / ess-zed'], +// quotations + ['‹', '‹', true, 'single left-pointing angle quotation mark'], + ['›', '›', true, 'single right-pointing angle quotation mark'], + ['«', '«', true, 'left pointing guillemet'], + ['»', '»', true, 'right pointing guillemet'], + ['‘', '‘', true, 'left single quotation mark'], + ['’', '’', true, 'right single quotation mark'], + ['“', '“', true, 'left double quotation mark'], + ['”', '”', true, 'right double quotation mark'], + ['‚', '‚', true, 'single low-9 quotation mark'], + ['„', '„', true, 'double low-9 quotation mark'], + ['<', '<', true, 'less-than sign'], + ['>', '>', true, 'greater-than sign'], + ['≤', '≤', true, 'less-than or equal to'], + ['≥', '≥', true, 'greater-than or equal to'], + ['–', '–', true, 'en dash'], + ['—', '—', true, 'em dash'], + ['¯', '¯', true, 'macron'], + ['‾', '‾', true, 'overline'], + ['¤', '¤', true, 'currency sign'], + ['¦', '¦', true, 'broken bar'], + ['¨', '¨', true, 'diaeresis'], + ['¡', '¡', true, 'inverted exclamation mark'], + ['¿', '¿', true, 'turned question mark'], + ['ˆ', 'ˆ', true, 'circumflex accent'], + ['˜', '˜', true, 'small tilde'], + ['°', '°', true, 'degree sign'], + ['−', '−', true, 'minus sign'], + ['±', '±', true, 'plus-minus sign'], + ['÷', '÷', true, 'division sign'], + ['⁄', '⁄', true, 'fraction slash'], + ['×', '×', true, 'multiplication sign'], + ['¹', '¹', true, 'superscript one'], + ['²', '²', true, 'superscript two'], + ['³', '³', true, 'superscript three'], + ['¼', '¼', true, 'fraction one quarter'], + ['½', '½', true, 'fraction one half'], + ['¾', '¾', true, 'fraction three quarters'], +// math / logical + ['ƒ', 'ƒ', true, 'function / florin'], + ['∫', '∫', true, 'integral'], + ['∑', '∑', true, 'n-ary sumation'], + ['∞', '∞', true, 'infinity'], + ['√', '√', true, 'square root'], + ['∼', '∼', false,'similar to'], + ['≅', '≅', false,'approximately equal to'], + ['≈', '≈', true, 'almost equal to'], + ['≠', '≠', true, 'not equal to'], + ['≡', '≡', true, 'identical to'], + ['∈', '∈', false,'element of'], + ['∉', '∉', false,'not an element of'], + ['∋', '∋', false,'contains as member'], + ['∏', '∏', true, 'n-ary product'], + ['∧', '∧', false,'logical and'], + ['∨', '∨', false,'logical or'], + ['¬', '¬', true, 'not sign'], + ['∩', '∩', true, 'intersection'], + ['∪', '∪', false,'union'], + ['∂', '∂', true, 'partial differential'], + ['∀', '∀', false,'for all'], + ['∃', '∃', false,'there exists'], + ['∅', '∅', false,'diameter'], + ['∇', '∇', false,'backward difference'], + ['∗', '∗', false,'asterisk operator'], + ['∝', '∝', false,'proportional to'], + ['∠', '∠', false,'angle'], +// undefined + ['´', '´', true, 'acute accent'], + ['¸', '¸', true, 'cedilla'], + ['ª', 'ª', true, 'feminine ordinal indicator'], + ['º', 'º', true, 'masculine ordinal indicator'], + ['†', '†', true, 'dagger'], + ['‡', '‡', true, 'double dagger'], +// alphabetical special chars + ['À', 'À', true, 'A - grave'], + ['Á', 'Á', true, 'A - acute'], + ['Â', 'Â', true, 'A - circumflex'], + ['Ã', 'Ã', true, 'A - tilde'], + ['Ä', 'Ä', true, 'A - diaeresis'], + ['Å', 'Å', true, 'A - ring above'], + ['Æ', 'Æ', true, 'ligature AE'], + ['Ç', 'Ç', true, 'C - cedilla'], + ['È', 'È', true, 'E - grave'], + ['É', 'É', true, 'E - acute'], + ['Ê', 'Ê', true, 'E - circumflex'], + ['Ë', 'Ë', true, 'E - diaeresis'], + ['Ì', 'Ì', true, 'I - grave'], + ['Í', 'Í', true, 'I - acute'], + ['Î', 'Î', true, 'I - circumflex'], + ['Ï', 'Ï', true, 'I - diaeresis'], + ['Ð', 'Ð', true, 'ETH'], + ['Ñ', 'Ñ', true, 'N - tilde'], + ['Ò', 'Ò', true, 'O - grave'], + ['Ó', 'Ó', true, 'O - acute'], + ['Ô', 'Ô', true, 'O - circumflex'], + ['Õ', 'Õ', true, 'O - tilde'], + ['Ö', 'Ö', true, 'O - diaeresis'], + ['Ø', 'Ø', true, 'O - slash'], + ['Œ', 'Œ', true, 'ligature OE'], + ['Š', 'Š', true, 'S - caron'], + ['Ù', 'Ù', true, 'U - grave'], + ['Ú', 'Ú', true, 'U - acute'], + ['Û', 'Û', true, 'U - circumflex'], + ['Ü', 'Ü', true, 'U - diaeresis'], + ['Ý', 'Ý', true, 'Y - acute'], + ['Ÿ', 'Ÿ', true, 'Y - diaeresis'], + ['Þ', 'Þ', true, 'THORN'], + ['à', 'à', true, 'a - grave'], + ['á', 'á', true, 'a - acute'], + ['â', 'â', true, 'a - circumflex'], + ['ã', 'ã', true, 'a - tilde'], + ['ä', 'ä', true, 'a - diaeresis'], + ['å', 'å', true, 'a - ring above'], + ['æ', 'æ', true, 'ligature ae'], + ['ç', 'ç', true, 'c - cedilla'], + ['è', 'è', true, 'e - grave'], + ['é', 'é', true, 'e - acute'], + ['ê', 'ê', true, 'e - circumflex'], + ['ë', 'ë', true, 'e - diaeresis'], + ['ì', 'ì', true, 'i - grave'], + ['í', 'í', true, 'i - acute'], + ['î', 'î', true, 'i - circumflex'], + ['ï', 'ï', true, 'i - diaeresis'], + ['ð', 'ð', true, 'eth'], + ['ñ', 'ñ', true, 'n - tilde'], + ['ò', 'ò', true, 'o - grave'], + ['ó', 'ó', true, 'o - acute'], + ['ô', 'ô', true, 'o - circumflex'], + ['õ', 'õ', true, 'o - tilde'], + ['ö', 'ö', true, 'o - diaeresis'], + ['ø', 'ø', true, 'o slash'], + ['œ', 'œ', true, 'ligature oe'], + ['š', 'š', true, 's - caron'], + ['ù', 'ù', true, 'u - grave'], + ['ú', 'ú', true, 'u - acute'], + ['û', 'û', true, 'u - circumflex'], + ['ü', 'ü', true, 'u - diaeresis'], + ['ý', 'ý', true, 'y - acute'], + ['þ', 'þ', true, 'thorn'], + ['ÿ', 'ÿ', true, 'y - diaeresis'], + ['Α', 'Α', true, 'Alpha'], + ['Β', 'Β', true, 'Beta'], + ['Γ', 'Γ', true, 'Gamma'], + ['Δ', 'Δ', true, 'Delta'], + ['Ε', 'Ε', true, 'Epsilon'], + ['Ζ', 'Ζ', true, 'Zeta'], + ['Η', 'Η', true, 'Eta'], + ['Θ', 'Θ', true, 'Theta'], + ['Ι', 'Ι', true, 'Iota'], + ['Κ', 'Κ', true, 'Kappa'], + ['Λ', 'Λ', true, 'Lambda'], + ['Μ', 'Μ', true, 'Mu'], + ['Ν', 'Ν', true, 'Nu'], + ['Ξ', 'Ξ', true, 'Xi'], + ['Ο', 'Ο', true, 'Omicron'], + ['Π', 'Π', true, 'Pi'], + ['Ρ', 'Ρ', true, 'Rho'], + ['Σ', 'Σ', true, 'Sigma'], + ['Τ', 'Τ', true, 'Tau'], + ['Υ', 'Υ', true, 'Upsilon'], + ['Φ', 'Φ', true, 'Phi'], + ['Χ', 'Χ', true, 'Chi'], + ['Ψ', 'Ψ', true, 'Psi'], + ['Ω', 'Ω', true, 'Omega'], + ['α', 'α', true, 'alpha'], + ['β', 'β', true, 'beta'], + ['γ', 'γ', true, 'gamma'], + ['δ', 'δ', true, 'delta'], + ['ε', 'ε', true, 'epsilon'], + ['ζ', 'ζ', true, 'zeta'], + ['η', 'η', true, 'eta'], + ['θ', 'θ', true, 'theta'], + ['ι', 'ι', true, 'iota'], + ['κ', 'κ', true, 'kappa'], + ['λ', 'λ', true, 'lambda'], + ['μ', 'μ', true, 'mu'], + ['ν', 'ν', true, 'nu'], + ['ξ', 'ξ', true, 'xi'], + ['ο', 'ο', true, 'omicron'], + ['π', 'π', true, 'pi'], + ['ρ', 'ρ', true, 'rho'], + ['ς', 'ς', true, 'final sigma'], + ['σ', 'σ', true, 'sigma'], + ['τ', 'τ', true, 'tau'], + ['υ', 'υ', true, 'upsilon'], + ['φ', 'φ', true, 'phi'], + ['χ', 'χ', true, 'chi'], + ['ψ', 'ψ', true, 'psi'], + ['ω', 'ω', true, 'omega'], +// symbols + ['ℵ', 'ℵ', false,'alef symbol'], + ['ϖ', 'ϖ', false,'pi symbol'], + ['ℜ', 'ℜ', false,'real part symbol'], + ['ϑ','ϑ', false,'theta symbol'], + ['ϒ', 'ϒ', false,'upsilon - hook symbol'], + ['℘', '℘', false,'Weierstrass p'], + ['ℑ', 'ℑ', false,'imaginary part'], +// arrows + ['←', '←', true, 'leftwards arrow'], + ['↑', '↑', true, 'upwards arrow'], + ['→', '→', true, 'rightwards arrow'], + ['↓', '↓', true, 'downwards arrow'], + ['↔', '↔', true, 'left right arrow'], + ['↵', '↵', false,'carriage return'], + ['⇐', '⇐', false,'leftwards double arrow'], + ['⇑', '⇑', false,'upwards double arrow'], + ['⇒', '⇒', false,'rightwards double arrow'], + ['⇓', '⇓', false,'downwards double arrow'], + ['⇔', '⇔', false,'left right double arrow'], + ['∴', '∴', false,'therefore'], + ['⊂', '⊂', false,'subset of'], + ['⊃', '⊃', false,'superset of'], + ['⊄', '⊄', false,'not a subset of'], + ['⊆', '⊆', false,'subset of or equal to'], + ['⊇', '⊇', false,'superset of or equal to'], + ['⊕', '⊕', false,'circled plus'], + ['⊗', '⊗', false,'circled times'], + ['⊥', '⊥', false,'perpendicular'], + ['⋅', '⋅', false,'dot operator'], + ['⌈', '⌈', false,'left ceiling'], + ['⌉', '⌉', false,'right ceiling'], + ['⌊', '⌊', false,'left floor'], + ['⌋', '⌋', false,'right floor'], + ['⟨', '〈', false,'left-pointing angle bracket'], + ['⟩', '〉', false,'right-pointing angle bracket'], + ['◊', '◊', true, 'lozenge'], + ['♠', '♠', true, 'black spade suit'], + ['♣', '♣', true, 'black club suit'], + ['♥', '♥', true, 'black heart suit'], + ['♦', '♦', true, 'black diamond suit'], + [' ', ' ', false,'en space'], + [' ', ' ', false,'em space'], + [' ', ' ', false,'thin space'], + ['‌', '‌', false,'zero width non-joiner'], + ['‍', '‍', false,'zero width joiner'], + ['‎', '‎', false,'left-to-right mark'], + ['‏', '‏', false,'right-to-left mark'], + ['­', '­', false,'soft hyphen'] +]; + +tinyMCEPopup.onInit.add(function() { + tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML()); + addKeyboardNavigation(); +}); + +function addKeyboardNavigation(){ + var tableElm, cells, settings; + + cells = tinyMCEPopup.dom.select(".charmaplink", "charmapgroup"); + + settings ={ + root: "charmapgroup", + items: cells + }; + + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom); +} + +function renderCharMapHTML() { + var charsPerRow = 20, tdWidth=20, tdHeight=20, i; + var html = '
'+ + ''; + var cols=-1; + + for (i=0; i' + + '' + + charmap[i][1] + + ''; + if ((cols+1) % charsPerRow == 0) + html += ''; + } + } + + if (cols % charsPerRow > 0) { + var padd = charsPerRow - (cols % charsPerRow); + for (var i=0; i '; + } + + html += '
'; + html = html.replace(/<\/tr>/g, ''); + + return html; +} + +function insertChar(chr) { + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); + + // Refocus in window + if (tinyMCEPopup.isWindow) + window.focus(); + + tinyMCEPopup.editor.focus(); + tinyMCEPopup.close(); +} + +function previewChar(codeA, codeB, codeN) { + var elmA = document.getElementById('codeA'); + var elmB = document.getElementById('codeB'); + var elmV = document.getElementById('codeV'); + var elmN = document.getElementById('codeN'); + + if (codeA=='#160;') { + elmV.innerHTML = '__'; + } else { + elmV.innerHTML = '&' + codeA; + } + + elmB.innerHTML = '&' + codeA; + elmA.innerHTML = '&' + codeB; + elmN.innerHTML = codeN; +} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/color_picker.js b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/color_picker.js index 7decac5..cdf8c4c 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/color_picker.js +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/color_picker.js @@ -1,329 +1,329 @@ -tinyMCEPopup.requireLangPack(); - -var detail = 50, strhex = "0123456789ABCDEF", i, isMouseDown = false, isMouseOver = false; - -var colors = [ - "#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033", - "#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099", - "#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff", - "#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033", - "#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399", - "#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff", - "#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333", - "#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399", - "#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff", - "#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633", - "#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699", - "#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff", - "#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633", - "#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999", - "#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff", - "#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933", - "#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999", - "#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff", - "#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33", - "#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99", - "#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff", - "#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33", - "#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99", - "#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff", - "#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33", - "#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99", - "#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff" -]; - -var named = { - '#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige', - '#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown', - '#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue', - '#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod', - '#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green', - '#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue', - '#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue', - '#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green', - '#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey', - '#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory', - '#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue', - '#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green', - '#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey', - '#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon', - '#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue', - '#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin', - '#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid', - '#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff', - '#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue', - '#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver', - '#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green', - '#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet', - '#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green' -}; - -var namedLookup = {}; - -function init() { - var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value; - - tinyMCEPopup.resizeToInnerSize(); - - generatePicker(); - generateWebColors(); - generateNamedColors(); - - if (inputColor) { - changeFinalColor(inputColor); - - col = convertHexToRGB(inputColor); - - if (col) - updateLight(col.r, col.g, col.b); - } - - for (key in named) { - value = named[key]; - namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase(); - } -} - -function toHexColor(color) { - var matches, red, green, blue, toInt = parseInt; - - function hex(value) { - value = parseInt(value).toString(16); - - return value.length > 1 ? value : '0' + value; // Padd with leading zero - }; - - color = color.replace(/[\s#]+/g, '').toLowerCase(); - color = namedLookup[color] || color; - matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color); - - if (matches) { - if (matches[1]) { - red = toInt(matches[1]); - green = toInt(matches[2]); - blue = toInt(matches[3]); - } else if (matches[4]) { - red = toInt(matches[4], 16); - green = toInt(matches[5], 16); - blue = toInt(matches[6], 16); - } else if (matches[7]) { - red = toInt(matches[7] + matches[7], 16); - green = toInt(matches[8] + matches[8], 16); - blue = toInt(matches[9] + matches[9], 16); - } - - return '#' + hex(red) + hex(green) + hex(blue); - } - - return ''; -} - -function insertAction() { - var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); - - tinyMCEPopup.restoreSelection(); - - if (f) - f(toHexColor(color)); - - tinyMCEPopup.close(); -} - -function showColor(color, name) { - if (name) - document.getElementById("colorname").innerHTML = name; - - document.getElementById("preview").style.backgroundColor = color; - document.getElementById("color").value = color.toUpperCase(); -} - -function convertRGBToHex(col) { - var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); - - if (!col) - return col; - - var rgb = col.replace(re, "$1,$2,$3").split(','); - if (rgb.length == 3) { - r = parseInt(rgb[0]).toString(16); - g = parseInt(rgb[1]).toString(16); - b = parseInt(rgb[2]).toString(16); - - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; - - return "#" + r + g + b; - } - - return col; -} - -function convertHexToRGB(col) { - if (col.indexOf('#') != -1) { - col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); - - r = parseInt(col.substring(0, 2), 16); - g = parseInt(col.substring(2, 4), 16); - b = parseInt(col.substring(4, 6), 16); - - return {r : r, g : g, b : b}; - } - - return null; -} - -function generatePicker() { - var el = document.getElementById('light'), h = '', i; - - for (i = 0; i < detail; i++){ - h += '
'; - } - - el.innerHTML = h; -} - -function generateWebColors() { - var el = document.getElementById('webcolors'), h = '', i; - - if (el.className == 'generated') - return; - - // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. - h += '
' - + ''; - - for (i=0; i' - + ''; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += ''; - } - h += ''; - h += ''; - if ((i+1) % 18 == 0) - h += ''; - } - - h += '
'; - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el.firstChild); -} - -function paintCanvas(el) { - tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { - var context; - if (canvas.getContext && (context = canvas.getContext("2d"))) { - context.fillStyle = canvas.getAttribute('data-color'); - context.fillRect(0, 0, 10, 10); - } - }); -} -function generateNamedColors() { - var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; - - if (el.className == 'generated') - return; - - for (n in named) { - v = named[n]; - h += ''; - if (tinyMCEPopup.editor.forcedHighContrastMode) { - h += ''; - } - h += ''; - h += ''; - i++; - } - - el.innerHTML = h; - el.className = 'generated'; - - paintCanvas(el); - enableKeyboardNavigation(el); -} - -function enableKeyboardNavigation(el) { - tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { - root: el, - items: tinyMCEPopup.dom.select('a', el) - }, tinyMCEPopup.dom); -} - -function dechex(n) { - return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); -} - -function computeColor(e) { - var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; - - x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); - y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); - - partWidth = document.getElementById('colors').width / 6; - partDetail = detail / 2; - imHeight = document.getElementById('colors').height; - - r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; - g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); - b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); - - coef = (imHeight - y) / imHeight; - r = 128 + (r - 128) * coef; - g = 128 + (g - 128) * coef; - b = 128 + (b - 128) * coef; - - changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); - updateLight(r, g, b); -} - -function updateLight(r, g, b) { - var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; - - for (i=0; i=0) && (i 1 ? value : '0' + value; // Padd with leading zero + }; + + color = color.replace(/[\s#]+/g, '').toLowerCase(); + color = namedLookup[color] || color; + matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color); + + if (matches) { + if (matches[1]) { + red = toInt(matches[1]); + green = toInt(matches[2]); + blue = toInt(matches[3]); + } else if (matches[4]) { + red = toInt(matches[4], 16); + green = toInt(matches[5], 16); + blue = toInt(matches[6], 16); + } else if (matches[7]) { + red = toInt(matches[7] + matches[7], 16); + green = toInt(matches[8] + matches[8], 16); + blue = toInt(matches[9] + matches[9], 16); + } + + return '#' + hex(red) + hex(green) + hex(blue); + } + + return ''; +} + +function insertAction() { + var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func'); + + tinyMCEPopup.restoreSelection(); + + if (f) + f(toHexColor(color)); + + tinyMCEPopup.close(); +} + +function showColor(color, name) { + if (name) + document.getElementById("colorname").innerHTML = name; + + document.getElementById("preview").style.backgroundColor = color; + document.getElementById("color").value = color.toUpperCase(); +} + +function convertRGBToHex(col) { + var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi"); + + if (!col) + return col; + + var rgb = col.replace(re, "$1,$2,$3").split(','); + if (rgb.length == 3) { + r = parseInt(rgb[0]).toString(16); + g = parseInt(rgb[1]).toString(16); + b = parseInt(rgb[2]).toString(16); + + r = r.length == 1 ? '0' + r : r; + g = g.length == 1 ? '0' + g : g; + b = b.length == 1 ? '0' + b : b; + + return "#" + r + g + b; + } + + return col; +} + +function convertHexToRGB(col) { + if (col.indexOf('#') != -1) { + col = col.replace(new RegExp('[^0-9A-F]', 'gi'), ''); + + r = parseInt(col.substring(0, 2), 16); + g = parseInt(col.substring(2, 4), 16); + b = parseInt(col.substring(4, 6), 16); + + return {r : r, g : g, b : b}; + } + + return null; +} + +function generatePicker() { + var el = document.getElementById('light'), h = '', i; + + for (i = 0; i < detail; i++){ + h += '
'; + } + + el.innerHTML = h; +} + +function generateWebColors() { + var el = document.getElementById('webcolors'), h = '', i; + + if (el.className == 'generated') + return; + + // TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby. + h += '
' + + ''; + + for (i=0; i' + + ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + if ((i+1) % 18 == 0) + h += ''; + } + + h += '
'; + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el.firstChild); +} + +function paintCanvas(el) { + tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) { + var context; + if (canvas.getContext && (context = canvas.getContext("2d"))) { + context.fillStyle = canvas.getAttribute('data-color'); + context.fillRect(0, 0, 10, 10); + } + }); +} +function generateNamedColors() { + var el = document.getElementById('namedcolors'), h = '', n, v, i = 0; + + if (el.className == 'generated') + return; + + for (n in named) { + v = named[n]; + h += ''; + if (tinyMCEPopup.editor.forcedHighContrastMode) { + h += ''; + } + h += ''; + h += ''; + i++; + } + + el.innerHTML = h; + el.className = 'generated'; + + paintCanvas(el); + enableKeyboardNavigation(el); +} + +function enableKeyboardNavigation(el) { + tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', { + root: el, + items: tinyMCEPopup.dom.select('a', el) + }, tinyMCEPopup.dom); +} + +function dechex(n) { + return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16); +} + +function computeColor(e) { + var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB; + + x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0); + y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0); + + partWidth = document.getElementById('colors').width / 6; + partDetail = detail / 2; + imHeight = document.getElementById('colors').height; + + r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255; + g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255 + (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth); + b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth); + + coef = (imHeight - y) / imHeight; + r = 128 + (r - 128) * coef; + g = 128 + (g - 128) * coef; + b = 128 + (b - 128) * coef; + + changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b)); + updateLight(r, g, b); +} + +function updateLight(r, g, b) { + var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color; + + for (i=0; i=0) && (i'); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); - if (isVisible('srcbrowser')) - document.getElementById('src').style.width = '180px'; - - e = ed.selection.getNode(); - - this.fillFileList('image_list', 'tinyMCEImageList'); - - if (e.nodeName == 'IMG') { - f.src.value = ed.dom.getAttrib(e, 'src'); - f.alt.value = ed.dom.getAttrib(e, 'alt'); - f.border.value = this.getAttrib(e, 'border'); - f.vspace.value = this.getAttrib(e, 'vspace'); - f.hspace.value = this.getAttrib(e, 'hspace'); - f.width.value = ed.dom.getAttrib(e, 'width'); - f.height.value = ed.dom.getAttrib(e, 'height'); - f.insert.value = ed.getLang('update'); - this.styleVal = ed.dom.getAttrib(e, 'style'); - selectByValue(f, 'image_list', f.src.value); - selectByValue(f, 'align', this.getAttrib(e, 'align')); - this.updateStyle(); - } - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - update : function() { - var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; - - tinyMCEPopup.restoreSelection(); - - if (f.src.value === '') { - if (ed.selection.getNode().nodeName == 'IMG') { - ed.dom.remove(ed.selection.getNode()); - ed.execCommand('mceRepaint'); - } - - tinyMCEPopup.close(); - return; - } - - if (!ed.settings.inline_styles) { - args = tinymce.extend(args, { - vspace : nl.vspace.value, - hspace : nl.hspace.value, - border : nl.border.value, - align : getSelectValue(f, 'align') - }); - } else - args.style = this.styleVal; - - tinymce.extend(args, { - src : f.src.value.replace(/ /g, '%20'), - alt : f.alt.value, - width : f.width.value, - height : f.height.value - }); - - el = ed.selection.getNode(); - - if (el && el.nodeName == 'IMG') { - ed.dom.setAttribs(el, args); - tinyMCEPopup.editor.execCommand('mceRepaint'); - tinyMCEPopup.editor.focus(); - } else { - ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); - ed.dom.setAttribs('__mce_tmp', args); - ed.dom.setAttrib('__mce_tmp', 'id', ''); - ed.undoManager.add(); - } - - tinyMCEPopup.close(); - }, - - updateStyle : function() { - var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; - - if (tinyMCEPopup.editor.settings.inline_styles) { - st = tinyMCEPopup.dom.parseStyle(this.styleVal); - - // Handle align - v = getSelectValue(f, 'align'); - if (v) { - if (v == 'left' || v == 'right') { - st['float'] = v; - delete st['vertical-align']; - } else { - st['vertical-align'] = v; - delete st['float']; - } - } else { - delete st['float']; - delete st['vertical-align']; - } - - // Handle border - v = f.border.value; - if (v || v == '0') { - if (v == '0') - st['border'] = '0'; - else - st['border'] = v + 'px solid black'; - } else - delete st['border']; - - // Handle hspace - v = f.hspace.value; - if (v) { - delete st['margin']; - st['margin-left'] = v + 'px'; - st['margin-right'] = v + 'px'; - } else { - delete st['margin-left']; - delete st['margin-right']; - } - - // Handle vspace - v = f.vspace.value; - if (v) { - delete st['margin']; - st['margin-top'] = v + 'px'; - st['margin-bottom'] = v + 'px'; - } else { - delete st['margin-top']; - delete st['margin-bottom']; - } - - // Merge - st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); - this.styleVal = dom.serializeStyle(st, 'img'); - } - }, - - getAttrib : function(e, at) { - var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; - - if (ed.settings.inline_styles) { - switch (at) { - case 'align': - if (v = dom.getStyle(e, 'float')) - return v; - - if (v = dom.getStyle(e, 'vertical-align')) - return v; - - break; - - case 'hspace': - v = dom.getStyle(e, 'margin-left') - v2 = dom.getStyle(e, 'margin-right'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'vspace': - v = dom.getStyle(e, 'margin-top') - v2 = dom.getStyle(e, 'margin-bottom'); - if (v && v == v2) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - - case 'border': - v = 0; - - tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { - sv = dom.getStyle(e, 'border-' + sv + '-width'); - - // False or not the same as prev - if (!sv || (sv != v && v !== 0)) { - v = 0; - return false; - } - - if (sv) - v = sv; - }); - - if (v) - return parseInt(v.replace(/[^0-9]/g, '')); - - break; - } - } - - if (v = dom.getAttrib(e, at)) - return v; - - return ''; - }, - - resetImageData : function() { - var f = document.forms[0]; - - f.width.value = f.height.value = ""; - }, - - updateImageData : function() { - var f = document.forms[0], t = ImageDialog; - - if (f.width.value == "") - f.width.value = t.preloadImg.width; - - if (f.height.value == "") - f.height.value = t.preloadImg.height; - }, - - getImageData : function() { - var f = document.forms[0]; - - this.preloadImg = new Image(); - this.preloadImg.onload = this.updateImageData; - this.preloadImg.onerror = this.resetImageData; - this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); - } -}; - -ImageDialog.preInit(); -tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); +var ImageDialog = { + preInit : function() { + var url; + + tinyMCEPopup.requireLangPack(); + + if (url = tinyMCEPopup.getParam("external_image_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image'); + if (isVisible('srcbrowser')) + document.getElementById('src').style.width = '180px'; + + e = ed.selection.getNode(); + + this.fillFileList('image_list', 'tinyMCEImageList'); + + if (e.nodeName == 'IMG') { + f.src.value = ed.dom.getAttrib(e, 'src'); + f.alt.value = ed.dom.getAttrib(e, 'alt'); + f.border.value = this.getAttrib(e, 'border'); + f.vspace.value = this.getAttrib(e, 'vspace'); + f.hspace.value = this.getAttrib(e, 'hspace'); + f.width.value = ed.dom.getAttrib(e, 'width'); + f.height.value = ed.dom.getAttrib(e, 'height'); + f.insert.value = ed.getLang('update'); + this.styleVal = ed.dom.getAttrib(e, 'style'); + selectByValue(f, 'image_list', f.src.value); + selectByValue(f, 'align', this.getAttrib(e, 'align')); + this.updateStyle(); + } + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + update : function() { + var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el; + + tinyMCEPopup.restoreSelection(); + + if (f.src.value === '') { + if (ed.selection.getNode().nodeName == 'IMG') { + ed.dom.remove(ed.selection.getNode()); + ed.execCommand('mceRepaint'); + } + + tinyMCEPopup.close(); + return; + } + + if (!ed.settings.inline_styles) { + args = tinymce.extend(args, { + vspace : nl.vspace.value, + hspace : nl.hspace.value, + border : nl.border.value, + align : getSelectValue(f, 'align') + }); + } else + args.style = this.styleVal; + + tinymce.extend(args, { + src : f.src.value.replace(/ /g, '%20'), + alt : f.alt.value, + width : f.width.value, + height : f.height.value + }); + + el = ed.selection.getNode(); + + if (el && el.nodeName == 'IMG') { + ed.dom.setAttribs(el, args); + tinyMCEPopup.editor.execCommand('mceRepaint'); + tinyMCEPopup.editor.focus(); + } else { + ed.execCommand('mceInsertContent', false, '', {skip_undo : 1}); + ed.dom.setAttribs('__mce_tmp', args); + ed.dom.setAttrib('__mce_tmp', 'id', ''); + ed.undoManager.add(); + } + + tinyMCEPopup.close(); + }, + + updateStyle : function() { + var dom = tinyMCEPopup.dom, st, v, f = document.forms[0]; + + if (tinyMCEPopup.editor.settings.inline_styles) { + st = tinyMCEPopup.dom.parseStyle(this.styleVal); + + // Handle align + v = getSelectValue(f, 'align'); + if (v) { + if (v == 'left' || v == 'right') { + st['float'] = v; + delete st['vertical-align']; + } else { + st['vertical-align'] = v; + delete st['float']; + } + } else { + delete st['float']; + delete st['vertical-align']; + } + + // Handle border + v = f.border.value; + if (v || v == '0') { + if (v == '0') + st['border'] = '0'; + else + st['border'] = v + 'px solid black'; + } else + delete st['border']; + + // Handle hspace + v = f.hspace.value; + if (v) { + delete st['margin']; + st['margin-left'] = v + 'px'; + st['margin-right'] = v + 'px'; + } else { + delete st['margin-left']; + delete st['margin-right']; + } + + // Handle vspace + v = f.vspace.value; + if (v) { + delete st['margin']; + st['margin-top'] = v + 'px'; + st['margin-bottom'] = v + 'px'; + } else { + delete st['margin-top']; + delete st['margin-bottom']; + } + + // Merge + st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img'); + this.styleVal = dom.serializeStyle(st, 'img'); + } + }, + + getAttrib : function(e, at) { + var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2; + + if (ed.settings.inline_styles) { + switch (at) { + case 'align': + if (v = dom.getStyle(e, 'float')) + return v; + + if (v = dom.getStyle(e, 'vertical-align')) + return v; + + break; + + case 'hspace': + v = dom.getStyle(e, 'margin-left') + v2 = dom.getStyle(e, 'margin-right'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'vspace': + v = dom.getStyle(e, 'margin-top') + v2 = dom.getStyle(e, 'margin-bottom'); + if (v && v == v2) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + + case 'border': + v = 0; + + tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) { + sv = dom.getStyle(e, 'border-' + sv + '-width'); + + // False or not the same as prev + if (!sv || (sv != v && v !== 0)) { + v = 0; + return false; + } + + if (sv) + v = sv; + }); + + if (v) + return parseInt(v.replace(/[^0-9]/g, '')); + + break; + } + } + + if (v = dom.getAttrib(e, at)) + return v; + + return ''; + }, + + resetImageData : function() { + var f = document.forms[0]; + + f.width.value = f.height.value = ""; + }, + + updateImageData : function() { + var f = document.forms[0], t = ImageDialog; + + if (f.width.value == "") + f.width.value = t.preloadImg.width; + + if (f.height.value == "") + f.height.value = t.preloadImg.height; + }, + + getImageData : function() { + var f = document.forms[0]; + + this.preloadImg = new Image(); + this.preloadImg.onload = this.updateImageData; + this.preloadImg.onerror = this.resetImageData; + this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value); + } +}; + +ImageDialog.preInit(); +tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog); diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/link.js b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/link.js index 53ff409..e67d868 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/link.js +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/link.js @@ -1,153 +1,153 @@ -tinyMCEPopup.requireLangPack(); - -var LinkDialog = { - preInit : function() { - var url; - - if (url = tinyMCEPopup.getParam("external_link_list_url")) - document.write(''); - }, - - init : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor; - - // Setup browse button - document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); - if (isVisible('hrefbrowser')) - document.getElementById('href').style.width = '180px'; - - this.fillClassList('class_list'); - this.fillFileList('link_list', 'tinyMCELinkList'); - this.fillTargetList('target_list'); - - if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { - f.href.value = ed.dom.getAttrib(e, 'href'); - f.linktitle.value = ed.dom.getAttrib(e, 'title'); - f.insert.value = ed.getLang('update'); - selectByValue(f, 'link_list', f.href.value); - selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); - selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); - } - }, - - update : function() { - var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); - - tinyMCEPopup.restoreSelection(); - e = ed.dom.getParent(ed.selection.getNode(), 'A'); - - // Remove element if there is no href - if (!f.href.value) { - if (e) { - b = ed.selection.getBookmark(); - ed.dom.remove(e, 1); - ed.selection.moveToBookmark(b); - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - return; - } - } - - // Create new anchor elements - if (e == null) { - ed.getDoc().execCommand("unlink", false, null); - tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); - - tinymce.each(ed.dom.select("a"), function(n) { - if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { - e = n; - - ed.dom.setAttribs(e, { - href : href, - title : f.linktitle.value, - target : f.target_list ? getSelectValue(f, "target_list") : null, - 'class' : f.class_list ? getSelectValue(f, "class_list") : null - }); - } - }); - } else { - ed.dom.setAttribs(e, { - href : href, - title : f.linktitle.value, - target : f.target_list ? getSelectValue(f, "target_list") : null, - 'class' : f.class_list ? getSelectValue(f, "class_list") : null - }); - } - - // Don't move caret if selection was image - if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { - ed.focus(); - ed.selection.select(e); - ed.selection.collapse(0); - tinyMCEPopup.storeSelection(); - } - - tinyMCEPopup.execCommand("mceEndUndoLevel"); - tinyMCEPopup.close(); - }, - - checkPrefix : function(n) { - if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) - n.value = 'mailto:' + n.value; - - if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) - n.value = 'http://' + n.value; - }, - - fillFileList : function(id, l) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - l = window[l]; - - if (l && l.length > 0) { - lst.options[lst.options.length] = new Option('', ''); - - tinymce.each(l, function(o) { - lst.options[lst.options.length] = new Option(o[0], o[1]); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillClassList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; - - if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { - cl = []; - - tinymce.each(v.split(';'), function(v) { - var p = v.split('='); - - cl.push({'title' : p[0], 'class' : p[1]}); - }); - } else - cl = tinyMCEPopup.editor.dom.getClasses(); - - if (cl.length > 0) { - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - - tinymce.each(cl, function(o) { - lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); - }); - } else - dom.remove(dom.getParent(id, 'tr')); - }, - - fillTargetList : function(id) { - var dom = tinyMCEPopup.dom, lst = dom.get(id), v; - - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); - lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); - - if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { - tinymce.each(v.split(','), function(v) { - v = v.split('='); - lst.options[lst.options.length] = new Option(v[0], v[1]); - }); - } - } -}; - -LinkDialog.preInit(); -tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); +tinyMCEPopup.requireLangPack(); + +var LinkDialog = { + preInit : function() { + var url; + + if (url = tinyMCEPopup.getParam("external_link_list_url")) + document.write(''); + }, + + init : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor; + + // Setup browse button + document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link'); + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + + this.fillClassList('class_list'); + this.fillFileList('link_list', 'tinyMCELinkList'); + this.fillTargetList('target_list'); + + if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) { + f.href.value = ed.dom.getAttrib(e, 'href'); + f.linktitle.value = ed.dom.getAttrib(e, 'title'); + f.insert.value = ed.getLang('update'); + selectByValue(f, 'link_list', f.href.value); + selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target')); + selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class')); + } + }, + + update : function() { + var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20'); + + tinyMCEPopup.restoreSelection(); + e = ed.dom.getParent(ed.selection.getNode(), 'A'); + + // Remove element if there is no href + if (!f.href.value) { + if (e) { + b = ed.selection.getBookmark(); + ed.dom.remove(e, 1); + ed.selection.moveToBookmark(b); + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + return; + } + } + + // Create new anchor elements + if (e == null) { + ed.getDoc().execCommand("unlink", false, null); + tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1}); + + tinymce.each(ed.dom.select("a"), function(n) { + if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') { + e = n; + + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value, + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null + }); + } + }); + } else { + ed.dom.setAttribs(e, { + href : href, + title : f.linktitle.value, + target : f.target_list ? getSelectValue(f, "target_list") : null, + 'class' : f.class_list ? getSelectValue(f, "class_list") : null + }); + } + + // Don't move caret if selection was image + if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') { + ed.focus(); + ed.selection.select(e); + ed.selection.collapse(0); + tinyMCEPopup.storeSelection(); + } + + tinyMCEPopup.execCommand("mceEndUndoLevel"); + tinyMCEPopup.close(); + }, + + checkPrefix : function(n) { + if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email'))) + n.value = 'mailto:' + n.value; + + if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external'))) + n.value = 'http://' + n.value; + }, + + fillFileList : function(id, l) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + l = window[l]; + + if (l && l.length > 0) { + lst.options[lst.options.length] = new Option('', ''); + + tinymce.each(l, function(o) { + lst.options[lst.options.length] = new Option(o[0], o[1]); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillClassList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl; + + if (v = tinyMCEPopup.getParam('theme_advanced_styles')) { + cl = []; + + tinymce.each(v.split(';'), function(v) { + var p = v.split('='); + + cl.push({'title' : p[0], 'class' : p[1]}); + }); + } else + cl = tinyMCEPopup.editor.dom.getClasses(); + + if (cl.length > 0) { + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + + tinymce.each(cl, function(o) { + lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']); + }); + } else + dom.remove(dom.getParent(id, 'tr')); + }, + + fillTargetList : function(id) { + var dom = tinyMCEPopup.dom, lst = dom.get(id), v; + + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), ''); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self'); + lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank'); + + if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) { + tinymce.each(v.split(','), function(v) { + v = v.split('='); + lst.options[lst.options.length] = new Option(v[0], v[1]); + }); + } + } +}; + +LinkDialog.preInit(); +tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog); diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/source_editor.js b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/source_editor.js index 84546ad..9cf6b1a 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/source_editor.js +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/js/source_editor.js @@ -1,56 +1,56 @@ -tinyMCEPopup.requireLangPack(); -tinyMCEPopup.onInit.add(onLoadInit); - -function saveContent() { - tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); - tinyMCEPopup.close(); -} - -function onLoadInit() { - tinyMCEPopup.resizeToInnerSize(); - - // Remove Gecko spellchecking - if (tinymce.isGecko) - document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); - - document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); - - if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { - setWrap('soft'); - document.getElementById('wraped').checked = true; - } - - resizeInputs(); -} - -function setWrap(val) { - var v, n, s = document.getElementById('htmlSource'); - - s.wrap = val; - - if (!tinymce.isIE) { - v = s.value; - n = s.cloneNode(false); - n.setAttribute("wrap", val); - s.parentNode.replaceChild(n, s); - n.value = v; - } -} - -function toggleWordWrap(elm) { - if (elm.checked) - setWrap('soft'); - else - setWrap('off'); -} - -function resizeInputs() { - var vp = tinyMCEPopup.dom.getViewPort(window), el; - - el = document.getElementById('htmlSource'); - - if (el) { - el.style.width = (vp.w - 20) + 'px'; - el.style.height = (vp.h - 65) + 'px'; - } -} +tinyMCEPopup.requireLangPack(); +tinyMCEPopup.onInit.add(onLoadInit); + +function saveContent() { + tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true}); + tinyMCEPopup.close(); +} + +function onLoadInit() { + tinyMCEPopup.resizeToInnerSize(); + + // Remove Gecko spellchecking + if (tinymce.isGecko) + document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck"); + + document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true}); + + if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) { + setWrap('soft'); + document.getElementById('wraped').checked = true; + } + + resizeInputs(); +} + +function setWrap(val) { + var v, n, s = document.getElementById('htmlSource'); + + s.wrap = val; + + if (!tinymce.isIE) { + v = s.value; + n = s.cloneNode(false); + n.setAttribute("wrap", val); + s.parentNode.replaceChild(n, s); + n.value = v; + } +} + +function toggleWordWrap(elm) { + if (elm.checked) + setWrap('soft'); + else + setWrap('off'); +} + +function resizeInputs() { + var vp = tinyMCEPopup.dom.getViewPort(window), el; + + el = document.getElementById('htmlSource'); + + if (el) { + el.style.width = (vp.w - 20) + 'px'; + el.style.height = (vp.h - 65) + 'px'; + } +} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/langs/en.js b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/langs/en.js index fbf2989..4c74747 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/langs/en.js +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/langs/en.js @@ -1,68 +1,68 @@ -tinyMCE.addI18n('en.advanced',{ -style_select:"Styles", -font_size:"Font size", -fontdefault:"Font family", -block:"Format", -paragraph:"Paragraph", -div:"Div", -address:"Address", -pre:"Preformatted", -h1:"Heading 1", -h2:"Heading 2", -h3:"Heading 3", -h4:"Heading 4", -h5:"Heading 5", -h6:"Heading 6", -blockquote:"Blockquote", -code:"Code", -samp:"Code sample", -dt:"Definition term ", -dd:"Definition description", -bold_desc:"Bold (Ctrl+B)", -italic_desc:"Italic (Ctrl+I)", -underline_desc:"Underline (Ctrl+U)", -striketrough_desc:"Strikethrough", -justifyleft_desc:"Align left", -justifycenter_desc:"Align center", -justifyright_desc:"Align right", -justifyfull_desc:"Align full", -bullist_desc:"Unordered list", -numlist_desc:"Ordered list", -outdent_desc:"Outdent", -indent_desc:"Indent", -undo_desc:"Undo (Ctrl+Z)", -redo_desc:"Redo (Ctrl+Y)", -link_desc:"Insert/edit link", -unlink_desc:"Unlink", -image_desc:"Insert/edit image", -cleanup_desc:"Cleanup messy code", -code_desc:"Edit HTML Source", -sub_desc:"Subscript", -sup_desc:"Superscript", -hr_desc:"Insert horizontal ruler", -removeformat_desc:"Remove formatting", -custom1_desc:"Your custom description here", -forecolor_desc:"Select text color", -backcolor_desc:"Select background color", -charmap_desc:"Insert custom character", -visualaid_desc:"Toggle guidelines/invisible elements", -anchor_desc:"Insert/edit anchor", -cut_desc:"Cut", -copy_desc:"Copy", -paste_desc:"Paste", -image_props_desc:"Image properties", -newdocument_desc:"New document", -help_desc:"Help", -blockquote_desc:"Blockquote", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", -path:"Path", -newdocument:"Are you sure you want clear all contents?", -toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", -more_colors:"More colors", - -// Accessibility Strings -shortcuts_desc:'Accessibility Help', -help_shortcut:'. Press ALT F10 for toolbar. Press ALT 0 for help.', -rich_text_area:"Rich Text Area", -toolbar:"Toolbar" -}); +tinyMCE.addI18n('en.advanced',{ +style_select:"Styles", +font_size:"Font size", +fontdefault:"Font family", +block:"Format", +paragraph:"Paragraph", +div:"Div", +address:"Address", +pre:"Preformatted", +h1:"Heading 1", +h2:"Heading 2", +h3:"Heading 3", +h4:"Heading 4", +h5:"Heading 5", +h6:"Heading 6", +blockquote:"Blockquote", +code:"Code", +samp:"Code sample", +dt:"Definition term ", +dd:"Definition description", +bold_desc:"Bold (Ctrl+B)", +italic_desc:"Italic (Ctrl+I)", +underline_desc:"Underline (Ctrl+U)", +striketrough_desc:"Strikethrough", +justifyleft_desc:"Align left", +justifycenter_desc:"Align center", +justifyright_desc:"Align right", +justifyfull_desc:"Align full", +bullist_desc:"Unordered list", +numlist_desc:"Ordered list", +outdent_desc:"Outdent", +indent_desc:"Indent", +undo_desc:"Undo (Ctrl+Z)", +redo_desc:"Redo (Ctrl+Y)", +link_desc:"Insert/edit link", +unlink_desc:"Unlink", +image_desc:"Insert/edit image", +cleanup_desc:"Cleanup messy code", +code_desc:"Edit HTML Source", +sub_desc:"Subscript", +sup_desc:"Superscript", +hr_desc:"Insert horizontal ruler", +removeformat_desc:"Remove formatting", +custom1_desc:"Your custom description here", +forecolor_desc:"Select text color", +backcolor_desc:"Select background color", +charmap_desc:"Insert custom character", +visualaid_desc:"Toggle guidelines/invisible elements", +anchor_desc:"Insert/edit anchor", +cut_desc:"Cut", +copy_desc:"Copy", +paste_desc:"Paste", +image_props_desc:"Image properties", +newdocument_desc:"New document", +help_desc:"Help", +blockquote_desc:"Blockquote", +clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", +path:"Path", +newdocument:"Are you sure you want clear all contents?", +toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", +more_colors:"More colors", + +// Accessibility Strings +shortcuts_desc:'Accessibility Help', +help_shortcut:'. Press ALT F10 for toolbar. Press ALT 0 for help.', +rich_text_area:"Rich Text Area", +toolbar:"Toolbar" +}); diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js index 0a459be..a4e2e0b 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/langs/en_dlg.js @@ -1,54 +1,54 @@ -tinyMCE.addI18n('en.advanced_dlg',{ -about_title:"About TinyMCE", -about_general:"About", -about_help:"Help", -about_license:"License", -about_plugins:"Plugins", -about_plugin:"Plugin", -about_author:"Author", -about_version:"Version", -about_loaded:"Loaded plugins", -anchor_title:"Insert/edit anchor", -anchor_name:"Anchor name", -anchor_invalid:"Please specify a valid anchor name.", -code_title:"HTML Source Editor", -code_wordwrap:"Word wrap", -colorpicker_title:"Select a color", -colorpicker_picker_tab:"Picker", -colorpicker_picker_title:"Color picker", -colorpicker_palette_tab:"Palette", -colorpicker_palette_title:"Palette colors", -colorpicker_named_tab:"Named", -colorpicker_named_title:"Named colors", -colorpicker_color:"Color:", -colorpicker_name:"Name:", -charmap_title:"Select custom character", -image_title:"Insert/edit image", -image_src:"Image URL", -image_alt:"Image description", -image_list:"Image list", -image_border:"Border", -image_dimensions:"Dimensions", -image_vspace:"Vertical space", -image_hspace:"Horizontal space", -image_align:"Alignment", -image_align_baseline:"Baseline", -image_align_top:"Top", -image_align_middle:"Middle", -image_align_bottom:"Bottom", -image_align_texttop:"Text top", -image_align_textbottom:"Text bottom", -image_align_left:"Left", -image_align_right:"Right", -link_title:"Insert/edit link", -link_url:"Link URL", -link_target:"Target", -link_target_same:"Open link in the same window", -link_target_blank:"Open link in a new window", -link_titlefield:"Title", -link_is_email:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?", -link_is_external:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?", -link_list:"Link list", -accessibility_help:"Accessibility Help", -accessibility_usage_title:"General Usage" +tinyMCE.addI18n('en.advanced_dlg',{ +about_title:"About TinyMCE", +about_general:"About", +about_help:"Help", +about_license:"License", +about_plugins:"Plugins", +about_plugin:"Plugin", +about_author:"Author", +about_version:"Version", +about_loaded:"Loaded plugins", +anchor_title:"Insert/edit anchor", +anchor_name:"Anchor name", +anchor_invalid:"Please specify a valid anchor name.", +code_title:"HTML Source Editor", +code_wordwrap:"Word wrap", +colorpicker_title:"Select a color", +colorpicker_picker_tab:"Picker", +colorpicker_picker_title:"Color picker", +colorpicker_palette_tab:"Palette", +colorpicker_palette_title:"Palette colors", +colorpicker_named_tab:"Named", +colorpicker_named_title:"Named colors", +colorpicker_color:"Color:", +colorpicker_name:"Name:", +charmap_title:"Select custom character", +image_title:"Insert/edit image", +image_src:"Image URL", +image_alt:"Image description", +image_list:"Image list", +image_border:"Border", +image_dimensions:"Dimensions", +image_vspace:"Vertical space", +image_hspace:"Horizontal space", +image_align:"Alignment", +image_align_baseline:"Baseline", +image_align_top:"Top", +image_align_middle:"Middle", +image_align_bottom:"Bottom", +image_align_texttop:"Text top", +image_align_textbottom:"Text bottom", +image_align_left:"Left", +image_align_right:"Right", +link_title:"Insert/edit link", +link_url:"Link URL", +link_target:"Target", +link_target_same:"Open link in the same window", +link_target_blank:"Open link in a new window", +link_titlefield:"Title", +link_is_email:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?", +link_is_external:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?", +link_list:"Link list", +accessibility_help:"Accessibility Help", +accessibility_usage_title:"General Usage" }); \ No newline at end of file diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/link.htm b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/link.htm index 5d9dea9..4a2459f 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/link.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/link.htm @@ -1,57 +1,57 @@ - - - - {#advanced_dlg.link_title} - - - - - - - -
- - -
-
- - - - - - - - - - - - - - - - - - - - - -
- - - - -
 
-
-
- -
- - -
-
- - + + + + {#advanced_dlg.link_title} + + + + + + + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + +
 
+
+
+ +
+ + +
+
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/shortcuts.htm b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/shortcuts.htm index 20ec2f5..436091f 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/shortcuts.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/shortcuts.htm @@ -1,47 +1,47 @@ - - - - {#advanced_dlg.accessibility_help} - - - - -

{#advanced_dlg.accessibility_usage_title}

-

Toolbars

-

Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. - Press enter to activate a button and return focus to the editor. - Press escape to return focus to the editor without performing any actions.

- -

Status Bar

-

To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. - Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

- -

Context Menu

-

Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. - To close submenus press the left arrow key. Press escape to close the context menu.

- -

Keyboard Shortcuts

- - - - - - - - - - - - - - - - - - - - - -
KeystrokeFunction
Control-BBold
Control-IItalic
Control-ZUndo
Control-YRedo
- - + + + + {#advanced_dlg.accessibility_help} + + + + +

{#advanced_dlg.accessibility_usage_title}

+

Toolbars

+

Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys. + Press enter to activate a button and return focus to the editor. + Press escape to return focus to the editor without performing any actions.

+ +

Status Bar

+

To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path. + Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.

+ +

Context Menu

+

Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key. + To close submenus press the left arrow key. Press escape to close the context menu.

+ +

Keyboard Shortcuts

+ + + + + + + + + + + + + + + + + + + + + +
KeystrokeFunction
Control-BBold
Control-IItalic
Control-ZUndo
Control-YRedo
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/content.css b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/content.css index 0363466..842d52d 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/content.css +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/content.css @@ -1,47 +1,47 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} - -.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} -.mceItemShockWave {background-image:url(../../img/shockwave.gif)} -.mceItemFlash {background-image:url(../../img/flash.gif)} -.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} -.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} -.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} -.mceItemVideo {background-image:url(../../img/video.gif)} -.mceItemIframe {background-image:url(../../img/iframe.gif)} -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css index f012226..1f5598c 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/dialog.css @@ -1,117 +1,117 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#insert {background:url(img/buttons.png) 0 -52px} -#cancel {background:url(img/buttons.png) 0 0; float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} -#colorpicker #picker_panel fieldset {margin:auto;width:325px;} +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(img/buttons.png) 0 -52px} +#cancel {background:url(img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/ui.css b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/ui.css index 556b510..e14d36f 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/ui.css +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/default/ui.css @@ -1,213 +1,213 @@ -/* Reset */ -.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} -.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} -.defaultSkin table td {vertical-align:middle} - -/* Containers */ -.defaultSkin table {direction:ltr;background:transparent} -.defaultSkin iframe {display:block;} -.defaultSkin .mceToolbar {height:26px} -.defaultSkin .mceLeft {text-align:left} -.defaultSkin .mceRight {text-align:right} - -/* External */ -.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} -.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} - -/* Layout */ -.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} -.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} -.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} -.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top} -.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} -.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} -.defaultSkin .mceStatusbar div {float:left; margin:2px} -.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} -.defaultSkin .mceStatusbar a:hover {text-decoration:underline} -.defaultSkin table.mceToolbar {margin-left:3px} -.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} -.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} -.defaultSkin td.mceCenter {text-align:center;} -.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} -.defaultSkin td.mceRight table {margin:0 0 0 auto;} - -/* Button */ -.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} -.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} -.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceButtonLabeled {width:auto} -.defaultSkin .mceButtonLabeled span.mceIcon {float:left} -.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} -.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} - -/* Separator */ -.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} - -/* ListBox */ -.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} -.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} -.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} -.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} -.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} -.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} -.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} -.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} -.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} -.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} - -/* SplitButton */ -.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} -.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} -.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} -.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} -.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} -.defaultSkin .mceSplitButton span.mceOpen {display:none} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} -.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} -.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} -.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} - -/* ColorSplitButton */ -.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} -.defaultSkin .mceColorSplitMenu td {padding:2px} -.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} -.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} -.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} -.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} -.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} - -/* Menu */ -.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} -.defaultSkin .mceNoIcons span.mceIcon {width:0;} -.defaultSkin .mceNoIcons a .mceText {padding-left:10px} -.defaultSkin .mceMenu table {background:#FFF} -.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} -.defaultSkin .mceMenu td {height:20px} -.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} -.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} -.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} -.defaultSkin .mceMenu pre.mceText {font-family:Monospace} -.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} -.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} -.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} -.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} -.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} -.defaultSkin .mceMenuItemDisabled .mceText {color:#888} -.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} -.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} -.defaultSkin .mceMenu span.mceMenuLine {display:none} -.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} - -/* Progress,Resize */ -.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} -.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Formats */ -.defaultSkin .mce_formatPreview a {font-size:10px} -.defaultSkin .mce_p span.mceText {} -.defaultSkin .mce_address span.mceText {font-style:italic} -.defaultSkin .mce_pre span.mceText {font-family:monospace} -.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} - -/* Theme */ -.defaultSkin span.mce_bold {background-position:0 0} -.defaultSkin span.mce_italic {background-position:-60px 0} -.defaultSkin span.mce_underline {background-position:-140px 0} -.defaultSkin span.mce_strikethrough {background-position:-120px 0} -.defaultSkin span.mce_undo {background-position:-160px 0} -.defaultSkin span.mce_redo {background-position:-100px 0} -.defaultSkin span.mce_cleanup {background-position:-40px 0} -.defaultSkin span.mce_bullist {background-position:-20px 0} -.defaultSkin span.mce_numlist {background-position:-80px 0} -.defaultSkin span.mce_justifyleft {background-position:-460px 0} -.defaultSkin span.mce_justifyright {background-position:-480px 0} -.defaultSkin span.mce_justifycenter {background-position:-420px 0} -.defaultSkin span.mce_justifyfull {background-position:-440px 0} -.defaultSkin span.mce_anchor {background-position:-200px 0} -.defaultSkin span.mce_indent {background-position:-400px 0} -.defaultSkin span.mce_outdent {background-position:-540px 0} -.defaultSkin span.mce_link {background-position:-500px 0} -.defaultSkin span.mce_unlink {background-position:-640px 0} -.defaultSkin span.mce_sub {background-position:-600px 0} -.defaultSkin span.mce_sup {background-position:-620px 0} -.defaultSkin span.mce_removeformat {background-position:-580px 0} -.defaultSkin span.mce_newdocument {background-position:-520px 0} -.defaultSkin span.mce_image {background-position:-380px 0} -.defaultSkin span.mce_help {background-position:-340px 0} -.defaultSkin span.mce_code {background-position:-260px 0} -.defaultSkin span.mce_hr {background-position:-360px 0} -.defaultSkin span.mce_visualaid {background-position:-660px 0} -.defaultSkin span.mce_charmap {background-position:-240px 0} -.defaultSkin span.mce_paste {background-position:-560px 0} -.defaultSkin span.mce_copy {background-position:-700px 0} -.defaultSkin span.mce_cut {background-position:-680px 0} -.defaultSkin span.mce_blockquote {background-position:-220px 0} -.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} -.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} -.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} -.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} - -/* Plugins */ -.defaultSkin span.mce_advhr {background-position:-0px -20px} -.defaultSkin span.mce_ltr {background-position:-20px -20px} -.defaultSkin span.mce_rtl {background-position:-40px -20px} -.defaultSkin span.mce_emotions {background-position:-60px -20px} -.defaultSkin span.mce_fullpage {background-position:-80px -20px} -.defaultSkin span.mce_fullscreen {background-position:-100px -20px} -.defaultSkin span.mce_iespell {background-position:-120px -20px} -.defaultSkin span.mce_insertdate {background-position:-140px -20px} -.defaultSkin span.mce_inserttime {background-position:-160px -20px} -.defaultSkin span.mce_absolute {background-position:-180px -20px} -.defaultSkin span.mce_backward {background-position:-200px -20px} -.defaultSkin span.mce_forward {background-position:-220px -20px} -.defaultSkin span.mce_insert_layer {background-position:-240px -20px} -.defaultSkin span.mce_insertlayer {background-position:-260px -20px} -.defaultSkin span.mce_movebackward {background-position:-280px -20px} -.defaultSkin span.mce_moveforward {background-position:-300px -20px} -.defaultSkin span.mce_media {background-position:-320px -20px} -.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} -.defaultSkin span.mce_pastetext {background-position:-360px -20px} -.defaultSkin span.mce_pasteword {background-position:-380px -20px} -.defaultSkin span.mce_selectall {background-position:-400px -20px} -.defaultSkin span.mce_preview {background-position:-420px -20px} -.defaultSkin span.mce_print {background-position:-440px -20px} -.defaultSkin span.mce_cancel {background-position:-460px -20px} -.defaultSkin span.mce_save {background-position:-480px -20px} -.defaultSkin span.mce_replace {background-position:-500px -20px} -.defaultSkin span.mce_search {background-position:-520px -20px} -.defaultSkin span.mce_styleprops {background-position:-560px -20px} -.defaultSkin span.mce_table {background-position:-580px -20px} -.defaultSkin span.mce_cell_props {background-position:-600px -20px} -.defaultSkin span.mce_delete_table {background-position:-620px -20px} -.defaultSkin span.mce_delete_col {background-position:-640px -20px} -.defaultSkin span.mce_delete_row {background-position:-660px -20px} -.defaultSkin span.mce_col_after {background-position:-680px -20px} -.defaultSkin span.mce_col_before {background-position:-700px -20px} -.defaultSkin span.mce_row_after {background-position:-720px -20px} -.defaultSkin span.mce_row_before {background-position:-740px -20px} -.defaultSkin span.mce_merge_cells {background-position:-760px -20px} -.defaultSkin span.mce_table_props {background-position:-980px -20px} -.defaultSkin span.mce_row_props {background-position:-780px -20px} -.defaultSkin span.mce_split_cells {background-position:-800px -20px} -.defaultSkin span.mce_template {background-position:-820px -20px} -.defaultSkin span.mce_visualchars {background-position:-840px -20px} -.defaultSkin span.mce_abbr {background-position:-860px -20px} -.defaultSkin span.mce_acronym {background-position:-880px -20px} -.defaultSkin span.mce_attribs {background-position:-900px -20px} -.defaultSkin span.mce_cite {background-position:-920px -20px} -.defaultSkin span.mce_del {background-position:-940px -20px} -.defaultSkin span.mce_ins {background-position:-960px -20px} -.defaultSkin span.mce_pagebreak {background-position:0 -40px} -.defaultSkin span.mce_restoredraft {background-position:-20px -40px} -.defaultSkin span.mce_spellchecker {background-position:-540px -20px} +/* Reset */ +.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.defaultSkin table td {vertical-align:middle} + +/* Containers */ +.defaultSkin table {direction:ltr;background:transparent} +.defaultSkin iframe {display:block;} +.defaultSkin .mceToolbar {height:26px} +.defaultSkin .mceLeft {text-align:left} +.defaultSkin .mceRight {text-align:right} + +/* External */ +.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;} +.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC} +.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC} +.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;} +.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top} +.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC} +.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px} +.defaultSkin .mceStatusbar div {float:left; margin:2px} +.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.defaultSkin .mceStatusbar a:hover {text-decoration:underline} +.defaultSkin table.mceToolbar {margin-left:3px} +.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px} +.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.defaultSkin td.mceCenter {text-align:center;} +.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;} +.defaultSkin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px} +.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0} +.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceButtonLabeled {width:auto} +.defaultSkin .mceButtonLabeled span.mceIcon {float:left} +.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px} + +/* ListBox */ +.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block} +.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;} +.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF} +.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0} +.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;} +.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px} +.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;} +.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;} + +/* SplitButton */ +.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr} +.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block} +.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;} +.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);} +.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;} +.defaultSkin .mceSplitButton span.mceOpen {display:none} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0} +.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;} +.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0} +.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;} + +/* ColorSplitButton */ +.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.defaultSkin .mceColorSplitMenu td {padding:2px} +.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A} +.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a} +.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px} + +/* Menu */ +.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8} +.defaultSkin .mceNoIcons span.mceIcon {width:0;} +.defaultSkin .mceNoIcons a .mceText {padding-left:10px} +.defaultSkin .mceMenu table {background:#FFF} +.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block} +.defaultSkin .mceMenu td {height:20px} +.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0} +.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px} +.defaultSkin .mceMenu pre.mceText {font-family:Monospace} +.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px} +.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD} +.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.defaultSkin .mceMenuItemDisabled .mceText {color:#888} +.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)} +.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center} +.defaultSkin .mceMenu span.mceMenuLine {display:none} +.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF} +.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.defaultSkin .mce_formatPreview a {font-size:10px} +.defaultSkin .mce_p span.mceText {} +.defaultSkin .mce_address span.mceText {font-style:italic} +.defaultSkin .mce_pre span.mceText {font-family:monospace} +.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.defaultSkin span.mce_bold {background-position:0 0} +.defaultSkin span.mce_italic {background-position:-60px 0} +.defaultSkin span.mce_underline {background-position:-140px 0} +.defaultSkin span.mce_strikethrough {background-position:-120px 0} +.defaultSkin span.mce_undo {background-position:-160px 0} +.defaultSkin span.mce_redo {background-position:-100px 0} +.defaultSkin span.mce_cleanup {background-position:-40px 0} +.defaultSkin span.mce_bullist {background-position:-20px 0} +.defaultSkin span.mce_numlist {background-position:-80px 0} +.defaultSkin span.mce_justifyleft {background-position:-460px 0} +.defaultSkin span.mce_justifyright {background-position:-480px 0} +.defaultSkin span.mce_justifycenter {background-position:-420px 0} +.defaultSkin span.mce_justifyfull {background-position:-440px 0} +.defaultSkin span.mce_anchor {background-position:-200px 0} +.defaultSkin span.mce_indent {background-position:-400px 0} +.defaultSkin span.mce_outdent {background-position:-540px 0} +.defaultSkin span.mce_link {background-position:-500px 0} +.defaultSkin span.mce_unlink {background-position:-640px 0} +.defaultSkin span.mce_sub {background-position:-600px 0} +.defaultSkin span.mce_sup {background-position:-620px 0} +.defaultSkin span.mce_removeformat {background-position:-580px 0} +.defaultSkin span.mce_newdocument {background-position:-520px 0} +.defaultSkin span.mce_image {background-position:-380px 0} +.defaultSkin span.mce_help {background-position:-340px 0} +.defaultSkin span.mce_code {background-position:-260px 0} +.defaultSkin span.mce_hr {background-position:-360px 0} +.defaultSkin span.mce_visualaid {background-position:-660px 0} +.defaultSkin span.mce_charmap {background-position:-240px 0} +.defaultSkin span.mce_paste {background-position:-560px 0} +.defaultSkin span.mce_copy {background-position:-700px 0} +.defaultSkin span.mce_cut {background-position:-680px 0} +.defaultSkin span.mce_blockquote {background-position:-220px 0} +.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0} +.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0} +.defaultSkin span.mce_forecolorpicker {background-position:-720px 0} +.defaultSkin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.defaultSkin span.mce_advhr {background-position:-0px -20px} +.defaultSkin span.mce_ltr {background-position:-20px -20px} +.defaultSkin span.mce_rtl {background-position:-40px -20px} +.defaultSkin span.mce_emotions {background-position:-60px -20px} +.defaultSkin span.mce_fullpage {background-position:-80px -20px} +.defaultSkin span.mce_fullscreen {background-position:-100px -20px} +.defaultSkin span.mce_iespell {background-position:-120px -20px} +.defaultSkin span.mce_insertdate {background-position:-140px -20px} +.defaultSkin span.mce_inserttime {background-position:-160px -20px} +.defaultSkin span.mce_absolute {background-position:-180px -20px} +.defaultSkin span.mce_backward {background-position:-200px -20px} +.defaultSkin span.mce_forward {background-position:-220px -20px} +.defaultSkin span.mce_insert_layer {background-position:-240px -20px} +.defaultSkin span.mce_insertlayer {background-position:-260px -20px} +.defaultSkin span.mce_movebackward {background-position:-280px -20px} +.defaultSkin span.mce_moveforward {background-position:-300px -20px} +.defaultSkin span.mce_media {background-position:-320px -20px} +.defaultSkin span.mce_nonbreaking {background-position:-340px -20px} +.defaultSkin span.mce_pastetext {background-position:-360px -20px} +.defaultSkin span.mce_pasteword {background-position:-380px -20px} +.defaultSkin span.mce_selectall {background-position:-400px -20px} +.defaultSkin span.mce_preview {background-position:-420px -20px} +.defaultSkin span.mce_print {background-position:-440px -20px} +.defaultSkin span.mce_cancel {background-position:-460px -20px} +.defaultSkin span.mce_save {background-position:-480px -20px} +.defaultSkin span.mce_replace {background-position:-500px -20px} +.defaultSkin span.mce_search {background-position:-520px -20px} +.defaultSkin span.mce_styleprops {background-position:-560px -20px} +.defaultSkin span.mce_table {background-position:-580px -20px} +.defaultSkin span.mce_cell_props {background-position:-600px -20px} +.defaultSkin span.mce_delete_table {background-position:-620px -20px} +.defaultSkin span.mce_delete_col {background-position:-640px -20px} +.defaultSkin span.mce_delete_row {background-position:-660px -20px} +.defaultSkin span.mce_col_after {background-position:-680px -20px} +.defaultSkin span.mce_col_before {background-position:-700px -20px} +.defaultSkin span.mce_row_after {background-position:-720px -20px} +.defaultSkin span.mce_row_before {background-position:-740px -20px} +.defaultSkin span.mce_merge_cells {background-position:-760px -20px} +.defaultSkin span.mce_table_props {background-position:-980px -20px} +.defaultSkin span.mce_row_props {background-position:-780px -20px} +.defaultSkin span.mce_split_cells {background-position:-800px -20px} +.defaultSkin span.mce_template {background-position:-820px -20px} +.defaultSkin span.mce_visualchars {background-position:-840px -20px} +.defaultSkin span.mce_abbr {background-position:-860px -20px} +.defaultSkin span.mce_acronym {background-position:-880px -20px} +.defaultSkin span.mce_attribs {background-position:-900px -20px} +.defaultSkin span.mce_cite {background-position:-920px -20px} +.defaultSkin span.mce_del {background-position:-940px -20px} +.defaultSkin span.mce_ins {background-position:-960px -20px} +.defaultSkin span.mce_pagebreak {background-position:0 -40px} +.defaultSkin span.mce_restoredraft {background-position:-20px -40px} +.defaultSkin span.mce_spellchecker {background-position:-540px -20px} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css index c2e30c7..75cfaf1 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/content.css @@ -1,23 +1,23 @@ -body, td, pre { margin:8px;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} +body, td, pre { margin:8px;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css index b2ed097..dafcd28 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/dialog.css @@ -1,105 +1,105 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; background:#F0F0EE; -color: black; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE; color:#000;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;background-color:transparent;} -a:hover {color:#2B6FB6;background-color:transparent;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;background-color:transparent;} -input.invalid {border:1px solid #EE0000;background-color:transparent;} -input {background:#FFF; border:1px solid #CCC;color:black;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -font-weight:bold; -width:94px; height:23px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#cancel {float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} -.tabs li.current {font-weight: bold; margin-right:2px;} -.tabs span {float:left; display:block; padding:0px 10px 0 0;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} +color: black; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE; color:#000;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;background-color:transparent;} +a:hover {color:#2B6FB6;background-color:transparent;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;background-color:transparent;} +input.invalid {border:1px solid #EE0000;background-color:transparent;} +input {background:#FFF; border:1px solid #CCC;color:black;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +font-weight:bold; +width:94px; height:23px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#cancel {float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;} +.tabs li.current {font-weight: bold; margin-right:2px;} +.tabs span {float:left; display:block; padding:0px 10px 0 0;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css index 901446e..a550c8f 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/highcontrast/ui.css @@ -1,101 +1,101 @@ -/* Reset */ -.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} -.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} -.highcontrastSkin table td {vertical-align:middle} - -.highcontrastSkin .mceIconOnly {display: block !important;} - -/* External */ -.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} -.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} - -/* Layout */ -.highcontrastSkin table.mceLayout {border: 1px solid;} -.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} -.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} -.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} -.highcontrastSkin .mceStatusbar div {float:left} -.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} - -.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} -.highcontrastSkin .mceToolbar tr { display: block;} -.highcontrastSkin .mceToolbar table { display: block; } - -/* Button */ - -.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} -.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} -.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} -.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} - -/* Separator */ -.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} - -/* ListBox */ -.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} -.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} -.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} -.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} -.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} -.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} - -.highcontrastSkin .mceListBoxMenu {overflow-y:auto} - -/* SplitButton */ -.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} - -.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} -.highcontrastSkin .mceSplitButton tr { display: table-row; } -.highcontrastSkin table.mceSplitButton { display: table; } -.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} -.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} -.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } -.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} -.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} - -/* Menu */ -.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} -.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; } -.highcontrastSkin .mceMenu table {background:white; color: black} -.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} -.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} -.highcontrastSkin .mceMenu td {height:2em} -.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} -.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} -.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} -.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} -.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} -.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} -.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} -.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} -.highcontrastSkin .mceMenu span.mceMenuLine {display:none} -.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} - -/* ColorSplitButton */ -.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} -.highcontrastSkin .mceColorSplitMenu td {padding:2px} -.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} -.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} -.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} -.highcontrastSkin .mceColorPreview {display:none;} -.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} - -/* Progress,Resize */ -.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} -.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Formats */ -.highcontrastSkin .mce_p span.mceText {} -.highcontrastSkin .mce_address span.mceText {font-style:italic} -.highcontrastSkin .mce_pre span.mceText {font-family:monospace} -.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} +/* Reset */ +.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;} +.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;} +.highcontrastSkin table td {vertical-align:middle} + +.highcontrastSkin .mceIconOnly {display: block !important;} + +/* External */ +.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;} +.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;} + +/* Layout */ +.highcontrastSkin table.mceLayout {border: 1px solid;} +.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid} +.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline} +.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;} +.highcontrastSkin .mceStatusbar div {float:left} +.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0} + +.highcontrastSkin .mceToolbar td { display: inline-block; float: left;} +.highcontrastSkin .mceToolbar tr { display: block;} +.highcontrastSkin .mceToolbar table { display: block; } + +/* Button */ + +.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;} +.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em} +.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;} + +/* Separator */ +.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;} + +/* ListBox */ +.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceListBox .mceText {padding: 5px 6px; line-height: 2em; width: 15ex; overflow: hidden;} +.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);} +.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;} +.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;} + +.highcontrastSkin .mceListBoxMenu {overflow-y:auto} + +/* SplitButton */ +.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} + +.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;} +.highcontrastSkin .mceSplitButton tr { display: table-row; } +.highcontrastSkin table.mceSplitButton { display: table; } +.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;} +.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;} +.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } +.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;} +.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;} + +/* Menu */ +.highcontrastSkin .mceNoIcons span.mceIcon {width:0;} +.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; } +.highcontrastSkin .mceMenu table {background:white; color: black} +.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px} +.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black} +.highcontrastSkin .mceMenu td {height:2em} +.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;} +.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;} +.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace} +.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;} +.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px} +.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid} +.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px} +.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";} +.highcontrastSkin .mceMenu span.mceMenuLine {display:none} +.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"} + +/* ColorSplitButton */ +.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000} +.highcontrastSkin .mceColorSplitMenu td {padding:2px} +.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;} +.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2} +.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;} +.highcontrastSkin .mceColorPreview {display:none;} +.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden} + +/* Progress,Resize */ +.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.highcontrastSkin .mce_p span.mceText {} +.highcontrastSkin .mce_address span.mceText {font-style:italic} +.highcontrastSkin .mce_pre span.mceText {font-family:monospace} +.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css index 4ac4e4d..8569401 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/content.css @@ -1,46 +1,46 @@ -body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} -body {background:#FFF;} -body.mceForceColors {background:#FFF; color:#000;} -h1 {font-size: 2em} -h2 {font-size: 1.5em} -h3 {font-size: 1.17em} -h4 {font-size: 1em} -h5 {font-size: .83em} -h6 {font-size: .75em} -.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} -a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} -span.mceItemNbsp {background: #DDD} -td.mceSelected, th.mceSelected {background-color:#3399ff !important} -img {border:0;} -table {cursor:default} -table td, table th {cursor:text} -ins {border-bottom:1px solid green; text-decoration: none; color:green} -del {color:red; text-decoration:line-through} -cite {border-bottom:1px dashed blue} -acronym {border-bottom:1px dotted #CCC; cursor:help} -abbr {border-bottom:1px dashed #CCC; cursor:help} - -/* IE */ -* html body { -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -} - -img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} -font[face=mceinline] {font-family:inherit !important} - -.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} -.mceItemShockWave {background-image:url(../../img/shockwave.gif)} -.mceItemFlash {background-image:url(../../img/flash.gif)} -.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} -.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} -.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} -.mceItemVideo {background-image:url(../../img/video.gif)} -.mceItemIframe {background-image:url(../../img/iframe.gif)} -.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} +body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;} +body {background:#FFF;} +body.mceForceColors {background:#FFF; color:#000;} +h1 {font-size: 2em} +h2 {font-size: 1.5em} +h3 {font-size: 1.17em} +h4 {font-size: 1em} +h5 {font-size: .83em} +h6 {font-size: .75em} +.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;} +a.mceItemAnchor {display:inline-block; width:11px !important; height:11px !important; background:url(../default/img/items.gif) no-repeat 0 0;} +span.mceItemNbsp {background: #DDD} +td.mceSelected, th.mceSelected {background-color:#3399ff !important} +img {border:0;} +table {cursor:default} +table td, table th {cursor:text} +ins {border-bottom:1px solid green; text-decoration: none; color:green} +del {color:red; text-decoration:line-through} +cite {border-bottom:1px dashed blue} +acronym {border-bottom:1px dotted #CCC; cursor:help} +abbr {border-bottom:1px dashed #CCC; cursor:help} + +/* IE */ +* html body { +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +} + +img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px} +font[face=mceinline] {font-family:inherit !important} + +.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc} +.mceItemShockWave {background-image:url(../../img/shockwave.gif)} +.mceItemFlash {background-image:url(../../img/flash.gif)} +.mceItemQuickTime {background-image:url(../../img/quicktime.gif)} +.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)} +.mceItemRealMedia {background-image:url(../../img/realmedia.gif)} +.mceItemVideo {background-image:url(../../img/video.gif)} +.mceItemIframe {background-image:url(../../img/iframe.gif)} +.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css index ec08772..c97d38e 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css @@ -1,117 +1,117 @@ -/* Generic */ -body { -font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; -scrollbar-3dlight-color:#F0F0EE; -scrollbar-arrow-color:#676662; -scrollbar-base-color:#F0F0EE; -scrollbar-darkshadow-color:#DDDDDD; -scrollbar-face-color:#E0E0DD; -scrollbar-highlight-color:#F0F0EE; -scrollbar-shadow-color:#F0F0EE; -scrollbar-track-color:#F5F5F5; -background:#F0F0EE; -padding:0; -margin:8px 8px 0 8px; -} - -html {background:#F0F0EE;} -td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -textarea {resize:none;outline:none;} -a:link, a:visited {color:black;} -a:hover {color:#2B6FB6;} -.nowrap {white-space: nowrap} - -/* Forms */ -fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} -legend {color:#2B6FB6; font-weight:bold;} -label.msg {display:none;} -label.invalid {color:#EE0000; display:inline;} -input.invalid {border:1px solid #EE0000;} -input {background:#FFF; border:1px solid #CCC;} -input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} -input, select, textarea {border:1px solid #808080;} -input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} -input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} -.input_noborder {border:0;} - -/* Buttons */ -#insert, #cancel, input.button, .updateButton { -border:0; margin:0; padding:0; -font-weight:bold; -width:94px; height:26px; -background:url(../default/img/buttons.png) 0 -26px; -cursor:pointer; -padding-bottom:2px; -float:left; -} - -#insert {background:url(../default/img/buttons.png) 0 -52px} -#cancel {background:url(../default/img/buttons.png) 0 0; float:right} - -/* Browse */ -a.pickcolor, a.browse {text-decoration:none} -a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} -.mceOldBoxModel a.browse span {width:22px; height:20px;} -a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} -a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} -a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} -.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} -a.pickcolor:hover span {background-color:#B2BBD0;} -a.pickcolor:hover span.disabled {} - -/* Charmap */ -table.charmap {border:1px solid #AAA; text-align:center} -td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} -#charmap a {display:block; color:#000; text-decoration:none; border:0} -#charmap a:hover {background:#CCC;color:#2B6FB6} -#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} -#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} - -/* Source */ -.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} -.mceActionPanel {margin-top:5px;} - -/* Tabs classes */ -.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} -.tabs ul {margin:0; padding:0; list-style:none;} -.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} -.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} -.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} -.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} -.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} -.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} - -/* Panels */ -.panel_wrapper div.panel {display:none;} -.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} -.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} - -/* Columns */ -.column {float:left;} -.properties {width:100%;} -.properties .column1 {} -.properties .column2 {text-align:left;} - -/* Titles */ -h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} -h3 {font-size:14px;} -.title {font-size:12px; font-weight:bold; color:#2B6FB6;} - -/* Dialog specific */ -#link .panel_wrapper, #link div.current {height:125px;} -#image .panel_wrapper, #image div.current {height:200px;} -#plugintable thead {font-weight:bold; background:#DDD;} -#plugintable, #about #plugintable td {border:1px solid #919B9C;} -#plugintable {width:96%; margin-top:10px;} -#pluginscontainer {height:290px; overflow:auto;} -#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} -#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} -#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} -#colorpicker #light div {overflow:hidden;} -#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} -#colorpicker .panel_wrapper div.current {height:175px;} -#colorpicker #namedcolors {width:150px;} -#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} -#colorpicker #colornamecontainer {margin-top:5px;} -#colorpicker #picker_panel fieldset {margin:auto;width:325px;} +/* Generic */ +body { +font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; +scrollbar-3dlight-color:#F0F0EE; +scrollbar-arrow-color:#676662; +scrollbar-base-color:#F0F0EE; +scrollbar-darkshadow-color:#DDDDDD; +scrollbar-face-color:#E0E0DD; +scrollbar-highlight-color:#F0F0EE; +scrollbar-shadow-color:#F0F0EE; +scrollbar-track-color:#F5F5F5; +background:#F0F0EE; +padding:0; +margin:8px 8px 0 8px; +} + +html {background:#F0F0EE;} +td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +textarea {resize:none;outline:none;} +a:link, a:visited {color:black;} +a:hover {color:#2B6FB6;} +.nowrap {white-space: nowrap} + +/* Forms */ +fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;} +legend {color:#2B6FB6; font-weight:bold;} +label.msg {display:none;} +label.invalid {color:#EE0000; display:inline;} +input.invalid {border:1px solid #EE0000;} +input {background:#FFF; border:1px solid #CCC;} +input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;} +input, select, textarea {border:1px solid #808080;} +input.radio {border:1px none #000000; background:transparent; vertical-align:middle;} +input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;} +.input_noborder {border:0;} + +/* Buttons */ +#insert, #cancel, input.button, .updateButton { +border:0; margin:0; padding:0; +font-weight:bold; +width:94px; height:26px; +background:url(../default/img/buttons.png) 0 -26px; +cursor:pointer; +padding-bottom:2px; +float:left; +} + +#insert {background:url(../default/img/buttons.png) 0 -52px} +#cancel {background:url(../default/img/buttons.png) 0 0; float:right} + +/* Browse */ +a.pickcolor, a.browse {text-decoration:none} +a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;} +.mceOldBoxModel a.browse span {width:22px; height:20px;} +a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;} +a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +a.browse:hover span.disabled {border:1px solid white; background-color:transparent;} +a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;} +.mceOldBoxModel a.pickcolor span {width:21px; height:17px;} +a.pickcolor:hover span {background-color:#B2BBD0;} +a.pickcolor:hover span.disabled {} + +/* Charmap */ +table.charmap {border:1px solid #AAA; text-align:center} +td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;} +#charmap a {display:block; color:#000; text-decoration:none; border:0} +#charmap a:hover {background:#CCC;color:#2B6FB6} +#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center} +#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center} + +/* Source */ +.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;} +.mceActionPanel {margin-top:5px;} + +/* Tabs classes */ +.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;} +.tabs ul {margin:0; padding:0; list-style:none;} +.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;} +.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;} +.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;} +.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;} +.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;} +.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;} + +/* Panels */ +.panel_wrapper div.panel {display:none;} +.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;} +.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;} + +/* Columns */ +.column {float:left;} +.properties {width:100%;} +.properties .column1 {} +.properties .column2 {text-align:left;} + +/* Titles */ +h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;} +h3 {font-size:14px;} +.title {font-size:12px; font-weight:bold; color:#2B6FB6;} + +/* Dialog specific */ +#link .panel_wrapper, #link div.current {height:125px;} +#image .panel_wrapper, #image div.current {height:200px;} +#plugintable thead {font-weight:bold; background:#DDD;} +#plugintable, #about #plugintable td {border:1px solid #919B9C;} +#plugintable {width:96%; margin-top:10px;} +#pluginscontainer {height:290px; overflow:auto;} +#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;} +#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;} +#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;} +#colorpicker #light div {overflow:hidden;} +#colorpicker #previewblock {float:right; padding-left:10px; height:20px;} +#colorpicker .panel_wrapper div.current {height:175px;} +#colorpicker #namedcolors {width:150px;} +#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;} +#colorpicker #colornamecontainer {margin-top:5px;} +#colorpicker #picker_panel fieldset {margin:auto;width:325px;} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css index df596bf..91edeca 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui.css @@ -1,216 +1,216 @@ -/* Reset */ -.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} -.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} -.o2k7Skin table td {vertical-align:middle} - -/* Containers */ -.o2k7Skin table {background:transparent} -.o2k7Skin iframe {display:block;} -.o2k7Skin .mceToolbar {height:26px} - -/* External */ -.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} -.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} -.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} - -/* Layout */ -.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} -.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} -.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} -.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} -.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} -.o2k7Skin td.mceToolbar{background:#E5EFFD} -.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} -.o2k7Skin .mceStatusbar div {float:left; padding:2px} -.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} -.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} -.o2k7Skin table.mceToolbar {margin-left:3px} -.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} -.o2k7Skin .mceToolbar td.mceFirst span {margin:0} -.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} -.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} -.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} -.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} -.o2k7Skin td.mceCenter {text-align:center;} -.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} -.o2k7Skin td.mceRight table {margin:0 0 0 auto;} - -/* Button */ -.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} -.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} -.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} -.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} -.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} -.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.o2k7Skin .mceButtonLabeled {width:auto} -.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} -.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} -.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} - -/* Separator */ -.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} - -/* ListBox */ -.o2k7Skin .mceListBox {margin-left:3px} -.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} -.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} -.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} -.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} -.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} -.o2k7Skin .mceListBoxDisabled .mceText {color:gray} -.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} -.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} -.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} - -/* SplitButton */ -.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} -.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} -.o2k7Skin .mceSplitButton a.mceAction {width:22px} -.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} -.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} -.o2k7Skin .mceSplitButton span.mceOpen {display:none} -.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} -.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} -.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} -.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} - -/* ColorSplitButton */ -.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} -.o2k7Skin .mceColorSplitMenu td {padding:2px} -.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} -.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} -.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} -.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} -.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} -.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} -.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} - -/* Menu */ -.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} -.o2k7Skin .mceNoIcons span.mceIcon {width:0;} -.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} -.o2k7Skin .mceMenu table {background:#FFF} -.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} -.o2k7Skin .mceMenu td {height:20px} -.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} -.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} -.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} -.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} -.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} -.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} -.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} -.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} -.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} -.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} -.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} -.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} -.o2k7Skin .mceMenu span.mceMenuLine {display:none} -.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} - -/* Progress,Resize */ -.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} -.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} - -/* Formats */ -.o2k7Skin .mce_formatPreview a {font-size:10px} -.o2k7Skin .mce_p span.mceText {} -.o2k7Skin .mce_address span.mceText {font-style:italic} -.o2k7Skin .mce_pre span.mceText {font-family:monospace} -.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} -.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} -.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} -.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} -.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} -.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} - -/* Theme */ -.o2k7Skin span.mce_bold {background-position:0 0} -.o2k7Skin span.mce_italic {background-position:-60px 0} -.o2k7Skin span.mce_underline {background-position:-140px 0} -.o2k7Skin span.mce_strikethrough {background-position:-120px 0} -.o2k7Skin span.mce_undo {background-position:-160px 0} -.o2k7Skin span.mce_redo {background-position:-100px 0} -.o2k7Skin span.mce_cleanup {background-position:-40px 0} -.o2k7Skin span.mce_bullist {background-position:-20px 0} -.o2k7Skin span.mce_numlist {background-position:-80px 0} -.o2k7Skin span.mce_justifyleft {background-position:-460px 0} -.o2k7Skin span.mce_justifyright {background-position:-480px 0} -.o2k7Skin span.mce_justifycenter {background-position:-420px 0} -.o2k7Skin span.mce_justifyfull {background-position:-440px 0} -.o2k7Skin span.mce_anchor {background-position:-200px 0} -.o2k7Skin span.mce_indent {background-position:-400px 0} -.o2k7Skin span.mce_outdent {background-position:-540px 0} -.o2k7Skin span.mce_link {background-position:-500px 0} -.o2k7Skin span.mce_unlink {background-position:-640px 0} -.o2k7Skin span.mce_sub {background-position:-600px 0} -.o2k7Skin span.mce_sup {background-position:-620px 0} -.o2k7Skin span.mce_removeformat {background-position:-580px 0} -.o2k7Skin span.mce_newdocument {background-position:-520px 0} -.o2k7Skin span.mce_image {background-position:-380px 0} -.o2k7Skin span.mce_help {background-position:-340px 0} -.o2k7Skin span.mce_code {background-position:-260px 0} -.o2k7Skin span.mce_hr {background-position:-360px 0} -.o2k7Skin span.mce_visualaid {background-position:-660px 0} -.o2k7Skin span.mce_charmap {background-position:-240px 0} -.o2k7Skin span.mce_paste {background-position:-560px 0} -.o2k7Skin span.mce_copy {background-position:-700px 0} -.o2k7Skin span.mce_cut {background-position:-680px 0} -.o2k7Skin span.mce_blockquote {background-position:-220px 0} -.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} -.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} -.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} -.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} - -/* Plugins */ -.o2k7Skin span.mce_advhr {background-position:-0px -20px} -.o2k7Skin span.mce_ltr {background-position:-20px -20px} -.o2k7Skin span.mce_rtl {background-position:-40px -20px} -.o2k7Skin span.mce_emotions {background-position:-60px -20px} -.o2k7Skin span.mce_fullpage {background-position:-80px -20px} -.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} -.o2k7Skin span.mce_iespell {background-position:-120px -20px} -.o2k7Skin span.mce_insertdate {background-position:-140px -20px} -.o2k7Skin span.mce_inserttime {background-position:-160px -20px} -.o2k7Skin span.mce_absolute {background-position:-180px -20px} -.o2k7Skin span.mce_backward {background-position:-200px -20px} -.o2k7Skin span.mce_forward {background-position:-220px -20px} -.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} -.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} -.o2k7Skin span.mce_movebackward {background-position:-280px -20px} -.o2k7Skin span.mce_moveforward {background-position:-300px -20px} -.o2k7Skin span.mce_media {background-position:-320px -20px} -.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} -.o2k7Skin span.mce_pastetext {background-position:-360px -20px} -.o2k7Skin span.mce_pasteword {background-position:-380px -20px} -.o2k7Skin span.mce_selectall {background-position:-400px -20px} -.o2k7Skin span.mce_preview {background-position:-420px -20px} -.o2k7Skin span.mce_print {background-position:-440px -20px} -.o2k7Skin span.mce_cancel {background-position:-460px -20px} -.o2k7Skin span.mce_save {background-position:-480px -20px} -.o2k7Skin span.mce_replace {background-position:-500px -20px} -.o2k7Skin span.mce_search {background-position:-520px -20px} -.o2k7Skin span.mce_styleprops {background-position:-560px -20px} -.o2k7Skin span.mce_table {background-position:-580px -20px} -.o2k7Skin span.mce_cell_props {background-position:-600px -20px} -.o2k7Skin span.mce_delete_table {background-position:-620px -20px} -.o2k7Skin span.mce_delete_col {background-position:-640px -20px} -.o2k7Skin span.mce_delete_row {background-position:-660px -20px} -.o2k7Skin span.mce_col_after {background-position:-680px -20px} -.o2k7Skin span.mce_col_before {background-position:-700px -20px} -.o2k7Skin span.mce_row_after {background-position:-720px -20px} -.o2k7Skin span.mce_row_before {background-position:-740px -20px} -.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} -.o2k7Skin span.mce_table_props {background-position:-980px -20px} -.o2k7Skin span.mce_row_props {background-position:-780px -20px} -.o2k7Skin span.mce_split_cells {background-position:-800px -20px} -.o2k7Skin span.mce_template {background-position:-820px -20px} -.o2k7Skin span.mce_visualchars {background-position:-840px -20px} -.o2k7Skin span.mce_abbr {background-position:-860px -20px} -.o2k7Skin span.mce_acronym {background-position:-880px -20px} -.o2k7Skin span.mce_attribs {background-position:-900px -20px} -.o2k7Skin span.mce_cite {background-position:-920px -20px} -.o2k7Skin span.mce_del {background-position:-940px -20px} -.o2k7Skin span.mce_ins {background-position:-960px -20px} -.o2k7Skin span.mce_pagebreak {background-position:0 -40px} -.o2k7Skin span.mce_restoredraft {background-position:-20px -40px} -.o2k7Skin span.mce_spellchecker {background-position:-540px -20px} +/* Reset */ +.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left} +.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000} +.o2k7Skin table td {vertical-align:middle} + +/* Containers */ +.o2k7Skin table {background:transparent} +.o2k7Skin iframe {display:block;} +.o2k7Skin .mceToolbar {height:26px} + +/* External */ +.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none} +.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;} +.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0} + +/* Layout */ +.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD} +.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD} +.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0} +.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD} +.o2k7Skin td.mceToolbar{background:#E5EFFD} +.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px} +.o2k7Skin .mceStatusbar div {float:left; padding:2px} +.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0} +.o2k7Skin .mceStatusbar a:hover {text-decoration:underline} +.o2k7Skin table.mceToolbar {margin-left:3px} +.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;} +.o2k7Skin .mceToolbar td.mceFirst span {margin:0} +.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px} +.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none} +.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px} +.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px} +.o2k7Skin td.mceCenter {text-align:center;} +.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;} +.o2k7Skin td.mceRight table {margin:0 0 0 auto;} + +/* Button */ +.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px} +.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px} +.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px} +.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px} +.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px} +.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceButtonLabeled {width:auto} +.o2k7Skin .mceButtonLabeled span.mceIcon {float:left} +.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica} +.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888} + +/* Separator */ +.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px} + +/* ListBox */ +.o2k7Skin .mceListBox {margin-left:3px} +.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block} +.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden} +.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0} +.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF} +.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px} +.o2k7Skin .mceListBoxDisabled .mceText {color:gray} +.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden} +.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px} +.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;} + +/* SplitButton */ +.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr} +.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)} +.o2k7Skin .mceSplitButton a.mceAction {width:22px} +.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)} +.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0} +.o2k7Skin .mceSplitButton span.mceOpen {display:none} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px} +.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px} +.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)} +.o2k7Skin .mceSplitButtonActive {background-position:0 -44px} + +/* ColorSplitButton */ +.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray} +.o2k7Skin .mceColorSplitMenu td {padding:2px} +.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080} +.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF} +.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2} +.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A} +.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden} +.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden} + +/* Menu */ +.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD} +.o2k7Skin .mceNoIcons span.mceIcon {width:0;} +.o2k7Skin .mceNoIcons a .mceText {padding-left:10px} +.o2k7Skin .mceMenu table {background:#FFF} +.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block} +.o2k7Skin .mceMenu td {height:20px} +.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0} +.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block} +.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px} +.o2k7Skin .mceMenu pre.mceText {font-family:Monospace} +.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;} +.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3} +.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px} +.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD} +.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px} +.o2k7Skin .mceMenuItemDisabled .mceText {color:#888} +.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)} +.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center} +.o2k7Skin .mceMenu span.mceMenuLine {display:none} +.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;} + +/* Progress,Resize */ +.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF} +.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px} + +/* Formats */ +.o2k7Skin .mce_formatPreview a {font-size:10px} +.o2k7Skin .mce_p span.mceText {} +.o2k7Skin .mce_address span.mceText {font-style:italic} +.o2k7Skin .mce_pre span.mceText {font-family:monospace} +.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em} +.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em} +.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em} +.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em} +.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em} +.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em} + +/* Theme */ +.o2k7Skin span.mce_bold {background-position:0 0} +.o2k7Skin span.mce_italic {background-position:-60px 0} +.o2k7Skin span.mce_underline {background-position:-140px 0} +.o2k7Skin span.mce_strikethrough {background-position:-120px 0} +.o2k7Skin span.mce_undo {background-position:-160px 0} +.o2k7Skin span.mce_redo {background-position:-100px 0} +.o2k7Skin span.mce_cleanup {background-position:-40px 0} +.o2k7Skin span.mce_bullist {background-position:-20px 0} +.o2k7Skin span.mce_numlist {background-position:-80px 0} +.o2k7Skin span.mce_justifyleft {background-position:-460px 0} +.o2k7Skin span.mce_justifyright {background-position:-480px 0} +.o2k7Skin span.mce_justifycenter {background-position:-420px 0} +.o2k7Skin span.mce_justifyfull {background-position:-440px 0} +.o2k7Skin span.mce_anchor {background-position:-200px 0} +.o2k7Skin span.mce_indent {background-position:-400px 0} +.o2k7Skin span.mce_outdent {background-position:-540px 0} +.o2k7Skin span.mce_link {background-position:-500px 0} +.o2k7Skin span.mce_unlink {background-position:-640px 0} +.o2k7Skin span.mce_sub {background-position:-600px 0} +.o2k7Skin span.mce_sup {background-position:-620px 0} +.o2k7Skin span.mce_removeformat {background-position:-580px 0} +.o2k7Skin span.mce_newdocument {background-position:-520px 0} +.o2k7Skin span.mce_image {background-position:-380px 0} +.o2k7Skin span.mce_help {background-position:-340px 0} +.o2k7Skin span.mce_code {background-position:-260px 0} +.o2k7Skin span.mce_hr {background-position:-360px 0} +.o2k7Skin span.mce_visualaid {background-position:-660px 0} +.o2k7Skin span.mce_charmap {background-position:-240px 0} +.o2k7Skin span.mce_paste {background-position:-560px 0} +.o2k7Skin span.mce_copy {background-position:-700px 0} +.o2k7Skin span.mce_cut {background-position:-680px 0} +.o2k7Skin span.mce_blockquote {background-position:-220px 0} +.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0} +.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0} +.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0} +.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0} + +/* Plugins */ +.o2k7Skin span.mce_advhr {background-position:-0px -20px} +.o2k7Skin span.mce_ltr {background-position:-20px -20px} +.o2k7Skin span.mce_rtl {background-position:-40px -20px} +.o2k7Skin span.mce_emotions {background-position:-60px -20px} +.o2k7Skin span.mce_fullpage {background-position:-80px -20px} +.o2k7Skin span.mce_fullscreen {background-position:-100px -20px} +.o2k7Skin span.mce_iespell {background-position:-120px -20px} +.o2k7Skin span.mce_insertdate {background-position:-140px -20px} +.o2k7Skin span.mce_inserttime {background-position:-160px -20px} +.o2k7Skin span.mce_absolute {background-position:-180px -20px} +.o2k7Skin span.mce_backward {background-position:-200px -20px} +.o2k7Skin span.mce_forward {background-position:-220px -20px} +.o2k7Skin span.mce_insert_layer {background-position:-240px -20px} +.o2k7Skin span.mce_insertlayer {background-position:-260px -20px} +.o2k7Skin span.mce_movebackward {background-position:-280px -20px} +.o2k7Skin span.mce_moveforward {background-position:-300px -20px} +.o2k7Skin span.mce_media {background-position:-320px -20px} +.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px} +.o2k7Skin span.mce_pastetext {background-position:-360px -20px} +.o2k7Skin span.mce_pasteword {background-position:-380px -20px} +.o2k7Skin span.mce_selectall {background-position:-400px -20px} +.o2k7Skin span.mce_preview {background-position:-420px -20px} +.o2k7Skin span.mce_print {background-position:-440px -20px} +.o2k7Skin span.mce_cancel {background-position:-460px -20px} +.o2k7Skin span.mce_save {background-position:-480px -20px} +.o2k7Skin span.mce_replace {background-position:-500px -20px} +.o2k7Skin span.mce_search {background-position:-520px -20px} +.o2k7Skin span.mce_styleprops {background-position:-560px -20px} +.o2k7Skin span.mce_table {background-position:-580px -20px} +.o2k7Skin span.mce_cell_props {background-position:-600px -20px} +.o2k7Skin span.mce_delete_table {background-position:-620px -20px} +.o2k7Skin span.mce_delete_col {background-position:-640px -20px} +.o2k7Skin span.mce_delete_row {background-position:-660px -20px} +.o2k7Skin span.mce_col_after {background-position:-680px -20px} +.o2k7Skin span.mce_col_before {background-position:-700px -20px} +.o2k7Skin span.mce_row_after {background-position:-720px -20px} +.o2k7Skin span.mce_row_before {background-position:-740px -20px} +.o2k7Skin span.mce_merge_cells {background-position:-760px -20px} +.o2k7Skin span.mce_table_props {background-position:-980px -20px} +.o2k7Skin span.mce_row_props {background-position:-780px -20px} +.o2k7Skin span.mce_split_cells {background-position:-800px -20px} +.o2k7Skin span.mce_template {background-position:-820px -20px} +.o2k7Skin span.mce_visualchars {background-position:-840px -20px} +.o2k7Skin span.mce_abbr {background-position:-860px -20px} +.o2k7Skin span.mce_acronym {background-position:-880px -20px} +.o2k7Skin span.mce_attribs {background-position:-900px -20px} +.o2k7Skin span.mce_cite {background-position:-920px -20px} +.o2k7Skin span.mce_del {background-position:-940px -20px} +.o2k7Skin span.mce_ins {background-position:-960px -20px} +.o2k7Skin span.mce_pagebreak {background-position:0 -40px} +.o2k7Skin span.mce_restoredraft {background-position:-20px -40px} +.o2k7Skin span.mce_spellchecker {background-position:-540px -20px} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css index 50c9b76..85812cd 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css @@ -1,8 +1,8 @@ -/* Black */ -.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} -.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} -.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} -.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} -.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} -.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} +/* Black */ +.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)} +.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF} +.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0} +.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0} +.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;} +.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)} .o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1} \ No newline at end of file diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css index 960a8e4..d64c361 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css @@ -1,5 +1,5 @@ -/* Silver */ -.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} -.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} -.o2k7SkinSilver .mceListBox .mceText {background:#FFF} -.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} +/* Silver */ +.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)} +.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee} +.o2k7SkinSilver .mceListBox .mceText {background:#FFF} +.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb} diff --git a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/source_editor.htm b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/source_editor.htm index 3c6d658..d3f75d6 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/source_editor.htm +++ b/functions/tinyMCE/jscripts/tiny_mce/themes/advanced/source_editor.htm @@ -1,25 +1,25 @@ - - - {#advanced_dlg.code_title} - - - - -
-
- -
- -
- -
- - - -
- - -
-
- - + + + {#advanced_dlg.code_title} + + + + +
+
+ +
+ +
+ +
+ + + +
+ + +
+
+ + diff --git a/functions/tinyMCE/jscripts/tiny_mce/utils/editable_selects.js b/functions/tinyMCE/jscripts/tiny_mce/utils/editable_selects.js index fd943c0..6cf1b16 100644 --- a/functions/tinyMCE/jscripts/tiny_mce/utils/editable_selects.js +++ b/functions/tinyMCE/jscripts/tiny_mce/utils/editable_selects.js @@ -1,70 +1,70 @@ -/** - * editable_selects.js - * - * Copyright 2009, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://tinymce.moxiecode.com/license - * Contributing: http://tinymce.moxiecode.com/contributing - */ - -var TinyMCE_EditableSelects = { - editSelectElm : null, - - init : function() { - var nl = document.getElementsByTagName("select"), i, d = document, o; - - for (i=0; i'; - h += ' '; - - return h; -} - -function updateColor(img_id, form_element_id) { - document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; -} - -function setBrowserDisabled(id, state) { - var img = document.getElementById(id); - var lnk = document.getElementById(id + "_link"); - - if (lnk) { - if (state) { - lnk.setAttribute("realhref", lnk.getAttribute("href")); - lnk.removeAttribute("href"); - tinyMCEPopup.dom.addClass(img, 'disabled'); - } else { - if (lnk.getAttribute("realhref")) - lnk.setAttribute("href", lnk.getAttribute("realhref")); - - tinyMCEPopup.dom.removeClass(img, 'disabled'); - } - } -} - -function getBrowserHTML(id, target_form_element, type, prefix) { - var option = prefix + "_" + type + "_browser_callback", cb, html; - - cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); - - if (!cb) - return ""; - - html = ""; - html += ''; - html += ' '; - - return html; -} - -function openBrowser(img_id, target_form_element, type, option) { - var img = document.getElementById(img_id); - - if (img.className != "mceButtonDisabled") - tinyMCEPopup.openBrowser(target_form_element, type, option); -} - -function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { - if (!form_obj || !form_obj.elements[field_name]) - return; - - if (!value) - value = ""; - - var sel = form_obj.elements[field_name]; - - var found = false; - for (var i=0; i'; + h += ' '; + + return h; +} + +function updateColor(img_id, form_element_id) { + document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; +} + +function setBrowserDisabled(id, state) { + var img = document.getElementById(id); + var lnk = document.getElementById(id + "_link"); + + if (lnk) { + if (state) { + lnk.setAttribute("realhref", lnk.getAttribute("href")); + lnk.removeAttribute("href"); + tinyMCEPopup.dom.addClass(img, 'disabled'); + } else { + if (lnk.getAttribute("realhref")) + lnk.setAttribute("href", lnk.getAttribute("realhref")); + + tinyMCEPopup.dom.removeClass(img, 'disabled'); + } + } +} + +function getBrowserHTML(id, target_form_element, type, prefix) { + var option = prefix + "_" + type + "_browser_callback", cb, html; + + cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); + + if (!cb) + return ""; + + html = ""; + html += ''; + html += ' '; + + return html; +} + +function openBrowser(img_id, target_form_element, type, option) { + var img = document.getElementById(img_id); + + if (img.className != "mceButtonDisabled") + tinyMCEPopup.openBrowser(target_form_element, type, option); +} + +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { + if (!form_obj || !form_obj.elements[field_name]) + return; + + if (!value) + value = ""; + + var sel = form_obj.elements[field_name]; + + var found = false; + for (var i=0; i parseInt(v)) - st = this.mark(f, n); - } - } - - return st; - }, - - hasClass : function(n, c, d) { - return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); - }, - - getNum : function(n, c) { - c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; - c = c.replace(/[^0-9]/g, ''); - - return c; - }, - - addClass : function(n, c, b) { - var o = this.removeClass(n, c); - n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; - }, - - removeClass : function(n, c) { - c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); - return n.className = c != ' ' ? c : ''; - }, - - tags : function(f, s) { - return f.getElementsByTagName(s); - }, - - mark : function(f, n) { - var s = this.settings; - - this.addClass(n, s.invalid_cls); - n.setAttribute('aria-invalid', 'true'); - this.markLabels(f, n, s.invalid_cls); - - return false; - }, - - markLabels : function(f, n, ic) { - var nl, i; - - nl = this.tags(f, "label"); - for (i=0; i parseInt(v)) + st = this.mark(f, n); + } + } + + return st; + }, + + hasClass : function(n, c, d) { + return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); + }, + + getNum : function(n, c) { + c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; + c = c.replace(/[^0-9]/g, ''); + + return c; + }, + + addClass : function(n, c, b) { + var o = this.removeClass(n, c); + n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; + }, + + removeClass : function(n, c) { + c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); + return n.className = c != ' ' ? c : ''; + }, + + tags : function(f, s) { + return f.getElementsByTagName(s); + }, + + mark : function(f, n) { + var s = this.settings; + + this.addClass(n, s.invalid_cls); + n.setAttribute('aria-invalid', 'true'); + this.markLabels(f, n, s.invalid_cls); + + return false; + }, + + markLabels : function(f, n, ic) { + var nl, i; + + nl = this.tags(f, "label"); + for (i=0; i$languagename) { - if ($languagetosearch==$languagename['description']) { - return $key2; +function getLanguageCodefromLanguage($languagetosearch) +{ + $strReturn = 'en_GB'; + $detaillanguages = getLanguageData(); + /** @noinspection ForeachSourceInspection */ + foreach ($detaillanguages as $key2 => $languagename) { + if ($languagetosearch == $languagename['description']) { + $strReturn = $key2; + } } - } - // else return default en code - return "en_GB"; + // else return default en code + return $strReturn; } -function getLanguageNameFromCode($codetosearch, $withnative=true) { - $detaillanguages = getLanguageData(); - if (isset($detaillanguages[$codetosearch]['description'])) { - if ($withnative) { - return $detaillanguages[$codetosearch]['description'].' - '.$detaillanguages[$codetosearch]['nativedescription']; - } else { - return $detaillanguages[$codetosearch]['description'];} - } else { - // else return false - return false; - } +function getLanguageNameFromCode($codetosearch, $withnative = true) +{ + $strReturn = false; + $detaillanguages = getLanguageData(); + if (isset($detaillanguages[$codetosearch]['description'])) { + if ($withnative) { + $strReturn = $detaillanguages[$codetosearch]['description'].' - '. + $detaillanguages[$codetosearch]['nativedescription']; + } else { + $strReturn = $detaillanguages[$codetosearch]['description']; + } + } + return $strReturn; } -function getLanguageData() { - unset($supportedLanguages); - // English - $supportedLanguages['en_GB']['description'] = translate('English'); - $supportedLanguages['en_GB']['nativedescription'] = 'English'; +function getLanguageData() +{ + unset($supportedLanguages); + // English + $supportedLanguages['en_GB']['description'] = translate('English'); + $supportedLanguages['en_GB']['nativedescription'] = 'English'; - // German - $supportedLanguages['de_DE']['description'] = translate('German'); - $supportedLanguages['de_DE']['nativedescription'] = 'Deutsch'; + // German + $supportedLanguages['de_DE']['description'] = translate('German'); + $supportedLanguages['de_DE']['nativedescription'] = 'Deutsch'; - // Chinese (Simplified) - $supportedLanguages['zh_CN']['description'] = translate('Chinese (Simplified)'); - $supportedLanguages['zh_CN']['nativedescription'] = '简体中文'; + // Chinese (Simplified) + $supportedLanguages['zh_CN']['description'] = translate('Chinese (Simplified)'); + $supportedLanguages['zh_CN']['nativedescription'] = '简体中文'; - // Italian - $supportedLanguages['it_IT']['description'] = translate('Italian'); - $supportedLanguages['it_IT']['nativedescription'] = 'Italiano'; + // Italian + $supportedLanguages['it_IT']['description'] = translate('Italian'); + $supportedLanguages['it_IT']['nativedescription'] = 'Italiano'; - // French - $supportedLanguages['fr_FR']['description'] = translate('French'); - $supportedLanguages['fr_FR']['nativedescription'] = 'Français'; + // French + $supportedLanguages['fr_FR']['description'] = translate('French'); + $supportedLanguages['fr_FR']['nativedescription'] = 'Français'; - // Russian - $supportedLanguages['ru_RU']['description'] = translate('Russian'); - $supportedLanguages['ru_RU']['nativedescription'] = 'Русский'; + // Russian + $supportedLanguages['ru_RU']['description'] = translate('Russian'); + $supportedLanguages['ru_RU']['nativedescription'] = 'Русский'; - // Spanish - $supportedLanguages['es_ES']['description'] = translate('Spanish'); - $supportedLanguages['es_ES']['nativedescription'] = 'Español'; + // Spanish + $supportedLanguages['es_ES']['description'] = translate('Spanish'); + $supportedLanguages['es_ES']['nativedescription'] = 'Español'; - // Brazilian Portuguese - $supportedLanguages['pt_BR']['description'] = translate('Portuguese (Brazilian)'); - $supportedLanguages['pt_BR']['nativedescription'] = 'Português do Brasil'; + // Brazilian Portuguese + $supportedLanguages['pt_BR']['description'] = translate('Portuguese (Brazilian)'); + $supportedLanguages['pt_BR']['nativedescription'] = 'Português do Brasil'; - // Dutch - $supportedLanguages['nl_NL']['description'] = translate('Dutch'); - $supportedLanguages['nl_NL']['nativedescription'] = 'Nederlands'; + // Dutch + $supportedLanguages['nl_NL']['description'] = translate('Dutch'); + $supportedLanguages['nl_NL']['nativedescription'] = 'Nederlands'; - // Danish - $supportedLanguages['da_DK']['description'] = translate('Danish'); - $supportedLanguages['da_DK']['nativedescription'] = 'Dansk'; + // Danish + $supportedLanguages['da_DK']['description'] = translate('Danish'); + $supportedLanguages['da_DK']['nativedescription'] = 'Dansk'; - // No longer supported language because of missing translators - // - // // Japanese - // $supportedLanguages['ja_JP']['description'] = translate('Japanese'); - // $supportedLanguages['ja_JP']['nativedescription'] = '日本語'; - // - // // Polish - // $supportedLanguages['pl_PL']['description'] = translate('Polish'); - // $supportedLanguages['pl_PL']['nativedescription'] = 'Polski'; - // - // // Spanish (Argentina) - // $supportedLanguages['es_AR']['description'] = translate('Spanish (Argentina)'); - // $supportedLanguages['es_AR']['nativedescription'] = 'Español Argentina'; - /// - /// Currently not supported languages - // - // // Albanian - // $supportedLanguages['sq']['description'] = $clang->translate('Albanian'); - // $supportedLanguages['sq']['nativedescription'] = 'Shqipe'; - // - // // Basque - // $supportedLanguages['eu']['description'] = translate('Basque'); - // $supportedLanguages['eu']['nativedescription'] = 'Euskara'; - // - // // Bosnian - // $supportedLanguages['bs']['description'] = translate('Bosnian'); - // $supportedLanguages['bs']['nativedescription'] = 'Български'; - // - // // Bulgarian - // $supportedLanguages['bg']['description'] = translate('Bulgarian'); - // $supportedLanguages['bg']['nativedescription'] = 'Български'; - // - // // Catalan - // $supportedLanguages['ca']['description'] = translate('Catalan'); - // $supportedLanguages['ca']['nativedescription'] = 'Catalά'; - // - // // Welsh - // $supportedLanguages['cy']['description'] = translate('Welsh'); - // $supportedLanguages['cy']['nativedescription'] = 'Cymraeg'; - // - // // Chinese (Traditional - Hong Kong) - // $supportedLanguages['zh-Hant-HK']['description'] = translate('Chinese (Traditional - Hong Kong)'); - // $supportedLanguages['zh-Hant-HK']['nativedescription'] = '繁體中文語系'; - // - // // Chinese (Traditional - Taiwan) - // $supportedLanguages['zh-Hant-TW']['description'] = translate('Chinese (Traditional - Taiwan)'); - // $supportedLanguages['zh-Hant-TW']['nativedescription'] = 'Chinese (Traditional - Taiwan)'; - // - // // Croatian - // $supportedLanguages['hr']['description'] = translate('Croatian'); - // $supportedLanguages['hr']['nativedescription'] = 'Hrvatski'; - // - // // Czech - // $supportedLanguages['cs']['description'] = translate('Czech'); - // $supportedLanguages['cs']['nativedescription'] = 'Česky'; - // - // - // // Estonian - // $supportedLanguages['et']['description'] = translate('Estonian'); - // $supportedLanguages['et']['nativedescription'] = 'Eesti'; - // - // // Finnish - // $supportedLanguages['fi']['description'] = translate('Finnish'); - // $supportedLanguages['fi']['nativedescription'] = 'Suomi'; - // - // // Galician - // $supportedLanguages['gl']['description'] = translate('Galician'); - // $supportedLanguages['gl']['nativedescription'] = 'Galego'; - // - // // German informal - // $supportedLanguages['de-informal']['description'] = translate('German informal'); - // $supportedLanguages['de-informal']['nativedescription'] = 'Deutsch (Du)'; - // - // // Greek - // $supportedLanguages['el']['description'] = translate('Greek'); - // $supportedLanguages['el']['nativedescription'] = 'ελληνικά'; - // - // // Hebrew - // $supportedLanguages['he']['description'] = translate('Hebrew'); - // $supportedLanguages['he']['nativedescription'] = ' עברית'; - // - // // Hungarian - // $supportedLanguages['hu']['description'] = translate('Hungarian'); - // $supportedLanguages['hu']['nativedescription'] = 'Magyar'; - // - // // Indonesian - // $supportedLanguages['id']['description'] = translate('Indonesian'); - // $supportedLanguages['id']['nativedescription'] = 'Bahasa Indonesia'; - // - // - // // Lithuanian - // $supportedLanguages['lt']['description'] = translate('Lithuanian'); - // $supportedLanguages['lt']['nativedescription'] = 'Lietuvių'; - // - // // Macedonian - // $supportedLanguages['mk']['description'] = translate('Macedonian'); - // $supportedLanguages['mk']['nativedescription'] = 'Македонски'; - // - // // Norwegian Bokml - // $supportedLanguages['nb']['description'] = translate('Norwegian (Bokmal)'); - // $supportedLanguages['nb']['nativedescription'] = 'Norsk Bokmål'; - // - // // Norwegian Nynorsk - // $supportedLanguages['nn']['description'] = translate('Norwegian (Nynorsk)'); - // $supportedLanguages['nn']['nativedescription'] = 'Norsk Nynorsk'; - // - // // Portuguese - // $supportedLanguages['pt']['description'] = translate('Portuguese'); - // $supportedLanguages['pt']['nativedescription'] = 'Português'; - // - // // Romanian - // $supportedLanguages['ro']['description'] = translate('Romanian'); - // $supportedLanguages['ro']['nativedescription'] = 'Românesc'; - // - // // Slovak - // $supportedLanguages['sk']['description'] = translate('Slovak'); - // $supportedLanguages['sk']['nativedescription'] = 'Slovák'; - // - // // Slovenian - // $supportedLanguages['sl']['description'] = translate('Slovenian'); - // $supportedLanguages['sl']['nativedescription'] = 'Slovenščina'; - // - // // Serbian - // $supportedLanguages['sr']['description'] = translate('Serbian'); - // $supportedLanguages['sr']['nativedescription'] = 'Srpski'; - // - // // Spanish (Mexico) - // $supportedLanguages['es-MX']['description'] = translate('Spanish (Mexico)'); - // $supportedLanguages['es-MX']['nativedescription'] = 'Español Mejicano'; - // - // // Swedish - // $supportedLanguages['sv']['description'] = translate('Swedish'); - // $supportedLanguages['sv']['nativedescription'] = 'Svenska'; - // - // // Turkish - // $supportedLanguages['tr']['description'] = translate('Turkish'); - // $supportedLanguages['tr']['nativedescription'] = 'Türkçe'; - // - // // Thai - // $supportedLanguages['th']['description'] = translate('Thai'); - // $supportedLanguages['th']['nativedescription'] = 'ภาษาไทย'; - // - // // Vietnamese - // $supportedLanguages['vi']['description'] = translate('Vietnamese'); - // $supportedLanguages['vi']['nativedescription'] = 'Tiếng Việt'; + // No longer supported language because of missing translators + // + // // Japanese + // $supportedLanguages['ja_JP']['description'] = translate('Japanese'); + // $supportedLanguages['ja_JP']['nativedescription'] = '日本語'; + // + // // Polish + // $supportedLanguages['pl_PL']['description'] = translate('Polish'); + // $supportedLanguages['pl_PL']['nativedescription'] = 'Polski'; + // + // // Spanish (Argentina) + // $supportedLanguages['es_AR']['description'] = translate('Spanish (Argentina)'); + // $supportedLanguages['es_AR']['nativedescription'] = 'Español Argentina'; + /// + /// Currently not supported languages + // + // // Albanian + // $supportedLanguages['sq']['description'] = $clang->translate('Albanian'); + // $supportedLanguages['sq']['nativedescription'] = 'Shqipe'; + // + // // Basque + // $supportedLanguages['eu']['description'] = translate('Basque'); + // $supportedLanguages['eu']['nativedescription'] = 'Euskara'; + // + // // Bosnian + // $supportedLanguages['bs']['description'] = translate('Bosnian'); + // $supportedLanguages['bs']['nativedescription'] = + // 'Български'; + // + // // Bulgarian + // $supportedLanguages['bg']['description'] = translate('Bulgarian'); + // $supportedLanguages['bg']['nativedescription'] = + // 'Български'; + // + // // Catalan + // $supportedLanguages['ca']['description'] = translate('Catalan'); + // $supportedLanguages['ca']['nativedescription'] = 'Catalά'; + // + // // Welsh + // $supportedLanguages['cy']['description'] = translate('Welsh'); + // $supportedLanguages['cy']['nativedescription'] = 'Cymraeg'; + // + // // Chinese (Traditional - Hong Kong) + // $supportedLanguages['zh-Hant-HK']['description'] = translate('Chinese (Traditional - Hong Kong)'); + // $supportedLanguages['zh-Hant-HK']['nativedescription'] = '繁體中文語系'; + // + // // Chinese (Traditional - Taiwan) + // $supportedLanguages['zh-Hant-TW']['description'] = translate('Chinese (Traditional - Taiwan)'); + // $supportedLanguages['zh-Hant-TW']['nativedescription'] = 'Chinese (Traditional - Taiwan)'; + // + // // Croatian + // $supportedLanguages['hr']['description'] = translate('Croatian'); + // $supportedLanguages['hr']['nativedescription'] = 'Hrvatski'; + // + // // Czech + // $supportedLanguages['cs']['description'] = translate('Czech'); + // $supportedLanguages['cs']['nativedescription'] = 'Česky'; + // + // + // // Estonian + // $supportedLanguages['et']['description'] = translate('Estonian'); + // $supportedLanguages['et']['nativedescription'] = 'Eesti'; + // + // // Finnish + // $supportedLanguages['fi']['description'] = translate('Finnish'); + // $supportedLanguages['fi']['nativedescription'] = 'Suomi'; + // + // // Galician + // $supportedLanguages['gl']['description'] = translate('Galician'); + // $supportedLanguages['gl']['nativedescription'] = 'Galego'; + // + // // German informal + // $supportedLanguages['de-informal']['description'] = translate('German informal'); + // $supportedLanguages['de-informal']['nativedescription'] = 'Deutsch (Du)'; + // + // // Greek + // $supportedLanguages['el']['description'] = translate('Greek'); + // $supportedLanguages['el']['nativedescription'] = 'ελληνικά'; + // + // // Hebrew + // $supportedLanguages['he']['description'] = translate('Hebrew'); + // $supportedLanguages['he']['nativedescription'] = ' עברית'; + // + // // Hungarian + // $supportedLanguages['hu']['description'] = translate('Hungarian'); + // $supportedLanguages['hu']['nativedescription'] = 'Magyar'; + // + // // Indonesian + // $supportedLanguages['id']['description'] = translate('Indonesian'); + // $supportedLanguages['id']['nativedescription'] = 'Bahasa Indonesia'; + // + // + // // Lithuanian + // $supportedLanguages['lt']['description'] = translate('Lithuanian'); + // $supportedLanguages['lt']['nativedescription'] = 'Lietuvių'; + // + // // Macedonian + // $supportedLanguages['mk']['description'] = translate('Macedonian'); + // $supportedLanguages['mk']['nativedescription'] = + // 'Македонски'; + // + // // Norwegian Bokml + // $supportedLanguages['nb']['description'] = translate('Norwegian (Bokmal)'); + // $supportedLanguages['nb']['nativedescription'] = 'Norsk Bokmål'; + // + // // Norwegian Nynorsk + // $supportedLanguages['nn']['description'] = translate('Norwegian (Nynorsk)'); + // $supportedLanguages['nn']['nativedescription'] = 'Norsk Nynorsk'; + // + // // Portuguese + // $supportedLanguages['pt']['description'] = translate('Portuguese'); + // $supportedLanguages['pt']['nativedescription'] = 'Português'; + // + // // Romanian + // $supportedLanguages['ro']['description'] = translate('Romanian'); + // $supportedLanguages['ro']['nativedescription'] = 'Românesc'; + // + // // Slovak + // $supportedLanguages['sk']['description'] = translate('Slovak'); + // $supportedLanguages['sk']['nativedescription'] = 'Slovák'; + // + // // Slovenian + // $supportedLanguages['sl']['description'] = translate('Slovenian'); + // $supportedLanguages['sl']['nativedescription'] = 'Slovenščina'; + // + // // Serbian + // $supportedLanguages['sr']['description'] = translate('Serbian'); + // $supportedLanguages['sr']['nativedescription'] = 'Srpski'; + // + // // Spanish (Mexico) + // $supportedLanguages['es-MX']['description'] = translate('Spanish (Mexico)'); + // $supportedLanguages['es-MX']['nativedescription'] = 'Español Mejicano'; + // + // // Swedish + // $supportedLanguages['sv']['description'] = translate('Swedish'); + // $supportedLanguages['sv']['nativedescription'] = 'Svenska'; + // + // // Turkish + // $supportedLanguages['tr']['description'] = translate('Turkish'); + // $supportedLanguages['tr']['nativedescription'] = 'Türkçe'; + // + // // Thai + // $supportedLanguages['th']['description'] = translate('Thai'); + // $supportedLanguages['th']['nativedescription'] = 'ภาษาไทย'; + // + // // Vietnamese + // $supportedLanguages['vi']['description'] = translate('Vietnamese'); + // $supportedLanguages['vi']['nativedescription'] = 'Tiếng Việt'; - uasort($supportedLanguages,"user_sort"); - Return $supportedLanguages; + uasort($supportedLanguages, 'user_sort'); + return $supportedLanguages; } -function user_sort($a, $b) { - // smarts is all-important, so sort it first - if($a['description'] >$b['description']) { - return 1; - } else { - return -1; - } +function user_sort($intValue1, $intValue2) +{ + $intReturn = -1; + // smarts is all-important, so sort it first + if ($intValue1['description'] > $intValue2['description']) { + $intReturn = 1; + } + return $intReturn; } -?> \ No newline at end of file diff --git a/functions/yui/build/element/element-beta-min.js b/functions/yui/build/element/element-beta-min.js new file mode 100644 index 0000000..443bca7 --- /dev/null +++ b/functions/yui/build/element/element-beta-min.js @@ -0,0 +1,8 @@ +/* +Copyright (c) 2008, Yahoo! Inc. All rights reserved. +Code licensed under the BSD License: +http://developer.yahoo.net/yui/license.txt +version: 2.5.1 +*/ +YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(F,B){var E;var A=this.owner;var C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(A,F)){return false;}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false;}}if(this.method){this.method.call(A,F);}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D);}return true;},configure:function(B,C){B=B||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var A in B){if(A&&YAHOO.lang.hasOwnProperty(B,A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(A){this.setValue(this.value,A);}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B){return undefined;}return B.value;},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false;}return C.setValue(E,B);},getAttributeKeys:function(){this._configs=this._configs;var D=[];var B;for(var C in this._configs){B=this._configs[C];if(A.hasOwnProperty(this._configs,C)&&!A.isUndefined(B)){D[D.length]=C;}}return D;},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B);}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true;}return false;},refresh:function(E,C){this._configs=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;DsetVariable("TITLE",translate('Welcome to')); -$conttp->setVariable("TITLE_LOGIN",translate('Welcome')); -$conttp->setVariable("LOGIN_TEXT",translate('Please enter your username and password to access NagiosQL.
If you forgot one of them, please contact your Administrator.')); -$conttp->setVariable("USERNAME",translate('Username')); -$conttp->setVariable("PASSWORD",translate('Password')); -$conttp->setVariable("LOGIN",translate('Login')); -if (isset($_SESSION['strLoginMessage']) && ($_SESSION['strLoginMessage'] != "")) { - $conttp->setVariable("MESSAGE",$_SESSION['strLoginMessage']); +$conttp->setVariable('TITLE', translate('Welcome to')); +$conttp->setVariable('TITLE_LOGIN', translate('Welcome')); +$conttp->setVariable('LOGIN_TEXT', translate('Please enter your username and password to access NagiosQL.
If ' + . 'you forgot one of them, please contact your Administrator.')); +$conttp->setVariable('USERNAME', translate('Username')); +$conttp->setVariable('PASSWORD', translate('Password')); +$conttp->setVariable('LOGIN', translate('Login')); +if (isset($_SESSION['strLoginMessage']) && ($_SESSION['strLoginMessage'] != '')) { + $conttp->setVariable('MESSAGE', $_SESSION['strLoginMessage']); } else { - $conttp->setVariable("MESSAGE"," "); + $conttp->setVariable('MESSAGE', ' '); } -$conttp->setVariable("ACTION_INSERT",filter_var($_SERVER['PHP_SELF'], FILTER_SANITIZE_STRING)); -$conttp->setVariable("IMAGE_PATH","images/"); -$conttp->parse("main"); -$conttp->show("main"); +$conttp->setVariable('ACTION_INSERT', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$conttp->setVariable('IMAGE_PATH', 'images/'); +$conttp->parse('main'); +$conttp->show('main'); // // Include footer // ============== -$maintp->setVariable("VERSION_INFO","NagiosQL $setFileVersion"); -$maintp->parse("footer"); -$maintp->show("footer"); -?> \ No newline at end of file +$maintp->setVariable('VERSION_INFO', "NagiosQL $setFileVersion"); +$maintp->parse('footer'); +$maintp->show('footer'); diff --git a/install/css/install.css b/install/css/install.css index f98cc6c..accd66a 100644 --- a/install/css/install.css +++ b/install/css/install.css @@ -8,13 +8,11 @@ /* /********************************************** /* -/* Project : NagiosQL -/* Component: Installer CSS -/* Website : http://www.nagiosql.org -/* Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -/* Author : $LastChangedBy: martin $ -/* Version : 3.3.0 -/* Revision : $LastChangedRevision: 2 $ +/* Project : NagiosQL +/* Component : Installer CSS +/* Website : https://sourceforge.net/projects/nagiosql/ +/* Version : 3.4.0 +/* GIT Repo : https://gitlab.com/wizonet/NagiosQL /* /**********************************************/ @@ -41,7 +39,7 @@ body { min-width: 740px; max-width: 80em; margin: 0 auto; - border: 0px #889 solid; + border: 0 #889 solid; text-align:left; } @@ -119,7 +117,7 @@ body { color: #FFFFFF; text-align: center; font-weight: bold; - padding: 0px 0 0 0; + padding: 0 0 0 0; } .step1_active a, @@ -131,16 +129,6 @@ body { color: #FFFFFF; } -.step1_deactive { - background: url(../images/step1_deactive.png) no-repeat; - height: 75px; - width: 150px; - color: #FFFFFF; - text-align: center; - font-weight: bold; - padding: 0px 0 0 0; - } - .step2_active { background: url(../images/step2_active.png) no-repeat; height: 75px; @@ -148,17 +136,7 @@ body { color: #FFFFFF; text-align: center; font-weight: bold; - padding: 0px 0 0 0; - } - -.step2_deactive { - background: url(../images/step2_deactive.png) no-repeat; - height: 75px; - width: 150px; - color: #FFFFFF; - text-align: center; - font-weight: bold; - padding: 0px 0 0 0; + padding: 0 0 0 0; } .step3_active { @@ -168,17 +146,7 @@ body { color: #FFFFFF; text-align: center; font-weight: bold; - padding: 0px 0 0 0; - } - -.step3_deactive { - background: url(../images/step3_deactive.png) no-repeat; - height: 75px; - width: 150px; - color: #FFFFFF; - text-align: center; - font-weight: bold; - padding: 0px 0 0 0; + padding: 0 0 0 0; } .textmiddle { @@ -205,46 +173,18 @@ body { float: left; text-align: center; } - + +/*noinspection CssUnusedSymbol*/ #install-center { padding-left: 240px; } - -#install-button-index { - text-align:center; - position:relative; - } - - .button-index { - overflow: auto; - width: 40%; - text-align: center; - margin: 0 auto; - padding: 0px; - } - - .button-install { - float: left; - width: 100px; - padding: 5px; - width: 45%; - float: left; - } .button-update { - float: left; - width:100px; - padding: 5px; - width: 45%; float: right; - } - - .button-skip { width:100px; - text-align: center; - display: block; padding: 5px; } + /* Index */ #indexmain { @@ -252,7 +192,7 @@ body { } #indexmain_content { - padding: 0px 20px 10px 10px; + padding: 0 20px 10px 10px; z-index: 2; } @@ -334,26 +274,21 @@ h3 { color:#f2d409; } -.steps { - text-align: center; - } - .clear { overflow: hidden; width: 100%; } -.clearfix { - display: block; - } - #ie_clearing { display:none; } +/*noinspection CssUnusedSymbol*/ .showfield { } + +/*noinspection CssUnusedSymbol*/ .hidefield { display:none; } @@ -398,7 +333,7 @@ input[type=submit] { height:25px; padding-left:10px; padding-right:10px; - margin:0px; + margin:0; padding-bottom:2px; } input[type=submit][disabled] { @@ -410,7 +345,7 @@ input[type=submit][disabled] { height:25px; padding-left:10px; padding-right:10px; - margin:0px; + margin:0; padding-bottom:2px; } select.required { @@ -423,41 +358,9 @@ select.required { font-size:12px; height:22px; } -.validation-advice { - margin: 5px 0; - padding: 5px; - background-color: #FF3300; - color : #FFF; - font-weight: bold; -} /* Text Styles */ .hint { color: #666; font-size: 0.95em; } - -/* Tooltip */ -.yh_tt_div { - width: 200px; - background-color: #ffffff; - padding: 10px; - border: 1px solid #ff6600; -} - -.yh_tooltip { - font-size: 11px; - font-face: arial,helvetica,sans-serif; -} - -.tt_header { - position: relative; - width: 150px; - height: 19px; - background-image: url(../images/tip_header.gif); - margin-bottom: 3px; -} - -.tooltip { - display: none; -} \ No newline at end of file diff --git a/install/functions/NagInstallClass.php b/install/functions/NagInstallClass.php new file mode 100644 index 0000000..33173d5 --- /dev/null +++ b/install/functions/NagInstallClass.php @@ -0,0 +1,1106 @@ +arrSession = $arrSession; + } + + /** + * Parse template + * @param array $arrTemplate Array including template replacements + * @param string $strTplFile Template file + * @return mixed|string + */ + public function parseTemplate($arrTemplate, $strTplFile) + { + // Open template file + if (file_exists($strTplFile) && is_readable($strTplFile)) { + $strTemplate = ''; + $datTplFile = fopen($strTplFile, 'rb'); + while (!feof($datTplFile)) { + $strTemplate .= fgets($datTplFile); + } + foreach ($arrTemplate as $key => $elem) { + if (substr_count($strTemplate, '{' .$key. '}') != 0) { + $strTemplate = str_replace('{' .$key. '}', $elem, $strTemplate); + } + } + return $strTemplate; + } + echo $this->translate('Template file not found'). ': ' .$strTplFile; + return 0; + } + + /** + * Translate text + * @param string $strLangString String to translate + * @return string Translated string + */ + public function translate($strLangString) + { + $strTemp1 = gettext($strLangString); + return str_replace(array('"', "'"), array('"', '''), $strTemp1); + } + + /** + * Return supported languages + * @return array Array including supported languages + */ + public function getLangData() + { + $arrLangSupported = array(); + unset($arrLangSupported); + // English + $arrLangSupported['en_GB']['description'] = $this->translate('English'); + $arrLangSupported['en_GB']['nativedescription'] = 'English'; + + // German + $arrLangSupported['de_DE']['description'] = $this->translate('German'); + $arrLangSupported['de_DE']['nativedescription'] = 'Deutsch'; + + // Chinese (Simplified) + $arrLangSupported['zh_CN']['description'] = $this->translate('Chinese (Simplified)'); + $arrLangSupported['zh_CN']['nativedescription'] = '简体中文'; + + // Italian + $arrLangSupported['it_IT']['description'] = $this->translate('Italian'); + $arrLangSupported['it_IT']['nativedescription'] = 'Italiano'; + + // French + $arrLangSupported['fr_FR']['description'] = $this->translate('French'); + $arrLangSupported['fr_FR']['nativedescription'] = 'Français'; + + // Russian + $arrLangSupported['ru_RU']['description'] = $this->translate('Russian'); + $arrLangSupported['ru_RU']['nativedescription'] = 'Русский'; + + // Spanish + $arrLangSupported['es_ES']['description'] = $this->translate('Spanish'); + $arrLangSupported['es_ES']['nativedescription'] = 'Español'; + + // Brazilian Portuguese + $arrLangSupported['pt_BR']['description'] = $this->translate('Portuguese (Brazilian)'); + $arrLangSupported['pt_BR']['nativedescription'] = 'Português do Brasil'; + + // Dutch + $arrLangSupported['nl_NL']['description'] = $this->translate('Dutch'); + $arrLangSupported['nl_NL']['nativedescription'] = 'Nederlands'; + + // Danish + $arrLangSupported['da_DK']['description'] = $this->translate('Danish'); + $arrLangSupported['da_DK']['nativedescription'] = 'Dansk'; + + // No longer supported language due to missing translators + // + // // Japanese + // $arrLangSupported['ja_JP']['description'] = $this->translate('Japanese'); + // $arrLangSupported['ja_JP']['nativedescription'] = '日本語'; + // + // // Polish + // $arrLangSupported['pl_PL']['description'] = $this->translate('Polish'); + // $arrLangSupported['pl_PL']['nativedescription'] = 'Polski'; + // + // // Spanish (Argentina) + // $arrLangSupported['es_AR']['description'] = $this->translate('Spanish (Argentina)'); + // $arrLangSupported['es_AR']['nativedescription'] = 'Español Argentina'; + /// + /// Currently not supported languages + // + // // Albanian + // $arrLangSupported['sq']['description'] = $clang->$this->translate('Albanian'); + // $arrLangSupported['sq']['nativedescription'] = 'Shqipe'; + // + // // Basque + // $arrLangSupported['eu']['description'] = $this->translate('Basque'); + // $arrLangSupported['eu']['nativedescription'] = 'Euskara'; + // + // // Bosnian + // $arrLangSupported['bs']['description'] = $this->translate('Bosnian'); + // $arrLangSupported['bs']['nativedescription'] = + // 'Български'; + // + // // Bulgarian + // $arrLangSupported['bg']['description'] = $this->translate('Bulgarian'); + // $arrLangSupported['bg']['nativedescription'] = + // 'Български'; + // + // // Catalan + // $arrLangSupported['ca']['description'] = $this->translate('Catalan'); + // $arrLangSupported['ca']['nativedescription'] = 'Catalά'; + // + // // Welsh + // $arrLangSupported['cy']['description'] = $this->translate('Welsh'); + // $arrLangSupported['cy']['nativedescription'] = 'Cymraeg'; + // + // // Chinese (Traditional - Hong Kong) + // $arrLangSupported['zh-Hant-HK']['description'] = $this->translate('Chinese (Traditional - Hong Kong)'); + // $arrLangSupported['zh-Hant-HK']['nativedescription'] = '繁體中文語系'; + // + // // Chinese (Traditional - Taiwan) + // $arrLangSupported['zh-Hant-TW']['description'] = $this->translate('Chinese (Traditional - Taiwan)'); + // $arrLangSupported['zh-Hant-TW']['nativedescription'] = 'Chinese (Traditional - Taiwan)'; + // + // // Croatian + // $arrLangSupported['hr']['description'] = $this->translate('Croatian'); + // $arrLangSupported['hr']['nativedescription'] = 'Hrvatski'; + // + // // Czech + // $arrLangSupported['cs']['description'] = $this->translate('Czech'); + // $arrLangSupported['cs']['nativedescription'] = 'Česky'; + // + // // Estonian + // $arrLangSupported['et']['description'] = $this->translate('Estonian'); + // $arrLangSupported['et']['nativedescription'] = 'Eesti'; + // + // // Finnish + // $arrLangSupported['fi']['description'] = $this->translate('Finnish'); + // $arrLangSupported['fi']['nativedescription'] = 'Suomi'; + // + // // Galician + // $arrLangSupported['gl']['description'] = $this->translate('Galician'); + // $arrLangSupported['gl']['nativedescription'] = 'Galego'; + // + // // German informal + // $arrLangSupported['de-informal']['description'] = $this->translate('German informal'); + // $arrLangSupported['de-informal']['nativedescription'] = 'Deutsch (Du)'; + // + // // Greek + // $arrLangSupported['el']['description'] = $this->translate('Greek'); + // $arrLangSupported['el']['nativedescription'] = 'ελληνικά'; + // + // // Hebrew + // $arrLangSupported['he']['description'] = $this->translate('Hebrew'); + // $arrLangSupported['he']['nativedescription'] = ' עברית'; + // + // // Hungarian + // $arrLangSupported['hu']['description'] = $this->translate('Hungarian'); + // $arrLangSupported['hu']['nativedescription'] = 'Magyar'; + // + // // Indonesian + // $arrLangSupported['id']['description'] = $this->translate('Indonesian'); + // $arrLangSupported['id']['nativedescription'] = 'Bahasa Indonesia'; + // + // // Lithuanian + // $arrLangSupported['lt']['description'] = $this->translate('Lithuanian'); + // $arrLangSupported['lt']['nativedescription'] = 'Lietuvių'; + // + // // Macedonian + // $arrLangSupported['mk']['description'] = $this->translate('Macedonian'); + // $arrLangSupported['mk']['nativedescription'] = + // 'Македонски'; + // + // // Norwegian Bokml + // $arrLangSupported['nb']['description'] = $this->translate('Norwegian (Bokmal)'); + // $arrLangSupported['nb']['nativedescription'] = 'Norsk Bokmål'; + // + // // Norwegian Nynorsk + // $arrLangSupported['nn']['description'] = $this->translate('Norwegian (Nynorsk)'); + // $arrLangSupported['nn']['nativedescription'] = 'Norsk Nynorsk'; + // + // // Portuguese + // $arrLangSupported['pt']['description'] = $this->translate('Portuguese'); + // $arrLangSupported['pt']['nativedescription'] = 'Português'; + // + // // Romanian + // $arrLangSupported['ro']['description'] = $this->translate('Romanian'); + // $arrLangSupported['ro']['nativedescription'] = 'Românesc'; + // + // // Slovak + // $arrLangSupported['sk']['description'] = $this->translate('Slovak'); + // $arrLangSupported['sk']['nativedescription'] = 'Slovák'; + // + // // Slovenian + // $arrLangSupported['sl']['description'] = $this->translate('Slovenian'); + // $arrLangSupported['sl']['nativedescription'] = 'Slovenščina'; + // + // // Serbian + // $arrLangSupported['sr']['description'] = $this->translate('Serbian'); + // $arrLangSupported['sr']['nativedescription'] = 'Srpski'; + // + // // Spanish (Mexico) + // $arrLangSupported['es-MX']['description'] = $this->translate('Spanish (Mexico)'); + // $arrLangSupported['es-MX']['nativedescription'] = 'Español Mejicano'; + // + // // Swedish + // $arrLangSupported['sv']['description'] = $this->translate('Swedish'); + // $arrLangSupported['sv']['nativedescription'] = 'Svenska'; + // + // // Turkish + // $arrLangSupported['tr']['description'] = $this->translate('Turkish'); + // $arrLangSupported['tr']['nativedescription'] = 'Türkçe'; + // + // // Thai + // $arrLangSupported['th']['description'] = $this->translate('Thai'); + // $arrLangSupported['th']['nativedescription'] = 'ภาษาไทย'; + // + // // Vietnamese + // $arrLangSupported['vi']['description'] = $this->translate('Vietnamese'); + // $arrLangSupported['vi']['nativedescription'] = 'Tiếng Việt'; + $nativedescription = array(); + $description = array(); + foreach ($arrLangSupported as $key => $row) { + $description[$key] = $row['description']; + $nativedescription[$key] = $row['nativedescription']; + } + array_multisort($description, SORT_ASC, $nativedescription, SORT_ASC, $arrLangSupported); + return $arrLangSupported; + } + + /** + * Translate text + * @param string $strCode Language code + * @param bool $booNative Native code true/false + * @return bool|string Language name if found / false if not exist + */ + public function getLangNameFromCode($strCode, $booNative = true) + { + $strReturn = false; + $arrLanguages = $this->getLangData(); + if (isset($arrLanguages[$strCode]['description'])) { + if ($booNative) { + $strReturn = $arrLanguages[$strCode]['description'].' - '.$arrLanguages[$strCode]['nativedescription']; + } else { + $strReturn = $arrLanguages[$strCode]['description']; + } + } + return $strReturn; + } + + /** + * Connect to database server as administrator + * @param string $strStatusMessage Array variable for status message + * @param string $strErrorMessage Error string + * @param int $intMode Mode (0=admin user/1=NagiosQL user + * @return int Status variable (0=ok,1=failed) + */ + public function openAdmDBSrv(&$strStatusMessage, &$strErrorMessage, $intMode = 0) + { + $intStatus = 0; + $intReturn = 0; + $this->myDBClass->hasDBConnection(1); + if ($this->myDBClass->error == true) { + $strErrorMessage .= str_replace('::', '
', $this->myDBClass->strErrorMessage); + $intStatus = 1; + } + /** @noinspection PhpStatementHasEmptyBodyInspection */ + /** @noinspection MissingOrEmptyGroupStatementInspection */ + if ($intMode == 1) { + // TO BE DEFINED + } + if ($intStatus == 0) { + $strStatusMessage = '' .$this->translate('passed'). ''; + } else { + $strStatusMessage = '' .$this->translate('failed'). ''; + $intReturn = 1; + } + return $intReturn; + } + + /** + * Connect to database as administrator + * @param string $strStatusMessage Error string + * @param string $strErrorMessage Error string + * @param int $intMode Mode (0=admin user/1=NagiosQL user + * @return int Status variable (0=ok,1=failed) + */ + public function openDatabase(&$strStatusMessage, &$strErrorMessage, $intMode = 0) + { + $intStatus = 0; + $intReturn = 0; + // Connect to database + $booDB = $this->myDBClass->hasDBConnection(); + if (!$booDB) { + $strErrorMessage .= $this->translate('Error while connecting to database:'). '
'; + $strErrorMessage .= str_replace('::', '
', $this->myDBClass->strErrorMessage)."\n"; + $intStatus = 1; + } + /** @noinspection PhpStatementHasEmptyBodyInspection */ + /** @noinspection MissingOrEmptyGroupStatementInspection */ + if ($intMode == 1) { + // TO BE DEFINED + } + if ($intStatus == 0) { + $strStatusMessage = '' .$this->translate('passed'). ''; + } else { + $strStatusMessage = '' .$this->translate('failed'). ''; + $intReturn = 1; + } + return $intReturn; + } + + /** + * Check database version + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @param string $setVersion Database version + * @return int Status variable (0=ok,1=failed) + */ + public function checkDBVersion(&$strStatusMessage, &$strErrorMessage, &$setVersion) + { + $arrDataset = array(); + $intReturn = 0; + $strDBError = ''; + $intVersion = 0; + // Read version string from DB + if ($this->arrSession['install']['dbtype'] == 'mysqli') { + $this->myDBClass->hasSingleDataset("SHOW VARIABLES LIKE 'version'", $arrDataset); + $setVersion = $arrDataset['Value']; + $strDBError = str_replace('::', '
', $this->myDBClass->strErrorMessage); + $intVersion = version_compare($setVersion, '4.1.0'); + } + if ($strDBError == '') { + // Is the currrent version supported? + if ($intVersion >=0) { + $strStatusMessage = '' .$this->translate('supported'). ''; + } else { + $strStatusMessage = '' .$this->translate('not supported'). ''; + $intReturn = 1; + } + } else { + $strErrorMessage .= $strDBError."
\n"; + $strStatusMessage = '' .$this->translate('failed'). ''; + $setVersion = 'unknown'; + $intReturn = 1; + } + return $intReturn; + } + + /** + * Check NagiosQL version + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @param array $arrUpdate Array including all update files + * @param string $setVersion Current NagiosQL version string + * @return int Status variable (0=ok,1=failed) + */ + public function checkQLVersion(&$strStatusMessage, &$strErrorMessage, &$arrUpdate, &$setVersion) + { + $intReturn = 0; + $strSQL = "SELECT `value` FROM `tbl_settings` WHERE `category`='db' AND `name`='version'"; + $setVersion = $this->myDBClass->getFieldData($strSQL); + $strDBError = str_replace('::', '
', $this->myDBClass->strErrorMessage); + // Process result + if (($strDBError == '') && ($setVersion != '')) { + // NagiosQL version supported? + $intVersionError = 0; + switch ($setVersion) { + case '3.0.0': + $arrUpdate[] = 'sql/update_300_310.sql'; + $arrUpdate[] = 'sql/update_310_320.sql'; + break; + case '3.0.1': + $arrUpdate[] = 'sql/update_302_303.sql'; + $arrUpdate[] = 'sql/update_304_310.sql'; + $arrUpdate[] = 'sql/update_310_320.sql'; + break; + case '3.0.2': + $arrUpdate[] = 'sql/update_302_303.sql'; + $arrUpdate[] = 'sql/update_304_310.sql'; + $arrUpdate[] = 'sql/update_310_320.sql'; + break; + case '3.0.3': + $arrUpdate[] = 'sql/update_304_310.sql'; + $arrUpdate[] = 'sql/update_310_320.sql'; + break; + case '3.0.4': + $arrUpdate[] = 'sql/update_304_310.sql'; + $arrUpdate[] = 'sql/update_310_320.sql'; + break; + case '3.1.0': + $arrUpdate[] = 'sql/update_310_320.sql'; + break; + case '3.1.1': + $arrUpdate[] = 'sql/update_311_320.sql'; + break; + case '3.2.0': + $arrUpdate[] = 'sql/update_320_340.sql'; + break; + case '3.3.0': + $arrUpdate[] = 'sql/update_320_340.sql'; + break; + case '3.4.0': + $intVersionError = 2; + break; + default: + $intVersionError = 1; + break; + } + if ($intVersionError == 0) { + $strStatusMessage = '' .$this->translate('supported'). ' (' + .$setVersion. ')'; + } elseif ($intVersionError == 2) { + $strErrorMessage .= $this->translate('Your NagiosQL installation is up to date - no further ' + . 'actions are needed!')."
\n"; + $strStatusMessage = '' .$this->translate('up-to-date'). ' (' + .$setVersion. ')'; + $intReturn = 1; + } else { + $strErrorMessage .= $this->translate('Updates to NagiosQL 3.2 and above are only supported from ' + . 'NagiosQL 3.0.0 and above!')."
\n"; + $strStatusMessage = '' .$this->translate('failed'). ' (' .$setVersion. ')'; + $intReturn = 1; + } + } else { + $strErrorMessage .= $this->translate('Error while selecting settings table.')."
\n"; + $strErrorMessage .= $strDBError."
\n"; + $strErrorMessage .= $this->translate('Updates to NagiosQL 3.2 and above are only supported ' + . 'from NagiosQL 3.0.0 and above!')."
\n"; + $strStatusMessage = '' .$this->translate('failed'). ''; + $intReturn = 1; + } + return $intReturn; + } + + /** + * Delete old NagiosQL database + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @return int Status variable (0=ok,1=failed) + */ + public function dropDB(&$strStatusMessage, &$strErrorMessage) + { + $intReturn = 0; + $booReturn = $this->myDBClass->insertData('DROP DATABASE ' .$this->arrSession['install']['dbname']); + $strDBError = str_replace('::', '
', $this->myDBClass->strErrorMessage); + if ($booReturn) { + $strStatusMessage = '' .$this->translate('done'). ' (' . + $this->arrSession['install']['dbname']. ')'; + } else { + $strErrorMessage .= $strDBError."
\n"; + $strStatusMessage = '' .$this->translate('failed'). ' (' . + $this->arrSession['install']['dbname']. ')'; + $intReturn = 1; + } + return $intReturn; + } + + /** + * Create NagiosQL database + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @return int Status variable (0=ok,1=failed) + */ + public function createDB(&$strStatusMessage, &$strErrorMessage) + { + $intReturn = 0; + $strSQL = ''; + // Create database + if (($this->arrSession['install']['dbtype'] == 'mysql') || + ($this->arrSession['install']['dbtype'] == 'mysqli')) { + $strSQL = 'CREATE DATABASE ' .$this->arrSession['install']['dbname']. ' DEFAULT CHARACTER SET utf8 DEFAULT ' + . 'COLLATE utf8_unicode_ci'; + } else { + $strErrorMessage .= $this->translate('Unsupported database type.')."
\n"; + $strStatusMessage = '' .$this->translate('failed'). ' (' . + $this->arrSession['install']['dbname']. ')'; + $intReturn = 1; + } + if ($intReturn == 0) { + $booReturn = $this->myDBClass->insertData($strSQL); + $strDBError = str_replace('::', '
', $this->myDBClass->strErrorMessage); + if ($booReturn) { + $strStatusMessage = '' .$this->translate('done'). ' (' . + $this->arrSession['install']['dbname']. ')'; + } else { + $strErrorMessage .= $strDBError."
\n"; + $strStatusMessage = '' .$this->translate('failed'). ' (' . + $this->arrSession['install']['dbname']. ')'; + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * Grant user to database + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @return int Status variable (0=ok,1=failed) + */ + public function grantDBUser(&$strStatusMessage, &$strErrorMessage) + { + $intReturn = 0; + $intUserError = 0; + $strDBError = ''; + // Grant user + if (($this->arrSession['install']['dbtype'] == 'mysql') || + ($this->arrSession['install']['dbtype'] == 'mysqli')) { + // does the user exist? + $intUserError = 0; + $this->myDBClass->insertData('FLUSH PRIVILEGES'); + $strSQL = "SELECT * FROM `mysql`.`user` WHERE `Host`='".$this->arrSession['install']['localsrv']."' " + . "AND `User`='".$this->arrSession['install']['dbuser']."'"; + $intCount = $this->myDBClass->countRows($strSQL); + if ($intCount == 0) { + $strSQL = "CREATE USER '".$this->arrSession['install']['dbuser']."'@'" + . $this->arrSession['install']['localsrv']."' " + . "IDENTIFIED BY '".$this->arrSession['install']['dbpass']."'"; + $booReturn = $this->myDBClass->insertData($strSQL); + if ($booReturn == false) { + $intUserError = 1; + $strDBError = str_replace('::', '
', $this->myDBClass->strErrorMessage); + } + } elseif ($this->myDBClass->strErrorMessage == '') { + $intUserError = 2; + } else { + $intUserError = 1; + $strDBError = str_replace('::', '
', $this->myDBClass->strErrorMessage); + } + if ($intUserError != 1) { + $this->myDBClass->insertData('FLUSH PRIVILEGES'); + $strSQL = 'GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON ' + . '`' .$this->arrSession['install']['dbname']. '`.* TO ' + . "'".$this->arrSession['install']['dbuser']."'@'" + . $this->arrSession['install']['localsrv']."'"; + $booReturn = $this->myDBClass->insertData($strSQL); + if ($booReturn == false) { + $intUserError = 1; + $strDBError = str_replace('::', '
', $this->myDBClass->strErrorMessage); + } + $this->myDBClass->insertData('FLUSH PRIVILEGES'); + } + } + if ($intUserError != 1) { + if ($intUserError == 2) { + $strStatusMessage = '' .$this->translate('done'). ' (' . + $this->translate('Only added rights to existing user'). ': ' . + $this->arrSession['install']['dbuser']. ')'; + } else { + $strStatusMessage = '' .$this->translate('done'). ''; + } + } else { + $strErrorMessage .= $strDBError."
\n"; + $strStatusMessage = '' .$this->translate('failed'). ''; + $intReturn = 1; + } + return $intReturn; + } + + /** + * Update NagiosQL database + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @param array $arrUpdate Array including all update files + * @return int Status variable (0=ok,1=failed) + */ + public function updateQLDB(&$strStatusMessage, &$strErrorMessage, $arrUpdate) + { + $intReturn = 0; + $intUpdateOk = 0; + $intUpdateError = 0; + if (\is_array($arrUpdate) && (\count($arrUpdate) != 0)) { + $intUpdateOk = 0; + $intUpdateError = 0; + } else { + $strStatusMessage = '' .$this->translate('failed'). ''; + $strErrorMessage .= $this->translate('No SQL update files available')."
\n"; + $intReturn = 1; + } + if ($intReturn == 0) { + foreach ($arrUpdate as $elem) { + if (($intUpdateError == 0) && is_readable($elem)) { + $this->processSqlFile($elem, $intUpdateOk, $intUpdateError, $strStatusMessage, $strErrorMessage); + } else { + $strStatusMessage = '' .$this->translate('failed'). ''; + $strErrorMessage .= $this->translate('SQL file is not readable or empty'). ' (' .$elem.")
\n"; + $intUpdateError++; + } + } + if ($intUpdateError == 0) { + $strStatusMessage = '' .$this->translate('done'). ''; + } else { + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * Process SQL files + * @param string $strFileName SQL Filename + * @param int $intSuccess Success counter + * @param int $intError Error Counter + * @param string $strStatus Status message string + * @param string $strError Error message string + */ + private function processSqlFile($strFileName, &$intSuccess, &$intError, &$strStatus, &$strError) + { + $filSqlNew = fopen($strFileName, 'rb'); + if ($filSqlNew) { + $strSqlCommand = ''; + $intSQLError = 0; + $intLineCount = 0; + while (!feof($filSqlNew)) { + $strLine = trim(fgets($filSqlNew)); + if ($intSQLError == 1) { + continue; + } // skip if an error was found + $intLineCount++; + if (($strLine == '') || (0 === strpos($strLine, '--'))) { + continue; + } // skip empty and comment lines + $strSqlCommand .= $strLine; + if (substr($strSqlCommand, -1) == ';') { + $booReturn = $this->myDBClass->insertData($strSqlCommand); + if ($booReturn == false) { + $intSQLError = 1; + $strError .= str_replace('::', '
', $this->myDBClass->strErrorMessage); + $intError = 1; + } + $strSqlCommand = ''; + } + } + if ($intSQLError == 0) { + $intSuccess++; + } else { + $strStatus = '' .$this->translate('failed'). ' (Line: ' . + $intLineCount. ' in file: ' .$strFileName. ')'; + $intError++; + } + } else { + $strStatus = '' .$this->translate('failed'). ''; + $strError .= $this->translate('SQL file is not readable or empty'). ' (' .$strFileName.")
\n"; + $intError++; + } + } + + /** + * Create NagiosQL administrator + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @return int Status variable (0=ok,1=failed) + */ + public function createNQLAdmin(&$strStatusMessage, &$strErrorMessage) + { + $intReturn = 0; + // Create admin user + $strSQL = "SELECT `id` FROM `tbl_language` WHERE `locale`='".$this->arrSession['install']['locale']."'"; + $intLang = (int)$this->myDBClass->getFieldData($strSQL); + if ($intLang == 0) { + $intLang = 1; + } + /** @noinspection SqlSignature */ + $strSQL = 'INSERT INTO `tbl_user` (`id`, `username`, `alias`, `password`, `admin_enable`, `wsauth`, ' + . '`active`, `nodelete`, `language`, `domain`, `last_login`, `last_modified`) ' + . "VALUES (1, '".$this->arrSession['install']['qluser']."', 'Administrator', " + . "MD5('".$this->arrSession['install']['qlpass']."'), '1', '0', '1', '1', '".$intLang + . "', '1', '', NOW());"; + $booReturn = $this->myDBClass->insertData($strSQL); + $strDBError = str_replace('::', '
', $this->myDBClass->strErrorMessage); + if ($booReturn) { + $strStatusMessage = '' .$this->translate('done'). ''; + } else { + $strErrorMessage .= $strDBError."
\n"; + $strStatusMessage = '' .$this->translate('failed'). ''; + $intReturn = 1; + } + return $intReturn; + } + + /** + * Update settings database + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @return int Status variable (0=ok,1=failed) + */ + public function updateSettingsDB(&$strStatusMessage, &$strErrorMessage) + { + $intReturn = 0; + // Checking initial settings + $arrInitial[] = array('category'=>'db','name'=>'version','value'=>$this->arrSession['install']['version']); + $arrInitial[] = array('category'=>'db','name'=>'type','value'=>$this->arrSession['install']['dbtype']); + /** @noinspection ForeachSourceInspection */ + foreach ($this->arrSession['init_settings'] as $key => $value) { + if ($key == 'db') { + continue; + } // do not store db values to database + /** @var array $value */ + foreach ($value as $key2 => $value2) { + $arrInitial[] = array('category'=>$key,'name'=>$key2,'value'=>$value2); + } + } + /** @noinspection ForeachSourceInspection */ + foreach ($arrInitial as $elem) { + $strSQL1 = 'SELECT `value` FROM `tbl_settings` ' + . "WHERE `category`='".$elem['category']."' AND `name`='".$elem['name']."'"; + $strSQL2 = 'INSERT INTO `tbl_settings` (`category`, `name`, `value`) ' + . "VALUES ('".$elem['category']."', '".$elem['name']."', '".$elem['value']."')"; + $intCount = $this->myDBClass->countRows($strSQL1); + if ($intCount == 0) { + $booReturn = $this->myDBClass->insertData($strSQL2); + if ($booReturn == false) { + $strStatusMessage = '' .$this->translate('failed'). ''; + $strErrorMessage .= $this->translate('Inserting initial data to settings database has ' + . 'failed:'). '1
'; + $strErrorMessage .= str_replace('::', '
', $this->myDBClass->strErrorMessage); + $intReturn = 1; + } + } elseif ($this->myDBClass->strErrorMessage != '') { + $strStatusMessage = '' .$this->translate('failed'). ''; + $strErrorMessage .= $this->translate('Inserting initial data to settings database has failed:') + . '2
'; + $strErrorMessage .= str_replace('::', '
', $this->myDBClass->strErrorMessage); + $intReturn = 1; + } + } + if ($intReturn == 0) { + $strBaseURL = str_replace('install/install.php', '', filter_input(INPUT_SERVER, 'PHP_SELF', 513)); + $strBasePath = substr(realpath('.'), 0, -7); + // Update some values + $arrSettings[] = array('category'=>'db','name'=>'version', + 'value'=>$this->arrSession['install']['version']); + if (substr_count(filter_input(INPUT_SERVER, 'SERVER_PROTOCOL', FILTER_SANITIZE_STRING), 'HTTPS') != 0) { + $arrSettings[] = array('category'=>'path','name'=>'protocol','value'=>'https'); + } else { + $arrSettings[] = array('category'=>'path','name'=>'protocol','value'=>'http'); + } + $arrSettings[] = array('category'=>'data','name'=>'locale', + 'value'=>$this->arrSession['install']['locale']); + $arrSettings[] = array('category'=>'path','name'=>'base_url','value'=>$strBaseURL); + $arrSettings[] = array('category'=>'path','name'=>'base_path','value'=>$strBasePath); + /** @var array $arrSettings */ + foreach ($arrSettings as $elem) { + $strSQL = "UPDATE `tbl_settings` SET `value`='".$elem['value']."' " + . "WHERE `category`='".$elem['category']."' AND `name`='".$elem['name']."'"; + $booReturn = $this->myDBClass->insertData($strSQL); + if ($booReturn == false) { + $strStatusMessage = '' .$this->translate('failed'). ''; + $strErrorMessage .= $this->translate('Inserting initial data to settings database has failed:'); + $strErrorMessage .= str_replace('::', '
', $this->myDBClass->strErrorMessage); + $intReturn = 1; + } + } + if ($intReturn == 0) { + $strStatusMessage = '' .$this->translate('done'). ''; + } + } + return $intReturn; + } + + /** + * Update settings file + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @return int Status variable (0=ok,1=failed) + */ + public function updateSettingsFile(&$strStatusMessage, &$strErrorMessage) + { + $intReturn = 0; + // open settings file + $strBaseURL = str_replace('install/install.php', '', filter_input(INPUT_SERVER, 'PHP_SELF', 513)); + $strBasePath = substr(realpath('.'), 0, -7); + $strErrorId = error_reporting(); + error_reporting(0); + $filSettings = fopen($strBasePath. 'config/settings.php', 'wb'); + error_reporting($strErrorId); + if ($filSettings) { + // Write Database Configuration into settings.php + fwrite($filSettings, "\n"); + fwrite($filSettings, ";///////////////////////////////////////////////////////////////////////////////\n"); + fwrite($filSettings, ";\n"); + fwrite($filSettings, "; NagiosQL\n"); + fwrite($filSettings, ";\n"); + fwrite($filSettings, ";///////////////////////////////////////////////////////////////////////////////\n"); + fwrite($filSettings, ";\n"); + fwrite($filSettings, "; Project : NagiosQL\n"); + fwrite($filSettings, "; Component: Database Configuration\n"); + fwrite($filSettings, "; Website : https://sourceforge.net/projects/nagiosql/\n"); + fwrite($filSettings, '; Date : ' .date('F j, Y, g:i a')."\n"); + fwrite($filSettings, '; Version : ' .$this->arrSession['install']['version']."\n"); + fwrite($filSettings, ";\n"); + fwrite($filSettings, ";///////////////////////////////////////////////////////////////////////////////\n"); + fwrite($filSettings, "[db]\n"); + fwrite($filSettings, 'type = ' .$this->arrSession['install']['dbtype']."\n"); + fwrite($filSettings, 'server = ' .$this->arrSession['install']['dbserver']."\n"); + fwrite($filSettings, 'port = ' .$this->arrSession['install']['dbport']."\n"); + fwrite($filSettings, 'database = ' .$this->arrSession['install']['dbname']."\n"); + fwrite($filSettings, 'username = ' .$this->arrSession['install']['dbuser']."\n"); + fwrite($filSettings, 'password = ' .$this->arrSession['install']['dbpass']."\n"); + fwrite($filSettings, "[path]\n"); + fwrite($filSettings, 'base_url = ' .$strBaseURL."\n"); + fwrite($filSettings, 'base_path = ' .$strBasePath."\n"); + fclose($filSettings); + $strStatusMessage = '' .$this->translate('done'). ''; + } else { + $strStatusMessage = '' .$this->translate('failed'). ''; + $strErrorMessage .= $this->translate('Connot open/write to config/settings.php')."
\n"; + $intReturn = 1; + } + return $intReturn; + } + + /** + * Update settings database + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @return int Status variable (0=ok,1=failed) + */ + public function updateQLpath(&$strStatusMessage, &$strErrorMessage) + { + $intReturn = 0; + // Update configuration target database + $strNagiosQLpath = str_replace('//', '/', $this->arrSession['install']['qlpath']. '/'); + $strNagiosPath = str_replace('//', '/', $this->arrSession['install']['nagpath']. '/'); + $strSQL = 'UPDATE `tbl_configtarget` SET ' + . "`basedir`='".$strNagiosQLpath."', " + . "`hostconfig`='".$strNagiosQLpath."hosts/', " + . "`serviceconfig`='".$strNagiosQLpath."services/', " + . "`backupdir`='".$strNagiosQLpath."backup/', " + . "`hostbackup`='".$strNagiosQLpath."backup/hosts/', " + . "`servicebackup`='".$strNagiosQLpath."backup/services/', " + . "`nagiosbasedir`='".$strNagiosPath."', " + . "`importdir`='".$strNagiosPath."objects/', " + . "`conffile`='".$strNagiosPath."nagios.cfg', " + . "`last_modified`=NOW() WHERE `target`='localhost'"; + $booReturn = $this->myDBClass->insertData($strSQL); + if ($booReturn == false) { + $strStatusMessage = '' .$this->translate('failed'). ''; + $strErrorMessage .= $this->translate('Inserting path data to database has failed:'). ' ' . + str_replace('::', '
', $this->myDBClass->strErrorMessage)."\n"; + $intReturn = 1; + } + if ($intReturn == 0 && $this->arrSession['install']['createpath'] == 1) { + if (is_writable($strNagiosQLpath) && is_dir($strNagiosQLpath) && is_executable($strNagiosQLpath)) { + if (!file_exists($strNagiosQLpath . 'hosts') && !mkdir($strNagiosQLpath . 'hosts', 0755) && + !is_dir($strNagiosQLpath . 'hosts')) { + throw new \RuntimeException(sprintf('Directory "%s" was not created', $strNagiosQLpath . 'hosts')); + } + if (!file_exists($strNagiosQLpath . 'services') && !mkdir($strNagiosQLpath . 'services', 0755) && + !is_dir($strNagiosQLpath . 'services')) { + throw new \RuntimeException(sprintf('Directory "%s" was not created', $strNagiosQLpath + . 'services')); + } + if (!file_exists($strNagiosQLpath . 'backup') && !mkdir($strNagiosQLpath . 'backup', 0755) && + !is_dir($strNagiosQLpath . 'backup')) { + throw new \RuntimeException(sprintf('Directory "%s" was not created', $strNagiosQLpath . 'backup')); + } + if (!file_exists($strNagiosQLpath . 'backup/hosts') && + !mkdir($strNagiosQLpath . 'backup/hosts', 0755) && !is_dir($strNagiosQLpath . 'backup/hosts')) { + throw new \RuntimeException(sprintf('Directory "%s" was not created', $strNagiosQLpath + . 'backup/hosts')); + } + if (!file_exists($strNagiosQLpath . 'backup/services') && + !mkdir($strNagiosQLpath . 'backup/services', 0755) && + !is_dir($strNagiosQLpath . 'backup/services')) { + throw new \RuntimeException(sprintf('Directory "%s" was not created', $strNagiosQLpath + . 'backup/services')); + } + $strStatusMessage = '' .$this->translate('done'). ' (' . + $this->translate('Check the permissions of the created paths!'). ')'; + } else { + $strStatusMessage = '' .$this->translate('failed'). ''; + $strErrorMessage .= $this->translate('NagiosQL config path is not writeable - only database ' + . 'values updated')."
\n"; + $intReturn = 1; + } + } + if ($intReturn == 0) { + $strStatusMessage = '' .$this->translate('done'). ''; + } + return $intReturn; + } + + /** + * Converting NagiosQL database to utf-8 + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @return int Status variable (0=ok,1=failed) + */ + public function convQLDB(&$strStatusMessage, &$strErrorMessage) + { + $strDBError = ''; + $intReturn = 0; + if ($this->arrSession['install']['dbtype'] == 'mysqli') { + $strSQL = 'ALTER DATABASE `' .$this->arrSession['install']['dbname']. '` ' + . 'DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci'; + $this->myDBClass->insertData($strSQL); + $strDBError = str_replace('::', '
', $this->myDBClass->strErrorMessage); + } + if ($strDBError == '') { + $strStatusMessage = '' .$this->translate('done'). ''; + } else { + $strErrorMessage .= $this->translate('Database errors while converting to utf-8:'). '
' . + $strDBError."
\n"; + $strStatusMessage = '' .$this->translate('failed'). ''; + $intReturn = 1; + } + return $intReturn; + } + + /** + * Converting NagiosQL database tables to utf-8 + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @return int Status variable (0=ok,1=failed) + */ + public function convQLDBTables(&$strStatusMessage, &$strErrorMessage) + { + $arrDataset = array(); + $intDataCount = 0; + $intReturn = 0; + $intError = 0; + $strDBError = ''; + // Read version string from DB + if ($this->arrSession['install']['dbtype'] == 'mysqli') { + $strSQL = 'SHOW TABLES FROM `' .$this->arrSession['install']['dbname']. '`'; + $this->myDBClass->hasDataArray($strSQL, $arrDataset, $intDataCount); + if ($intDataCount != 0) { + foreach ($arrDataset as $elem) { + if ($intError == 1) { + continue; + } + $strSQL = 'ALTER TABLE `' .$elem[0]. '` DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci'; + $booReturn = $this->myDBClass->insertData($strSQL); + if ($booReturn == false) { + $intError = 1; + $strDBError = str_replace('::', '
', $this->myDBClass->strErrorMessage); + } + } + } + } else { + $strErrorMessage .= translate('Database type not defined!'). ' (' .$this->arrSession['install']['dbtype'] + .")
\n"; + $strStatusMessage = '' .translate('failed'). ''; + $intReturn = 1; + } + if ($intReturn == 0) { + if ($strDBError == '') { + $strStatusMessage = '' .translate('done'). ''; + } else { + $strErrorMessage .= translate('Database errors while converting to utf-8:'). '
' .$strDBError + ."
\n"; + $strStatusMessage = '' .translate('failed'). ''; + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * Converting NagiosQL database tables to utf-8 + * @param string $strStatusMessage Variable for status message + * @param string $strErrorMessage Error string + * @return int Status variable (0=ok,1=failed) + */ + public function convQLDBFields(&$strStatusMessage, &$strErrorMessage) + { + $arrDataset1 = array(); + $arrDataset2 = array(); + $intDataCount1 = 0; + $intDataCount2 = 0; + $intReturn = 0; + $intError = 0; + $strDBError = ''; + // Read version string from DB + $strSQL1 = 'SHOW TABLES FROM `' .$this->arrSession['install']['dbname']. '`'; + $booReturn = $this->myDBClass->hasDataArray($strSQL1, $arrDataset1, $intDataCount1); + if ($booReturn && ($intDataCount1 != 0)) { + foreach ($arrDataset1 as $elem1) { + $strSQL2 = 'SHOW FULL FIELDS FROM `' .$elem1[0]. '` ' + . "WHERE (`Type` LIKE '%varchar%' OR `Type` LIKE '%enum%' OR `Type` LIKE '%text%') " + . "AND Collation <> 'utf8_unicode_ci'"; + $this->myDBClass->hasDataArray($strSQL2, $arrDataset2, $intDataCount2); + if ($intDataCount2 != 0) { + foreach ($arrDataset2 as $elem2) { + if ($intError == 1) { + continue; + } + $this->convTabFields($elem1[0], $elem2, $intError, $strDBError); + } + } + } + } else { + $strErrorMessage .= translate('Database type not defined!'). ' (' + .$this->arrSession['install']['dbtype'].")
\n"; + $strStatusMessage = '' .translate('failed'). ''; + $intReturn = 1; + } + if ($intReturn == 0) { + if ($strDBError == '') { + $strStatusMessage = '' .translate('done'). ''; + } else { + $strErrorMessage .= translate('Database errors while converting to utf-8:'). '
' .$strDBError + ."
\n"; + $strStatusMessage = '' .translate('failed'). ''; + $intReturn = 1; + } + } + return $intReturn; + } + + /** + * Convert table fields + * @param string $strTable Table Name + * @param array $arrFields Table fields (array) + * @param int $intError Error Counter + * @param string $strDBError DB error message string + */ + private function convTabFields($strTable, $arrFields, &$intError, &$strDBError) + { + $strDefault = ''; + $strNull = 'NOT NULL'; + if (($arrFields[5] === null) && ($arrFields[3] === 'YES')) { + $strDefault = 'DEFAULT NULL'; + } elseif ($arrFields[5] != '') { + $strDefault = "DEFAULT '".$arrFields[5]."'"; + } + if ($arrFields[3] == 'YES') { + $strNull = 'NULL'; + } + $strSQL = /** @lang text */ 'ALTER TABLE `' .$strTable. '` CHANGE `' .$arrFields[0]. '` `' .$arrFields[0] + . '` ' . $arrFields[1]." CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' $strNull $strDefault"; + $booReturn = $this->myDBClass->insertData($strSQL); + if ($booReturn == false) { + $intError = 1; + $strDBError = 'Table:' .$strTable. ' - Field: ' .$arrFields[0]. ' ' . + $this->myDBClass->strErrorMessage; + } + } +} diff --git a/install/functions/initial_settings.php b/install/functions/initial_settings.php index 12e6968..31f78ef 100644 --- a/install/functions/initial_settings.php +++ b/install/functions/initial_settings.php @@ -7,42 +7,41 @@ exit; ; ;/////////////////////////////////////////////////////////////////////////////// ; -; Project : NagiosQL -; Component: Initial configuration settings -; Website : http://www.nagiosql.org -; Date : May 27, 2011, 2:35 pm -; Version : 3.3.0 -; $LastChangedRevision: 2 $ +; Project : NagiosQL +; Component : Initial configuration settings +; Website : https://sourceforge.net/projects/nagiosql/ +; Version : 3.4.0 +; GIT Repo : https://gitlab.com/wizonet/NagiosQL ; ; DO NOT USE THIS FILE AS NAGIOSQL SETTINGS FILE! ; ;/////////////////////////////////////////////////////////////////////////////// [db] -type = mysqli -server = localhost -port = 3306 -database = db_nagiosql_v32 -username = nagiosql_user -password = nagiosql_pass +type = mysqli +server = localhost +port = 3306 +database = db_nagiosql_v34 +username = nagiosql_user +password = nagiosql_pass [path] -protocol = http -tempdir = /tmp -base_url = / -base_path = '' +protocol = http +tempdir = /tmp +base_url = / +base_path = '' [data] -locale = en_GB -encoding = utf-8 +locale = en_GB +encoding = utf-8 [security] -logofftime = 3600 -wsauth = 0 +logofftime = 3600 +wsauth = 0 [common] -pagelines = 15 -seldisable = 1 -tplcheck = 0 -updcheck = 1 +pagelines = 15 +seldisable = 1 +tplcheck = 0 +updcheck = 1 [network] -proxy = 0 -proxyserver = '' -proxyuser = '' -proxypasswd = '' -onlineupdate = 0 \ No newline at end of file +proxy = 0 +proxyserver = '' +proxyuser = '' +proxypasswd = '' +onlineupdate = 0 \ No newline at end of file diff --git a/install/functions/install_class.php b/install/functions/install_class.php deleted file mode 100644 index a6b5252..0000000 --- a/install/functions/install_class.php +++ /dev/null @@ -1,979 +0,0 @@ - $elem) { - if (substr_count($strTemplate,"{".$key."}") != 0) { - $strTemplate = str_replace("{".$key."}",$elem,$strTemplate); - } - } - return($strTemplate); - } else { - echo $this->translate("Template file not found").": ".$strTplFile; - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Translate text - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: $strLangString String to translate - // - // Return values: Translated string - // - /////////////////////////////////////////////////////////////////////////////////////////// - function translate($strLangString) { - $strLangString = gettext($strLangString); - $strLangString = str_replace('"','"',$strLangString); - $strLangString = str_replace("'",''',$strLangString); - return $strLangString; - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Return supported languages - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: none - // - // Return values: Array including supported languages - // - /////////////////////////////////////////////////////////////////////////////////////////// - function getLangData() { - unset($arrLangSupported); - // English - $arrLangSupported['en_GB']['description'] = $this->translate('English'); - $arrLangSupported['en_GB']['nativedescription'] = 'English'; - - // German - $arrLangSupported['de_DE']['description'] = $this->translate('German'); - $arrLangSupported['de_DE']['nativedescription'] = 'Deutsch'; - - // Chinese (Simplified) - $arrLangSupported['zh_CN']['description'] = $this->translate('Chinese (Simplified)'); - $arrLangSupported['zh_CN']['nativedescription'] = '简体中文'; - - // Italian - $arrLangSupported['it_IT']['description'] = $this->translate('Italian'); - $arrLangSupported['it_IT']['nativedescription'] = 'Italiano'; - - // French - $arrLangSupported['fr_FR']['description'] = $this->translate('French'); - $arrLangSupported['fr_FR']['nativedescription'] = 'Français'; - - // Russian - $arrLangSupported['ru_RU']['description'] = $this->translate('Russian'); - $arrLangSupported['ru_RU']['nativedescription'] = 'Русский'; - - // Spanish - $arrLangSupported['es_ES']['description'] = $this->translate('Spanish'); - $arrLangSupported['es_ES']['nativedescription'] = 'Español'; - - // Brazilian Portuguese - $arrLangSupported['pt_BR']['description'] = $this->translate('Portuguese (Brazilian)'); - $arrLangSupported['pt_BR']['nativedescription'] = 'Português do Brasil'; - - // Dutch - $arrLangSupported['nl_NL']['description'] = $this->translate('Dutch'); - $arrLangSupported['nl_NL']['nativedescription'] = 'Nederlands'; - - // Danish - $arrLangSupported['da_DK']['description'] = $this->translate('Danish'); - $arrLangSupported['da_DK']['nativedescription'] = 'Dansk'; - - // No longer supported language due to missing translators - // - // // Japanese - // $arrLangSupported['ja_JP']['description'] = $this->translate('Japanese'); - // $arrLangSupported['ja_JP']['nativedescription'] = '日本語'; - // - // // Polish - // $arrLangSupported['pl_PL']['description'] = $this->translate('Polish'); - // $arrLangSupported['pl_PL']['nativedescription'] = 'Polski'; - // - // // Spanish (Argentina) - // $arrLangSupported['es_AR']['description'] = $this->translate('Spanish (Argentina)'); - // $arrLangSupported['es_AR']['nativedescription'] = 'Español Argentina'; - /// - /// Currently not supported languages - // - // // Albanian - // $arrLangSupported['sq']['description'] = $clang->$this->translate('Albanian'); - // $arrLangSupported['sq']['nativedescription'] = 'Shqipe'; - // - // // Basque - // $arrLangSupported['eu']['description'] = $this->translate('Basque'); - // $arrLangSupported['eu']['nativedescription'] = 'Euskara'; - // - // // Bosnian - // $arrLangSupported['bs']['description'] = $this->translate('Bosnian'); - // $arrLangSupported['bs']['nativedescription'] = 'Български'; - // - // // Bulgarian - // $arrLangSupported['bg']['description'] = $this->translate('Bulgarian'); - // $arrLangSupported['bg']['nativedescription'] = 'Български'; - // - // // Catalan - // $arrLangSupported['ca']['description'] = $this->translate('Catalan'); - // $arrLangSupported['ca']['nativedescription'] = 'Catalά'; - // - // // Welsh - // $arrLangSupported['cy']['description'] = $this->translate('Welsh'); - // $arrLangSupported['cy']['nativedescription'] = 'Cymraeg'; - // - // // Chinese (Traditional - Hong Kong) - // $arrLangSupported['zh-Hant-HK']['description'] = $this->translate('Chinese (Traditional - Hong Kong)'); - // $arrLangSupported['zh-Hant-HK']['nativedescription'] = '繁體中文語系'; - // - // // Chinese (Traditional - Taiwan) - // $arrLangSupported['zh-Hant-TW']['description'] = $this->translate('Chinese (Traditional - Taiwan)'); - // $arrLangSupported['zh-Hant-TW']['nativedescription'] = 'Chinese (Traditional - Taiwan)'; - // - // // Croatian - // $arrLangSupported['hr']['description'] = $this->translate('Croatian'); - // $arrLangSupported['hr']['nativedescription'] = 'Hrvatski'; - // - // // Czech - // $arrLangSupported['cs']['description'] = $this->translate('Czech'); - // $arrLangSupported['cs']['nativedescription'] = 'Česky'; - // - // // Estonian - // $arrLangSupported['et']['description'] = $this->translate('Estonian'); - // $arrLangSupported['et']['nativedescription'] = 'Eesti'; - // - // // Finnish - // $arrLangSupported['fi']['description'] = $this->translate('Finnish'); - // $arrLangSupported['fi']['nativedescription'] = 'Suomi'; - // - // // Galician - // $arrLangSupported['gl']['description'] = $this->translate('Galician'); - // $arrLangSupported['gl']['nativedescription'] = 'Galego'; - // - // // German informal - // $arrLangSupported['de-informal']['description'] = $this->translate('German informal'); - // $arrLangSupported['de-informal']['nativedescription'] = 'Deutsch (Du)'; - // - // // Greek - // $arrLangSupported['el']['description'] = $this->translate('Greek'); - // $arrLangSupported['el']['nativedescription'] = 'ελληνικά'; - // - // // Hebrew - // $arrLangSupported['he']['description'] = $this->translate('Hebrew'); - // $arrLangSupported['he']['nativedescription'] = ' עברית'; - // - // // Hungarian - // $arrLangSupported['hu']['description'] = $this->translate('Hungarian'); - // $arrLangSupported['hu']['nativedescription'] = 'Magyar'; - // - // // Indonesian - // $arrLangSupported['id']['description'] = $this->translate('Indonesian'); - // $arrLangSupported['id']['nativedescription'] = 'Bahasa Indonesia'; - // - // // Lithuanian - // $arrLangSupported['lt']['description'] = $this->translate('Lithuanian'); - // $arrLangSupported['lt']['nativedescription'] = 'Lietuvių'; - // - // // Macedonian - // $arrLangSupported['mk']['description'] = $this->translate('Macedonian'); - // $arrLangSupported['mk']['nativedescription'] = 'Македонски'; - // - // // Norwegian Bokml - // $arrLangSupported['nb']['description'] = $this->translate('Norwegian (Bokmal)'); - // $arrLangSupported['nb']['nativedescription'] = 'Norsk Bokmål'; - // - // // Norwegian Nynorsk - // $arrLangSupported['nn']['description'] = $this->translate('Norwegian (Nynorsk)'); - // $arrLangSupported['nn']['nativedescription'] = 'Norsk Nynorsk'; - // - // // Portuguese - // $arrLangSupported['pt']['description'] = $this->translate('Portuguese'); - // $arrLangSupported['pt']['nativedescription'] = 'Português'; - // - // // Romanian - // $arrLangSupported['ro']['description'] = $this->translate('Romanian'); - // $arrLangSupported['ro']['nativedescription'] = 'Românesc'; - // - // // Slovak - // $arrLangSupported['sk']['description'] = $this->translate('Slovak'); - // $arrLangSupported['sk']['nativedescription'] = 'Slovák'; - // - // // Slovenian - // $arrLangSupported['sl']['description'] = $this->translate('Slovenian'); - // $arrLangSupported['sl']['nativedescription'] = 'Slovenščina'; - // - // // Serbian - // $arrLangSupported['sr']['description'] = $this->translate('Serbian'); - // $arrLangSupported['sr']['nativedescription'] = 'Srpski'; - // - // // Spanish (Mexico) - // $arrLangSupported['es-MX']['description'] = $this->translate('Spanish (Mexico)'); - // $arrLangSupported['es-MX']['nativedescription'] = 'Español Mejicano'; - // - // // Swedish - // $arrLangSupported['sv']['description'] = $this->translate('Swedish'); - // $arrLangSupported['sv']['nativedescription'] = 'Svenska'; - // - // // Turkish - // $arrLangSupported['tr']['description'] = $this->translate('Turkish'); - // $arrLangSupported['tr']['nativedescription'] = 'Türkçe'; - // - // // Thai - // $arrLangSupported['th']['description'] = $this->translate('Thai'); - // $arrLangSupported['th']['nativedescription'] = 'ภาษาไทย'; - // - // // Vietnamese - // $arrLangSupported['vi']['description'] = $this->translate('Vietnamese'); - // $arrLangSupported['vi']['nativedescription'] = 'Tiếng Việt'; - - - foreach ($arrLangSupported as $key => $row) { - $description[$key] = $row['description']; - $nativedescription[$key] = $row['nativedescription']; - } - array_multisort($description, SORT_ASC, $nativedescription, SORT_ASC, $arrLangSupported); - //uasort($arrLangSupported,"user_sort"); - return $arrLangSupported; - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Translate text - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: $strCode Language code - // $booNative Native code true/false - // - // Return values: Language name if found / false if not exist - // - /////////////////////////////////////////////////////////////////////////////////////////// - function getLangNameFromCode($strCode, $booNative=true) { - $arrLanguages = $this->getLangData(); - if (isset($arrLanguages[$strCode]['description'])) { - if ($booNative) { - return $arrLanguages[$strCode]['description'].' - '.$arrLanguages[$strCode]['nativedescription']; - } else { - return $arrLanguages[$strCode]['description'];} - } else { - // else return false - return false; - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Connect to database server as administrator - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // $intMode Mode (0=admin user/1=NagiosQL user - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function openAdmDBSrv(&$strStatusMessage,&$strErrorMessage,$intMode=0) { - $intStatus = 0; - $this->myDBClass->dbconnect(); - if ($this->myDBClass->error == true) { - $strErrorMessage .= str_replace("::","
",$this->myDBClass->strErrorMessage); - $intStatus = 1; - } - if ($intStatus == 0) { - $strStatusMessage = "".$this->translate("passed").""; - return(0); - } else { - $strStatusMessage = "".$this->translate("failed").""; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Connect to database as administrator - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // $intMode Mode (0=admin user/1=NagiosQL user - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function openDatabase(&$strStatusMessage,&$strErrorMessage,$intMode=0) { - $intStatus = 0; - // Connect to database - $booDB = $this->myDBClass->dbselect(); - if (!$booDB) { - $strErrorMessage .= $this->translate('Error while connecting to database:')."
"; - $strErrorMessage .= str_replace("::","
",$this->myDBClass->strErrorMessage)."\n"; - $intStatus = 1; - } - if ($intStatus == 0) { - $strStatusMessage = "".$this->translate("passed").""; - return(0); - } else { - $strStatusMessage = "".$this->translate("failed").""; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Check database version - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // $strVersion Database version - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function checkDBVersion(&$strStatusMessage,&$strErrorMessage,&$setVersion) { - // Read version string from DB - if (($_SESSION['install']['dbtype'] == "mysql") || ($_SESSION['install']['dbtype'] == "mysqli")) { - $this->myDBClass->getSingleDataset("SHOW VARIABLES LIKE 'version'",$arrDataset); - $setVersion = $arrDataset['Value']; - $strDBError = str_replace("::","
",$this->myDBClass->strErrorMessage); - $intVersion = version_compare($setVersion,"4.1.0"); - } - if ($strDBError == "") { - // Is the currrent version supported? - if ($intVersion >=0) { - $strStatusMessage = "".$this->translate("supported").""; - return(0); - } else { - $strStatusMessage = "".$this->translate("not supported").""; - return(1); - } - } else { - $strErrorMessage .= $strDBError."
\n"; - $strStatusMessage = "".$this->translate("failed").""; - $setVersion = "unknown"; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Check NagiosQL version - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // $arrUpdate Array including all update files - // $setVersion Current NagiosQL version string - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function checkQLVersion(&$strStatusMessage,&$strErrorMessage,&$arrUpdate,&$setVersion) { - $strSQL = "SELECT `value` FROM `tbl_settings` WHERE `category`='db' AND `name`='version'"; - $setVersion = $this->myDBClass->getFieldData($strSQL); - $strDBError = str_replace("::","
",$this->myDBClass->strErrorMessage); - // Process result - if (($strDBError == "") && ($setVersion != "")) { - // NagiosQL version supported? - $intVersionError = 0; - switch($setVersion) { - case '3.0.0': $arrUpdate[] = "sql/update_300_310.sql"; - $arrUpdate[] = "sql/update_310_320.sql"; - break; - case '3.0.1': $arrUpdate[] = "sql/update_302_303.sql"; - $arrUpdate[] = "sql/update_304_310.sql"; - $arrUpdate[] = "sql/update_310_320.sql"; - break; - case '3.0.2': $arrUpdate[] = "sql/update_302_303.sql"; - $arrUpdate[] = "sql/update_304_310.sql"; - $arrUpdate[] = "sql/update_310_320.sql"; - break; - case '3.0.3': $arrUpdate[] = "sql/update_304_310.sql"; - $arrUpdate[] = "sql/update_310_320.sql"; - break; - case '3.0.4': $arrUpdate[] = "sql/update_304_310.sql"; - $arrUpdate[] = "sql/update_310_320.sql"; - break; - case '3.1.0': $arrUpdate[] = "sql/update_310_320.sql"; - break; - case '3.1.1': $arrUpdate[] = "sql/update_311_320.sql"; - break; - case '3.2.0': $intVersionError = 2; - break; - case '3.3.0': $intVersionError = 2; - break; - default: $intVersionError = 1; - break; - } - if ($intVersionError == 0) { - $strStatusMessage = "".$this->translate("supported")." (".$setVersion.")"; - return(0); - } else if ($intVersionError == 2) { - $strErrorMessage .= $this->translate("Your NagiosQL installation is up to date - no further actions are needed!")."
\n"; - $strStatusMessage = "".$this->translate("up-to-date")." (".$setVersion.")"; - return(1); - } else { - $strErrorMessage .= $this->translate("Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and above!")."
\n"; - $strStatusMessage = "".$this->translate("failed")." (".$setVersion.")"; - return(1); - } - } else { - $strErrorMessage .= $this->translate("Error while selecting settings table.")."
\n"; - $strErrorMessage .= $strDBError."
\n"; - $strErrorMessage .= $this->translate("Updates to NagiosQL 3.2 and above are only supported from NagiosQL 3.0.0 and above!")."
\n"; - $strStatusMessage = "".$this->translate("failed").""; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Delete old NagiosQL database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function dropDB(&$strStatusMessage,&$strErrorMessage) { - $booReturn = $this->myDBClass->insertData("DROP DATABASE ".$_SESSION['install']['dbname']); - $strDBError = str_replace("::","
",$this->myDBClass->strErrorMessage); - if ($booReturn) { - $strStatusMessage = "".$this->translate("done")." (".$_SESSION['install']['dbname'].")"; - return(0); - } else { - $strErrorMessage .= $strDBError."
\n"; - $strStatusMessage = "".$this->translate("failed")." (".$_SESSION['install']['dbname'].")"; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Create NagiosQL database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function createDB(&$strStatusMessage,&$strErrorMessage) { - // Create database - if (($_SESSION['install']['dbtype'] == "mysql") || ($_SESSION['install']['dbtype'] == "mysqli")) { - $strSQL = "CREATE DATABASE ".$_SESSION['install']['dbname']." DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci"; - } else { - $strErrorMessage .= $this->translate("Unsupported database type.")."
\n"; - $strStatusMessage = "".$this->translate("failed")." (".$_SESSION['install']['dbname'].")"; - return(1); - } - $booReturn = $this->myDBClass->insertData($strSQL); - $strDBError = str_replace("::","
",$this->myDBClass->strErrorMessage); - if ($booReturn) { - $strStatusMessage = "".$this->translate("done")." (".$_SESSION['install']['dbname'].")"; - return(0); - } else { - $strErrorMessage .= $strDBError."
\n"; - $strStatusMessage = "".$this->translate("failed")." (".$_SESSION['install']['dbname'].")"; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Grant user to database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function grantDBUser(&$strStatusMessage,&$strErrorMessage) { - // Grant user - if (($_SESSION['install']['dbtype'] == "mysql") || ($_SESSION['install']['dbtype'] == "mysqli")) { - // does the user exist? - $intUserError = 0; - $booReturn = $this->myDBClass->insertData("FLUSH PRIVILEGES"); - $strSQL = "SELECT * FROM `mysql`.`user` - WHERE `Host`='".$_SESSION['install']['localsrv']."' AND `User`='".$_SESSION['install']['dbuser']."'"; - $intCount = $this->myDBClass->countRows($strSQL); - if ($intCount == 0) { - $strSQL = "CREATE USER '".$_SESSION['install']['dbuser']."'@'".$_SESSION['install']['localsrv']."' IDENTIFIED BY '".$_SESSION['install']['dbpass']."'"; - $booReturn = $this->myDBClass->insertData($strSQL ); - if ($booReturn == false) { - $intUserError = 1; - $strDBError = str_replace("::","
",$this->myDBClass->strErrorMessage); - } - } else if ($this->myDBClass->strErrorMessage == "") { - $intUserError = 2; - } else { - $intUserError = 1; - $strDBError = str_replace("::","
",$this->myDBClass->strErrorMessage); - } - if ($intUserError != 1) { - $booReturn = $this->myDBClass->insertData("FLUSH PRIVILEGES"); - $strSQL = "GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES ON `".$_SESSION['install']['dbname']."`.* - TO '".$_SESSION['install']['dbuser']."'@'".$_SESSION['install']['localsrv']."'"; - $booReturn = $this->myDBClass->insertData($strSQL); - if ($booReturn == false) { - $intUserError = 1; - $strDBError = str_replace("::","
",$this->myDBClass->strErrorMessage); - } - $booReturn = $this->myDBClass->insertData("FLUSH PRIVILEGES"); - } - } - if ($intUserError != 1) { - if ($intUserError == 2) { - $strStatusMessage = "".$this->translate("done")." (".$this->translate("Only added rights to existing user").": ".$_SESSION['install']['dbuser'].")"; - } else { - $strStatusMessage = "".$this->translate("done").""; - } - return(0); - } else { - $strErrorMessage .= $strDBError."
\n"; - $strStatusMessage = "".$this->translate("failed").""; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Update NagiosQL database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // $arrUpdate Array including all update files - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function updateQLDB(&$strStatusMessage,&$strErrorMessage,$arrUpdate) { - if (is_array($arrUpdate) && (count($arrUpdate) != 0)) { - $intUpdateOk = 0; - $intUpdateError = 0; - foreach($arrUpdate AS $elem) { - if ($intUpdateError == 0) { - if (is_readable($elem)) { - $filSqlNew = fopen($elem,"r"); - if ($filSqlNew) { - $strSqlCommand = ""; - $intSQLError = 0; - $intLineCount = 0; - while (!feof($filSqlNew)) { - $strLine = fgets($filSqlNew); - $strLine = trim($strLine); - if ($intSQLError == 1) continue; // skip if an error was found - $intLineCount++; - if ($strLine == "") continue; // skip empty lines - if (substr($strLine,0,2) == "--") continue; // skip comment lines - $strSqlCommand .= $strLine; - if (substr($strSqlCommand,-1) == ";") { - $booReturn = $this->myDBClass->insertData($strSqlCommand); - if ($booReturn == false) { - $intSQLError = 1; - $strErrorMessage .= str_replace("::","
",$this->myDBClass->strErrorMessage); - $intError = 1; - } - $strSqlCommand = ""; - } - } - if ($intSQLError == 0) { - $intUpdateOk++; - } else { - $strStatusMessage = "".$this->translate("failed")." (Line: ".$intLineCount." in file: ".$elem.")"; - $intUpdateError++; - } - } else { - $strStatusMessage = "".$this->translate("failed").""; - $strErrorMessage .= $this->translate("SQL file is not readable or empty")." (".$elem.")
\n"; - $intUpdateError++; - } - } else { - $strStatusMessage = "".$this->translate("failed").""; - $strErrorMessage .= $this->translate("SQL file is not readable or empty")." (".$elem.")
\n"; - $intUpdateError++; - } - } - } - if ($intUpdateError == 0) { - $strStatusMessage = "".$this->translate("done").""; - return(0); - } else { - return(1); - } - } else { - $strStatusMessage = "".$this->translate("failed").""; - $strErrorMessage .= $this->translate("No SQL update files available")."
\n"; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Create NagiosQL administrator - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function createNQLAdmin(&$strStatusMessage,&$strErrorMessage) { - // Create admin user - $strSQL = "SELECT `id` FROM `tbl_language` WHERE `locale`='".$_SESSION['install']['locale']."'"; - $intLang = $this->myDBClass->getFieldData($strSQL)+0; - if ($intLang == 0) $intLang = 1; - $strSQL = "INSERT INTO `tbl_user` (`id`, `username`, `alias`, `password`, `admin_enable`, `wsauth`, `active`, - `nodelete`, `language`, `domain`, `last_login`, `last_modified`) - VALUES (1, '".$_SESSION['install']['qluser']."', 'Administrator', md5('".$_SESSION['install']['qlpass']."'), - '1', '0', '1', '1', '".$intLang."', '1', '', NOW());"; - $booReturn = $this->myDBClass->insertData($strSQL); - $strDBError = str_replace("::","
",$this->myDBClass->strErrorMessage); - if ($booReturn) { - $strStatusMessage = "".$this->translate("done").""; - return(0); - } else { - $strErrorMessage .= $strDBError."
\n"; - $strStatusMessage = "".$this->translate("failed").""; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Update settings database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function updateSettingsDB(&$strStatusMessage,&$strErrorMessage) { - // Checking initial settings - $arrInitial[] = array('category'=>'db','name'=>'version','value'=>$_SESSION['install']['version']); - $arrInitial[] = array('category'=>'db','name'=>'type','value'=>$_SESSION['install']['dbtype']); - foreach ($_SESSION['init_settings'] AS $key => $elem) { - if ($key == 'db') continue; // do not store db values to database - foreach ($elem AS $key2=>$elem2) { - $arrInitial[] = array('category'=>$key,'name'=>$key2,'value'=>$elem2); - } - } - foreach ($arrInitial AS $elem) { - $strSQL1 = "SELECT `value` FROM `tbl_settings` WHERE `category`='".$elem['category']."' - AND `name`='".$elem['name']."'"; - $strSQL2 = "INSERT INTO `tbl_settings` (`category`, `name`, `value`) - VALUES ('".$elem['category']."', '".$elem['name']."', '".$elem['value']."')"; - $intCount = $this->myDBClass->countRows($strSQL1); - if ($intCount == 0) { - $booReturn = $this->myDBClass->insertData($strSQL2); - if ($booReturn == false) { - $strStatusMessage = "".$this->translate("failed").""; - $strErrorMessage .= $this->translate("Inserting initial data to settings database has failed:")."1
"; - $strErrorMessage .= str_replace("::","
",$this->myDBClass->strErrorMessage); - return(1); - } - } else if ($this->myDBClass->strErrorMessage != "") { - $strStatusMessage = "".$this->translate("failed").""; - $strErrorMessage .= $this->translate("Inserting initial data to settings database has failed:")."2
"; - $strErrorMessage .= str_replace("::","
",$this->myDBClass->strErrorMessage); - return(1); - } - } - // Update some values - $arrSettings[] = array('category'=>'db','name'=>'version','value'=>$_SESSION['install']['version']); - if (substr_count($_SERVER['SERVER_PROTOCOL'],"HTTPS") != 0) { - $arrSettings[] = array('category'=>'path','name'=>'protocol','value'=>'https'); - } else { - $arrSettings[] = array('category'=>'path','name'=>'protocol','value'=>'http'); - } - //$strBaseURL = str_replace("install/install.php","",$_SERVER["PHP_SELF"]); - //$arrSettings[] = array('category'=>'path','name'=>'base_url','value'=>$strBaseURL); - //$strBasePath = substr(realpath('.'),0,-7); - //$arrSettings[] = array('category'=>'path','name'=>'base_path','value'=>$strBasePath); - $arrSettings[] = array('category'=>'data','name'=>'locale','value'=>$_SESSION['install']['locale']); - foreach ($arrSettings AS $elem) { - $strSQL = "UPDATE `tbl_settings` SET `value`='".$elem['value']."' - WHERE `category` = '".$elem['category']."' AND `name` = '".$elem['name']."'"; - $booReturn = $this->myDBClass->insertData($strSQL); - if ($booReturn == false) { - $strStatusMessage = "".$this->translate("failed").""; - $strErrorMessage .= $this->translate("Inserting initial data to settings database has failed:"); - $strErrorMessage .= str_replace("::","
",$this->myDBClass->strErrorMessage); - return(1); - } - } - $strStatusMessage = "".$this->translate("done").""; - return(0); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Update settings file - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function updateSettingsFile(&$strStatusMessage,&$strErrorMessage) { - // open settings file - $strBaseURL = str_replace("install/install.php","",$_SERVER["PHP_SELF"]); - $strBasePath = substr(realpath('.'),0,-7); - $strE_ID = error_reporting(); - error_reporting(0); - $filSettings = fopen($strBasePath."config/settings.php","w"); - error_reporting($strE_ID); - if ($filSettings) { - // Write Database Configuration into settings.php - fwrite($filSettings,"\n"); - fwrite($filSettings,";///////////////////////////////////////////////////////////////////////////////\n"); - fwrite($filSettings,";\n"); - fwrite($filSettings,"; NagiosQL\n"); - fwrite($filSettings,";\n"); - fwrite($filSettings,";///////////////////////////////////////////////////////////////////////////////\n"); - fwrite($filSettings,";\n"); - fwrite($filSettings,"; Project : NagiosQL\n"); - fwrite($filSettings,"; Component: Database Configuration\n"); - fwrite($filSettings,"; Website : http://www.nagiosql.org\n"); - fwrite($filSettings,"; Date : ".date("F j, Y, g:i a")."\n"); - fwrite($filSettings,"; Version : ".$_SESSION['install']['version']."\n"); - fwrite($filSettings,";\n"); - fwrite($filSettings,";///////////////////////////////////////////////////////////////////////////////\n"); - fwrite($filSettings,"[db]\n"); - fwrite($filSettings,"type = ".$_SESSION['install']['dbtype']."\n"); - fwrite($filSettings,"server = ".$_SESSION['install']['dbserver']."\n"); - fwrite($filSettings,"port = ".$_SESSION['install']['dbport']."\n"); - fwrite($filSettings,"database = ".$_SESSION['install']['dbname']."\n"); - fwrite($filSettings,"username = ".$_SESSION['install']['dbuser']."\n"); - fwrite($filSettings,"password = ".$_SESSION['install']['dbpass']."\n"); - fwrite($filSettings,"[path]\n"); - fwrite($filSettings,"base_url = ".$strBaseURL."\n"); - fwrite($filSettings,"base_path = ".$strBasePath."\n"); - fclose($filSettings); - $strStatusMessage = "".$this->translate("done").""; - return(0); - } else { - $strStatusMessage = "".$this->translate("failed").""; - $strErrorMessage .= $this->translate("Connot open/write to config/settings.php")."
\n"; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Update settings database - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function updateQLpath(&$strStatusMessage,&$strErrorMessage) { - // Update configuration target database - $strNagiosQLpath = str_replace("//","/",$_SESSION['install']['qlpath']."/"); - $strNagiosPath = str_replace("//","/",$_SESSION['install']['nagpath']."/"); - $strSQL = "UPDATE `tbl_configtarget` SET - `basedir`='".$strNagiosQLpath."', - `hostconfig`='".$strNagiosQLpath."hosts/', - `serviceconfig`='".$strNagiosQLpath."services/', - `backupdir`='".$strNagiosQLpath."backup/', - `hostbackup`='".$strNagiosQLpath."backup/hosts/', - `servicebackup`='".$strNagiosQLpath."backup/services/', - `nagiosbasedir`='".$strNagiosPath."', - `importdir`='".$strNagiosPath."objects/', - `conffile`='".$strNagiosPath."nagios.cfg', - `last_modified`=NOW() - WHERE `target`='localhost'"; - $booReturn = $this->myDBClass->insertData($strSQL); - if ($booReturn == false) { - $strStatusMessage = "".$this->translate("failed").""; - $strErrorMessage .= $this->translate("Inserting path data to database has failed:")." ".str_replace("::","
",$this->myDBClass->strErrorMessage)."\n"; - return(1); - } - // Create real paths - if ($_SESSION['install']['createpath'] == 1) { - if (is_writable($strNagiosQLpath) && is_dir($strNagiosQLpath) && is_executable($strNagiosQLpath)) { - if (!file_exists($strNagiosQLpath."hosts")) mkdir($strNagiosQLpath."hosts",0755); - if (!file_exists($strNagiosQLpath."services")) mkdir($strNagiosQLpath."services",0755); - if (!file_exists($strNagiosQLpath."backup")) mkdir($strNagiosQLpath."backup",0755); - if (!file_exists($strNagiosQLpath."backup/hosts")) mkdir($strNagiosQLpath."backup/hosts",0755); - if (!file_exists($strNagiosQLpath."backup/services")) mkdir($strNagiosQLpath."backup/services",0755); - $strStatusMessage = "".$this->translate("done")." (".$this->translate("Check the permissions of the created paths!").")"; - return(0); - } else { - $strStatusMessage = "".$this->translate("failed").""; - $strErrorMessage .= $this->translate("NagiosQL config path is not writeable - only database values updated")."
\n"; - return(1); - } - } - $strStatusMessage = "".$this->translate("done").""; - return(0); - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Converting NagiosQL database to utf-8 - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function convQLDB(&$strStatusMessage,&$strErrorMessage) { - $strDBError = ""; - if ($_SESSION['install']['dbtype'] == "mysqli") { - $strSQL = "ALTER DATABASE `".$_SESSION['install']['dbname']."` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci"; - $booReturn = $this->myDBClass->insertData($strSQL); - $strDBError = str_replace("::","
",$this->myDBClass->strErrorMessage); - } - if ($strDBError == "") { - $strStatusMessage = "".$this->translate("done").""; - return(0); - } else { - $strErrorMessage .= $this->translate("Database errors while converting to utf-8:")."
".$strDBError."
\n"; - $strStatusMessage = "".$this->translate("failed").""; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Converting NagiosQL database tables to utf-8 - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function convQLDBTables(&$strStatusMessage,&$strErrorMessage) { - // Read version string from DB - if ($_SESSION['install']['dbtype'] == "mysqli") { - $strSQL = "SHOW TABLES FROM `".$_SESSION['install']['dbname']."`"; - $booReturn = $this->myDBClass->getDataArray($strSQL,$arrDataset,$intDataCount); - if ($intDataCount != 0) { - foreach ($arrDataset AS $elem) { - if ($intError == 1) continue; - $strSQL = "ALTER TABLE `".$elem[0]."` DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci"; - $booReturn = $this->myDBClass->insertData($strSQL); - if ($booReturn == false) { - $intError = 1; - $strDBError = str_replace("::","
",$this->myDBClass->strErrorMessage); - } - } - } - } else { - $strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")
\n"; - $strStatusMessage = "".translate("failed").""; - return(1); - } - if ($strDBError == "") { - $strStatusMessage = "".translate("done").""; - return(0); - } else { - $strErrorMessage .= translate("Database errors while converting to utf-8:")."
".$strDBError."
\n"; - $strStatusMessage = "".translate("failed").""; - return(1); - } - } - /////////////////////////////////////////////////////////////////////////////////////////// - // Function: Converting NagiosQL database tables to utf-8 - /////////////////////////////////////////////////////////////////////////////////////////// - // - // Parameter: strStatusMessage Array variable for status message - // $strErrorMessage Error string - // - // Return values: Status variable (0=ok,1=failed) - // - /////////////////////////////////////////////////////////////////////////////////////////// - function convQLDBFields(&$strStatusMessage,&$strErrorMessage) { - // Read version string from DB - $strSQL1 = "SHOW TABLES FROM `".$_SESSION['install']['dbname']."`"; - $booReturn = $this->myDBClass->getDataArray($strSQL1,$arrDataset1,$intDataCount1); - if ($intDataCount1 != 0) { - foreach ($arrDataset1 AS $elem1) { - if ($intError == 1) continue; - $strSQL2 = "SHOW FULL FIELDS FROM `".$elem1[0]."` WHERE (`Type` LIKE '%varchar%' OR `Type` LIKE '%enum%' - OR `Type` LIKE '%text%') AND Collation <> 'utf8_unicode_ci'"; - $booReturn = $this->myDBClass->getDataArray($strSQL2,$arrDataset2,$intDataCount2); - if ($intDataCount2 != 0) { - foreach ($arrDataset2 AS $elem2) { - if ($intError2 == 1) continue; - if (($elem2[5] === NULL) && ($elem2[3] == 'YES')){ - $strDefault = "DEFAULT NULL"; - } else if ($elem2[5] != '') { - $strDefault = "DEFAULT '".$elem2[5]."'"; - } else { - $strDefault = ""; - } - if ($elem2[3] == 'YES') { $strNull = 'NULL'; } else { $strNull = 'NOT NULL'; } - $strSQL3 = "ALTER TABLE `".$elem[0]."` CHANGE `".$elem2[0]."` `".$elem2[0]."` ".$elem2[1]." - CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci' $strNull $strDefault"; - $booReturn = $this->myDBClass->insertData($strSQL3); - if ($booReturn == false) { - $intError2 = 1; - $strDBError = "Table:".$elem[0]." - Field: ".$elem2[0]." ".$this->myDBClass->strErrorMessage; - } - } - } - } - } else { - $strErrorMessage .= translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")
\n"; - $strStatusMessage = "".translate("failed").""; - return(1); - } - if ($strDBError == "") { - $strStatusMessage = "".translate("done").""; - return(0); - } else { - $strErrorMessage .= translate("Database errors while converting to utf-8:")."
".$strDBError."
\n"; - $strStatusMessage = "".translate("failed").""; - return(1); - } - } -} -?> \ No newline at end of file diff --git a/install/functions/prepend_install.php b/install/functions/prepend_install.php index 21b4cca..27df38a 100644 --- a/install/functions/prepend_install.php +++ b/install/functions/prepend_install.php @@ -4,23 +4,21 @@ // NagiosQL /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Installer preprocessing script -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// error_reporting(E_ALL); // // Define common variables // ======================= -$strErrorMessage = ""; // All error messages (red) -$strInfoMessage = ""; // All information messages (green) +$strErrorMessage = ''; // All error messages (red) +$strInfoMessage = ''; // All information messages (green) // // Start PHP session // ================= @@ -28,9 +26,9 @@ session_start([ 'name' => 'nagiosql_install']); // // Include external function/class files // ===================================== -include("functions/install_class.php"); +require $preBasePath.'functions/Autoloader.php'; +functions\Autoloader::register($preBasePath); // // Initialize class // ================ -$myInstClass = new naginstall; -?> \ No newline at end of file +$myInstClass = new install\functions\NagInstallClass($_SESSION); diff --git a/install/index.php b/install/index.php index b1a5df0..3975ef1 100644 --- a/install/index.php +++ b/install/index.php @@ -5,33 +5,36 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Installer main script -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(install/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$preContent = "templates/index.tpl.htm"; -$preEncode = 'utf-8'; -$preLocale = "../config/locale"; -$filConfig = "../config/settings.php"; -$preDBType = "mysql"; -$strLangOpt = ""; -$strVersion = "3.3.0"; +$preContent = $preBasePath.'install/templates/index.htm.tpl'; +$preEncode = 'utf-8'; +$preLocale = $preBasePath.'config/locale'; +$filConfig = $preBasePath.'config/settings.php'; +$strLangOpt = ''; +$strVersion = '3.4.0'; $intUpdate = 0; $intError = 0; // // Include preprocessing file // ========================== -require("functions/prepend_install.php"); +require $preBasePath.'install/functions/prepend_install.php'; // // Restart session // =============== @@ -40,173 +43,163 @@ session_start([ 'name' => 'nagiosql_install']); // // POST parameters // =============== -$arrLocale = array("zh_CN","de_DE","da_DK","en_GB","fr_FR","it_IT","ja_JP","nl_NL","pl_PL","pt_BR","ru_RU","es_ES"); -$chkLocale = (isset($_POST['selLanguage']) && in_array($_POST['selLanguage'],$arrLocale)) ? $_POST['selLanguage'] : "no"; +$arrLocale = array('zh_CN', 'de_DE', 'da_DK', 'en_GB', 'fr_FR', 'it_IT', 'ja_JP', 'nl_NL', 'pl_PL', 'pt_BR', 'ru_RU', + 'es_ES'); +$chkLocale = filter_input(INPUT_POST, 'selLanguage', FILTER_SANITIZE_STRING); +if (!in_array($chkLocale, $arrLocale, true)) { + $chkLocale = 'no'; +} // // Language settings // ================= if (extension_loaded('gettext')) { - if ($chkLocale == "no") { - if (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2) == "de") { - $chkLocale = 'de_DE'; - } else { - $chkLocale = 'en_GB'; - } - } - putenv("LC_ALL=".$chkLocale.".".$preEncode); - putenv("LANG=".$chkLocale.".".$preEncode); - // GETTEXT domain - setlocale(LC_ALL, $chkLocale.".".$preEncode); - bindtextdomain($chkLocale, $preLocale); - bind_textdomain_codeset($chkLocale, $preEncode); - textdomain($chkLocale); - $arrTemplate['NAGIOS_FAQ'] = $myInstClass->translate("Online Documentation"); - // Language selection field - $arrTemplate['LANGUAGE'] = $myInstClass->translate("Language"); - foreach($myInstClass->getLangData() AS $key => $elem) { - $strLangOpt .= "\n"; - if ($key != $chkLocale) { $strLangOpt = str_replace(" {sel}","",$strLangOpt); } else { $strLangOpt = str_replace(" {sel}"," selected",$strLangOpt); } - } - $arrTemplate['LANG_OPTION'] = $strLangOpt; + if ($chkLocale == 'no') { + if (0 === strpos(filter_input(INPUT_SERVER, 'HTTP_ACCEPT_LANGUAGE', FILTER_SANITIZE_STRING), 'de')) { + $chkLocale = 'de_DE'; + } else { + $chkLocale = 'en_GB'; + } + } + putenv('LC_ALL=' .$chkLocale. '.' .$preEncode); + putenv('LANG=' .$chkLocale. '.' .$preEncode); + setlocale(LC_ALL, $chkLocale. '.' .$preEncode); + bindtextdomain($chkLocale, $preLocale); + bind_textdomain_codeset($chkLocale, $preEncode); + textdomain($chkLocale); + $arrTemplate['NAGIOS_FAQ'] = $myInstClass->translate('Online Documentation'); + // Language selection field + $arrTemplate['LANGUAGE'] = $myInstClass->translate('Language'); + foreach ($myInstClass->getLangData() as $key => $elem) { + $strLangOpt .= "\n"; + if ($key != $chkLocale) { + $strLangOpt = str_replace(' {sel}', '', $strLangOpt); + } else { + $strLangOpt = str_replace(' {sel}', ' selected', $strLangOpt); + } + } + $arrTemplate['LANG_OPTION'] = $strLangOpt; } else { - $intError = 1; - $strErrorMessage .= "Installation cannot continue, please make sure you have the php-gettext extension loaded!"; + $intError = 1; + $strErrorMessage .= 'Installation cannot continue, please make sure you have the php-gettext extension loaded!'; } // // Checking current installation // ============================= // Does the settings file exist? if (file_exists($filConfig) && is_readable($filConfig)) { - $preSettings = parse_ini_file($filConfig,true); - // Are there any connection data? - if (isset($preSettings['db']) && isset($preSettings['db']['server']) && isset($preSettings['db']['port']) && - isset($preSettings['db']['database']) && isset($preSettings['db']['username']) && isset($preSettings['db']['password'])) { - // Copy settings to session - $_SESSION['SETS'] = $preSettings; - // Existing postgres database? - if (isset($preSettings['db']['dbtype']) && ($preSettings['db']['dbtype'] == "postgres")) { - $preDBType = "pgsql"; - $_SESSION['install']['dbtype'] = $preDBType; - } - // Select database - $intDBFallback = 0; - if (isset($preSettings['db']['type'])) { - if ($preSettings['db']['type'] == "mysqli") { - if (extension_loaded('mysqli')) { - // Include mysqli class - include("../functions/mysqli_class.php"); - // Initialize mysqli class - $myDBClass = new mysqlidb; - } else { - $intDBFallback = 1; - } - $_SESSION['install']['dbtype'] = 'mysqli'; - } else { - $intDBFallback = 1; - } - } else { - if (extension_loaded('mysqli')) { - // Include mysql class - include("../functions/mysqli_class.php"); - // Initialize mysql class - $myDBClass = new mysqldb; - } else { - $intDBFallback = 1; - } - $_SESSION['install']['dbtype'] = 'mysqli'; - $preSettings['db']['type'] = 'mysqli'; - } - // Set DB parameters - $myDBClass->arrParams['server'] = $preSettings['db']['server']; - $myDBClass->arrParams['port'] = $preSettings['db']['port']; - $myDBClass->arrParams['username'] = $preSettings['db']['username']; - $myDBClass->arrParams['password'] = $preSettings['db']['password']; - $myDBClass->arrParams['database'] = $preSettings['db']['database']; - $myDBClass->getdatabase(); - // DB failure - if ($intDBFallback == 1) { - $_SESSION['install']['dbtype'] = 'mysqli'; - $preSettings['db']['type'] = 'mysqli'; - $intUpdate = 0; - } else { - if ($myDBClass->error == true) { - $strErrorMessage .= $myInstClass->translate("Database connection failed. Upgrade not available!")."
"; - $strErrorMessage .= str_replace("::","
",$myDBClass->strErrorMessage)."
"; - } else { - $strSQL = "SELECT category,name,value FROM tbl_settings"; - $booReturn = $myDBClass->getDataArray($strSQL,$arrDataLines,$intDataCount); - if ($booReturn == false) { - $strErrorMessage .= $myInstClass->translate("Settings table not available or wrong. Upgrade not available!")."
"; - $strErrorMessage .= str_replace("::","
",$myDBClass->strErrorMessage)."
"; - - } else if ($intDataCount != 0) { - foreach ($arrDataLines AS $elem) { - $preSettings[$elem['category']][$elem['name']] = $elem['value']; - } - $intUpdate = 1; - } - } - } - } else { - $strErrorMessage .= $myInstClass->translate("Database values in settings file are missing (config/settings.php). Upgrade not available!"); - } + $preSettings = parse_ini_file($filConfig, true); + // Are there any database connection data? + if (isset($preSettings['db']) && isset($preSettings['db']['server']) && isset($preSettings['db']['port']) && + isset($preSettings['db']['database']) && isset($preSettings['db']['username']) && + isset($preSettings['db']['password'])) { + // Old mysql db module is no longer supported + if (!isset($preSettings['db']['type']) || ($preSettings['db']['type'] == 'mysql') || + ($preSettings['db']['type'] == '')) { + $preSettings['db']['type'] = 'mysqli'; + } + // Copy settings to session + $_SESSION['SETS'] = $preSettings; + // Select database + $intDBFallback = 0; + if (($preSettings['db']['type'] == 'mysqli') && extension_loaded('mysqli')) { + // Initialize mysqli class + $myDBClass = new functions\MysqliDbClass; + // Set DB parameters + $myDBClass->arrParams['server'] = $preSettings['db']['server']; + $myDBClass->arrParams['port'] = $preSettings['db']['port']; + $myDBClass->arrParams['username'] = $preSettings['db']['username']; + $myDBClass->arrParams['password'] = $preSettings['db']['password']; + $myDBClass->arrParams['database'] = $preSettings['db']['database']; + $myDBClass->hasDBConnection(); + if ($myDBClass->error == true) { + $strErrorMessage .= $myInstClass->translate('Database connection failed. Upgrade not available!') . + '
'; + $strErrorMessage .= str_replace('::', '
', $myDBClass->strErrorMessage) . '
'; + } else { + $strSQL = 'SELECT `category`, `name`, `value` FROM `tbl_settings`'; + $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); + if ($booReturn == false) { + $strErrorMessage .= $myInstClass->translate('Settings table not available or wrong. ' + . 'Upgrade not available!'). '
'; + $strErrorMessage .= str_replace('::', '
', $myDBClass->strErrorMessage) . '
'; + } elseif ($intDataCount != 0) { + foreach ($arrDataLines as $elem) { + $preSettings[$elem['category']][$elem['name']] = $elem['value']; + } + $intUpdate = 1; + } + } + } else { + $strErrorMessage .= $myInstClass->translate('Invalid database type in settings file ' + . '(config/settings.php). Upgrade not available!'); + } + } else { + $strErrorMessage .= $myInstClass->translate('Database values in settings file are missing ' + . '(config/settings.php). Upgrade not available!'); + } } else { - $strErrorMessage .= $myInstClass->translate("Settings file not found or not readable (config/settings.php). Upgrade not available!"); + $strErrorMessage .= $myInstClass->translate('Settings file not found or not readable (config/settings.php). ' + . 'Upgrade not available!'); } // // Initial settings (new installation) // =================================== -$filInit = "functions/initial_settings.php"; +$filInit = 'functions/initial_settings.php'; if (file_exists($filInit) && is_readable($filInit)) { - $preInit = parse_ini_file($filInit,true); - $_SESSION['init_settings'] = $preInit; + $preInit = parse_ini_file($filInit, true); + $_SESSION['init_settings'] = $preInit; } else { - $strErrorMessage .= $myInstClass->translate("Default values file is not available or not readable (install/functions/initial_settings.php). Installation possible, but without predefined data!"); + $strErrorMessage .= $myInstClass->translate('Default values file is not available or not readable ' + . '(install/functions/initial_settings.php). Installation possible, ' + . 'but without predefined data!'); } // // Build content // ============= -$arrTemplate['PAGETITLE'] = "[NagiosQL] ".$myInstClass->translate("Installation wizard"); -$arrTemplate['MAIN_TITLE'] = $myInstClass->translate("Welcome to the NagiosQL installation wizard"); -$arrTemplate['TEXT_PART_1'] = $myInstClass->translate("This wizard will help you to install and configure NagiosQL."); -$arrTemplate['TEXT_PART_2'] = $myInstClass->translate("For questions please visit").": "; -$arrTemplate['TEXT_PART_3'] = $myInstClass->translate("First let's check your local environment and find out if everything NagiosQL needs is available."); -$arrTemplate['TEXT_PART_4'] = $myInstClass->translate("The basic requirements are:"); -$arrTemplate['TEXT_PART_5'] = $myInstClass->translate("PHP 5.2.0 or greater including:"); -$arrTemplate['TEXT_PHP_REQ_1'] = $myInstClass->translate("PHP database module:")." ". - $myInstClass->translate("supported types are")." mysqli"; -$arrTemplate['TEXT_PHP_REQ_2'] = $myInstClass->translate("PHP module:")." session"; -$arrTemplate['TEXT_PHP_REQ_3'] = $myInstClass->translate("PHP module:")." gettext"; -$arrTemplate['TEXT_PHP_REQ_6'] = $myInstClass->translate("PHP module:")." filter"; -$arrTemplate['TEXT_PHP_REQ_8'] = $myInstClass->translate("PHP module:")." FTP ".$myInstClass->translate("(optional)"); -$arrTemplate['TEXT_PHP_REQ_10'] = $myInstClass->translate("PECL extension:")." SSH ".$myInstClass->translate("(optional)"); -$arrTemplate['TEXT_PART_6'] = $myInstClass->translate("php.ini options").":"; -$arrTemplate['TEXT_INI_REQ_1'] = $myInstClass->translate("file_uploads on (for upload features)"); -$arrTemplate['TEXT_INI_REQ_2'] = $myInstClass->translate("session.auto_start needs to be off"); -$arrTemplate['TEXT_PART_7'] = $myInstClass->translate("A database server"); -$arrTemplate['TEXT_PART_8'] = $myInstClass->translate("Nagios 2.x/3.x/4.x"); -$arrTemplate['TEXT_PART_9'] = $myInstClass->translate("NagiosQL version")." ".$strVersion; -$arrTemplate['LOCALE'] = $chkLocale; -$arrTemplate['ONLINE_DOC'] = $myInstClass->translate("Online documentation"); +$arrTemplate['PAGETITLE'] = '[NagiosQL] ' .$myInstClass->translate('Installation wizard'); +$arrTemplate['MAIN_TITLE'] = $myInstClass->translate('Welcome to the NagiosQL installation wizard'); +$arrTemplate['TEXT_PART_1'] = $myInstClass->translate('This wizard will help you to install and configure ' + . 'NagiosQL.'); +$arrTemplate['TEXT_PART_2'] = $myInstClass->translate('For questions please visit'). ': '; +$arrTemplate['TEXT_PART_3'] = $myInstClass->translate("First let's check your local environment and find out if " + . 'everything NagiosQL needs is available.'); +$arrTemplate['TEXT_PART_4'] = $myInstClass->translate('The basic requirements are:'); +$arrTemplate['TEXT_PART_5'] = $myInstClass->translate('PHP 5.5.0 or greater including:'); +$arrTemplate['TEXT_PHP_REQ_1'] = $myInstClass->translate('PHP database module:'). ' ' . + $myInstClass->translate('supported types are'). ' mysqli'; +$arrTemplate['TEXT_PHP_REQ_2'] = $myInstClass->translate('PHP module:'). ' session'; +$arrTemplate['TEXT_PHP_REQ_3'] = $myInstClass->translate('PHP module:'). ' gettext'; +$arrTemplate['TEXT_PHP_REQ_6'] = $myInstClass->translate('PHP module:'). ' filter'; +$arrTemplate['TEXT_PHP_REQ_8'] = $myInstClass->translate('PHP module:'). ' FTP ' . + $myInstClass->translate('(optional)'); +$arrTemplate['TEXT_PHP_REQ_10'] = $myInstClass->translate('PECL extension:'). ' SSH ' . + $myInstClass->translate('(optional)'); +$arrTemplate['TEXT_PART_6'] = $myInstClass->translate('php.ini options'). ':'; +$arrTemplate['TEXT_INI_REQ_1'] = $myInstClass->translate('file_uploads on (for upload features)'); +$arrTemplate['TEXT_INI_REQ_2'] = $myInstClass->translate('session.auto_start needs to be off'); +$arrTemplate['TEXT_PART_7'] = $myInstClass->translate('A database server'); +$arrTemplate['TEXT_PART_8'] = $myInstClass->translate('Nagios 2.x/3.x/4.x'); +$arrTemplate['TEXT_PART_9'] = $myInstClass->translate('NagiosQL version'). ' ' .$strVersion; +$arrTemplate['LOCALE'] = $chkLocale; +$arrTemplate['ONLINE_DOC'] = $myInstClass->translate('Online documentation'); // // New installation or upgrade // =========================== -$arrTemplate['NEW_INSTALLATION'] = $myInstClass->translate("START INSTALLATION"); -$arrTemplate['UPDATE'] = $myInstClass->translate("START UPDATE"); -$arrTemplate['DISABLE_NEW'] = ""; -$arrTemplate['UPDATE_ERROR'] = "".$strErrorMessage.""; +$arrTemplate['NEW_INSTALLATION'] = $myInstClass->translate('START INSTALLATION'); +$arrTemplate['UPDATE'] = $myInstClass->translate('START UPDATE'); +$arrTemplate['DISABLE_NEW'] = ''; +$arrTemplate['UPDATE_ERROR'] = '
' .$strErrorMessage. '
'; if ($intUpdate == 1) { - $arrTemplate['DISABLE_UPDATE'] = ""; + $arrTemplate['DISABLE_UPDATE'] = ''; } else { - $arrTemplate['DISABLE_UPDATE'] = "disabled=\disabled\""; + $arrTemplate['DISABLE_UPDATE'] = "disabled=\disabled\""; } if ($intError == 1) { - $arrTemplate['DISABLE_NEW'] = "disabled=\disabled\""; - $arrTemplate['DISABLE_UPDATE'] = "disabled=\disabled\""; + $arrTemplate['DISABLE_NEW'] = "disabled=\disabled\""; + $arrTemplate['DISABLE_UPDATE'] = "disabled=\disabled\""; } // // Write content // ============= -$strContent = $myInstClass->parseTemplate($arrTemplate,$preContent); +$strContent = $myInstClass->parseTemplate($arrTemplate, $preContent); echo $strContent; -?> \ No newline at end of file diff --git a/install/install.php b/install/install.php index 2ba93fe..e071f8a 100644 --- a/install/install.php +++ b/install/install.php @@ -5,129 +5,217 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Installer script - check page -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // +// Path settings +// =================== +$strPattern = '(install/[^/]*.php)'; +$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_STRING)); +$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME', FILTER_SANITIZE_STRING)); +// // Define common variables // ======================= -$preContent = "templates/install.tpl.htm"; -$preEncode = 'utf-8'; -$preLocale = "../config/locale"; -$chkModus = "none"; +$preContent = $preBasePath.'install/templates/install.htm.tpl'; +$preEncode = 'utf-8'; +$preLocale = $preBasePath.'config/locale'; +$chkModus = 'none'; // // Include preprocessing file // ========================== -require("functions/prepend_install.php"); +require $preBasePath.'install/functions/prepend_install.php'; // // Actual database files // ===================== -$preSqlNewInstall = "sql/nagiosQL_v32_db_mysql.sql"; -$preSqlUpdateLast = "sql/update_31x_320.sql"; -$preNagiosQL_ver = "3.3.0"; +$preSqlNewInstall = $preBasePath.'install/sql/nagiosQL_v34_db_mysql.sql'; +$preSqlUpdateLast = $preBasePath.'install/sql/update_320_340.sql'; +$preNagiosQL_ver = '3.4.0'; // // Process initial value // ===================== -if (!isset($_SESSION['init_settings'])) header("Location: index.php"); -$strInitDBtype = isset($_SESSION['SETS']['db']['type']) ? $_SESSION['SETS']['db']['type'] : $_SESSION['init_settings']['db']['type']; -$strInitDBserver = isset($_SESSION['SETS']['db']['server']) ? $_SESSION['SETS']['db']['server'] : $_SESSION['init_settings']['db']['server']; -$strInitDBname = isset($_SESSION['SETS']['db']['database']) ? $_SESSION['SETS']['db']['database'] : $_SESSION['init_settings']['db']['database']; -$strInitDBuser = isset($_SESSION['SETS']['db']['username']) ? $_SESSION['SETS']['db']['username'] : $_SESSION['init_settings']['db']['username']; -$strInitDBpass = isset($_SESSION['SETS']['db']['password']) ? $_SESSION['SETS']['db']['password'] : $_SESSION['init_settings']['db']['password']; -$strInitDBport = isset($_SESSION['SETS']['db']['port']) ? $_SESSION['SETS']['db']['port'] : $_SESSION['init_settings']['db']['port']; +if (!isset($_SESSION['init_settings'])) { + header('Location: index.php'); + exit; +} +$strInitDBtype = isset($_SESSION['SETS']['db']['type']) ? $_SESSION['SETS']['db']['type'] + : $_SESSION['init_settings']['db']['type']; +$strInitDBserver = isset($_SESSION['SETS']['db']['server']) ? $_SESSION['SETS']['db']['server'] + : $_SESSION['init_settings']['db']['server']; +$strInitDBname = isset($_SESSION['SETS']['db']['database']) ? $_SESSION['SETS']['db']['database'] + : $_SESSION['init_settings']['db']['database']; +$strInitDBuser = isset($_SESSION['SETS']['db']['username']) ? $_SESSION['SETS']['db']['username'] + : $_SESSION['init_settings']['db']['username']; +$strInitDBpass = isset($_SESSION['SETS']['db']['password']) ? $_SESSION['SETS']['db']['password'] + : $_SESSION['init_settings']['db']['password']; +$strInitDBport = isset($_SESSION['SETS']['db']['port']) ? $_SESSION['SETS']['db']['port'] + : $_SESSION['init_settings']['db']['port']; // // Init session parameters // ======================= -if (!isset($_SESSION['install']['jscript'])) $_SESSION['install']['jscript'] = "no"; -if (!isset($_SESSION['install']['locale'])) $_SESSION['install']['locale'] = "en_GB"; -if (!isset($_SESSION['install']['dbtype'])) $_SESSION['install']['dbtype'] = $strInitDBtype; -if (!isset($_SESSION['install']['dbserver'])) $_SESSION['install']['dbserver'] = $strInitDBserver; -if (!isset($_SESSION['install']['localsrv'])) $_SESSION['install']['localsrv'] = ""; -if (!isset($_SESSION['install']['dbname'])) $_SESSION['install']['dbname'] = $strInitDBname; -if (!isset($_SESSION['install']['dbuser'])) $_SESSION['install']['dbuser'] = $strInitDBuser; -if (!isset($_SESSION['install']['dbpass'])) $_SESSION['install']['dbpass'] = $strInitDBpass; -if (!isset($_SESSION['install']['admuser'])) $_SESSION['install']['admuser'] = "root"; -if (!isset($_SESSION['install']['admpass'])) $_SESSION['install']['admpass'] = ""; -if (!isset($_SESSION['install']['qluser'])) $_SESSION['install']['qluser'] = "admin"; -if (!isset($_SESSION['install']['qlpass'])) $_SESSION['install']['qlpass'] = ""; -if (!isset($_SESSION['install']['dbport'])) $_SESSION['install']['dbport'] = $strInitDBport; -if (!isset($_SESSION['install']['dbdrop'])) $_SESSION['install']['dbdrop'] = 0; -if (!isset($_SESSION['install']['sample'])) $_SESSION['install']['sample'] = 0; -if (!isset($_SESSION['install']['version'])) $_SESSION['install']['version'] = $preNagiosQL_ver; -if (!isset($_SESSION['install']['createpath'])) $_SESSION['install']['createpath'] = 0; -if (!isset($_SESSION['install']['qlpath'])) $_SESSION['install']['qlpath'] = "/etc/nagiosql"; -if (!isset($_SESSION['install']['nagpath'])) $_SESSION['install']['nagpath'] = "/etc/nagios"; +if (!isset($_SESSION['install']['jscript'])) { + $_SESSION['install']['jscript'] = 'no'; +} +if (!isset($_SESSION['install']['locale'])) { + $_SESSION['install']['locale'] = 'en_GB'; +} +if (!isset($_SESSION['install']['dbtype'])) { + $_SESSION['install']['dbtype'] = $strInitDBtype; +} +if (!isset($_SESSION['install']['dbserver'])) { + $_SESSION['install']['dbserver'] = $strInitDBserver; +} +if (!isset($_SESSION['install']['localsrv'])) { + $_SESSION['install']['localsrv'] = ''; +} +if (!isset($_SESSION['install']['dbname'])) { + $_SESSION['install']['dbname'] = $strInitDBname; +} +if (!isset($_SESSION['install']['dbuser'])) { + $_SESSION['install']['dbuser'] = $strInitDBuser; +} +if (!isset($_SESSION['install']['dbpass'])) { + $_SESSION['install']['dbpass'] = $strInitDBpass; +} +if (!isset($_SESSION['install']['admuser'])) { + $_SESSION['install']['admuser'] = 'root'; +} +if (!isset($_SESSION['install']['admpass'])) { + $_SESSION['install']['admpass'] = ''; +} +if (!isset($_SESSION['install']['qluser'])) { + $_SESSION['install']['qluser'] = 'admin'; +} +if (!isset($_SESSION['install']['qlpass'])) { + $_SESSION['install']['qlpass'] = ''; +} +if (!isset($_SESSION['install']['dbport'])) { + $_SESSION['install']['dbport'] = $strInitDBport; +} +if (!isset($_SESSION['install']['dbdrop'])) { + $_SESSION['install']['dbdrop'] = 0; +} +if (!isset($_SESSION['install']['sample'])) { + $_SESSION['install']['sample'] = 0; +} +if (!isset($_SESSION['install']['version'])) { + $_SESSION['install']['version'] = $preNagiosQL_ver; +} +if (!isset($_SESSION['install']['createpath'])) { + $_SESSION['install']['createpath'] = 0; +} +if (!isset($_SESSION['install']['qlpath'])) { + $_SESSION['install']['qlpath'] = '/etc/nagiosql'; +} +if (!isset($_SESSION['install']['nagpath'])) { + $_SESSION['install']['nagpath'] = '/etc/nagios'; +} // // POST parameters // =============== -$arrStep = array(1,2,3); -$chkStep = (isset($_POST['hidStep']) && in_array($_POST['hidStep'],$arrStep)) ? $_POST['hidStep']+0 : "1"; -if (isset($_GET['step']) && in_array($_GET['step'],$arrStep)) $chkStep = $_GET['step']+0; -if (!in_array($chkStep,$arrStep)) $arrStep = 1; -// Session values -$_SESSION['install']['locale'] = isset($_POST['hidLocale']) ? $_POST['hidLocale'] : $_SESSION['install']['locale']; -$_SESSION['install']['jscript'] = isset($_POST['hidJScript']) ? $_POST['hidJScript'] : $_SESSION['install']['jscript']; -$_SESSION['install']['dbtype'] = isset($_POST['selDBtype']) ? $_POST['selDBtype'] : $_SESSION['install']['dbtype']; -$_SESSION['install']['dbserver'] = isset($_POST['tfDBserver']) ? $_POST['tfDBserver'] : $_SESSION['install']['dbserver']; -$_SESSION['install']['localsrv'] = isset($_POST['tfLocalSrv']) ? $_POST['tfLocalSrv'] : $_SESSION['install']['localsrv']; -$_SESSION['install']['dbname'] = isset($_POST['tfDBname']) ? $_POST['tfDBname'] : $_SESSION['install']['dbname']; -$_SESSION['install']['dbuser'] = isset($_POST['tfDBuser']) ? $_POST['tfDBuser'] : $_SESSION['install']['dbuser']; -$_SESSION['install']['dbpass'] = isset($_POST['tfDBpass']) ? $_POST['tfDBpass'] : $_SESSION['install']['dbpass']; -$_SESSION['install']['admuser'] = isset($_POST['tfDBprivUser']) ? $_POST['tfDBprivUser'] : $_SESSION['install']['admuser']; -$_SESSION['install']['admpass'] = isset($_POST['tfDBprivPass']) ? $_POST['tfDBprivPass'] : $_SESSION['install']['admpass']; -$_SESSION['install']['qluser'] = isset($_POST['tfQLuser']) ? $_POST['tfQLuser'] : $_SESSION['install']['qluser']; -$_SESSION['install']['qlpass'] = isset($_POST['tfQLpass']) ? $_POST['tfQLpass'] : $_SESSION['install']['qlpass']; -$_SESSION['install']['dbport'] = isset($_POST['tfDBport']) ? $_POST['tfDBport']+0 : $_SESSION['install']['dbport']; -$_SESSION['install']['dbdrop'] = isset($_POST['chbDrop']) ? $_POST['chbDrop']+0 : 0; -$_SESSION['install']['sample'] = isset($_POST['chbSample']) ? $_POST['chbSample']+0 : 0; -$_SESSION['install']['createpath'] = isset($_POST['chbPath']) ? $_POST['chbPath']+0 : 0; -$_SESSION['install']['qlpath'] = isset($_POST['tfQLpath']) ? $_POST['tfQLpath'] : $_SESSION['install']['qlpath']; -$_SESSION['install']['nagpath'] = isset($_POST['tfNagiosPath']) ? $_POST['tfNagiosPath'] : $_SESSION['install']['nagpath']; - - -$preSqlNewInstall = str_replace("DBTYPE",$_SESSION['install']['dbtype'],$preSqlNewInstall); -$preSqlNewInstall = str_replace("mysqli","mysql",$preSqlNewInstall); - -if (isset($_POST['butNewInstall'])) $chkModus = "Installation"; -if (isset($_POST['butUpgrade'])) $chkModus = "Update"; -if (!isset($_SESSION['install']['mode'])) $_SESSION['install']['mode'] = $chkModus; +$arrStep = array(1,2,3); +$chkStep = filter_input(INPUT_POST, 'hidStep', FILTER_VALIDATE_INT); +if (!in_array($chkStep, $arrStep, true)) { + $chkStep = 1; +} +$chkStepG = filter_input(INPUT_GET, 'step', FILTER_VALIDATE_INT); +if (($chkStepG != null) && in_array($chkStepG, $arrStep, true)) { + $chkStep = $chkStepG; +} +// +// Set session values +// ================== +$_SESSION['install']['locale'] = (filter_input(INPUT_POST, 'hidLocale') != null) ? + filter_input(INPUT_POST, 'hidLocale', FILTER_SANITIZE_STRING) : $_SESSION['install']['locale']; +$_SESSION['install']['jscript'] = (filter_input(INPUT_POST, 'hidJScript') != null) ? + filter_input(INPUT_POST, 'hidJScript', FILTER_SANITIZE_STRING) : $_SESSION['install']['jscript']; +$_SESSION['install']['dbtype'] = (filter_input(INPUT_POST, 'selDBtype') != null) ? + filter_input(INPUT_POST, 'selDBtype', FILTER_SANITIZE_STRING) : $_SESSION['install']['dbtype']; +$_SESSION['install']['dbserver'] = (filter_input(INPUT_POST, 'tfDBserver') != null) ? + filter_input(INPUT_POST, 'tfDBserver', FILTER_SANITIZE_STRING) : $_SESSION['install']['dbserver']; +$_SESSION['install']['localsrv'] = (filter_input(INPUT_POST, 'tfLocalSrv') != null) ? + filter_input(INPUT_POST, 'tfLocalSrv', FILTER_SANITIZE_STRING) : $_SESSION['install']['localsrv']; +$_SESSION['install']['dbname'] = (filter_input(INPUT_POST, 'tfDBname') != null) ? + filter_input(INPUT_POST, 'tfDBname', FILTER_SANITIZE_STRING) : $_SESSION['install']['dbname']; +$_SESSION['install']['dbuser'] = (filter_input(INPUT_POST, 'tfDBuser') != null) ? + filter_input(INPUT_POST, 'tfDBuser', FILTER_SANITIZE_STRING) : $_SESSION['install']['dbuser']; +$_SESSION['install']['dbpass'] = (filter_input(INPUT_POST, 'tfDBpass') != null) ? + filter_input(INPUT_POST, 'tfDBpass', FILTER_SANITIZE_STRING) : $_SESSION['install']['dbpass']; +$_SESSION['install']['admuser'] = (filter_input(INPUT_POST, 'tfDBprivUser') != null) ? + filter_input(INPUT_POST, 'tfDBprivUser', FILTER_SANITIZE_STRING) : $_SESSION['install']['admuser']; +$_SESSION['install']['admpass'] = (filter_input(INPUT_POST, 'tfDBprivPass') != null) ? + filter_input(INPUT_POST, 'tfDBprivPass', FILTER_SANITIZE_STRING) : $_SESSION['install']['admpass']; +$_SESSION['install']['qluser'] = (filter_input(INPUT_POST, 'tfQLuser') != null) ? + filter_input(INPUT_POST, 'tfQLuser', FILTER_SANITIZE_STRING) : $_SESSION['install']['qluser']; +$_SESSION['install']['qlpass'] = (filter_input(INPUT_POST, 'tfQLpass') != null) ? + filter_input(INPUT_POST, 'tfQLpass', FILTER_SANITIZE_STRING) : $_SESSION['install']['qlpass']; +$_SESSION['install']['qlpath'] = (filter_input(INPUT_POST, 'tfQLpath') != null) ? + filter_input(INPUT_POST, 'tfQLpath', FILTER_SANITIZE_STRING) : $_SESSION['install']['qlpath']; +$_SESSION['install']['nagpath'] = (filter_input(INPUT_POST, 'tfNagiosPath') != null) ? + filter_input(INPUT_POST, 'tfNagiosPath', FILTER_SANITIZE_STRING) : $_SESSION['install']['nagpath']; +$_SESSION['install']['dbdrop'] = filter_input( + INPUT_POST, + 'chbDrop', + FILTER_VALIDATE_INT, + array('options' => array('default' => 0)) +); +$_SESSION['install']['sample'] = filter_input( + INPUT_POST, + 'chbSample', + FILTER_VALIDATE_INT, + array('options' => array('default' => 0)) +); +$_SESSION['install']['createpath'] = filter_input( + INPUT_POST, + 'chbPath', + FILTER_VALIDATE_INT, + array('options' => array('default' => 0)) +); +$strSqlFile = str_replace('DBTYPE', $_SESSION['install']['dbtype'], $preSqlNewInstall); +if (filter_input(INPUT_POST, 'butNewInstall') != null) { + $chkModus = 'Installation'; +} +if (filter_input(INPUT_POST, 'butUpgrade') != null) { + $chkModus = 'Update'; +} +if (!isset($_SESSION['install']['mode'])) { + $_SESSION['install']['mode'] = $chkModus; +} // // Language settings // ================= if (extension_loaded('gettext')) { - putenv("LC_ALL=".$_SESSION['install']['locale'].$preEncode); - putenv("LANG=".$_SESSION['install']['locale'].$preEncode); - // GETTEXT domain - setlocale(LC_ALL, $_SESSION['install']['locale'].".".$preEncode); - bindtextdomain($_SESSION['install']['locale'], $preLocale); - bind_textdomain_codeset($_SESSION['install']['locale'], $preEncode); - textdomain($_SESSION['install']['locale']); + putenv('LC_ALL=' .$_SESSION['install']['locale'].$preEncode); + putenv('LANG=' .$_SESSION['install']['locale'].$preEncode); + // GETTEXT domain + setlocale(LC_ALL, $_SESSION['install']['locale']. '.' .$preEncode); + bindtextdomain($_SESSION['install']['locale'], $preLocale); + bind_textdomain_codeset($_SESSION['install']['locale'], $preEncode); + textdomain($_SESSION['install']['locale']); } +$myInstClass->arrSession = $_SESSION; // // Content in buffer laden // ======================= ob_start(); -include "step".$chkStep.".php"; -$strContent = ob_get_contents(); +include 'step' .$chkStep. '.php'; +$strContentRaw = ob_get_contents(); ob_end_clean(); // // Build content // ============= -$arrTemplate['PAGETITLE'] = "[NagiosQL] Installation Wizard"; -$arrTemplate['MAIN_TITLE'] = $myInstClass->translate("Welcome to the NagiosQL Installation Wizard"); -$arrTemplate['CONTENT'] = $strContent; +$arrTemplate['PAGETITLE'] = '[NagiosQL] Installation Wizard'; +$arrTemplate['MAIN_TITLE'] = $myInstClass->translate('Welcome to the NagiosQL Installation Wizard'); +$arrTemplate['CONTENT'] = $strContentRaw; // // Write content // ============= $myInstClass->filTemplate = $preContent; -$strContent = $myInstClass->parseTemplate($arrTemplate,$preContent); +$strContent = $myInstClass->parseTemplate($arrTemplate, $preContent); echo $strContent; -?> \ No newline at end of file diff --git a/install/sql/import_nagios_sample.sql b/install/sql/import_nagios_sample.sql index 6a5a8ef..493dd9e 100644 --- a/install/sql/import_nagios_sample.sql +++ b/install/sql/import_nagios_sample.sql @@ -5,14 +5,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- (c) 2005-2018 by Martin Willisegger +-- -- Project : NagiosQL -- Component : Import samples build from Nagios 3.0.5 configuration samples --- Website : www.nagiosql.org --- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ --- Author : $LastChangedBy: martin $ --- Version : 3.3.0 --- Revision : $LastChangedRevision: 2 $ --- SVN-ID : $Id: import_nagios_sample.sql 2 2017-06-22 07:29:35Z martin $ +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/install/sql/nagiosQL_v32_db_mysql.sql b/install/sql/nagiosQL_v32_db_mysql.sql index 7bfa13d..7f4fba2 100644 --- a/install/sql/nagiosQL_v32_db_mysql.sql +++ b/install/sql/nagiosQL_v32_db_mysql.sql @@ -5,14 +5,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- (c) 2005-2018 by Martin Willisegger +-- -- Project : NagiosQL -- Component : Complete NagiosQL Database --- Website : www.nagiosql.org --- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ --- Author : $LastChangedBy: martin $ --- Version : 3.3.0 --- Revision : $LastChangedRevision: 2 $ --- SVN-ID : $Id: nagiosQL_v32_db_mysql.sql 2 2017-06-22 07:29:35Z martin $ +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/install/sql/nagiosQL_v34_db_mysql.sql b/install/sql/nagiosQL_v34_db_mysql.sql new file mode 100644 index 0000000..0ab511c --- /dev/null +++ b/install/sql/nagiosQL_v34_db_mysql.sql @@ -0,0 +1,2853 @@ +-- +-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- +-- NagiosQL +-- +-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- +-- (c) 2005-2018 by Martin Willisegger +-- +-- Project : NagiosQL +-- Component : Complete NagiosQL Database +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL +-- +-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; +SET NAMES 'utf8'; + +-- +-- Structure for table `tbl_command` +-- + +CREATE TABLE IF NOT EXISTS `tbl_command` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `command_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `command_line` text COLLATE utf8_unicode_ci NOT NULL, + `command_type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(10) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`command_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_command` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_configtarget` +-- + +CREATE TABLE `tbl_configtarget` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `target` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `server` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `method` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `user` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `ssh_key_path` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `ftp_secure` tinyint(3) UNSIGNED NOT NULL DEFAULT '0', + `basedir` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `hostconfig` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `serviceconfig` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `backupdir` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `hostbackup` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `servicebackup` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `nagiosbasedir` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `importdir` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `picturedir` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `commandfile` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `binaryfile` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `pidfile` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `conffile` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `cgifile` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `resourcefile` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `version` tinyint(3) UNSIGNED NOT NULL DEFAULT '3', + `access_group` int(10) UNSIGNED NOT NULL DEFAULT '0', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `nodelete` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', + `last_modified` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `target` (`target`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; +-- +-- Datasets for table `tbl_configtarget` +-- +INSERT INTO `tbl_configtarget` (`id`, `target`, `alias`, `server`, `method`, `user`, `password`, `ssh_key_path`, `ftp_secure`, `basedir`, `hostconfig`, `serviceconfig`, `backupdir`, `hostbackup`, `servicebackup`, `nagiosbasedir`, `importdir`, `picturedir`, `commandfile`, `binaryfile`, `pidfile`, `conffile`, `cgifile`, `resourcefile`, `version`, `access_group`, `active`, `nodelete`, `last_modified`) VALUES (1, 'localhost', 'Local installation', 'localhost', '1', '', '', '', 0, '/etc/nagiosql/', '/etc/nagiosql/hosts/', '/etc/nagiosql/services/', '/etc/nagiosql/backup/', '/etc/nagiosql/backup/hosts/', '/etc/nagiosql/backup/services/', '/etc/nagios/', '/opt/nagios/etc/objects/', '', '/var/nagios/rw/nagios.cmd', '/opt/nagios/bin/nagios', '/var/nagios/nagios.lock', '/etc/nagios/nagios.cfg', '/etc/nagios/cgi.cfg', '/etc/nagios/resource.cfg', 3, 0, '1', '1', NOW()); + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_contact` +-- +CREATE TABLE IF NOT EXISTS `tbl_contact` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `contact_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `contactgroups` int(10) unsigned NOT NULL DEFAULT '0', + `contactgroups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `minimum_importance` int(11) DEFAULT NULL, + `host_notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `service_notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `host_notification_period` int(10) unsigned NOT NULL DEFAULT '0', + `service_notification_period` int(10) unsigned NOT NULL DEFAULT '0', + `host_notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `service_notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `host_notification_commands` int(10) unsigned NOT NULL DEFAULT '0', + `host_notification_commands_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `service_notification_commands` int(10) unsigned NOT NULL DEFAULT '0', + `service_notification_commands_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `can_submit_commands` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_status_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_nonstatus_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `pager` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address1` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address2` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address3` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address4` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address5` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address6` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `use_variables` tinyint(3) unsigned NOT NULL DEFAULT '0', + `use_template` tinyint(3) unsigned NOT NULL DEFAULT '0', + `use_template_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(10) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`contact_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_contact` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_contactgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_contactgroup` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `contactgroup_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `members` int(10) unsigned NOT NULL DEFAULT '0', + `contactgroup_members` int(10) unsigned NOT NULL DEFAULT '0', + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(10) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`contactgroup_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_contactgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_contacttemplate` +-- + +CREATE TABLE IF NOT EXISTS `tbl_contacttemplate` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `template_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `contactgroups` int(10) unsigned NOT NULL DEFAULT '0', + `contactgroups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `minimum_importance` int(11) DEFAULT NULL, + `host_notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `service_notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `host_notification_period` int(11) NOT NULL DEFAULT '0', + `service_notification_period` int(11) NOT NULL DEFAULT '0', + `host_notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `service_notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `host_notification_commands` int(10) unsigned NOT NULL DEFAULT '0', + `host_notification_commands_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `service_notification_commands` int(10) unsigned NOT NULL DEFAULT '0', + `service_notification_commands_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `can_submit_commands` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_status_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_nonstatus_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `pager` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address1` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address2` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address3` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address4` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address5` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address6` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `use_variables` tinyint(3) unsigned NOT NULL DEFAULT '0', + `use_template` tinyint(3) unsigned NOT NULL DEFAULT '0', + `use_template_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(10) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`template_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_contacttemplate` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_datadomain` +-- + + +CREATE TABLE IF NOT EXISTS `tbl_datadomain` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `domain` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `targets` int(10) unsigned NOT NULL, + `version` tinyint(3) unsigned NOT NULL DEFAULT '3', + `enable_common` tinyint(3) unsigned NOT NULL DEFAULT '0', + `utf8_decode` tinyint(3) unsigned NOT NULL DEFAULT '0', + `access_group` int(10) unsigned NOT NULL DEFAULT '0', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `nodelete` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', + `last_modified` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `domain` (`domain`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_datadomain` +-- + +INSERT INTO `tbl_datadomain` (`id`, `domain`, `alias`, `targets`, `version`, `enable_common`, `utf8_decode`, `access_group`, `active`, `nodelete`, `last_modified`) VALUES(0, 'common', 'Global common domain', 0, 3, 0, 0, 0, '1', '1', NOW()); +UPDATE `tbl_datadomain` SET `id` = '0' WHERE `domain` = 'common'; +ALTER TABLE `tbl_datadomain` AUTO_INCREMENT = 1; +INSERT INTO `tbl_datadomain` (`id`, `domain`, `alias`, `targets`, `version`, `enable_common`, `utf8_decode`, `access_group`, `active`, `nodelete`, `last_modified`) VALUES(1, 'localhost', 'Local installation', 1, 3, 1, 0, 0, '1', '1', NOW()); + + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_group` +-- + +CREATE TABLE IF NOT EXISTS `tbl_group` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `groupname` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `description` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `users` tinyint(3) unsigned NOT NULL DEFAULT '0', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_group` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_host` +-- + +CREATE TABLE IF NOT EXISTS `tbl_host` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `host_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `display_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `address` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `parents` tinyint(3) unsigned NOT NULL DEFAULT '0', + `parents_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `importance` int(11) DEFAULT NULL, + `hostgroups` tinyint(3) unsigned NOT NULL DEFAULT '0', + `hostgroups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_command` text COLLATE utf8_unicode_ci NOT NULL, + `use_template` tinyint(3) unsigned NOT NULL DEFAULT '0', + `use_template_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `initial_state` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `max_check_attempts` int(11) DEFAULT NULL, + `check_interval` int(11) DEFAULT NULL, + `retry_interval` int(11) DEFAULT NULL, + `active_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `passive_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_period` int(11) NOT NULL DEFAULT '0', + `obsess_over_host` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_freshness` tinyint(3) unsigned NOT NULL DEFAULT '2', + `freshness_threshold` int(11) DEFAULT NULL, + `event_handler` int(11) NOT NULL DEFAULT '0', + `event_handler_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `low_flap_threshold` int(11) DEFAULT NULL, + `high_flap_threshold` int(11) DEFAULT NULL, + `flap_detection_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `flap_detection_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `process_perf_data` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_status_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_nonstatus_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `contacts` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contacts_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `contact_groups` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contact_groups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `notification_interval` int(11) DEFAULT NULL, + `notification_period` int(11) NOT NULL DEFAULT '0', + `first_notification_delay` int(11) DEFAULT NULL, + `notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `stalking_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `notes` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `notes_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `action_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `icon_image` varchar(500) COLLATE utf8_unicode_ci NOT NULL, + `icon_image_alt` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `vrml_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `statusmap_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `2d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `3d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `use_variables` tinyint(3) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(10) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`host_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_host` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_hostdependency` +-- + +CREATE TABLE IF NOT EXISTS `tbl_hostdependency` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `config_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `dependent_host_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `dependent_hostgroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `host_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `hostgroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `inherits_parent` tinyint(3) unsigned NOT NULL DEFAULT '0', + `execution_failure_criteria` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `notification_failure_criteria` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `dependency_period` int(11) NOT NULL DEFAULT '0', + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + `import_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`config_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_hostdependency` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_hostescalation` +-- + +CREATE TABLE IF NOT EXISTS `tbl_hostescalation` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `config_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `host_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `hostgroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contacts` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contact_groups` tinyint(3) unsigned NOT NULL DEFAULT '0', + `first_notification` int(11) DEFAULT NULL, + `last_notification` int(11) DEFAULT NULL, + `notification_interval` int(11) DEFAULT NULL, + `escalation_period` int(11) NOT NULL DEFAULT '0', + `escalation_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + `import_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`config_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_hostescalation` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_hostextinfo` +-- + +CREATE TABLE IF NOT EXISTS `tbl_hostextinfo` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `host_name` int(11) NOT NULL, + `notes` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `notes_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `action_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `statistik_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `icon_image` varchar(500) COLLATE utf8_unicode_ci NOT NULL, + `icon_image_alt` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `vrml_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `statusmap_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `2d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `3d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`host_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_hostextinfo` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_hostgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_hostgroup` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `hostgroup_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `members` tinyint(3) unsigned NOT NULL DEFAULT '0', + `hostgroup_members` tinyint(3) unsigned NOT NULL DEFAULT '0', + `notes` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `notes_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `action_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`hostgroup_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_hostgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_hosttemplate` +-- + +CREATE TABLE IF NOT EXISTS `tbl_hosttemplate` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `template_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `parents` tinyint(3) unsigned NOT NULL DEFAULT '0', + `parents_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `importance` int(11) DEFAULT NULL, + `hostgroups` tinyint(3) unsigned NOT NULL DEFAULT '0', + `hostgroups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_command` text COLLATE utf8_unicode_ci NOT NULL, + `use_template` tinyint(3) unsigned NOT NULL DEFAULT '0', + `use_template_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `initial_state` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `max_check_attempts` int(11) DEFAULT NULL, + `check_interval` int(11) DEFAULT NULL, + `retry_interval` int(11) DEFAULT NULL, + `active_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `passive_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_period` int(11) NOT NULL DEFAULT '0', + `obsess_over_host` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_freshness` tinyint(3) unsigned NOT NULL DEFAULT '2', + `freshness_threshold` int(11) DEFAULT NULL, + `event_handler` int(11) NOT NULL DEFAULT '0', + `event_handler_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `low_flap_threshold` int(11) DEFAULT NULL, + `high_flap_threshold` int(11) DEFAULT NULL, + `flap_detection_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `flap_detection_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `process_perf_data` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_status_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_nonstatus_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `contacts` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contacts_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `contact_groups` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contact_groups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `notification_interval` int(11) DEFAULT NULL, + `notification_period` int(11) NOT NULL DEFAULT '0', + `first_notification_delay` int(11) DEFAULT NULL, + `notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `stalking_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `notes` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `notes_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `action_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `icon_image` varchar(500) COLLATE utf8_unicode_ci NOT NULL, + `icon_image_alt` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `vrml_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `statusmap_image` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `2d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `3d_coords` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `use_variables` tinyint(3) unsigned NOT NULL DEFAULT '0', + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`template_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_hosttemplate` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_info` +-- + +CREATE TABLE IF NOT EXISTS `tbl_info` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `key1` varchar(100) COLLATE utf8_unicode_ci NOT NULL, + `key2` varchar(100) COLLATE utf8_unicode_ci NOT NULL, + `version` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `language` varchar(50) COLLATE utf8_unicode_ci NOT NULL, + `infotext` text COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `keypair` (`key1`,`key2`,`version`,`language`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_info` +-- + +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(1, 'domain', 'domain', 'all', 'default', 'Common name of this domain. This field is for internal use only.'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(2, 'domain', 'basedir', 'all', 'default', '

Absolute path to your NagiosQL configuration directory.

Examples:
/etc/nagiosql/
/usr/local/nagiosql/etc/

Be sure, that your configuration path settings are matching with your nagios.cfg! (cfg_file=/etc/nagiosql/timeperiods.cfg)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(3, 'domain', 'hostdir', 'all', 'default', 'NagiosQL writes one configuration file for every host. It is useful to store this files inside an own subdirectory below your Nagios configuration path.

Examples:
/etc/nagios/hosts
/usr/local/nagios/etc/hosts

Be sure, that your configuration settings are matching with your nagios.cfg!
(cfg_dir=/etc/nagios/hosts)'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(4, 'domain', 'servicedir', 'all', 'default', 'NagiosQL writes services grouped into files identified by the service configuration names. It is useful to store this files inside an own subdirectory below your Nagios configuration path.

Examples:
/etc/nagios/services
/usr/local/nagios/etc/services

Be sure, that your configuration settings are matching with your nagios.cfg!
(cfg_dir=/etc/nagios/services)'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(5, 'domain', 'backupdir', 'all', 'default', 'Absolute path to your NagiosQL configuration backup directory.

Examples:
/etc/nagios/backup
/usr/local/nagios/etc/backup

This directory is for internal configuration backups of NagiosQL and is not used by Nagios itself. '); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(6, 'domain', 'backuphostdir', 'all', 'default', 'Absolute path to your NagiosQL host configuration backup directory.

Examples:
/etc/nagios/backup/hosts
/usr/local/nagios/etc/backup/hosts

This directory is for internal configuration backups of NagiosQL only and is not used by Nagios itself.'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(7, 'domain', 'backupservicedir', 'all', 'default', 'Absolute path to your NagiosQL service configuration backup directory.

Examples:
/etc/nagios/backup/services
/usr/local/nagios/etc/backup/services

This directory is for internal configuration backups of NagiosQL only and is not used by Nagios itself.'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(8, 'domain', 'commandfile', 'all', 'default', 'Absolute path to your Nagios command file.

Examples:
/var/spool/nagios/nagios.cmd
/usr/local/nagios/var/rw/nagios.cmd

Be sure, that your command file path settings are matching with your nagios.cfg! (command_file=/var/spool/nagios/nagios.cmd)
(check_external_commands=1)

\r\nThis is used to reload Nagios directly from NagiosQL after changing a configuration.'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(9, 'common', 'accesskeys', 'all', 'default', '

Access key/keyholes

\r\n

NagiosQL uses a very simplified access control mechanism by using up to 8 keys.

\r\n

To access a secure object (menu, domain), a user must have a key for every defined keyhole.

\r\n

Example:

\r\n

User A has key 1,2,5,7 (can be defined in user management)
User B has key 3,5,7,8 (can be defined in user management)

\r\n

Menu 1 has keyhole 3,5
Menu 2 has keyhole 2,5,7
Menu 3 has no keyhole
Menu 4 has keyhole 4

User A has access to menu 2 and menu 3 (key 3 for menu 1 and key 4 for menu 4 are missing)
User B has access to menu 1 and menu 3 (key 2 for menu 2 and key 4 for menu 4 are missing)

\r\n

 

\r\n

 

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(10, 'user', 'webserverauth', 'all', 'default', '

User - webserver authentification

\r\n

If your webserver uses authentification and the NagiosQL user name is the same which is actually logged in - the NagiosQL login process will passed. This means, that NagiosQL no longer shows a login page if this user is already logged in by webserver authentification.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(11, 'domain', 'nagiosbasedir', 'all', 'default', '

Absolute path to your Nagios configuration directory.

Examples:
/etc/nagios/
/usr/local/nagios/etc/

\r\n

Be sure, that your nagios.cfg and cfg.cfg ist located inside this directory. NagiosQL uses this to handle this two files.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(12, 'domain', 'importdir', 'all', 'default', '

Absolute path to your configuration import directory.

Examples:
/etc/nagiosql/import/
/usr/local/nagios/etc/import/

\r\n

You can use this directory to store old or example configuration files in it which should be accessable by the importer of NagiosQL.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(13, 'domain', 'binary', 'all', 'default', '

Absolute path to your Nagios binary file.

Examples:
/usr/bin/nagios
/usr/local/nagios/bin/nagios

This is used to verify your configuration.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(14, 'domain', 'pidfile', 'all', 'default', '

Absolute path to your Nagios process file.

Examples:
/var/run/nagios/nagios.pid
/var/run/nagios/nagios.lock

This is used to check if nagios is running before sending a reload command to the nagios command file.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(15, 'domain', 'version', 'all', 'default', '

The nagios version which is running in this domain.

\r\n

Be sure you select the correct version here - otherwise not all configuration options are available or not supported options are shown.

\r\n

You can change this with a running configuration - NagiosQL will then upgrade or downgrade your configuration. Don\'t forget to write your complete configuration after a version change!

\r\n

Difference between version in data domain and configuration domain:

\r\n
    \r\n
  • The version information of the data domain is used to define the options offered in the web forms in NagiosQL.
  • \r\n
  • The version information of the configuration domain is used to define the options offered in the written configuration files.
  • \r\n
\r\n

This way you can create your data in a newer Nagios version and still write in an older version to keep the configuration compatible to the running Nagios version.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(16, 'host', 'hostname', 'all', 'default', '

Host - host name

This directive is used to define a short name used to identify the host. It is used in host group and service definitions to reference this particular host. Hosts can have multiple services (which are monitored) associated with them. When used properly, the $HOSTNAME$ macro will contain this short name.

\r\n

Parameter name: host_name
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(17, 'host', 'alias', 'all', 'default', '

Host - alias

This directive is used to define a longer name or description used to identify the host. It is provided in order to allow you to more easily identify a particular host. When used properly, the $HOSTALIAS$ macro will contain this alias/description.

\r\n

Parameter name: alias
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(18, 'host', 'address', 'all', 'default', '

Host - address

\r\n

This directive is used to define the address of the host. Normally, this is an IP address, although it could really be anything you want (so long as it can be used to check the status of the host). You can use a FQDN to identify the host instead of an IP address, but if DNS services are not availble this could cause problems. When used properly, the $HOSTADDRESS$ macro will contain this address.

\r\n

Note: If you do not specify an address directive in a host definition, the name of the host will be used as its address. A word of caution about doing this, however - if DNS fails, most of your service checks will fail because the plugins will be unable to resolve the host name.

\r\n

Parameter name: address
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(19, 'host', 'display_name', 'all', 'default', '

Host - display name

\r\n

This directive is used to define an alternate name that should be displayed in the web interface for this host. If not specified, this defaults to the value you specify for the host_name directive.

\r\n

Note: The current CGIs do not use this option, although future versions of the web interface will.

\r\n

Parameter name: display_name
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(20, 'host', 'parents', 'all', 'default', '

Host - parents

\r\n

This directive is used to define a comma-delimited list of short names of the "parent" hosts for this particular host. Parent hosts are typically routers, switches, firewalls, etc. that lie between the monitoring host and a remote hosts. A router, switch, etc. which is closest to the remote host is considered to be that host''s "parent". Read the "Determining Status and Reachability of Network Hosts" document for more information.

\r\n

If this host is on the same network segment as the host doing the monitoring (without any intermediate routers, etc.) the host is considered to be on the local network and will not have a parent host. Leave this value blank if the host does not have a parent host (i.e. it is on the same segment as the Nagios host). The order in which you specify parent hosts has no effect on how things are monitored.

\r\n

Parameter name: parents
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(21, 'host', 'hostgroups', 'all', 'default', '

Host - hostgroup names

\r\n

This directive is used to identify the short name(s) of the hostgroup(s) that the host belongs to. Multiple hostgroups should be separated by commas. This directive may be used as an alternative to (or in addition to) using the members directive in hostgroup definitions.

\r\n

NagiosQL: If a hostgroup is defined here - this host will not be selected inside the member field of the same hostgroup definition!

\r\n

Parameter name: hostgroups
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(22, 'common', 'tploptions', '3', 'default', '

Cancelling Inheritance of String Values

\r\n

In some cases you may not want your host, service, or contact definitions to inherit values of string variables from the templates they reference. If this is the case, you can specify "null" as the value of the variable that you do not want to inherit.

\r\n


Additive Inheritance of String Values

\r\n

Nagios gives preference to local variables instead of values inherited from templates. In most cases local variable values override those that are defined in templates. In some cases it makes sense to allow Nagios to use the values of inherited and local variables together.

\r\n

This "additive inheritance" can be accomplished by prepending the local variable value with a plus sign (+). This features is only available for standard (non-custom) variables that contain string values.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(23, 'host', 'check_command', 'all', 'default', '

Host - check command

This directive is used to specify the short name of the command that should be used to check if the host is up or down. Typically, this command would try and ping the host to see if it is "alive". The command must return a status of OK (0) or Nagios will assume the host is down.

\r\n

If you leave this argument blank, the host will not be actively checked. Thus, Nagios will likely always assume the host is up (it may show up as being in a "PENDING" state in the web interface). This is useful if you are monitoring printers or other devices that are frequently turned off. The maximum amount of time that the notification command can run is controlled by the host_check_timeout option.

\r\n

Parameter name: check_command
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(24, 'host', 'arguments', 'all', 'default', '

Host - arguments

\r\n

The values defined here will replace the according argument variable behind the selected command. Up to 8 argument variables are supported. Be sure, that you defines a valid value for each required argument variable.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(25, 'host', 'templateadd', 'all', 'default', '

Host - Templates

\r\n

You can add one or more host templates to a host configuration. Nagios will add the definitions from each template to a host configuration.

\r\n

If you add more than one template - the sort order will be used to overwrite configuration items which are defined inside templates before.

\r\n

The host configuration itselves will overwrite all values which are defined in templates before and pass all values which are not defined.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(26, 'host', 'initial_state', '3', 'default', '

Host - initial state

\r\n

By default Nagios will assume that all hosts are in UP states when in starts. You can override the initial state for a host by using this directive. Valid options are:
o
= UP,
d = DOWN, and
u = UNREACHABLE.

\r\n

Parameter name: initial_state
Required:
no

\r\n

 

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(27, 'host', 'retry_interval', '3', 'default', '

Host - retry interval

\r\n

This directive is used to define the number of "time units" to wait before scheduling a re-check of the hosts. Hosts are rescheduled at the retry interval when they have changed to a non-UP state. Once the host has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" rate as defined by the check_interval value. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.

\r\n

Parameter name: retry_interval
Required:
no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(28, 'host', 'max_check_attempts', 'all', 'default', '

Host - max check attempts

\r\n

This directive is used to define the number of times that Nagios will retry the host check command if it returns any state other than an OK state. Setting this value to 1 will cause Nagios to generate an alert without retrying the host check again. Note: If you do not want to check the status of the host, you must still set this to a minimum value of 1. To bypass the host check, just leave the check_command option blank.

\r\n

Parameter name: max_check_attempts
Required:
yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(29, 'host', 'check_interval', 'all', 'default', '

Host - check interval

\r\n

This directive is used to define the number of "time units" between regularly scheduled checks of the host. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.

\r\n

Parameter name: check_interval
Required:
no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(30, 'host', 'active_checks_enabled', 'all', 'default', '

Host - active checks enabled

\r\n

This directive is used to determine whether or not active checks (either regularly scheduled or on-demand) of this host are enabled. Values: 0 = disable active host checks, 1 = enable active host checks.

\r\n

Parameter name: active_checks_enabled
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(31, 'host', 'passive_checks_enabled', 'all', 'default', '

Host - passive checks enabled

\r\n

This directive is used to determine whether or not passive checks are enabled for this host. Values: 0 = disable passive host checks, 1 = enable passive host checks.

\r\n

Parameter name: passive_checks_enabled
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(32, 'host', 'check_period', 'all', 'default', '

Host - check period

\r\n

This directive is used to specify the short name of the time period during which active checks of this host can be made.

\r\n

Parameter name: check_period
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(33, 'host', 'freshness_threshold', 'all', 'default', '

Host - freshness threshold

\r\n

This directive is used to specify the freshness threshold (in seconds) for this host. If you set this directive to a value of 0, Nagios will determine a freshness threshold to use automatically.

\r\n

Parameter name: freshness_threshold
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(34, 'host', 'check_freshness', 'all', 'default', '

Host - check freshness

\r\n

This directive is used to determine whether or not freshness checks are enabled for this host. Values: 0 = disable freshness checks, 1 = enable freshness checks.

\r\n

Parameter name: check_freshness
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(35, 'host', 'obsess_over_host', 'all', 'default', '

Host - obsess over host

\r\n

This directive determines whether or not checks for the host will be "obsessed" over using the ochp_command.

\r\n

Parameter name: obsess_over_host
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(36, 'host', 'event_handler', 'all', 'default', '

Host - event handler

\r\n

This directive is used to specify the short name of the command that should be run whenever a change in the state of the host is detected (i.e. whenever it goes down or recovers). Read the documentation on event handlers for a more detailed explanation of how to write scripts for handling events. The maximum amount of time that the event handler command can run is controlled by the event_handler_timeout option.

\r\n

Parameter name: event_handler
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(37, 'host', 'event_handler_enabled', 'all', 'default', '

Host - event handler enabled

\r\n

This directive is used to determine whether or not the event handler for this host is enabled. Values: 0 = disable host event handler, 1 = enable host event handler.

\r\n

Parameter name: event_handler_enabled
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(38, 'host', 'low_flap_threshold', 'all', 'default', '

Host - low flap threshold

\r\n

This directive is used to specify the low state change threshold used in flap detection for this host. If you set this directive to a value of 0, the program-wide value specified by the low_host_flap_threshold directive will be used.

\r\n

Parameter name: low_flap_threshold
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(39, 'host', 'high_flap_threshold', 'all', 'default', '

Host - high flap threshold

\r\n

This directive is used to specify the high state change threshold used in flap detection for this host. If you set this directive to a value of 0, the program-wide value specified by the high_host_flap_threshold directive will be used.

\r\n

Parameter name: high_flap_threshold
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(40, 'host', 'flap_detection_enabled', 'all', 'default', '

Host - flap detection enabled

\r\n

This directive is used to determine whether or not flap detection is enabled for this host. Values: 0 = disable host flap detection, 1 = enable host flap detection.

\r\n

Parameter name: flap_detection_enabled
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(41, 'host', 'flap_detection_options', '3', 'default', '

Host - flap detection options

\r\n

This directive is used to determine what host states the flap detection logic will use for this host. Valid options are a combination of one or more of the following:
o
= UP states,
d = DOWN states,
u = UNREACHABLE states.

\r\n

Parameter name: flap_detection_options
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(42, 'host', 'retain_status_information', 'all', 'default', '

Host - retain status information

\r\n

This directive is used to determine whether or not status-related information about the host is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable status information retention, 1 = enable status information retention.

\r\n

Parameter name: retain_status_information
Required:
no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(43, 'host', 'retain_nonstatus_information', 'all', 'default', '

Host - retain nonstatus information

\r\n

This directive is used to determine whether or not non-status information about the host is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable non-status information retention, 1 = enable non-status information retention.

\r\n

Parameter name: retain_nonstatus_information
Required:
no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(45, 'host', 'contacts', '3', 'default', '

Host - contacts

\r\n

This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this host. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each host definition.

\r\n

Parameter name: contacs
Required:
yes (at least one contact or contact group)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(46, 'host', 'contactgroups', 'all', 'default', '

Host - contact groups

\r\n

This is a list of the short names of the contact groups that should be notified whenever there are problems (or recoveries) with this host. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each host definition.

\r\n

Parameter name: contact_groups
Required: yes (at least one contact or contact group)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(47, 'host', 'notification_period', 'all', 'default', '

Host - notification period

\r\n

This directive is used to specify the short name of the time period during which notifications of events for this host can be sent out to contacts. If a host goes down, becomes unreachable, or recoveries during a time which is not covered by the time period, no notifications will be sent out.

\r\n

Parameter name: notification_period
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(48, 'host', 'notification_options', 'all', 'default', '

Host - notification options

\r\n

This directive is used to determine when notifications for the host should be sent out. Valid options are a combination of one or more of the following:
d = send notifications on a DOWN state,
u = send notifications on an UNREACHABLE state,
r
= send notifications on recoveries (OK state),
f = send notifications when the host starts and stops flapping, and
s = send notifications when scheduled downtime starts and ends.
If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states.

\r\n

Example: If you specify d,r in this field, notifications will only be sent out when the host goes DOWN and when it recovers from a DOWN state.

\r\n

Parameter name: notification_options
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(51, 'host', 'notification_enabled', 'all', 'default', '

Host - notification enabled

\r\n

This directive is used to determine whether or not notifications for this host are enabled. Values: 0 = disable host notifications, 1 = enable host notifications.

\r\n

Parameter name: notification_enabled
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(52, 'host', 'stalking_options', 'all', 'default', '

Host - stalking options

\r\n

This directive determines which host states "stalking" is enabled for. Valid options are a combination of one or more of the following:
o
= stalk on UP states,
d = stalk on DOWN states, and
u = stalk on UNREACHABLE states.

\r\n

Parameter name: stalking_options
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(53, 'host', 'process_perf_data', 'all', 'default', '

Host - process performance data

\r\n

This directive is used to determine whether or not the processing of performance data is enabled for this host. Values: 0 = disable performance data processing, 1 = enable performance data processing.

\r\n

Parameter name: process_perf_data
Required:
no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(54, 'host', 'notification_intervall', 'all', 'default', '

Host - notification interval

\r\n

This directive is used to define the number of "time units" to wait before re-notifying a contact that this service is still down or unreachable. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will not re-notify contacts about problems for this host - only one problem notification will be sent out.

\r\n

Parameter name: notification_interval
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(55, 'host', 'first_notification_delay', 'all', 'default', '

Host - first notification delay

\r\n

This directive is used to define the number of "time units" to wait before sending out the first problem notification when this host enters a non-UP state. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will start sending out notifications immediately.

\r\n

Parameter name: first_notification_delay
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(56, 'host', 'notes', '3', 'default', '

Host - notes

\r\n

This directive is used to define an optional string of notes pertaining to the host. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified host).

\r\n

Parameter name: notes
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(57, 'host', 'vrml_image', '3', 'default', '

Host - vrml image

\r\n

This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be used as the texture map for the specified host in the statuswrl CGI. Unlike the image you use for the icon_image variable, this one should probably not have any transparency.

\r\n

If it does, the host object will look a bit wierd. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).

\r\n

Parameter name: vrml_image
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(58, 'host', 'notes_url', '3', 'default', '

Host - notes url

\r\n

This variable is used to define an optional URL that can be used to provide more information about the host. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing host information) that links to the URL you specify here. Any valid URL can be used.

\r\n

If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the host, emergency contact methods, etc. available to other support staff.

\r\n

Parameter name: notes_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(59, 'host', 'status_image', '3', 'default', '

Host - statusmap image

\r\n

This variable is used to define the name of an image that should be associated with this host in the statusmap CGI. You can specify a JPEG, PNG, and GIF image if you want, although I would strongly suggest using a GD2 format image, as other image formats will result in a lot of wasted CPU time when the statusmap image is generated.

\r\n

GD2 images can be created from PNG images by using the pngtogd2 utility supplied with Thomas Boutell''s gd library . The GD2 images should be created in uncompressed format in order to minimize CPU load when the statusmap CGI is generating the network map image.

\r\n

The image will look best if it is 40x40 pixels in size. You can leave these option blank if you are not using the statusmap CGI. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).

\r\n

Parameter name: statusmap_image
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(60, 'host', 'action_url', '3', 'default', '

Host - action url

\r\n

This directive is used to define an optional URL that can be used to provide more actions to be performed on the host. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing host information) that links to the URL you specify here. Any valid URL can be used.

\r\n

If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).

\r\n

Parameter name: action_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(61, 'host', 'icon_image', '3', 'default', '

Host - icon image

\r\n

This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be displayed in the various places in the CGIs. The image will look best if it is 40x40 pixels in size. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).

\r\n

Parameter name: icon_image
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(62, 'host', '2d_coords', '3', 'default', '

Host - 2D coords

\r\n

This variable is used to define coordinates to use when drawing the host in the statusmap CGI. Coordinates should be given in positive integers, as they correspond to physical pixels in the generated image. The origin for drawing (0,0) is in the upper left hand corner of the image and extends in the positive x direction (to the right) along the top of the image and in the positive y direction (down) along the left hand side of the image.

\r\n

For reference, the size of the icons drawn is usually about 40x40 pixels (text takes a little extra space). The coordinates you specify here are for the upper left hand corner of the host icon that is drawn. Note: Don''t worry about what the maximum x and y coordinates that you can use are. The CGI will automatically calculate the maximum dimensions of the image it creates based on the largest x and y coordinates you specify.

\r\n

Parameter name: 2d_coords
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(63, 'host', 'icon_image_alt_text', '3', 'default', '

Host - icon image alt

\r\n

This variable is used to define an optional string that is used in the ALT tag of the image specified by the icon image argument.

\r\n

Parameter name: icon_image_alt
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(64, 'host', '3d_coords', '3', 'default', '

Host - 3D coords

\r\n

This variable is used to define coordinates to use when drawing the host in the statuswrl CGI. Coordinates can be positive or negative real numbers. The origin for drawing is (0.0,0.0,0.0). For reference, the size of the host cubes drawn is 0.5 units on each side (text takes a little more space). The coordinates you specify here are used as the center of the host cube.

\r\n

Parameter name: 3d_coords
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(65, 'common', 'free_variables_name', 'all', 'default', '

Free variables (custom object variables)

\r\n

NagiosQL supports custom object variables.

\r\n

There are a few important things that you should note about custom variables:

\r\n
    \r\n
  • Custom variable names must begin with an underscore (_) to prevent name collision with standard variables
  • \r\n
  • Custom variable names are case-insensitive
  • \r\n
  • Custom variables are inherited from object templates like normal variables
  • \r\n
  • Scripts can reference custom variable values with macros and environment variables
  • \r\n
\r\n

Examples

\r\n

define host{
       host_name linuxserver
       _mac_address 00:06:5B:A6:AD:AA ; <-- Custom MAC_ADDRESS variable
       _rack_number R32 ; <-- Custom RACK_NUMBER variable
       ...
}

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(66, 'common', 'free_variables_value', 'all', 'default', '

Free variables (custom object variables)

\r\n

NagiosQL supports custom object variables.

\r\n

There are a few important things that you should note about custom variables:

\r\n
    \r\n
  • Custom variable names must begin with an underscore (_) to prevent name collision with standard variables
  • \r\n
  • Custom variable names are case-insensitive
  • \r\n
  • Custom variables are inherited from object templates like normal variables
  • \r\n
  • Scripts can reference custom variable values with macros and environment variables
  • \r\n
\r\n

Examples

\r\n

define host{
       host_name linuxserver
       _mac_address 00:06:5B:A6:AD:AA ; <-- Custom MAC_ADDRESS variable
       _rack_number R32 ; <-- Custom RACK_NUMBER variable
       ...
}

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(67, 'host', 'genericname', 'all', 'default', '

Host or Service - generic name

\r\n

It is possible to use a host definition as a template for other host configurations. If this definition should be used as template, a generic template name must be defined.

\r\n

We do not recommend to do this - it is more open to define a separate host template than to use this option.

\r\n

Parameter name: name
Required:
no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(68, 'service', 'config_name', 'all', 'default', '

Service - config name

\r\n

This directive is used to specify a common config name for a group of service definitions. This is a NagiosQL parameter and it will not be written to the configuration file. Every service definitions with the same configuration name will stored in one file. The configuration name is also the file name of this configuration set.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(69, 'service', 'hosts', 'all', 'default', '

Service - host name

\r\n

This directive is used to specify the short name(s) of the host(s) that the service "runs" on or is associated with.

\r\n

Parameter name: host_name
Required: yes (no, if a hostgroup is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(70, 'service', 'hostgroups', 'all', 'default', '

Service - hostgroup name

\r\n

This directive is used to specify the short name(s) of the hostgroup(s) that the service "runs" on or is associated with. The hostgroup_name may be used instead of, or in addition to, the host_name directive.

\r\n

Parameter name: hostgroup_name
Required: no (yes, if no host is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(71, 'service', 'service_description', 'all', 'default', '

Service - service description

\r\n

This directive is used to define the description of the service, which may contain spaces, dashes, and colons (semicolons, apostrophes, and quotation marks should be avoided). No two services associated with the same host can have the same description. Services are uniquely identified with their host_name and service_description directives.

\r\n

Parameter name: service_description
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(72, 'service', 'service_groups', 'all', 'default', '

Service - servicegroups

\r\n

This directive is used to identify the short name(s) of the servicegroup(s) that the service belongs to. Multiple servicegroups should be separated by commas. This directive may be used as an alternative to using the members directive in servicegroup definitions.

\r\n

NagiosQL: If a servicegroup is defined here - this service will not be selected inside the member field of the same servicegroup definition!

\r\n

Parameter name: servicegroups
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(73, 'service', 'display_name', 'all', 'default', '

Service - display name

\r\n

This directive is used to define an alternate name that should be displayed in the web interface for this service. If not specified, this defaults to the value you specify for the service_description directive. Note: The current CGIs do not use this option, although future versions of the web interface will.

\r\n

Parameter name: display_name
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(74, 'service', 'check_command', 'all', 'default', '

Service - check command

\r\n

This directive is used to specify the short name of the command that Nagios will run in order to check the status of the service. The maximum amount of time that the service check command can run is controlled by the service_check_timeout option.

\r\n

Parameter name: check_command
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(75, 'service', 'argument', 'all', 'default', '

Service - arguments

\r\n

The values defined here will replace the according argument variable behind the selected command. Up to 8 argument variables are supported. Be sure, that you defines a valid value for each required argument variable.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(76, 'service', 'templateadd', 'all', 'default', '

Service - Templates

\r\n

You can add one or more service templates to a service configuration. Nagios will add the definitions from each template to a service configuration.

\r\n

If you add more than one template - the sort order will be used to overwrite configuration items which are defined inside templates before.

\r\n

The host configuration itselves will overwrite all values which are defined in templates before and pass all values which are not defined.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(77, 'service', 'initial_state', '3', 'default', '

Service - initial state

\r\n

By default Nagios will assume that all services are in OK states when in starts. You can override the initial state for a service by using this directive. Valid options are:
o
= OK,
w = WARNING,
u
= UNKNOWN, and
c
= CRITICAL.

\r\n

Parameter name: initial_state
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(78, 'service', 'retry_interval', '3', 'default', '

Service - retry interval

\r\n

This directive is used to define the number of "time units" to wait before scheduling a re-check of the service. Services are rescheduled at the retry interval when they have changed to a non-OK state. Once the service has been retried max_check_attempts times without a change in its status, it will revert to being scheduled at its "normal" rate as defined by the check_interval value. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.

\r\n

Parameter name: retry_interval
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(79, 'service', 'max_check_attempts', 'all', 'default', '

Service - max check attempts

\r\n

This directive is used to define the number of times that Nagios will retry the service check command if it returns any state other than an OK state. Setting this value to 1 will cause Nagios to generate an alert without retrying the service check again.

\r\n

Parameter name: max_check_attempts
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(80, 'service', 'check_interval', 'all', 'default', '

Service - check interval

\r\n

This directive is used to define the number of "time units" to wait before scheduling the next "regular" check of the service. "Regular" checks are those that occur when the service is in an OK state or when the service is in a non-OK state, but has already been rechecked max_check_attempts number of times. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. More information on this value can be found in the check scheduling documentation.

\r\n

Parameter name: check_interval
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(81, 'service', 'active_checks_enabled', 'all', 'default', '

Service - active checks enabled

\r\n

This directive is used to determine whether or not active checks of this service are enabled. Values: 0 = disable active service checks, 1 = enable active service checks.

\r\n

Parameter name: active_checks_enabled
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(82, 'service', 'passive_checks_enabled', 'all', 'default', '

Service - passive checks enabled

\r\n

This directive is used to determine whether or not passive checks of this service are enabled. Values: 0 = disable passive service checks, 1 = enable passive service checks.

\r\n

Parameter name: passive_checks_enabled
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(83, 'service', 'parallelize_checks', '2', 'default', '

Service - parallelize check

\r\n

This directive is used to determine whether or not the service check can be parallelized. By default, all service checks are parallelized. Disabling parallel checks of services can result in serious performance problems. More information on service check parallelization can be found in the nagios documentation.

\r\n

Values: 0 = service check cannot be parallelized (use with caution!), 1 = service check can be parallelized.

\r\n

Parameter name: parallelize_check
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(84, 'service', 'check_period', 'all', 'default', '

Service - check period

\r\n

This directive is used to specify the short name of the time period during which active checks of this service can be made.

\r\n

Parameter name: check_period
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(85, 'service', 'freshness_threshold', 'all', 'default', '

Service - freshness threshold

\r\n

This directive is used to specify the freshness threshold (in seconds) for this service. If you set this directive to a value of 0, Nagios will determine a freshness threshold to use automatically.

\r\n

Parameter name: freshness_threshold
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(86, 'service', 'check_freshness', 'all', 'default', '

Service - check freshness

\r\n

This directive is used to determine whether or not freshness checks are enabled for this service. Values: 0 = disable freshness checks, 1 = enable freshness checks.

\r\n

Parameter name: check_freshness
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(87, 'service', 'obsess_over_service', 'all', 'default', '

Service - obsess over service

\r\n

This directive determines whether or not checks for the service will be "obsessed" over using the ocsp_command.

\r\n

Parameter name: obsess_over_service
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(88, 'service', 'event_handler', 'all', 'default', '

Service - event handler

\r\n

This directive is used to specify the short name of the command that should be run whenever a change in the state of the service is detected (i.e. whenever it goes down or recovers). Read the documentation on event handlers for a more detailed explanation of how to write scripts for handling events. The maximum amount of time that the event handler command can run is controlled by the event_handler_timeout option.

\r\n

Parameter name: event_handler
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(89, 'service', 'event_handler_enabled', 'all', 'default', '

Service - event handler enabled

\r\n

This directive is used to determine whether or not the event handler for this service is enabled. Values: 0 = disable service event handler, 1 = enable service event handler.

\r\n

Parameter name: event_handler_enabled
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(90, 'service', 'low_flap_threshold', 'all', 'default', '

Service - low flap threshold

\r\n

This directive is used to specify the low state change threshold used in flap detection for this service. More information on flap detection can be found in the nagios documentation. If you set this directive to a value of 0, the program-wide value specified by the low_service_flap_threshold directive will be used.

\r\n

Parameter name: low_flap_threshold
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(91, 'service', 'high_flap_threshold', 'all', 'default', '

Service - high flap threshold

\r\n

This directive is used to specify the high state change threshold used in flap detection for this service. More information on flap detection can be found in the nagios documentation. If you set this directive to a value of 0, the program-wide value specified by the high_service_flap_threshold directive will be used.

\r\n

Parameter name: high_flap_threshold
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(92, 'service', 'flap_detection_enabled', 'all', 'default', '

Service - flap detection enabled

\r\n

This directive is used to determine whether or not flap detection is enabled for this service. More information on flap detection can be found in the nagios documentation. Values: 0 = disable service flap detection, 1 = enable service flap detection.

\r\n

Parameter name: flap_detection_enabled
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(93, 'service', 'flap_detection_options', '3', 'default', '

Service - flap detection options

\r\n

This directive is used to determine what service states the flap detection logic will use for this service. Valid options are a combination of one or more of the following:
o
= OK states,
w = WARNING states,
c = CRITICAL states,
u = UNKNOWN states.

\r\n

Parameter name: flap_detection_options
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(94, 'service', 'retain_status_information', 'all', 'default', '

Service - retain status information

\r\n

This directive is used to determine whether or not status-related information about the service is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable status information retention, 1 = enable status information retention.

\r\n

Parameter name: retain_status_information
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(95, 'service', 'retain_nonstatus_information', 'all', 'default', '

Service - retain nonstatus information

\r\n

This directive is used to determine whether or not non-status information about the service is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable non-status information retention, 1 = enable non-status information retention.

\r\n

Parameter name: retain_nonstatus_information
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(96, 'service', 'process_perf_data', 'all', 'default', '

Service - process perf data

\r\n

This directive is used to determine whether or not the processing of performance data is enabled for this service. Values: 0 = disable performance data processing, 1 = enable performance data processing.

\r\n

Parameter name: process_perf_data
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(97, 'service', 'is_volatile', 'all', 'default', '

Service - is volatile

\r\n

This directive is used to denote whether the service is "volatile". Services are normally not volatile. More information on volatile service and how they differ from normal services can be found in the nagios documentation. Value: 0 = service is not volatile, 1 = service is volatile.

\r\n

Parameter name: is_volatile
Required:no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(98, 'service', 'contacts', '3', 'default', '

Service - contacts

\r\n

This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this service. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each service definition.

\r\n

Parameter name: contacts
Required: yes (no, if a contact group is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(99, 'service', 'contactgroups', 'all', 'default', '

Service - contact groups

\r\n

This is a list of the short names of the contact groups that should be notified whenever there are problems (or recoveries) with this service. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each service definition.

\r\n

Parameter name: contact_groups
Required: yes (no, if a contact is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(100, 'service', 'notification_period', 'all', 'default', '

Service - notification period

\r\n

This directive is used to specify the short name of the time period during which notifications of events for this service can be sent out to contacts. No service notifications will be sent out during times which is not covered by the time period.

\r\n

Parameter name: notification_period
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(101, 'service', 'notification_options', 'all', 'default', '

Service - notification options

\r\n

This directive is used to determine when notifications for the service should be sent out. Valid options are a combination of one or more of the following:

w
= send notifications on a WARNING state,
u = send notifications on an UNKNOWN state,
c
= send notifications on a CRITICAL state,
r = send notifications on recoveries (OK state),
f
= send notifications when the service starts and stops flapping, and
s = send notifications when scheduled downtime starts and ends.

\r\n

If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states.

\r\n

Example: If you specify w,r in this field, notifications will only be sent out when the service goes into a WARNING state and when it recovers from a WARNING state.

\r\n

Parameter name: notification_options
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(102, 'service', 'notification_intervall', 'all', 'default', '

Service - notification interval

\r\n

This directive is used to define the number of "time units" to wait before re-notifying a contact that this service is still in a non-OK state. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will not re-notify contacts about problems for this service - only one problem notification will be sent out.

\r\n

Parameter name: notification_interval
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(103, 'service', 'first_notification_delay', 'all', 'default', '

Service - first notification delay

\r\n

This directive is used to define the number of "time units" to wait before sending out the first problem notification when this service enters a non-OK state. Unless you''ve changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will start sending out notifications immediately.

\r\n

Parameter name: first_notification_delay
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(104, 'service', 'notification_enabled', 'all', 'default', '

Service - notifications enabled

\r\n

This directive is used to determine whether or not notifications for this service are enabled. Values: 0 = disable service notifications, 1 = enable service notifications.

\r\n

Parameter name: notifications_enabled
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(105, 'service', 'stalking_options', 'all', 'default', '

Service - stalking options

\r\n

This directive determines which service states "stalking" is enabled for. Valid options are a combination of one or more of the following:
o
= stalk on OK states,
w = stalk on WARNING states,
u
= stalk on UNKNOWN states, and
c
= stalk on CRITICAL states.

\r\n

More information on state stalking can be found in the nagios documentation.

\r\n

Parameter name: stalking_options
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(106, 'service', 'notes', '3', 'default', '

Service - notes

\r\n

This directive is used to define an optional string of notes pertaining to the service. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified service).

\r\n

Parameter name: notes
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(107, 'service', 'icon_image', '3', 'default', '

Service - icon image

\r\n

This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this service. This image will be displayed in the status and extended information CGIs. The image will look best if it is 40x40 pixels in size. Images for services are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).

\r\n

Parameter name: icon_image
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(108, 'service', 'notes_url', '3', 'default', '

Service - notes url

\r\n

This directive is used to define an optional URL that can be used to provide more information about the service. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing service information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the service, emergency contact methods, etc. available to other support staff.

\r\n

Parameter name: notes_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(109, 'service', 'icon_image_alt_text', '3', 'default', '

Service - icon image alt

\r\n

This variable is used to define an optional string that is used in the ALT tag of the image specified by the <icon_image> argument. The ALT tag is used in the status, extended information and statusmap CGIs.

\r\n

Parameter name: icon_image_alt
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(110, 'service', 'action_url', '3', 'default', '

Service - action url

\r\n

This directive is used to define an optional URL that can be used to provide more actions to be performed on the service. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing service information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).

\r\n

Parameter name: action_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(111, 'hostgroup', 'hostgroup_name', 'all', 'default', '

Hostgroup - hostgroup name

\r\n

This directive is used to define a short name used to identify the host group.

\r\n

Parameter name: hostgroup_name
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(112, 'hostgroup', 'members', 'all', 'default', '

Hostgroup - members

\r\n

This is a list of the short names of hosts that should be included in this group. Multiple host names should be separated by commas. This directive may be used as an alternative to (or in addition to) the hostgroups directive in host definitions.

\r\n

NagiosQL: If you select a hostgroup inside a host definition using the hostgroups directive in host definition, this host will not be selected here because these are two different ways to specify a hostgroup!

\r\n

Parameter name: members
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(113, 'hostgroup', 'description', 'all', 'default', '

Hostgroup - alias

\r\n

This directive is used to define is a longer name or description used to identify the host group. It is provided in order to allow you to more easily identify a particular host group.

\r\n

Parameter name: alias
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(114, 'hostgroup', 'notes', '3', 'default', '

Hostgroup - notes

\r\n

This directive is used to define an optional string of notes pertaining to the host. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified host).

\r\n

Parameter name: notes
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(115, 'hostgroup', 'notes_url', '3', 'default', '

Hostgroup - notes url

\r\n

This variable is used to define an optional URL that can be used to provide more information about the host group. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing hostgroup information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the host group, emergency contact methods, etc. available to other support staff.

\r\n

Parameter name: notes_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(116, 'hostgroup', 'action_url', '3', 'default', '

Hostgroup - action url

\r\n

This directive is used to define an optional URL that can be used to provide more actions to be performed on the host group. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing hostgroup information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).

\r\n

Parameter name: action_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(117, 'hostgroup', 'hostgroup_members', 'all', 'default', '

Hostgroup - hostgroup members

\r\n

This optional directive can be used to include hosts from other "sub" host groups in this host group. Specify a comma-delimited list of short names of other host groups whose members should be included in this group.

\r\n

Parameter name: hostgroup_members
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(118, 'servicegroup', 'servicegroup_name', 'all', 'default', '

Servicegroup - servicegroup name

\r\n

This directive is used to define a short name used to identify the service group.

\r\n

Parameter name: servicegroup_name
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(119, 'servicegroup', 'members', 'all', 'default', '

Servicegroup - members

\r\n

This is a list of the descriptions of services (and the names of their corresponding hosts) that should be included in this group. Host and service names should be separated by commas. This directive may be used as an alternative to the servicegroups directive in service definitions.

\r\n

NagiosQL: If you select a servicegroup inside a service definition using the servicegroups directive in service definition, this service will not be selected here because these are two different ways to specify a servicegroup!

\r\n

Parameter name: members
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(120, 'servicegroup', 'description', 'all', 'default', '

Servicegroup - alias

\r\n

This directive is used to define is a longer name or description used to identify the service group. It is provided in order to allow you to more easily identify a particular service group.

\r\n

Parameter name: alias
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(121, 'servicegroup', 'notes', '3', 'default', '

Servicegroup - notes

\r\n

This directive is used to define an optional string of notes pertaining to the service group. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified service group).

\r\n

Parameter name: notes
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(122, 'servicegroup', 'notes_url', '3', 'default', '

Servicegroup - notes url

\r\n

This directive is used to define an optional URL that can be used to provide more information about the service group. If you specify an URL, you will see a red folder icon in the CGIs (when you are viewing service group information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the service group, emergency contact methods, etc. available to other support staff.

\r\n

Parameter name: notes_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(123, 'servicegroup', 'action_url', '3', 'default', '

Servicegroup - action url

\r\n

This directive is used to define an optional URL that can be used to provide more actions to be performed on the service group. If you specify an URL, you will see a red "splat" icon in the CGIs (when you are viewing service group information) that links to the URL you specify here. Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).

\r\n

Parameter name: action_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(124, 'servicegroup', 'servicegroup_members', 'all', 'default', '

Servicegroup - servicegroup members

\r\n

This optional directive can be used to include services from other "sub" service groups in this service group. Specify a comma-delimited list of short names of other service groups whose members should be included in this group.

\r\n

Parameter name: servicegroup_members
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(125, 'hosttemplate', 'template_name', 'all', 'default', '

Hosttemplate - template name

\r\n

This directive is used to define a short name used to identify the host template.

\r\n

Parameter name: name
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(126, 'servicetemplate', 'template_name', 'all', 'default', '

Servicetemplate - template name

\r\n

This directive is used to define a short name used to identify the service template.

\r\n

Parameter name: name
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(127, 'contact', 'contact_name', 'all', 'default', '

Contact - contact name

\r\n

This directive is used to define a short name used to identify the contact. It is referenced in contact group definitions. Under the right circumstances, the $CONTACTNAME$ macro will contain this value.

\r\n

Parameter name: contact_name
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(128, 'contact', 'contactgroups', 'all', 'default', '

Contact - contactgroups

\r\n

This directive is used to identify the short name(s) of the contactgroup(s) that the contact belongs to. Multiple contactgroups should be separated by commas. This directive may be used as an alternative to (or in addition to) using the members directive in contactgroup definitions.

\r\n

NagiosQL: If a contactgroup is defined here - this contact will not be selected inside the member field of the same contactgroup definition!

\r\n

Parameter name: contactgroups
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(129, 'contact', 'alias', 'all', 'default', '

Contact - alias

\r\n

This directive is used to define a longer name or description for the contact. Under the rights circumstances, the $CONTACTALIAS$ macro will contain this value. If not specified, the contact_name will be used as the alias.

\r\n

Parameter name: alias
Required: no (yes in Nagios 2.x)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(130, 'contact', 'email', 'all', 'default', '

Contact - email

\r\n

This directive is used to define an email address for the contact. Depending on how you configure your notification commands, it can be used to send out an alert email to the contact. Under the right circumstances, the $CONTACTEMAIL$ macro will contain this value.

\r\n

Parameter name: email
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(131, 'contact', 'pager', 'all', 'default', '

Contact - pager

\r\n

This directive is used to define a pager number for the contact. It can also be an email address to a pager gateway (i.e. pagejoe@pagenet.com). Depending on how you configure your notification commands, it can be used to send out an alert page to the contact. Under the right circumstances, the $CONTACTPAGER$ macro will contain this value.

\r\n

Parameter name: pager
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(132, 'contact', 'address', 'all', 'default', '

Contact - addressx

\r\n

Address directives are used to define additional "addresses" for the contact. These addresses can be anything - cell phone numbers, instant messaging addresses, etc. Depending on how you configure your notification commands, they can be used to send out an alert o the contact. Up to six addresses can be defined using these directives (address1 through address6). The $CONTACTADDRESSx$ macro will contain this value.

\r\n

Parameter name: addressx (x as number from 1 to 6)
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(133, 'contact', 'host_notifications_enabled', '3', 'default', '

Contact - host notifications enabled

\r\n

This directive is used to determine whether or not the contact will receive notifications about host problems and recoveries. Values: 0 = don''t send notifications, 1 = send notifications.

\r\n

Parameter name: host_notifications_enabled
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(134, 'contact', 'service_notifications_enabled', '3', 'default', '

Contact - service notifications enabled

\r\n

This directive is used to determine whether or not the contact will receive notifications about service problems and recoveries. Values: 0 = don''t send notifications, 1 = send notifications.

\r\n

Parameter name: service_notifications_enabled
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(135, 'contact', 'host_notification_period', 'all', 'default', '

Contact - host notification period

\r\n

This directive is used to specify the short name of the time period during which the contact can be notified about host problems or recoveries. You can think of this as an "on call" time for host notifications for the contact. Read the documentation on time periods for more information on how this works and potential problems that may result from improper use.

\r\n

Parameter name: host_notification_period
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(136, 'contact', 'service_notification_period', 'all', 'default', '

Contact - service notification period

\r\n

This directive is used to specify the short name of the time period during which the contact can be notified about service problems or recoveries. You can think of this as an "on call" time for service notifications for the contact. Read the documentation on time periods for more information on how this works and potential problems that may result from improper use.

\r\n

Parameter name: service_notification_period
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(137, 'contact', 'host_notification_options', '2', 'default', '

Contact - host notification options

\r\n

This directive is used to define the host states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following:
d
= notify on DOWN host states,
u = notify on UNREACHABLE host states,
r
= notify on host recoveries (UP states), and
f
= notify when the host starts and stops flapping.
If you specify n (none) as an option, the contact will not receive any type of host notifications.

\r\n

Parameter name: host_notification_options
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(138, 'contact', 'host_notification_options', '3', 'default', '

Contact - host notification options

\r\n

This directive is used to define the host states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following:
d = notify on DOWN host states,
u
= notify on UNREACHABLE host states,
r
= notify on host recoveries (UP states),
f
= notify when the host starts and stops flapping, and
s = send notifications when host or service scheduled downtime starts and ends.
If you specify n (none) as an option, the contact will not receive any type of host notifications.

\r\n

Parameter name: host_notification_options
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(139, 'contact', 'service_notification_options', '2', 'default', '

Contact - service notification options

\r\n

This directive is used to define the service states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following:
w
= notify on WARNING service states,
u
= notify on UNKNOWN service states,
c
= notify on CRITICAL service states,
r = notify on service recoveries (OK states), and
f = notify when the servuce starts and stops flapping.
If you specify n (none) as an option, the contact will not receive any type of host notifications.

\r\n

Parameter name: service_notification_options
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(140, 'contact', 'service_notification_options', '3', 'default', '

Contact - service notification options

\r\n

This directive is used to define the service states for which notifications can be sent out to this contact. Valid options are a combination of one or more of the following:
w
= notify on WARNING service states,
u = notify on UNKNOWN service states,
c = notify on CRITICAL service states,
r
= notify on service recoveries (OK states), and
f = notify when the host starts and stops flapping, and
s
= send notifications when host or service scheduled downtime starts and ends.
If you specify n (none) as an option, the contact will not receive any type of host notifications.

\r\n

Parameter name: service_notification_options
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(141, 'contact', 'host_notification_commands', 'all', 'default', '

Contact - host notification commands

\r\n

This directive is used to define a list of the short names of the commands used to notify the contact of a host problem or recovery. Multiple notification commands should be separated by commas. All notification commands are executed when the contact needs to be notified. The maximum amount of time that a notification command can run is controlled by the notification_timeout option.

\r\n

Parameter name: host_notification_commands
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(142, 'contact', 'service_notification_commands', 'all', 'default', '

Contact - service notification commands

\r\n

This directive is used to define a list of the short names of the commands used to notify the contact of a service problem or recovery. Multiple notification commands should be separated by commas. All notification commands are executed when the contact needs to be notified. The maximum amount of time that a notification command can run is controlled by the notification_timeout option.

\r\n

Parameter name: service_notification_commands
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(143, 'contact', 'retain_status_information', '3', 'default', '

Contact - retain status information

\r\n

This directive is used to determine whether or not status-related information about the contact is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable status information retention, 1 = enable status information retention.

\r\n

Parameter name: retain_status_information
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(144, 'contact', 'can_submit_commands', '3', 'default', '

Contact - can submit commands

\r\n

This directive is used to determine whether or not the contact can submit external commands to Nagios from the CGIs. Values: 0 = don''t allow contact to submit commands, 1 = allow contact to submit commands.

\r\n

Parameter name: can_submit_commands
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(145, 'contact', 'retain_nostatus_information', '3', 'default', '

Contact - retain nonstatus information

\r\n

This directive is used to determine whether or not non-status information about the contact is retained across program restarts. This is only useful if you have enabled state retention using the retain_state_information directive. Value: 0 = disable non-status information retention, 1 = enable non-status information retention.

\r\n

Parameter name: retain_nonstatus_information
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(146, 'contact', 'templateadd', 'all', 'default', '

Contact - Templates

\r\n

You can add one or more contact templates to a contact configuration. Nagios will add the definitions from each template to a contact configuration.

\r\n

If you add more than one template - the sort order will be used to overwrite configuration items which are defined inside templates before.

\r\n

The host configuration itselves will overwrite all values which are defined in templates before and pass all values which are not defined.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(147, 'contact', 'genericname', 'all', 'default', '

Contact - generic name

\r\n

It is possible to use a contact definition as a template for other contact configurations. If this definition should be used as template, a generic template name must be defined.

\r\n

We do not recommend to do this - it is more open to define a separate contact template than use this option.

\r\n

Parameter name: name
Required:
no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(148, 'contactgroup', 'contactgroup_name', 'all', 'default', '

Contactgroup - contactgroup name

\r\n

This directive is a short name used to identify the contact group.

\r\n

Parameter name: contactgroup_name
Required:
yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(149, 'contactgroup', 'members', 'all', 'default', '

Contactgroup - members

\r\n

This directive is used to define a list of the short names of contacts that should be included in this group. Multiple contact names should be separated by commas. This directive may be used as an alternative to (or in addition to) using the contactgroups directive in contact definitions.

\r\n

NagiosQL: If you select a contactgroup inside a contact definition using the contactgroups directive in contact definition, this contact will not be selected here because these are two different ways to specify a contactgroup!

\r\n

Parameter name: members
Required:
yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(150, 'contactgroup', 'alias', 'all', 'default', '

Contactgroup - alias

\r\n

This directive is used to define a longer name or description used to identify the contact group.

\r\n

Parameter name: alias
Required:
yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(151, 'contactgroup', 'contactgroup_members', 'all', 'default', '

Contactgroup - contactgroup members

\r\n

This optional directive can be used to include contacts from other "sub" contact groups in this contact group. Specify a comma-delimited list of short names of other contact groups whose members should be included in this group.

\r\n

Parameter name: contactgroup_members
Required:
no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(152, 'timeperiod', 'timeperiod_name', 'all', 'default', '

Timeperiod - timeperiod name

\r\n

This directives is the short name used to identify the time period.

\r\n

Parameter name: timeperiod_name
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(153, 'timeperiod', 'exclude', '3', 'default', '

Timeperiod - exclude

\r\n

This directive is used to specify the short names of other timeperiod definitions whose time ranges should be excluded from this timeperiod. Multiple timeperiod names should be separated with a comma.

\r\n

Parameter name: exclude
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(154, 'timeperiod', 'alias', 'all', 'default', '

Timeperiod - alias

\r\n

This directive is a longer name or description used to identify the time period.

\r\n

Parameter name: alias
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(155, 'timeperiod', 'templatename', '3', 'default', '

Timeperiod - template name

\r\n

Not yet implemented.

\r\n

Parameter name: name
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(156, 'timeperiod', 'weekday', '2', 'default', '

Timeperiod - time definition

\r\n

The sunday through saturday directives are comma-delimited lists of time ranges that are "valid" times for a particular day of the week. Notice that there are seven different days for which you can define time ranges (Sunday through Saturday).

\r\n

Parameter name: [weekday] [exception]
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(157, 'timeperiod', 'timerange', '2', 'default', '

Timeperiod - time range

\r\n

Each time range is in the form of HH:MM-HH:MM, where hours are specified on a 24 hour clock. For example, 00:15-24:00 means 12:15am in the morning for this day until 12:20am midnight (a 23 hour, 45 minute total time range). If you wish to exclude an entire day from the timeperiod, simply do not include it in the timeperiod definition.

\r\n

Parameter name: [weekday] [exception]
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(158, 'timeperiod', 'weekday', '3', 'default', '

Timeperiod - time definition

\r\n

The weekday directives ("sunday" through "saturday")are comma-delimited lists of time ranges that are "valid" times for a particular day of the week. Notice that there are seven different days for which you can define time ranges (Sunday through Saturday). 

\r\n

You can also specify several different types of exceptions to the standard rotating weekday schedule. Exceptions can take a number of different forms including single days of a specific or generic month, single weekdays in a month, or single calendar dates. You can also specify a range of days/dates and even specify skip intervals to obtain functionality described by "every 3 days between these dates". Rather than list all the possible formats for exception strings, Weekdays and different types of exceptions all have different levels of precedence, so its important to understand how they can affect each other. More information on this can be found in the documentation on timeperiods.

\r\n

Parameter name: [weekday] [exception]
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(159, 'timeperiod', 'timerange', '3', 'default', '

Timeperiod - time range

\r\n

Each time range is in the form of HH:MM-HH:MM, where hours are specified on a 24 hour clock. For example, 00:15-24:00 means 12:15am in the morning for this day until 12:00am midnight (a 23 hour, 45 minute total time range). If you wish to exclude an entire day from the timeperiod, simply do not include it in the timeperiod definition.

\r\n

Parameter name: [weekday] [exception]
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(160, 'contacttemplate', 'template_name', 'all', 'default', '

Contacttemplate - template name

\r\n

This directive is used to define a short name used to identify the contact template.

\r\n

Parameter name: name
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(161, 'command', 'command_name', 'all', 'default', '

Command - command name

\r\n

This directive is the short name used to identify the command. It is referenced in contact, host, and service definitions (in notification, check, and event handler directives), among other places.

\r\n

Parameter name: command_name
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(162, 'command', 'command_line', 'all', 'default', '

Command - command line

\r\n

This directive is used to define what is actually executed by Nagios when the command is used for service or host checks, notifications, or event handlers. Before the command line is executed, all valid macros are replaced with their respective values. See the documentation on macros for determining when you can use different macros. Note that the command line is not surrounded in quotes. Also, if you want to pass a dollar sign ($) on the command line, you have to escape it with another dollar sign.

\r\n

NOTE: You may not include a semicolon (;) in the command_line directive, because everything after it will be ignored as a config file comment. You can work around this limitation by setting one of the $USER$ macros in your resource file to a semicolon and then referencing the appropriate $USER$ macro in the command_line directive in place of the semicolon.

\r\n

If you want to pass arguments to commands during runtime, you can use $ARGn$ macros in the command_line directive of the command definition and then separate individual arguments from the command name (and from each other) using bang (!) characters in the object definition directive (host check command, service event handler command, etc) that references the command. More information on how arguments in command definitions are processed during runtime can be found in the documentation on macros.

\r\n

Parameter name: command_line
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(163, 'command', 'command_type', 'all', 'default', '

Command - command type

\r\n

This directive is used to differ checks and misc commands. Its a NagiosQL definition only.

\r\n

Commands tagged as "check command" will be displayed in services and hosts as check command.

\r\n

Commands tagged as "misc command" will be displayed in contacts, services and hosts as event command.

\r\n

Not classified commands will be displayed everywhere.

\r\n

This definition is only used to reduce the amount of commands shown in the selection fields and to have a more clear view.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(164, 'hostdependency', 'dependent_host', 'all', 'default', '

Hostdependency - dependent host name

\r\n

This directive is used to identify the short name(s) of the dependent host(s). Multiple hosts should be separated by commas

\r\n

Parameter name: dependent_host_name
Required: yes (no, if a dependent hostgroup is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(165, 'hostdependency', 'dependent_hostgroups', 'all', 'default', '

Hostdependency - dependent hostgroup name

\r\n

This directive is used to identify the short name(s) of the dependenthostgroup(s). Multiple hostgroups should be separated by commas. The dependent_hostgroup_name may be used instead of, or in addition to, the dependent_host_name directive.

\r\n

Parameter name: dependent_hostgroup_name
Required: no (yes, if no dependent host is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(166, 'hostdependency', 'host', 'all', 'default', '

Hostdependency - host name

\r\n

This directive is used to identify the short name(s) of the host(s) that is being depended upon (also referred to as the master host). Multiple hosts should be separated by commas.

\r\n

Parameter name: host_name
Required: yes (no, if  a hostgroup is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(167, 'hostdependency', 'hostgroup', 'all', 'default', '

Hostdependency - hostgroup name

\r\n

This directive is used to identify the short name(s) of the host(s) that is being depended upon (also referred to as the master host). Multiple hosts should be separated by commas.

\r\n

Parameter name: hostgroup_name
Required: no (yes, if a no host is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(168, 'hostdependency', 'config_name', 'all', 'default', '

Hostdependency - config name

\r\n

This directive is used to specify a common config name for a hostdependency configration. This is a NagiosQL parameter and it will not be written to the configuration file.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(169, 'hostdependency', 'inherit_parents', 'all', 'default', '

Hostdependency - inherits parent

\r\n

This directive indicates whether or not the dependency inherits dependencies of the host that is being depended upon (also referred to as the master host). In other words, if the master host is dependent upon other hosts and any one of those dependencies fail, this dependency will also fail.

\r\n

Parameter name: inherits_parent
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(170, 'hostdependency', 'dependency_period', '3', 'default', '

Hostdependency - dependency_period

\r\n

This directive is used to specify the short name of the time period during which this dependency is valid. If this directive is not specified, the dependency is considered to be valid during all times.

\r\n

Parameter name: dependency_period
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(171, 'hostdependency', 'execution_failure_criteria', 'all', 'default', '

Hostdependency - execution failure criteria

\r\n

This directive is used to specify the criteria that determine when the dependent host should not be actively checked. If the master host is in one of the failure states we specify, the dependent host will not be actively checked. Valid options are a combination of one or more of the following (multiple options are separated with commas):
o = fail on an UP state,
d = fail on a DOWN state,
u = fail on an UNREACHABLE state, and
p
= fail on a pending state (e.g. the host has not yet been checked).

\r\n

If you specify n (none) as an option, the execution dependency will never fail and the dependent host will always be actively checked (if other conditions allow for it to be).

\r\n

Example: If you specify u,d in this field, the dependent host will not be actively checked if the master host is in either an UNREACHABLE or DOWN state.

\r\n

Parameter name: execution_failure_criteria
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(172, 'hostdependency', 'notification_failure_criteria', 'all', 'default', '

Hostdependency - notification failure criteria

\r\n

This directive is used to define the criteria that determine when notifications for the dependent host should not be sent out. If the master host is in one of the failure states we specify, notifications for the dependent host will not be sent to contacts. Valid options are a combination of one or more of the following:
o = fail on an UP state,
d = fail on a DOWN state,
u = fail on an UNREACHABLE state, and
p = fail on a pending state (e.g. the host has not yet been checked).

\r\n

If you specify n (none) as an option, the notification dependency will never fail and notifications for the dependent host will always be sent out.

\r\n

Example: If you specify d in this field, the notifications for the dependent host will not be sent out if the master host is in a DOWN state.

\r\n

Parameter name: notification_failure_criteria
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(173, 'hostescalation', 'host', 'all', 'default', '

Hostescalation - host name

\r\n

This directive is used to identify the short name of the host that the escalation should apply to.

\r\n

Parameter name: host_name
Required: yes (no, if a hostgroup name is defined

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(174, 'hostescalation', 'hostgroup', 'all', 'default', '

Hostescalation - hostgroup name

\r\n

This directive is used to identify the short name(s) of the hostgroup(s) that the escalation should apply to. Multiple hostgroups should be separated by commas. If this is used, the escalation will apply to all hosts that are members of the specified hostgroup(s).

\r\n

Parameter name: hostgroup_name
Required: no (yes, if no host ist defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(175, 'hostescalation', 'contact', 'all', 'default', '

Hostescalation - contacts

\r\n

This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this host. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each host escalation definition.

\r\n

Parameter name: contacts
Required: yes (no, if a contactgroup is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(176, 'hostescalation', 'contactgroup', 'all', 'default', '

Hostescalation - contact groups

\r\n

This directive is used to identify the short name of the contact group that should be notified when the host notification is escalated. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each host escalation definition.

\r\n

Parameter name: contact_groups
Required: yes (no, if a contact is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(177, 'hostescalation', 'config_name', 'all', 'default', '

Hostescalation - config name

\r\n

This directive is used to specify a common config name for a hostescalation configration. This is a NagiosQL parameter and it will not be written to the configuration file.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(178, 'hostescalation', 'escalation_period', 'all', 'default', '

Hostescalation - escalation period

\r\n

This directive is used to specify the short name of the time period during which this escalation is valid. If this directive is not specified, the escalation is considered to be valid during all times.

\r\n

Parameter name: escalation_period
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(179, 'hostescalation', 'escalation_options', 'all', 'default', '

Hostescalation - escalation options

\r\n

This directive is used to define the criteria that determine when this host escalation is used. The escalation is used only if the host is in one of the states specified in this directive. If this directive is not specified in a host escalation, the escalation is considered to be valid during all host states. Valid options are a combination of one or more of the following:
r = escalate on an UP (recovery) state,
d = escalate on a DOWN state, and
u
= escalate on an UNREACHABLE state.

\r\n

Example: If you specify d in this field, the escalation will only be used if the host is in a DOWN state.

\r\n

Parameter name: escalation_options
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(180, 'hostescalation', 'first_notification', 'all', 'default', '

Hostescalation - first notification

\r\n

This directive is a number that identifies the first notification for which this escalation is effective. For instance, if you set this value to 3, this escalation will only be used if the host is down or unreachable long enough for a third notification to go out.

\r\n

Parameter name: first_notification
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(181, 'hostescalation', 'last_notification', 'all', 'default', '

Hostescalation - last notification

\r\n

This directive is a number that identifies the last notification for which this escalation is effective. For instance, if you set this value to 5, this escalation will not be used if more than five notifications are sent out for the host. Setting this value to 0 means to keep using this escalation entry forever (no matter how many notifications go out).

\r\n

Parameter name: last_notification
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(182, 'hostescalation', 'notification_intervall', 'all', 'default', '

Hostescalation - notification interval

\r\n

This directive is used to determine the interval at which notifications should be made while this escalation is valid. If you specify a value of 0 for the interval, Nagios will send the first notification when this escalation definition is valid, but will then prevent any more problem notifications from being sent out for the host. Notifications are sent out again until the host recovers.

\r\n

This is useful if you want to stop having notifications sent out after a certain amount of time. Note: If multiple escalation entries for a host overlap for one or more notification ranges, the smallest notification interval from all escalation entries is used.

\r\n

Parameter name: notification_interval
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(183, 'hostextinfo', 'host_name', 'all', 'default', '

Hostextinfo - host name

\r\n

This variable is used to identify the short name of the host which the data is associated with.

\r\n

Parameter name: host_name
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(184, 'hostextinfo', 'icon_image', 'all', 'default', '

Hostextinfo - icon image

\r\n

This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be displayed in the status and extended information CGIs. The image will look best if it is 40x40 pixels in size.

\r\n

Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).

\r\n

Parameter name: icon_image
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(185, 'hostextinfo', 'notes', 'all', 'default', '

Hostextinfo - notes

\r\n

This directive is used to define an optional string of notes pertaining to the host. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified host).

\r\n

Parameter name: notes
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(186, 'hostextinfo', 'icon_image_alt_text', 'all', 'default', '

Hostextinfo - icon image alt

\r\n

This variable is used to define an optional string that is used in the ALT tag of the image specified by the <icon_image> argument. The ALT tag is used in the status, extended information and statusmap CGIs.

\r\n

Parameter name: icon_image_alt
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(187, 'hostextinfo', 'notes_url', 'all', 'default', '

Hostextinfo - notes url

\r\n

This variable is used to define an optional URL that can be used to provide more information about the host. If you specify an URL, you will see a link that says "Extra Host Notes" in the extended information CGI (when you are viewing information about the specified host). Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the host, emergency contact methods, etc. available to other support staff.

\r\n

Parameter name: notes_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(188, 'hostextinfo', 'vrml_image', 'all', 'default', '

Hostextinfo - vrml image

\r\n

This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be used as the texture map for the specified host in the statuswrl CGI. Unlike the image you use for the icon_image variable, this one should probably not have any transparency. If it does, the host object will look a bit wierd.

\r\n

Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).

\r\n

Parameter name: vrml_image
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(189, 'hostextinfo', 'action_url', 'all', 'default', '

Hostextinfo - action url

\r\n

This directive is used to define an optional URL that can be used to provide more actions to be performed on the host. If you specify an URL, you will see a link that says "Extra Host Actions" in the extended information CGI (when you are viewing information about the specified host). Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).

\r\n

Parameter name: action_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(190, 'hostextinfo', 'status_image', 'all', 'default', '

Hostextinfo - statusmap image

\r\n

This variable is used to define the name of an image that should be associated with this host in the statusmap CGI. You can specify a JPEG, PNG, and GIF image if you want, although I would strongly suggest using a GD2 format image, as other image formats will result in a lot of wasted CPU time when the statusmap image is generated.

\r\n

GD2 images can be created from PNG images by using the pngtogd2 utility supplied with Thomas Boutell''s gd library. The GD2 images should be created in uncompressed format in order to minimize CPU load when the statusmap CGI is generating the network map image.

\r\n

The image will look best if it is 40x40 pixels in size. You can leave these option blank if you are not using the statusmap CGI. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).

\r\n

Parameter name: statusmap_image
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(191, 'hostextinfo', '2d_coords', 'all', 'default', '

Hostextinfo - 2d coords

\r\n

This variable is used to define coordinates to use when drawing the host in the statusmap CGI. Coordinates should be given in positive integers, as they correspond to physical pixels in the generated image. The origin for drawing (0,0) is in the upper left hand corner of the image and extends in the positive x direction (to the right) along the top of the image and in the positive y direction (down) along the left hand side of the image. For reference, the size of the icons drawn is usually about 40x40 pixels (text takes a little extra space). The coordinates you specify here are for the upper left hand corner of the host icon that is drawn.

\r\n

Note: Don''t worry about what the maximum x and y coordinates that you can use are. The CGI will automatically calculate the maximum dimensions of the image it creates based on the largest x and y coordinates you specify.

\r\n

Parameter name: 2d_coords
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(192, 'hostextinfo', '3d_coords', 'all', 'default', '

Hostextinfo - 3d coords

\r\n

This variable is used to define coordinates to use when drawing the host in the statuswrl CGI. Coordinates can be positive or negative real numbers. The origin for drawing is (0.0,0.0,0.0). For reference, the size of the host cubes drawn is 0.5 units on each side (text takes a little more space). The coordinates you specify here are used as the center of the host cube.

\r\n

Parameter name: 3d_coords
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(193, 'serviceescalation', 'host', 'all', 'default', '

Serviceescalation - host name

\r\n

This directive is used to identify the short name(s) of the host(s) that the service escalation should apply to or is associated with.

\r\n

Parameter name: host_name
Required: yes (no, if a hostgroup name is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(194, 'serviceescalation', 'hostgroup', 'all', 'default', '

Serviceescalation - hostgroup name

\r\n

This directive is used to specify the short name(s) of the hostgroup(s) that the service escalation should apply to or is associated with. Multiple hostgroups should be separated by commas. The hostgroup_name may be used instead of, or in addition to, the host_name directive.

\r\n

Parameter name: hostgroup_name
Required: yes (no, if a host name is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(195, 'serviceescalation', 'contact', 'all', 'default', '

Serviceescalation - contacts

\r\n

This is a list of the short names of the contacts that should be notified whenever there are problems (or recoveries) with this service. Multiple contacts should be separated by commas. Useful if you want notifications to go to just a few people and don''t want to configure contact groups. You must specify at least one contact or contact group in each service escalation definition.

\r\n

Parameter name: contacts
Required: yes (no, if a contact group is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(196, 'serviceescalation', 'contactgroup', 'all', 'default', '

Serviceescalation - contact groups

\r\n

This directive is used to identify the short name of the contact group that should be notified when the service notification is escalated. Multiple contact groups should be separated by commas. You must specify at least one contact or contact group in each service escalation definition.

\r\n

Parameter name: contact_groups
Required: yes (no, if a contact is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(197, 'serviceescalation', 'config_name', 'all', 'default', '

Serviceescalation - config name

\r\n

This directive is used to specify a common config name for a serviceescalation configration. This is a NagiosQL parameter and it will not be written to the configuration file.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(198, 'serviceescalation', 'service', 'all', 'default', '

Serviceescalation - service description

\r\n

This directive is used to identify the description of the service the escalation should apply to.

\r\n

Parameter name: service_description
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(199, 'serviceescalation', 'first_notification', 'all', 'default', '

Serviceescalation - first notification

\r\n

This directive is a number that identifies the first notification for which this escalation is effective. For instance, if you set this value to 3, this escalation will only be used if the service is in a non-OK state long enough for a third notification to go out.

\r\n

Parameter name: first_notification
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(200, 'serviceescalation', 'last_notification', 'all', 'default', '

Serviceescalation - last notification

\r\n

This directive is a number that identifies the last notification for which this escalation is effective. For instance, if you set this value to 5, this escalation will not be used if more than five notifications are sent out for the service. Setting this value to 0 means to keep using this escalation entry forever (no matter how many notifications go out).

\r\n

Parameter name: last_notification
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(201, 'serviceescalation', 'notification_intervall', 'all', 'default', '

Serviceescalation - notification interval

\r\n

This directive is used to determine the interval at which notifications should be made while this escalation is valid. If you specify a value of 0 for the interval, Nagios will send the first notification when this escalation definition is valid, but will then prevent any more problem notifications from being sent out for the host. Notifications are sent out again until the host recovers.

\r\n

This is useful if you want to stop having notifications sent out after a certain amount of time. Note: If multiple escalation entries for a host overlap for one or more notification ranges, the smallest notification interval from all escalation entries is used.

\r\n

Parameter name: notification_interval
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(202, 'serviceescalation', 'escalation_period', 'all', 'default', '

Serviceescalation - escalation period

\r\n

This directive is used to specify the short name of the time period during which this escalation is valid. If this directive is not specified, the escalation is considered to be valid during all times.

\r\n

Parameter name: escalation_period
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(203, 'serviceescalation', 'escalation_options', 'all', 'default', '

Serviceescalation - escalation options

\r\n

This directive is used to define the criteria that determine when this service escalation is used. The escalation is used only if the service is in one of the states specified in this directive. If this directive is not specified in a service escalation, the escalation is considered to be valid during all service states. Valid options are a combination of one or more of the following:
r
= escalate on an OK (recovery) state,
w = escalate on a WARNING state,
u
= escalate on an UNKNOWN state, and
c = escalate on a CRITICAL state.

\r\n

Example: If you specify w in this field, the escalation will only be used if the service is in a WARNING state.

\r\n

Parameter name: escalation_options
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(204, 'servicedependency', 'dependent_host', 'all', 'default', '

Servicedependency - dependent host

\r\n

This directive is used to identify the short name(s) of the host(s) that the dependent service "runs" on or is associated with. Multiple hosts should be separated by commas. Leaving this directive blank can be used to create "same host" dependencies.

\r\n

Parameter name: dependent_host
Required: yes (no, if a dependent hostgroup is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(205, 'servicedependency', 'host', 'all', 'default', '

Servicedependency - host name

\r\n

This directive is used to identify the short name(s) of the host(s) that the service that is being depended upon (also referred to as the master service) "runs" on or is associated with. Multiple hosts should be separated by commas.

\r\n

Parameter name: host_name
Required: yes (no, if a hostgroup is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(206, 'servicedependency', 'dependent_hostgroup', 'all', 'default', '

Servicedependency - dependent hostgroup

\r\n

This directive is used to specify the short name(s) of the hostgroup(s) that the dependent service "runs" on or is associated with. Multiple hostgroups should be separated by commas. The dependent_hostgroup may be used instead of, or in addition to, the dependent_host directive.

\r\n

Parameter name: dependent_hostgroup
Required: yes (no, if a dependent host is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(207, 'servicedependency', 'hostgroup', 'all', 'default', '

Servicedependency - hostgroup name

\r\n

This directive is used to identify the short name(s) of the hostgroup(s) that the service that is being depended upon (also referred to as the master service) "runs" on or is associated with. Multiple hostgroups should be separated by commas. The hostgroup_name may be used instead of, or in addition to, the host_name directive.

\r\n

Parameter name: hostgroup_name
Required: yes (no, if a host is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(208, 'servicedependency', 'dependent_services', 'all', 'default', '

Servicedependency - dependent service description

\r\n

This directive is used to identify the description of the dependent service.

\r\n

Parameter name: dependent_service_description
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(209, 'servicedependency', 'services', 'all', 'default', '

Servicedependency - service description

\r\n

This directive is used to identify the description of the service that is being depended upon (also referred to as the master service).

\r\n

Parameter name: service_description
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(210, 'servicedependency', 'config_name', 'all', 'default', '

Servicedependency - config name

\r\n

This directive is used to specify a common config name for a servicedependency configration. This is a NagiosQL parameter and it will not be written to the configuration file.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(211, 'servicedependency', 'inherit_parents', 'all', 'default', '

Servicedependency - inherits parent

\r\n

This directive indicates whether or not the dependency inherits dependencies of the service that is being depended upon (also referred to as the master service). In other words, if the master service is dependent upon other services and any one of those dependencies fail, this dependency will also fail.

\r\n

Parameter name: inherits_parent
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(212, 'servicedependency', 'dependency_period', 'all', 'default', '

Servicedependency - dependency period

\r\n

This directive is used to specify the short name of the time period during which this dependency is valid. If this directive is not specified, the dependency is considered to be valid during all times.

\r\n

Parameter name: dependency_period
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(213, 'servicedependency', 'execution_failure_criteria', 'all', 'default', '

Servicedependency - execution failure criteria

\r\n

This directive is used to specify the criteria that determine when the dependent service should not be actively checked. If the master service is in one of the failure states we specify, the dependent service will not be actively checked. Valid options are a combination of one or more of the following (multiple options are separated with commas):
o = fail on an OK state,
w = fail on a WARNING state,
u
= fail on an UNKNOWN state,
c = fail on a CRITICAL state, and
p = fail on a pending state (e.g. the service has not yet been checked).
If you specify n (none) as an option, the execution dependency will never fail and checks of the dependent service will always be actively checked (if other conditions allow for it to be).

\r\n

Example: If you specify o,c,u in this field, the dependent service will not be actively checked if the master service is in either an OK, a CRITICAL, or an UNKNOWN state.

\r\n

Parameter name: execution_failure_criteria
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(214, 'servicedependency', 'notification_failure_criteria', 'all', 'default', '

Servicedependency - notification failure criteria

\r\n

This directive is used to define the criteria that determine when notifications for the dependent service should not be sent out. If the master service is in one of the failure states we specify, notifications for the dependent service will not be sent to contacts. Valid options are a combination of one or more of the following:
o
= fail on an OK state,
w = fail on a WARNING state,
u
= fail on an UNKNOWN state,
c = fail on a CRITICAL state, and
p = fail on a pending state (e.g. the service has not yet been checked).
If you specify n (none) as an option, the notification dependency will never fail and notifications for the dependent service will always be sent out.

\r\n

Example: If you specify w in this field, the notifications for the dependent service will not be sent out if the master service is in a WARNING state.

\r\n

Parameter name: notification_failure_criteria
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(216, 'serviceextinfo', 'host_name', 'all', 'default', '

Serviceextinfo - host name

\r\n

This directive is used to identify the short name of the host that the service is associated with.

\r\n

Parameter name: host_name
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(217, 'serviceextinfo', 'icon_image', 'all', 'default', '

Serviceextinfo - icon image

\r\n

This variable is used to define the name of a GIF, PNG, or JPG image that should be associated with this host. This image will be displayed in the status and extended information CGIs.

\r\n

The image will look best if it is 40x40 pixels in size. Images for hosts are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).

\r\n

Parameter name: icon_image
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(218, 'serviceextinfo', 'service_description', 'all', 'default', '

Serviceextinfo - service description

\r\n

This directive is description of the service which the data is associated with.

\r\n

Parameter name: service_description
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(219, 'serviceextinfo', 'notes', 'all', 'default', '

Serviceextinfo - notes

\r\n

This directive is used to define an optional string of notes pertaining to the service. If you specify a note here, you will see the it in the extended information CGI (when you are viewing information about the specified service).

\r\n

Parameter name: notes
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(220, 'serviceextinfo', 'action_url', 'all', 'default', '

Serviceextinfo - action url

\r\n

This directive is used to define an optional URL that can be used to provide more actions to be performed on the service. If you specify an URL, you will see a link that says "Extra Service Actions" in the extended information CGI (when you are viewing information about the specified service). Any valid URL can be used. If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/).

\r\n

Parameter name: action_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(221, 'serviceextinfo', 'notes_url', 'all', 'default', '

Serviceextinfo - notes url

\r\n

This directive is used to define an optional URL that can be used to provide more information about the service. If you specify an URL, you will see a link that says "Extra Service Notes" in the extended information CGI (when you are viewing information about the specified service). Any valid URL can be used.

\r\n

If you plan on using relative paths, the base path will the the same as what is used to access the CGIs (i.e. /cgi-bin/nagios/). This can be very useful if you want to make detailed information on the service, emergency contact methods, etc. available to other support staff.

\r\n

Parameter name: notes_url
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(222, 'serviceextinfo', 'icon_image_alt', 'all', 'default', '

Serviceextinfo - icon image alt

\r\n

This variable is used to define an optional string that is used in the ALT tag of the image specified by the <icon_image> argument. The ALT tag is used in the status, extended information and statusmap CGIs.

\r\n

Parameter name: icon_image_alt
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(223, 'host', 'services', 'all', 'default', '

Host - service settings

\r\n

This box can be used to allocate already existing services to a host. 

\r\n

This is an internal function of NagiosQL.

\r\n

Note: To activate the changes, the corresponding service definitions have to be rewritten!

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(224, 'timeperiod', 'name', 'all', 'default', '

Timeperiod - name

\r\n

Its just a "template" name that can be referenced in other object definitions so they can inherit the objects properties/variables. Template names must be unique amongst objects of the same type, so you can''t have two or more time definitions that have "mytemplate" as their template name.

\r\n

Parameter name: name
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(225, 'timeperiod', 'include', '3', 'default', '

Timeperiod - include

\r\n

This directive is used to specify the short names (template names) of other timeperiod definitions whose time ranges should be included to this timeperiod. Multiple timeperiod names should be separated with a comma.

\r\n

Parameter name: use
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(226, 'user', 'adminenable', 'all', 'default', '

User - enable group administration

\r\n

If this option is selected, the specified user is able to modify the access group for every object definition. This should be restricted only to administrators; otherwise a user might be able to lock himself out.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(227, 'group', 'userrights', 'all', 'default', '

Group - user rights

\r\n

Define the object access rights for a user.

\r\n

READ = The user can see the objects belong to this group
WRITE = The user can modify the objects belong to this group
LINK = The user can use the objects belong to this group to link them in other objects*

* Example: If a time object belongs to this group - the user can add (link) this time object to his contact objects.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(228, 'domain', 'conffile', 'all', 'default', '

Absolute path to your Nagios config file.

Examples:
/etc/nagios/nagios.cfg
/usr/local/nagios/etc/nagios.cfg

This is used to verify your Nagios configuration directly from NagiosQL.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(229, 'domain', 'enable_common', 'all', 'default', '

This option is used to enable or disable the global common domain functionality.

\r\n

If this option is enabled, all objects from the global common domain will be added to this domains configuration files. The global common domain can be used to define objects like timeperiods or contacts that are used in all domains the same.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(230, 'domain', 'utf8_decode', 'all', 'default', '

This is an experimental option!

\r\n

If this option is enabled, UTF8 data from database will be translated to ISO in configuration file. So, the configuration files will be in ISO mode. This could be helpful, if nagios does not understand the UTF8 data from NagiosQL.

\r\n

Tested only with western european configurations!

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(231, 'domain', 'picturedir', 'all', 'default', '

Relative path to your nagios icon images.

Example:
/my/own/images/

\r\n

This path is based on your nagios standard image path. Images are assumed to be in the logos/ subdirectory in your HTML images directory (i.e. /usr/local/nagios/share/images/logos).

\r\n

So in the example above, the images are located in:

\r\n

/usr/local/nagios/share/images/logos/my/own/images/

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(232, 'common', 'accessgroup', 'all', 'default', '

Access group

\r\n

Select an access group name to restrict this object to the group members.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(233, 'common', 'registered', 'all', 'default', '

Register

\r\n

This variable is used to indicate whether or not the object definition should be "registered" with Nagios. By default, all object definitions are registered. If you are using a partial object definition as a template, you would want to prevent it from being registered (an example of this is provided later). Values are as follows: 0 = do NOT register object definition, 1 = register object definition (this is the default). This variable is NOT inherited; every (partial) object definition used as a template must explicitly set the register directive to be 0. This prevents the need to override an inherited register directive with a value of 1 for every object that should be registered.

\r\n

Parameter name: register
Required: yes

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(234, 'servicedependency', 'dependent_servicegroup_name', 'all', 'default', '

Servicedependency - dependent servicegroup name

\r\n

This directive is used to identify the name of the dependent servicegroup.

\r\n

Parameter name: dependent_servicegroup_name
Required: yes (no, if a dependent service is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(235, 'servicedependency', 'servicegroup_name', 'all', 'default', '

Servicedependency - servicegroup name

\r\n

This directive is used to identify the name of the servicegroup that is being depended upon (also referred to as the master service).

\r\n

Parameter name: servicegroup_name
Required: yes (no, if a service is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(236, 'serviceescalation', 'servicegroup', 'all', 'default', '

Serviceescalation - servicegroup name

\r\n

This directive is used to identify the name of the servicegroup the escalation should apply to.

\r\n

Parameter name: servicegroup_name
Required: yes (no, if a service is defined)

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(237, 'user', 'language', 'all', 'default', '

User - language

\r\n

Defines a default UI language for the user.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(238, 'user', 'standarddomain', 'all', 'default', '

User - standard domain

\r\n

Defines a standard domain for the user. After the user has logged in, the defined domain is pre-selected.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(239, 'domain', 'targets', 'all', 'default', '

Select a configuration domain which is assigned to this data domain

\r\n

The settings where to store the configuration files are defined in a configuration domain. Select here the desired target for your configuration files.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(240, 'domain', 'ssh_host_key', 'all', 'default', 'Absolute path to the ssh key directory for the defined ssh user.

Examples:
/etc/nagiosql/ssh/
/usr/local/nagios/etc/.ssh/

This directory includes the key file (id_rsa) for the user to connect to the remote system. Note, that the file name is set to id_rsa!'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(241, 'contact', 'minimum_importance', 'all', 'default', '

Contact - minimum importance

\r\n

This directive is used as the value that the host or service importance value must equal before notification is sent to this contact. The importance values are intended to represent the value of a host or service to an organization. For example, you could set this value and the importance value of a host such that a system administrator would be notified when a development server goes down, but the CIO would only be notified when the company\'s production ecommerce database server was down. The minimum_importance value defaults to zero.

\r\n

In Nagios Core 4.0.0 to 4.0.3 this was known as minimum_value but has been replaced with minimum_importance.

\r\n

Parameter name: minimum_importance
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(242, 'domain', 'ftps_option', 'all', 'default', 'Use encrypted FTP (FTPS) to connect to the remote server. '); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(243, 'domain', 'cgifile', 'all', 'default', '

Absolute path to your Nagios CGI config file.

Examples:
/etc/nagios/cgi.cfg
/usr/local/nagios/etc/cgi.cfg

This is used to edit Nagios website options directly from NagiosQL.

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(244, 'domain', 'resourcefile', 'all', 'default', '

Absolute path to your Nagios resource config file.

Examples:
/etc/nagios/resource.cfg
/usr/local/nagios/etc/resource.cfg

This file is used to verify your configuration in Nagios 4.x. Be sure this file is readably by your webserver\'s user!

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(245, 'host', 'importance', 'all', 'default', '

Host - importance

This directive is used to represent the importance of the host to your organization. The importance is used when determining whether to send notifications to a contact. If the host\'s importance value plus the importance values of all of the host\'s services is greater than or equal to the contact\'s minimum_importance, the contact will be notified. For example, you could set this value and the minimum_importance of contacts such that a system administrator would be notified when a development server goes down, but the CIO would only be notified when the company\'s production ecommerce database server was down. The importance could also be used as a sort criteria when generating reports or for calculating a good system administrator\'s bonus. The importance value defaults to zero. In Nagios Core 4.0.0 to 4.0.3 this was known as hourly_value but has been replaced with importance.

Parameter name: importance
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(246, 'service', 'importance', 'all', 'default', '

Service - importance

\r\n

This directive is used to represent the importance of the service to your organization. The importance is used when determining whether to send notifications to a contact. If the service\'s importance value is greater than or equal to the contact\'s minimum_importance, the contact will be notified. For example, you could set this value and the minimum_importance of contacts such that a system administrator would be notified of a disk full event on a development server, but the CIO would only be notified when the company\'s production ecommerce database was down. The importance could also be used as a sort criteria when generating reports or for calculating a good system administrator\'s bonus. The importance value defaults to zero. In Nagios Core 4.0.0 to 4.0.3 this was known as hourly_value but has been replaced with importance.

\r\n

Parameter name: importance
Required: no

'); +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES(247, 'service', 'parents', 'all', 'default', '

Service - parents

\r\n

This directive is used to define a comma-delimited list of short names of the \"parent\" services for this particular service. Parent services are typically other services that need to be available in order for a check of this service to occur. For example, if a service checks the status of a disk using SSH, the disk check service would have the SSH service as a parent. If the service has no parent services, simply omit the \"parents\" directive. More complex service dependencies may be specified with service dependency objects.

\r\n

Parameter name: parents
Required: no

'); + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_language` +-- + +CREATE TABLE IF NOT EXISTS `tbl_language` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `language` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `locale` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL, + `last_modified` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_language` +-- + +INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(1, 'English', 'en_GB', '1', NOW()); +INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(2, 'German', 'de_DE', '1', NOW()); +INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(3, 'Chinese (Simplified)', 'zh_CN', '1', NOW()); +INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(5, 'Italian', 'it_IT', '1', NOW()); +INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(6, 'French', 'fr_FR', '1', NOW()); +INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(7, 'Russian', 'ru_RU', '1', NOW()); +INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(8, 'Spanish', 'es_ES', '1', NOW()); +INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(9, 'Portuguese (Brazilian)', 'pt_BR', '1', NOW()); +INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(11, 'Dutch', 'nl_NL', '1', NOW()); +INSERT INTO `tbl_language` (`id`, `language`, `locale`, `active`, `last_modified`) VALUES(13, 'Danish', 'da_DK', '1', NOW()); + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContactgroupToContact` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContactgroupToContact` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContactgroupToContact` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContactgroupToContactgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContactgroupToContactgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContactgroupToContactgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContacttemplateToCommandHost` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContacttemplateToCommandHost` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContacttemplateToCommandHost` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContacttemplateToCommandService` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContacttemplateToCommandService` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContacttemplateToCommandService` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContacttemplateToContactgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContacttemplateToContactgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContacttemplateToContactgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContacttemplateToContacttemplate` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContacttemplateToContacttemplate` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `idSort` int(11) NOT NULL, + `idTable` tinyint(4) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`,`idTable`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContacttemplateToContacttemplate` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContacttemplateToVariabledefinition` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContacttemplateToVariabledefinition` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContacttemplateToVariabledefinition` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContactToCommandHost` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContactToCommandHost` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContactToCommandHost` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContactToCommandService` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContactToCommandService` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContactToCommandService` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContactToContactgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContactToContactgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContactToContactgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContactToContacttemplate` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContactToContacttemplate` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `idSort` int(11) NOT NULL, + `idTable` tinyint(4) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`,`idTable`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContactToContacttemplate` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkContactToVariabledefinition` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkContactToVariabledefinition` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkContactToVariabledefinition` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkGroupToUser` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkGroupToUser` ( + `idMaster` int(10) unsigned NOT NULL, + `idSlave` int(10) unsigned NOT NULL, + `read` enum('0','1') NOT NULL DEFAULT '1', + `write` enum('0','1') NOT NULL DEFAULT '1', + `link` enum('0','1') NOT NULL DEFAULT '1', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkGroupToUser` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostdependencyToHostgroup_DH` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostdependencyToHostgroup_DH` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostdependencyToHostgroup_DH` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostdependencyToHostgroup_H` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostdependencyToHostgroup_H` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostdependencyToHostgroup_H` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostdependencyToHost_DH` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostdependencyToHost_DH` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostdependencyToHost_DH` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostdependencyToHost_H` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostdependencyToHost_H` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostdependencyToHost_H` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostescalationToContact` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostescalationToContact` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostescalationToContact` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostescalationToContactgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostescalationToContactgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostescalationToContactgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostescalationToHost` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostescalationToHost` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostescalationToHost` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostescalationToHostgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostescalationToHostgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostescalationToHostgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostgroupToHost` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostgroupToHost` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostgroupToHost` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostgroupToHostgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostgroupToHostgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostgroupToHostgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHosttemplateToContact` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHosttemplateToContact` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHosttemplateToContact` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHosttemplateToContactgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHosttemplateToContactgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHosttemplateToContactgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHosttemplateToHost` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHosttemplateToHost` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHosttemplateToHost` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHosttemplateToHostgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHosttemplateToHostgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHosttemplateToHostgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHosttemplateToHosttemplate` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHosttemplateToHosttemplate` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `idSort` int(11) NOT NULL, + `idTable` tinyint(4) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`,`idTable`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHosttemplateToHosttemplate` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHosttemplateToVariabledefinition` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHosttemplateToVariabledefinition` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHosttemplateToVariabledefinition` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostToContact` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostToContact` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostToContact` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostToContactgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostToContactgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostToContactgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostToHost` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostToHost` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostToHost` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostToHostgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostToHostgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostToHostgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostToHosttemplate` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostToHosttemplate` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `idSort` int(11) NOT NULL, + `idTable` tinyint(4) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`,`idTable`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostToHosttemplate` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkHostToVariabledefinition` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkHostToVariabledefinition` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkHostToVariabledefinition` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicedependencyToHostgroup_DH` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToHostgroup_DH` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicedependencyToHostgroup_DH` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicedependencyToHostgroup_H` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToHostgroup_H` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicedependencyToHostgroup_H` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicedependencyToHost_DH` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToHost_DH` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicedependencyToHost_DH` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicedependencyToHost_H` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToHost_H` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicedependencyToHost_H` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicedependencyToService_DS` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToService_DS` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `strSlave` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicedependencyToService_DS` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicedependencyToService_S` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToService_S` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `strSlave` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicedependencyToService_S` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicedependencyToServicegroup_DS` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToServicegroup_DS` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicedependencyToServicegroup_DS` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicedependencyToServicegroup_S` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicedependencyToServicegroup_S` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicedependencyToServicegroup_S` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceescalationToContact` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceescalationToContact` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceescalationToContact` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceescalationToContactgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceescalationToContactgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceescalationToContactgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceescalationToHost` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceescalationToHost` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceescalationToHost` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceescalationToHostgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceescalationToHostgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceescalationToHostgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceescalationToService` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceescalationToService` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `strSlave` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceescalationToService` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceescalationToServicegroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceescalationToServicegroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceescalationToService` +-- + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicegroupToService` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicegroupToService` ( + `idMaster` int(11) NOT NULL, + `idSlaveH` int(11) NOT NULL, + `idSlaveHG` int(11) NOT NULL, + `idSlaveS` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlaveH`,`idSlaveHG`,`idSlaveS`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicegroupToService` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicegroupToServicegroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicegroupToServicegroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicegroupToServicegroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicetemplateToContact` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicetemplateToContact` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicetemplateToContact` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicetemplateToContactgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicetemplateToContactgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicetemplateToContactgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicetemplateToHost` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicetemplateToHost` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicetemplateToHost` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicetemplateToHostgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicetemplateToHostgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicetemplateToHostgroup` +-- + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicetemplateToService` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicetemplateToService` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `idHost` int(11) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicetemplateToService` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicetemplateToServicegroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicetemplateToServicegroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicetemplateToServicegroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicetemplateToServicetemplate` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicetemplateToServicetemplate` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `idSort` int(11) NOT NULL, + `idTable` tinyint(4) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`,`idTable`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicetemplateToServicetemplate` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServicetemplateToVariabledefinition` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServicetemplateToVariabledefinition` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServicetemplateToVariabledefinition` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceToContact` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceToContact` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceToContact` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceToContactgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceToContactgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceToContactgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceToHost` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceToHost` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceToHost` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceToHostgroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceToHostgroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceToHostgroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceToService` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceToService` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `idHost` int(11) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceToService` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceToServicegroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceToServicegroup` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceToServicegroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceToServicetemplate` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceToServicetemplate` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `idSort` int(11) NOT NULL, + `idTable` tinyint(4) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`,`idTable`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceToServicetemplate` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkServiceToVariabledefinition` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkServiceToVariabledefinition` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkServiceToVariabledefinition` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkTimeperiodToTimeperiod` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkTimeperiodToTimeperiod` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkTimeperiodToTimeperiod` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_lnkTimeperiodToTimeperiodUse` +-- + +CREATE TABLE IF NOT EXISTS `tbl_lnkTimeperiodToTimeperiodUse` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`idMaster`,`idSlave`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +-- +-- Datasets for table `tbl_lnkTimeperiodToTimeperiodUse` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_logbook` +-- + +CREATE TABLE IF NOT EXISTS `tbl_logbook` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `time` datetime NOT NULL, + `user` varchar(255) NOT NULL, + `ipadress` varchar(255) NOT NULL, + `domain` varchar(255) NOT NULL, + `entry` tinytext NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_logbook` +-- + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_menu` +-- + +CREATE TABLE IF NOT EXISTS `tbl_menu` ( + `mnuId` int(10) unsigned NOT NULL AUTO_INCREMENT, + `mnuTopId` int(10) unsigned NOT NULL, + `mnuGrpId` int(10) unsigned NOT NULL DEFAULT '0', + `mnuCntId` int(10) unsigned NOT NULL, + `mnuName` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `mnuLink` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `mnuActive` tinyint(3) unsigned NOT NULL DEFAULT '1', + `mnuOrderId` int(10) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`mnuId`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_menu` +-- + +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(1, 0, 0, 1, 'Main page', 'admin.php', 1, 1); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(2, 0, 0, 1, 'Supervision', 'admin/monitoring.php', 1, 2); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(3, 0, 0, 1, 'Alarming', 'admin/alarming.php', 1, 3); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(4, 0, 0, 1, 'Commands', 'admin/commands.php', 1, 4); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(5, 0, 0, 1, 'Specialties', 'admin/specials.php', 1, 5); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(6, 0, 0, 1, 'Tools', 'admin/tools.php', 1, 6); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(7, 0, 0, 1, 'Administration', 'admin/administration.php', 1, 7); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(8, 2, 0, 1, 'Host', 'admin/hosts.php', 1, 1); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(9, 2, 0, 1, 'Services', 'admin/services.php', 1, 2); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(10, 2, 0, 1, 'Host groups', 'admin/hostgroups.php', 1, 3); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(11, 2, 0, 1, 'Service groups', 'admin/servicegroups.php', 1, 4); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(12, 2, 0, 1, 'Host templates', 'admin/hosttemplates.php', 1, 5); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(13, 2, 0, 1, 'Service templates', 'admin/servicetemplates.php', 1, 6); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(14, 3, 0, 1, 'Contact data', 'admin/contacts.php', 1, 1); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(15, 3, 0, 1, 'Contact groups', 'admin/contactgroups.php', 1, 2); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(16, 3, 0, 1, 'Time periods', 'admin/timeperiods.php', 1, 3); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(17, 3, 0, 1, 'Contact templates', 'admin/contacttemplates.php', 1, 4); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(18, 4, 0, 1, 'Definitions', 'admin/checkcommands.php', 1, 1); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(19, 5, 0, 1, 'Host dependency', 'admin/hostdependencies.php', 1, 1); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(20, 5, 0, 1, 'Host escalation', 'admin/hostescalations.php', 1, 2); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(21, 5, 0, 1, 'Extended Host', 'admin/hostextinfo.php', 1, 3); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(22, 5, 0, 1, 'Service dependency', 'admin/servicedependencies.php', 1, 4); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(23, 5, 0, 1, 'Service escalation', 'admin/serviceescalations.php', 1, 5); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(24, 5, 0, 1, 'Extended Service', 'admin/serviceextinfo.php', 1, 6); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(25, 6, 0, 1, 'Data import', 'admin/import.php', 1, 1); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(26, 6, 0, 1, 'Delete backup files', 'admin/delbackup.php', 1, 2); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(27, 6, 0, 1, 'Delete config files', 'admin/delconfig.php', 1, 3); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(28, 6, 0, 1, 'Nagios config', 'admin/nagioscfg.php', 1, 4); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(29, 6, 0, 1, 'CGI config', 'admin/cgicfg.php', 1, 5); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(30, 6, 0, 1, 'Nagios control', 'admin/verify.php', 1, 6); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(31, 7, 0, 1, 'New password', 'admin/password.php', 1, 1); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(32, 7, 0, 1, 'User admin', 'admin/user.php', 1, 2); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(33, 7, 0, 1, 'Group admin', 'admin/group.php', 1, 3); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(34, 7, 0, 1, 'Menu access', 'admin/menuaccess.php', 1, 4); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(35, 7, 0, 1, 'Data domains', 'admin/datadomain.php', 1, 5); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(36, 7, 0, 1, 'Config targets', 'admin/configtargets.php', 1, 6); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(37, 7, 0, 1, 'Logbook', 'admin/logbook.php', 1, 7); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(38, 7, 0, 1, 'Settings', 'admin/settings.php', 1, 8); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(39, 7, 0, 1, 'Help editor', 'admin/helpedit.php', 1, 9); +INSERT INTO `tbl_menu` (`mnuId`, `mnuTopId`, `mnuGrpId`, `mnuCntId`, `mnuName`, `mnuLink`, `mnuActive`, `mnuOrderId`) VALUES(40, 7, 0, 1, 'Support', 'admin/support.php', 1, 10); + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_relationinformation` +-- + +CREATE TABLE IF NOT EXISTS `tbl_relationinformation` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `master` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `tableName1` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `tableName2` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `fieldName` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `linkTable` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `target1` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `target2` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `targetKey` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `fullRelation` tinyint(3) unsigned NOT NULL DEFAULT '0', + `flags` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `type` tinyint(3) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_relationinformation` +-- + +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(1, 'tbl_timeperiod', 'tbl_timeperiod', '', 'exclude', 'tbl_lnkTimeperiodToTimeperiod', 'timeperiod_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(2, 'tbl_contact', 'tbl_command', '', 'host_notification_commands', 'tbl_lnkContactToCommandHost', 'command_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(3, 'tbl_contact', 'tbl_command', '', 'service_notification_commands', 'tbl_lnkContactToCommandService', 'command_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(4, 'tbl_contact', 'tbl_contactgroup', '', 'contactgroups', 'tbl_lnkContactToContactgroup', 'contactgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(5, 'tbl_contact', 'tbl_timeperiod', '', 'host_notification_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(6, 'tbl_contact', 'tbl_timeperiod', '', 'service_notification_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(7, 'tbl_contact', 'tbl_contacttemplate', 'tbl_contact', 'use_template', 'tbl_lnkContactToContacttemplate', 'template_name', 'name', '', 0, '', 3); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(8, 'tbl_contact', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkContactToVariabledefinition', 'name', '', '', 0, '', 4); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(9, 'tbl_contacttemplate', 'tbl_command', '', 'host_notification_commands', 'tbl_lnkContacttemplateToCommandHost', 'command_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(10, 'tbl_contacttemplate', 'tbl_command', '', 'service_notification_commands', 'tbl_lnkContacttemplateToCommandService', 'command_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(11, 'tbl_contacttemplate', 'tbl_contactgroup', '', 'contactgroups', 'tbl_lnkContacttemplateToContactgroup', 'contactgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(12, 'tbl_contacttemplate', 'tbl_timeperiod', '', 'host_notification_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(13, 'tbl_contacttemplate', 'tbl_timeperiod', '', 'service_notification_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(14, 'tbl_contacttemplate', 'tbl_contacttemplate', 'tbl_contact', 'use_template', 'tbl_lnkContacttemplateToContacttemplate', 'template_name', 'name', '', 0, '', 3); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(15, 'tbl_contacttemplate', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkContacttemplateToVariabledefinition', 'name', '', '', 0, '', 4); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(16, 'tbl_contactgroup', 'tbl_contact', '', 'members', 'tbl_lnkContactgroupToContact', 'contact_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(17, 'tbl_contactgroup', 'tbl_contactgroup', '', 'contactgroup_members', 'tbl_lnkContactgroupToContactgroup', 'contactgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(18, 'tbl_hosttemplate', 'tbl_host', '', 'parents', 'tbl_lnkHosttemplateToHost', 'host_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(19, 'tbl_hosttemplate', 'tbl_hostgroup', '', 'hostgroups', 'tbl_lnkHosttemplateToHostgroup', 'hostgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(20, 'tbl_hosttemplate', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkHosttemplateToContactgroup', 'contactgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(21, 'tbl_hosttemplate', 'tbl_contact', '', 'contacts', 'tbl_lnkHosttemplateToContact', 'contact_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(22, 'tbl_hosttemplate', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(23, 'tbl_hosttemplate', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(24, 'tbl_hosttemplate', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(25, 'tbl_hosttemplate', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(26, 'tbl_hosttemplate', 'tbl_hosttemplate', 'tbl_host', 'use_template', 'tbl_lnkHosttemplateToHosttemplate', 'template_name', 'name', '', 0, '', 3); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(27, 'tbl_hosttemplate', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkHosttemplateToVariabledefinition', 'name', '', '', 0, '', 4); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(28, 'tbl_host', 'tbl_host', '', 'parents', 'tbl_lnkHostToHost', 'host_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(29, 'tbl_host', 'tbl_hostgroup', '', 'hostgroups', 'tbl_lnkHostToHostgroup', 'hostgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(30, 'tbl_host', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkHostToContactgroup', 'contactgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(31, 'tbl_host', 'tbl_contact', '', 'contacts', 'tbl_lnkHostToContact', 'contact_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(32, 'tbl_host', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(33, 'tbl_host', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(34, 'tbl_host', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(35, 'tbl_host', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(36, 'tbl_host', 'tbl_hosttemplate', 'tbl_host', 'use_template', 'tbl_lnkHostToHosttemplate', 'template_name', 'name', '', 0, '', 3); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(37, 'tbl_host', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkHostToVariabledefinition', 'name', '', '', 0, '', 4); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(38, 'tbl_hostgroup', 'tbl_host', '', 'members', 'tbl_lnkHostgroupToHost', 'host_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(39, 'tbl_hostgroup', 'tbl_hostgroup', '', 'hostgroup_members', 'tbl_lnkHostgroupToHostgroup', 'hostgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(40, 'tbl_servicetemplate', 'tbl_host', '', 'host_name', 'tbl_lnkServicetemplateToHost', 'host_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(41, 'tbl_servicetemplate', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServicetemplateToHostgroup', 'hostgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(42, 'tbl_servicetemplate', 'tbl_servicegroup', '', 'servicegroups', 'tbl_lnkServicetemplateToServicegroup', 'servicegroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(43, 'tbl_servicetemplate', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkServicetemplateToContactgroup', 'contactgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(44, 'tbl_servicetemplate', 'tbl_contact', '', 'contacts', 'tbl_lnkServicetemplateToContact', 'contact_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(45, 'tbl_servicetemplate', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(46, 'tbl_servicetemplate', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(47, 'tbl_servicetemplate', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(48, 'tbl_servicetemplate', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(49, 'tbl_servicetemplate', 'tbl_servicetemplate', 'tbl_service', 'use_template', 'tbl_lnkServicetemplateToServicetemplate', 'template_name', 'name', '', 0, '', 3); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(50, 'tbl_servicetemplate', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkServicetemplateToVariabledefinition', 'name', '', '', 0, '', 4); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(51, 'tbl_service', 'tbl_host', '', 'host_name', 'tbl_lnkServiceToHost', 'host_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(52, 'tbl_service', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServiceToHostgroup', 'hostgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(53, 'tbl_service', 'tbl_servicegroup', '', 'servicegroups', 'tbl_lnkServiceToServicegroup', 'servicegroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(54, 'tbl_service', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkServiceToContactgroup', 'contactgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(55, 'tbl_service', 'tbl_contact', '', 'contacts', 'tbl_lnkServiceToContact', 'contact_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(56, 'tbl_service', 'tbl_timeperiod', '', 'check_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(57, 'tbl_service', 'tbl_command', '', 'check_command', '', 'command_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(58, 'tbl_service', 'tbl_timeperiod', '', 'notification_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(59, 'tbl_service', 'tbl_command', '', 'event_handler', '', 'command_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(60, 'tbl_service', 'tbl_servicetemplate', 'tbl_service', 'use_template', 'tbl_lnkServiceToServicetemplate', 'template_name', 'name', '', 0, '', 3); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(61, 'tbl_service', 'tbl_variabledefinition', '', 'use_variables', 'tbl_lnkServiceToVariabledefinition', 'name', '', '', 0, '', 4); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(62, 'tbl_servicegroup', 'tbl_host', 'tbl_service', 'members', 'tbl_lnkServicegroupToService', 'host_name', 'service_description', '', 0, '', 5); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(63, 'tbl_servicegroup', 'tbl_servicegroup', '', 'servicegroup_members', 'tbl_lnkServicegroupToServicegroup', 'servicegroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(64, 'tbl_hostdependency', 'tbl_host', '', 'dependent_host_name', 'tbl_lnkHostdependencyToHost_DH', 'host_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(65, 'tbl_hostdependency', 'tbl_host', '', 'host_name', 'tbl_lnkHostdependencyToHost_H', 'host_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(66, 'tbl_hostdependency', 'tbl_hostgroup', '', 'dependent_hostgroup_name', 'tbl_lnkHostdependencyToHostgroup_DH', 'hostgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(67, 'tbl_hostdependency', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkHostdependencyToHostgroup_H', 'hostgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(68, 'tbl_hostdependency', 'tbl_timeperiod', '', 'dependency_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(69, 'tbl_hostescalation', 'tbl_host', '', 'host_name', 'tbl_lnkHostescalationToHost', 'host_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(70, 'tbl_hostescalation', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkHostescalationToHostgroup', 'hostgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(71, 'tbl_hostescalation', 'tbl_contact', '', 'contacts', 'tbl_lnkHostescalationToContact', 'contact_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(72, 'tbl_hostescalation', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkHostescalationToContactgroup', 'contactgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(73, 'tbl_hostescalation', 'tbl_timeperiod', '', 'escalation_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(74, 'tbl_hostextinfo', 'tbl_host', '', 'host_name', '', 'host_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(75, 'tbl_servicedependency', 'tbl_host', '', 'dependent_host_name', 'tbl_lnkServicedependencyToHost_DH', 'host_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(76, 'tbl_servicedependency', 'tbl_host', '', 'host_name', 'tbl_lnkServicedependencyToHost_H', 'host_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(77, 'tbl_servicedependency', 'tbl_hostgroup', '', 'dependent_hostgroup_name', 'tbl_lnkServicedependencyToHostgroup_DH', 'hostgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(78, 'tbl_servicedependency', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServicedependencyToHostgroup_H', 'hostgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(79, 'tbl_servicedependency', 'tbl_service', '', 'dependent_service_description', 'tbl_lnkServicedependencyToService_DS', 'service_description', '', '', 0, '', 6); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(80, 'tbl_servicedependency', 'tbl_service', '', 'service_description', 'tbl_lnkServicedependencyToService_S', 'service_description', '', '', 0, '', 6); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(81, 'tbl_servicedependency', 'tbl_timeperiod', '', 'dependency_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(82, 'tbl_serviceescalation', 'tbl_host', '', 'host_name', 'tbl_lnkServiceescalationToHost', 'host_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(83, 'tbl_serviceescalation', 'tbl_hostgroup', '', 'hostgroup_name', 'tbl_lnkServiceescalationToHostgroup', 'hostgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(84, 'tbl_serviceescalation', 'tbl_service', '', 'service_description', 'tbl_lnkServiceescalationToService', 'service_description', '', '', 0, '', 6); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(85, 'tbl_serviceescalation', 'tbl_contact', '', 'contacts', 'tbl_lnkServiceescalationToContact', 'contact_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(86, 'tbl_serviceescalation', 'tbl_contactgroup', '', 'contact_groups', 'tbl_lnkServiceescalationToContactgroup', 'contactgroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(87, 'tbl_serviceescalation', 'tbl_timeperiod', '', 'escalation_period', '', 'timeperiod_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(88, 'tbl_serviceextinfo', 'tbl_host', '', 'host_name', '', 'host_name', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(89, 'tbl_serviceextinfo', 'tbl_service', '', 'service_description', '', 'service_description', '', '', 0, '', 1); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(90, 'tbl_command', 'tbl_lnkContacttemplateToCommandHost', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(91, 'tbl_command', 'tbl_lnkContacttemplateToCommandService', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(92, 'tbl_command', 'tbl_lnkContactToCommandHost', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(93, 'tbl_command', 'tbl_lnkContactToCommandService', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(94, 'tbl_command', 'tbl_host', '', 'check_command', '', '', '', 'host_name', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(95, 'tbl_command', 'tbl_host', '', 'event_handler', '', '', '', 'host_name', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(96, 'tbl_command', 'tbl_service', '', 'check_command', '', '', '', 'config_name,service_description', 1, '1,1,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(97, 'tbl_command', 'tbl_service', '', 'event_handler', '', '', '', 'config_name,service_description', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(98, 'tbl_contact', 'tbl_lnkContactgroupToContact', '', 'idSlave', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '1,2,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(99, 'tbl_contact', 'tbl_lnkContactToCommandHost', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(100, 'tbl_contact', 'tbl_lnkContactToCommandService', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(101, 'tbl_contact', 'tbl_lnkContactToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(102, 'tbl_contact', 'tbl_lnkContactToContacttemplate', '', 'idMaster', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(103, 'tbl_contact', 'tbl_lnkContactToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(104, 'tbl_contact', 'tbl_lnkHostescalationToContact', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(105, 'tbl_contact', 'tbl_lnkHosttemplateToContact', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(106, 'tbl_contact', 'tbl_lnkHostToContact', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(107, 'tbl_contact', 'tbl_lnkServiceescalationToContact', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(108, 'tbl_contact', 'tbl_lnkServicetemplateToContact', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(109, 'tbl_contact', 'tbl_lnkServiceToContact', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(110, 'tbl_contactgroup', 'tbl_lnkContactgroupToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(111, 'tbl_contactgroup', 'tbl_lnkContactgroupToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(112, 'tbl_contactgroup', 'tbl_lnkContactgroupToContactgroup', '', 'idSlave', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(113, 'tbl_contactgroup', 'tbl_lnkContacttemplateToContactgroup', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(114, 'tbl_contactgroup', 'tbl_lnkContactToContactgroup', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(115, 'tbl_contactgroup', 'tbl_lnkHostescalationToContactgroup', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(116, 'tbl_contactgroup', 'tbl_lnkHosttemplateToContactgroup', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(117, 'tbl_contactgroup', 'tbl_lnkHostToContactgroup', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(118, 'tbl_contactgroup', 'tbl_lnkServiceescalationToContactgroup', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(119, 'tbl_contactgroup', 'tbl_lnkServicetemplateToContactgroup', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(120, 'tbl_contactgroup', 'tbl_lnkServiceToContactgroup', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(121, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToCommandHost', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(122, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToCommandService', '', 'idMaster', '', 'tbl_command', '', 'command_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(123, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(124, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToContacttemplate', '', 'idMaster', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(125, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToContacttemplate', '', 'idSlave', '', 'tbl_contacttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(126, 'tbl_contacttemplate', 'tbl_lnkContacttemplateToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(127, 'tbl_contacttemplate', 'tbl_lnkContactToContacttemplate', '', 'idSlave', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(128, 'tbl_host', 'tbl_lnkHostdependencyToHost_DH', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(129, 'tbl_host', 'tbl_lnkHostdependencyToHost_H', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(130, 'tbl_host', 'tbl_lnkHostescalationToHost', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(131, 'tbl_host', 'tbl_lnkHosttemplateToHost', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(132, 'tbl_host', 'tbl_lnkHostToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(133, 'tbl_host', 'tbl_lnkHostToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(134, 'tbl_host', 'tbl_lnkHostToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(135, 'tbl_host', 'tbl_lnkHostToHost', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(136, 'tbl_host', 'tbl_lnkHostToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(137, 'tbl_host', 'tbl_lnkHostgroupToHost', '', 'idSlave', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(138, 'tbl_host', 'tbl_lnkHostToHosttemplate', '', 'idMaster', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(139, 'tbl_host', 'tbl_lnkHostToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(140, 'tbl_host', 'tbl_lnkServicedependencyToHost_DH', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(141, 'tbl_host', 'tbl_lnkServicedependencyToHost_H', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(142, 'tbl_host', 'tbl_lnkServiceescalationToHost', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(143, 'tbl_host', 'tbl_lnkServicetemplateToHost', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(144, 'tbl_host', 'tbl_lnkServiceToHost', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(145, 'tbl_host', 'tbl_lnkServicegroupToService', '', 'idSlaveH', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(146, 'tbl_host', 'tbl_hostextinfo', '', 'host_name', '', '', '', 'host_name', 1, '0,0,0,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(147, 'tbl_host', 'tbl_serviceextinfo', '', 'host_name', '', '', '', 'host_name', 1, '0,0,0,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(148, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHostgroup_DH', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(149, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHostgroup_H', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(150, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHost_DH', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(151, 'tbl_hostdependency', 'tbl_lnkHostdependencyToHost_H', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(152, 'tbl_hostescalation', 'tbl_lnkHostescalationToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(153, 'tbl_hostescalation', 'tbl_lnkHostescalationToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(154, 'tbl_hostescalation', 'tbl_lnkHostescalationToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(155, 'tbl_hostescalation', 'tbl_lnkHostescalationToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(156, 'tbl_hostgroup', 'tbl_lnkHostdependencyToHostgroup_DH', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(157, 'tbl_hostgroup', 'tbl_lnkHostdependencyToHostgroup_H', '', 'idSlave', '', 'tbl_hostdependency', '', 'config_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(158, 'tbl_hostgroup', 'tbl_lnkHostescalationToHostgroup', '', 'idSlave', '', 'tbl_hostescalation', '', 'config_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(159, 'tbl_hostgroup', 'tbl_lnkHostgroupToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(160, 'tbl_hostgroup', 'tbl_lnkHostgroupToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(161, 'tbl_hostgroup', 'tbl_lnkHostgroupToHostgroup', '', 'idSlave', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(162, 'tbl_hostgroup', 'tbl_lnkHosttemplateToHostgroup', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(163, 'tbl_hostgroup', 'tbl_lnkHostToHostgroup', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(164, 'tbl_hostgroup', 'tbl_lnkServicedependencyToHostgroup_DH', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(165, 'tbl_hostgroup', 'tbl_lnkServicedependencyToHostgroup_H', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(166, 'tbl_hostgroup', 'tbl_lnkServiceescalationToHostgroup', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(167, 'tbl_hostgroup', 'tbl_lnkServicetemplateToHostgroup', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(168, 'tbl_hostgroup', 'tbl_lnkServiceToHostgroup', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(169, 'tbl_hostgroup', 'tbl_lnkServicegroupToService', '', 'idSlaveHG', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(170, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(171, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(172, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(173, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(174, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHosttemplate', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(175, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToHosttemplate', '', 'idSlave', '', 'tbl_hosttemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(176, 'tbl_hosttemplate', 'tbl_lnkHosttemplateToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(177, 'tbl_hosttemplate', 'tbl_lnkHostToHosttemplate', '', 'idSlave', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(178, 'tbl_service', 'tbl_lnkServicedependencyToService_DS', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(179, 'tbl_service', 'tbl_lnkServicedependencyToService_S', '', 'idSlave', '', 'tbl_servicedependency', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(180, 'tbl_service', 'tbl_lnkServiceescalationToService', '', 'idSlave', '', 'tbl_serviceescalation', '', 'config_name', 1, '1,1,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(181, 'tbl_service', 'tbl_lnkServicegroupToService', '', 'idSlaveS', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(182, 'tbl_service', 'tbl_lnkServiceToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(183, 'tbl_service', 'tbl_lnkServiceToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(184, 'tbl_service', 'tbl_lnkServiceToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(185, 'tbl_service', 'tbl_lnkServiceToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(186, 'tbl_service', 'tbl_lnkServiceToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(187, 'tbl_service', 'tbl_lnkServiceToServicetemplate', '', 'idMaster', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(188, 'tbl_service', 'tbl_lnkServiceToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(189, 'tbl_service', 'tbl_serviceextinfo', '', 'service_description', '', '', '', 'host_name', 1, '0,0,0,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(190, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHostgroup_DH', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(191, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHostgroup_H', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(192, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHost_DH', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(193, 'tbl_servicedependency', 'tbl_lnkServicedependencyToHost_H', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(194, 'tbl_servicedependency', 'tbl_lnkServicedependencyToService_DS', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(195, 'tbl_servicedependency', 'tbl_lnkServicedependencyToService_S', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(196, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(197, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(198, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(199, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(200, 'tbl_serviceescalation', 'tbl_lnkServiceescalationToService', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(201, 'tbl_servicegroup', 'tbl_lnkServicegroupToService', '', 'idMaster', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(202, 'tbl_servicegroup', 'tbl_lnkServicegroupToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(203, 'tbl_servicegroup', 'tbl_lnkServicegroupToServicegroup', '', 'idSlave', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(204, 'tbl_servicegroup', 'tbl_lnkServicetemplateToServicegroup', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(205, 'tbl_servicegroup', 'tbl_lnkServiceToServicegroup', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(206, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToContact', '', 'idMaster', '', 'tbl_contact', '', 'contact_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(207, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToContactgroup', '', 'idMaster', '', 'tbl_contactgroup', '', 'contactgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(208, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToHost', '', 'idMaster', '', 'tbl_host', '', 'host_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(209, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToHostgroup', '', 'idMaster', '', 'tbl_hostgroup', '', 'hostgroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(210, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(211, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToServicetemplate', '', 'idMaster', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(212, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToServicetemplate', '', 'idSlave', '', 'tbl_servicetemplate', '', 'template_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(213, 'tbl_servicetemplate', 'tbl_lnkServicetemplateToVariabledefinition', '', 'idMaster', '', 'tbl_variabledefinition', '', 'name', 1, '0,0,0,2', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(214, 'tbl_servicetemplate', 'tbl_lnkServiceToServicetemplate', '', 'idSlave', '', 'tbl_service', '', 'config_name,service_description', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(215, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiod', '', 'idMaster', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(216, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiod', '', 'idSlave', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(217, 'tbl_timeperiod', 'tbl_contact', '', 'host_notification_period', '', '', '', 'contact_name', 1, '1,1,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(218, 'tbl_timeperiod', 'tbl_contact', '', 'service_notification_period', '', '', '', 'contact_name', 1, '1,1,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(219, 'tbl_timeperiod', 'tbl_contacttemplate', '', 'host_notification_period', '', '', '', 'template_name', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(220, 'tbl_timeperiod', 'tbl_contacttemplate', '', 'service_notification_period', '', '', '', 'template_name', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(221, 'tbl_timeperiod', 'tbl_host', '', 'check_period', '', '', '', 'host_name', 1, '1,1,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(222, 'tbl_timeperiod', 'tbl_host', '', 'notification_period', '', '', '', 'host_name', 1, '1,1,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(223, 'tbl_timeperiod', 'tbl_hosttemplate', '', 'check_period', '', '', '', 'template_name', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(224, 'tbl_timeperiod', 'tbl_hosttemplate', '', 'notification_period', '', '', '', 'template_name', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(225, 'tbl_timeperiod', 'tbl_hostdependency', '', 'dependency_period', '', '', '', 'config_name', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(226, 'tbl_timeperiod', 'tbl_hostescalation', '', 'escalation_period', '', '', '', 'config_name', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(227, 'tbl_timeperiod', 'tbl_service', '', 'check_period', '', '', '', 'config_name,service_description', 1, '1,1,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(228, 'tbl_timeperiod', 'tbl_service', '', 'notification_period', '', '', '', 'config_name,service_description', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(229, 'tbl_timeperiod', 'tbl_servicetemplate', '', 'check_period', '', '', '', 'template_name', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(230, 'tbl_timeperiod', 'tbl_servicetemplate', '', 'notification_period', '', '', '', 'template_name', 1, '1,1,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(231, 'tbl_timeperiod', 'tbl_servicedependency', '', 'dependency_period', '', '', '', 'config_name', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(232, 'tbl_timeperiod', 'tbl_serviceescalation', '', 'escalation_period', '', '', '', 'config_name', 1, '0,2,2,0', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(233, 'tbl_timeperiod', 'tbl_timedefinition', '', 'tipId', '', '', '', 'id', 1, '0,0,0,3', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(234, 'tbl_timeperiod', 'tbl_timeperiod', '', 'use_template', 'tbl_lnkTimeperiodToTimeperiodUse', 'timeperiod_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(235, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiodUse', '', 'idMaster', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(236, 'tbl_timeperiod', 'tbl_lnkTimeperiodToTimeperiodUse', '', 'idSlave', '', 'tbl_timeperiod', '', 'timeperiod_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(237, 'tbl_group', 'tbl_user', '', 'users', 'tbl_lnkGroupToUser', 'username', '', '', 0, '', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(238, 'tbl_group', 'tbl_lnkGroupToUser', '', 'idMaster', '', 'tbl_user', '', 'username', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(239, 'tbl_servicedependency', 'tbl_servicegroup', '', 'dependent_servicegroup_name', 'tbl_lnkServicedependencyToServicegroup_DS', 'servicegroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(240, 'tbl_servicedependency', 'tbl_servicegroup', '', 'servicegroup_name', 'tbl_lnkServicedependencyToServicegroup_S', 'servicegroup_name', '', '', 0, '', 2); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(241, 'tbl_servicedependency', 'tbl_lnkServicedependencyToServicegroup_DS', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES(242, 'tbl_servicedependency', 'tbl_lnkServicedependencyToServicegroup_S', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', 1, '0,0,0,1', 0); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES (243,'tbl_serviceescalation', 'tbl_servicegroup', '', 'servicegroup_name', 'tbl_lnkServiceescalationToServicegroup', 'servicegroup_name', '', '', '0', '', '2'); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES (244,'tbl_serviceescalation', 'tbl_lnkServiceescalationToServicegroup', '', 'idMaster', '', 'tbl_servicegroup', '', 'servicegroup_name', '1', '0,0,0,1', '0'); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES (NULL, 'tbl_service', 'tbl_service', '', 'parents', 'tbl_lnkServiceToService', 'service_description', '', '', '0', '', '7'); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES (NULL, 'tbl_servicetemplate', 'tbl_service', '', 'parents', 'tbl_lnkServicetemplateToService', 'service_description', '', '', '0', '', '7'); + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_service` +-- + +CREATE TABLE IF NOT EXISTS `tbl_service` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `config_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `host_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `host_name_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `hostgroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `hostgroup_name_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `service_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `display_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `parents` tinyint(3) unsigned NOT NULL DEFAULT '0', + `parents_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `importance` int(11) DEFAULT NULL, + `servicegroups` tinyint(3) unsigned NOT NULL DEFAULT '0', + `servicegroups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `use_template` tinyint(3) unsigned NOT NULL DEFAULT '0', + `use_template_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_command` text COLLATE utf8_unicode_ci NOT NULL, + `is_volatile` tinyint(3) unsigned NOT NULL DEFAULT '2', + `initial_state` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `max_check_attempts` int(11) DEFAULT NULL, + `check_interval` int(11) DEFAULT NULL, + `retry_interval` int(11) DEFAULT NULL, + `active_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `passive_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_period` int(11) NOT NULL DEFAULT '0', + `parallelize_check` tinyint(3) unsigned NOT NULL DEFAULT '2', + `obsess_over_service` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_freshness` tinyint(3) unsigned NOT NULL DEFAULT '2', + `freshness_threshold` int(11) DEFAULT NULL, + `event_handler` int(11) NOT NULL DEFAULT '0', + `event_handler_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `low_flap_threshold` int(11) DEFAULT NULL, + `high_flap_threshold` int(11) DEFAULT NULL, + `flap_detection_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `flap_detection_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `process_perf_data` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_status_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_nonstatus_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `notification_interval` int(11) DEFAULT NULL, + `first_notification_delay` int(11) DEFAULT NULL, + `notification_period` int(11) NOT NULL DEFAULT '0', + `notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `contacts` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contacts_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `contact_groups` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contact_groups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `stalking_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `notes` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `notes_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `action_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `icon_image` varchar(500) COLLATE utf8_unicode_ci NOT NULL, + `icon_image_alt` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `use_variables` tinyint(3) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + `import_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_service` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_servicedependency` +-- + +CREATE TABLE IF NOT EXISTS `tbl_servicedependency` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `config_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `dependent_host_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `dependent_hostgroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `dependent_service_description` tinyint(3) unsigned NOT NULL DEFAULT '0', + `dependent_servicegroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `host_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `hostgroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `service_description` tinyint(3) unsigned NOT NULL DEFAULT '0', + `servicegroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `inherits_parent` tinyint(3) unsigned NOT NULL DEFAULT '0', + `execution_failure_criteria` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `notification_failure_criteria` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `dependency_period` int(11) NOT NULL DEFAULT '0', + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + `import_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`config_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_servicedependency` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_serviceescalation` +-- + +CREATE TABLE IF NOT EXISTS `tbl_serviceescalation` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `config_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `host_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `hostgroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `service_description` tinyint(3) unsigned NOT NULL DEFAULT '0', + `servicegroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contacts` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contact_groups` tinyint(3) unsigned NOT NULL DEFAULT '0', + `first_notification` int(11) DEFAULT NULL, + `last_notification` int(11) DEFAULT NULL, + `notification_interval` int(11) DEFAULT NULL, + `escalation_period` int(11) NOT NULL DEFAULT '0', + `escalation_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + `import_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `config_name` (`config_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_serviceescalation` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_serviceextinfo` +-- + + +CREATE TABLE IF NOT EXISTS `tbl_serviceextinfo` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `host_name` int(11) NOT NULL, + `service_description` int(11) NOT NULL, + `notes` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `notes_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `action_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `statistic_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `icon_image` varchar(500) COLLATE utf8_unicode_ci NOT NULL, + `icon_image_alt` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + `import_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`host_name`,`service_description`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_serviceextinfo` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_servicegroup` +-- + +CREATE TABLE IF NOT EXISTS `tbl_servicegroup` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `servicegroup_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `members` tinyint(3) unsigned NOT NULL DEFAULT '0', + `servicegroup_members` tinyint(3) unsigned NOT NULL DEFAULT '0', + `notes` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `notes_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `action_url` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`servicegroup_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_servicegroup` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_servicetemplate` +-- + +CREATE TABLE IF NOT EXISTS `tbl_servicetemplate` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `template_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `host_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `host_name_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `hostgroup_name` tinyint(3) unsigned NOT NULL DEFAULT '0', + `hostgroup_name_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `service_description` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `display_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `parents` tinyint(3) unsigned NOT NULL DEFAULT '0', + `parents_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `importance` int(11) DEFAULT NULL, + `servicegroups` tinyint(3) unsigned NOT NULL DEFAULT '0', + `servicegroups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `use_template` tinyint(3) unsigned NOT NULL DEFAULT '0', + `use_template_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_command` text COLLATE utf8_unicode_ci NOT NULL, + `is_volatile` tinyint(3) unsigned NOT NULL DEFAULT '2', + `initial_state` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `max_check_attempts` int(11) DEFAULT NULL, + `check_interval` int(11) DEFAULT NULL, + `retry_interval` int(11) DEFAULT NULL, + `active_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `passive_checks_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_period` int(11) NOT NULL DEFAULT '0', + `parallelize_check` tinyint(3) unsigned NOT NULL DEFAULT '2', + `obsess_over_service` tinyint(3) unsigned NOT NULL DEFAULT '2', + `check_freshness` tinyint(3) unsigned NOT NULL DEFAULT '2', + `freshness_threshold` int(11) DEFAULT NULL, + `event_handler` int(11) NOT NULL DEFAULT '0', + `event_handler_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `low_flap_threshold` int(11) DEFAULT NULL, + `high_flap_threshold` int(11) DEFAULT NULL, + `flap_detection_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `flap_detection_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `process_perf_data` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_status_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `retain_nonstatus_information` tinyint(3) unsigned NOT NULL DEFAULT '2', + `notification_interval` int(11) DEFAULT NULL, + `first_notification_delay` int(11) DEFAULT NULL, + `notification_period` int(11) NOT NULL DEFAULT '0', + `notification_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `notifications_enabled` tinyint(3) unsigned NOT NULL DEFAULT '2', + `contacts` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contacts_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `contact_groups` tinyint(3) unsigned NOT NULL DEFAULT '0', + `contact_groups_tploptions` tinyint(3) unsigned NOT NULL DEFAULT '2', + `stalking_options` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `notes` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `notes_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `action_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `icon_image` varchar(500) COLLATE utf8_unicode_ci NOT NULL, + `icon_image_alt` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `use_variables` tinyint(3) unsigned NOT NULL DEFAULT '0', + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + `import_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `config_name` (`template_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_servicetemplate` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_settings` +-- + +CREATE TABLE IF NOT EXISTS `tbl_settings` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `category` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `name` varchar(30) COLLATE utf8_unicode_ci NOT NULL, + `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_settings` +-- + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_tablestatus` +-- + +CREATE TABLE IF NOT EXISTS `tbl_tablestatus` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `tableName` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `domainId` int(11) NOT NULL, + `updateTime` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_tablestatus` +-- + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_timedefinition` +-- + +CREATE TABLE IF NOT EXISTS `tbl_timedefinition` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `tipId` int(10) unsigned NOT NULL, + `definition` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `range` text COLLATE utf8_unicode_ci NOT NULL, + `last_modified` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_timedefinition` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_timeperiod` +-- + +CREATE TABLE IF NOT EXISTS `tbl_timeperiod` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `timeperiod_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `exclude` tinyint(3) unsigned NOT NULL DEFAULT '0', + `use_template` tinyint(3) unsigned NOT NULL DEFAULT '0', + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `register` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '1', + `last_modified` datetime NOT NULL, + `access_group` int(8) unsigned NOT NULL DEFAULT '0', + `config_id` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`id`), + UNIQUE KEY `timeperiod_name` (`timeperiod_name`,`config_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_timeperiod` +-- + + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_user` +-- + +CREATE TABLE IF NOT EXISTS `tbl_user` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `password` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `admin_enable` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', + `wsauth` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', + `active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', + `nodelete` enum('0','1') COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', + `language` varchar(20) COLLATE utf8_unicode_ci NOT NULL, + `domain` int(10) unsigned NOT NULL DEFAULT '1', + `last_login` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `last_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_user` +-- + +-- -------------------------------------------------------- + +-- +-- Structure for table `tbl_variabledefinition` +-- + +CREATE TABLE IF NOT EXISTS `tbl_variabledefinition` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `value` varchar(255) COLLATE utf8_unicode_ci NOT NULL, + `last_modified` datetime NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; + +-- +-- Datasets for table `tbl_variabledefinition` +-- + diff --git a/install/sql/update_300_301.sql b/install/sql/update_300_301.sql index c54e39a..0af28e5 100644 --- a/install/sql/update_300_301.sql +++ b/install/sql/update_300_301.sql @@ -5,16 +5,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --- (c) 2008, 2009 by Martin Willisegger +-- (c) 2005-2018 by Martin Willisegger -- -- Project : NagiosQL -- Component : Update from NagiosQL 3.0.0 to NagiosQL 3.0.1 --- Website : www.nagiosql.org --- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ --- Author : $LastChangedBy: martin $ --- Version : 3.0.2 --- Revision : $LastChangedRevision: 2 $ --- SVN-ID : $Id: update_300_301.sql 2 2017-06-22 07:29:35Z martin $ +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/install/sql/update_300_310.sql b/install/sql/update_300_310.sql index 0dcefa8..93a6e3c 100644 --- a/install/sql/update_300_310.sql +++ b/install/sql/update_300_310.sql @@ -5,13 +5,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- (c) 2005-2018 by Martin Willisegger +-- -- Project : NagiosQL -- Component : Update from NagiosQL 3.0.4 to NagiosQL 3.1.0 --- Website : www.nagiosql.org --- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ --- Author : $LastChangedBy: martin $ --- Version : 3.1.1 --- Revision : $LastChangedRevision: 2 $ +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/install/sql/update_301_302.sql b/install/sql/update_301_302.sql index 8c66323..f0a90cc 100644 --- a/install/sql/update_301_302.sql +++ b/install/sql/update_301_302.sql @@ -5,16 +5,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --- (c) 2008, 2009 by Martin Willisegger +-- (c) 2005-2018 by Martin Willisegger -- -- Project : NagiosQL -- Component : Update from NagiosQL 3.0.1 to NagiosQL 3.0.2 --- Website : www.nagiosql.org --- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ --- Author : $LastChangedBy: martin $ --- Version : 3.0.2 --- Revision : $LastChangedRevision: 2 $ --- SVN-ID : $Id: update_301_302.sql 2 2017-06-22 07:29:35Z martin $ +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/install/sql/update_302_303.sql b/install/sql/update_302_303.sql index 83a4800..ad2eab9 100644 --- a/install/sql/update_302_303.sql +++ b/install/sql/update_302_303.sql @@ -5,16 +5,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --- (c) 2008, 2009 by Martin Willisegger +-- (c) 2005-2018 by Martin Willisegger -- -- Project : NagiosQL -- Component : Update from NagiosQL 3.0.2 to NagiosQL 3.0.3 --- Website : www.nagiosql.org --- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ --- Author : $LastChangedBy: martin $ --- Version : 3.0.3 --- Revision : $LastChangedRevision: 2 $ --- SVN-ID : $Id: update_302_303.sql 2 2017-06-22 07:29:35Z martin $ +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/install/sql/update_303_304.sql b/install/sql/update_303_304.sql index 57a2444..3974c96 100644 --- a/install/sql/update_303_304.sql +++ b/install/sql/update_303_304.sql @@ -5,14 +5,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- (c) 2005-2018 by Martin Willisegger +-- -- Project : NagiosQL -- Component : Update from NagiosQL 3.0.3 to NagiosQL 3.0.4 --- Website : www.nagiosql.org --- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ --- Author : $LastChangedBy: martin $ --- Version : 3.1.1 --- Revision : $LastChangedRevision: 2 $ --- SVN-ID : $Id: update_303_304.sql 2 2017-06-22 07:29:35Z martin $ +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/install/sql/update_304_310.sql b/install/sql/update_304_310.sql index e6c0995..a8e4572 100644 --- a/install/sql/update_304_310.sql +++ b/install/sql/update_304_310.sql @@ -5,13 +5,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- (c) 2005-2018 by Martin Willisegger +-- -- Project : NagiosQL -- Component : Update from NagiosQL 3.0.4 to NagiosQL 3.1.0 --- Website : www.nagiosql.org --- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ --- Author : $LastChangedBy: martin $ --- Version : 3.1.1 --- Revision : $LastChangedRevision: 2 $ +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/install/sql/update_310_311.sql b/install/sql/update_310_311.sql index 9971acd..f15206a 100644 --- a/install/sql/update_310_311.sql +++ b/install/sql/update_310_311.sql @@ -5,13 +5,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- (c) 2005-2018 by Martin Willisegger +-- -- Project : NagiosQL -- Component : Update from NagiosQL 3.1.0 to NagiosQL 3.1.1 --- Website : www.nagiosql.org --- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ --- Author : $LastChangedBy: martin $ --- Version : 3.1.1 --- Revision : $LastChangedRevision: 2 $ +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/install/sql/update_310_320.sql b/install/sql/update_310_320.sql index 57116a3..ac9ee39 100644 --- a/install/sql/update_310_320.sql +++ b/install/sql/update_310_320.sql @@ -5,13 +5,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- (c) 2005-2018 by Martin Willisegger +-- -- Project : NagiosQL -- Component : Update from NagiosQL 3.1.x to NagiosQL 3.2.0 --- Website : www.nagiosql.org --- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ --- Author : $LastChangedBy: martin $ --- Version : 3.2.0 --- Revision : $LastChangedRevision: 2 $ +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/install/sql/update_311_320.sql b/install/sql/update_311_320.sql index 4881ead..bbf07df 100644 --- a/install/sql/update_311_320.sql +++ b/install/sql/update_311_320.sql @@ -5,13 +5,13 @@ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- (c) 2005-2018 by Martin Willisegger +-- -- Project : NagiosQL -- Component : Update from NagiosQL 3.1.x to NagiosQL 3.2.0 --- Website : www.nagiosql.org --- Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ --- Author : $LastChangedBy: martin $ --- Version : 3.2.0 --- Revision : $LastChangedRevision: 2 $ +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- diff --git a/install/sql/update_320_340.sql b/install/sql/update_320_340.sql new file mode 100644 index 0000000..e7ed594 --- /dev/null +++ b/install/sql/update_320_340.sql @@ -0,0 +1,95 @@ +-- +-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- +-- NagiosQL +-- +-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- +-- (c) 2005-2018 by Martin Willisegger +-- +-- Project : NagiosQL +-- Component : Update from NagiosQL 3.2.0 to NagiosQL 3.4.0 +-- Website : https://sourceforge.net/projects/nagiosql/ +-- Version : 3.4.0 +-- GIT Repo : https://gitlab.com/wizonet/NagiosQL +-- +-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +-- +-- Modify existing tbl_settings +-- +UPDATE `tbl_settings` SET `value` = '3.4.0' WHERE `tbl_settings`.`name` = 'version' LIMIT 1; +-- +-- Modify existing tbl_configtarget +-- +ALTER TABLE `tbl_configtarget` ADD `cgifile` VARCHAR(255) NOT NULL AFTER `conffile`; +ALTER TABLE `tbl_configtarget` ADD `resourcefile` VARCHAR(255) NOT NULL AFTER `cgifile`; +ALTER TABLE `tbl_configtarget` ADD `ftp_secure` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `ssh_key_path`; +-- +-- Modify existing tbl_contact +-- +ALTER TABLE `tbl_contact` ADD `minimum_importance` INT NULL DEFAULT NULL AFTER `contactgroups_tploptions`; +-- +-- Modify existing tbl_contacttemplate +-- +ALTER TABLE `tbl_contacttemplate` ADD `minimum_importance` INT NULL DEFAULT NULL AFTER `contactgroups_tploptions`; +-- +-- Modify existing tbl_hosts +-- +ALTER TABLE `tbl_host` ADD `importance` INT NULL DEFAULT NULL AFTER `parents_tploptions`; +-- +-- Modify existing tbl_hoststemplates +-- +ALTER TABLE `tbl_hosttemplate` ADD `importance` INT NULL DEFAULT NULL AFTER `parents_tploptions`; +-- +-- Modify existing tbl_services +-- +ALTER TABLE `tbl_service` ADD `parents` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `display_name`; +ALTER TABLE `tbl_service` ADD `parents_tploptions` TINYINT UNSIGNED NOT NULL DEFAULT '2' AFTER `parents`; +ALTER TABLE `tbl_service` ADD `importance` INT NULL DEFAULT NULL AFTER `parents_tploptions`; +-- +-- Modify existing tbl_servicetemplate +-- +ALTER TABLE `tbl_servicetemplate` ADD `parents` TINYINT UNSIGNED NOT NULL DEFAULT '0' AFTER `display_name`; +ALTER TABLE `tbl_servicetemplate` ADD `parents_tploptions` TINYINT UNSIGNED NOT NULL DEFAULT '2' AFTER `parents`; +ALTER TABLE `tbl_servicetemplate` ADD `importance` INT NULL DEFAULT NULL AFTER `parents_tploptions`; +-- +-- Tabellenstruktur für Tabelle `tbl_lnkServiceToService` +-- +CREATE TABLE `tbl_lnkServiceToService` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `idHost` int(11) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +-- +-- Indizes für die Tabelle `tbl_lnkServiceToService` +-- +ALTER TABLE `tbl_lnkServiceToService` ADD PRIMARY KEY (`idMaster`,`idSlave`); +-- +-- Tabellenstruktur für Tabelle `tbl_lnkServicetemplateToService` +-- +CREATE TABLE `tbl_lnkServicetemplateToService` ( + `idMaster` int(11) NOT NULL, + `idSlave` int(11) NOT NULL, + `idHost` int(11) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +-- +-- Indizes für die Tabelle `tbl_lnkServicetemplateToService` +-- +ALTER TABLE `tbl_lnkServicetemplateToService` ADD PRIMARY KEY (`idMaster`,`idSlave`); +-- +-- Modify table tbl_relationinformation +-- +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES (NULL, 'tbl_service', 'tbl_service', '', 'parents', 'tbl_lnkServiceToService', 'service_description', '', '', '0', '', '7'); +INSERT INTO `tbl_relationinformation` (`id`, `master`, `tableName1`, `tableName2`, `fieldName`, `linkTable`, `target1`, `target2`, `targetKey`, `fullRelation`, `flags`, `type`) VALUES (NULL, 'tbl_servicetemplate', 'tbl_service', '', 'parents', 'tbl_lnkServicetemplateToService', 'service_description', '', '', '0', '', '7'); +-- +-- Modify existing tbl_info +-- +INSERT INTO `tbl_info` (`id`, `key1`, `key2`, `version`, `language`, `infotext`) VALUES (NULL, 'contact', 'minimum_importance', 'all', 'default', '

Contact - minimum importance

\r\n

This directive is used as the value that the host or service importance value must equal before notification is sent to this contact. The importance values are intended to represent the value of a host or service to an organization. For example, you could set this value and the importance value of a host such that a system administrator would be notified when a development server goes down, but the CIO would only be notified when the company\'s production ecommerce database server was down. The minimum_importance value defaults to zero.

\r\n

In Nagios Core 4.0.0 to 4.0.3 this was known as minimum_value but has been replaced with minimum_importance.

\r\n

Parameter name: minimum_importance
Required: no

'), + (NULL, 'domain', 'ftps_option', 'all', 'default', 'Use encrypted FTP (FTPS) to connect to the remote server. '), + (NULL, 'domain', 'cgifile', 'all', 'default', '

Absolute path to your Nagios CGI config file.

Examples:
/etc/nagios/cgi.cfg
/usr/local/nagios/etc/cgi.cfg

This is used to edit Nagios website options directly from NagiosQL.

'), + (NULL, 'domain', 'resourcefile', 'all', 'default', '

Absolute path to your Nagios resource config file.

Examples:
/etc/nagios/resource.cfg
/usr/local/nagios/etc/resource.cfg

This file is used to verify your configuration in Nagios 4.x. Be sure this file is readably by your webserver\'s user!

'), + (NULL, 'host', 'importance', 'all', 'default', '

Host - importance

This directive is used to represent the importance of the host to your organization. The importance is used when determining whether to send notifications to a contact. If the host\'s importance value plus the importance values of all of the host\'s services is greater than or equal to the contact\'s minimum_importance, the contact will be notified. For example, you could set this value and the minimum_importance of contacts such that a system administrator would be notified when a development server goes down, but the CIO would only be notified when the company\'s production ecommerce database server was down. The importance could also be used as a sort criteria when generating reports or for calculating a good system administrator\'s bonus. The importance value defaults to zero. In Nagios Core 4.0.0 to 4.0.3 this was known as hourly_value but has been replaced with importance.

Parameter name: importance
Required: no

'), + (NULL, 'service', 'importance', 'all', 'default', '

Service - importance

\r\n

This directive is used to represent the importance of the service to your organization. The importance is used when determining whether to send notifications to a contact. If the service\'s importance value is greater than or equal to the contact\'s minimum_importance, the contact will be notified. For example, you could set this value and the minimum_importance of contacts such that a system administrator would be notified of a disk full event on a development server, but the CIO would only be notified when the company\'s production ecommerce database was down. The importance could also be used as a sort criteria when generating reports or for calculating a good system administrator\'s bonus. The importance value defaults to zero. In Nagios Core 4.0.0 to 4.0.3 this was known as hourly_value but has been replaced with importance.

\r\n

Parameter name: importance
Required: no

'), + (NULL, 'service', 'parents', 'all', 'default', '

Service - parents

\r\n

This directive is used to define a comma-delimited list of short names of the \"parent\" services for this particular service. Parent services are typically other services that need to be available in order for a check of this service to occur. For example, if a service checks the status of a disk using SSH, the disk check service would have the SSH service as a parent. If the service has no parent services, simply omit the \"parents\" directive. More complex service dependencies may be specified with service dependency objects.

\r\n

Parameter name: parents
Required: no

'); +UPDATE `tbl_info` SET `infotext`='

The nagios version which is running in this domain.

\r\n

Be sure you select the correct version here - otherwise not all configuration options are available or not supported options are shown.

\r\n

You can change this with a running configuration - NagiosQL will then upgrade or downgrade your configuration. Don\'t forget to write your complete configuration after a version change!

\r\n

Difference between version in data domain and configuration domain:

\r\n
    \r\n
  • The version information of the data domain is used to define the options offered in the web forms in NagiosQL.
  • \r\n
  • The version information of the configuration domain is used to define the options offered in the written configuration files.
  • \r\n
\r\n

This way you can create your data in a newer Nagios version and still write in an older version to keep the configuration compatible to the running Nagios version.

' WHERE `key1`='domain' AND `key2`='version'; +UPDATE `tbl_info` SET `infotext`='

Host or Service - generic name

\r\n

It is possible to use a host definition as a template for other host configurations. If this definition should be used as template, a generic template name must be defined.

\r\n

We do not recommend to do this - it is more open to define a separate host template than to use this option.

\r\n

Parameter name: name
Required:
no

' WHERE `key1`='host' AND `key2`='genericname'; diff --git a/install/step1.php b/install/step1.php index 3ea77f8..54c79d9 100644 --- a/install/step1.php +++ b/install/step1.php @@ -5,279 +5,325 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Installer script - step 1 -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // // Prevent this file from direct access // ==================================== -if(preg_match('#' . basename(__FILE__) . '#', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'utf-8'))) { - exit; +if (preg_match('#' . basename(__FILE__) . '#', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'utf-8'))) { + header('Location: install.php'); + exit; } // // Define common variables // ======================= -$preIncludeContent = "templates/step1.tpl.htm"; -$intError = 0; +$preIncludeContent = $preBasePath.'install/templates/step1.htm.tpl'; +$intError = 0; // // Define check arrays // =================== -$arrRequiredExt = array ( - 'Session' => 'session', - 'Gettext' => 'gettext', - 'Filter' => 'filter' +$arrRequiredExt = array( + 'Session' => 'session', + 'Gettext' => 'gettext', + 'Filter' => 'filter' ); -$arrOptionalExt = array ( - 'FTP' => 'ftp', - 'SSH2' => 'ssh2' +$arrOptionalExt = array( + 'FTP' => 'ftp', + 'SSH2' => 'ssh2' ); -/* -$arrSupportedDBs = array ( - 'MySQL' => 'mysql', - 'MySQLi' => 'mysqli', - 'Postgres' => 'pgsql' +$arrSupportedDBs = array( + 'MySQLi' => 'mysqli' ); -*/ -$arrSupportedDBs = array ( - 'MySQLi' => 'mysqli' +$arrIniCheck = array( + 'file_uploads' => 1, + 'session.auto_start' => 0, + 'suhosin.session.encrypt' => 0, + 'date.timezone' => '-NOTEMPTY-' ); -$arrIniCheck = array ( - 'file_uploads' => 1, - 'session.auto_start' => 0, - 'suhosin.session.encrypt' => 0, - 'date.timezone' => '-NOTEMPTY-' -); $arrSourceURLs = array( - 'Sockets' => 'http://www.php.net/manual/en/book.sockets.php', - 'Session' => 'http://www.php.net/manual/en/book.session.php', - 'PCRE' => 'http://www.php.net/manual/en/book.pcre.php', - 'FileInfo' => 'http://www.php.net/manual/en/book.fileinfo.php', - 'Mcrypt' => 'http://www.php.net/manual/en/book.mcrypt.php', - 'OpenSSL' => 'http://www.php.net/manual/en/book.openssl.php', - 'JSON' => 'http://www.php.net/manual/en/book.json.php', - 'DOM' => 'http://www.php.net/manual/en/book.dom.php', - 'Intl' => 'http://www.php.net/manual/en/book.intl.php', - 'gettext' => 'http://www.php.net/manual/en/book.gettext.php', - 'curl' => 'http://www.php.net/manual/en/book.curl.php', - 'Filter' => 'http://www.php.net/manual/en/book.filter.php', - 'XML' => 'http://www.php.net/manual/en/book.xml.php', - 'SimpleXML' => 'http://www.php.net/manual/en/book.simplexml.php', - 'FTP' => 'http://www.php.net/manual/en/book.ftp.php', - 'MySQL' => 'http://php.net/manual/de/book.mysqli.php', - 'PEAR' => 'http://pear.php.net', - 'date.timezone' => 'http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone', - 'SSH2' => 'http://pecl.php.net/package/ssh2' + 'Sockets' => 'http://www.php.net/manual/en/book.sockets.php', + 'Session' => 'http://www.php.net/manual/en/book.session.php', + 'PCRE' => 'http://www.php.net/manual/en/book.pcre.php', + 'FileInfo' => 'http://www.php.net/manual/en/book.fileinfo.php', + 'Mcrypt' => 'http://www.php.net/manual/en/book.mcrypt.php', + 'OpenSSL' => 'http://www.php.net/manual/en/book.openssl.php', + 'JSON' => 'http://www.php.net/manual/en/book.json.php', + 'DOM' => 'http://www.php.net/manual/en/book.dom.php', + 'Intl' => 'http://www.php.net/manual/en/book.intl.php', + 'gettext' => 'http://www.php.net/manual/en/book.gettext.php', + 'curl' => 'http://www.php.net/manual/en/book.curl.php', + 'Filter' => 'http://www.php.net/manual/en/book.filter.php', + 'XML' => 'http://www.php.net/manual/en/book.xml.php', + 'SimpleXML' => 'http://www.php.net/manual/en/book.simplexml.php', + 'FTP' => 'http://www.php.net/manual/en/book.ftp.php', + 'MySQL' => 'http://php.net/manual/de/book.mysqli.php', + 'PEAR' => 'http://pear.php.net', + 'date.timezone' => 'http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone', + 'SSH2' => 'http://pecl.php.net/package/ssh2' ); // // Build content // ============= -$arrTemplate['STEP1_BOX'] = $myInstClass->translate('Requirements'); -$arrTemplate['STEP2_BOX'] = $myInstClass->translate($_SESSION['install']['mode']); -$arrTemplate['STEP3_BOX'] = $myInstClass->translate('Finish'); -$arrTemplate['STEP1_TITLE'] = "NagiosQL ".$myInstClass->translate($_SESSION['install']['mode']).": ".$myInstClass->translate("Checking requirements"); -$arrTemplate['STEP1_SUBTITLE1'] = $myInstClass->translate("Checking Client"); -$arrTemplate['STEP1_SUBTITLE2'] = $myInstClass->translate("Checking PHP version"); -$arrTemplate['STEP1_SUBTITLE3'] = $myInstClass->translate("Checking PHP extensions"); -$arrTemplate['STEP1_SUBTITLE4'] = $myInstClass->translate("Checking available database interfaces"); -$arrTemplate['STEP1_SUBTITLE5'] = $myInstClass->translate("Checking php.ini/.htaccess settings"); -$arrTemplate['STEP1_SUBTITLE6'] = $myInstClass->translate("Checking System Permission"); -$arrTemplate['STEP1_TEXT3_1'] = $myInstClass->translate("The following modules/extensions are required to run NagiosQL"); -$arrTemplate['STEP1_TEXT3_2'] = $myInstClass->translate("The next couple of extensions are optional but recommended"); -$arrTemplate['STEP1_TEXT4_1'] = $myInstClass->translate("Check which of the supported extensions are installed. At least one of them is required."); -$arrTemplate['STEP1_TEXT5_1'] = $myInstClass->translate("The following settings are required to run NagiosQL"); +$arrTemplate['STEP1_BOX'] = $myInstClass->translate('Requirements'); +$arrTemplate['STEP2_BOX'] = $myInstClass->translate('Installation'); +$arrTemplate['STEP3_BOX'] = $myInstClass->translate('Finish'); +$arrTemplate['STEP1_TITLE'] = 'NagiosQL ' .$myInstClass->translate('Installation'). ': ' . + $myInstClass->translate('Checking requirements'); +$arrTemplate['STEP1_SUBTITLE1'] = $myInstClass->translate('Checking Client'); +$arrTemplate['STEP1_SUBTITLE2'] = $myInstClass->translate('Checking PHP version'); +$arrTemplate['STEP1_SUBTITLE3'] = $myInstClass->translate('Checking PHP extensions'); +$arrTemplate['STEP1_SUBTITLE4'] = $myInstClass->translate('Checking available database interfaces'); +$arrTemplate['STEP1_SUBTITLE5'] = $myInstClass->translate('Checking php.ini/.htaccess settings'); +$arrTemplate['STEP1_SUBTITLE6'] = $myInstClass->translate('Checking System Permission'); +$arrTemplate['STEP1_TEXT3_1'] = $myInstClass->translate('The following modules/extensions are required ' + . 'to run NagiosQL'); +$arrTemplate['STEP1_TEXT3_2'] = $myInstClass->translate('The next couple of extensions are optional but ' + . 'recommended'); +$arrTemplate['STEP1_TEXT4_1'] = $myInstClass->translate('Check which of the supported extensions are installed. At ' + . 'least one of them is required.'); +$arrTemplate['STEP1_TEXT5_1'] = $myInstClass->translate('The following settings are required to run ' + . 'NagiosQL'); // // Conditional checks // ======================= -$strHTMLPart1 = "\"valid\" "; -$strHTMLPart2 = "\"invalid\" "; -$strHTMLPart3 = "\"warning\" "; -$strHTMLPart4 = ": "; -$strHTMLPart5 = ": "; -$strHTMLPart6 = ": "; -$strHTMLPart7 = "\"online"; +$strHTMLPart1 = 'valid '; +$strHTMLPart2 = 'invalid '; +$strHTMLPart3 = 'warning '; +$strHTMLPart4 = ': '; +$strHTMLPart5 = ': '; +$strHTMLPart6 = ': '; +$strHTMLPart7 = 'online help'; // Javascript check -if ($_SESSION['install']['jscript'] == "yes") { - $arrTemplate['CHECK_1_PIC'] = "valid"; $arrTemplate['CHECK_1_CLASS'] = "green"; $arrTemplate['CHECK_1_VALUE'] = $myInstClass->translate("ENABLED"); - $arrTemplate['CHECK_1_INFO'] = ""; +if ($_SESSION['install']['jscript'] == 'yes') { + $arrTemplate['CHECK_1_PIC'] = 'valid'; + $arrTemplate['CHECK_1_CLASS'] = 'green'; + $arrTemplate['CHECK_1_VALUE'] = $myInstClass->translate('ENABLED'); + $arrTemplate['CHECK_1_INFO'] = ''; } else { - $arrTemplate['CHECK_1_PIC'] = "invalid"; $arrTemplate['CHECK_1_CLASS'] = "green"; $arrTemplate['CHECK_1_VALUE'] = $myInstClass->translate("NOT ENABLED"); - $arrTemplate['CHECK_1_INFO'] = "(".$myInstClass->translate("After enabling Javascript, the page must be updated twice so that the status changes").")"; + $arrTemplate['CHECK_1_PIC'] = 'invalid'; + $arrTemplate['CHECK_1_CLASS'] = 'green'; + $arrTemplate['CHECK_1_VALUE'] = $myInstClass->translate('NOT ENABLED'); + $arrTemplate['CHECK_1_INFO'] = '(' .$myInstClass->translate('After enabling Javascript, the page must be updated ' + . 'twice so that the status changes'). ')'; } // PHP version check -define('MIN_PHP_VERSION', '5.2.0'); -$arrTemplate['CHECK_2_TEXT'] = $myInstClass->translate("Version"); -if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '>=')) { - $arrTemplate['CHECK_2_PIC'] = "valid"; $arrTemplate['CHECK_2_CLASS'] = "green"; $arrTemplate['CHECK_2_VALUE'] = $myInstClass->translate("OK"); - $arrTemplate['CHECK_2_INFO'] = "(PHP ". PHP_VERSION ." ".$myInstClass->translate("detected").")"; +$strMinPHPVersion = '5.5.0'; +$arrTemplate['CHECK_2_TEXT'] = $myInstClass->translate('Version'); +if (version_compare(PHP_VERSION, $strMinPHPVersion, '>=')) { + $arrTemplate['CHECK_2_PIC'] = 'valid'; + $arrTemplate['CHECK_2_CLASS'] = 'green'; + $arrTemplate['CHECK_2_VALUE'] = $myInstClass->translate('OK'); + $arrTemplate['CHECK_2_INFO'] = '(PHP ' . PHP_VERSION . ' ' .$myInstClass->translate('detected'). ')'; } else { - $arrTemplate['CHECK_2_PIC'] = "invalid"; $arrTemplate['CHECK_2_CLASS'] = "green"; $arrTemplate['CHECK_2_VALUE'] = "PHP ". PHP_VERSION ." ".$myInstClass->translate("detected"); - $arrTemplate['CHECK_2_INFO'] = "(PHP ". MIN_PHP_VERSION ." ".$myInstClass->translate("or greater is required").")"; - $intError = 1; + $arrTemplate['CHECK_2_PIC'] = 'invalid'; + $arrTemplate['CHECK_2_CLASS'] = 'green'; + $arrTemplate['CHECK_2_VALUE'] = 'PHP ' . PHP_VERSION . ' ' .$myInstClass->translate('detected'); + $arrTemplate['CHECK_2_INFO'] = '(PHP ' . $strMinPHPVersion . ' ' .$myInstClass->translate('or greater is ' + . 'required'). ')'; + $intError = 1; } // PHP modules / extensions $strExtPath = ini_get('extension_dir'); -$strPrefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; -$strHTML = ""; +$strPrefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; +$strHTML1 = ''; foreach ($arrRequiredExt as $key => $elem) { - if (extension_loaded($elem)) { - $strHTML .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate("OK")."\n"; - } else { - $strPath = $strExtPath."/".$strPrefix.$elem.".".PHP_SHLIB_SUFFIX; - $strMsg = @is_readable($strPath) ? $myInstClass->translate("Could be loaded. Please add in php.ini") : "".$strHTMLPart7.""; - $strHTML .= $strHTMLPart2.$key.$strHTMLPart5.$myInstClass->translate("NOT AVAILABLE")." (".$strMsg.")\n"; - $intError = 1; - } - $strHTML .= "
\n"; + if (extension_loaded($elem)) { + $strHTML1 .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate('OK')."
\n"; + } else { + $strPath = $strExtPath. '/' .$strPrefix.$elem. '.' .PHP_SHLIB_SUFFIX; + $strMsg = is_readable($strPath) ? $myInstClass->translate('Could be loaded. Please add in php.ini') + : '' .$strHTMLPart7. ''; + $strHTML1 .= $strHTMLPart2.$key.$strHTMLPart5.$myInstClass->translate('NOT AVAILABLE'). ' (' .$strMsg. ')' + . "
\n"; + $intError = 1; + } + $strHTML1 .= "
\n"; } -$arrTemplate['CHECK_3_CONTENT_1'] = $strHTML; -$strHTML = ""; +$arrTemplate['CHECK_3_CONTENT_1'] = $strHTML1; +$strHTML2 = ''; foreach ($arrOptionalExt as $key => $elem) { - if (extension_loaded($elem)) { - $strHTML .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate("OK")."
\n"; - } else { - $strPath = $strExtPath."/".$strPrefix.$elem.".".PHP_SHLIB_SUFFIX; - $strMsg = @is_readable($strPath) ? $myInstClass->translate("Could be loaded. Please add in php.ini") : "".$strHTMLPart7.""; - $strHTML .= $strHTMLPart3.$key.$strHTMLPart6.$myInstClass->translate("NOT AVAILABLE")." (".$strMsg.")
\n"; - //$intError = 1; - } - $strHTML .= "
\n"; + if (extension_loaded($elem)) { + $strHTML2 .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate('OK')."
\n"; + } else { + $strPath = $strExtPath. '/' .$strPrefix.$elem. '.' .PHP_SHLIB_SUFFIX; + $strMsg = is_readable($strPath) ? $myInstClass->translate('Could be loaded. Please add in php.ini') + : '' .$strHTMLPart7. ''; + $strHTML2 .= $strHTMLPart3.$key.$strHTMLPart6.$myInstClass->translate('NOT AVAILABLE'). ' (' .$strMsg. ')' + . "
\n"; + //$intError = 1; + } + $strHTML2 .= "
\n"; } -$arrTemplate['CHECK_3_CONTENT_2'] = $strHTML; +$arrTemplate['CHECK_3_CONTENT_2'] = $strHTML2; // PHP database interfaces -$strHTML = ""; -$intTemp = 0; +$strHTML3 = ''; +$intTemp = 0; $_SESSION['install']['dbtype_available'] = array(); foreach ($arrSupportedDBs as $key => $elem) { - if (extension_loaded($elem)) { - $strNewInstallOnly = ""; - if (isset($_SESSION['install']['dbtype']) && ($_SESSION['install']['mode'] == "Update")) { - if (($_SESSION['install']['dbtype'] != $elem) && (substr($_SESSION['install']['dbtype'],0,5) != substr($elem,0,5))) { - $strNewInstallOnly = " (".$myInstClass->translate("New installation only - updates are only supported using the same database interface!").")"; - } - } - $strHTML .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate("OK")."
$strNewInstallOnly\n"; - if ($strNewInstallOnly == "") $_SESSION['install']['dbtype_available'][] = $elem; - $intTemp++; - } else { - $strPath = $strExtPath."/".$strPrefix.$elem.".".PHP_SHLIB_SUFFIX; - $strMsg = @is_readable($strPath) ? $myInstClass->translate("Could be loaded. Please add in php.ini") : "".$strHTMLPart7.""; - $strHTML .= $strHTMLPart2.$key.$strHTMLPart5.$myInstClass->translate("NOT AVAILABLE")." (".$strMsg.")
\n"; - } - $strHTML .= "
\n"; + if (extension_loaded($elem)) { + $strNewInstallOnly = ''; + if (isset($_SESSION['install']['dbtype']) && ($_SESSION['install']['mode'] == 'Update') && + ($_SESSION['install']['dbtype'] != $elem) && + (0 !== strpos($_SESSION['install']['dbtype'], substr($elem, 0, 5)))) { + $strNewInstallOnly = ' (' .$myInstClass->translate('New installation only - updates are only supported ' + . 'using the same database interface!'). ')'; + } + $strHTML3 .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate('OK')."
$strNewInstallOnly\n"; + if ($strNewInstallOnly == '') { + $_SESSION['install']['dbtype_available'][] = $elem; + } + $intTemp++; + } else { + $strPath = $strExtPath. '/' .$strPrefix.$elem. '.' .PHP_SHLIB_SUFFIX; + $strMsg = is_readable($strPath) ? $myInstClass->translate('Could be loaded. Please add in php.ini') + : '' .$strHTMLPart7. ''; + $strHTML3 .= $strHTMLPart2.$key.$strHTMLPart5.$myInstClass->translate('NOT AVAILABLE'). ' (' .$strMsg. ')' + . "
\n"; + } + $strHTML3 .= "
\n"; +} +$arrTemplate['CHECK_4_CONTENT_1'] = $strHTML3; +if ($intTemp == 0) { + $intError = 1; } -$arrTemplate['CHECK_4_CONTENT_1'] = $strHTML; -if ($intTemp == 0) $intError = 1; // PHP ini checks -$strHTML = ""; +$strHTML4 = ''; foreach ($arrIniCheck as $key => $elem) { - $strStatus = ini_get($key); - if ($elem === '-NOTEMPTY-') { - if (empty($strStatus)) { - $strHTML .= $strHTMLPart2.$key.$strHTMLPart5.$myInstClass->translate("NOT AVAILABLE")." (".$myInstClass->translate("cannot be empty and needs to be set").")
\n"; - $intError = 1; - } else { - $strHTML .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate("OK")."
\n"; - } - } else { - if ($strStatus == $elem) { - $strHTML .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate("OK")."\n"; - } else { - $strHTML .= $strHTMLPart2.$key.$strHTMLPart5.$status." (".$myInstClass->translate("should be")." ".$elem.")\n"; - $intError = 1; - } - } - $strHTML .= "
\n"; + $strStatus = ini_get($key); + if ($elem === '-NOTEMPTY-') { + if (empty($strStatus)) { + $strHTML4 .= $strHTMLPart2.$key.$strHTMLPart5.$myInstClass->translate('NOT AVAILABLE'). ' (' . + $myInstClass->translate('cannot be empty and needs to be set').")\n"; + $intError = 1; + } else { + $strHTML4 .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate('OK')."\n"; + } + } else { + if ($strStatus == $elem) { + $strHTML4 .= $strHTMLPart1.$key.$strHTMLPart4.$myInstClass->translate('OK')."\n"; + } else { + $strHTML4 .= $strHTMLPart2.$key.$strHTMLPart5.$strStatus. ' (' .$myInstClass->translate('should be'). ' ' . + $elem.")\n"; + $intError = 1; + } + } + $strHTML4 .= "
\n"; } -$arrTemplate['CHECK_5_CONTENT_1'] = $strHTML; +$arrTemplate['CHECK_5_CONTENT_1'] = $strHTML4; // File access checks -$strConfigFile = "../config/settings.php"; +$strConfigFile = '../config/settings.php'; if (file_exists($strConfigFile) && is_readable($strConfigFile)) { - $arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart1.$myInstClass->translate("Read test on settings file (config/settings.php)").$strHTMLPart4.$myInstClass->translate("OK")."
\n"; -} else if (file_exists($strConfigFile)&& !is_readable($strConfigFile)) { - $arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart2.$myInstClass->translate("Read test on settings file (config/settings.php)").$strHTMLPart5.$myInstClass->translate("failed")."
\n"; + $arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart1.$myInstClass->translate('Read test on settings file ' + . '(config/settings.php)').$strHTMLPart4.$myInstClass->translate('OK')."
\n"; +} elseif (file_exists($strConfigFile)&& !is_readable($strConfigFile)) { + $arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart2.$myInstClass->translate('Read test on settings file ' + . '(config/settings.php)').$strHTMLPart5.$myInstClass->translate('failed')."
\n"; } elseif (!file_exists($strConfigFile)) { - $arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart3.$myInstClass->translate("Settings file does not exists (config/settings.php)").$strHTMLPart6.$myInstClass->translate("will be created")."
\n"; + $arrTemplate['CHECK_6_CONTENT_1'] = $strHTMLPart3.$myInstClass->translate('Settings file does not exists ' + . '(config/settings.php)').$strHTMLPart6.$myInstClass->translate('will be created')."
\n"; } -if(file_exists($strConfigFile) && is_writable($strConfigFile)) { - $arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart1.$myInstClass->translate("Write test on settings file (config/settings.php)").$strHTMLPart4.$myInstClass->translate("OK")."
\n"; -} else if (is_writable("../config") && !file_exists($strConfigFile)) { - $arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart1.$myInstClass->translate("Write test on settings directory (config/)").$strHTMLPart4.$myInstClass->translate("OK")."
\n"; -} else if (file_exists($strConfigFile) && !is_writable($strConfigFile)) { - $arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart2.$myInstClass->translate("Write test on settings file (config/settings.php)").$strHTMLPart5.$myInstClass->translate("failed")."
\n"; - $intError = 1; +if (file_exists($strConfigFile) && is_writable($strConfigFile)) { + $arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart1.$myInstClass->translate('Write test on settings file ' + . '(config/settings.php)').$strHTMLPart4.$myInstClass->translate('OK')."
\n"; +} elseif (is_writable('../config') && !file_exists($strConfigFile)) { + $arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart1.$myInstClass->translate('Write test on settings directory ' + . '(config/)').$strHTMLPart4.$myInstClass->translate('OK')."
\n"; +} elseif (file_exists($strConfigFile) && !is_writable($strConfigFile)) { + $arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart2.$myInstClass->translate('Write test on settings file ' + . '(config/settings.php)').$strHTMLPart5.$myInstClass->translate('failed')."
\n"; + $intError = 1; } else { - $arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart2.$myInstClass->translate("Write test on settings directory (config/)").$strHTMLPart5.$myInstClass->translate("failed")."
\n"; - $intError = 1; + $arrTemplate['CHECK_6_CONTENT_2'] = $strHTMLPart2.$myInstClass->translate('Write test on settings directory ' + . '(config/)').$strHTMLPart5.$myInstClass->translate('failed')."
\n"; + $intError = 1; } -$strClassFile = "../functions/nag_class.php"; -if(file_exists($strClassFile) && is_readable($strClassFile)) { - $arrTemplate['CHECK_6_CONTENT_3'] = $strHTMLPart1.$myInstClass->translate("Read test on a class file (functions/nag_class.php)").$strHTMLPart4.$myInstClass->translate("OK")."
\n"; +$strClassFile = '../functions/NagVisualClass.php'; +if (file_exists($strClassFile) && is_readable($strClassFile)) { + $arrTemplate['CHECK_6_CONTENT_3'] = $strHTMLPart1.$myInstClass->translate('Read test on one class file ' + . '(functions/NagVisualClass.php)').$strHTMLPart4.$myInstClass->translate('OK')."
\n"; } else { - $arrTemplate['CHECK_6_CONTENT_3'] = $strHTMLPart2.$myInstClass->translate("Read test on a class file (functions/nag_class.php)").$strHTMLPart5.$myInstClass->translate("failed")."
\n"; - $intError = 1; + $arrTemplate['CHECK_6_CONTENT_3'] = $strHTMLPart2.$myInstClass->translate('Read test on one class file ' + . '(functions/NagVisualClass.php)').$strHTMLPart5.$myInstClass->translate('failed')."
\n"; + $intError = 1; } -$strFile = "../admin.php"; -if(file_exists($strFile) && is_readable($strFile)) { - $arrTemplate['CHECK_6_CONTENT_4'] = $strHTMLPart1.$myInstClass->translate("Read test on startsite file (admin.php)").$strHTMLPart4.$myInstClass->translate("OK")."
\n"; +$strFile1 = '../admin.php'; +if (file_exists($strFile1) && is_readable($strFile1)) { + $arrTemplate['CHECK_6_CONTENT_4'] = $strHTMLPart1.$myInstClass->translate('Read test on home page file ' + . '(admin.php)').$strHTMLPart4.$myInstClass->translate('OK')."
\n"; } else { - $arrTemplate['CHECK_6_CONTENT_4'] = $strHTMLPart2.$myInstClass->translate("Read test on startsite file (admin.php)").$strHTMLPart5.$myInstClass->translate("failed")."
\n"; - $intError = 1; + $arrTemplate['CHECK_6_CONTENT_4'] = $strHTMLPart2.$myInstClass->translate('Read test on home page file ' + . '(admin.php)').$strHTMLPart5.$myInstClass->translate('failed')."
\n"; + $intError = 1; } -$strFile = "../templates/index.tpl.htm"; -if(file_exists($strFile) && is_readable($strFile)) { - $arrTemplate['CHECK_6_CONTENT_5'] = $strHTMLPart1.$myInstClass->translate("Read test on a template file (templates/index.tpl.htm)").$strHTMLPart4.$myInstClass->translate("OK")."
\n"; +$strFile2 = '../templates/index.htm.tpl'; +if (file_exists($strFile2) && is_readable($strFile2)) { + $arrTemplate['CHECK_6_CONTENT_5'] = $strHTMLPart1.$myInstClass->translate('Read test on one template file ' + . '(templates/index.tpl.htm)').$strHTMLPart4.$myInstClass->translate('OK')."
\n"; } else { - $arrTemplate['CHECK_6_CONTENT_5'] = $strHTMLPart2.$myInstClass->translate("Read test on a template file (templates/index.tpl.htm)").$strHTMLPart5.$myInstClass->translate("failed")."
\n"; - $intError = 1; + $arrTemplate['CHECK_6_CONTENT_5'] = $strHTMLPart2.$myInstClass->translate('Read test on one template file ' + . '(templates/index.tpl.htm)').$strHTMLPart5.$myInstClass->translate('failed')."
\n"; + $intError = 1; } -$strFile = "../templates/admin/admin_master.tpl.htm"; -if(file_exists($strFile) && is_readable($strFile)) { - $arrTemplate['CHECK_6_CONTENT_6'] = $strHTMLPart1.$myInstClass->translate("Read test on a admin template file (templates/admin/admin_master.tpl.htm)").$strHTMLPart4.$myInstClass->translate("OK")."
\n"; +$strFile3 = '../templates/admin/datalist.htm.tpl'; +if (file_exists($strFile3) && is_readable($strFile3)) { + $arrTemplate['CHECK_6_CONTENT_6'] = $strHTMLPart1.$myInstClass->translate('Read test on one admin template file ' + . '(templates/admin/datalist.htm.tpl)').$strHTMLPart4.$myInstClass->translate('OK')."
\n"; } else { - $arrTemplate['CHECK_6_CONTENT_6'] = $strHTMLPart2.$myInstClass->translate("Read test on a admin template file (templates/admin/admin_master.tpl.htm)").$strHTMLPart5.$myInstClass->translate("failed")."
\n"; - $intError = 1; + $arrTemplate['CHECK_6_CONTENT_6'] = $strHTMLPart2.$myInstClass->translate('Read test on one admin template file ' + . '(templates/admin/datalist.htm.tpl)').$strHTMLPart5.$myInstClass->translate('failed')."
\n"; + $intError = 1; } -$strFile = "../templates/files/contacts.tpl.dat"; -if(file_exists($strFile) && is_readable($strFile)) { - $arrTemplate['CHECK_6_CONTENT_7'] = $strHTMLPart1.$myInstClass->translate("Read test on a file template (templates/files/contacts.tpl.dat)").$strHTMLPart4.$myInstClass->translate("OK")."
\n"; +$strFile4 = '../templates/files/contacts.tpl.dat'; +if (file_exists($strFile4) && is_readable($strFile4)) { + $arrTemplate['CHECK_6_CONTENT_7'] = $strHTMLPart1.$myInstClass->translate('Read test on one file template ' + . '(templates/files/contacts.tpl.dat)').$strHTMLPart4.$myInstClass->translate('OK')."
\n"; } else { - $arrTemplate['CHECK_6_CONTENT_7'] = $strHTMLPart2.$myInstClass->translate("Read test on a file template (templates/files/contacts.tpl.dat)").$strHTMLPart5.$myInstClass->translate("failed")."
\n"; - $intError = 1; + $arrTemplate['CHECK_6_CONTENT_7'] = $strHTMLPart2.$myInstClass->translate('Read test on one file template ' + . '(templates/files/contacts.tpl.dat)').$strHTMLPart5.$myInstClass->translate('failed')."
\n"; + $intError = 1; } -$strFile = "../images/pixel.gif"; -if(file_exists($strFile) && is_readable($strFile)) { - $arrTemplate['CHECK_6_CONTENT_8'] = $strHTMLPart1.$myInstClass->translate("Read test on a image file (images/pixel.gif)").$strHTMLPart4.$myInstClass->translate("OK")."
\n"; +$strFile5 = '../images/pixel.gif'; +if (file_exists($strFile5) && is_readable($strFile5)) { + $arrTemplate['CHECK_6_CONTENT_8'] = $strHTMLPart1.$myInstClass->translate('Read test on one image file ' + . '(images/pixel.gif)').$strHTMLPart4.$myInstClass->translate('OK')."
\n"; } else { - $arrTemplate['CHECK_6_CONTENT_9'] = $strHTMLPart2.$myInstClass->translate("Read test on a image file (images/pixel.gif)").$strHTMLPart5.$myInstClass->translate("failed")."
\n"; - $intError = 1; + $arrTemplate['CHECK_6_CONTENT_9'] = $strHTMLPart2.$myInstClass->translate('Read test on one image file ' + . '(images/pixel.gif)').$strHTMLPart5.$myInstClass->translate('failed')."
\n"; + $intError = 1; } if ($intError != 0) { - $arrTemplate['MESSAGE'] = "".$myInstClass->translate("There are some errors - please check your system settings and read the requirements of NagiosQL!")."

\n"; - $arrTemplate['MESSAGE'] .= $myInstClass->translate("Read the INSTALLATION file in the NagiosQL doc directory or the installation PDF file on our"); - $arrTemplate['MESSAGE'] .= " "; - $arrTemplate['MESSAGE'] .= $myInstClass->translate("online documentation")."
".$myInstClass->translate("site to find out, how to fix them.") ."
\n"; - $arrTemplate['MESSAGE'] .= $myInstClass->translate("After that - refresh this page to proceed") ."...
\n"; - $arrTemplate['DIV_ID'] = "install-center"; - $arrTemplate['FORM_CONTENT'] = "
"; - $arrTemplate['FORM_CONTENT'] .= $myInstClass->translate("Refresh")."\n"; + $arrTemplate['MESSAGE'] = '' .$myInstClass->translate('There are some errors - please ' + . 'check your system settings and read the requirements of NagiosQL!')."

\n"; + $arrTemplate['MESSAGE'] .= $myInstClass->translate('Read the INSTALLATION file in the NagiosQL doc directory ' + . 'or the installation PDF file on our'); + $arrTemplate['MESSAGE'] .= ' '; + $arrTemplate['MESSAGE'] .= $myInstClass->translate('online documentation'). '
' . + $myInstClass->translate('site to find out, how to fix them.') ."
\n"; + $arrTemplate['MESSAGE'] .= $myInstClass->translate('After that - refresh this page to proceed') ."...
\n"; + $arrTemplate['DIV_ID'] = 'install-center'; + $arrTemplate['FORM_CONTENT'] = '
'; + $arrTemplate['FORM_CONTENT'] .= $myInstClass->translate('Refresh')."\n"; } else { - $arrTemplate['MESSAGE'] = "".$myInstClass->translate("Environment test sucessfully passed")."

\n"; - $arrTemplate['DIV_ID'] = "install-next"; - $arrTemplate['FORM_CONTENT'] = "\n"; - $arrTemplate['FORM_CONTENT'] .= "
".$myInstClass->translate("Next")."\n"; + $arrTemplate['MESSAGE'] = '' .$myInstClass->translate('Environment test completed ' + . 'successfully')."

\n"; + $arrTemplate['DIV_ID'] = 'install-next'; + $arrTemplate['FORM_CONTENT'] = "\n"; + $arrTemplate['FORM_CONTENT'] .= '
' .$myInstClass->translate('Next')."\n"; } // // Write content // ============= -$strContent = $myInstClass->parseTemplate($arrTemplate,$preIncludeContent); +$strContent = $myInstClass->parseTemplate($arrTemplate, $preIncludeContent); echo $strContent; -?> \ No newline at end of file diff --git a/install/step2.php b/install/step2.php index 5a6a120..6bef8c3 100644 --- a/install/step2.php +++ b/install/step2.php @@ -5,112 +5,127 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Installer script - step 2 -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // // Prevent this file from direct access // ==================================== -if(preg_match('#' . basename(__FILE__) . '#', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'utf-8'))) { - exit; +if (preg_match('#' . basename(__FILE__) . '#', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'utf-8'))) { + header('Location: install.php'); + exit; } // // Define common variables // ======================= -$preIncludeContent = "templates/step2.tpl.htm"; -$intError = 0; +$preIncludeContent = $preBasePath.'install/templates/step2.htm.tpl'; +$intError = 0; // // Build content // ============= -$arrTemplate['PASSWD_MESSAGE'] = $myInstClass->translate('The NagiosQL first passwords are not equal!'); -$arrTemplate['FIELDS_MESSAGE'] = $myInstClass->translate('Please fill in all fields marked with an *'); -$arrTemplate['STEP1_BOX'] = $myInstClass->translate('Requirements'); -$arrTemplate['STEP2_BOX'] = $myInstClass->translate($_SESSION['install']['mode']); -$arrTemplate['STEP3_BOX'] = $myInstClass->translate('Finish'); -$arrTemplate['STEP2_TITLE'] = "NagiosQL ".$myInstClass->translate($_SESSION['install']['mode']).": ".$myInstClass->translate("Setup"); -$arrTemplate['STEP2_TEXT1_1'] = $myInstClass->translate("Please complete the form below. Mandatory fields marked *"); -$arrTemplate['STEP2_TEXT2_1'] = $myInstClass->translate("Database Configuration"); -$arrTemplate['STEP2_TEXT2_2'] = $myInstClass->translate("Database Type"); +$arrTemplate['PASSWD_MESSAGE'] = $myInstClass->translate('The NagiosQL first passwords are not equal!'); +$arrTemplate['FIELDS_MESSAGE'] = $myInstClass->translate('Please fill in all fields marked with an *'); +$arrTemplate['STEP1_BOX'] = $myInstClass->translate('Requirements'); +$arrTemplate['STEP2_BOX'] = $myInstClass->translate('Installation'); +$arrTemplate['STEP3_BOX'] = $myInstClass->translate('Finish'); +$arrTemplate['STEP2_TITLE'] = 'NagiosQL ' .$myInstClass->translate('Installation'). ': ' . + $myInstClass->translate('Setup'); +$arrTemplate['STEP2_TEXT1_1'] = $myInstClass->translate('Please complete the form below. Mandatory fields marked ' + . '*'); +$arrTemplate['STEP2_TEXT2_1'] = $myInstClass->translate('Database Configuration'); +$arrTemplate['STEP2_TEXT2_2'] = $myInstClass->translate('Database Type'); +$strSelected = ''; if (is_array($_SESSION['install']['dbtype_available']) && (count($_SESSION['install']['dbtype_available']) != 0)) { - $strDBType = ""; - foreach ($_SESSION['install']['dbtype_available'] AS $elem) { - $strSelected = ""; - if (isset($_SESSION['install']['dbtype']) && ($_SESSION['install']['dbtype'] == $elem)) $strSelected = "selected=\"selected\""; - $strDBType .= "\n"; - } + $strDBType = ''; + foreach ((array)$_SESSION['install']['dbtype_available'] as $elem) { + if (isset($_SESSION['install']['dbtype']) && ($_SESSION['install']['dbtype'] == $elem)) { + $strSelected = 'selected="selected"'; + } + $strDBType .= '\n"; + } } else { - $strDBType .= "\n"; + $strDBType .= "\n"; } -$arrTemplate['STEP2_VALUE2_2'] = $strDBType; -$arrTemplate['STEP2_TEXT2_3'] = $myInstClass->translate("Database Server"); -$arrTemplate['STEP2_VALUE2_3'] = htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8'); -$arrTemplate['STEP2_TEXT2_4'] = $myInstClass->translate("Local hostname or IP address"); -if (htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8') == "localhost") { - $arrTemplate['STEP2_VALUE2_4'] = htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8'); -}else { - $arrTemplate['STEP2_VALUE2_4'] = $_SERVER['SERVER_ADDR']; +$arrTemplate['STEP2_VALUE2_2'] = $strDBType; +$arrTemplate['STEP2_TEXT2_3'] = $myInstClass->translate('Database Server'); +$arrTemplate['STEP2_VALUE2_3'] = htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8'); +$arrTemplate['STEP2_TEXT2_4'] = $myInstClass->translate('Local hostname or IP address'); +if (htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8') == 'localhost') { + $arrTemplate['STEP2_VALUE2_4'] = htmlspecialchars($_SESSION['install']['dbserver'], ENT_QUOTES, 'utf-8'); +} else { + $arrTemplate['STEP2_VALUE2_4'] = filter_input(INPUT_SERVER, 'SERVER_ADDR', FILTER_SANITIZE_STRING); } -$arrTemplate['STEP2_TEXT2_5'] = $myInstClass->translate("Database Server Port"); -$arrTemplate['STEP2_VALUE2_5'] = htmlspecialchars($_SESSION['install']['dbport'], ENT_QUOTES, 'utf-8'); -$arrTemplate['STEP2_TEXT2_6'] = $myInstClass->translate("Database name"); -$arrTemplate['STEP2_VALUE2_6'] = htmlspecialchars($_SESSION['install']['dbname'], ENT_QUOTES, 'utf-8'); -$arrTemplate['STEP2_TEXT2_7'] = $myInstClass->translate("NagiosQL DB User"); -$arrTemplate['STEP2_VALUE2_7'] = htmlspecialchars($_SESSION['install']['dbuser'], ENT_QUOTES, 'utf-8'); -$arrTemplate['STEP2_TEXT2_8'] = $myInstClass->translate("NagiosQL DB Password"); -$arrTemplate['STEP2_VALUE2_8'] = htmlspecialchars($_SESSION['install']['dbpass'], ENT_QUOTES, 'utf-8'); -$arrTemplate['STEP2_TEXT2_9'] = $myInstClass->translate("Administrative Database User"); -$arrTemplate['STEP2_VALUE2_9'] = htmlspecialchars($_SESSION['install']['admuser'], ENT_QUOTES, 'utf-8'); -$arrTemplate['STEP2_TEXT2_10'] = $myInstClass->translate("Administrative Database Password"); -$arrTemplate['STEP2_TEXT2_11'] = $myInstClass->translate("Drop database if already exists?"); -if ($_SESSION['install']['dbdrop'] == 1) {$arrTemplate['STEP2_VALUE2_11'] = "checked";} else {$arrTemplate['STEP2_VALUE2_11'] = "";} -$arrTemplate['STEP2_TEXT3_1'] = $myInstClass->translate("NagiosQL User Setup"); -$arrTemplate['STEP2_TEXT3_2'] = $myInstClass->translate("Initial NagiosQL User"); -$arrTemplate['STEP2_VALUE3_2'] = htmlspecialchars($_SESSION['install']['qluser'], ENT_QUOTES, 'utf-8'); -$arrTemplate['STEP2_TEXT3_3'] = $myInstClass->translate("Initial NagiosQL Password"); -$arrTemplate['STEP2_VALUE3_3'] = htmlspecialchars($_SESSION['install']['qlpass'], ENT_QUOTES, 'utf-8'); -$arrTemplate['STEP2_TEXT3_4'] = $myInstClass->translate("Please repeat the password"); -$arrTemplate['STEP2_TEXT4_1'] = $myInstClass->translate("Nagios Configuration"); -$arrTemplate['STEP2_TEXT4_2'] = $myInstClass->translate("Import Nagios sample config?"); -if ($_SESSION['install']['sample'] == 1) {$arrTemplate['STEP2_VALUE4_2'] = "checked";} else {$arrTemplate['STEP2_VALUE4_2'] = "";} -$arrTemplate['STEP2_FORM_1'] = $myInstClass->translate("Next"); -$arrTemplate['STEP2_TEXT5_1'] = $myInstClass->translate("NagiosQL path values"); -$arrTemplate['STEP2_TEXT5_2'] = $myInstClass->translate("Create NagiosQL config paths?"); -if ($_SESSION['install']['createpath'] == 1) {$arrTemplate['STEP2_VALUE5_2'] = "checked";} else {$arrTemplate['STEP2_VALUE5_2'] = "";} -$arrTemplate['STEP2_TEXT5_3'] = $myInstClass->translate("NagiosQL config path"); -$arrTemplate['STEP2_VALUE5_3'] = htmlspecialchars($_SESSION['install']['qlpath'], ENT_QUOTES, 'utf-8'); -$arrTemplate['STEP2_TEXT5_4'] = $myInstClass->translate("Nagios config path"); -$arrTemplate['STEP2_VALUE5_4'] = htmlspecialchars($_SESSION['install']['nagpath'], ENT_QUOTES, 'utf-8'); -$arrTemplate['STEP2_TEXT5_5'] = $myInstClass->translate("Both path values were stored in your configuration target settings for localhost."); -$arrTemplate['STEP2_TEXT5_6'] = $myInstClass->translate("If you select the create path option, be sure that the NagiosQL base path exist and the webserver demon has write access to it. So the installer will create the required subdirectories in your localhost's filesystem (hosts, services, backup etc.)"); -$arrTemplate['INSTALL_FIELDS'] = ""; - +$arrTemplate['STEP2_TEXT2_5'] = $myInstClass->translate('Database Server Port'); +$arrTemplate['STEP2_VALUE2_5'] = htmlspecialchars($_SESSION['install']['dbport'], ENT_QUOTES, 'utf-8'); +$arrTemplate['STEP2_TEXT2_6'] = $myInstClass->translate('Database name'); +$arrTemplate['STEP2_VALUE2_6'] = htmlspecialchars($_SESSION['install']['dbname'], ENT_QUOTES, 'utf-8'); +$arrTemplate['STEP2_TEXT2_7'] = $myInstClass->translate('NagiosQL DB User'); +$arrTemplate['STEP2_VALUE2_7'] = htmlspecialchars($_SESSION['install']['dbuser'], ENT_QUOTES, 'utf-8'); +$arrTemplate['STEP2_TEXT2_8'] = $myInstClass->translate('NagiosQL DB Password'); +$arrTemplate['STEP2_VALUE2_8'] = htmlspecialchars($_SESSION['install']['dbpass'], ENT_QUOTES, 'utf-8'); +$arrTemplate['STEP2_TEXT2_9'] = $myInstClass->translate('Administrative Database User'); +$arrTemplate['STEP2_VALUE2_9'] = htmlspecialchars($_SESSION['install']['admuser'], ENT_QUOTES, 'utf-8'); +$arrTemplate['STEP2_TEXT2_10'] = $myInstClass->translate('Administrative Database Password'); +$arrTemplate['STEP2_TEXT2_11'] = $myInstClass->translate('Drop database if already exists?'); +if ($_SESSION['install']['dbdrop'] == 1) { + $arrTemplate['STEP2_VALUE2_11'] = 'checked'; +} else { + $arrTemplate['STEP2_VALUE2_11'] = ''; +} +$arrTemplate['STEP2_TEXT3_1'] = $myInstClass->translate('NagiosQL User Setup'); +$arrTemplate['STEP2_TEXT3_2'] = $myInstClass->translate('Initial NagiosQL User'); +$arrTemplate['STEP2_VALUE3_2'] = htmlspecialchars($_SESSION['install']['qluser'], ENT_QUOTES, 'utf-8'); +$arrTemplate['STEP2_TEXT3_3'] = $myInstClass->translate('Initial NagiosQL Password'); +$arrTemplate['STEP2_VALUE3_3'] = htmlspecialchars($_SESSION['install']['qlpass'], ENT_QUOTES, 'utf-8'); +$arrTemplate['STEP2_TEXT3_4'] = $myInstClass->translate('Please repeat the password'); +$arrTemplate['STEP2_TEXT4_1'] = $myInstClass->translate('Nagios Configuration'); +$arrTemplate['STEP2_TEXT4_2'] = $myInstClass->translate('Import Nagios sample config?'); +if ($_SESSION['install']['sample'] == 1) { + $arrTemplate['STEP2_VALUE4_2'] = 'checked'; +} else { + $arrTemplate['STEP2_VALUE4_2'] = ''; +} +$arrTemplate['STEP2_FORM_1'] = $myInstClass->translate('Next'); +$arrTemplate['STEP2_TEXT5_1'] = $myInstClass->translate('NagiosQL path values'); +$arrTemplate['STEP2_TEXT5_2'] = $myInstClass->translate('Create NagiosQL config paths?'); +if ($_SESSION['install']['createpath'] == 1) { + $arrTemplate['STEP2_VALUE5_2'] = 'checked'; +} else { + $arrTemplate['STEP2_VALUE5_2'] = ''; +} +$arrTemplate['STEP2_TEXT5_3'] = $myInstClass->translate('NagiosQL config path'); +$arrTemplate['STEP2_VALUE5_3'] = htmlspecialchars($_SESSION['install']['qlpath'], ENT_QUOTES, 'utf-8'); +$arrTemplate['STEP2_TEXT5_4'] = $myInstClass->translate('Nagios config path'); +$arrTemplate['STEP2_VALUE5_4'] = htmlspecialchars($_SESSION['install']['nagpath'], ENT_QUOTES, 'utf-8'); +$arrTemplate['STEP2_TEXT5_5'] = $myInstClass->translate('Both path values were stored in your configuration target ' + . 'settings for localhost.'); +$arrTemplate['STEP2_TEXT5_6'] = $myInstClass->translate('If you select the create path option, be sure that the ' + . 'NagiosQL base path exist and the webserver demon has write access to it. So the installer will create the ' + . "required subdirectories in your localhost's filesystem (hosts, services, backup etc.)"); +$arrTemplate['INSTALL_FIELDS'] = ''; // // Setting some template values to blank // ===================================== -$arrTemplate['STEP2_TEXT1_2'] = ""; - +$arrTemplate['STEP2_TEXT1_2'] = ''; // // Conditional checks // ======================= -if ($_SESSION['install']['mode'] == "Update") { - $arrTemplate['STEP2_TEXT1_2'] = "

".$myInstClass->translate("Please backup your database before proceeding!")."

\n"; - $arrTemplate['INST_VISIBLE'] = "hidefield"; +if ($_SESSION['install']['mode'] == 'Update') { + $arrTemplate['STEP2_TEXT1_2'] = '

' .$myInstClass->translate('Please backup your ' + . 'database before proceeding!')."

\n"; + $arrTemplate['INST_VISIBLE'] = 'hidefield'; } else { - $arrTemplate['INSTALL_FIELDS'] = ",tfDBprivUser,tfDBprivPass,tfQLuser,tfQLpass"; - $arrTemplate['INST_VISIBLE'] = "showfield"; + $arrTemplate['INSTALL_FIELDS'] = ',tfDBprivUser,tfDBprivPass,tfQLuser,tfQLpass'; + $arrTemplate['INST_VISIBLE'] = 'showfield'; } - // // Write content // ============= -$strContent = $myInstClass->parseTemplate($arrTemplate,$preIncludeContent); +$strContent = $myInstClass->parseTemplate($arrTemplate, $preIncludeContent); echo $strContent; -?> \ No newline at end of file diff --git a/install/step3.php b/install/step3.php index cf8ecdc..11efceb 100644 --- a/install/step3.php +++ b/install/step3.php @@ -5,68 +5,70 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Installer script - step 2 -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // // Prevent this file from direct access // ==================================== -if(preg_match('#' . basename(__FILE__) . '#', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'utf-8'))) { - exit; +if (preg_match('#' . basename(__FILE__) . '#', htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES, 'utf-8'))) { + header('Location: install.php'); + exit; } // // Define common variables // ======================= -$preIncludeContent = "templates/step3.tpl.htm"; -$intError = 0; +$preIncludeContent = $preBasePath.'install/templates/step3.htm.tpl'; +$intError = 0; +$setQLVersion = ''; +$arrUpdate = array(); -if(function_exists("date_default_timezone_set") and function_exists("date_default_timezone_get")) { - @date_default_timezone_set(@date_default_timezone_get()); +if (function_exists('date_default_timezone_set') and function_exists('date_default_timezone_get')) { + date_default_timezone_set(date_default_timezone_get()); } // // Build content // ============= -$arrTemplate['STEP1_BOX'] = $myInstClass->translate('Requirements'); -$arrTemplate['STEP2_BOX'] = $myInstClass->translate($_SESSION['install']['mode']); -$arrTemplate['STEP3_BOX'] = $myInstClass->translate('Finish'); -$arrTemplate['STEP3_TITLE'] = "NagiosQL ".$myInstClass->translate($_SESSION['install']['mode']).": ".$myInstClass->translate("Finishing Setup"); -$arrTemplate['INST_VISIBLE'] = "showfield"; -$arrTemplate['STEP4_SUB_TITLE'] = $myInstClass->translate("Deploy NagiosQL settings"); -$arrTemplate['STEP3_TEXT_01'] = $myInstClass->translate("Database server connection (privileged user)"); -$arrTemplate['STEP3_TEXT_03'] = $myInstClass->translate("Database server version"); -$arrTemplate['STEP3_TEXT_05'] = $myInstClass->translate("Database server support"); -$arrTemplate['STEP3_TEXT_07'] = $myInstClass->translate("Delete existing NagiosQL database"); -$arrTemplate['STEP3_TEXT_09'] = $myInstClass->translate("Creating new database"); -$arrTemplate['STEP3_TEXT_11'] = $myInstClass->translate("Installing NagiosQL database tables"); -$arrTemplate['STEP3_TEXT_13'] = $myInstClass->translate("Create NagiosQL database user"); -$arrTemplate['STEP3_TEXT_15'] = $myInstClass->translate("Set initial NagiosQL Administrator"); -$arrTemplate['STEP3_TEXT_17'] = $myInstClass->translate("Database server connection (NagiosQL user)"); -$arrTemplate['STEP4_TEXT_01'] = $myInstClass->translate("Writing global settings to database"); -$arrTemplate['STEP4_TEXT_03'] = $myInstClass->translate("Writing database configuration to settings.php"); -$arrTemplate['STEP4_TEXT_05'] = $myInstClass->translate("Import Nagios sample data"); -$arrTemplate['STEP4_TEXT_07'] = $myInstClass->translate("Create and/or store NagiosQL path settings"); +$arrTemplate['STEP1_BOX'] = $myInstClass->translate('Requirements'); +$arrTemplate['STEP2_BOX'] = $myInstClass->translate('Installation'); +$arrTemplate['STEP3_BOX'] = $myInstClass->translate('Finish'); +$arrTemplate['STEP3_TITLE'] = 'NagiosQL ' .$myInstClass->translate('Installation'). ': ' . + $myInstClass->translate('Finishing Setup'); +$arrTemplate['INST_VISIBLE'] = 'showfield'; +$arrTemplate['STEP4_SUB_TITLE'] = $myInstClass->translate('Deploy NagiosQL settings'); +$arrTemplate['STEP3_TEXT_01'] = $myInstClass->translate('Database server connection (privileged user)'); +$arrTemplate['STEP3_TEXT_03'] = $myInstClass->translate('Database server version'); +$arrTemplate['STEP3_TEXT_05'] = $myInstClass->translate('Database server support'); +$arrTemplate['STEP3_TEXT_07'] = $myInstClass->translate('Delete existing NagiosQL database'); +$arrTemplate['STEP3_TEXT_09'] = $myInstClass->translate('Creating new database'); +$arrTemplate['STEP3_TEXT_11'] = $myInstClass->translate('Installing NagiosQL database tables'); +$arrTemplate['STEP3_TEXT_13'] = $myInstClass->translate('Create NagiosQL database user'); +$arrTemplate['STEP3_TEXT_15'] = $myInstClass->translate('Set initial NagiosQL Administrator'); +$arrTemplate['STEP3_TEXT_17'] = $myInstClass->translate('Database server connection (NagiosQL user)'); +$arrTemplate['STEP4_TEXT_01'] = $myInstClass->translate('Writing global settings to database'); +$arrTemplate['STEP4_TEXT_03'] = $myInstClass->translate('Writing database configuration to settings.php'); +$arrTemplate['STEP4_TEXT_05'] = $myInstClass->translate('Import Nagios sample data'); +$arrTemplate['STEP4_TEXT_07'] = $myInstClass->translate('Create and/or store NagiosQL path settings'); -$arrTemplate['STEP4_VISIBLE'] = "hidefield"; -$arrTemplate['STEP3_TEXT_02_SHOW'] = "hidefield"; -$arrTemplate['STEP3_TEXT_03_SHOW'] = "hidefield"; -$arrTemplate['STEP3_TEXT_05_SHOW'] = "hidefield"; -$arrTemplate['STEP3_TEXT_07_SHOW'] = "hidefield"; -$arrTemplate['STEP3_TEXT_09_SHOW'] = "hidefield"; -$arrTemplate['STEP3_TEXT_11_SHOW'] = "hidefield"; -$arrTemplate['STEP3_TEXT_13_SHOW'] = "hidefield"; -$arrTemplate['STEP3_TEXT_15_SHOW'] = "hidefield"; -$arrTemplate['STEP3_TEXT_17_SHOW'] = "hidefield"; -$arrTemplate['STEP4_TEXT_03_SHOW'] = "hidefield"; -$arrTemplate['STEP4_TEXT_05_SHOW'] = "hidefield"; -$arrTemplate['STEP4_TEXT_07_SHOW'] = "hidefield"; +$arrTemplate['STEP4_VISIBLE'] = 'hidefield'; +$arrTemplate['STEP3_TEXT_02_SHOW'] = 'hidefield'; +$arrTemplate['STEP3_TEXT_03_SHOW'] = 'hidefield'; +$arrTemplate['STEP3_TEXT_05_SHOW'] = 'hidefield'; +$arrTemplate['STEP3_TEXT_07_SHOW'] = 'hidefield'; +$arrTemplate['STEP3_TEXT_09_SHOW'] = 'hidefield'; +$arrTemplate['STEP3_TEXT_11_SHOW'] = 'hidefield'; +$arrTemplate['STEP3_TEXT_13_SHOW'] = 'hidefield'; +$arrTemplate['STEP3_TEXT_15_SHOW'] = 'hidefield'; +$arrTemplate['STEP3_TEXT_17_SHOW'] = 'hidefield'; +$arrTemplate['STEP4_TEXT_03_SHOW'] = 'hidefield'; +$arrTemplate['STEP4_TEXT_05_SHOW'] = 'hidefield'; +$arrTemplate['STEP4_TEXT_07_SHOW'] = 'hidefield'; // // Check any data before installation // ================================== @@ -74,218 +76,233 @@ $intInstError = 0; // // Doing installation/upgrade // ========================== -if ($_SESSION['install']['mode'] == "Update") { - $arrTemplate['STEP3_SUB_TITLE'] = $myInstClass->translate("Updating existing NagiosQL database"); - // - // Include database class - // ====================== - if ($_SESSION['install']['dbtype'] == "mysqli") { - // Include and initialize mysqli class - include("../functions/mysqli_class.php"); - $myDBClass = new mysqlidb; - } else if ($_SESSION['install']['dbtype'] == "pgsql") { - // Include and initialize pgsql class - include("../functions/pgsql_class.php"); - $myDBClass = new pgsqldb; - } else { - $strErrorMessage .= $myInstClass->translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")
\n"; - $strStatusMessage = "".$myInstClass->translate("failed").""; - $intError = 1; - } - // Set DB parameters - $myDBClass->arrParams['server'] = $_SESSION['install']['dbserver']; - $myDBClass->arrParams['port'] = $_SESSION['install']['dbport']; - $myDBClass->arrParams['username'] = $_SESSION['install']['admuser']; - $myDBClass->arrParams['password'] = $_SESSION['install']['admpass']; - $myDBClass->arrParams['database'] = $_SESSION['install']['dbname']; - // Include classes - if ($intError == 0) $myInstClass->myDBClass =& $myDBClass; - // Check database connection - if ($intError == 0) $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'],$strErrorMessage); - if ($intError == 0) $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_02'],$strErrorMessage); - $arrTemplate['STEP3_TEXT_02_SHOW'] = "showfield"; - // Check NagiosQL version - if ($intError == 0) { - $arrTemplate['STEP3_TEXT_03'] = $myInstClass->translate("Installed NagiosQL version"); - $arrTemplate['STEP3_TEXT_03_SHOW'] = "showfield"; - $intError = $myInstClass->checkQLVersion($arrTemplate['STEP3_TEXT_04'],$strErrorMessage,$arrUpdate,$setQLVersion); - } - // Upgrade NagiosQL DB - if ($intError == 0) { - $arrTemplate['STEP3_TEXT_05'] = $myInstClass->translate("Upgrading from version")." ".$setQLVersion." ".$myInstClass->translate("to")." ".$preNagiosQL_ver; - $arrTemplate['STEP3_TEXT_05_SHOW'] = "showfield"; - $intError = $myInstClass->updateQLDB($arrTemplate['STEP3_TEXT_06'],$strErrorMessage,$arrUpdate); - } - if (($_SESSION['install']['dbtype'] == "mysql") && (version_compare($setQLVersion,"3.2.0") == -1)) { - // Converting database to UTF8 - if ($intError == 0) { - $arrTemplate['STEP3_TEXT_07'] = $myInstClass->translate("Converting database to utf8 character set"); - $arrTemplate['STEP3_TEXT_07_SHOW'] = "showfield"; - $intError = $myInstClass->convQLDB($arrTemplate['STEP3_TEXT_08'],$strErrorMessage); - } - // Converting database tables to UTF8 - if ($intError == 0) { - $arrTemplate['STEP3_TEXT_09'] = $myInstClass->translate("Converting database tables to utf8 character set"); - $arrTemplate['STEP3_TEXT_09_SHOW'] = "showfield"; - $intError = $myInstClass->convQLDBTables($arrTemplate['STEP3_TEXT_10'],$strErrorMessage); - } - // Converting database fields to UTF8 - if ($intError == 0) { - $arrTemplate['STEP3_TEXT_11'] = $myInstClass->translate("Converting database fields to utf8 character set"); - $arrTemplate['STEP3_TEXT_11_SHOW'] = "showfield"; - $intError = $myInstClass->convQLDBFields($arrTemplate['STEP3_TEXT_12'],$strErrorMessage); - } - } - // Reconnect Database with new user - if ($intError == 0) { - $arrTemplate['STEP3_TEXT_17_SHOW'] = "showfield"; - $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1); - $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1); - } - // Deploy NagiosQL database settings - if ($intError == 0) { - $arrTemplate['STEP4_VISIBLE'] = "showfield"; - $intError = $myInstClass->updateSettingsDB($arrTemplate['STEP4_TEXT_02'],$strErrorMessage); - } - // Write database settings to file - if ($intError == 0) { - $arrTemplate['STEP4_TEXT_03_SHOW'] = "showfield"; - $intError = $myInstClass->updateSettingsFile($arrTemplate['STEP4_TEXT_04'],$strErrorMessage); - } +if ($_SESSION['install']['mode'] == 'Update') { + $arrTemplate['STEP3_SUB_TITLE'] = $myInstClass->translate('Updating existing NagiosQL database'); + // + // Include database class + // ====================== + if ($_SESSION['install']['dbtype'] == 'mysqli') { + // Initialize mysqli class + $myDBClass = new functions\MysqliDbClass; + } else { + $strErrorMessage .= $myInstClass->translate('Database type not defined!'). ' (' . + $_SESSION['install']['dbtype'].")
\n"; + $strStatusMessage = '' .$myInstClass->translate('failed'). ''; + $intError = 1; + } + // Set DB parameters + $myDBClass->arrParams['server'] = $_SESSION['install']['dbserver']; + $myDBClass->arrParams['port'] = $_SESSION['install']['dbport']; + $myDBClass->arrParams['username'] = $_SESSION['install']['admuser']; + $myDBClass->arrParams['password'] = $_SESSION['install']['admpass']; + $myDBClass->arrParams['database'] = $_SESSION['install']['dbname']; + // Include classes + if ($intError == 0) { + $myInstClass->myDBClass =& $myDBClass; + } + // Check database connection + if ($intError == 0) { + $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'], $strErrorMessage); + } + if ($intError == 0) { + $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_02'], $strErrorMessage); + } + $arrTemplate['STEP3_TEXT_02_SHOW'] = 'showfield'; + // Check NagiosQL version + if ($intError == 0) { + $arrTemplate['STEP3_TEXT_03'] = $myInstClass->translate('Installed NagiosQL version'); + $arrTemplate['STEP3_TEXT_03_SHOW'] = 'showfield'; + $intError = $myInstClass->checkQLVersion( + $arrTemplate['STEP3_TEXT_04'], + $strErrorMessage, + $arrUpdate, + $setQLVersion + ); + } + // Upgrade NagiosQL DB + if ($intError == 0) { + $arrTemplate['STEP3_TEXT_05'] = $myInstClass->translate('Upgrading from version'). ' ' .$setQLVersion + . ' ' . $myInstClass->translate('to'). ' ' .$preNagiosQL_ver; + $arrTemplate['STEP3_TEXT_05_SHOW'] = 'showfield'; + $intError = $myInstClass->updateQLDB($arrTemplate['STEP3_TEXT_06'], $strErrorMessage, $arrUpdate); + } + if (($_SESSION['install']['dbtype'] == 'mysql') && (version_compare($setQLVersion, '3.4.0') == -1)) { + // Converting database to UTF8 + if ($intError == 0) { + $arrTemplate['STEP3_TEXT_07'] = $myInstClass->translate('Converting database to utf8 character set'); + $arrTemplate['STEP3_TEXT_07_SHOW'] = 'showfield'; + $intError = $myInstClass->convQLDB($arrTemplate['STEP3_TEXT_08'], $strErrorMessage); + } + // Converting database tables to UTF8 + if ($intError == 0) { + $arrTemplate['STEP3_TEXT_09'] = $myInstClass->translate('Converting database tables to utf8 character ' + . 'set'); + $arrTemplate['STEP3_TEXT_09_SHOW'] = 'showfield'; + $intError = $myInstClass->convQLDBTables($arrTemplate['STEP3_TEXT_10'], $strErrorMessage); + } + // Converting database fields to UTF8 + if ($intError == 0) { + $arrTemplate['STEP3_TEXT_11'] = $myInstClass->translate('Converting database fields to utf8 ' + . 'character set'); + $arrTemplate['STEP3_TEXT_11_SHOW'] = 'showfield'; + $intError = $myInstClass->convQLDBFields($arrTemplate['STEP3_TEXT_12'], $strErrorMessage); + } + } + // Reconnect Database with new user + if ($intError == 0) { + $arrTemplate['STEP3_TEXT_17_SHOW'] = 'showfield'; + $intError1 = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_18'], $strErrorMessage, 1); + $intError2 = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_18'], $strErrorMessage, 1); + $intError = $intError1 + $intError2; + } + // Deploy NagiosQL database settings + if ($intError == 0) { + $arrTemplate['STEP4_VISIBLE'] = 'showfield'; + $intError = $myInstClass->updateSettingsDB($arrTemplate['STEP4_TEXT_02'], $strErrorMessage); + } + // Write database settings to file + if ($intError == 0) { + $arrTemplate['STEP4_TEXT_03_SHOW'] = 'showfield'; + $intError = $myInstClass->updateSettingsFile($arrTemplate['STEP4_TEXT_04'], $strErrorMessage); + } } else { - $arrTemplate['STEP3_SUB_TITLE'] = $myInstClass->translate("Create new NagiosQL database"); - // - // Include database class - // ====================== - if ($_SESSION['install']['dbtype'] == "mysqli") { - // Include and initialize mysqli class - include("../functions/mysqli_class.php"); - $myDBClass = new mysqlidb; - } else if ($_SESSION['install']['dbtype'] == "pgsql") { - // Include and initialize pgsql class - include("../functions/pgsql_class.php"); - $myDBClass = new pgsqldb; - //} else if ($_SESSION['install']['dbtype'] == "sqlite3") { - // // Include sqlite3 and initialize class - // include("../functions/sqlite3_class.php"); - // $myDBClass = new sqlite3db; - } else { - $strErrorMessage .= $myInstClass->translate("Database type not defined!")." (".$_SESSION['install']['dbtype'].")
\n"; - $strStatusMessage = "".$myInstClass->translate("failed").""; - $intError = 1; - } - // Set DB parameters - $myDBClass->arrParams['server'] = $_SESSION['install']['dbserver']; - $myDBClass->arrParams['port'] = $_SESSION['install']['dbport']; - $myDBClass->arrParams['username'] = $_SESSION['install']['admuser']; - $myDBClass->arrParams['password'] = $_SESSION['install']['admpass']; - $myDBClass->arrParams['database'] = $_SESSION['install']['dbname']; - // Include classes - if ($intError == 0) $myInstClass->myDBClass =& $myDBClass; - // Check database connection - $intOldDBStatus = 0; - if ($intError == 0) $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'],$strErrorMessage); - // Does the database already exist? - if ($intError == 0) { - $intOldDBStatus = $myInstClass->openDatabase($strTmpMessage,$strTmpError); - $myDBClass->strErrorMessage = ""; - if (($intOldDBStatus == 0) && ($_SESSION['install']['dbdrop'] == 0)) { - $strErrorMessage .= $myInstClass->translate("Database already exists and drop database was not selected, please correct or manage manually")."
"; - $arrTemplate['STEP3_TEXT_02'] = "".$myInstClass->translate("failed").""; - $intError = 1; - } else { - $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'],$strErrorMessage); - } - } - $arrTemplate['STEP3_TEXT_02_SHOW'] = "showfield"; - $arrTemplate['STEP3_TEXT_02'] .= " (".$_SESSION['install']['dbtype'].")"; - // Check database version - if ($intError == 0) { - $arrTemplate['STEP3_TEXT_03_SHOW'] = "showfield"; - $arrTemplate['STEP3_TEXT_05_SHOW'] = "showfield"; - $intError = $myInstClass->checkDBVersion($arrTemplate['STEP3_TEXT_06'],$strErrorMessage,$strVersion); - if ($strVersion == "unknown") { - $arrTemplate['STEP3_TEXT_04'] = "".$myInstClass->translate("unknown").""; - } else { - $arrTemplate['STEP3_TEXT_04'] = "".$strVersion.""; - } - } - // Drop existing database - if (($intError == 0) && ($_SESSION['install']['dbdrop'] == 1) && ($intOldDBStatus == 0)) { - $arrTemplate['STEP3_TEXT_07_SHOW'] = "showfield"; - $intError = $myInstClass->dropDB($arrTemplate['STEP3_TEXT_08'],$strErrorMessage); - } - // Create new database - if ($intError == 0) { - $arrTemplate['STEP3_TEXT_09_SHOW'] = "showfield"; - $intError = $myInstClass->createDB($arrTemplate['STEP3_TEXT_10'],$strErrorMessage); - echo $strErrorMessage; - } - // Write initial SQL data to database - if ($intError == 0) $intError = $myInstClass->openDatabase($strTmp,$strErrorMessage); - if ($intError == 0) { - $arrTemplate['STEP3_TEXT_11_SHOW'] = "showfield"; - $arrInsert[] = $preSqlNewInstall; - $intError = $myInstClass->updateQLDB($arrTemplate['STEP3_TEXT_12'],$strErrorMessage,$arrInsert); - } - // Grant NagiosQL database user - if ($intError == 0) { - $arrTemplate['STEP3_TEXT_13_SHOW'] = "showfield"; - $intError = $myInstClass->grantDBUser($arrTemplate['STEP3_TEXT_14'],$strErrorMessage); - } - // Create NagiosQL admin user - if ($intError == 0) { - $arrTemplate['STEP3_TEXT_15_SHOW'] = "showfield"; - $intError = $myInstClass->createNQLAdmin($arrTemplate['STEP3_TEXT_16'],$strErrorMessage); - } - // Reconnect Database with new user - if ($intError == 0) { - $myDBClass->arrParams['username'] = $_SESSION['install']['dbuser']; - $myDBClass->arrParams['password'] = $_SESSION['install']['dbpass']; - $arrTemplate['STEP3_TEXT_17_SHOW'] = "showfield"; - if ($intError == 0) $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1); - if ($intError == 0) $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_18'],$strErrorMessage,1); - } - // Deploy NagiosQL settings - if ($intError == 0) { - $arrTemplate['STEP4_VISIBLE'] = "showfield"; - $intError = $myInstClass->updateSettingsDB($arrTemplate['STEP4_TEXT_02'],$strErrorMessage); - } - // Write database settings to file - if ($intError == 0) { - $arrTemplate['STEP4_TEXT_03_SHOW'] = "showfield"; - $intError = $myInstClass->updateSettingsFile($arrTemplate['STEP4_TEXT_04'],$strErrorMessage); - } - // Write sample data to database - if (($intError == 0) && ($_SESSION['install']['sample'] == 1)) { - $arrTemplate['STEP4_TEXT_05_SHOW'] = "showfield"; - $arrSample[] = "sql/import_nagios_sample.sql"; - $intError = $myInstClass->updateQLDB($arrTemplate['STEP4_TEXT_06'],$strErrorMessage,$arrSample); - } - // Create NagiosQL path and write path settings to the database - if ($intError == 0) { - $arrTemplate['STEP4_TEXT_07_SHOW'] = "showfield"; - $intError = $myInstClass->updateQLpath($arrTemplate['STEP4_TEXT_08'],$strErrorMessage); - } + $arrTemplate['STEP3_SUB_TITLE'] = $myInstClass->translate('Create new NagiosQL database'); + // + // Include database class + // ====================== + if ($_SESSION['install']['dbtype'] == 'mysqli') { + // Initialize mysqli class + $myDBClass = new functions\MysqliDbClass; + } else { + $strErrorMessage .= $myInstClass->translate('Database type not defined!'). ' (' . + $_SESSION['install']['dbtype'].")
\n"; + $strStatusMessage = '' .$myInstClass->translate('failed'). ''; + $intError = 1; + } + // Set DB parameters + $myDBClass->arrParams['server'] = $_SESSION['install']['dbserver']; + $myDBClass->arrParams['port'] = $_SESSION['install']['dbport']; + $myDBClass->arrParams['username'] = $_SESSION['install']['admuser']; + $myDBClass->arrParams['password'] = $_SESSION['install']['admpass']; + $myDBClass->arrParams['database'] = $_SESSION['install']['dbname']; + // Include classes + if ($intError == 0) { + $myInstClass->myDBClass =& $myDBClass; + } + // Check database connection + $intOldDBStatus = 0; + if ($intError == 0) { + $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'], $strErrorMessage); + } + // Does the database already exist? + if ($intError == 0) { + $intOldDBStatus = $myInstClass->openDatabase($strTmpMessage, $strTmpError); + $myDBClass->strErrorMessage = ''; + if (($intOldDBStatus == 0) && ($_SESSION['install']['dbdrop'] == 0)) { + $strErrorMessage .= $myInstClass->translate('Database already exists and drop database was not ' + . 'selected, please correct or manage manually'). '
'; + $arrTemplate['STEP3_TEXT_02'] = '' .$myInstClass->translate('failed'). ''; + $intError = 1; + } else { + $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_02'], $strErrorMessage); + } + } + $arrTemplate['STEP3_TEXT_02_SHOW'] = 'showfield'; + $arrTemplate['STEP3_TEXT_02'] .= ' (' .$_SESSION['install']['dbtype']. ')'; + // Check database version + if ($intError == 0) { + $arrTemplate['STEP3_TEXT_03_SHOW'] = 'showfield'; + $arrTemplate['STEP3_TEXT_05_SHOW'] = 'showfield'; + $intError = $myInstClass->checkDBVersion($arrTemplate['STEP3_TEXT_06'], $strErrorMessage, $strVersion); + if ($strVersion == 'unknown') { + $arrTemplate['STEP3_TEXT_04'] = '' .$myInstClass->translate('unknown'). ''; + } else { + $arrTemplate['STEP3_TEXT_04'] = '' .$strVersion. ''; + } + } + // Drop existing database + if (($intError == 0) && ($_SESSION['install']['dbdrop'] == 1) && ($intOldDBStatus == 0)) { + $arrTemplate['STEP3_TEXT_07_SHOW'] = 'showfield'; + $intError = $myInstClass->dropDB($arrTemplate['STEP3_TEXT_08'], $strErrorMessage); + } + // Create new database + if ($intError == 0) { + $arrTemplate['STEP3_TEXT_09_SHOW'] = 'showfield'; + $intError = $myInstClass->createDB($arrTemplate['STEP3_TEXT_10'], $strErrorMessage); + } + // Write initial SQL data to database + if ($intError == 0) { + $intError = $myInstClass->openDatabase($strTmp, $strErrorMessage); + } + if ($intError == 0) { + $arrTemplate['STEP3_TEXT_11_SHOW'] = 'showfield'; + $arrInsert[] = $preSqlNewInstall; + $intError = $myInstClass->updateQLDB($arrTemplate['STEP3_TEXT_12'], $strErrorMessage, $arrInsert); + } + // Grant NagiosQL database user + if ($intError == 0) { + $arrTemplate['STEP3_TEXT_13_SHOW'] = 'showfield'; + $intError = $myInstClass->grantDBUser($arrTemplate['STEP3_TEXT_14'], $strErrorMessage); + } + // Create NagiosQL admin user + if ($intError == 0) { + $arrTemplate['STEP3_TEXT_15_SHOW'] = 'showfield'; + $intError = $myInstClass->createNQLAdmin($arrTemplate['STEP3_TEXT_16'], $strErrorMessage); + } + // Reconnect Database with new user + if ($intError == 0) { + $myDBClass->arrParams['username'] = $_SESSION['install']['dbuser']; + $myDBClass->arrParams['password'] = $_SESSION['install']['dbpass']; + $arrTemplate['STEP3_TEXT_17_SHOW'] = 'showfield'; + if ($intError == 0) { + $intError = $myInstClass->openAdmDBSrv($arrTemplate['STEP3_TEXT_18'], $strErrorMessage, 1); + } + if ($intError == 0) { + $intError = $myInstClass->openDatabase($arrTemplate['STEP3_TEXT_18'], $strErrorMessage, 1); + } + } + // Deploy NagiosQL settings + if ($intError == 0) { + $arrTemplate['STEP4_VISIBLE'] = 'showfield'; + $intError = $myInstClass->updateSettingsDB($arrTemplate['STEP4_TEXT_02'], $strErrorMessage); + } + // Write database settings to file + if ($intError == 0) { + $arrTemplate['STEP4_TEXT_03_SHOW'] = 'showfield'; + $intError = $myInstClass->updateSettingsFile($arrTemplate['STEP4_TEXT_04'], $strErrorMessage); + } + // Write sample data to database + if (($intError == 0) && ($_SESSION['install']['sample'] == 1)) { + $arrTemplate['STEP4_TEXT_05_SHOW'] = 'showfield'; + $arrSample[] = 'sql/import_nagios_sample.sql'; + $intError = $myInstClass->updateQLDB($arrTemplate['STEP4_TEXT_06'], $strErrorMessage, $arrSample); + } + // Create NagiosQL path and write path settings to the database + if ($intError == 0) { + $arrTemplate['STEP4_TEXT_07_SHOW'] = 'showfield'; + $intError = $myInstClass->updateQLpath($arrTemplate['STEP4_TEXT_08'], $strErrorMessage); + } } if ($intError != 0) { - $arrTemplate['ERRORMESSAGE'] = "

".$strErrorMessage."

\n"; - $arrTemplate['INFO_TEXT'] = ""; - $arrTemplate['BUTTON'] = "
\n"; - $arrTemplate['BUTTON'] .= "\n"; - $arrTemplate['BUTTON'] .= "
".$myInstClass->translate("Back")."\n"; - $arrTemplate['BUTTON'] .= "
\n"; + $arrTemplate['ERRORMESSAGE'] = '

' . + $strErrorMessage."

\n"; + $arrTemplate['INFO_TEXT'] = ''; + $arrTemplate['BUTTON'] = "
\n"; + $arrTemplate['BUTTON'] .= "\n"; + $arrTemplate['BUTTON'] .= "" + . '
' .$myInstClass->translate('Back')."\n"; + $arrTemplate['BUTTON'] .= "
\n"; } else { - $arrTemplate['ERRORMESSAGE'] = ""; - $arrTemplate['INST_VISIBLE'] = "showfield"; - $arrTemplate['INFO_TEXT'] = $myInstClass->translate("Please delete the install directory to continue!"); - $arrTemplate['BUTTON'] = "
\n"; - $arrTemplate['BUTTON'] .= "finish
".$myInstClass->translate("Finish")."\n"; - $arrTemplate['BUTTON'] .= "
\n"; + $arrTemplate['ERRORMESSAGE'] = ''; + $arrTemplate['INST_VISIBLE'] = 'showfield'; + $arrTemplate['INFO_TEXT'] = $myInstClass->translate('Please delete the install directory to continue!'); + $arrTemplate['BUTTON'] = "
\n"; + $arrTemplate['BUTTON'] .= "finish
".$myInstClass->translate('Finish')."\n"; + $arrTemplate['BUTTON'] .= "
\n"; } // // Write content // ============= -$strContent = $myInstClass->parseTemplate($arrTemplate,$preIncludeContent); +$strContent = $myInstClass->parseTemplate($arrTemplate, $preIncludeContent); echo $strContent; -?> \ No newline at end of file diff --git a/install/templates/index.htm.tpl b/install/templates/index.htm.tpl new file mode 100644 index 0000000..59bbe85 --- /dev/null +++ b/install/templates/index.htm.tpl @@ -0,0 +1,88 @@ + + + + + + + + + + + + {PAGETITLE} + + + +
+
+ +
+
+
+

{MAIN_TITLE}

+
{TEXT_PART_1}
{TEXT_PART_2}NagiosQL @ Sourceforge
+

{TEXT_PART_9}
+
+

{TEXT_PART_3}

+

{TEXT_PART_4}

+
    +
  • {TEXT_PART_5}
  • +
      +
    • {TEXT_PHP_REQ_1}
    • +
    • {TEXT_PHP_REQ_2}
    • +
    • {TEXT_PHP_REQ_3}
    • +
    • {TEXT_PHP_REQ_6}
    • +
    • {TEXT_PHP_REQ_8}
    • +
    • {TEXT_PHP_REQ_10}
    • +
    +
+
    +
  • {TEXT_PART_6}
  • +
      +
    • {TEXT_INI_REQ_1}
    • +
    • {TEXT_INI_REQ_2}
    • +
    +
+
    +
  • {TEXT_PART_7}
  • +
  • {TEXT_PART_8}
  • +
+ {UPDATE_ERROR} +
+ + + +

+

+

{ONLINE_DOC}

+
+
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/install/templates/index.tpl.htm b/install/templates/index.tpl.htm deleted file mode 100644 index 0816bbf..0000000 --- a/install/templates/index.tpl.htm +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - {PAGETITLE} - - - -
-
- -
-
-
-

{MAIN_TITLE}

-
{TEXT_PART_1}
{TEXT_PART_2}www.nagiosql.org
-

{TEXT_PART_9}

-
-

{TEXT_PART_3}

-

{TEXT_PART_4}

-
    -
  • {TEXT_PART_5}
  • -
      -
    • {TEXT_PHP_REQ_1}
    • -
    • {TEXT_PHP_REQ_2}
    • -
    • {TEXT_PHP_REQ_3}
    • -
    • {TEXT_PHP_REQ_6}
    • -
    • {TEXT_PHP_REQ_8}
    • -
    • {TEXT_PHP_REQ_10}
    • -
    -
-
    -
  • {TEXT_PART_6}
  • -
      -
    • {TEXT_INI_REQ_1}
    • -
    • {TEXT_INI_REQ_2}
    • -
    -
-
    -
  • {TEXT_PART_7}
  • -
  • {TEXT_PART_8}
  • -
- {UPDATE_ERROR} -
- - - -

-

-

{ONLINE_DOC}

-
-
-
- -
-
-
- - - \ No newline at end of file diff --git a/install/templates/install.htm.tpl b/install/templates/install.htm.tpl new file mode 100644 index 0000000..b9aa0c4 --- /dev/null +++ b/install/templates/install.htm.tpl @@ -0,0 +1,35 @@ + + + + + + + + + + + + {PAGETITLE} + + + +
+
+ +
+ {CONTENT} +
+ +
+
+ + \ No newline at end of file diff --git a/install/templates/install.tpl.htm b/install/templates/install.tpl.htm deleted file mode 100644 index bdad9be..0000000 --- a/install/templates/install.tpl.htm +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - {PAGETITLE} - - - -
-
- -
- {CONTENT} -
- -
-
- - \ No newline at end of file diff --git a/install/templates/step1.tpl.htm b/install/templates/step1.htm.tpl similarity index 66% rename from install/templates/step1.tpl.htm rename to install/templates/step1.htm.tpl index b249304..8327a7a 100644 --- a/install/templates/step1.tpl.htm +++ b/install/templates/step1.htm.tpl @@ -1,12 +1,10 @@ - + - - - - - - - + + + + +



{STEP1_BOX}

@@ -15,8 +13,8 @@
-
-

{STEP1_TITLE}

+
+

{STEP1_TITLE}

{STEP1_SUBTITLE1}

{CHECK_1_PIC} Javascript: {CHECK_1_VALUE}{CHECK_1_INFO}

{STEP1_SUBTITLE2}

@@ -45,16 +43,16 @@ {MESSAGE}
-
- - {FORM_CONTENT} -
-
-
+
+ + {FORM_CONTENT} +
+
+
-
\ No newline at end of file diff --git a/install/templates/step2.htm.tpl b/install/templates/step2.htm.tpl new file mode 100644 index 0000000..542c6a4 --- /dev/null +++ b/install/templates/step2.htm.tpl @@ -0,0 +1,172 @@ + + + + + + + + +
+
+



{STEP1_BOX}

+



{STEP2_BOX}

+



{STEP3_BOX}

+
+
+
+
+

{STEP2_TITLE}

+
+

{STEP2_TEXT1_1}:

+ {STEP2_TEXT1_2} +
+ {STEP2_TEXT2_1} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{STEP2_TEXT2_2} * + +
{STEP2_TEXT2_3} *
{STEP2_TEXT2_4} *
{STEP2_TEXT2_5} *
{STEP2_TEXT2_6} *
{STEP2_TEXT2_7} *
{STEP2_TEXT2_8} *
{STEP2_TEXT2_9} *
{STEP2_TEXT2_10} *
{STEP2_TEXT2_11}
+
+
+ {STEP2_TEXT3_1} + + + + + + + + + + + + + +
{STEP2_TEXT3_2} *
{STEP2_TEXT3_3} *
{STEP2_TEXT3_4} *
+
+
+ {STEP2_TEXT4_1} + + + + + +
{STEP2_TEXT4_2}
+
+
+ {STEP2_TEXT5_1} + + + + + + + + + + + + + + + + +
{STEP2_TEXT5_2}
{STEP2_TEXT5_3}
{STEP2_TEXT5_4}
{STEP2_TEXT5_5}
{STEP2_TEXT5_6}
+
+
+
+ + {STEP2_FORM_1}
{STEP2_FORM_1} +
+
+
+
+
\ No newline at end of file diff --git a/install/templates/step2.tpl.htm b/install/templates/step2.tpl.htm deleted file mode 100644 index d9a21dc..0000000 --- a/install/templates/step2.tpl.htm +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - - - - -
-
-



{STEP1_BOX}

-



{STEP2_BOX}

-



{STEP3_BOX}

-
-
-
-
-

{STEP2_TITLE}

-
-

{STEP2_TEXT1_1}:

- {STEP2_TEXT1_2} -
- {STEP2_TEXT2_1} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{STEP2_TEXT2_2} * - -
{STEP2_TEXT2_3} *
{STEP2_TEXT2_4} *
{STEP2_TEXT2_5} *
{STEP2_TEXT2_6} *
{STEP2_TEXT2_7} *
{STEP2_TEXT2_8} *
{STEP2_TEXT2_9} *
{STEP2_TEXT2_10} *
{STEP2_TEXT2_11}
-
-
- {STEP2_TEXT3_1} - - - - - - - - - - - - - -
{STEP2_TEXT3_2} *
{STEP2_TEXT3_3} *
{STEP2_TEXT3_4} *
-
-
- {STEP2_TEXT4_1} - - - - - -
{STEP2_TEXT4_2}
-
-
- {STEP2_TEXT5_1} - - - - - - - - - - - - - - - - -
{STEP2_TEXT5_2}
{STEP2_TEXT5_3}
{STEP2_TEXT5_4}
{STEP2_TEXT5_5}
{STEP2_TEXT5_6}
-
-
-
- - {STEP2_FORM_1}
{STEP2_FORM_1} -
-
-
-
-
\ No newline at end of file diff --git a/install/templates/step3.htm.tpl b/install/templates/step3.htm.tpl new file mode 100644 index 0000000..a768db0 --- /dev/null +++ b/install/templates/step3.htm.tpl @@ -0,0 +1,88 @@ + + + + + + + +
+
+



{STEP1_BOX}

+



{STEP2_BOX}

+



{STEP3_BOX}

+
+
+
+
+

{STEP3_TITLE}

+
+
+ {STEP3_SUB_TITLE} + {ERRORMESSAGE} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{STEP3_TEXT_02}
{STEP3_TEXT_04}
{STEP3_TEXT_06}
{STEP3_TEXT_08}
{STEP3_TEXT_10}
{STEP3_TEXT_12}
{STEP3_TEXT_14}
{STEP3_TEXT_16}
{STEP3_TEXT_18}
+
+
+
+ {STEP4_SUB_TITLE} + + + + + + + + + + + + + + + + + +
{STEP4_TEXT_02}
{STEP4_TEXT_04}
{STEP4_TEXT_06}
{STEP4_TEXT_08}
+
+

{INFO_TEXT}

+ {BUTTON} +
+
+
+
\ No newline at end of file diff --git a/install/templates/step3.tpl.htm b/install/templates/step3.tpl.htm deleted file mode 100644 index 474022e..0000000 --- a/install/templates/step3.tpl.htm +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - -
-
-



{STEP1_BOX}

-



{STEP2_BOX}

-



{STEP3_BOX}

-
-
-
-
-

{STEP3_TITLE}

-
-
- {STEP3_SUB_TITLE} - {ERRORMESSAGE} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{STEP3_TEXT_02}
{STEP3_TEXT_04}
{STEP3_TEXT_06}
{STEP3_TEXT_08}
{STEP3_TEXT_10}
{STEP3_TEXT_12}
{STEP3_TEXT_14}
{STEP3_TEXT_16}
{STEP3_TEXT_18}
-
-
-
- {STEP4_SUB_TITLE} - - - - - - - - - - - - - - - - - -
{STEP4_TEXT_02}
{STEP4_TEXT_04}
{STEP4_TEXT_06}
{STEP4_TEXT_08}
-
-

{INFO_TEXT}

- {BUTTON} -
-
-
-
\ No newline at end of file diff --git a/scripts/do_config.php b/scripts/do_config.php index 3e8912f..c621d32 100644 --- a/scripts/do_config.php +++ b/scripts/do_config.php @@ -6,15 +6,13 @@ // /////////////////////////////////////////////////////////////////////////////// // -// (c) 2005-2017 by Martin Willisegger +// (c) 2005-2018 by Martin Willisegger // // Project : NagiosQL // Component : Configuration scripting interface -// Website : http://www.nagiosql.org -// Date : $LastChangedDate: 2017-06-22 09:29:35 +0200 (Thu, 22 Jun 2017) $ -// Author : $LastChangedBy: martin $ -// Version : 3.3.0 -// Revision : $LastChangedRevision: 2 $ +// Website : https://sourceforge.net/projects/nagiosql/ +// Version : 3.4.0 +// GIT Repo : https://gitlab.com/wizonet/NagiosQL // /////////////////////////////////////////////////////////////////////////////// // @@ -24,262 +22,271 @@ exit; // // Include preprocessing file // ========================== -$preAccess = 0; -$preNoMain = 1; -require(str_replace("scripts","",dirname(__FILE__)) ."functions/prepend_scripting.php"); +$preAccess = 0; +$preNoMain = 1; +require str_replace('scripts', '', __DIR__) . 'functions/prepend_scripting.php'; // // Process post parameters // ======================= -$argFunction = isset($argv[1]) ? htmlspecialchars($argv[1], ENT_QUOTES, 'utf-8') : "none"; -$argDomain = isset($argv[2]) ? htmlspecialchars($argv[2], ENT_QUOTES, 'utf-8') : "none"; -$argObject = isset($argv[3]) ? htmlspecialchars($argv[3], ENT_QUOTES, 'utf-8') : "none"; -if ((($argFunction == "none") || ($argDomain == "none")) || (($argFunction == "write") && ($argObject == "none")) || - (($argFunction != "write") && ($argFunction != "check") && ($argFunction != "restart") && ($argFunction != "import"))){ - echo "Usage: ".htmlspecialchars($argv[0], ENT_QUOTES, 'utf-8')." function domain [object]\n"; - echo "function = write/check/restart/import\n"; - echo "domain = domain name like 'localhost'\n"; - echo "object = object name, see below:\n"; - echo "import: object = file name like 'hostgroups.cfg' or 'localhost.cfg'\n"; - echo "write: object = table name like 'tbl_contact' or simplier 'contact' without 'tbl_'\n"; - echo "Attention: import function replaces existing data!\n"; - echo "Note that the new backup and configuration files becomes the UID/GID\nfrom the calling user and probably can't be deleted via web GUI anymore!\n"; - exit(1); +$argFunction = isset($argv[1]) ? htmlspecialchars($argv[1], ENT_QUOTES, 'utf-8') : 'none'; +$argDomain = isset($argv[2]) ? htmlspecialchars($argv[2], ENT_QUOTES, 'utf-8') : 'none'; +$argObject = isset($argv[3]) ? htmlspecialchars($argv[3], ENT_QUOTES, 'utf-8') : 'none'; +if ((($argFunction == 'none') || ($argDomain == 'none')) || (($argFunction == 'write') && ($argObject == 'none')) || + (($argFunction != 'write') && ($argFunction != 'check') && ($argFunction != 'restart') && + ($argFunction != 'import'))) { + echo 'Usage: ' .htmlspecialchars($argv[0], ENT_QUOTES, 'utf-8')." function domain [object]\n"; + echo "function = write/check/restart/import\n"; + echo "domain = domain name like 'localhost'\n"; + echo "object = object name, see below:\n"; + echo "import: object = file name like 'hostgroups.cfg' or 'localhost.cfg'\n"; + echo "write: object = table name like 'tbl_contact' or simplier 'contact' without 'tbl_'\n"; + echo "Attention: import function replaces existing data!\n"; + echo "Note that the new backup and configuration files becomes the UID/GID\nfrom the calling user and probably "; + echo "can't be deleted via web GUI anymore!\n"; + exit(1); } // // Get domain ID // ============= -$strSQL = "SELECT `targets` FROM `tbl_datadomain` WHERE `domain`='$argDomain'"; -$intTarget = $myDBClass->getFieldData($strSQL); -$strSQL = "SELECT `id` FROM `tbl_datadomain` WHERE `domain`='$argDomain'"; -$intDomain = $myDBClass->getFieldData($strSQL); -if ($intDomain == "") { - echo "Domain '".$argDomain."' doesn not exist\n"; - exit(1); -} else if ($intDomain == "0") { - echo "Domain '".$argDomain."' cannot be used\n"; - exit(1); -} else { - $myDataClass->intDomainId = $intDomain; - $myConfigClass->intDomainId = $intDomain; - $myImportClass->intDomainId = $intDomain; +/** @var \functions\MysqliDbClass $myDBClass */ +$strSQL = "SELECT `targets` FROM `tbl_datadomain` WHERE `domain`='$argDomain'"; +$intTarget = $myDBClass->getFieldData($strSQL); +$strSQL = "SELECT `id` FROM `tbl_datadomain` WHERE `domain`='$argDomain'"; +$intDomain = $myDBClass->getFieldData($strSQL); +if ($intDomain == '') { + echo "Domain '".$argDomain."' doesn not exist\n"; + exit(1); } -$myConfigClass->getConfigData($intTarget,"method",$intMethod); +if ($intDomain == '0') { + echo "Domain '".$argDomain."' cannot be used\n"; + exit(1); +} +$myDataClass->intDomainId = $intDomain; +$myConfigClass->intDomainId = $intDomain; +$myImportClass->intDomainId = $intDomain; +$myConfigClass->getConfigData($intTarget, 'method', $intMethod); // // Process form variables // ====================== -if ($argFunction == "check") { - $myConfigClass->getConfigData($intTarget,"binaryfile",$strBinary); - $myConfigClass->getConfigData($intTarget,"basedir",$strBaseDir); - $myConfigClass->getConfigData($intTarget,"nagiosbasedir",$strNagiosBaseDir); - $myConfigClass->getConfigData($intTarget,"conffile",$strConffile); - if ($intMethod == 1) { - if (file_exists($strBinary) && is_executable($strBinary)) { - $resFile = popen($strBinary." -v ".$strConffile,"r"); - } else { - echo "Cannot find the Nagios binary or no rights for execution!\n"; - exit(1); - } - } else if ($intMethod == 2) { - $booReturn = 0; - if (!isset($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { - $booReturn = $myConfigClass->getFTPConnection($intTarget); - } - if ($booReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - $intErrorReporting = error_reporting(); - error_reporting(0); - if (!($resFile = ftp_exec($myConfigClass->resConnectId,$strBinary.' -v '.$strConffile))) { - echo "Remote execution (FTP SITE EXEC) is not supported on your system!\n"; - error_reporting($intErrorReporting); - exit(1); - } - ftp_close($conn_id); - error_reporting($intErrorReporting); - } - } else if ($intMethod == 3) { - $booReturn = 0; - if (!isset($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { - $booReturn = $myConfigClass->getSSHConnection($intTarget); - } - if ($booReturn == 1) { - echo "SSH connection failure: ".str_replace("::","\n",$myConfigClass->strErrorMessage); - exit(1); - } else { - if ((is_array($myConfigClass->sendSSHCommand('ls '.$strBinary))) && - (is_array($myConfigClass->sendSSHCommand('ls '.$strConffile)))) { - $arrResult = $myConfigClass->sendSSHCommand($strBinary.' -v '.$strConffile); - if (!is_array($arrResult) || ($arrResult == false)) { - echo "Remote execution of nagios verify command failed (remote SSH)!\n"; - exit(1); - } - } else { - echo "Nagios binary or configuration file not found (remote SSH)!\n"; - exit(1); - } - } - } +if ($argFunction == 'check') { + $myConfigClass->getConfigData($intTarget, 'binaryfile', $strBinary); + $myConfigClass->getConfigData($intTarget, 'basedir', $strBaseDir); + $myConfigClass->getConfigData($intTarget, 'nagiosbasedir', $strNagiosBaseDir); + $myConfigClass->getConfigData($intTarget, 'conffile', $strConffile); + if ($intMethod == 1) { + if (file_exists($strBinary) && is_executable($strBinary)) { + $resFile = popen($strBinary. ' -v ' .$strConffile, 'r'); + } else { + echo "Cannot find the Nagios binary or no execute permissions!\n"; + exit(1); + } + } elseif ($intMethod == 2) { + $booReturn = 0; + if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { + $booReturn = $myConfigClass->getFTPConnection($intTarget); + } + if ($booReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $intErrorReporting = error_reporting(); + error_reporting(0); + if (!($resFile = ftp_exec($myConfigClass->resConnectId, $strBinary.' -v '.$strConffile))) { + echo "Remote execution (FTP SITE EXEC) is not supported on your system!\n"; + error_reporting($intErrorReporting); + exit(1); + } + ftp_close($conn_id); + error_reporting($intErrorReporting); + } + } elseif ($intMethod == 3) { + $booReturn = 0; + if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { + $booReturn = $myConfigClass->getSSHConnection($intTarget); + } + if ($booReturn == 1) { + echo 'SSH connection failure: ' .str_replace('::', "\n", $myConfigClass->strErrorMessage); + exit(1); + } + $intRet1 = $myConfigClass->sendSSHCommand('ls '.$strBinary, $arrRet1); + $intRet2 = $myConfigClass->sendSSHCommand('ls '.$strConffile, $arrRet2); + if (($intRet1 == 0) && ($intRet2 == 0) && is_array($arrRet1) && is_array($arrRet2)) { + $intRet3 = $myConfigClass->sendSSHCommand($strBinary.' -v '.$strConffile, $arrResult); + if ($intRet3 != 0) { + echo "Remote execution of nagios verify command failed (remote SSH)!\n"; + exit(1); + } + } else { + echo "Nagios binary or configuration file not found (remote SSH)!\n"; + exit(1); + } + } } -if ($argFunction == "restart") { - // Read config file - $myConfigClass->getConfigData($intTarget,"commandfile",$strCommandfile); - $myConfigClass->getConfigData($intTarget,"pidfile",$strPidfile); - // Check state nagios demon - clearstatcache(); - if ($intMethod == 1) { - if (file_exists($strPidfile)) { - if (file_exists($strCommandfile) && is_writable($strCommandfile)) { - $strCommandString = "[".time()."] RESTART_PROGRAM;".time()."\n"; - $timeout = 3; - $old = ini_set('default_socket_timeout', $timeout); - $resCmdFile = fopen($strCommandfile,"w"); - ini_set('default_socket_timeout', $old); - stream_set_timeout($resCmdFile, $timeout); - stream_set_blocking($resCmdFile, 0); - if ($resCmdFile) { - fputs($resCmdFile,$strCommandString); - fclose($resCmdFile); - echo "Restart command successfully send to Nagios\n"; - exit(0); - } - } - echo "Restart failed - Nagios command file not found or no rights to execute\n"; - exit(1); - } else { - echo "Nagios daemon is not running, cannot send restart command!\n"; - exit(1); - } - } else if ($intMethod == 2) { - echo "Nagios restart is not possible via FTP remote connection!\n"; - exit(1); - } else if ($intMethod == 3) { - $booReturn = 0; - if (!isset($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { - $booReturn = $myConfigClass->getSSHConnection($intTarget); - } - if ($booReturn == 1) { - $myVisClass->processMessage($myDataClass->strErrorMessage,$strErrorMessage); - } else { - if (is_array($myConfigClass->sendSSHCommand('ls '.$strCommandfile))) { - $strCommandString = "[".time()."] RESTART_PROGRAM;".time()."\n";; - $arrResult = $myConfigClass->sendSSHCommand('echo "'.$strCommandString.'" >> '.$strCommandfile); - if ($arrResult == false) { - echo "Restart failed - Nagios command file not found or no rights to execute (remote SSH)!\n"; - exit(1); - } - echo "Nagios daemon successfully restarted (remote SSH)\n"; - exit(0); - } else { - echo "Nagios command file not found (remote SSH)!\n"; - exit(1); - } - } - } +if ($argFunction == 'restart') { + // Read config file + $myConfigClass->getConfigData($intTarget, 'commandfile', $strCommandfile); + $myConfigClass->getConfigData($intTarget, 'pidfile', $strPidfile); + // Check state nagios demon + clearstatcache(); + if ($intMethod == 1) { + if (file_exists($strPidfile)) { + if (file_exists($strCommandfile) && is_writable($strCommandfile)) { + $strCommandString = '[' .time(). '] RESTART_PROGRAM;' .time()."\n"; + $timeout = 3; + $old = ini_set('default_socket_timeout', $timeout); + $resCmdFile = fopen($strCommandfile, 'wb'); + ini_set('default_socket_timeout', $old); + stream_set_timeout($resCmdFile, $timeout); + stream_set_blocking($resCmdFile, 0); + if ($resCmdFile) { + fwrite($resCmdFile, $strCommandString); + fclose($resCmdFile); + echo "Restart command successfully send to Nagios\n"; + exit(0); + } + } + echo "Restart failed - Nagios command file not found or no execute permissions\n"; + exit(1); + } + echo "Nagios daemon is not running, cannot send restart command!\n"; + exit(1); + } + if ($intMethod == 2) { + echo "Nagios restart is not possible via FTP remote connection!\n"; + exit(1); + } + if ($intMethod == 3) { + $booReturn = 0; + if (empty($myConfigClass->resConnectId) || !is_resource($myConfigClass->resConnectId)) { + $booReturn = $myConfigClass->getSSHConnection($intTarget); + } + if ($booReturn == 1) { + $myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage); + } else { + $intRet1 = $myConfigClass->sendSSHCommand('ls '.$strBinary, $arrRet1); + if (($intRet1 == 0) && is_array($arrRet1)) { + $strCommandString = '[' .time(). '] RESTART_PROGRAM;' .time()."\n"; + $strCommand = 'echo "'.$strCommandString.'" >> '.$strCommandfile; + $intRet2 = $myConfigClass->sendSSHCommand($strCommand, $arrResult); + if ($intRet2 != 0) { + echo "Restart failed - Nagios command file not found or no rights to execute (remote SSH)!\n"; + exit(1); + } + echo "Nagios daemon successfully restarted (remote SSH)\n"; + exit(0); + } + echo "Nagios command file not found (remote SSH)!\n"; + exit(1); + } + } } -if ($argFunction == "write") { - if (substr_count($argObject,"tbl_") != 0) { - $argObject = str_replace("tbl_","",$argObject); - } - if (substr_count($argObject,".cfg") != 0) { - $argObject = str_replace(".cfg","",$argObject); - } - if ($argObject == "host") { - // Write host configuration - $strInfo = "Write host configurations ...\n"; - $strSQL = "SELECT `id` FROM `tbl_host` WHERE `config_id` = $intDomain AND `active`='1'"; - $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - $intError = 0; - if ($intDataCount != 0) { - foreach ($arrData AS $data) { - $intReturn = $myConfigClass->createConfigSingle("tbl_host",$data['id']); - if ($intReturn == 1) $intError++; - } - } - if ($intError == 0) { - $strInfo .= "Host configuration files successfully written!\n"; - } else { - $strInfo .= "Cannot open/overwrite the configuration file (check the permissions)!\n"; - } - } else if ($argObject == "service") { - // Write service configuration - $strInfo = "Write service configurations ...\n"; - $strSQL = "SELECT `id`, `config_name` FROM `tbl_service` WHERE `config_id` = $intDomain AND `active`='1' GROUP BY `config_name`"; - $myDBClass->getDataArray($strSQL,$arrData,$intDataCount); - $intError = 0; - if ($intDataCount != 0) { - foreach ($arrData AS $data) { - $intReturn = $myConfigClass->createConfigSingle("tbl_service",$data['id']); - if ($intReturn == 1) $intError++; - } - } - if ($intError == 0) { - $strInfo .= "Service configuration file successfully written!\n"; - } else { - $strInfo .= "Cannot open/overwrite the configuration file (check the permissions)!\n"; - } - } else { - $strInfo = "Write ".$argObject.".cfg ...\n"; - $booReturn = $myConfigClass->createConfig("tbl_".$argObject); - if ($booReturn == 0) { - $strInfo .= "Configuration file ".$argObject.".cfg successfully written!\n"; - } else { - echo $myConfigClass->strErrorMessage; - $strInfo .= "Cannot open/overwrite the configuration file ".$argObject.".cfg (check the permissions or probably tbl_".$argObject." does not exists)!\n"; - } - } - echo $strInfo; +if ($argFunction == 'write') { + if (substr_count($argObject, 'tbl_') != 0) { + $argObject = str_replace('tbl_', '', $argObject); + } + if (substr_count($argObject, '.cfg') != 0) { + $argObject = str_replace('.cfg', '', $argObject); + } + if ($argObject == 'host') { + // Write host configuration + $strInfo = "Write host configurations ...\n"; + $strSQL = "SELECT `id` FROM `tbl_host` WHERE `config_id` = $intDomain AND `active`='1'"; + $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + $intError = 0; + if ($intDataCount != 0) { + foreach ($arrData as $data) { + $intReturn = $myConfigClass->createConfigSingle('tbl_host', $data['id']); + if ($intReturn == 1) { + $intError++; + } + } + } + if ($intError == 0) { + $strInfo .= "Host configuration files successfully written!\n"; + } else { + $strInfo .= "Cannot open/overwrite the configuration file (check the permissions)!\n"; + } + } elseif ($argObject == 'service') { + // Write service configuration + $strInfo = "Write service configurations ...\n"; + $strSQL = 'SELECT `id`, `config_name` FROM `tbl_service` ' + . "WHERE `config_id` = $intDomain AND `active`='1' GROUP BY `config_name`"; + $myDBClass->hasDataArray($strSQL, $arrData, $intDataCount); + $intError = 0; + if ($intDataCount != 0) { + foreach ($arrData as $data) { + $intReturn = $myConfigClass->createConfigSingle('tbl_service', $data['id']); + if ($intReturn == 1) { + $intError++; + } + } + } + if ($intError == 0) { + $strInfo .= "Service configuration file successfully written!\n"; + } else { + $strInfo .= "Cannot open/overwrite the configuration file (check the permissions)!\n"; + } + } else { + $strInfo = 'Write ' .$argObject.".cfg ...\n"; + $booReturn = $myConfigClass->createConfig('tbl_' .$argObject); + if ($booReturn == 0) { + $strInfo .= 'Configuration file ' .$argObject.".cfg successfully written!\n"; + } else { + echo $myConfigClass->strErrorMessage; + $strInfo .= 'Cannot open/overwrite the configuration file ' .$argObject. '.cfg (check the permissions or ' + . 'probably tbl_' .$argObject." does not exists)!\n"; + } + } + echo $strInfo; } -if ($argFunction == "import") { - $strInfo = "Importing configurations ...\n"; - $intReturn = $myImportClass->fileImport($argObject,$intTarget,'1'); - if ($intReturn != 0) { - $strInfo .= $myImportClass->strErrorMessage; - } else { - $strInfo .= $myImportClass->strInfoMessage; - } - $strInfo = strip_tags($strInfo); - echo str_replace("::","\n",$strInfo); - +if ($argFunction == 'import') { + $strInfo = "Importing configurations ...\n"; + $intReturn = $myImportClass->fileImport($argObject, $intTarget, '1'); + if ($intReturn != 0) { + $strInfo .= $myImportClass->strErrorMessage; + } else { + $strInfo .= $myImportClass->strInfoMessage; + } + $strInfo = strip_tags($strInfo); + echo str_replace('::', "\n", $strInfo); } // // Output processing // ================= -if (isset($resFile) && ($resFile != false)){ - $intError = 0; - $intWarning = 0; - $strOutput = ""; - while(!feof($resFile)) { - $strLine = fgets($resFile,1024); - if (substr_count($strLine,"Error:") != 0) { - $intError++; - } - if (substr_count($strLine,"Warning:") != 0) { - $intWarning++; - } - $strOutput .= $strLine; - } - pclose($resFile); - echo $strOutput."\n"; - if (($intError == 0) && ($intWarning == 0)) { - echo "Written configuration files are valid, Nagios can be restarted!\n\n"; - } -} else if (isset($arrResult) && is_array($arrResult)) { - $intError = 0; - $intWarning = 0; - $strOutput = ""; - foreach ($arrResult AS $elem) { - if (substr_count($elem,"Error:") != 0) { - $intError++; - } - if (substr_count($elem,"Warning:") != 0) { - $intWarning++; - } - $strOutput .= $elem."\n"; - } - echo $strOutput."\n"; - if (($intError == 0) && ($intWarning == 0)) { - echo "Written configuration files are valid, Nagios can be restarted!\n\n"; - } +if (isset($resFile) && ($resFile != false)) { + $intError = 0; + $intWarning = 0; + $strOutput = ''; + while (!feof($resFile)) { + $strLine = fgets($resFile, 1024); + if (substr_count($strLine, 'Error:') != 0) { + $intError++; + } + if (substr_count($strLine, 'Warning:') != 0) { + $intWarning++; + } + $strOutput .= $strLine; + } + pclose($resFile); + echo $strOutput."\n"; + if (($intError == 0) && ($intWarning == 0)) { + echo "Written configuration files are valid, Nagios can be restarted!\n\n"; + } +} elseif (isset($arrResult) && is_array($arrResult)) { + $intError = 0; + $intWarning = 0; + $strOutput = ''; + foreach ($arrResult as $elem) { + if (substr_count($elem, 'Error:') != 0) { + $intError++; + } + if (substr_count($elem, 'Warning:') != 0) { + $intWarning++; + } + $strOutput .= $elem."\n"; + } + echo $strOutput."\n"; + if (($intError == 0) && ($intWarning == 0)) { + echo "Written configuration files are valid, Nagios can be restarted!\n\n"; + } } -?> diff --git a/templates/admin/admin_master.tpl.htm b/templates/admin/admin_master.tpl.htm deleted file mode 100644 index 1f3cfdf..0000000 --- a/templates/admin/admin_master.tpl.htm +++ /dev/null @@ -1,872 +0,0 @@ - - - - - - - - - - - -
- - - - - - -
{LANG_SEARCH_STRING}:{LANG_SEARCH} {LANG_DELETE_SEARCH}
- - - - - - - - - - - - - - - - - - - -
 
{FIELD_1}
{SORT_IMAGE_1}
{FIELD_2}
{SORT_IMAGE_2}
{LANG_REGISTERED}{LANG_ACTIVE}{LANG_FUNCTION}
{DATA_FIELD_1} {DOMAIN_SPECIAL}{DATA_FIELD_2}{DATA_REGISTERED}{DATA_ACTIVE}{LANG_MODIFY} - {LANG_DUPLICATE} - {LANG_DELETE} - {INFO}
- - - - - - -
- - - - - - - - {LANG_MARKED}: - - to Domain: - -
-
-
- - -
-
- - -

-{CONSIST_USAGE}

-{INFOMESSAGE}
-{ERRORMESSAGE}
-{LAST_MODIFIED_TABLE}
-{LAST_MODIFIED_FILE}
-{MODIFICATION_STATUS}
-

- - - -
- - - - - - -
{LANG_SEARCH_STRING}:{LANG_SEARCH} {LANG_DELETE_SEARCH}
- - - - - - - - - - - - - - - - - - - - - -
{FIELD_1}
{SORT_IMAGE_1}
{FIELD_2}
{SORT_IMAGE_2}
{LANG_REGISTERED}{LANG_ACTIVE}{LANG_FILE}
{LANG_FUNCTION}
{DATA_FIELD_1} {DOMAIN_SPECIAL}{DATA_FIELD_2}{DATA_REGISTERED}{DATA_ACTIVE}{DATA_FILE}{LANG_MODIFY} - {LANG_DUPLICATE} - {LANG_DELETE} - {LANG_WRITE_CONFIG} - {LANG_DOWNLOAD} - {INFO}
- - - - - - -
- - - - - - - {LANG_MARKED}: - - to Domain: - -
-
-
- - -
-
- - -

- {DBMESSAGE}
- {CONSISTUSAGE}
-

- - - -
- - - - - - - - -
{LANG_SEARCH_STRING}:{LANG_SEARCH} {LANG_DELETE_SEARCH}{LANG_CONFIGFILTER}: -
- - - - - - - - - - - - - - - - - - - - - -
{FIELD_1}
{SORT_IMAGE_1}
{FIELD_2}
{SORT_IMAGE_2}
{LANG_REGISTERED}{LANG_ACTIVE}{LANG_FILE}
{LANG_FUNCTION}
{DATA_FIELD_1} {DOMAIN_SPECIAL}{DATA_FIELD_2}{DATA_REGISTERED}{DATA_ACTIVE}{DATA_FILE}{LANG_MODIFY} - {LANG_DUPLICATE} - {LANG_DELETE} - {LANG_WRITE_CONFIG} - {LANG_DOWNLOAD} - {INFO}
- - - - - - -
- - - - - - - {LANG_MARKED}: - - to Domain: - -
-
-
- - -
-
- - - -
- - - - - - - - - - - - - - - - - -
 
{FIELD_1}
{SORT_IMAGE_1}
{FIELD_2}
{SORT_IMAGE_2}
{LANG_ACTIVE}{LANG_FUNCTION}
{DATA_FIELD_1}{DATA_FIELD_2}{DATA_ACTIVE} - {LANG_MODIFY} - {LANG_COPY} - {DEL_HIDE_START}{LANG_DELETE}{DEL_HIDE_STOP}
- - - - - - -
- - - - - - {LANG_MARKED}: - -
-
- - -
-
- - -
-
{LANG_CHANGE_PASSWORD}
- -
- - - - - - - - - - - - - - - - - - - -
{LANG_OLD_PASSWORD} *
{LANG_NEW_PASSWORD} *
{LANG_CONFIRM_PASSWORD}*
 
 * {LANG_REQUIRED}
-
-
-

{ERRORMESSAGE}

-
-
- - -
-
{TITLE}
- -
- - - - - - -
{LANG_SEARCH_STRING}:{LANG_SEARCH} {LANG_DELETE_SEARCH}
-
- - - - - - - - - - - - - - - - - -
{LANG_TIME}{LANG_USER}{LANG_IP}{LANG_DOMAIN}{LANG_ENTRY}
{DAT_TIME}{DAT_ACCOUNT}{DAT_IPADRESS}{DAT_DOMAIN}{DAT_ACTION}
- - - - - -
{LANG_PREVIOUS}{LANG_NEXT}
-
- - - - - - - - - - - - - -
{LANG_ENTRIES_BEFORE}
{LANG_FROM}:{LANG_CALENDAR} {LANG_DELETE_SEARCH}{LANG_TO}:{LANG_CALENDAR} {LANG_DELETE_SEARCH}
-
-

{ERRORMESSAGE}{INFOMESSAGE}

-
- - -
-
- - -
-
{TITLE}
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
{LANG_MENU_PAGE} - -
 
{LANG_ACCESS_GROUP} -
 
{LANG_ACCESSDESCRIPTION}
 
 
-
-

{ERRORMESSAGE}{INFOMESSAGE}

-
- \ No newline at end of file diff --git a/templates/admin/checkcommands.htm.tpl b/templates/admin/checkcommands.htm.tpl new file mode 100644 index 0000000..255fc7b --- /dev/null +++ b/templates/admin/checkcommands.htm.tpl @@ -0,0 +1,120 @@ + + + + + + + + +
+
{TITLE}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{LANG_COMMAND} *{LANG_HELP}   
{LANG_COMMAND_LINE} *{LANG_HELP}
{LANG_COMMAND_TYPE} + + {LANG_HELP} +
{LANG_ACCESS_GROUP} + + {LANG_HELP}
{LANG_REGISTERED}{LANG_HELP}
{LANG_ACTIVE} + + + + +
 
 * {LANG_REQUIRED}{WARNING}
+
+
+ [{LANG_SHOW_RELATION_DATA}][{LANG_HIDE_RELATION_DATA}]{CHECK_MUST_DATA} +
+
+
+
+
+ \ No newline at end of file diff --git a/templates/admin/checkcommands.tpl.htm b/templates/admin/checkcommands.tpl.htm deleted file mode 100644 index ee28eca..0000000 --- a/templates/admin/checkcommands.tpl.htm +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - - -
-
{TITLE}
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{LANG_COMMAND}*{LANG_HELP}   
{LANG_COMMAND_LINE}*{LANG_HELP}
{LANG_COMMAND_TYPE} - - {LANG_HELP} -
{LANG_ACCESS_GROUP} - - {LANG_HELP}
{LANG_REGISTERED}{LANG_HELP}
{LANG_ACTIVE} - - - - -
 
 * {LANG_REQUIRED}{WARNING}
-
-
- [{LANG_SHOW_RELATION_DATA}][{LANG_HIDE_RELATION_DATA}]{CHECK_MUST_DATA} -
-
-
-
-
- \ No newline at end of file diff --git a/templates/admin/configtargets.htm.tpl b/templates/admin/configtargets.htm.tpl new file mode 100644 index 0000000..0af4a87 --- /dev/null +++ b/templates/admin/configtargets.htm.tpl @@ -0,0 +1,321 @@ + + + + + + + + +
+
{TITLE}
+
{PATHMESSAGE}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{LANG_CONFIG_TARGET} *{LANG_HELP}
{LANG_DESCRIPTION} *
{LANG_SERVER_NAME} *
{LANG_METHOD} + +
{LANG_USERNAME} *
{LANG_PASSWORD} *
{LANG_SSH_KEY} *{LANG_HELP}
{LANG_FTPS}{LANG_HELP}
 
{LANG_CONFIGURATION_DIRECTORIES}
{LANG_BASE_DIRECTORY} *{LANG_HELP}
{LANG_HOST_DIRECTORY} *{LANG_HELP}
{LANG_SERVICE_DIRECTORY} *{LANG_HELP}
{LANG_BACKUP_DIRECTORY} *{LANG_HELP}
{LANG_HOST_BACKUP_DIRECTORY} *{LANG_HELP}
{LANG_SERVICE_BACKUP_DIRECTORY} *{LANG_HELP}
 
{LANG_NAGIOS_DIRECTORIES}
{LANG_NAGIOS_BASEDIR} *{LANG_HELP}
{LANG_IMPORT_DIRECTORY}{LANG_HELP}
{LANG_PICTURE_DIRECTORY}{LANG_HELP}
{LANG_NAGIOS_COMMAND_FILE}{LANG_HELP}
{LANG_NAGIOS_BINARY_FILE}{LANG_HELP}
{LANG_NAGIOS_PROCESS_FILE}{LANG_HELP}
{LANG_NAGIOS_CONFIG_FILE} *{LANG_HELP}
{LANG_NAGIOS_CGI_FILE} *{LANG_HELP}
{LANG_NAGIOS_RESOURCE_FILE} *{LANG_HELP}
 
{LANG_NAGIOS_VERSION} + + {LANG_HELP}
 
{LANG_ACCESS_GROUP} + + {LANG_HELP}
{LANG_ACTIVE} + + +
 
 * {LANG_REQUIRED}
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/templates/admin/configtargets.tpl.htm b/templates/admin/configtargets.tpl.htm deleted file mode 100644 index 143a502..0000000 --- a/templates/admin/configtargets.tpl.htm +++ /dev/null @@ -1,297 +0,0 @@ - - - - - - - - - - -
-
{TITLE}
-
{PATHMESSAGE}
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{LANG_CONFIG_TARGET} *{LANG_HELP}
{LANG_DESCRIPTION} *
{LANG_SERVER_NAME} *
{LANG_METHOD} - -
{LANG_USERNAME} *
{LANG_PASSWORD} *
{LANG_SSH_KEY} *{LANG_HELP}
 
{LANG_CONFIGURATION_DIRECTORIES}
{LANG_BASE_DIRECTORY} *{LANG_HELP}
{LANG_HOST_DIRECTORY} *{LANG_HELP}
{LANG_SERVICE_DIRECTORY} *{LANG_HELP}
{LANG_BACKUP_DIRECTORY} *{LANG_HELP}
{LANG_HOST_BACKUP_DIRECTORY} *{LANG_HELP}
{LANG_SERVICE_BACKUP_DIRECTORY} *{LANG_HELP}
{LANG_NAGIOS_BASEDIR} *{LANG_HELP}
{LANG_IMPORT_DIRECTORY}{LANG_HELP}
{LANG_PICTURE_DIRECTORY}{LANG_HELP}
 
{LANG_NAGIOS_COMMAND_FILE}{LANG_HELP}
{LANG_NAGIOS_BINARY_FILE}{LANG_HELP}
{LANG_NAGIOS_PROCESS_FILE}{LANG_HELP}
{LANG_NAGIOS_CONFIG_FILE} *{LANG_HELP}
 
{LANG_NAGIOS_VERSION} - - {LANG_HELP}
 
{LANG_ACCESS_GROUP} - - {LANG_HELP}
{LANG_ACTIVE} - - -
 
 * {LANG_REQUIRED}
-
-
-
-
-
-
- - \ No newline at end of file diff --git a/templates/admin/contactgroups.tpl.htm b/templates/admin/contactgroups.htm.tpl similarity index 71% rename from templates/admin/contactgroups.tpl.htm rename to templates/admin/contactgroups.htm.tpl index a4b9200..56bb41f 100644 --- a/templates/admin/contactgroups.tpl.htm +++ b/templates/admin/contactgroups.htm.tpl @@ -1,18 +1,14 @@ - + - - - - - - - - + + + + + +
{TITLE}
- - -
@@ -137,14 +142,14 @@ - - + + - + + - - + + - + + + - + - - + + - - + + - - + + - + - + - + - + - + @@ -215,96 +222,96 @@ - + - + - + - + - - + + - - + + @@ -312,7 +319,7 @@
{LANG_CONTACT_NAME} *{LANG_HELP}{LANG_HELP} {LANG_CONTACT_GROUP}
- @@ -152,60 +157,62 @@
-
{LANG_MODIFY}
{LANG_HELP}
{LANG_MODIFY}
{LANG_HELP}
{LANG_DESCRIPTION} {VERSION_20_STAR}{LANG_HELP}{LANG_HELP} {LANG_CTRLINFO}
 {LANG_MINIMUM_IMPORTANCE}{LANG_HELP}
  - + - + - +
+ null {LANG_STANDARD}
{LANG_HELP}{LANG_HELP}
{LANG_EMAIL_ADDRESS}{LANG_HELP}{LANG_HELP} {LANG_PAGER_NUMBER}{LANG_HELP}{LANG_HELP}
{LANG_ADDON_ADDRESS} 1{LANG_HELP}{LANG_HELP} {LANG_ADDON_ADDRESS} 2
{LANG_ADDON_ADDRESS} 3 {LANG_ADDON_ADDRESS} 4
{LANG_ADDON_ADDRESS} 5 {LANG_ADDON_ADDRESS} 6
  - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP}
{LANG_HELP}{LANG_HELP} {LANG_SERVICE_NOTIF_ENABLE} * - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP}
{LANG_HELP}{LANG_HELP}
{LANG_TIME_PERIOD_HOSTS} * - {LANG_HELP}{LANG_HELP} {LANG_TIME_PERIOD_SERVICES} * - {LANG_HELP}{LANG_HELP}
{LANG_HOST_OPTIONS} * - + - + - + - + - + - +
d u r f s n
{LANG_HELP}{LANG_HELP}{LANG_HELP}{LANG_HELP} {LANG_SERVICE_OPTIONS} * - + - + - + - + - + - + - +
w u c r f s n
{LANG_HELP}{LANG_HELP}{LANG_HELP}{LANG_HELP}
{LANG_HOST_COMMAND} *
- @@ -321,13 +328,13 @@
- {LANG_MODIFY}
{LANG_HELP} + {LANG_MODIFY}
{LANG_HELP} {LANG_SERVICE_COMMAND} *
- @@ -336,7 +343,7 @@
- {LANG_MODIFY}
{LANG_HELP} + {LANG_MODIFY}
{LANG_HELP} {LANG_CTRLINFO} @@ -347,26 +354,26 @@ - + - +
+ {LANG_STANDARD}
- {LANG_HELP} + {LANG_HELP}   - + - +
+ {LANG_STANDARD}
- {LANG_HELP} + {LANG_HELP}   @@ -376,61 +383,61 @@ - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
- {LANG_HELP} + {LANG_HELP} {LANG_CAN_SUBMIT_COMMANDS} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
- {LANG_HELP} + {LANG_HELP} {LANG_RETAIN_NONSTATUS_INFO} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
- {LANG_HELP} + {LANG_HELP} {LANG_REGISTERED} - - {LANG_HELP} + + {LANG_HELP} {LANG_ACTIVE} - + @@ -440,7 +447,7 @@   -  * {LANG_REQUIRED} +  * {LANG_REQUIRED} {WARNING} @@ -469,20 +476,20 @@ {LANG_VARIABLE_NAME} - - {LANG_HELP} + + {LANG_HELP} {LANG_VARIABLE_VALUE} - - {LANG_HELP} - + + {LANG_HELP} +   - {LANG_ADDITIONAL_TEMPLATES} + {LANG_ADDITIONAL_TEMPLATES} @@ -490,14 +497,14 @@ {LANG_TEMPLATE_NAME} - - {LANG_HELP} - + {LANG_HELP} +   @@ -512,8 +519,8 @@ {LANG_GENERIC_NAME} - - {LANG_HELP} + + {LANG_HELP}   @@ -524,19 +531,19 @@ {LANG_ACCESS_GROUP} - - {LANG_HELP} + {LANG_HELP}   -  * {LANG_REQUIRED} +  * {LANG_REQUIRED} {WARNING} @@ -547,13 +554,15 @@
- +
[{LANG_SHOW_RELATION_DATA}][{LANG_HIDE_RELATION_DATA}]{CHECK_MUST_DATA} diff --git a/templates/admin/contacttemplates.htm.tpl b/templates/admin/contacttemplates.htm.tpl new file mode 100644 index 0000000..9df4842 --- /dev/null +++ b/templates/admin/contacttemplates.htm.tpl @@ -0,0 +1,518 @@ + + + + + + + + +
+
{TITLE}
+ + +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{LANG_TEMPLATE_NAME} *{LANG_HELP}{LANG_CONTACT_GROUP} + + + + +
+ +
+
{LANG_MODIFY}
{LANG_HELP}
{LANG_DESCRIPTION}{LANG_HELP}{LANG_CTRLINFO}
{LANG_MINIMUM_IMPORTANCE}{LANG_HELP}
  + + + + + + + + + +
+null{LANG_STANDARD}
+
{LANG_HELP}
{LANG_EMAIL_ADDRESS}{LANG_HELP}{LANG_PAGER_NUMBER}{LANG_HELP}
{LANG_ADDON_ADDRESS} 1{LANG_HELP}{LANG_ADDON_ADDRESS} 2
{LANG_ADDON_ADDRESS} 3{LANG_ADDON_ADDRESS} 4
{LANG_ADDON_ADDRESS} 5{LANG_ADDON_ADDRESS} 6
 
{LANG_HOST_NOTIF_ENABLE} + + + + + + + + + +
{LANG_ON}{LANG_OFF}{LANG_SKIP}
+
{LANG_HELP}{LANG_SERVICE_NOTIF_ENABLE} + + + + + + + + + +
{LANG_ON}{LANG_OFF}{LANG_SKIP}
+
{LANG_HELP}
{LANG_TIME_PERIOD_HOSTS} + + {LANG_HELP}{LANG_TIME_PERIOD_SERVICES} + + {LANG_HELP}
{LANG_HOST_OPTIONS} + + + + + + + + + + + + + + + +
durfsn
+
{LANG_HELP}{LANG_HELP}{LANG_SERVICE_OPTIONS} + + + + + + + + + + + + + + + + + +
wucrfsn
+
{LANG_HELP}{LANG_HELP}
{LANG_HOST_COMMAND} + + + + +
+ +
+
{LANG_MODIFY}
{LANG_HELP}
{LANG_SERVICE_COMMAND} + + + + +
+ +
+
{LANG_MODIFY}
{LANG_HELP}
{LANG_CTRLINFO}{LANG_CTRLINFO}
  + + + + + + + +
+{LANG_STANDARD}
+
{LANG_HELP}  + + + + + + + +
+{LANG_STANDARD}
+
{LANG_HELP}
 
{LANG_RETAIN_STATUS_INFO} + + + + + + + + + + + +
{LANG_ON}{LANG_OFF}{LANG_SKIP}null
+
{LANG_HELP}{LANG_CAN_SUBMIT_COMMANDS} + + + + + + + + + + + +
{LANG_ON}{LANG_OFF}{LANG_SKIP}null
+
{LANG_HELP}
{LANG_RETAIN_NONSTATUS_INFO} + + + + + + + + + + + +
{LANG_ON}{LANG_OFF}{LANG_SKIP}null
+
{LANG_HELP}
{LANG_ACTIVE} + + + +
 
 * {LANG_REQUIRED}{WARNING}
 
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{LANG_FREE_VARIABLE_DEFINITIONS}
+ + + + + +
{LANG_VARIABLE_NAME}{LANG_VARIABLE_VALUE}
+
{LANG_VARIABLE_NAME}{LANG_HELP}
{LANG_VARIABLE_VALUE}{LANG_HELP}
 
{LANG_ADDITIONAL_TEMPLATES}
{LANG_TEMPLATE_NAME} + + {LANG_HELP}
      
{LANG_OBJECT_ACCESS_RESTRICTIONS}
{LANG_ACCESS_GROUP} + + {LANG_HELP}
 
 * {LANG_REQUIRED}{WARNING}
 
+
+
+
+
+ + +
+
+[{LANG_SHOW_RELATION_DATA}][{LANG_HIDE_RELATION_DATA}]{CHECK_MUST_DATA} +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ \ No newline at end of file diff --git a/templates/admin/contacttemplates.tpl.htm b/templates/admin/contacttemplates.tpl.htm deleted file mode 100644 index e975b37..0000000 --- a/templates/admin/contacttemplates.tpl.htm +++ /dev/null @@ -1,510 +0,0 @@ - - - - - - - - - - -
-
{TITLE}
- - - -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{LANG_TEMPLATE_NAME}*{LANG_HELP}{LANG_CONTACT_GROUP} - - - - -
- -
-
{LANG_MODIFY}
{LANG_HELP}
{LANG_DESCRIPTION}{LANG_HELP}{LANG_CTRLINFO}
 
  - - - - - - - - - -
+null{LANG_STANDARD}
-
{LANG_HELP}
{LANG_EMAIL_ADDRESS}{LANG_HELP}{LANG_PAGER_NUMBER}{LANG_HELP}
{LANG_ADDON_ADDRESS} 1{LANG_HELP}{LANG_ADDON_ADDRESS} 2
{LANG_ADDON_ADDRESS} 3{LANG_ADDON_ADDRESS} 4
{LANG_ADDON_ADDRESS} 5{LANG_ADDON_ADDRESS} 6
 
{LANG_HOST_NOTIF_ENABLE} - - - - - - - - - -
{LANG_ON}{LANG_OFF}{LANG_SKIP}
-
{LANG_HELP}{LANG_SERVICE_NOTIF_ENABLE} - - - - - - - - - -
{LANG_ON}{LANG_OFF}{LANG_SKIP}
-
{LANG_HELP}
{LANG_TIME_PERIOD_HOSTS} - - {LANG_HELP}{LANG_TIME_PERIOD_SERVICES} - - {LANG_HELP}
{LANG_HOST_OPTIONS} - - - - - - - - - - - - - - - -
durfsn
-
{LANG_HELP}{LANG_HELP}{LANG_SERVICE_OPTIONS} - - - - - - - - - - - - - - - - - -
wucrfsn
-
{LANG_HELP}{LANG_HELP}
{LANG_HOST_COMMAND} - - - - -
- -
-
{LANG_MODIFY}
{LANG_HELP}
{LANG_SERVICE_COMMAND} - - - - -
- -
-
{LANG_MODIFY}
{LANG_HELP}
{LANG_CTRLINFO}{LANG_CTRLINFO}
  - - - - - - - -
+{LANG_STANDARD}
-
{LANG_HELP}  - - - - - - - -
+{LANG_STANDARD}
-
{LANG_HELP}
 
{LANG_RETAIN_STATUS_INFO} - - - - - - - - - - - -
{LANG_ON}{LANG_OFF}{LANG_SKIP}null
-
{LANG_HELP}{LANG_CAN_SUBMIT_COMMANDS} - - - - - - - - - - - -
{LANG_ON}{LANG_OFF}{LANG_SKIP}null
-
{LANG_HELP}
{LANG_RETAIN_NONSTATUS_INFO} - - - - - - - - - - - -
{LANG_ON}{LANG_OFF}{LANG_SKIP}null
-
{LANG_HELP}
{LANG_ACTIVE} - - - -
 
 * {LANG_REQUIRED}{WARNING}
 
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{LANG_FREE_VARIABLE_DEFINITIONS}
- - - - - -
{LANG_VARIABLE_NAME}{LANG_VARIABLE_VALUE}
-
{LANG_VARIABLE_NAME}{LANG_HELP}
{LANG_VARIABLE_VALUE}{LANG_HELP}
 
{LANG_ADDITIONAL_TEMPLATES}
{LANG_TEMPLATE_NAME} - - {LANG_HELP}
      
{LANG_OBJECT_ACCESS_RESTRICTIONS}
{LANG_ACCESS_GROUP} - - {LANG_HELP}
 
 * {LANG_REQUIRED}{WARNING}
 
-
-
-
-
- -
-
-[{LANG_SHOW_RELATION_DATA}][{LANG_HIDE_RELATION_DATA}]{CHECK_MUST_DATA} -
-
-
-
-
-
-
-
-
-
-
-
-
-
- \ No newline at end of file diff --git a/templates/admin/datadomain.htm.tpl b/templates/admin/datadomain.htm.tpl new file mode 100644 index 0000000..45c55d3 --- /dev/null +++ b/templates/admin/datadomain.htm.tpl @@ -0,0 +1,146 @@ + + + + + + + + +
+
{TITLE}
+
{ERRMESSAGE}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{LANG_DOMAIN} *{LANG_HELP}
{LANG_DESCRIPTION} *
 
{LANG_CONFIG_TARGET} * + + {LANG_HELP}
 
{LANG_NAGIOS_VERSION} + + {LANG_HELP}
{LANG_ENABLE_COMMON_DOMAIN} + + {LANG_HELP}
 
{LANG_ACCESS_GROUP} + + {LANG_HELP}
{LANG_ACTIVE} + + +
 
 * {LANG_REQUIRED}{WARNING}
+
+
+
+
+
+
+ \ No newline at end of file diff --git a/templates/admin/datadomain.tpl.htm b/templates/admin/datadomain.tpl.htm deleted file mode 100644 index 9c4c47d..0000000 --- a/templates/admin/datadomain.tpl.htm +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - -
-
{TITLE}
-
{ERRMESSAGE}
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{LANG_DOMAIN} *{LANG_HELP}
{LANG_DESCRIPTION} *
 
{LANG_CONFIG_TARGET} * - - {LANG_HELP}
 
{LANG_NAGIOS_VERSION} - - {LANG_HELP}
{LANG_ENABLE_COMMON_DOMAIN} - - {LANG_HELP}
 
{LANG_ACCESS_GROUP} - - {LANG_HELP}
{LANG_ACTIVE} - - -
 
 * {LANG_REQUIRED}{WARNING}
-
-
-
-
-
-
- \ No newline at end of file diff --git a/templates/admin/datalist.htm.tpl b/templates/admin/datalist.htm.tpl new file mode 100644 index 0000000..e4b1a28 --- /dev/null +++ b/templates/admin/datalist.htm.tpl @@ -0,0 +1,165 @@ + + + + + + + + +
+
{TITLE}
+ + +
+ + + + + + +
{LANG_SEARCH_STRING}:{LANG_SEARCH} {LANG_DELETE_SEARCH}
+ + + + + + + + + + + + + + + + + + + +
 
{FIELD_1}
{SORT_IMAGE_1}
{FIELD_2}
{SORT_IMAGE_2}
{LANG_REGISTERED}{LANG_ACTIVE}{LANG_FUNCTION}
{DATA_FIELD_1} {DOMAIN_SPECIAL}{DATA_FIELD_2}{DATA_REGISTERED}{DATA_ACTIVE}{LANG_MODIFY} + {LANG_DUPLICATE} + {LANG_DELETE} + {INFO}
+ + + + + + +
+ + + + + + + + {LANG_MARKED}: + + to Domain: + +
+
+
+ +
+
+
+ + +

+ {CONSIST_USAGE}

+ {INFOMESSAGE}
+ {ERRORMESSAGE}
+ {LAST_MODIFIED_TABLE}
+ {LAST_MODIFIED_FILE}
+ {MODIFICATION_STATUS}
+

+ \ No newline at end of file diff --git a/templates/admin/datalist_common.htm.tpl b/templates/admin/datalist_common.htm.tpl new file mode 100644 index 0000000..fed6349 --- /dev/null +++ b/templates/admin/datalist_common.htm.tpl @@ -0,0 +1,120 @@ + + + + + + + + +
+
{TITLE}
+ + +
+ + + + + + + + + + + + + + + + + +
 
{FIELD_1}
{SORT_IMAGE_1}
{FIELD_2}
{SORT_IMAGE_2}
{LANG_ACTIVE}{LANG_FUNCTION}
{DATA_FIELD_1}{DATA_FIELD_2}{DATA_ACTIVE} + {LANG_MODIFY} + {LANG_COPY} + {DEL_HIDE_START}{LANG_DELETE}{DEL_HIDE_STOP}
+ + + + + + +
+ + + + + + {LANG_MARKED}: + +
+
+ +
+
+
+ + +

+ {CONSIST_USAGE}

+ {INFOMESSAGE}
+ {ERRORMESSAGE}
+ {LAST_MODIFIED_TABLE}
+ {LAST_MODIFIED_FILE}
+ {MODIFICATION_STATUS}
+

+ \ No newline at end of file diff --git a/templates/admin/datalist_hosts.htm.tpl b/templates/admin/datalist_hosts.htm.tpl new file mode 100644 index 0000000..6303d6e --- /dev/null +++ b/templates/admin/datalist_hosts.htm.tpl @@ -0,0 +1,192 @@ + + + + + + + + +
+
{TITLE}
+ + +
+ + + + + + +
{LANG_SEARCH_STRING}:{LANG_SEARCH} {LANG_DELETE_SEARCH}
+ + + + + + + + + + + + + + + + + + + + + +
{FIELD_1}
{SORT_IMAGE_1}
{FIELD_2}
{SORT_IMAGE_2}
{LANG_REGISTERED}{LANG_ACTIVE}{LANG_FILE}
{LANG_FUNCTION}
{DATA_FIELD_1} {DOMAIN_SPECIAL}{DATA_FIELD_2}{DATA_REGISTERED}{DATA_ACTIVE}{DATA_FILE}{LANG_MODIFY} + {LANG_DUPLICATE} + {LANG_DELETE} + {LANG_WRITE_CONFIG} + {LANG_DOWNLOAD} + {INFO}
+ + + + + + +
+ + + + + + + {LANG_MARKED}: + + to Domain: + +
+
+
+ +
+
+
+ + +

+ {CONSIST_USAGE}

+ {INFOMESSAGE}
+ {ERRORMESSAGE}
+ {LAST_MODIFIED_TABLE}
+ {LAST_MODIFIED_FILE}
+ {MODIFICATION_STATUS}
+

+ \ No newline at end of file diff --git a/templates/admin/datalist_services.htm.tpl b/templates/admin/datalist_services.htm.tpl new file mode 100644 index 0000000..ac170b0 --- /dev/null +++ b/templates/admin/datalist_services.htm.tpl @@ -0,0 +1,205 @@ + + + + + + + + +
+
{TITLE}
+ + +
+ + + + + + + + +
{LANG_SEARCH_STRING}:{LANG_SEARCH} {LANG_DELETE_SEARCH}{LANG_CONFIGFILTER}: +
+ + + + + + + + + + + + + + + + + + + + + +
{FIELD_1}
{SORT_IMAGE_1}
{FIELD_2}
{SORT_IMAGE_2}
{LANG_REGISTERED}{LANG_ACTIVE}{LANG_FILE}
{LANG_FUNCTION}
{DATA_FIELD_1} {DOMAIN_SPECIAL}{DATA_FIELD_2}{DATA_REGISTERED}{DATA_ACTIVE}{DATA_FILE}{LANG_MODIFY} + {LANG_DUPLICATE} + {LANG_DELETE} + {LANG_WRITE_CONFIG} + {LANG_DOWNLOAD} + {INFO}
+ + + + + + +
+ + + + + + + {LANG_MARKED}: + + to Domain: + +
+
+
+ +
+
+
+ + +

+ {CONSIST_USAGE}

+ {INFOMESSAGE}
+ {ERRORMESSAGE}
+ {LAST_MODIFIED_TABLE}
+ {LAST_MODIFIED_FILE}
+ {MODIFICATION_STATUS}
+

+ \ No newline at end of file diff --git a/templates/admin/delbackup.htm.tpl b/templates/admin/delbackup.htm.tpl new file mode 100644 index 0000000..6282205 --- /dev/null +++ b/templates/admin/delbackup.htm.tpl @@ -0,0 +1,62 @@ + + + + + + + + +
+
{TITLE}
+ +
+ + + + + + + + + + + + + + + + + + + +
{LANG_SEARCH_STRING}{LANG_SEARCH} {LANG_DELETE_SEARCH}
{BACKUPFILE} * +
{CTRL_INFO}
 
  + * {LANG_REQUIRED}
+
+
+

{ERRORMESSAGE}{INFOMESSAGE}

+
+ \ No newline at end of file diff --git a/templates/admin/delbackup.tpl.htm b/templates/admin/delbackup.tpl.htm deleted file mode 100644 index 887225e..0000000 --- a/templates/admin/delbackup.tpl.htm +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - -
-
{TITLE}
- - - -
- - - - - - - - - - - - - - - - - - - -
{LANG_SEARCH_STRING}{LANG_SEARCH} {LANG_DELETE_SEARCH}
{BACKUPFILE} * -
{CTRL_INFO}
 
  - * {LANG_REQUIRED}
-
-
-

{ERRORMESSAGE}{INFOMESSAGE}

-
- \ No newline at end of file diff --git a/templates/admin/domain.tpl.htm b/templates/admin/domain.tpl.htm deleted file mode 100644 index 649d2f6..0000000 --- a/templates/admin/domain.tpl.htm +++ /dev/null @@ -1,309 +0,0 @@ - - - - - - - - - - -
-
{TITLE}
-
{ERRMESSAGE}
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{LANG_DOMAIN} * - {LANG_HELP}
{LANG_DESCRIPTION} *
{LANG_SERVER_NAME} *
{LANG_METHOD} - -
{LANG_USERNAME} *
{LANG_PASSWORD} *
{LANG_SSH_KEY} *{LANG_HELP}
 
{LANG_CONFIGURATION_DIRECTORIES}
{LANG_BASE_DIRECTORY} *{LANG_HELP}
{LANG_HOST_DIRECTORY} *{LANG_HELP}
{LANG_SERVICE_DIRECTORY} *{LANG_HELP}
{LANG_BACKUP_DIRECTORY} *{LANG_HELP}
{LANG_HOST_BACKUP_DIRECTORY} *{LANG_HELP}
{LANG_SERVICE_BACKUP_DIRECTORY} *{LANG_HELP}
{LANG_NAGIOS_BASEDIR} *{LANG_HELP}
{LANG_IMPORT_DIRECTORY}{LANG_HELP}
{LANG_PICTURE_DIRECTORY}{LANG_HELP}
 
{LANG_NAGIOS_COMMAND_FILE}{LANG_HELP}
{LANG_NAGIOS_BINARY_FILE}{LANG_HELP}
{LANG_NAGIOS_PROCESS_FILE}{LANG_HELP}
{LANG_NAGIOS_CONFIG_FILE}{LANG_HELP}
 
{LANG_NAGIOS_VERSION} - - {LANG_HELP}
{LANG_ENABLE_COMMON_DOMAIN} - - {LANG_HELP}
{LANG_ENABLE_UTF8_DECODE} - - {LANG_HELP}
 
{LANG_ACCESS_GROUP} - - {LANG_HELP}
{LANG_ACTIVE} - - -
 
{LANG_ACCESSDESCRIPTION}
 
 * {LANG_REQUIRED}
-
-
-
-
-
-
- - \ No newline at end of file diff --git a/templates/admin/group.htm.tpl b/templates/admin/group.htm.tpl new file mode 100644 index 0000000..326ee52 --- /dev/null +++ b/templates/admin/group.htm.tpl @@ -0,0 +1,170 @@ + + + + + + + + +
+
{TITLE}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{LANG_GROUPNAME} *
{LANG_DESCRIPTION} *
 
{LANG_USER_DEFINITIONS}
+ + + + + +
{LANG_USER_NAME}{LANG_USER_RIGHTS}
+
+ + + + + + + + + + + +
{LANG_USER_NAME} +  
{LANG_USER_RIGHTS} + + + + + + + + + + +
{LANG_READ}   {LANG_WRITE}   {LANG_LINK}   {LANG_HELP}
+
+
 
{LANG_ACTIVE} + + + +
 
 * {LANG_REQUIRED}
{WARNING}
+
+
+
+
+
+
+
+
+
+ \ No newline at end of file diff --git a/templates/admin/group.tpl.htm b/templates/admin/group.tpl.htm deleted file mode 100644 index d7681b0..0000000 --- a/templates/admin/group.tpl.htm +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - -
-
{TITLE}
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{LANG_GROUPNAME} *
{LANG_DESCRIPTION} *
 
{LANG_USER_DEFINITIONS}
- - - - - -
{LANG_USER_NAME}{LANG_USER_RIGHTS}
-
- - - - - - - - - - - -
{LANG_USER_NAME} -  
{LANG_USER_RIGHTS} - - - - - - - - - - -
{LANG_READ}   {LANG_WRITE}   {LANG_LINK}   {LANG_HELP}
-
-
 
{LANG_ACTIVE} - - - -
 
 * {LANG_REQUIRED}
{WARNING}
-
-
-
-
-
-
-
-
-
- \ No newline at end of file diff --git a/templates/admin/helpedit.htm.tpl b/templates/admin/helpedit.htm.tpl new file mode 100644 index 0000000..3b23d8c --- /dev/null +++ b/templates/admin/helpedit.htm.tpl @@ -0,0 +1,108 @@ + + + + + + + + +
+
{TITLE}
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{INFOKEY_1} + +
{INFOKEY_2} + +
{INFO_VERSION} + +
{LOAD_DEFAULT}
 
 
  +
+
+

{ERRORMESSAGE}{INFOMESSAGE}

+
+
+ \ No newline at end of file diff --git a/templates/admin/helpedit.tpl.htm b/templates/admin/helpedit.tpl.htm deleted file mode 100644 index 7a0ea56..0000000 --- a/templates/admin/helpedit.tpl.htm +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - -
-
{TITLE}
- - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{INFOKEY_1} - -
{INFOKEY_2} - -
{INFO_VERSION} - -
{LOAD_DEFAULT}
 
 
  -
-
-

{ERRORMESSAGE}{INFOMESSAGE}

-
-
- \ No newline at end of file diff --git a/templates/admin/hostdependencies.tpl.htm b/templates/admin/hostdependencies.htm.tpl similarity index 66% rename from templates/admin/hostdependencies.tpl.htm rename to templates/admin/hostdependencies.htm.tpl index d292312..7b88e4f 100644 --- a/templates/admin/hostdependencies.tpl.htm +++ b/templates/admin/hostdependencies.htm.tpl @@ -1,18 +1,15 @@ - + - - - - - - - - + + + + + +
{TITLE}
- - - -
-
- -
-
- +
+
{TITLE}
+ + + +
- - + + - - + + - - + + - - + + @@ -194,7 +196,7 @@
{LANG_COMMON_SETTINGS}
{LANG_HOST_NAME} *{LANG_HELP}{LANG_HELP} {LANG_DESCRIPTION} *{LANG_HELP}{LANG_HELP}
{LANG_ADDRESS} *{LANG_HELP}{LANG_HELP} {LANG_DISPLAY_NAME}{LANG_HELP}{LANG_HELP}
{LANG_PARENTS}

{LANG_CTRLINFO}
- @@ -203,13 +205,13 @@
- {LANG_MODIFY}
{LANG_HELP} + {LANG_MODIFY}
{LANG_HELP} {LANG_HOST_GROUPS}

{LANG_CTRLINFO}
- @@ -218,48 +220,48 @@
- {LANG_MODIFY}
{LANG_HELP} + {LANG_MODIFY}
{LANG_HELP}   - + - + - +
+ null {LANG_STANDARD}
- {LANG_HELP} + {LANG_HELP}   - + - + - +
+ null {LANG_STANDARD}
- {LANG_HELP} + {LANG_HELP} {LANG_CHECK_COMMAND} - - {LANG_HELP} + {LANG_HELP} {LANG_COMMAND_VIEW} @@ -267,39 +269,39 @@ $ARG1$ - - {LANG_HELP} + + {LANG_HELP} $ARG5$ - + $ARG2$ - + $ARG6$ - + $ARG3$ - + $ARG7$ - + $ARG4$ - + $ARG8$ - +   {LANG_REGISTERED} - - {LANG_HELP} + + {LANG_HELP} - {LANG_ADDITIONAL_TEMPLATES} + {LANG_ADDITIONAL_TEMPLATES} {LANG_ACTIVE} - + @@ -312,20 +314,20 @@ {LANG_TEMPLATE_NAME} - - - + +   -  * {LANG_REQUIRED} +  * {LANG_REQUIRED} {WARNING} @@ -333,9 +335,9 @@ - -
-
+ +
+
@@ -346,61 +348,61 @@ - + - - + + - - + + - - + + - + - + @@ -408,50 +410,50 @@ - + - - + + - + - + @@ -459,72 +461,72 @@ - + - + - - + + - - + + - + - + @@ -534,68 +536,68 @@ - + - + - + - + -
{LANG_CHECK_SETTINGS} - + - + - +
o d u
{LANG_HELP}{LANG_HELP} {LANG_RETRY_INTERVAL}min{LANG_HELP}min{LANG_HELP}
{LANG_MAX_CHECK_ATTEMPTS} *{LANG_HELP}{LANG_HELP} {LANG_CHECK_INTERVAL}min{LANG_HELP}min{LANG_HELP}
{LANG_ACTIVE_CHECKS_ENABLED} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP} {LANG_PASSIVE_CHECKS_ENABLED} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP}
 
{LANG_CHECK_PERIOD} * - {LANG_HELP}{LANG_HELP} {LANG_FRESHNESS_TRESHOLD}sec{LANG_HELP}sec{LANG_HELP}
{LANG_CHECK_FRESHNESS} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP} {LANG_OBSESS_OVER_HOST} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP}
 
{LANG_EVENT_HANDLER} - {LANG_HELP}{LANG_HELP} {LANG_EVENT_HANDLER_ENABLED} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP}
 
{LANG_LOW_FLAP_THRESHOLD}%{LANG_HELP}%{LANG_HELP} {LANG_HIGH_FLAP_THRESHOLD}%{LANG_HELP}%{LANG_HELP}
{LANG_FLAP_DETECTION_ENABLED} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP} {LANG_FLAP_DETECTION_OPTIONS} - + - + - +
o d u
{LANG_HELP}{LANG_HELP}
  - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP} {LANG_RETAIN_NOSTATUS_INFORMATION} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP}
{LANG_PROCESS_PERF_DATA} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP}  
 
 * {LANG_REQUIRED} * {LANG_REQUIRED} {WARNING}
 
-
-
- +
+
+
+ @@ -605,7 +607,7 @@
{LANG_ALARM_SETTINGS}
- @@ -614,13 +616,13 @@
- {LANG_MODIFY}
{LANG_HELP} + {LANG_MODIFY}
{LANG_HELP} {LANG_CONTACTS} *

{LANG_CTRLINFO}
- @@ -629,37 +631,37 @@
- {LANG_MODIFY}
{LANG_HELP}
+ {LANG_MODIFY}
{LANG_HELP}
  - + - + - +
+ null {LANG_STANDARD}
- {LANG_HELP} + {LANG_HELP}   - + - + - +
+ null {LANG_STANDARD}
- {LANG_HELP} + {LANG_HELP}   @@ -667,125 +669,131 @@ {LANG_NOTIFICATION_PERIOD} * - - {LANG_HELP} + {LANG_HELP} {LANG_NOTIFICATION_OPTIONS} {VERSION_20_STAR} - + - + - + - + - +
d u r f s
- {LANG_HELP} + {LANG_HELP} {LANG_NOTIFICATION_INTERVAL} * - min - {LANG_HELP} + min + {LANG_HELP} {LANG_FIRST_NOTIFICATION_DELAY} - min - {LANG_HELP} + min + {LANG_HELP} {LANG_NOTIFICATION_ENABLED} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
- {LANG_HELP} + {LANG_HELP} {LANG_STALKING_OPTIONS} - + - + - +
o d u
- {LANG_HELP} + {LANG_HELP} + + + {LANG_IMPORTANCE} + + {LANG_HELP} +     -  * {LANG_REQUIRED} +  * {LANG_REQUIRED} {WARNING}   - +
- +
- - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -793,13 +801,13 @@ - + @@ -822,13 +830,13 @@ - - + + - - + + @@ -839,8 +847,8 @@ - - + + @@ -849,7 +857,7 @@ - + @@ -858,7 +866,7 @@
{LANG_ADDON_SETTINGS}
{LANG_NOTES}{LANG_HELP}{LANG_HELP} {LANG_VRML_IMAGE}{LANG_HELP}{LANG_HELP}
{LANG_NOTES_URL}{LANG_HELP}{LANG_HELP} {LANG_STATUS_IMAGE}{LANG_HELP}{LANG_HELP}
{LANG_ACTION_URL}{LANG_HELP}{LANG_HELP}
{LANG_ICON_IMAGE}{LANG_HELP}{LANG_HELP} {LANG_2D_COORDS}(x,y){LANG_HELP}(x,y){LANG_HELP}
{LANG_ICON_IMAGE_ALT_TEXT}{LANG_HELP}{LANG_HELP} {LANG_3D_COORDS}(x,y,z){LANG_HELP}(x,y,z){LANG_HELP}
 
{LANG_ACCESS_GROUP} - {LANG_HELP}{LANG_HELP}
 
{LANG_VARIABLE_NAME}{LANG_HELP}{LANG_HELP}
{LANG_VARIABLE_VALUE}{LANG_HELP}{LANG_HELP}
{LANG_GENERIC_NAME}{LANG_HELP}{LANG_HELP}       
 * {LANG_REQUIRED} * {LANG_REQUIRED} {WARNING}
- +
@@ -874,13 +882,13 @@
{LANG_SERVICE_SETTINGS}
- +
- {LANG_MODIFY}
{LANG_HELP}
{LANG_MODIFY}
{LANG_HELP}
@@ -898,7 +906,7 @@ - +
 * {LANG_REQUIRED} * {LANG_REQUIRED} {WARNING}
@@ -908,13 +916,14 @@
-
-
-
- diff --git a/templates/admin/hosttemplates.tpl.htm b/templates/admin/hosttemplates.htm.tpl similarity index 67% rename from templates/admin/hosttemplates.tpl.htm rename to templates/admin/hosttemplates.htm.tpl index 62799d7..4d3f341 100644 --- a/templates/admin/hosttemplates.tpl.htm +++ b/templates/admin/hosttemplates.htm.tpl @@ -1,26 +1,24 @@ - + - - - - - - - - + + + + + +
{TITLE}
- - - -
+
-
+
@@ -119,11 +135,11 @@ - - + + - - + + @@ -131,7 +147,7 @@
{LANG_TEMPLATE_NAME} *{LANG_HELP}{LANG_HELP} {LANG_DESCRIPTION}{LANG_HELP}{LANG_HELP}
{LANG_PARENTS}

{LANG_CTRLINFO}
- @@ -140,13 +156,13 @@
- {LANG_MODIFY}
{LANG_HELP} + {LANG_MODIFY}
{LANG_HELP} {LANG_HOST_GROUPS}

{LANG_CTRLINFO}
- @@ -155,49 +171,49 @@
- {LANG_MODIFY}
{LANG_HELP} + {LANG_MODIFY}
{LANG_HELP}   - + - + - +
+ null {LANG_STANDARD}
- {LANG_HELP} + {LANG_HELP}   - + - + - +
+ null {LANG_STANDARD}
- {LANG_HELP} + {LANG_HELP} {LANG_CHECK_COMMAND} - - {LANG_HELP} + {LANG_HELP} {LANG_ACTIVE} - + @@ -206,34 +222,34 @@ $ARG1$ - - {LANG_HELP} + + {LANG_HELP} $ARG5$ - + $ARG2$ - + $ARG6$ - + $ARG3$ - + $ARG7$ - + $ARG4$ - + $ARG8$ - +   - {LANG_ADDITIONAL_TEMPLATES} + {LANG_ADDITIONAL_TEMPLATES} {LANG_TEMPLATE_NAME} @@ -245,19 +261,19 @@ {LANG_TEMPLATE_NAME} - - {LANG_HELP} - + {LANG_HELP} +   -  * {LANG_REQUIRED} +  * {LANG_REQUIRED} {WARNING} @@ -266,8 +282,8 @@ -
-
+
+
@@ -278,61 +294,61 @@ - + - - + + - - + + - - + + - + - + @@ -340,50 +356,50 @@ - + - - + + - + - + @@ -391,72 +407,72 @@ - + - + - - + + - - + + - + - + @@ -466,66 +482,66 @@ - + - + - + - +
{LANG_CHECK_SETTINGS} - + - + - +
o d u
{LANG_HELP}{LANG_HELP} {LANG_RETRY_INTERVAL}min{LANG_HELP}min{LANG_HELP}
{LANG_MAX_CHECK_ATTEMPTS}{LANG_HELP}{LANG_HELP} {LANG_CHECK_INTERVAL}min{LANG_HELP}min{LANG_HELP}
{LANG_ACTIVE_CHECKS_ENABLED} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP} {LANG_PASSIVE_CHECKS_ENABLED} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP}
 
{LANG_CHECK_PERIOD} - {LANG_HELP}{LANG_HELP} {LANG_FRESHNESS_TRESHOLD}sec{LANG_HELP}sec{LANG_HELP}
{LANG_CHECK_FRESHNESS} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP} {LANG_OBSESS_OVER_HOST} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP}
 
{LANG_EVENT_HANDLER} - {LANG_HELP}{LANG_HELP} {LANG_EVENT_HANDLER_ENABLED} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP}
 
{LANG_LOW_FLAP_THRESHOLD}%{LANG_HELP}%{LANG_HELP} {LANG_HIGH_FLAP_THRESHOLD}%{LANG_HELP}%{LANG_HELP}
{LANG_FLAP_DETECTION_ENABLED} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP} {LANG_FLAP_DETECTION_OPTIONS} - + - + - +
o d u
{LANG_HELP}{LANG_HELP}
  - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP} {LANG_RETAIN_NOSTATUS_INFORMATION} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP}
{LANG_PROCESS_PERF_DATA} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
{LANG_HELP}{LANG_HELP}
 
 * {LANG_REQUIRED} * {LANG_REQUIRED} {WARNING}
 
-
-
+
+
@@ -536,7 +552,7 @@
{LANG_ALARM_SETTINGS}
- @@ -545,13 +561,13 @@
- {LANG_MODIFY}
{LANG_HELP} + {LANG_MODIFY}
{LANG_HELP} {LANG_CONTACTS}

{LANG_CTRLINFO}
- @@ -560,115 +576,121 @@
- {LANG_MODIFY}
{LANG_HELP}
+ {LANG_MODIFY}
{LANG_HELP}
  - + - + - +
+ null {LANG_STANDARD}
- {LANG_HELP} + {LANG_HELP}   - + - + - +
+ null {LANG_STANDARD}
- {LANG_HELP} + {LANG_HELP}   - {LANG_NOTIFICATION_PERIOD}* + {LANG_NOTIFICATION_PERIOD} * - - {LANG_HELP} + {LANG_HELP} {LANG_NOTIFICATION_OPTIONS} - + - + - + - + - +
d u r f s
- {LANG_HELP} + {LANG_HELP} {LANG_NOTIFICATION_INTERVAL} - min - {LANG_HELP} + min + {LANG_HELP} {LANG_FIRST_NOTIFICATION_DELAY} - min - {LANG_HELP} + min + {LANG_HELP} {LANG_NOTIFICATION_ENABLED} - + - + - + - +
{LANG_ON} {LANG_OFF} {LANG_SKIP} null
- {LANG_HELP} + {LANG_HELP} {LANG_STALKING_OPTIONS} - + - + - +
o d u
- {LANG_HELP} + {LANG_HELP} + + + {LANG_IMPORTANCE} + + {LANG_HELP} +     -  * {LANG_REQUIRED} +  * {LANG_REQUIRED} {WARNING} @@ -683,40 +705,40 @@ {LANG_NOTES} - - {LANG_HELP} + + {LANG_HELP} {LANG_VRML_IMAGE} - - {LANG_HELP} + + {LANG_HELP} {LANG_NOTES_URL} - - {LANG_HELP} + + {LANG_HELP} {LANG_STATUS_IMAGE} - - {LANG_HELP} + + {LANG_HELP} {LANG_ACTION_URL} - - {LANG_HELP} + + {LANG_HELP} {LANG_ICON_IMAGE} - - {LANG_HELP} + + {LANG_HELP} {LANG_2D_COORDS} - (x,y) - {LANG_HELP} + (x,y) + {LANG_HELP} {LANG_ICON_IMAGE_ALT_TEXT} - - {LANG_HELP} + + {LANG_HELP} {LANG_3D_COORDS} - (x,y,z) - {LANG_HELP} + (x,y,z) + {LANG_HELP}   @@ -724,13 +746,13 @@ {LANG_ACCESS_GROUP} - - {LANG_HELP} + {LANG_HELP}   @@ -753,33 +775,34 @@ {LANG_VARIABLE_NAME} - - {LANG_HELP} + + {LANG_HELP} {LANG_VARIABLE_VALUE} - - {LANG_HELP} + + {LANG_HELP}   -  * {LANG_REQUIRED} +  * {LANG_REQUIRED} {WARNING}   -
+
+ diff --git a/templates/admin/import.htm.tpl b/templates/admin/import.htm.tpl new file mode 100644 index 0000000..5795f08 --- /dev/null +++ b/templates/admin/import.htm.tpl @@ -0,0 +1,72 @@ + + + + + + + + +
+
{TITLE}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{LANG_SEARCH_STRING}{LANG_SEARCH} {LANG_DELETE_SEARCH}
{IMPORTFILE} +
{CTRL_INFO}
{LOCAL_FILE}
{OVERWRITE}
 
 
 
+ +

{IMPORT_INFO_1}{IMPORT_INFO_2}

+

{ERRORMESSAGE}{INFOMESSAGE}

+
+ \ No newline at end of file diff --git a/templates/admin/import.tpl.htm b/templates/admin/import.tpl.htm deleted file mode 100644 index 84013aa..0000000 --- a/templates/admin/import.tpl.htm +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - -
-
{TITLE}
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{LANG_SEARCH_STRING}{LANG_SEARCH} {LANG_DELETE_SEARCH}
{IMPORTFILE} -
{CTRL_INFO}
{LOCAL_FILE}
{OVERWRITE}
 
 
 
-
-

{IMPORT_INFO_1}{IMPORT_INFO_2}

-

{ERRORMESSAGE}{INFOMESSAGE}

-
- \ No newline at end of file diff --git a/templates/admin/logbook.htm.tpl b/templates/admin/logbook.htm.tpl new file mode 100644 index 0000000..dfb3eae --- /dev/null +++ b/templates/admin/logbook.htm.tpl @@ -0,0 +1,115 @@ + + + + + + + + +
+
{TITLE}
+ + +
+ + + + + + +
{LANG_SEARCH_STRING}:{LANG_SEARCH} {LANG_DELETE_SEARCH}
+
+ + + + + + + + + + + + + + + + + +
{LANG_TIME}{LANG_USER}{LANG_IP}{LANG_DOMAIN}{LANG_ENTRY}
{DAT_TIME}{DAT_ACCOUNT}{DAT_IPADRESS}{DAT_DOMAIN}{DAT_ACTION}
+ + + + + +
{LANG_PREVIOUS}{LANG_NEXT}
+
+ + + + + + + + + + + + + +
{LANG_ENTRIES_BEFORE}
{LANG_FROM}:{LANG_CALENDAR} {LANG_DELETE_SEARCH}{LANG_TO}:{LANG_CALENDAR} {LANG_DELETE_SEARCH}
+
+

{ERRORMESSAGE}{INFOMESSAGE}

+
+ + +
+
+ \ No newline at end of file diff --git a/templates/admin/mainpages.tpl.htm b/templates/admin/mainpages.htm.tpl similarity index 50% rename from templates/admin/mainpages.tpl.htm rename to templates/admin/mainpages.htm.tpl index 47840a5..47f118a 100644 --- a/templates/admin/mainpages.tpl.htm +++ b/templates/admin/mainpages.htm.tpl @@ -1,27 +1,23 @@ - + - - - - - - - - + + + + + +
{TITLE}
- - -

{DESC}

-
+

{DESC}

+
-

{STATISTICS}

- - - +

{STATISTICS}

+
{TYPE}
+ + - + @@ -29,11 +25,11 @@ -
{TYPE} {ACTIVE} {INACTIVE}
{NAME}{INACT_COUNT}
+
-
+
\ No newline at end of file diff --git a/templates/admin/menuaccess.htm.tpl b/templates/admin/menuaccess.htm.tpl new file mode 100644 index 0000000..3ccf3e3 --- /dev/null +++ b/templates/admin/menuaccess.htm.tpl @@ -0,0 +1,62 @@ + + + + + + + + +
+
{TITLE}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
{LANG_MENU_PAGE} + +
 
{LANG_ACCESS_GROUP} +
 
{LANG_ACCESSDESCRIPTION}
 
 
+
+

{ERRORMESSAGE}{INFOMESSAGE}

+
+ \ No newline at end of file diff --git a/templates/admin/mutdialog.tpl.htm b/templates/admin/mutdialog.htm.tpl similarity index 58% rename from templates/admin/mutdialog.tpl.htm rename to templates/admin/mutdialog.htm.tpl index ce91316..e71663c 100644 --- a/templates/admin/mutdialog.tpl.htm +++ b/templates/admin/mutdialog.htm.tpl @@ -1,19 +1,18 @@ - + - - - - - - - + + + + + none - + + @@ -24,8 +23,8 @@
- - - + + - + - - - + + + - - +
- + - - + + - - + + - - + + - - + + - - + +
+ @@ -33,15 +32,15 @@ - + diff --git a/templates/admin/nagioscfg.htm.tpl b/templates/admin/nagioscfg.htm.tpl new file mode 100644 index 0000000..f7ce1da --- /dev/null +++ b/templates/admin/nagioscfg.htm.tpl @@ -0,0 +1,62 @@ + + + + + + + + +
+
{TITLE}
+ + +
{AVAILABLE}  
-   -
<-

->{DISABLE_HTML_BEGIN}

!->{DISABLE_HTML_END}
<-

->{DISABLE_HTML_BEGIN}

!->{DISABLE_HTML_END}
 
+ + + + + + + + + +
 
  +
+ +
+

{ERRORMESSAGE}{INFOMESSAGE}

+ +
+ \ No newline at end of file diff --git a/templates/admin/nagioscfg.tpl.htm b/templates/admin/nagioscfg.tpl.htm deleted file mode 100644 index 9b3954c..0000000 --- a/templates/admin/nagioscfg.tpl.htm +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - -
-
{TITLE}
- - - -
- - - - - - - - - - -
 
  -
-
-
-

{ERRORMESSAGE}{INFOMESSAGE}

-
-
- \ No newline at end of file diff --git a/templates/admin/password.htm.tpl b/templates/admin/password.htm.tpl new file mode 100644 index 0000000..b8c4943 --- /dev/null +++ b/templates/admin/password.htm.tpl @@ -0,0 +1,85 @@ + + + + + + + + +
+
{LANG_CHANGE_PASSWORD}
+ +
+ + + + + + + + + + + + + + + + + + + +
{LANG_OLD_PASSWORD} *
{LANG_NEW_PASSWORD} *
{LANG_CONFIRM_PASSWORD} *
 
 * {LANG_REQUIRED}
+
+
+

{ERRORMESSAGE}

+
+
+ \ No newline at end of file diff --git a/templates/admin/servicedependencies.tpl.htm b/templates/admin/servicedependencies.htm.tpl similarity index 69% rename from templates/admin/servicedependencies.tpl.htm rename to templates/admin/servicedependencies.htm.tpl index 104c87d..c000d33 100644 --- a/templates/admin/servicedependencies.tpl.htm +++ b/templates/admin/servicedependencies.htm.tpl @@ -1,18 +1,15 @@ - + - - - - - - - - + + + + + +
{TITLE}
- - - -
+ - - + +
{LANG_SERVICEGROUP_NAME} *{LANG_HELP}{LANG_HELP} {LANG_MEMBERS} {VERSION_20_STAR} -
- +
+
{LANG_MODIFY}
{LANG_HELP}
{LANG_MODIFY}
{LANG_HELP}
{LANG_DESCRIPTION} *{LANG_HELP}{LANG_HELP} {LANG_CTRLINFO}
{LANG_NOTES}{LANG_HELP}{LANG_HELP}
{LANG_NOTES_URL}{LANG_HELP}{LANG_HELP}
{LANG_ACTION_URL}{LANG_HELP}{LANG_HELP} {LANG_SERVICEGROUP_MEMBERS} -
- + - - + +
+
{LANG_MODIFY}
{LANG_HELP}
{LANG_MODIFY}
{LANG_HELP}
{LANG_ACCESS_GROUP} - + + + {LANG_HELP}{LANG_HELP} {LANG_CTRLINFO}
 
{LANG_REGISTERED}{LANG_HELP}{LANG_REGISTERED}{LANG_HELP}
{LANG_ACTIVE} + @@ -152,14 +151,14 @@  
 * {LANG_REQUIRED} * {LANG_REQUIRED} {WARNING}
 
- + {CHECK_MUST_DATA}
diff --git a/templates/admin/services.tpl.htm b/templates/admin/services.htm.tpl similarity index 59% rename from templates/admin/services.tpl.htm rename to templates/admin/services.htm.tpl index 9045233..dd992d4 100644 --- a/templates/admin/services.tpl.htm +++ b/templates/admin/services.htm.tpl @@ -1,18 +1,15 @@ - + - - - - - - - - + + + + + +
{TITLE}
- - - -
-
-
    + +
    + -
    -
    - + +
    +
    +
    - - + + @@ -211,124 +214,142 @@
    {LANG_COMMON_SETTINGS}
    {LANG_CONFIG_NAME} *{LANG_HELP}{LANG_HELP}      
    - +
    - {LANG_MODIFY}
    {LANG_HELP} + {LANG_MODIFY}
    {LANG_HELP} {LANG_HOST_GROUPS} (*)

    {LANG_CTRLINFO}
    - +
    - {LANG_MODIFY}
    {LANG_HELP} + {LANG_MODIFY}
    {LANG_HELP}   - + - + - +
    + null {LANG_STANDARD}
    - {LANG_HELP} + {LANG_HELP}   - + - + - +
    + null {LANG_STANDARD}
    - {LANG_HELP} + {LANG_HELP} - {LANG_SERVICE_DESCRIPTION} * - - {LANG_HELP} - {LANG_SERVICEGROUPS}

    {LANG_CTRLINFO} - - + + - - - - - - - - - - - - - - - - -
    {LANG_PARENT_SERVICES}

    {LANG_CTRLINFO}
    +
    - +
    {LANG_MODIFY}
    {LANG_HELP}
    {LANG_DISPLAY_NAME}{LANG_HELP}
    {LANG_REGISTERED}{LANG_HELP}
    {LANG_ACTIVE} - - + + + + + + + + - + + + + - + + + + + + - + @@ -336,34 +357,40 @@ - - + + - + - + - + - + - + - + - + - + + + + - + + + @@ -374,20 +401,20 @@ - - + + - + @@ -395,9 +422,9 @@ -
    {LANG_MODIFY}
    {LANG_HELP}
    {LANG_SERVICEGROUPS}

    {LANG_CTRLINFO}
    + - + + +
    + +
    +
    {LANG_MODIFY}
    {LANG_HELP}
      + + + - + - +
    + null {LANG_STANDARD}
    {LANG_HELP}{LANG_HELP}  + + + + + + + + + +
    +null{LANG_STANDARD}
    +
    {LANG_HELP}
     {LANG_SERVICE_DESCRIPTION} *{LANG_HELP}{LANG_DISPLAY_NAME}{LANG_HELP}
    {LANG_CHECK_COMMAND} * - + {LANG_HELP}{LANG_HELP}
    {LANG_COMMAND_VIEW}
    $ARG1${LANG_HELP}{LANG_HELP} $ARG5$
    $ARG2$ $ARG6$
    $ARG3$ $ARG7$
    $ARG4$ $ARG8$
      {LANG_REGISTERED}{LANG_HELP}
    {LANG_ADDITIONAL_TEMPLATES}{LANG_ADDITIONAL_TEMPLATES}{LANG_ACTIVE} +
    {LANG_TEMPLATE_NAME}
    {LANG_TEMPLATE_NAME} - + {LANG_HELP}{LANG_HELP}
     
     * {LANG_REQUIRED} * {LANG_REQUIRED} {WARNING}
    - -
    +
    +
    +
    @@ -408,131 +435,131 @@ - + - - + + - - + + - - + + - + - - + + - - + - + - - + + - + - + @@ -540,74 +567,74 @@ - + - + - - + + - - + + - + - + @@ -617,74 +644,74 @@ - + - + - + - + - + @@ -692,7 +719,7 @@
    {LANG_CHECK_SETTINGS} - + - + - + - +
    o w u c
    {LANG_HELP}{LANG_HELP} {LANG_RETRY_INTERVAL} *min{LANG_HELP}min{LANG_HELP}
    {LANG_MAX_CHECK_ATTEMPTS} *{LANG_HELP} {LANG_HELP} {LANG_CHECK_INTERVAL} *min{LANG_HELP} min{LANG_HELP}
    {LANG_ACTIVE_CHECKS_ENABLED} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP} {LANG_PASSIVE_CHECKS_ENABLED} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}
    {LANG_HELP}
     
    {LANG_PARALLELIZE_CHECK} + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP}
    {LANG_HELP}{LANG_HELP}  
    {LANG_CHECK_PERIOD} * - + - + {LANG_HELP}{LANG_HELP} {LANG_FRESHNESS_TRESHOLD}sec{LANG_HELP}sec{LANG_HELP}
    {LANG_CHECK_FRESHNESS} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP} {LANG_OBSESS_OVER_SERVICE} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP}
     
    {LANG_EVENT_HANDLER} - + - + {LANG_HELP}{LANG_HELP} {LANG_EVENT_HANDLER_ENABLED} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP}
     
    {LANG_LOW_FLAP_THRESHOLD}%{LANG_HELP}%{LANG_HELP} {LANG_HIGH_FLAP_THRESHOLD}%{LANG_HELP}%{LANG_HELP}
    {LANG_FLAP_DETECTION_ENABLED} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP} {LANG_FLAP_DETECTION_OPTIONS} - + - + - + - +
    o w u c
    {LANG_HELP}{LANG_HELP}
      - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP} {LANG_RETAIN_NOSTATUS_INFORMATION} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP}
    {LANG_PROCESS_PERF_DATA} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP} {LANG_IS_VOLATILE} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP}
     
     * {LANG_REQUIRED} * {LANG_REQUIRED} {WARNING}
    -
    +
    @@ -703,62 +730,62 @@
    {LANG_ALARM_SETTINGS}
    - -
    - -
    - - {LANG_MODIFY}
    {LANG_HELP} - - {LANG_CONTACTS} *

    {LANG_CTRLINFO}
    - - - -
    - + + +
    - {LANG_MODIFY}
    {LANG_HELP}
    + {LANG_MODIFY}
    {LANG_HELP} + + {LANG_CONTACTS} *

    {LANG_CTRLINFO}
    + + + + + +
    + +
    + + {LANG_MODIFY}
    {LANG_HELP}
      - + - + - + -
    + null {LANG_STANDARD}
    + - {LANG_HELP} + {LANG_HELP}   - + - + - + -
    + null {LANG_STANDARD}
    + - {LANG_HELP} + {LANG_HELP}   @@ -766,81 +793,87 @@ {LANG_NOTIFICATION_PERIOD} * - + - + - {LANG_HELP} + {LANG_HELP} {LANG_NOTIFICATION_OPTIONS} {VERSION_20_STAR} - + - + - + - + - + - +
    w u c r f s
    - {LANG_HELP} + {LANG_HELP} {LANG_NOTIFICATION_INTERVAL} * - min - {LANG_HELP} + min + {LANG_HELP} {LANG_FIRST_NOTIFICATION_DELAY} - min - {LANG_HELP} + min + {LANG_HELP} {LANG_NOTIFICATION_ENABLED} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    - {LANG_HELP} + {LANG_HELP} {LANG_STALKING_OPTIONS} - + - + - + - +
    o d u c
    - {LANG_HELP} + {LANG_HELP} + + + {LANG_IMPORTANCE} + + {LANG_HELP} +     -  * {LANG_REQUIRED} +  * {LANG_REQUIRED} {WARNING} @@ -848,31 +881,31 @@
    -
    +
    - - + + - - + + - - + + - - + + - - + + @@ -880,13 +913,13 @@ - + @@ -909,13 +942,13 @@ - - + + - - + + @@ -926,8 +959,8 @@ - - + + @@ -936,7 +969,7 @@ - + @@ -947,16 +980,17 @@ - {CHECK_MUST_DATA}
    - +
    @@ -972,6 +1006,9 @@
    +
    +
    +
    diff --git a/templates/admin/servicetemplates.tpl.htm b/templates/admin/servicetemplates.htm.tpl similarity index 63% rename from templates/admin/servicetemplates.tpl.htm rename to templates/admin/servicetemplates.htm.tpl index a38d9c7..de95cfb 100644 --- a/templates/admin/servicetemplates.tpl.htm +++ b/templates/admin/servicetemplates.htm.tpl @@ -1,18 +1,15 @@ - + - - - - - - - - + + + + + +
    {TITLE}
    - - - -
    +
    {LANG_ADDON_SETTINGS}
    {LANG_NOTES}{LANG_HELP}{LANG_HELP} {LANG_ICON_IMAGE}{LANG_HELP}{LANG_HELP}
    {LANG_NOTES_URL}{LANG_HELP}{LANG_HELP} {LANG_ICON_IMAGE_ALT_TEXT}{LANG_HELP}{LANG_HELP}
    {LANG_ACTION_URL}{LANG_HELP}{LANG_HELP}
     
    {LANG_ACCESS_GROUP} - + {LANG_HELP}{LANG_HELP}
     
    {LANG_VARIABLE_NAME}{LANG_HELP}{LANG_HELP}
    {LANG_VARIABLE_VALUE}{LANG_HELP}{LANG_HELP}
    {LANG_GENERIC_NAME}{LANG_HELP}{LANG_HELP}       
     * {LANG_REQUIRED} * {LANG_REQUIRED} {WARNING}
    +
    - - + + @@ -159,117 +161,141 @@
    {LANG_COMMON_SETTINGS}
    {LANG_TEMPLATE_NAME} *{LANG_HELP}{LANG_HELP}      
    - + - +
    - {LANG_MODIFY}
    {LANG_HELP} + {LANG_MODIFY}
    {LANG_HELP} {LANG_HOST_GROUPS}

    {LANG_CTRLINFO}
    - + - +
    - {LANG_MODIFY}
    {LANG_HELP} + {LANG_MODIFY}
    {LANG_HELP}   - + - + - +
    + null {LANG_STANDARD}
    - {LANG_HELP} + {LANG_HELP} - + - + - +
    + null {LANG_STANDARD}
    - {LANG_HELP} + {LANG_HELP} - {LANG_SERVICE_DESCRIPTION} - - {LANG_HELP} - {LANG_SERVICEGROUPS}

    {LANG_CTRLINFO} - + {LANG_PARENT_SERVICES}

    {LANG_CTRLINFO}
    + + + + + +
    + +
    + + {LANG_MODIFY}
    {LANG_HELP}
    + {LANG_SERVICEGROUPS}

    {LANG_CTRLINFO} + - +
    - + - +
    - {LANG_MODIFY}
    {LANG_HELP} + {LANG_MODIFY}
    {LANG_HELP} - {LANG_DISPLAY_NAME} - - {LANG_HELP} - - - {LANG_ACTIVE} - - - - -   +   + + + + + + + + + + +
    +null{LANG_STANDARD}
    + + {LANG_HELP} +   - + - + - + -
    + null {LANG_STANDARD}
    + - {LANG_HELP} + {LANG_HELP} + + + {LANG_SERVICE_DESCRIPTION} * + + {LANG_HELP} + {LANG_DISPLAY_NAME} + + {LANG_HELP} {LANG_CHECK_COMMAND} - + - + - {LANG_HELP} + {LANG_HELP} {LANG_COMMAND_VIEW} @@ -277,34 +303,37 @@ $ARG1$ - - {LANG_HELP} + + {LANG_HELP} $ARG5$ - + $ARG2$ - + $ARG6$ - + $ARG3$ - + $ARG7$ - + $ARG4$ - + $ARG8$ - +   - {LANG_ADDITIONAL_TEMPLATES} + {LANG_ADDITIONAL_TEMPLATES} + {LANG_ACTIVE} + + {LANG_TEMPLATE_NAME} @@ -316,20 +345,20 @@ {LANG_TEMPLATE_NAME} - + - + - {LANG_HELP} + {LANG_HELP}   -  * {LANG_REQUIRED} +  * {LANG_REQUIRED} {WARNING} @@ -337,9 +366,9 @@ - +
    -
    +
    @@ -350,130 +379,130 @@ - + - - + + - - + + - - + + - + - - + + - - + - + - - + + - + - + @@ -481,74 +510,74 @@ - + - + - - + + - - + + - + - + @@ -558,74 +587,74 @@ - + - + - + - + - + @@ -644,142 +673,148 @@
    {LANG_CHECK_SETTINGS} - + - + - + - +
    o w u c
    {LANG_HELP}{LANG_HELP} {LANG_RETRY_INTERVAL}min{LANG_HELP}min{LANG_HELP}
    {LANG_MAX_CHECK_ATTEMPTS}{LANG_HELP}{LANG_HELP} {LANG_CHECK_INTERVAL}min{LANG_HELP}min{LANG_HELP}
    {LANG_ACTIVE_CHECKS_ENABLED} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP} {LANG_PASSIVE_CHECKS_ENABLED} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}
    {LANG_HELP}
     
    {LANG_PARALLELIZE_CHECK} + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP}
    {LANG_HELP}{LANG_HELP}
    {LANG_CHECK_PERIOD} - + - + {LANG_HELP}{LANG_HELP} {LANG_FRESHNESS_TRESHOLD}sec{LANG_HELP}sec{LANG_HELP}
    {LANG_CHECK_FRESHNESS} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP} {LANG_OBSESS_OVER_SERVICE} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP}
     
    {LANG_EVENT_HANDLER} - + - + {LANG_HELP}{LANG_HELP} {LANG_EVENT_HANDLER_ENABLED} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP}
     
    {LANG_LOW_FLAP_THRESHOLD}%{LANG_HELP}%{LANG_HELP} {LANG_HIGH_FLAP_THRESHOLD}%{LANG_HELP}%{LANG_HELP}
    {LANG_FLAP_DETECTION_ENABLED} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP} {LANG_FLAP_DETECTION_OPTIONS} - + - + - + - +
    o w u c
    {LANG_HELP}{LANG_HELP}
      - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP} {LANG_RETAIN_NOSTATUS_INFORMATION} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP}
    {LANG_PROCESS_PERF_DATA} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP} {LANG_IS_VOLATILE} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    {LANG_HELP}{LANG_HELP}
     
     * {LANG_REQUIRED} * {LANG_REQUIRED} {WARNING}
    - + - +
    - {LANG_MODIFY}
    {LANG_HELP} + {LANG_MODIFY}
    {LANG_HELP} {LANG_CONTACTS}

    {LANG_CTRLINFO}
    - + - +
    - {LANG_MODIFY}
    {LANG_HELP}
    + {LANG_MODIFY}
    {LANG_HELP}
      - + - + - + -
    + null {LANG_STANDARD}
    + - {LANG_HELP} + {LANG_HELP} - + - + - + -
    + null {LANG_STANDARD}
    + - {LANG_HELP} + {LANG_HELP}   - {LANG_NOTIFICATION_PERIOD}* + {LANG_NOTIFICATION_PERIOD} * - + - + - {LANG_HELP} + {LANG_HELP} {LANG_NOTIFICATION_OPTIONS} - + - + - + - + - + - +
    w u c r f s
    - {LANG_HELP} + {LANG_HELP} {LANG_NOTIFICATION_INTERVAL} - - {LANG_HELP} + + {LANG_HELP} {LANG_FIRST_NOTIFICATION_DELAY} - - {LANG_HELP} + + {LANG_HELP} {LANG_NOTIFICATION_ENABLED} - + - + - + - +
    {LANG_ON} {LANG_OFF} {LANG_SKIP} null
    - {LANG_HELP} + {LANG_HELP} {LANG_STALKING_OPTIONS} - + - + - + - +
    o w u c
    - {LANG_HELP} + {LANG_HELP} + + + {LANG_IMPORTANCE} + + {LANG_HELP} +     -  * {LANG_REQUIRED} +  * {LANG_REQUIRED} {WARNING} @@ -794,24 +829,24 @@ {LANG_NOTES} - - {LANG_HELP} + + {LANG_HELP} {LANG_ICON_IMAGE} - - {LANG_HELP} + + {LANG_HELP} {LANG_NOTES_URL} - - {LANG_HELP} + + {LANG_HELP} {LANG_ICON_IMAGE_ALT_TEXT} - - {LANG_HELP} + + {LANG_HELP} {LANG_ACTION_URL} - - {LANG_HELP} + + {LANG_HELP}   @@ -819,13 +854,13 @@ {LANG_ACCESS_GROUP} - + - + - {LANG_HELP} + {LANG_HELP}   @@ -848,20 +883,20 @@ {LANG_VARIABLE_NAME} - - {LANG_HELP} + + {LANG_HELP} {LANG_VARIABLE_VALUE} - - {LANG_HELP} + + {LANG_HELP}   -  * {LANG_REQUIRED} +  * {LANG_REQUIRED} {WARNING} @@ -870,18 +905,19 @@
    -
    - - {CHECK_MUST_DATA}
    -
    +
    @@ -897,6 +933,9 @@
    +
    +
    +
    diff --git a/templates/admin/settings.htm.tpl b/templates/admin/settings.htm.tpl new file mode 100644 index 0000000..76b769c --- /dev/null +++ b/templates/admin/settings.htm.tpl @@ -0,0 +1,283 @@ + + + + + + + + +
    +
    {TITLE}
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {PATH}
    {TEMPDIR_NAME} *{LANG_HELP}
    {PROTOCOL_NAME} * + + {LANG_HELP}
     
    {DATA}
    {LOCALE} + + {LANG_HELP}
    {ENCODING_NAME}{LANG_HELP}
     
    {DB}
    {SERVER_NAME} *{LANG_HELP}
    {SERVER_PORT} *{LANG_HELP}
    {DATABASE_NAME} *{LANG_HELP}
    {USERNAME_NAME} *{LANG_HELP}
    {PASSWORD_NAME}{LANG_HELP}
     
    {SECURITY}
    {LOGOFFTIME_NAME}{LANG_HELP}
    {WSAUTH_NAME} * + + {LANG_HELP}
     
    {COMMON}
    {PAGELINES_NAME}{LANG_HELP}
    {SELDISABLE_NAME} + + {LANG_HELP}
    {TEMPLATE_CHECK} +
    {LANG_ENABLE}
    +
    {LANG_DISABLE}
    +
    {LANG_HELP}
    {UPDATE_CHECK} +
    {LANG_ENABLE}
    +
    {LANG_DISABLE}
    +
    {LANG_HELP}
    {UPD_PROXY_CHECK} +
    {LANG_ENABLE}
    +
    {LANG_DISABLE}
    +
    {LANG_HELP}
    {UPD_PROXY_SERVER} *{LANG_HELP}
    {UPD_PROXY_USERNAME}{LANG_HELP}
    {UPD_PROXY_PASSWORD}{LANG_HELP}
     
     * {LANG_REQUIRED}
    +
    +
    +

    {ERRORMESSAGE}{INFOMESSAGE}

    +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/templates/admin/settings.tpl.htm b/templates/admin/settings.tpl.htm deleted file mode 100644 index 0f59940..0000000 --- a/templates/admin/settings.tpl.htm +++ /dev/null @@ -1,285 +0,0 @@ - - - - - - - - - - -
    -
    {TITLE}
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {PATH}
    {TEMPDIR_NAME} *{LANG_HELP}
    {PROTOCOL_NAME} * - - {LANG_HELP}
     
    {DATA}
    {LOCALE} - - {LANG_HELP}
    {ENCODING_NAME}{LANG_HELP}
     
    {DB}
    {SERVER_NAME} *{LANG_HELP}
    {SERVER_PORT} *{LANG_HELP}
    {DATABASE_NAME} *{LANG_HELP}
    {USERNAME_NAME} *{LANG_HELP}
    {PASSWORD_NAME}{LANG_HELP}
     
    {SECURITY}
    {LOGOFFTIME_NAME}{LANG_HELP}
    {WSAUTH_NAME}* - - {LANG_HELP}
     
    {COMMON}
    {PAGELINES_NAME}{LANG_HELP}
    {SELDISABLE_NAME} - - {LANG_HELP}
    {TEMPLATE_CHECK} -
    {LANG_ENABLE}
    -
    {LANG_DISABLE}
    -
    {LANG_HELP}
    {UPDATE_CHECK} -
    {LANG_ENABLE}
    -
    {LANG_DISABLE}
    -
    {LANG_HELP}
    {UPD_PROXY_CHECK} -
    {LANG_ENABLE}
    -
    {LANG_DISABLE}
    -
    {LANG_HELP}
    {UPD_PROXY_SERVER} *{LANG_HELP}
    {UPD_PROXY_USERNAME}{LANG_HELP}
    {UPD_PROXY_PASSWORD}{LANG_HELP}
     
     * {LANG_REQUIRED}
    -
    -
    -

    {ERRORMESSAGE}{INFOMESSAGE}

    -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/templates/admin/support.tpl.htm b/templates/admin/support.htm.tpl similarity index 62% rename from templates/admin/support.tpl.htm rename to templates/admin/support.htm.tpl index 2ffdaf7..9f10ebc 100644 --- a/templates/admin/support.tpl.htm +++ b/templates/admin/support.htm.tpl @@ -1,28 +1,27 @@ - + - - - - - - + + + +
    {TITLE}
    - -

    {SUBTITLE_1}

    {SUPPORT_TEXT_1}

    -

    NagiosQL +

    {WEBSITE_LINK}

    {SUBTITLE_2}

    -

    {SUPPORT_TEXT_2}

    +

    {SUPPORT_TEXT_2}

    {DONATE_LINK}

    {SUBTITLE_3}

    -

    {SUPPORT_TEXT_3}

    +

    {SUPPORT_TEXT_3}

    {TRANSLATION_LINK} +

    {SUBTITLE_8}

    +

    {SUPPORT_TEXT_5}

    +

    {GIT_LINK}

    {SUBTITLE_4}

    -

    {SUPPORT_TEXT_4}

    +

    {SUPPORT_TEXT_4}

    Loading...
    @@ -30,103 +29,102 @@

    {SUBTITLE_5}

    - + - + - + - + - + - + - + - + - + - + - + - + - + - +
    JavascriptJavascript {FAILED}{INI_FILE_UPLOADS}{INI_FILE_UPLOADS} {INI_FILE_UPLOADS_RESULT}
    {PHP_VERSION}{PHP_VERSION} {PHP_RESULT}{INI_AUTO_START}{INI_AUTO_START} {INI_AUTO_START_RESULT}
    {PHP_SESSION_MODULE}{PHP_SESSION_MODULE} {PHP_SESSION_RESULT}{INI_SUHO_SESS_ENC}{INI_SUHO_SESS_ENC} {INI_SUHO_SESS_ENC_RESULT}
    {PHP_GETTEXT_MODULE}{PHP_GETTEXT_MODULE} {PHP_GETTEXT_RESULT}{INI_DATE_TIMEZONE}{INI_DATE_TIMEZONE} {INI_DATE_TIMEZONE_RESULT}
    {PHP_FTP_MODULE}{PHP_FTP_MODULE} {PHP_FTP_RESULT}{RW_CONFIG}{RW_CONFIG} {RW_CONFIG_RESULT}
    {PHP_SSH2_MODULE}{PHP_SSH2_MODULE} {PHP_SSH2_RESULT}    
    {DB_VERSION}{DB_VERSION} {DB_RESULT}    

    {SUBTITLE_6}

    -

    {SUPPORT_TEXT_6}

    +

    {SUPPORT_TEXT_6}

    - + - + - + - + - + - + - - - + + +
    {DOMAIN_NAME}{DOMAIN_NAME} {DOMAIN_NAME_VALUE}{RW_NAG_CONF}{RW_NAG_CONF} {RW_NAG_CONF_RESULT}
    {CONNECT_TYPE}{CONNECT_TYPE} {CONNECT_TYPE_RESULT}{CHECK_NAG_LOCK}{CHECK_NAG_LOCK} {CHECK_NAG_LOCK_RESULT}
    {CONNECT_CHECK}{CONNECT_CHECK} {CONNECT_CHECK_RESULT}{RW_NAG_COMMAND}{RW_NAG_COMMAND} {RW_NAG_COMMAND_RESULT}
    {EXE_NAG_BINARY}  {EXE_NAG_BINARY} {EXE_NAG_BINARY_RESULT}

    {SUBTITLE_7}

    - +
    - - - + + + - - - + + +
    {CONFIGURATION_NAME}{USED}{DEMON_CONFIG}{CONFIGURATION_NAME}{USED}{DEMON_CONFIG}
    {CONFIG_NAME}{ACTIVE_CONFIG_COUNT}{DEMON_CFG_OK}{CONFIG_NAME}{ACTIVE_CONFIG_COUNT}{DEMON_CFG_OK}
    -

    {ERRORMESSAGE}{INFOMESSAGE}

    - - +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {LANG_TIME_PERIOD} *{LANG_HELP}{LANG_EXCLUDE} + + + + +
    + +
    +
    {LANG_MODIFY}
    {LANG_HELP}
    {LANG_DESCRIPTION} *{LANG_HELP}{LANG_CTRLINFO}
    {LANG_TPLNAME}{LANG_HELP}
    {LANG_ACCESS_GROUP} + + {LANG_HELP}
    {LANG_REGISTERED}{LANG_HELP}
    {LANG_ACTIVE} + + + + + {LANG_INCLUDE} + + + + +
    + +
    +
    {LANG_MODIFY}
    {LANG_HELP}
     {LANG_CTRLINFO}
     
    {LANG_TIME_DEFINITIONS}
    + + + + + +
    {LANG_TIME_DEFINITION}{LANG_TIME_RANGE}
    +
    {LANG_WEEKDAY} + + {LANG_HELP}
    {LANG_TIME_RANGE}{LANG_HELP}
    {LANG_TIME_DEFINITION}{LANG_HELP}
    {LANG_TIME_RANGE}{LANG_HELP}
     
     * {LANG_REQUIRED}{WARNING}
     
    +
    + [{LANG_SHOW_RELATION_DATA}][{LANG_HIDE_RELATION_DATA}]{CHECK_MUST_DATA} +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/templates/admin/timeperiods.tpl.htm b/templates/admin/timeperiods.tpl.htm deleted file mode 100644 index b6b7092..0000000 --- a/templates/admin/timeperiods.tpl.htm +++ /dev/null @@ -1,233 +0,0 @@ - - - - - - - - - - -
    -
    {TITLE}
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {LANG_TIME_PERIOD} *{LANG_HELP}{LANG_EXCLUDE} - - - - -
    - -
    -
    {LANG_MODIFY}
    {LANG_HELP}
    {LANG_DESCRIPTION} *{LANG_HELP}{LANG_CTRLINFO}
    {LANG_TPLNAME}{LANG_HELP}
    {LANG_ACCESS_GROUP} - - {LANG_HELP}
    {LANG_REGISTERED}{LANG_HELP}
    {LANG_ACTIVE} - - - - - {LANG_INCLUDE} - - - - -
    - -
    -
    {LANG_MODIFY}
    {LANG_HELP}
     {LANG_CTRLINFO}
     
    {LANG_TIME_DEFINITIONS}
    - - - - - -
    {LANG_TIME_DEFINITION}{LANG_TIME_RANGE}
    -
    {LANG_WEEKDAY} - - {LANG_HELP}
    {LANG_TIME_RANGE}{LANG_HELP}
    {LANG_TIME_DEFINITION}{LANG_HELP}
    {LANG_TIME_RANGE}{LANG_HELP}
     
     * {LANG_REQUIRED}{WARNING}
     
    -
    - [{LANG_SHOW_RELATION_DATA}][{LANG_HIDE_RELATION_DATA}]{CHECK_MUST_DATA} -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/templates/admin/user.htm.tpl b/templates/admin/user.htm.tpl new file mode 100644 index 0000000..01a944d --- /dev/null +++ b/templates/admin/user.htm.tpl @@ -0,0 +1,147 @@ + + + + + + + + +
    +
    {TITLE}
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {LANG_USERNAME} *
    {LANG_DESCRIPTION} *
    {LANG_PASSWORD} {PASSWORD_MUST_STAR}
    {LANG_CONFIRM_PASSWORD} {PASSWORD_MUST_STAR}
    {LANG_LANGUAGE} + + {LANG_HELP}
    {LANG_STANDARD_DOMAIN} + + {LANG_HELP}
    {LANG_ADMIN_ENABLE}{LANG_HELP}
    {LANG_WEBSERVER_AUTH}{LANG_HELP}
     
    {LANG_ACTIVE} + + + +
     
     * {LANG_REQUIRED}
    +
    +
    +
    +
    +
    +
    + \ No newline at end of file diff --git a/templates/admin/user.tpl.htm b/templates/admin/user.tpl.htm deleted file mode 100644 index 31784d3..0000000 --- a/templates/admin/user.tpl.htm +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - -
    -
    {TITLE}
    - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {LANG_USERNAME} *
    {LANG_DESCRIPTION} *
    {LANG_PASSWORD} {PASSWORD_MUST_STAR}
    {LANG_CONFIRM_PASSWORD} {PASSWORD_MUST_STAR}
    {LANG_LANGUAGE} - - {LANG_HELP}
    {LANG_STANDARD_DOMAIN} - - {LANG_HELP}
    {LANG_ADMIN_ENABLE}{LANG_HELP}
    {LANG_WEBSERVER_AUTH}{LANG_HELP}
     
    {LANG_ACTIVE} - - - -
     
     * {LANG_REQUIRED}
    -
    -
    -
    -
    -
    -
    - \ No newline at end of file diff --git a/templates/admin/verify.tpl.htm b/templates/admin/verify.htm.tpl similarity index 63% rename from templates/admin/verify.tpl.htm rename to templates/admin/verify.htm.tpl index a338fa1..b6130b8 100644 --- a/templates/admin/verify.tpl.htm +++ b/templates/admin/verify.htm.tpl @@ -1,26 +1,14 @@ - + - - - - - - - - + + + + + +
    {TITLE}
    - - - -
    + @@ -53,9 +41,9 @@
    {WRITE_MONITORING_DATA}

    -

    {ERRORMESSAGE}{INFOMESSAGE}

    -

    +

    {ERRORMESSAGE}{INFOMESSAGE}

    +

    {VERIFY_LINE}
    - {DATA}

    + {DATA}

    \ No newline at end of file diff --git a/templates/index.htm.tpl b/templates/index.htm.tpl new file mode 100644 index 0000000..b8d1e69 --- /dev/null +++ b/templates/index.htm.tpl @@ -0,0 +1,31 @@ + + + + + + + + +
    +

    NagiosQL

    +

    {TITLE_LOGIN}

    +
    + + + + + + + + + + + +
    {USERNAME}:
    {PASSWORD}:
     
    +
    +

    {MESSAGE}

    +
    +

    {LOGIN_TEXT}

    +
    +
    + \ No newline at end of file diff --git a/templates/index.tpl.htm b/templates/index.tpl.htm deleted file mode 100644 index 64b3c4d..0000000 --- a/templates/index.tpl.htm +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - -
    -

    NagiosQL

    -

    {TITLE_LOGIN}

    -
    - - - - - - - - - - - -
    {USERNAME}:
    {PASSWORD}:
     
    -
    -

    {MESSAGE}

    -
    -

    {LOGIN_TEXT}

    -
    -
    - \ No newline at end of file diff --git a/templates/main.htm.tpl b/templates/main.htm.tpl new file mode 100644 index 0000000..7ed84d9 --- /dev/null +++ b/templates/main.htm.tpl @@ -0,0 +1,92 @@ + + + + + + + + + + + + {PAGETITLE} + + + + + + + {SPECIALMETA} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {ADMIN} {MONITOR} {PLUGINS}  
    {POSITION}  +
    + + + + + + + + + + +
    {DOMAIN_INFO} + +   {LOGIN_INFO} {LOGOUT_INFO}
    +
    +
    + + + {MAINMENU} + + +
    + + +
    +

    {VERSION_INFO}

    + + + \ No newline at end of file diff --git a/templates/main.tpl.htm b/templates/main.tpl.htm deleted file mode 100644 index 31c035a..0000000 --- a/templates/main.tpl.htm +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - {PAGETITLE} - - - - - - - {SPECIALMETA} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {ADMIN} {MONITOR} {PLUGINS}  
    {POSITION}  -
    - - - - - - - - - - -
    {DOMAIN_INFO}   - -   {LOGIN_INFO} {LOGOUT_INFO}
    -
    -
    - - - {MAINMENU} - - -
    - - -
    -

    {VERSION_INFO}

    - - - \ No newline at end of file