ftimme
2013-01-31 926b0a2128262974946e40329186ac1863b79231
- Bugfix: when you delete a client with a web site, website symlinks have to be deleted from the client directory before the client directory is deleted (because otherwise the client directory cannot be deleted).
3 files modified
14 ■■■■■ changed files
interface/web/client/client_del.php 2 ●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php 6 ●●●●● patch | view | raw | blame | history
server/plugins-available/nginx_plugin.inc.php 6 ●●●●● patch | view | raw | blame | history
interface/web/client/client_del.php
@@ -112,7 +112,7 @@
    
    
    
    function onAfterDelete() {
    function onBeforeDelete() {
        global $app, $conf;
        
        $client_id = $app->functions->intval($this->dataRecord['client_id']);
server/plugins-available/apache2_plugin.inc.php
@@ -2666,6 +2666,12 @@
            
            $client_dir = $web_config['website_basedir'].'/clients/client'.$client_id;
            if(is_dir($client_dir) && !stristr($client_dir,'..')) {
                // remove symlinks from $client_dir
                $files = array_diff(scandir($client_dir), array('.','..'));
                foreach($files as $file){
                    if(is_link($client_dir.'/'.$file)) unlink($client_dir.'/'.$file);
                }
                @rmdir($client_dir);
                $app->log('Removed client directory: '.$client_dir,LOGLEVEL_DEBUG);
            }
server/plugins-available/nginx_plugin.inc.php
@@ -2441,6 +2441,12 @@
            
            $client_dir = $web_config['website_basedir'].'/clients/client'.$client_id;
            if(is_dir($client_dir) && !stristr($client_dir,'..')) {
                // remove symlinks from $client_dir
                $files = array_diff(scandir($client_dir), array('.','..'));
                foreach($files as $file){
                    if(is_link($client_dir.'/'.$file)) unlink($client_dir.'/'.$file);
                }
                @rmdir($client_dir);
                $app->log('Removed client directory: '.$client_dir,LOGLEVEL_DEBUG);
            }