diff --git a/inc/remotesupport.class.php b/inc/remotesupport.class.php index e61ca6a..00e160d 100644 --- a/inc/remotesupport.class.php +++ b/inc/remotesupport.class.php @@ -8,16 +8,25 @@ class PluginRemotesupportRemotesupport extends CommonDBTM { public static function showInfo($item) { + + $config = Config::getConfigurationValues('plugin:Remotesupport'); - // Manage locks pictures - //PluginFusioninventoryLock::showLockIcon('Computer'); - - $pfInventoryComputerComputer = new PluginFusioninventoryInventoryComputerComputer(); - $a_computerextend = $pfInventoryComputerComputer->hasAutomaticInventory($item->getID()); - if (empty($a_computerextend)) { - return true; - } - + if ($config["show_in_computers"] == false) + return true; + + if ($config["fusion"] == true && $config["easy_novnc"] == true) { + $pfInventoryComputerComputer = new PluginFusioninventoryInventoryComputerComputer(); + $a_computerextend = $pfInventoryComputerComputer->hasAutomaticInventory($item->getID()); + if (empty($a_computerextend)) { + return true; + } + + $href = "https://" . $_SERVER['SERVER_ADDR'] . "/vnc.html?path=vnc%2F" . $a_computerextend['remote_addr'] . "&autoconnect=true&resize=scale&reconnect=true&show_dot=true"; + $name = $a_computerextend['remote_addr']; + } else { + $href = "vnc://" . $item->fields["name"]; + $name = $item->fields["name"]; + } echo '
| ' . __('Remote Support') . ' | '; @@ -25,7 +34,7 @@ class PluginRemotesupportRemotesupport extends CommonDBTM echo '
|---|
';
- $url = "VNC connect :"; @@ -72,6 +81,11 @@ class PluginRemotesupportRemotesupport extends CommonDBTM { global $DB; + $config = Config::getConfigurationValues('plugin:Remotesupport'); + + if ($config["fusion"]) + return 0; + Toolbox::logInFile("remotsupport", "Starting search of agents\n"); $pfConfig = new PluginFusioninventoryConfig(); $port = $pfConfig->getValue('agent_port'); |