diff --git a/bureau/class/m_apache.php b/bureau/class/m_apache.php index bf69ab54..87767e65 100644 --- a/bureau/class/m_apache.php +++ b/bureau/class/m_apache.php @@ -160,6 +160,7 @@ class m_apache { } closedir($d); fclose($f); + rename($this->vhostroot."/vhosts_all.conf.new", $this->vhostroot."/vhosts_all.conf"); } private function subconcat($f,$root) { diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index 2261bf6e..484a16e4 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -1943,14 +1943,22 @@ class m_dom { $db->query("SELECT sd.*, dt.only_dns FROM domaines_type dt, sub_domaines sd WHERE dt.name=sd.type AND sd.web_action!='OK';"); $alldoms=array(); $ignore=array(); + $delete=array(); while ($db->next_record()) { // only_dns=1 => weird, we should not have web_action SET to something else than OK ... anyway, skip it if ($db->Record["only_dns"]) { - $ignore[]=$db->Record["id"]; + if ($db->Record["web_action"]=="DELETE") { + $delete[]=$db->Record["id"]; + } else { + $ignore[]=$db->Record["id"]; + } } else { $alldoms[$db->Record["id"]]=$db->Record; } } + foreach($delete as $id) { + $db->query("DELETE FROM sub_domaines WHERE id=?;",array($id)); + } foreach($ignore as $id) { // @FIXME (unsure it's useful) maybe we could check that no file exist for this subdomain ? $db->query("UPDATE sub_domaines SET web_action='OK' WHERE id=?;",array($id));