diff --git a/bureau/class/m_dom.php b/bureau/class/m_dom.php index 9759db67..39cf0d79 100644 --- a/bureau/class/m_dom.php +++ b/bureau/class/m_dom.php @@ -1973,6 +1973,20 @@ function generate_apacheconf($p = null) { return $r; } + function subdomain_modif_are_done($sub_domain_id, $action) { + global $db; + $sub_domain_id=intval($sub_domain_id); + switch (strtolower($action)) { + case "delete": + $sql="DELETE FROM sub_domaines WHERE id =$sub_domain_id;"; + break; + default: + $sql="UPDATE sub_domaines SET web_action='OK' WHERE id='$sub_domain_id'; "; + } + $db->query($sql); + return true; + } + /* ----------------------------------------------------------------- */ /** hook function called by AlternC-upnp to know which open * tcp or udp ports this class requires or suggests diff --git a/src/generate_apache_conf.php b/src/generate_apache_conf.php index 90eb0302..bdd87b8b 100755 --- a/src/generate_apache_conf.php +++ b/src/generate_apache_conf.php @@ -22,6 +22,7 @@ FIXME : */ // Check if we can modify Apache conf +@touch(ALTERNC_VHOST_FILE); if ( ! is_writable( ALTERNC_VHOST_FILE )) { die("Error: ".ALTERNC_VHOST_FILE." is not writable\n"); } @@ -66,6 +67,9 @@ if (! file_put_contents(ALTERNC_VHOST_FILE, $conf2) ) { die("Error: writing content\n"); } +// Update the database to inform that we did the job +array_walk_recursive($todo, 'm_dom::subdomain_modif_are_done'); + // Hooks ! foreach (array('DELETE', 'CREATE', 'UPDATE', 'ENABLE', 'DISABLE') as $y) { if (!isset($todo[$y]) || empty($todo[$y])) continue;