$item = xmlrpc_getMenuItemByUUID($item_uuid); $bs_uuid = $item['boot_service']['imaging_uuid']; $im_uuid = $item['image']['imaging_uuid']; if(isset($_GET['gid'])) { $type = 'group'; $target_uuid = $_GET['gid']; } else { $type = ''; $target_uuid = $_GET['uuid']; } if (quickGet('valid')) { if (isset($bs_uuid)) { $ret = xmlrpc_delServiceToTarget($bs_uuid, $target_uuid, $type); } else { $ret = xmlrpc_delImageToTarget($im_uuid, $target_uuid, $type); } if ($ret[0] and !isXMLRPCError()) { /* insert notification code here if needed */ // Synchronize boot menu $ret = xmlrpc_synchroComputer($target_uuid); if (isXMLRPCError()) { new NotifyWidgetFailure(sprintf(_T("Boot menu generation failed for computer: %s", "imaging"), implode(', ', $ret[1]))); } } elseif (!$ret[0]) { new NotifyWidgetFailure($ret[1]); } $params['mod'] = 'remove_success';
if (substr($key, 0, 14) == 'computer_uuid_') { $target_uuid = substr($key, 14); if (isset($_POST['computer_checkbox_' . $target_uuid]) and $_POST['computer_checkbox_' . $target_uuid] == 'on') { $bootServicesToDelFromTarget[] = array('bs_uuid' => $_POST['computer_uuid_' . $target_uuid], 'target_uuid' => $target_uuid, 'type' => $_POST['type_uuid_' . $target_uuid]); } } if (substr($key, 0, 13) == 'imaging_uuid_') { $location = substr($key, 13); $target_uuid = substr($key, 13); if (isset($_POST['imaging_checkbox_' . $location]) and $_POST['imaging_checkbox_' . $location] == 'on') { $bootServicesToDelFromLocation[] = array('bs_uuid' => $_POST['imaging_uuid_' . $target_uuid], 'location' => $location); } } } foreach ($bootServicesToDelFromTarget as $boot_service) { $ret = xmlrpc_delServiceToTarget($boot_service['bs_uuid'], $boot_service['target_uuid'], $boot_service['type']); if (isXMLRPCError()) { new NotifyWidgetFailure(sprintf(_T("Removal of boot service failed", "imaging"))); } // Synchronize boot menu $ret = xmlrpc_synchroComputer($boot_service['target_uuid']); if (isXMLRPCError()) { new NotifyWidgetFailure(sprintf(_T("Boot menu generation failed for computer: %s", "imaging"), implode(', ', $ret[1]))); } } foreach ($bootServicesToDelFromLocation as $boot_service) { $ret = xmlrpc_delServiceToLocation($boot_service['bs_uuid'], $boot_service['location']); if (isXMLRPCError()) { new NotifyWidgetFailure(sprintf(_T("Removal of boot service failed", "imaging"))); } // Synchronize boot menu