コード例 #1
0
 static function getList($agents_id = NULL)
 {
     global $PF_CONFIG;
     if (is_null($agents_id)) {
         return array();
     }
     $pfAgent = new PluginFusioninventoryAgent();
     $pfAgent->getFromDB($agents_id);
     $agent = $pfAgent->fields;
     $results = getAllDatasFromTable('glpi_plugin_fusioninventory_deploymirrors');
     if (!isset($agent) || !isset($agent['computers_id'])) {
         return array();
     }
     $computer = new Computer();
     $computer->getFromDB($agent['computers_id']);
     $mirrors = array();
     foreach ($results as $result) {
         if ($computer->fields['locations_id'] == $result['locations_id']) {
             $mirrors[] = $result['url'];
         }
     }
     //add default mirror (this server) if enabled in config
     $entities_id = 0;
     if (isset($agent['entities_id'])) {
         $entities_id = $agent['entities_id'];
     }
     if (isset($PF_CONFIG['server_as_mirror']) && (bool) $PF_CONFIG['server_as_mirror'] == TRUE) {
         $mirrors[] = PluginFusioninventoryAgentmodule::getUrlForModule('DEPLOY', $entities_id) . "?action=getFilePart&file=";
     }
     return $mirrors;
 }
コード例 #2
0
 static function task_collect_getParameters($entities_id)
 {
     return array("task" => "Collect", "remote" => PluginFusioninventoryAgentmodule::getUrlForModule('Collect', $entities_id));
 }