Esempio n. 1
0
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require_once 'modules/imaging/includes/includes.php';
require_once 'modules/imaging/includes/xmlrpc.inc.php';
require_once 'modules/imaging/includes/web_def.inc.php';
$location = getCurrentLocation();
if (isset($_POST["bconfirm"])) {
    $params = getParams();
    $item_uuid = $_POST['itemid'];
    $label = urldecode($_POST['itemlabel']);
    $ret = xmlrpc_delServiceToLocation($item_uuid, $location, $params);
    // goto images list
    if ($ret[0] and !isXMLRPCError()) {
        $str = sprintf(_T("Service <strong>%s</strong> removed from default boot menu", "imaging"), $label);
        new NotifyWidgetSuccess($str);
        // Synchronize boot menu
        $ret = xmlrpc_synchroLocation($location);
        if (isXMLRPCError()) {
            new NotifyWidgetFailure(sprintf(_T("Boot menu generation failed for package server: %s", "imaging"), implode(', ', $ret[1])));
        }
        header("Location: " . urlStrRedirect("imaging/manage/service", $params));
        exit;
    } elseif ($ret[0]) {
        header("Location: " . urlStrRedirect("imaging/manage/service", $params));
        exit;
    } else {
Esempio n. 2
0
         }
     }
 }
 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
     $ret = xmlrpc_synchroLocation($boot_service['location']);
     if (isXMLRPCError()) {
         new NotifyWidgetFailure(sprintf(_T("Boot menu generation failed for package server: %s", "imaging"), implode(', ', $ret[1])));
     }
 }
 if (isset($_POST['uuid']) and isset($_POST['hostname'])) {
     // Come from a computer page
     $params = array('uuid' => $_POST['uuid'], 'hostname' => $_POST['hostname']);
     header("Location: " . urlStrRedirect("base/computers/" . $type . "imgtabs/" . $type . "tabservices", $params));
     exit;
 } else {