| | |
| | | global $app, $conf; |
| | | |
| | | $app->uses('system'); |
| | | $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$this->data['new']['parent_domain_id']); |
| | | |
| | | if($app->system->is_user($data['new']['username'])) { |
| | | |
| | |
| | | */ |
| | | if ($data['new']['chroot'] == "jailkit") |
| | | { |
| | | $app->system->web_folder_protection($web['document_root'],false); |
| | | |
| | | // load the server configuration options |
| | | $app->uses("getconf"); |
| | | $this->data = $data; |
| | |
| | | exec($command); |
| | | |
| | | $this->_update_website_security_level(); |
| | | $app->system->web_folder_protection($web['document_root'],true); |
| | | } |
| | | |
| | | $app->log("Jailkit Plugin -> insert username:".$data['new']['username'],LOGLEVEL_DEBUG); |
| | |
| | | global $app, $conf; |
| | | |
| | | $app->uses('system'); |
| | | $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$this->data['new']['parent_domain_id']); |
| | | |
| | | if($app->system->is_user($data['new']['username'])) { |
| | | |
| | |
| | | */ |
| | | if ($data['new']['chroot'] == "jailkit") |
| | | { |
| | | $app->system->web_folder_protection($web['document_root'],false); |
| | | |
| | | // load the server configuration options |
| | | $app->uses("getconf"); |
| | | $this->data = $data; |
| | |
| | | $this->_setup_ssh_rsa(); |
| | | |
| | | $this->_update_website_security_level(); |
| | | |
| | | $app->system->web_folder_protection($web['document_root'],true); |
| | | } |
| | | |
| | | $app->log("Jailkit Plugin -> update username:".$data['new']['username'],LOGLEVEL_DEBUG); |
| | |
| | | |
| | | $app->uses('system'); |
| | | |
| | | $web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$this->data['old']['parent_domain_id']); |
| | | |
| | | if ($data['old']['chroot'] == "jailkit") |
| | | { |
| | | $app->uses("getconf"); |
| | |
| | | //commented out proved to be dangerous on config errors |
| | | //exec('rm -rf '.$data['old']['dir'].$jailkit_chroot_userhome); |
| | | |
| | | $app->system->web_folder_protection($web['document_root'],false); |
| | | |
| | | if(@is_dir($data['old']['dir'].$jailkit_chroot_userhome)) { |
| | | $command = 'userdel -f'; |
| | | $command .= ' '.escapeshellcmd($data['old']['username']); |
| | | exec($command); |
| | | $app->log("Jailkit Plugin -> delete chroot home:".$data['old']['dir'].$jailkit_chroot_userhome,LOGLEVEL_DEBUG); |
| | | } |
| | | |
| | | $app->system->web_folder_protection($web['document_root'],true); |
| | | |
| | | } |
| | | |
| | |
| | | if(is_file('/root/.ssh/authorized_keys')) file_put_contents($sshkeys, file_get_contents('/root/.ssh/authorized_keys')); |
| | | |
| | | // Remove duplicate keys |
| | | $existing_keys = file($sshkeys); |
| | | $existing_keys = @file($sshkeys); |
| | | $new_keys = explode("\n", $userkey); |
| | | $final_keys_arr = array_merge($existing_keys, $new_keys); |
| | | $final_keys_arr = @array_merge($existing_keys, $new_keys); |
| | | $new_final_keys_arr = array(); |
| | | if(is_array($final_keys_arr) && !empty($final_keys_arr)){ |
| | | foreach($final_keys_arr as $key => $val){ |