Commit 9d583c35 authored by Falko Timme's avatar Falko Timme

- Ported relevant changes from Apache plugin to nginx plugin.

parent d03323d1
...@@ -86,6 +86,8 @@ class nginx_plugin { ...@@ -86,6 +86,8 @@ class nginx_plugin {
$app->plugins->registerEvent('web_folder_update',$this->plugin_name,'web_folder_update'); $app->plugins->registerEvent('web_folder_update',$this->plugin_name,'web_folder_update');
$app->plugins->registerEvent('web_folder_delete',$this->plugin_name,'web_folder_delete'); $app->plugins->registerEvent('web_folder_delete',$this->plugin_name,'web_folder_delete');
$app->plugins->registerEvent('ftp_user_delete',$this->plugin_name,'ftp_user_delete');
} }
// Handle the creation of SSL certificates // Handle the creation of SSL certificates
...@@ -635,9 +637,10 @@ class nginx_plugin { ...@@ -635,9 +637,10 @@ class nginx_plugin {
* website root has to be owned by the root user and we have to chmod it to 755 then * website root has to be owned by the root user and we have to chmod it to 755 then
*/ */
//* Check if there is a jailkit user for this site //* Check if there is a jailkit user or cronjob for this site
$tmp = $app->db->queryOneRecord('SELECT count(shell_user_id) as number FROM shell_user WHERE parent_domain_id = '.$data['new']['domain_id']." AND chroot = 'jailkit'"); $tmp = $app->db->queryOneRecord('SELECT count(shell_user_id) as number FROM shell_user WHERE parent_domain_id = '.$data['new']['domain_id']." AND chroot = 'jailkit'");
if($tmp['number'] > 0) { $tmp2 = $app->db->queryOneRecord('SELECT count(id) as number FROM cron WHERE parent_domain_id = '.$data['new']['domain_id']." AND `type` = 'chrooted'");
if($tmp['number'] > 0 || $tmp2['number'] > 0) {
$this->_exec('chmod 755 '.escapeshellcmd($data['new']['document_root'])); $this->_exec('chmod 755 '.escapeshellcmd($data['new']['document_root']));
$this->_exec('chown root:root '.escapeshellcmd($data['new']['document_root'])); $this->_exec('chown root:root '.escapeshellcmd($data['new']['document_root']));
} }
...@@ -1314,6 +1317,14 @@ class nginx_plugin { ...@@ -1314,6 +1317,14 @@ class nginx_plugin {
$this->update('web_domain_update', $webdata); $this->update('web_domain_update', $webdata);
} }
public function ftp_user_delete($event_name,$data) {
global $app, $conf;
$ftpquota_file = $data['old']['dir'].'/.ftpquota';
if(file_exists($ftpquota_file)) unlink($ftpquota_file);
}
function _create_web_folder_auth_configuration($website){ function _create_web_folder_auth_configuration($website){
global $app, $conf; global $app, $conf;
//* Create the domain.auth file which is included in the vhost configuration file //* Create the domain.auth file which is included in the vhost configuration file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment