diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index 04ee2909..aed9d922 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -535,15 +535,16 @@ class m_dom { $status=strtoupper($status); 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 - $jh = $this->get_sub_domain_all($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")); 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; }