Exemplo n.º 1
0
 // example
 // ?action=setAnswer&InformationSource=0x00000000&BIOSVersion=VirtualBox&SystemManufacturer=innotek%20GmbH&uuid=fepjhoug56743h&SystemProductName=VirtualBox&BIOSReleaseDate=12%2F01%2F2006
 $pfTaskjobstate = new PluginFusioninventoryTaskjobstate();
 $pfAgent = new PluginFusioninventoryAgent();
 $jobstate = current($pfTaskjobstate->find("`uniqid`='" . $_GET['uuid'] . "'\n            AND `state`!='" . PluginFusioninventoryTaskjobstate::FINISHED . "'", '', 1));
 if (isset($jobstate['plugin_fusioninventory_agents_id'])) {
     $pfAgent->getFromDB($jobstate['plugin_fusioninventory_agents_id']);
     $computers_id = $pfAgent->fields['computers_id'];
     $a_values = $_GET;
     unset($a_values['action']);
     unset($a_values['uuid']);
     switch ($jobstate['itemtype']) {
         case 'PluginFusioninventoryCollect_Registry':
             // update registry content
             $pfCRC = new PluginFusioninventoryCollect_Registry_Content();
             $pfCRC->updateComputer($computers_id, $a_values, $jobstate['items_id']);
             $pfTaskjobstate->changeStatus($jobstate['id'], PluginFusioninventoryTaskjobstate::AGENT_HAS_SENT_DATA);
             if (isset($a_values['_cpt']) && $a_values['_cpt'] == 0) {
                 // it not find the path
                 $pfTaskjobstate->changeStatusFinish($jobstate['id'], $jobstate['items_id'], $jobstate['itemtype'], 1, 'Path not found');
             }
             if (isset($a_values['_cpt']) && $a_values['_cpt'] == 1) {
                 // it last value
                 $pfTaskjobstate->changeStatusFinish($jobstate['id'], $jobstate['items_id'], $jobstate['itemtype']);
             }
             break;
         case 'PluginFusioninventoryCollect_Wmi':
             // update registry content
             $pfCWC = new PluginFusioninventoryCollect_Wmi_Content();
             $pfCWC->updateComputer($computers_id, $a_values, $jobstate['items_id']);
             $pfTaskjobstate->changeStatus($jobstate['id'], PluginFusioninventoryTaskjobstate::AGENT_HAS_SENT_DATA);