Skip to content

Commit 1d8123a

Browse files
committed
Fixed some bugs in apps_vhost_plugin.
1 parent 0a2a60f commit 1d8123a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

server/plugins-available/apps_vhost_plugin.inc.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,13 @@ function insert($event_name,$data) {
7070
// The purpose of this plugin is to rewrite the main.cf file
7171
function update($event_name,$data) {
7272
global $app, $conf;
73-
74-
if( $data['old']['apps_vhost_ip'] != $data['new']['apps_vhost_ip'] or
75-
$data['old']['apps_vhost_port'] != $data['new']['apps_vhost_port'] or
76-
$data['old']['apps_vhost_servername'] != $data['new']['apps_vhost_servername'] ) {
77-
73+
7874
// get the config
7975
$app->uses("getconf");
8076
$web_config = $app->getconf->get_server_config($conf["server_id"], 'web');
8177

8278
// Dont just copy over the virtualhost template but add some custom settings
83-
$content = rf("conf/apache_apps.vhost.master");
79+
$content = file_get_contents($conf["rootpath"]."/conf/apache_apps.vhost.master");
8480

8581
$vhost_conf_dir = $web_config['vhost_conf_dir'];
8682
$vhost_conf_enabled_dir = $web_config['vhost_conf_enabled_dir'];
@@ -99,8 +95,9 @@ function update($event_name,$data) {
9995
$content = str_replace('{vhost_port_listen}', '', $content);
10096
}
10197

102-
wf("$vhost_conf_dir/apps.vhost", $content);
103-
}
98+
file_put_contents("$vhost_conf_dir/apps.vhost", $content);
99+
100+
$app->services->restartServiceDelayed('httpd','restart');
104101

105102

106103
}

0 commit comments

Comments
 (0)