コード例 #1
0
ファイル: addimage.php プロジェクト: pulse-project/pulse
         $location_name = _T("root", "pulse2");
     } else {
         $location_name = xmlrpc_getLocationName($location);
     }
     $objprocess = array();
     $scriptmulticast = 'multicast.sh';
     $path = "/tmp/";
     $objprocess['location'] = $location;
     $objprocess['process'] = $path . $scriptmulticast;
     if (xmlrpc_check_process_multicast($objprocess)) {
         $msg = _T("The bootmenus cannot be generated as a multicast deployment is currently running.", "imaging");
         new NotifyWidgetFailure($msg);
         header("Location: " . urlStrRedirect("imaging/manage/index"));
         exit;
     } else {
         $ret = xmlrpc_synchroProfile($target_uuid);
         xmlrpc_clear_script_multicast($objprocess);
     }
 } else {
     $ret = xmlrpc_synchroComputer($target_uuid);
 }
 if (isXMLRPCError()) {
     new NotifyWidgetFailure(sprintf(_T("Boot menu generation failed for computer: %s", "imaging"), implode(', ', $ret[1])));
 }
 if ($type == 'group') {
     // Imaging group
     header("Location: " . urlStrRedirect("imaging/manage/" . $type . "imgtabs/" . $type . "tabimages", $params));
 } else {
     header("Location: " . urlStrRedirect("base/computers/" . $type . "imgtabs/" . $type . "tabimages", $params));
 }
 exit;
コード例 #2
0
ファイル: add_groups.php プロジェクト: pulse-project/pulse
             $objprocess = array();
             $scriptmulticast = 'multicast.sh';
             $path = "/tmp/";
             $objprocess['location'] = $location;
             $objprocess['process'] = $path . $scriptmulticast;
             if (xmlrpc_check_process_multicast($objprocess)) {
                 $msg = _T("The bootmenus cannot be generated as a multicast deployment is currently running.", "imaging");
                 new NotifyWidgetFailure($msg);
                 header("Location: " . urlStrRedirect("imaging/manage/index"));
                 exit;
             } else {
                 $ret = xmlrpc_synchroProfile($group->id);
                 xmlrpc_clear_script_multicast($objprocess);
             }
         }
         $ret = xmlrpc_synchroProfile($group->id);
         if (count($dontAddedToProfile) > 0) {
             $msg = _T("Imaging group modified, but some machines were not added to existing imaging group, because they have more than one ethernet card:", 'dyngroup');
             $msg .= "<br /><br />";
             foreach ($dontAddedToProfile as $member) {
                 $msg .= $member['hostname'] . "<br />";
             }
             new NotifyWidgetWarning($msg);
         } else {
             new NotifyWidgetSuccess(_T("Imaging group successfully modified", "dyngroup"));
         }
     }
 } else {
     if ($type == 0) {
         // Simple group
         new NotifyWidgetSuccess(_T("Group successfully created", "dyngroup"));
コード例 #3
0
ファイル: tabs.php プロジェクト: neoclust/mmc
global $SYNCHROSTATE_UNKNOWN;
global $SYNCHROSTATE_TODO;
global $SYNCHROSTATE_SYNCHRO;
global $SYNCHROSTATE_RUNNING;
global $SYNCHROSTATE_INIT_ERROR;

/*
 * Display right top shortcuts menu
 */
right_top_shortcuts_display();

if (isset($_POST['bsync'])) {
    if (isset($params['uuid'])) {
        $ret = xmlrpc_synchroComputer($params['uuid']);
    } else {
        $ret = xmlrpc_synchroProfile($params['gid']);
    }
    // goto images list
    if ($ret[0] and !isXMLRPCError()) {
        /* insert notification code here if needed */
    } elseif (!$ret[0] and !isXMLRPCError()) {
         unset($_SESSION["imaging.isComputerInProfileRegistered_".$params['uuid']]);
         unset($_SESSION["imaging.isComputerRegistered_".$params['uuid']]);
         if (!xmlrpc_isComputerInProfileRegistered($params['uuid']) && !xmlrpc_isComputerRegistered($params['uuid'])) {
            new NotifyWidgetFailure(sprintf(_T("This computer is no longer registered : %s", "imaging"), $params['uuid']));
            header("Location: ".urlStrRedirect("base/computers/index", $params));
            exit;
         } else {
            new NotifyWidgetFailure(sprintf(_T("Boot Menu Generation failed for : %s", "imaging"), implode(', ', $ret[1])));
         }
    }
コード例 #4
0
if (isset($multicast) && isset($location) && isset($process) && isset($path) && $location != "" && $process != "") {
    $objprocess['location'] = $location;
    switch ($multicast) {
        case "start":
            $objprocess['group'] = $_SESSION['PARAMMULTICAST']['gid'];
            $objprocess['description'] = $_SESSION['PARAMMULTICAST']['itemlabel'];
            $objprocess['master'] = $_SESSION['PARAMMULTICAST']['uuidmaster'];
            $objprocess['path'] = "/var/lib/pulse2/imaging/masters/" . $_SESSION['PARAMMULTICAST']['uuidmaster'];
            $objprocess['process'] = $path . $process;
            xmlrpc_start_process_multicast($objprocess);
            break;
        case "stop":
            $objprocess['process'] = $process;
            xmlrpc_stop_process_multicast($objprocess);
            $objprocess['process'] = $path . $process;
            $gr = xmlrpc_clear_script_multicast($objprocess);
            if ($gr != -1) {
                xmlrpc_synchroProfile($gr);
            }
            break;
        case "clear":
            $objprocess['process'] = $path . $process;
            $gr = xmlrpc_clear_script_multicast($objprocess);
            if ($gr != -1) {
                xmlrpc_synchroProfile($gr);
            }
            unset($_SESSION['PARAMMULTICAST']);
            break;
    }
}
redirectTo(urlStrRedirect("imaging/manage/index/"));