Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
enh(pdo): use fetch method instead of fetchrow
Browse files Browse the repository at this point in the history
Cp7 m53 ongoing fixes (#6365)

* fix(widget): remove unused variable

code cleaning

Resolve CP7M-53

* fix(engine): remove getting a reference from the function

code cleaning

Resolve CP7M-53

* fix(ldap): Illegal string offset 'action'

the issue happens when try to import LDAP users without a selected checkbox

Resolve CP7M-53

Cp7 m53 ongoing fixes (#6369)

* fix(install): module without cfg throw warnings
* chore(base): ignore content of www/img/media folder

Resolve CP7M-53
  • Loading branch information
kduret committed Jun 20, 2018
1 parent dd9ec86 commit c1c6835
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ nbproject/
composer.lock
GPL_LIB/SmartyCache/*
www/install/tmp/*
!www/img/media/.keep
www/img/media/*
!www/install/tmp/.gitkeep
www/install/install.conf.php
4 changes: 4 additions & 0 deletions src/CentreonLegacy/Core/Module/Information.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ private function getAvailableList()

$configuration = $this->utils->requireConfiguration($modulePath . '/conf.php');

if (!isset($configuration[$moduleName])) {
continue;
}

$licenseFile = $modulePath . '/license/merethis_lic.zl';
$list[$moduleName] = $configuration[$moduleName];
$list[$moduleName]['license_expiration'] = $this->licenseObj->getLicenseExpiration($licenseFile);
Expand Down
2 changes: 1 addition & 1 deletion www/class/centreonPurgeEngine.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ private function purgeParts($table)
while ($row = $DBRESULT->fetchRow()) {
$request = "ALTER TABLE " . $table . " DROP PARTITION `" . $row["PARTITION_NAME"] . "`;";
try {
$DBRESULT2 =& $this->dbCentstorage->query($request);
$DBRESULT2 = $this->dbCentstorage->query($request);
} catch (\PDOException $e) {
throw new Exception("Error : Cannot drop partition " . $row["PARTITION_NAME"] . " of table "
. $table . ", " . $e->getMessage() . "\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@

$action = $form->getSubmitValue("action");

if ($valid && $action["action"]["action"]) {
if ($valid && isset($action["action"]) && $action["action"]) {
require_once($path . "listContact.php");
} else {
/*
Expand Down
1 change: 0 additions & 1 deletion www/include/home/customViews/rename.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
}

$centreon = $_SESSION['centreon'];
$action = $_REQUEST['action'];
$db = new CentreonDB();

if (CentreonSession::checkSession(session_id(), $db) == 0) {
Expand Down
4 changes: 2 additions & 2 deletions www/include/monitoring/status/Notifications/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@
WHERE cp_key LIKE 'monitoring%notification%'
AND cp_contact_id = '" . $obj->DB->escape($user_id) . "'");
$notification_preferences = array();
while ($row_pref = $res_pref->fetchRow()) {
while ($row_pref = $res_pref->fetch()) {
$notification_preferences[$row_pref['cp_key']] = $row_pref['cp_value'];
}
$_SESSION['centreon_notification_preferences'] = $notification_preferences;
} else {
$notification_preferences = $_SESSION['centreon_notification_preferences'];
}
while ($row = $res->fetchRow()) {
while ($row = $res->fetch()) {
$obj->XML->startElement("message");
if ($row['description']) {
if (isset($notification_preferences['monitoring_svc_notification_' . $row['state']])) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
$hostCounter = 0;
$host_stat = array(0 => 0, 1 => 0, 2 => 0, 3 => 0, 4 => 0);
$DBRESULT = $obj->DBC->query($rq1);
while ($data = $DBRESULT->fetchRow()) {
while ($data = $DBRESULT->fetch()) {
$host_stat[$data["state"]] = $data["count(DISTINCT name)"];
$hostCounter += $host_stat[$data["state"]];
}
Expand Down

0 comments on commit c1c6835

Please sign in to comment.