plugin_name = get_class($this); $this->class_name = get_class($this); } //* This function is called during ispconfig installation to determine // if a symlink shall be created for this plugin. function onInstall() { global $conf; if($conf['services']['web'] == true && !@is_link('/usr/local/ispconfig/server/plugins-enabled/apache2_plugin.inc.php')) { return true; } else { return false; } } /* This function is called when the plugin is loaded */ function onLoad() { global $app; /* Register for the events */ $app->plugin_webserver_base->registerEvents('nginx'); } // Handle php.ini changes function php_ini_changed($event_name, $data) { global $app; $app->plugin_webserver_base->eventPhpIniChanged($event_name, $data, 'nginx'); } // Handle the creation of SSL certificates function ssl($event_name, $data) { global $app; $app->plugin_webserver_base->eventSsl($event_name, $data, 'nginx'); } function insert($event_name, $data) { $this->action = 'insert'; // just run the update function $this->update($event_name, $data); } function update($event_name, $data) { global $app; if($this->action != 'insert') $this->action = 'update'; $app->plugins_webserver_base->eventUpdate($event_name, $data, 'nginx'); //* Unset action to clean it for next processed vhost. $this->action = ''; } function delete($event_name, $data) { global $app; $app->plugin_webserver_base->eventDelete($event_name, $data, 'nginx'); } //* This function is called when a IP on the server is inserted, updated or deleted or when anon_ip setting is altered function server_ip($event_name, $data) { global $app; $app->plugin_webserver_base->eventServerIp($event_name, $data, 'nginx'); } //* Create or update the .htaccess folder protection function web_folder_user($event_name, $data) { global $app; $app->plugin_webserver_base->eventWebFolderUser($event_name, $data, 'nginx'); } //* Remove .htpasswd file, when folder protection is removed function web_folder_delete($event_name, $data) { global $app; $app->plugin_webserver_base->eventWebFolderDelete($event_name, $data, 'nginx'); } //* Update folder protection, when path has been changed function web_folder_update($event_name, $data) { global $app; $app->plugin_webserver_base->eventWebFolderUpdate($event_name, $data, 'nginx'); } public function ftp_user_delete($event_name, $data) { global $app; $ftpquota_file = $data['old']['dir'].'/.ftpquota'; if(file_exists($ftpquota_file)) $app->system->unlink($ftpquota_file); } function client_delete($event_name, $data) { global $app; $app->plugin_webserver_base->eventClientDelete($event_name, $data, 'nginx'); } } // end class