Exemplo n.º 1
0
 function service_add($type, $target_uuid)
 {
     $params = getParams();
     $item_uuid = $_GET['itemid'];
     $label = urldecode($_GET['itemlabel']);
     $ret = xmlrpc_addServiceToTarget($item_uuid, $target_uuid, $type);
     // goto images list
     if ($ret[0]) {
         /* insert notification code here if needed */
         header("Location: " . urlStrRedirect("base/computers/imgtabs/" . $type . "tabservices", $params));
         exit;
     } else {
         new NotifyWidgetFailure($ret[1]);
     }
 }
Exemplo n.º 2
0
 $params = getParams();
 if (isset($_POST['gid']) && $_POST['gid'] != '') {
     $type = 'group';
     $target_uuid = $_POST['gid'];
 } else {
     $type = '';
     $target_uuid = $_POST['uuid'];
 }
 $item_uuid = $_POST['itemid'];
 $label = urldecode($_POST['itemlabel']);
 $params['name'] = $_POST['default_mi_label'];
 $params['hidden'] = $_POST['do_display'] != 'on';
 $params['hidden_WOL'] = $_POST['do_display_WOL'] != 'on';
 $params['default'] = $_POST['do_default'] == 'on';
 $params['default_WOL'] = $_POST['do_default_WOL'] == 'on';
 $ret = xmlrpc_addServiceToTarget($item_uuid, $target_uuid, $params, $type);
 $ret = xmlrpc_editServiceToTarget($item_uuid, $target_uuid, $params, $type);
 // goto images list
 if ($ret[0] and !isXMLRPCError()) {
     /* insert notification code here if needed */
     // Synchronize boot menu
     if ($type == 'group') {
         $location = getCurrentLocation();
         if ($location == "UUID1") {
             $location_name = _T("root", "pulse2");
         } else {
             $location_name = xmlrpc_getLocationName($location);
         }
         $objprocess = array();
         $scriptmulticast = 'multicast.sh';
         $path = "/tmp/";