From ca0ed3dd407c48d309bf052aa91f0602c03fe4e3 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Tue, 23 Oct 2018 19:02:15 +0200 Subject: [PATCH] [fix] (for 3.5) fixing longstanding bug when we didn't deleted (or deleted too many) vhosts files in /var/lib/alternc/apache-vhost/. --- bureau/class/m_apache.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bureau/class/m_apache.php b/bureau/class/m_apache.php index 98f4f17f..8371f039 100644 --- a/bureau/class/m_apache.php +++ b/bureau/class/m_apache.php @@ -106,12 +106,13 @@ class m_apache { * launched for each FQDN for which we want to delete a vhost template */ function hook_updatedomains_web_del($subdomid) { - global $db; + global $db,$msg; $db->query("SELECT sd.*, dt.only_dns, dt.has_https_option, m.login FROM domaines_type dt, sub_domaines sd LEFT JOIN membres m ON m.uid=sd.compte WHERE dt.name=sd.type AND sd.web_action!='OK' AND id=?;",array($subdomid)); $db->next_record(); $subdom=$db->Record; $confdir = $this->vhostroot."/".substr($subdom["compte"],-1)."/".$subdom["compte"]; - @unlink($confdir."/".$subdom["fqdn"].".conf"); + $deleteme= $subdom["sub"].(($subdom["sub"])?".":"").$subdom["domaine"].".conf"; + @unlink($confdir."/".$deleteme); $this->shouldreload=true; }