- 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).
| | |
| | | |
| | | |
| | | |
| | | function onAfterDelete() { |
| | | function onBeforeDelete() { |
| | | global $app, $conf; |
| | | |
| | | $client_id = $app->functions->intval($this->dataRecord['client_id']); |
| | |
| | | |
| | | $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); |
| | | } |
| | |
| | | |
| | | $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); |
| | | } |