| | |
| | | var $plugin_name = 'shelluser_jailkit_plugin'; |
| | | var $class_name = 'shelluser_jailkit_plugin'; |
| | | |
| | | //* 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) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /* |
| | | This function is called when the plugin is loaded |
| | |
| | | function insert($event_name,$data) { |
| | | global $app, $conf; |
| | | |
| | | /** |
| | | * Setup Jailkit Chroot System If Enabled |
| | | */ |
| | | if ($data['new']['chroot'] == "jailkit") |
| | | { |
| | | // load the server configuration options |
| | | $app->uses("getconf"); |
| | | $this->data = $data; |
| | | $this->app = $app; |
| | | $this->jailkit_config = $app->getconf->get_server_config($conf["server_id"], 'jailkit'); |
| | | |
| | | $this->_setup_jailkit_chroot(); |
| | | $this->_add_jailkit_user(); |
| | | } |
| | | $app->uses('system'); |
| | | |
| | | $app->log("Jalikit Plugin -> insert username:".$data['new']['username'],LOGLEVEL_DEBUG); |
| | | if($app->system->is_user($data['new']['username'])) { |
| | | |
| | | /** |
| | | * Setup Jailkit Chroot System If Enabled |
| | | */ |
| | | if ($data['new']['chroot'] == "jailkit") |
| | | { |
| | | // load the server configuration options |
| | | $app->uses("getconf"); |
| | | $this->data = $data; |
| | | $this->app = $app; |
| | | $this->jailkit_config = $app->getconf->get_server_config($conf["server_id"], 'jailkit'); |
| | | |
| | | $this->_setup_jailkit_chroot(); |
| | | $this->_add_jailkit_user(); |
| | | } |
| | | |
| | | $app->log("Jalikit Plugin -> insert username:".$data['new']['username'],LOGLEVEL_DEBUG); |
| | | |
| | | } else { |
| | | $app->log("Jalikit Plugin -> insert username:".$data['new']['username']." skipped, the user does not exist.",LOGLEVEL_WARN); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | function update($event_name,$data) { |
| | | global $app, $conf; |
| | | |
| | | /** |
| | | * Setup Jailkit Chroot System If Enabled |
| | | */ |
| | | if ($data['new']['chroot'] == "jailkit") |
| | | { |
| | | // load the server configuration options |
| | | $app->uses("getconf"); |
| | | $this->data = $data; |
| | | $this->app = $app; |
| | | $this->jailkit_config = $app->getconf->get_server_config($conf["server_id"], 'jailkit'); |
| | | |
| | | $this->_setup_jailkit_chroot(); |
| | | $this->_add_jailkit_user(); |
| | | } |
| | | $app->uses('system'); |
| | | |
| | | $app->log("Jalikit Plugin -> update username:".$data['new']['username'],LOGLEVEL_DEBUG); |
| | | if($app->system->is_user($data['new']['username'])) { |
| | | |
| | | /** |
| | | * Setup Jailkit Chroot System If Enabled |
| | | */ |
| | | if ($data['new']['chroot'] == "jailkit") |
| | | { |
| | | // load the server configuration options |
| | | $app->uses("getconf"); |
| | | $this->data = $data; |
| | | $this->app = $app; |
| | | $this->jailkit_config = $app->getconf->get_server_config($conf["server_id"], 'jailkit'); |
| | | |
| | | $this->_setup_jailkit_chroot(); |
| | | $this->_add_jailkit_user(); |
| | | } |
| | | |
| | | $app->log("Jalikit Plugin -> update username:".$data['new']['username'],LOGLEVEL_DEBUG); |
| | | |
| | | } else { |
| | | $app->log("Jalikit Plugin -> update username:".$data['new']['username']." skipped, the user does not exist.",LOGLEVEL_WARN); |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | function delete($event_name,$data) { |
| | | global $app, $conf; |
| | | |
| | | $app->uses('system'); |
| | | |
| | | if ($data['old']['chroot'] == "jailkit") |
| | | { |
| | | $app->uses("getconf"); |