[fix] more bugs in update_domaines.php => not renaming vhosts_all.conf.new to vhosts_all.conf.new + ignoring deletion of DNS_ONLY sub_domaines entries
This commit is contained in:
parent
1e4f2783d8
commit
e705f377b9
|
@ -160,6 +160,7 @@ class m_apache {
|
||||||
}
|
}
|
||||||
closedir($d);
|
closedir($d);
|
||||||
fclose($f);
|
fclose($f);
|
||||||
|
rename($this->vhostroot."/vhosts_all.conf.new", $this->vhostroot."/vhosts_all.conf");
|
||||||
}
|
}
|
||||||
|
|
||||||
private function subconcat($f,$root) {
|
private function subconcat($f,$root) {
|
||||||
|
|
|
@ -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';");
|
$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();
|
$alldoms=array();
|
||||||
$ignore=array();
|
$ignore=array();
|
||||||
|
$delete=array();
|
||||||
while ($db->next_record()) {
|
while ($db->next_record()) {
|
||||||
// only_dns=1 => weird, we should not have web_action SET to something else than OK ... anyway, skip it
|
// only_dns=1 => weird, we should not have web_action SET to something else than OK ... anyway, skip it
|
||||||
if ($db->Record["only_dns"]) {
|
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 {
|
} else {
|
||||||
$alldoms[$db->Record["id"]]=$db->Record;
|
$alldoms[$db->Record["id"]]=$db->Record;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
foreach($delete as $id) {
|
||||||
|
$db->query("DELETE FROM sub_domaines WHERE id=?;",array($id));
|
||||||
|
}
|
||||||
foreach($ignore as $id) {
|
foreach($ignore as $id) {
|
||||||
// @FIXME (unsure it's useful) maybe we could check that no file exist for this subdomain ?
|
// @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));
|
$db->query("UPDATE sub_domaines SET web_action='OK' WHERE id=?;",array($id));
|
||||||
|
|
Loading…
Reference in New Issue