Commit 318ace2f authored by tbrehm's avatar tbrehm

No commit message

No commit message
parent e2c5f8b5
......@@ -238,7 +238,7 @@ class apache2_plugin {
if(is_array($tmp_symlinks_array)) {
foreach($tmp_symlinks_array as $tmp_symlink) {
$tmp_symlink = str_replace("[client_id]",$client_id,$tmp_symlink);
$tmp_symlink = str_replace("[website_domain]",$data["new"]["domain"],$tmp_symlink);
$tmp_symlink = str_replace("[website_domain]",$data["old"]["domain"],$tmp_symlink);
// Remove trailing slash
if(substr($tmp_symlink, -1, 1) == '/') $tmp_symlink = substr($tmp_symlink, 0, -1);
// create the symlinks, if not exist
......@@ -389,6 +389,13 @@ class apache2_plugin {
$app->log("Removing symlink: $vhost_symlink => $vhost_file",LOGLEVEL_DEBUG);
}
// remove old symlink, if domain name of the site has changed
if($this->action == 'update' && $data["old"]["domain"] != '' && $data["new"]["domain"] != $data["old"]["domain"]) {
$vhost_symlink = escapeshellcmd($web_config["vhost_conf_enabled_dir"].'/'.$data["old"]["domain"].'.vhost');
unlink($vhost_symlink);
$app->log("Removing symlink: $vhost_symlink => $vhost_file",LOGLEVEL_DEBUG);
}
// request a httpd reload when all records have been processed
$app->services->restartServiceDelayed('httpd','reload');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment