Beispiel #1
0
  */
 if (!$whose && !$menu) {
     if ($type == '') {
         $msg = _T("To register, you must first set a default menu to the imaging server that manages the entity of this computer.", "imaging");
     } else {
         $msg = _T("To register, you must first set a default menu to the imaging server that manages the entities of the computers that belongs to this profile.", "imaging");
     }
     $f->add(new TitleElement($msg, 3));
     $f->display();
 } else {
     if ($type == '' && $is_registering && xmlrpc_checkComputerForImaging($target_uuid) != 0) {
         $msg = _T("The computer either doesn't have a MAC address, either has more than one MAC address or the only NIC doesn't have any network mask. It can't be registered into the imaging module.", "imaging");
         $f->add(new TitleElement($msg, 3));
         $f->display();
     } else {
         if ($type == 'group' && $is_registering && ($checkProfileForImagingStatus = xmlrpc_checkProfileForImaging($target_uuid) and $checkProfileForImagingStatus != 0)) {
             if ($checkProfileForImagingStatus != 2) {
                 $msg = _T("The profile can't be registered into the imaging module.", "imaging");
                 $f->add(new TitleElement($msg, 3));
             } else {
                 // form preseeding
                 $f->add(new HiddenTpl("target_uuid"), array("value" => $target_uuid, "hide" => True));
                 $f->add(new HiddenTpl("target_name"), array("value" => $target_name, "hide" => True));
                 $f->add(new HiddenTpl("type"), array("value" => $type, "hide" => True));
                 $profileNetworks = xmlrpc_getProfileNetworks($target_uuid);
                 foreach ($profileNetworks as $networks) {
                     $networks = $networks[1];
                     foreach (range(0, count($networks['ipHostNumber']) - 1) as $i) {
                         $ip = explode(":", $networks['ipHostNumber'][$i]);
                         if (filter_var($ip[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) == "") {
                             unset($networks['ipHostNumber'][$i]);
Beispiel #2
0
        if ($type == '') {
            $msg = _T("To register, you must first set a default menu to the imaging server that manages the entity of this computer.", "imaging");
        } else {
            $msg = _T("To register, you must first set a default menu to the imaging server that manages the entities of the computers that belongs to this profile.", "imaging");
        }
        $f->add(new TitleElement($msg, 3));
        $f->display();
    } else if (($type == '')
               && ($is_registering)
               && (xmlrpc_checkComputerForImaging($target_uuid) != 0)) {
        $msg = _T("The computer either doesn't have a MAC address, either has more than one MAC address or the only NIC doesn't have any network mask. It can't be registered into the imaging module.", "imaging");
        $f->add(new TitleElement($msg, 3));
        $f->display();
    } else if (($type == 'group')
               && ($is_registering)
               && (xmlrpc_checkProfileForImaging($target_uuid) != 0)) {
        $msg = _T("The profile can't be registered into the imaging module.", "imaging");
        $f->add(new TitleElement($msg, 3));
        $f->display();
    } else {
        $target = null;
        $real_target = null;
        $has_profile = False;
        if (!$whose) {
            if ($type == '') {
                $msg = _T("The default values for the imaging parameters will be inherited from the imaging server that manages the entity that owns this computer.", "imaging");
            } else {
                $msg = _T("The default values for the imaging parameters will be inherited from the imaging server that manages the entities of the computers that belongs to this profile.", "imaging");
            }

            $f->add(new TitleElement($msg, 3));