diff --git a/hook.php b/hook.php index 51d6be3..acd0849 100644 --- a/hook.php +++ b/hook.php @@ -25,6 +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] + ); + + Toolbox::logInFile("remotsupport", "Installing plugin"); $state_online = [ 'name' => 'Online', diff --git a/inc/config.class.php b/inc/config.class.php new file mode 100644 index 0000000..f13228c --- /dev/null +++ b/inc/config.class.php @@ -0,0 +1,112 @@ +. + -------------------------------------------------------------------------- + */ + +class PluginRemotesupportConfig extends CommonDBTM { + + static protected $notable = true; + + function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { + + if (!$withtemplate) { + if ($item->getType() == 'Config') { + return __('Remote Support plugin'); + } + } + return ''; + } + + static function configUpdate($input) { + $input['configuration'] = 1 - $input['configuration']; + return $input; + } + + function showFormRemotesupport() { + global $CFG_GLPI; + + if (!Session::haveRight("config", UPDATE)) { + return false; + } + + $my_config = Config::getConfigurationValues('plugin:Remotesupport'); + + echo "