From 3c461d457016376f35cc5978d8db954999b1431a Mon Sep 17 00:00:00 2001 From: skjaro Date: Thu, 23 Dec 2021 16:14:34 +0100 Subject: [PATCH] Fix typos --- hook.php | 24 ++++++++++++------------ inc/remote_status.php | 2 +- inc/remotesupport.class.php | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/hook.php b/hook.php index acd0849..0ddfbce 100644 --- a/hook.php +++ b/hook.php @@ -25,18 +25,17 @@ function plugin_remotesupport_install() { global $DB; - $config = new Config(); - $config->setConfigurationValues('plugin:Remotesupport', - [ 'run_mode' => 'None', - 'threads' => 100, - 'show_in_tickets' => true, - 'show_in_computers' => true, - 'easy_novnc' => true, - 'fusion' => true] - ); + $config = new Config(); + $config->setConfigurationValues('plugin:Remotesupport', + ['run_mode' => 'None', + 'threads' => 100, + 'show_in_tickets' => true, + 'show_in_computers' => true, + 'easy_novnc' => true, + 'fusion' => true] + ); - - Toolbox::logInFile("remotsupport", "Installing plugin"); + Toolbox::logInFile("remotesupport", "Installing plugin"); $state_online = [ 'name' => 'Online', 'entities_id' => 0, @@ -105,8 +104,9 @@ function plugin_remotesupport_uninstall() function plugin_remotesupport_postinit() { global $CFG_GLPI, $DB; + $config = Config::getConfigurationValues('plugin:Remotesupport'); - if (isset($_GET['id']) && $_GET['id'] != 0 && isset($_GET['_itemtype']) && $_GET['_itemtype'] == "Ticket") { + if (isset($_GET['id']) && $_GET['id'] != 0 && isset($_GET['_itemtype']) && $_GET['_itemtype'] == "Ticket" && $config["show_in_tickets"]) { $id = $_GET['id']; //mysql> select * from glpi_tickets_users where tickets_id = 2 and type = 1; diff --git a/inc/remote_status.php b/inc/remote_status.php index 3b4e8e4..7b8b7eb 100644 --- a/inc/remote_status.php +++ b/inc/remote_status.php @@ -37,7 +37,7 @@ $descriptorspec = array( ); $cwd = '/tmp'; -$env = array('debug' => 'false'); +$env = array('debug' => 'false', 'threads' => 100); $process = proc_open($rs_path . '/bin/check_status', $descriptorspec, $pipes, $cwd, $env); diff --git a/inc/remotesupport.class.php b/inc/remotesupport.class.php index f3af885..936a315 100644 --- a/inc/remotesupport.class.php +++ b/inc/remotesupport.class.php @@ -88,7 +88,7 @@ class PluginRemotesupportRemotesupport extends CommonDBTM return 0; } - Toolbox::logInFile("remotsupport", "Starting search of agents\n"); + Toolbox::logInFile("remotesupport", "Starting search of agents\n"); if ($config["run_mode"] == "Parallel") { $pfConfig = new PluginFusioninventoryConfig(); @@ -140,7 +140,7 @@ class PluginRemotesupportRemotesupport extends CommonDBTM // proc_close in order to avoid a deadlock $return_value = proc_close($process); - Toolbox::logInFile("remotsupport", "command returned $return_value\n"); + Toolbox::logInFile("remotesupport", "command returned $return_value\n"); } } else { @@ -183,7 +183,7 @@ class PluginRemotesupportRemotesupport extends CommonDBTM $comp = new Computer(); $comp->getFromDB($s->computers_id); - Toolbox::logInFile("remotsupport", $s->computers_id . " " . $cids[$s->computers_id] . "\n"); + Toolbox::logInFile("remotesupport", $s->computers_id . " " . $cids[$s->computers_id] . "\n"); $ids[] = $s->computers_id; }