예제 #1
0
         }
     }
 }
 foreach ($imagesToDelFromTarget as $image) {
     $ret = xmlrpc_delImageToTarget($image['uuid'], $image['target_uuid'], $image['type']);
     if (isXMLRPCError()) {
         new NotifyWidgetFailure(sprintf(_T("Removal of master failed", "imaging")));
     }
     // Synchronize boot menu
     $ret = xmlrpc_synchroComputer($image['target_uuid']);
     if (isXMLRPCError()) {
         new NotifyWidgetFailure(sprintf(_T("Boot menu generation failed for computer: %s", "imaging"), implode(', ', $ret[1])));
     }
 }
 foreach ($imagesToDelFromLocation as $image) {
     $ret = xmlrpc_delImageToLocation($image['menu_item_id'], $image['location']);
     if (isXMLRPCError()) {
         new NotifyWidgetFailure(sprintf(_T("Removal of master failed", "imaging")));
     }
     // Synchronize boot menu
     $ret = xmlrpc_synchroLocation($image['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 . "tabimages", $params));
     exit;
 } else {
예제 #2
0
 *
 * 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
 */

include('modules/imaging/includes/includes.php');
require_once('modules/imaging/includes/xmlrpc.inc.php');

$item_uuid = $_GET['itemid'];
$location = getCurrentLocation();
$label = urldecode($_GET['itemlabel']);

if ($_POST) {
    $menu_item_id = $_POST['menu_item_id'];
    $ret = xmlrpc_delImageToLocation($menu_item_id, $location);
    if ($ret[0] and !isXMLRPCError()) {
        $str = sprintf(_T("Image <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/master"));
        exit;
    } elseif ($ret[0]) {
        header("Location: " . urlStrRedirect("imaging/manage/master"));
        exit;
    } else {
        new NotifyWidgetFailure($ret[1]);