Exemplo n.º 1
0
     list($whose, $menu) = $ret;
 }
 /*
  * whose is a list who come from python imaging database code: [uuid, type, target[0].toH]
  * menu is the target boot menu
  */
 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) {
Exemplo n.º 2
0
        $err_msg = getPulse2ErrorString($ret[2], $ret[3]);
    } else {
        list($whose, $menu) = $ret;
    }

    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)
               && (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 == '') {