tbrehm
2008-12-18 7227e86264ce29150c51a289fea143af53108d4e
Replace website symlink in /var/www when target directory has been changed.
1 files modified
4 ■■■■ changed files
server/plugins-available/apache2_plugin.inc.php 4 ●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php
@@ -302,6 +302,10 @@
                $tmp_symlink = str_replace("[website_domain]",$data["new"]["domain"],$tmp_symlink);
                // Remove trailing slash
                if(substr($tmp_symlink, -1, 1) == '/') $tmp_symlink = substr($tmp_symlink, 0, -1);
                //* Remove symlink if target folder has been changed.
                if($data["old"]["document_root"] != '' && $data["old"]["document_root"] != $data["new"]["document_root"] && is_link($tmp_symlink)) {
                    unlink($tmp_symlink);
                }
                // create the symlinks, if not exist
                if(!is_link($tmp_symlink)) {
                    exec("ln -s ".escapeshellcmd($data["new"]["document_root"])."/ ".escapeshellcmd($tmp_symlink));