New upstream version 3.5.0

This commit is contained in:
geos_one
2025-08-08 11:12:01 +02:00
parent 8948a800bb
commit 8e3d35fd6e
153 changed files with 33544 additions and 22227 deletions

View File

@@ -1,123 +1,197 @@
<?php
///////////////////////////////////////////////////////////////////////////////
//
// NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
//
// (c) 2005-2018 by Martin Willisegger
//
// Project : NagiosQL
// Component : Host dependencies definition
// Website : https://sourceforge.net/projects/nagiosql/
// Version : 3.4.0
// GIT Repo : https://gitlab.com/wizonet/NagiosQL
//
///////////////////////////////////////////////////////////////////////////////
//
// Path settings
// ===================
/* ----------------------------------------------------------------------------
NagiosQL
-------------------------------------------------------------------------------
(c) 2005-2023 by Martin Willisegger
Project : NagiosQL
Component : Host dependencies definition
Website : https://sourceforge.net/projects/nagiosql/
Version : 3.5.0
GIT Repo : https://gitlab.com/wizonet/NagiosQL
-----------------------------------------------------------------------------*/
use functions\MysqliDbClass;
use functions\NagConfigClass;
use functions\NagContentClass;
use functions\NagDataClass;
use functions\NagVisualClass;
/**
* Class and variable includes
* @var HTML_Template_IT $conttp Content template
* @var HTML_Template_IT $maintp Main template
* @var HTML_Template_IT $mastertp Master template (list view)
* @var MysqliDbClass $myDBClass MySQL database class
* @var NagVisualClass $myVisClass Visual content class
* @var NagDataClass $myDataClass NagiosQL data class
* @var NagContentClass $myContentClass NagiosQL content class
* @var NagConfigClass $myConfigClass NagiosQL configuration class
* @var string $setFileVersion from prepend_adm.php -> Application version string
* @var string $chkModus from prepend_adm.php -> Form work mode
* @var int $chkDataId from prepend_adm.php -> Actual dataset id
* @var string $chkSelModify from prepend_adm.php -> Modification selection value
* @var int $hidSortBy from prepend_adm.php -> Sort data by
* @var string $hidSortDir from prepend_adm.php -> Sort data direction (ASC, DESC)
* @var int $chkLimit from prepend_adm.php / settings -> Data set count per page
* @var array $SETS Settings array
* @var int $intGlobalWriteAccess from prepend_content.php -> Global admin write access
* @var int $intWriteAccessId from prepend_content.php -> Admin write access to actual dataset id
* @var string $strAccess from prepend_content.php -> List of read access group id's for actual user
* @var string $preSQLCommon1 from prepend_content.php -> Common SQL part 1
* @var string $strSearchWhere from prepend_content.php -> SQL WHERE addon for data search
* @var string $strDomainWhere from prepend_adm.php -> Domain selection SQL part with table name
* @var string $chkTfValue1 from prepend_content.php -> Configuration name
* @var int $chkSelValue1 from prepend_content.php -> Dependency period
* @var array $chkMselValue1 from prepend_content.php -> Dependent hosts
* @var array $chkMselValue2 from prepend_content.php -> Hosts
* @var array $chkMselValue3 from prepend_content.php -> Dependent hostgroups
* @var array $chkMselValue4 from prepend_content.php -> Hostgroups
* @var int $intMselValue1 from prepend_content.php -> Dependent hosts multiselect status value
* @var int $intMselValue2 from prepend_content.php -> Hosts multiselect status value
* @var int $intMselValue3 from prepend_content.php -> Dependent hostgroups multiselect status value
* @var int $intMselValue4 from prepend_content.php -> Hostgroups multiselect status value
* @var string $chkChbGr1a from prepend_content.php -> Execution failure criteria (o)
* @var string $chkChbGr1b from prepend_content.php -> Execution failure criteria (d)
* @var string $chkChbGr1c from prepend_content.php -> Execution failure criteria (u)
* @var string $chkChbGr1d from prepend_content.php -> Execution failure criteria (p)
* @var string $chkChbGr1e from prepend_content.php -> Execution failure criteria (n)
* @var string $chkChbGr2a from prepend_content.php -> Notification failure criteria (o)
* @var string $chkChbGr2b from prepend_content.php -> Notification failure criteria (d)
* @var string $chkChbGr2c from prepend_content.php -> Notification failure criteria (u)
* @var string $chkChbGr2d from prepend_content.php -> Notification failure criteria (p)
* @var string $chkChbGr2e from prepend_content.php -> Notification failure criteria (n)
* @var int $chkChbValue1 from prepend_content.php -> Inherit parents
*/
/*
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.htm.tpl';
$preListTpl = 'admin/datalist.htm.tpl';
$preRelPath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'PHP_SELF'));
$preBasePath = preg_replace($strPattern, '', filter_input(INPUT_SERVER, 'SCRIPT_FILENAME'));
/*
Define common variables
*/
$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 $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);
//
// Add or modify data
// ==================
if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAccess == 0)) {
$preTableName = 'tbl_hostdependency';
$preKeyField = 'config_name';
$preAccess = 1;
$preFieldvars = 1;
$strErrorMessage = '';
$strInfoMessage = '';
$strConsistMessage = '';
$strDBWarning = '';
$intDataWarning = 0;
$intRet1 = 0;
$intRet2 = 0;
$intRet3 = 0;
$intRet4 = 0;
$intNoTime = 0;
/*
Default values for form variables
*/
if (!isset($intMselValue1)) {
$intMselValue1 = 0;
}
if (!isset($intMselValue2)) {
$intMselValue2 = 0;
}
if (!isset($intMselValue3)) {
$intMselValue3 = 0;
}
if (!isset($intMselValue4)) {
$intMselValue4 = 0;
}
/*
Include preprocessing files
*/
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);
/*
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;
if ($chkModus === 'insert') {
$strSQL = 'INSERT INTO ' . $strSQLx;
} else {
$strSQL = 'UPDATE ' .$strSQLx. ' WHERE `id`=' .$chkDataId;
$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))) {
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') {
if ($chkModus === 'insert') {
$chkDataId = $intInsertId;
}
if ($intReturn == 1) {
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 === 'insert') {
$myDataClass->writeLog(translate('New host dependency inserted:') . ' ' . $chkTfValue1);
}
if ($chkModus == 'modify') {
$myDataClass->writeLog(translate('Host dependency modified:'). ' ' .$chkTfValue1);
if ($chkModus === 'modify') {
$myDataClass->writeLog(translate('Host dependency modified:') . ' ' . $chkTfValue1);
}
//
// Insert/update relations
// =======================
if ($chkModus == 'insert') {
if ($intMselValue1 != 0) {
/*
Insert/update relations
*/
if ($chkModus === 'insert') {
if ($intMselValue1 !== 0) {
$intRet1 = $myDataClass->dataInsertRelation(
'tbl_lnkHostdependencyToHost_DH',
$chkDataId,
$chkMselValue1
);
}
if (isset($intRet1) && ($intRet1 != 0)) {
if (isset($intRet1) && ($intRet1 !== 0)) {
$myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage);
}
if ($intMselValue2 != 0) {
if ($intMselValue2 !== 0) {
$intRet2 = $myDataClass->dataInsertRelation(
'tbl_lnkHostdependencyToHost_H',
$chkDataId,
$chkMselValue2
);
}
if (isset($intRet2) && ($intRet2 != 0)) {
if (isset($intRet2) && ($intRet2 !== 0)) {
$myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage);
}
if ($intMselValue3 != 0) {
if ($intMselValue3 !== 0) {
$intRet3 = $myDataClass->dataInsertRelation(
'tbl_lnkHostdependencyToHostgroup_DH',
$chkDataId,
$chkMselValue3
);
}
if (isset($intRet3) && ($intRet3 != 0)) {
if (isset($intRet3) && ($intRet3 !== 0)) {
$myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage);
}
if ($intMselValue4 != 0) {
if ($intMselValue4 !== 0) {
$intRet4 = $myDataClass->dataInsertRelation(
'tbl_lnkHostdependencyToHostgroup_H',
$chkDataId,
$chkMselValue4
);
}
if (isset($intRet4) && ($intRet4 != 0)) {
if (isset($intRet4) && ($intRet4 !== 0)) {
$myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage);
}
} elseif ($chkModus == 'modify') {
if ($intMselValue1 != 0) {
} elseif ($chkModus === 'modify') {
if ($intMselValue1 !== 0) {
$intRet1 = $myDataClass->dataUpdateRelation(
'tbl_lnkHostdependencyToHost_DH',
$chkDataId,
@@ -126,10 +200,10 @@ if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAcce
} else {
$intRet1 = $myDataClass->dataDeleteRelation('tbl_lnkHostdependencyToHost_DH', $chkDataId);
}
if ($intRet1 != 0) {
if ($intRet1 !== 0) {
$myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage);
}
if ($intMselValue2 != 0) {
if ($intMselValue2 !== 0) {
$intRet2 = $myDataClass->dataUpdateRelation(
'tbl_lnkHostdependencyToHost_H',
$chkDataId,
@@ -138,10 +212,10 @@ if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAcce
} else {
$intRet2 = $myDataClass->dataDeleteRelation('tbl_lnkHostdependencyToHost_H', $chkDataId);
}
if ($intRet2 != 0) {
if ($intRet2 !== 0) {
$myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage);
}
if ($intMselValue3 != 0) {
if ($intMselValue3 !== 0) {
$intRet3 = $myDataClass->dataUpdateRelation(
'tbl_lnkHostdependencyToHostgroup_DH',
$chkDataId,
@@ -150,10 +224,10 @@ if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAcce
} else {
$intRet3 = $myDataClass->dataDeleteRelation('tbl_lnkHostdependencyToHostgroup_DH', $chkDataId);
}
if ($intRet3 != 0) {
if ($intRet3 !== 0) {
$myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage);
}
if ($intMselValue4 != 0) {
if ($intMselValue4 !== 0) {
$intRet4 = $myDataClass->dataUpdateRelation(
'tbl_lnkHostdependencyToHostgroup_H',
$chkDataId,
@@ -162,18 +236,18 @@ if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAcce
} else {
$intRet4 = $myDataClass->dataDeleteRelation('tbl_lnkHostdependencyToHostgroup_H', $chkDataId);
}
if ($intRet4 != 0) {
if ($intRet4 !== 0) {
$myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage);
}
}
if (($intRet1 + $intRet2 + $intRet3 + $intRet4) != 0) {
if (($intRet1 + $intRet2 + $intRet3 + $intRet4) !== 0) {
$strInfoMessage = '';
}
//
// Update Import HASH
// ==================
/*
Update Import HASH
*/
$booReturn = $myDataClass->updateHash($preTableName, $chkDataId);
if ($booReturn != 0) {
if ($booReturn !== 0) {
$myVisClass->processMessage($myDataClass->strErrorMessage, $strErrorMessage);
}
}
@@ -188,29 +262,25 @@ if ((($chkModus == 'insert') || ($chkModus == 'modify')) && ($intGlobalWriteAcce
}
$chkModus = 'display';
}
if ($chkModus != 'add') {
$chkModus = 'display';
if ($chkModus !== 'add') {
$chkModus = 'display';
}
//
// Get date/time of last database and config file manipulation
// ===========================================================
/*
Get date/time of last database and config file manipulation
*/
$intReturn = $myConfigClass->lastModifiedFile($preTableName, $arrTimeData, $strTimeInfoString);
if ($intReturn != 0) {
if ($intReturn !== 0) {
$myVisClass->processMessage($myConfigClass->strErrorMessage, $strErrorMessage);
}
//
// Singe data form
// ===============
if ($chkModus == 'add') {
/*
Singe data form
*/
if ($chkModus === 'add') {
$conttp->setVariable('TITLE', translate('Define host dependencies (hostdependencies.cfg)'));
// Do not show modified time list
/* 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;
}
/* Process host selection field */
$intFieldId = $arrModifyData['dependent_host_name'] ?? 0;
$intReturn = $myVisClass->parseSelectMulti(
'tbl_host',
'host_name',
@@ -219,14 +289,10 @@ if ($chkModus == 'add') {
2,
$intFieldId
);
if ($intReturn != 0) {
if ($intReturn !== 0) {
$myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage);
}
if (isset($arrModifyData['host_name'])) {
$intFieldId = $arrModifyData['host_name'];
} else {
$intFieldId = 0;
}
$intFieldId = $arrModifyData['host_name'] ?? 0;
$intReturn1 = $myVisClass->parseSelectMulti(
'tbl_host',
'host_name',
@@ -235,25 +301,17 @@ if ($chkModus == 'add') {
2,
$intFieldId
);
if ($intReturn1 != 0) {
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;
}
/* Process time period selection field */
$intFieldId = $arrModifyData['dependency_period'] ?? 0;
$intReturn = $myVisClass->parseSelectSimple('tbl_timeperiod', 'timeperiod_name', 'timeperiod', 1, $intFieldId);
if ($intReturn != 0) {
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;
}
/* Process host group selection field */
$intFieldId = $arrModifyData['dependent_hostgroup_name'] ?? 0;
$intReturn = $myVisClass->parseSelectMulti(
'tbl_hostgroup',
'hostgroup_name',
@@ -262,14 +320,10 @@ if ($chkModus == 'add') {
2,
$intFieldId
);
if ($intReturn != 0) {
if ($intReturn !== 0) {
$myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage);
}
if (isset($arrModifyData['hostgroup_name'])) {
$intFieldId = $arrModifyData['hostgroup_name'];
} else {
$intFieldId = 0;
}
$intFieldId = $arrModifyData['hostgroup_name'] ?? 0;
$intReturn2 = $myVisClass->parseSelectMulti(
'tbl_hostgroup',
'hostgroup_name',
@@ -278,77 +332,76 @@ if ($chkModus == 'add') {
2,
$intFieldId
);
if ($intReturn2 != 0) {
if ($intReturn2 !== 0) {
$myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage);
}
if (($intReturn1 != 0) && ($intReturn2 != 0)) {
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;
}
/* Process access group selection field */
$intFieldId = $arrModifyData['access_group'] ?? 0;
$intReturn = $myVisClass->parseSelectSimple('tbl_group', 'groupname', 'acc_group', 0, $intFieldId);
if ($intReturn != 0) {
if ($intReturn !== 0) {
$myVisClass->processMessage($myVisClass->strErrorMessage, $strErrorMessage);
}
// Initial add/modify form definitions
/* Initial add/modify form definitions */
$myContentClass->addFormInit($conttp);
if ($intDataWarning == 1) {
$conttp->setVariable('WARNING', $strDBWarning. '<br>' .translate('Saving not possible!'));
if ($intDataWarning === 1) {
$conttp->setVariable('WARNING', $strDBWarning . '<br>' . 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
/* 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 = '<br><span class="redmessage">' .translate('Entry cannot be activated because it is used by '
. 'another configuration'). ':</span>';
$strInfo .= '<br><span class="greenmessage">' .$strRelMessage. '</span>';
// Process data
$strInfo = '<br><span class="redmessage">' . translate('Entry cannot be activated because it is used by '
. 'another configuration') . ':</span>';
$strInfo .= '<br><span class="greenmessage">' . $strRelMessage . '</span>';
/* Process data */
$myContentClass->addInsertData($conttp, $arrModifyData, $intLocked, $strInfo);
if ($arrModifyData['inherits_parent'] == 1) {
if ((int)$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');
$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->setVariable('DAT_NO' . strtoupper($elem) . '_CHECKED', 'checked');
}
}
$conttp->parse('datainsert');
$conttp->show('datainsert');
}
//
// List view
// ==========
if ($chkModus == 'display') {
// Initial list view definitions
/*
List view
*/
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('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."%')";
$mastertp->setVariable('FILTER_VISIBLE', 'visibility: hidden');
/* Process search string */
if ($_SESSION['search'][$preSearchSession] !== '') {
$strSearchTxt = $_SESSION['search'][$preSearchSession];
$strSearchWhere = "AND (`$preKeyField` LIKE '%" . $strSearchTxt . "%')";
}
// Row sorting
/* Row sorting */
$strOrderString = "ORDER BY `config_id`, `$preKeyField` $hidSortDir";
if ($hidSortBy == 2) {
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` "
/* Count datasets */
$intLineCount = 0;
/** @noinspection SqlResolve */
$strSQL = "SELECT count(*) AS `number` FROM `$preTableName` "
. "WHERE $strDomainWhere $strSearchWhere AND `access_group` IN ($strAccess)";
$booReturn = $myDBClass->hasSingleDataset($strSQL, $arrDataLinesCount);
if ($booReturn == false) {
if ($booReturn === false) {
$myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage);
$myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage);
} else {
@@ -357,16 +410,16 @@ if ($chkModus == 'display') {
$chkLimit = 0;
}
}
// Get datasets
$strSQL = "SELECT `id`, `$preKeyField`, `dependent_host_name`, `dependent_hostgroup_name`, `register`, "
/* 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'];
. "`access_group` IN ($strAccess) $strOrderString LIMIT $chkLimit," . $SETS['common']['pagelines'];
$booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount);
if ($booReturn == false) {
if ($booReturn === false) {
$myVisClass->processMessage(translate('Error while selecting data from database:'), $strErrorMessage);
$myVisClass->processMessage($myDBClass->strErrorMessage, $strErrorMessage);
}
// Process data
/* Process data */
$myContentClass->listData(
$mastertp,
$arrDataLines,
@@ -377,7 +430,7 @@ if ($chkModus == 'display') {
40
);
}
// Show messages
/* Show messages */
$myContentClass->showMessages(
$mastertp,
$strErrorMessage,
@@ -387,7 +440,7 @@ $myContentClass->showMessages(
$strTimeInfoString,
$intNoTime
);
//
// Process footer
// ==============
$myContentClass->showFooter($maintp, $setFileVersion);
/*
Process footer
*/
$myContentClass->showFooter($maintp, $setFileVersion);