diff --git a/inc/commoninjectionlib.class.php b/inc/commoninjectionlib.class.php index 80c4a15..2e0230f 100644 --- a/inc/commoninjectionlib.class.php +++ b/inc/commoninjectionlib.class.php @@ -746,7 +746,7 @@ private static function findUser($value, $entity) WHERE LOWER(`name`) = '" . strtolower($value) . "' OR (CONCAT(LOWER(`realname`),' ',LOWER(`firstname`)) = '" . strtolower($value) . "' OR CONCAT(LOWER(`firstname`),' ',LOWER(`realname`)) = '" . strtolower($value) . "')"; - $result = $DB->doQuery($sql); + $result = $DB->query($sql); // phpcs:ignore if ($DB->numrows($result) > 0) { //check if user has right on the current entity $ID = $DB->result($result, 0, "id"); @@ -780,7 +780,7 @@ private static function findContact($value, $entity) AND (LOWER(`name`) = '" . strtolower($value) . "' OR (CONCAT(LOWER(`name`),' ',LOWER(`firstname`)) = '" . strtolower($value) . "' OR CONCAT(LOWER(`firstname`),' ',LOWER(`name`)) = '" . strtolower($value) . "'))"; - $result = $DB->doQuery($sql); + $result = $DB->query($sql); // phpcs:ignore if ($DB->numrows($result) > 0) { //check if user has right on the current entity @@ -824,7 +824,7 @@ private static function findSingle($item, $searchOption, $entity, $value) } $query .= " AND `" . $searchOption['field'] . "` = '$value'"; - $result = $DB->doQuery($query); + $result = $DB->query($query); // phpcs:ignore if ($DB->numrows($result) > 0) { //check if user has right on the current entity @@ -942,7 +942,7 @@ private static function getTemplateIDByName($itemtype, $name) FROM `" . getTableForItemType($itemtype) . "` WHERE `is_template` = '1' AND `template_name` = '$name'"; - $result = $DB->doQuery($query); + $result = $DB->query($query); // phpcs:ignore if ($DB->numrows($result) > 0) { return $DB->result($result, 0, 'id'); @@ -1889,7 +1889,7 @@ private function dataAlreadyInDB($injectionClass, $itemtype) $sql .= " WHERE 1 " . $where_entity . " " . $where; } - $result = $DB->doQuery($sql); + $result = $DB->query($sql); // phpcs:ignore if ($DB->numrows($result) > 0) { $db_fields = $DB->fetchAssoc($result); foreach ($db_fields as $key => $value) { diff --git a/inc/modelcsv.class.php b/inc/modelcsv.class.php index 814668a..758b1a4 100644 --- a/inc/modelcsv.class.php +++ b/inc/modelcsv.class.php @@ -138,7 +138,7 @@ public function getFromDBByModelID($models_id) FROM `" . $this->getTable() . "` WHERE `models_id` = '" . $models_id . "'"; - $results = $DB->doQuery($query); + $results = $DB->query($query); // phpcs:ignore $id = 0; if ($DB->numrows($results) > 0) { diff --git a/inc/networkportinjection.class.php b/inc/networkportinjection.class.php index 4c6ae9a..9946a34 100644 --- a/inc/networkportinjection.class.php +++ b/inc/networkportinjection.class.php @@ -356,7 +356,7 @@ public function processAfterInsertOrUpdate($values, $add = true, $rights = []) if ($use_mac) { $sql .= " AND `glpi_networkports`.`mac` = '" . $values['NetworkPort']["netmac"] . "'"; } - $res = $DB->doQuery($sql); + $res = $DB->query($sql); // phpcs:ignore //if at least one parameter is given $nb = $DB->numrows($res); diff --git a/inc/profile.class.php b/inc/profile.class.php index 06708c5..276a820 100644 --- a/inc/profile.class.php +++ b/inc/profile.class.php @@ -61,7 +61,7 @@ public function cleanProfiles($ID) $query = "DELETE FROM `glpi_profiles` WHERE `profiles_id`='$ID' AND `name` LIKE '%plugin_datainjection%'"; - $DB->doQuery($query); + $DB->query($query); // phpcs:ignore } public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) @@ -146,7 +146,7 @@ public static function migrateProfiles() $profiles = getAllDataFromTable('glpi_plugin_datainjection_profiles'); foreach ($profiles as $id => $profile) { $query = "SELECT `id` FROM `glpi_profiles` WHERE `name`='" . $profile['name'] . "'"; - $result = $DB->doQuery($query); + $result = $DB->query($query); // phpcs:ignore if ($DB->numrows($result) == 1) { $id = $DB->result($result, 0, 'id'); switch ($profile['model']) { diff --git a/inc/softwarelicenseinjection.class.php b/inc/softwarelicenseinjection.class.php index d024631..093778a 100644 --- a/inc/softwarelicenseinjection.class.php +++ b/inc/softwarelicenseinjection.class.php @@ -164,7 +164,7 @@ public function getValueForAdditionalMandatoryFields($fields_toinject = []) $fields_toinject['SoftwareLicense']['entities_id'], true ); - $result = $DB->doQuery($query); + $result = $DB->query($query); // phpcs:ignore if ($DB->numrows($result) > 0) { $id = $DB->result($result, 0, 'id'); diff --git a/inc/softwareversioninjection.class.php b/inc/softwareversioninjection.class.php index dd4423f..8617439 100644 --- a/inc/softwareversioninjection.class.php +++ b/inc/softwareversioninjection.class.php @@ -159,7 +159,7 @@ public function getValueForAdditionalMandatoryFields($fields_toinject = []) $fields_toinject['SoftwareVersion']['entities_id'], true ); - $result = $DB->doQuery($query); + $result = $DB->query($query); // phpcs:ignore if ($DB->numrows($result) > 0) { $id = $DB->result($result, 0, 'id'); diff --git a/inc/userinjection.class.php b/inc/userinjection.class.php index 92cfd9d..9e70ec5 100644 --- a/inc/userinjection.class.php +++ b/inc/userinjection.class.php @@ -182,7 +182,7 @@ public function processAfterInsertOrUpdate($values, $add = true, $rights = []) $query = "UPDATE `glpi_users` SET `password` = '" . $password . "' WHERE `id` = '" . $values['User']['id'] . "'"; - $DB->doQuery($query); + $DB->query($query); // phpcs:ignore } }