Fix des typo bizarre de m_dom

Rajoute un controle sur les valeurs de ttl
This commit is contained in:
Alan Garcia 2013-07-10 07:06:29 +00:00
parent 1b5ee89245
commit 363c7a2d32
1 changed files with 16 additions and 12 deletions

View File

@ -1098,6 +1098,10 @@ class m_dom {
return false; return false;
} }
} }
# Can't have ttl == 0. There is also a check in function_dns
if ( $ttl == 0 ) { $ttl = 86400; }
$t=checkfqdn($dom); $t=checkfqdn($dom);
if ($t) { if ($t) {
$err->raise("dom",_("The domain name is syntaxically incorrect")); $err->raise("dom",_("The domain name is syntaxically incorrect"));
@ -1462,26 +1466,26 @@ class m_dom {
$s=$this->get_domain_all($d); $s=$this->get_domain_all($d);
$this->unlock(); $this->unlock();
if(empty($s["dns"])){ if(empty($s["dns"])){
$s[dns]="non"; $s["dns"]="non";
}else{ }else{
$s[dns]="oui"; $s["dns"]="oui";
} }
$str.=" <dns>".$s[dns]."</dns>\n"; $str.=" <dns>".$s["dns"]."</dns>\n";
if(empty($s[mx])){ if(empty($s["mx"])){
$s[mx]="non"; $s["mx"]="non";
}else{ }else{
$s[mx]="oui"; $s["mx"]="oui";
} }
$str.=" <mx>".$s[mx]."</mx>\n"; $str.=" <mx>".$s["mx"]."</mx>\n";
if(empty($s[mail])){ if(empty($s["mail"])){
$s[mail]="non"; $s["mail"]="non";
} }
$str.=" <mail>".$s[mail]."</mail>\n"; $str.=" <mail>".$s["mail"]."</mail>\n";
if (is_array($s[sub])) { if (is_array($s["sub"])) {
foreach ($s[sub] as $sub) { foreach ($s["sub"] as $sub) {
$str.=" <subdomain>\n"; $str.=" <subdomain>\n";
$str.=" <enabled>".$sub["enable"]." </enabled>\n"; $str.=" <enabled>".$sub["enable"]." </enabled>\n";
$str.=" <destination>".$sub["dest"]." </destination>\n"; $str.=" <destination>".$sub["dest"]." </destination>\n";