*/ 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]))); } } } if (isset($params['uuid'])) { $_GET['type'] = ''; $_GET['target_uuid'] = $params['uuid']; $_GET['target_name'] = $params['hostname']; unset($_GET['gid']); $params['type'] = '';
if (isset($_GET['gid']) && $_GET['gid'] != '') { $type = 'group'; $target_uuid = isset($_GET['gid']) ? $_GET['gid'] : ""; $target_name = isset($_GET['groupname']) ? $_GET['groupname'] : ""; } else { $type = ''; $target_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : ""; if (isset($_GET['hostname'])) { $target_name = $_GET['hostname']; } elseif (isset($_GET['target_name'])) { $target_name = $_GET['target_name']; } else { $target_name = ''; } } if ($type == '' && (xmlrpc_isComputerRegistered($target_uuid) || xmlrpc_isComputerInProfileRegistered($target_uuid)) || $type == 'group' && xmlrpc_isProfileRegistered($target_uuid)) { if (isset($_GET['mod'])) { $mod = $_GET['mod']; } else { $mod = "none"; } switch ($mod) { case 'details': log_details(); break; default: log_list(); break; } } else { # register the target (computer or profile)
} else { new NotifyWidgetFailure(sprintf(_T("Failed to unregister the computer %s", 'imaging'), $target_name)); } $is_unregistering = True; } else { /* * type: 'group' for a profile, '' for a single computer */ $type = $_GET["type"]; $target_uuid = $_GET['target_uuid']; $target_name = $_GET['target_name']; $f = new ValidatingForm(); // Set title if ($type == '') { // Computer if (!xmlrpc_isComputerRegistered($target_uuid) && !xmlrpc_isComputerInProfileRegistered($target_uuid)) { $f->add(new TitleElement(sprintf(_T("Register computer '%s'", "imaging"), $target_name))); } } else { // Profile if (!xmlrpc_isProfileRegistered($target_uuid)) { $f->add(new TitleElement(sprintf(_T("Imaging activation for group '%s'", "imaging"), $target_name))); } } // Get boot menu if ($type == '') { // Computer $ret = xmlrpc_getMyMenuComputer($target_uuid); } else { // Profile $ret = xmlrpc_getMyMenuProfile($target_uuid);