gere la valeur du champ zonettl dans le formulaire du domaine (et update dans la base)
fixes #1514
This commit is contained in:
parent
df28b20d83
commit
dc801c9a59
|
@ -216,6 +216,17 @@ if (!$r['noerase']) {
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
<?php if ($r["dns"]) { ?>
|
||||||
|
<table class="tlist2">
|
||||||
|
<tr>
|
||||||
|
<td><?php __("Define TTL for the zone records"); ?> : </td>
|
||||||
|
<td>
|
||||||
|
<input type="text" id="ttldns" class="inc" name="ttl" size="6" value="<?php echo ($r["zonettl"]); ?>" /> <?php __("seconds"); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<table class="tlist2">
|
<table class="tlist2">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -34,12 +34,13 @@ $fields = array (
|
||||||
"domain" => array ("request", "string", ""),
|
"domain" => array ("request", "string", ""),
|
||||||
"dns" => array ("request", "integer", 1),
|
"dns" => array ("request", "integer", 1),
|
||||||
"email" => array ("request", "integer", 1),
|
"email" => array ("request", "integer", 1),
|
||||||
|
"ttl" => array ("request", "integer", 86400),
|
||||||
);
|
);
|
||||||
getFields($fields);
|
getFields($fields);
|
||||||
|
|
||||||
$dom->lock();
|
$dom->lock();
|
||||||
|
|
||||||
if (!$dom->edit_domain($domain,$dns,$email)) {
|
if (!$dom->edit_domain($domain,$dns,$email,0,$ttl)) {
|
||||||
$error=$err->errstr();
|
$error=$err->errstr();
|
||||||
include("dom_edit.php");
|
include("dom_edit.php");
|
||||||
$dom->unlock();
|
$dom->unlock();
|
||||||
|
|
|
@ -771,6 +771,7 @@ class m_dom {
|
||||||
$r["dns_action"]=$db->Record["dns_action"];
|
$r["dns_action"]=$db->Record["dns_action"];
|
||||||
$r["dns_result"]=$db->Record["dns_result"];
|
$r["dns_result"]=$db->Record["dns_result"];
|
||||||
$r["mail"]=$db->Record["gesmx"];
|
$r["mail"]=$db->Record["gesmx"];
|
||||||
|
$r["zonettl"]=$db->Record["zonettl"];
|
||||||
$r['noerase']=$db->Record['noerase'];
|
$r['noerase']=$db->Record['noerase'];
|
||||||
$db->free();
|
$db->free();
|
||||||
$db->query("SELECT COUNT(*) AS cnt FROM sub_domaines WHERE compte='$cuid' AND domaine='$dom'");
|
$db->query("SELECT COUNT(*) AS cnt FROM sub_domaines WHERE compte='$cuid' AND domaine='$dom'");
|
||||||
|
@ -1073,7 +1074,7 @@ class m_dom {
|
||||||
* TRUE sinon.
|
* TRUE sinon.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function edit_domain($dom,$dns,$gesmx,$force=0) {
|
function edit_domain($dom,$dns,$gesmx,$force=0,$ttl=86400) {
|
||||||
global $db,$err,$L_MX,$classes,$cuid,$hooks;
|
global $db,$err,$L_MX,$classes,$cuid,$hooks;
|
||||||
$err->log("dom","edit_domain",$dom."/".$dns."/".$gesmx);
|
$err->log("dom","edit_domain",$dom."/".$dns."/".$gesmx);
|
||||||
// Locked ?
|
// Locked ?
|
||||||
|
@ -1109,7 +1110,7 @@ class m_dom {
|
||||||
}
|
}
|
||||||
if ($dns!="1") $dns="0";
|
if ($dns!="1") $dns="0";
|
||||||
// On vérifie que des modifications ont bien eu lieu :)
|
// On vérifie que des modifications ont bien eu lieu :)
|
||||||
if ($r["dns"]==$dns && $r["mail"]==$gesmx) {
|
if ($r["dns"]==$dns && $r["mail"]==$gesmx && $r["zonettl"]==$ttl) {
|
||||||
$err->raise("dom",_("No change has been requested..."));
|
$err->raise("dom",_("No change has been requested..."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1137,7 +1138,7 @@ class m_dom {
|
||||||
$hooks->invoke("hook_dom_del_mx_domain",array($r["id"]));
|
$hooks->invoke("hook_dom_del_mx_domain",array($r["id"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
$db->query("UPDATE domaines SET gesdns='$dns', gesmx='$gesmx' WHERE domaine='$dom'");
|
$db->query("UPDATE domaines SET gesdns='$dns', gesmx='$gesmx', zonettl='$ttl' WHERE domaine='$dom'");
|
||||||
$db->query("UPDATE domaines set dns_action='UPDATE' where domaine='$dom';");
|
$db->query("UPDATE domaines set dns_action='UPDATE' where domaine='$dom';");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue