tbrehm
2012-08-22 fea5e7cba7d3c7f567642d0329e0a66eea231dd1
Added unmount commands when website gets deleted in apache2_plugin.inc.php
1 files modified
17 ■■■■■ changed files
server/plugins-available/apache2_plugin.inc.php 17 ●●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php
@@ -1460,6 +1460,23 @@
        } else {
            $apache_chrooted = false;
        }
        //* Remove the mounts
        $log_folder = 'log';
        if($data['old']['type'] == 'vhostsubdomain') {
            $tmp = $app->db->queryOneRecord('SELECT `domain` FROM web_domain WHERE domain_id = '.intval($data['old']['parent_domain_id']));
            $subdomain_host = preg_replace('/^(.*)\.' . preg_quote($tmp['domain'], '/') . '$/', '$1', $data['old']['domain']);
            if($subdomain_host == '') $subdomain_host = 'web'.$data['old']['domain_id'];
            $web_folder = $data['old']['web_folder'];
            $log_folder .= '/' . $subdomain_host;
            unset($tmp);
        }
        exec('umount '.escapeshellarg($data['old']['document_root'].'/'.$log_folder));
        //* remove mountpoint from fstab
        $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$log_folder.'    none    bind    0 0';
        $app->system->removeLine('/etc/fstab',$fstab_line);
        if($data['old']['type'] != 'vhost' && $data['old']['type'] != 'vhostsubdomain' && $data['old']['parent_domain_id'] > 0) {
            //* This is a alias domain or subdomain, so we have to update the website instead