We add the subdomains in sub_domaines_standby when we set the dns to ON. Fixes #517

This commit is contained in:
Chantal Bernard-Putz 2010-06-23 22:16:10 +00:00
parent de5c535ac2
commit 4bf0345088
2 changed files with 9 additions and 4 deletions

View File

@ -166,7 +166,7 @@ if (!$r[noerase]) {
<p>
<?php printf(_("help_dns_mx %s %s"),$L_MX,$L_HOSTING); ?>
</p>
<label for="mx"><?php __("MX Field"); ?> : </label><input type="text" class="int" name="mx" id="mx" value="<?php echo $r["mx"] ?>" <?php if (!$r["dns"]) echo "disabled=\"disabled\""; ?> />
<label for="mx"><?php __("MX Field"); ?> : </label><input type="text" class="int" name="mx" id="mx" value="<?php if ($r["dns"]) echo $r["mx"]; else echo $L_MX; ?>" <?php if (!$r["dns"]) echo "disabled=\"disabled\""; ?> />
</td>
<td width="35%" valign="top">
<p>

View File

@ -873,9 +873,14 @@ class m_dom {
}
}
$db->query("update domaines set gesdns='$dns', mx='$mx', gesmx='$gesmx' where domaine='$dom'");
$db->query("insert into domaines_standby (compte,domaine,mx,gesdns,gesmx,action) values ('$cuid','$dom','$mx','$dns','$gesmx',1);");
// UPDATE
$db->query("UPDATE domaines SET gesdns='$dns', mx='$mx', gesmx='$gesmx' WHERE domaine='$dom'");
$db->query("INSERT INTO domaines_standby (compte,domaine,mx,gesdns,gesmx,action) VALUES ('$cuid','$dom','$mx','$dns','$gesmx',1);");
// If we go from NODNS to YESDNS, we HAVE TO recreate all the subdomains of this domain in the bind zone file
// This code will fix Ticket 517
if ($dns==1 && $r["dns"]==0) {
$db->query("INSERT INTO sub_domaines_standby SELECT compte,domaine,sub,valeur,type,1 FROM sub_domaines WHERE domaine='$dom';");
}
return true;
} // edit_domain