Skip to content

Commit 1df8216

Browse files
author
Debug Bill
committed
one more reference to development database...
1 parent 352fa0a commit 1df8216

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

inc/computer.class.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,15 @@ class PluginGlpi2mdtComputer extends PluginGlpi2mdtMdt {
5353
function getTabNameForItem(CommonGLPI $item, $withtemplate=0) {
5454
global $DB;
5555
$id = $item->getID();
56-
$result = $DB->query("SELECT value_char as mode FROM glpi_dev.glpi_plugin_glpi2mdt_parameters
56+
$result = $DB->query("SELECT value_char as mode FROM glpi_plugin_glpi2mdt_parameters
5757
WHERE scope='global' AND parameter='Mode';");
5858
$mode = $DB->fetch_array($result)['mode'];
5959
if ($mode == 'Master') {
6060
PluginGlpi2mdtCrontask::cronSyncMasterMaster(null, $id);
6161
}
6262
$result = $DB->query("SELECT value FROM glpi_plugin_glpi2mdt_settings
6363
WHERE type='C' AND category='C' AND `key`='OSInstall' AND id=$id");
64-
$row = $DB->fetch_array($result);
65-
if ($row['value'] == "YES") {
64+
if (($DB->numrows($result) == 1) AND ($DB->fetch_array($result)['value'] == 'YES')) {
6665
return self::createTabEntry(__('Auto Install', 'glpi2mdt'), __('YES'));
6766
} else {
6867
return self::createTabEntry(__('Auto Install', 'glpi2mdt'), __('NO'));

inc/crontask.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ static function cronCheckGlpi2mdtUpdate($task, $cron=true, $messageafterredirect
109109
$gets = $gets."&CO=$CO&&AP=$AP&AG=$AG&TS=$TS&TG=$TG&RO=$RO&MO=$MO&PK=$PK&ST=$ST";
110110
}
111111
Toolbox::getURLContent("https://glpi2mdt.thauvin.org/report.php".$gets);
112-
$task->log("https://glpi2mdt.thauvin.org/report.php".$gets);
112+
if ($cron) {
113+
$task->log("https://glpi2mdt.thauvin.org/report.php".$gets);
114+
}
113115
$query = "INSERT INTO glpi_plugin_glpi2mdt_parameters
114116
(`parameter`, `scope`, `value_char`, `is_deleted`)
115117
VALUES ('LatestVersion', 'global', '$latest_version', false)

0 commit comments

Comments
 (0)