Ejemplo n.º 1
0
             $service->loadFromMySQL($service_id);
             $service->addMember('host_name', $host->getId(), $host->getName());
             $service->saveToMySQL();
             $service->dataReset();
         }
     }
     $contacts = $stemplate->getDataValue('contacts');
     if (count($contacts)) {
         foreach ($contacts as $contact_id => $contact_name) {
             $host->addMember('contacts', $contact_id, $contact_name);
         }
         $host->saveToMySQL();
     }
     break;
 case 'populate':
     $host->autoPopulateServices();
     break;
 case 'icon':
     $icourl = $oPage->getRequestValue('icourl');
     if (strlen($icourl)) {
         $tmpfilename = sys_get_temp_dir() . '/' . EaseSand::randomString();
         $fp = fopen($tmpfilename, 'w');
         $ch = curl_init($icourl);
         curl_setopt($ch, CURLOPT_FILE, $fp);
         $data = curl_exec($ch);
         $downloadErr = curl_error($ch);
         if ($downloadErr) {
             $oPage->addStatusMessage($downloadErr, 'warning');
         }
         curl_close($ch);
         fclose($fp);