| | |
| | | function insert($event_name,$data) { |
| | | global $app, $conf; |
| | | |
| | | $app->uses('system'); |
| | | |
| | | if(!is_dir($data['new']['dir'])) { |
| | | $app->log("FTP User directory '".$data['new']['dir']."' does not exist. Creating it now.",LOGLEVEL_DEBUG); |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | $app->system->web_folder_protection($web['document_root'],false); |
| | | exec('mkdir -p '.escapeshellcmd($data['new']['dir'])); |
| | | exec('chown '.escapeshellcmd($web["system_user"]).':'.escapeshellcmd($web['system_group']).' '.$data['new']['dir']); |
| | | $app->system->web_folder_protection($web['document_root'],true); |
| | | |
| | | $app->log("Added ftpuser_dir: ".$data['new']['dir'],LOGLEVEL_DEBUG); |
| | | } |
| | |
| | | function update($event_name,$data) { |
| | | global $app, $conf; |
| | | |
| | | $app->uses('system'); |
| | | |
| | | if(!is_dir($data['new']['dir'])) { |
| | | $app->log("FTP User directory '".$data['new']['dir']."' does not exist. Creating it now.",LOGLEVEL_DEBUG); |
| | | |
| | |
| | | return false; |
| | | } |
| | | |
| | | $app->system->web_folder_protection($web['document_root'],false); |
| | | exec('mkdir -p '.escapeshellcmd($data['new']['dir'])); |
| | | exec('chown '.escapeshellcmd($web["system_user"]).':'.escapeshellcmd($web['system_group']).' '.$data['new']['dir']); |
| | | $app->system->web_folder_protection($web['document_root'],true); |
| | | |
| | | $app->log("Added ftpuser_dir: ".$data['new']['dir'],LOGLEVEL_DEBUG); |
| | | } |