private function ExceptionOnErrors(ErrorList $ErrList, $message = null, $code = null)
 {
     if ($ErrList->HasMessages()) {
         if (!$message) {
             $message = _("Cannot register domain");
         }
         $e = new RegisterDomainAction_Exception($message);
         $e->ErrorList = $ErrList;
         throw $e;
     }
 }
Beispiel #2
0
	        					sprintf(_("Contact <%s> is not yet approved by administrator"), $Contact->GetTitle()));
	        			}
	        			else
	        			{
	        				// Accept contact
		        			$_SESSION["domaininfo"][$v["type"]] = $_POST[$v["type"]];	        				
	        			}
	        		}
	        		catch (Exception $e)
	        		{
	        			$exception->AddMessage($e->getMessage());
	        		}
	        	}
	        }
	        
	        if ($exception->HasMessages())
	        	throw $exception;
	        
	        $fields = $registry_config->domain->registration->extra_fields->xpath("field"); 
        	if (count($fields) > 0)
				$display["add_fields"] = UI::GetRegExtraFieldsForSmarty($registry_config);
			else
				$display["add_fields"] = false;
				
			$_SESSION["wiz_contacts"] = true;
			
			if ($_SESSION["domaininfo"]["id"])
			{        		
				$domaininfo = $db->GetRow("SELECT * FROM domains WHERE id=?", array($_SESSION["domaininfo"]["id"]));
        		$display["ns1"] = $domaininfo["ns1"];
        		$display["ns2"] = $domaininfo["ns2"];
 protected function PostNS()
 {
     $ErrList = new ErrorList();
     $Validator = Core::GetValidatorInstance();
     if (!$attr["enable_managed_dns"]) {
         foreach (array("ns1", "ns2") as $k) {
             if (!$Validator->IsDomain($this->attr[$k])) {
                 $ErrList->AddMessage(sprintf(_("%s is not a valid host"), $this->attr[$k]));
             }
         }
         if ($attr["ns1"] && $attr["ns1"] == $attr["ns2"]) {
             $ErrList->AddMessage(_("You cannot use the same nameserver twice."));
         }
         if ($ErrList->HasMessages()) {
             throw $ErrList;
         }
         $this->ns = array($this->attr["ns1"], $this->attr["ns2"]);
     } else {
         $this->ns = array(CONFIG::$NS1, CONFIG::$NS2);
     }
 }