From 0ea264c1144f00fb5a377a3a4223dfa0f7f597f8 Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Sat, 14 Feb 2009 09:53:46 -0500 Subject: [PATCH] ISPConfig writes namevirtualhost directives. --- server/plugins-available/apache2_plugin.inc.php | 21 ++++++++++++++++++--- 1 files changed, 18 insertions(+), 3 deletions(-) diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index 38732ed..7e1c3a4 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -721,9 +721,24 @@ function server_ip($event_name,$data) { global $app, $conf; - // Here we write the name virtualhost directives - // NameVirtualHost IP:80 - // NameVirtualHost IP:443 + // load the server configuration options + $app->uses("getconf"); + $web_config = $app->getconf->get_server_config($conf["server_id"], 'web'); + + $app->load('tpl'); + + $tpl = new tpl(); + $tpl->newTemplate("apache_ispconfig.conf.master"); + $records = $app->db->queryAllRecords("SELECT * FROM server_ip WHERE server_id = ".$conf["server_id"]." AND virtualhost = 'y'"); + + if(count($records) > 0) { + $tpl->setLoop('ip_adresses',$records); + } + + $vhost_file = escapeshellcmd($web_config["vhost_conf_dir"].'/ispconfig.conf'); + file_put_contents($vhost_file,$tpl->grab()); + $app->log("Writing the conf file: ispconfig.conf",LOGLEVEL_DEBUG); + unset($tpl); } -- Gitblit v1.9.1