BUgfix : oubliais de mettre à jour le DNS lors de l'activation/desactivation d'une entrée.

A backporter
This commit is contained in:
Alan Garcia 2014-02-05 12:36:54 +00:00
parent 82e8c2e40c
commit 0edf010715
1 changed files with 3 additions and 2 deletions

View File

@ -535,15 +535,16 @@ class m_dom {
$status=strtoupper($status); $status=strtoupper($status);
if (! in_array($status,array('ENABLE', 'DISABLE'))) return false; if (! in_array($status,array('ENABLE', 'DISABLE'))) return false;
$jh = $this->get_sub_domain_all($sub_id);
if ($status == 'ENABLE') { // check compatibility with existing sub_domains if ($status == 'ENABLE') { // check compatibility with existing sub_domains
$jh = $this->get_sub_domain_all($sub_id);
if (! $this->can_create_subdomain($jh['domain'], $jh['name'], $jh['type'], $sub_id) ) { if (! $this->can_create_subdomain($jh['domain'], $jh['name'], $jh['type'], $sub_id) ) {
$err->raise("dom", _("The parameters for this subdomain and domain type are invalid. Please check for subdomain entries incompatibility")); $err->raise("dom", _("The parameters for this subdomain and domain type are invalid. Please check for subdomain entries incompatibility"));
return false; return false;
} }
} }
$db->query("update sub_domaines set enable='$status' where id = '$sub_id'"); $db->query("update sub_domaines set enable='$status' where id = '".intval($sub_id)."';");
$db->query("UPDATE domaines SET dns_action='UPDATE' WHERE domaine='".mysql_escape_string($jh['domain'])."';");
return true; return true;
} }