Skip to content
......@@ -186,7 +186,7 @@ class modules {
$app->db->query($sql, $d['dbtable'], $idx[0], $idx[1]);
if($app->db->errorNumber > 0) {
$replication_error = true;
$app->log("Replication failed. Error: (" . $d[dbtable] . ") " . $app->db->errorMessage . " # SQL: " . $sql, LOGLEVEL_ERROR);
$app->log("Replication failed. Error: (" . $d['dbtable'] . ") " . $app->db->errorMessage . " # SQL: " . $sql, LOGLEVEL_ERROR);
}
$log = $app->db->_build_query_string($sql, $d['dbtable'], $idx[0], $idx[1]);
$app->log('Replicated from master: '.$log, LOGLEVEL_DEBUG);
......
......@@ -57,7 +57,7 @@ class services {
// call_user_method($function_name,$app->loaded_modules[$module_name],$action);
return call_user_func(array($app->loaded_modules[$module_name], $function_name), $action);
} else {
$app->log("Unable to restart $service_name. Service not registered.", LOGLEVEL_WARNING);
$app->log("Unable to restart $service_name. Service not registered.", LOGLEVEL_WARN);
return array('output' => '', 'retval' => 0);
}
......
......@@ -2132,6 +2132,26 @@ class system{
}
$full_init_script_path = realpath($init_script_directory.'/'.$servicename);
//** Gentoo, keep symlink as init script, but do some checks
if(file_exists('/etc/gentoo-release')) {
//* check if init script is symlink
if(is_link($init_script_directory.'/'.$servicename)) {
//* Check init script owner (realpath, symlink is checked later)
if(fileowner($full_init_script_path) !== 0) {
$app->log('Init script '.$full_init_script_path.' not owned by root user',LOGLEVEL_WARN);
return false;
}
//* full path is symlink
$full_init_script_path_symlink = $init_script_directory.'/'.$servicename;
//* check if realpath matches symlink
if(strpos($full_init_script_path_symlink,$full_init_script_path) == 0) {
$full_init_script_path = $full_init_script_path_symlink;
}
}
}
if($full_init_script_path == '') {
$app->log('No init script, we quit here.',LOGLEVEL_WARN);
......@@ -2327,6 +2347,16 @@ class system{
return true;
}
public function is_redhat_os() {
global $app;
if(file_exists('/etc/redhat-release') && (filesize('/etc/redhat-release') > 0)) {
return true;
} else {
return false;
}
}
public function is_allowed_path($path) {
global $app;
......
......@@ -1342,6 +1342,7 @@ class apache2_plugin {
$tpl->setVar($vhost_data);
$tpl->setVar('apache_version', $app->system->getapacheversion());
$tpl->setVar('apache_full_version', $app->system->getapacheversion(true));
// Rewrite rules
$rewrite_rules = array();
......
......@@ -393,7 +393,7 @@ class bind_plugin {
//}
//* Delete old domain file, if domain name has been changed
if($data['old']['origin'] != $data['new']['origin']) {
if(!empty($data['old']['origin']) && $data['old']['origin'] != $data['new']['origin']) {
$filename = $dns_config['bind_zonefiles_dir'].'/' . $this->zone_file_prefix() . str_replace("/", "_", substr($data['old']['origin'], 0, -1));
if(is_file($filename)) unlink($filename);
......
......@@ -155,7 +155,7 @@ class mail_plugin_dkim {
$app->system->mkdirpath($mail_config['dkim_path'], 0750, $amavis_user, $amavis_group);
} else {
$app->system->mkdirpath($mail_config['dkim_path'], 0755);
$app->log('No user amavis or vscan found - using root for '.$mail_config['dkim_path'], LOGLEVEL_WARNING);
$app->log('No user amavis or vscan found - using root for '.$mail_config['dkim_path'], LOGLEVEL_WARN);
}
} else {
if (!$app->system->checkpath($mail_config['dkim_path'])) {
......
......@@ -516,7 +516,7 @@ class mongo_clientdb_plugin {
if ((bool) $db_user) {
if ($user == 'root') {
$app->log("User root not allowed for client databases", LOGLEVEL_WARNING);
$app->log("User root not allowed for client databases", LOGLEVEL_WARN);
} else {
if (!$this->addUser($db, array(
'username' => $user,
......@@ -526,14 +526,14 @@ class mongo_clientdb_plugin {
"dbAdmin"
)
))) {
$app->log("Error while adding user: ".$user." to DB: ".$db, LOGLEVEL_WARNING);
$app->log("Error while adding user: ".$user." to DB: ".$db, LOGLEVEL_WARN);
}
}
}
if ($db_ro_user && $data['new']['database_user_id'] != $data['new']['database_ro_user_id']) {
if ($user == 'root') {
$app->log("User root not allowed for client databases", LOGLEVEL_WARNING);
$app->log("User root not allowed for client databases", LOGLEVEL_WARN);
} else {
if (!$this->addUser($db, array(
'username' => $ro_user,
......@@ -542,7 +542,7 @@ class mongo_clientdb_plugin {
"read"
)
))) {
$app->log("Error while adding read-only user: ".$user." to DB: ".$db, LOGLEVEL_WARNING);
$app->log("Error while adding read-only user: ".$user." to DB: ".$db, LOGLEVEL_WARN);
}
}
}
......@@ -607,7 +607,7 @@ class mongo_clientdb_plugin {
if ((bool) $old_db_user) {
if ($old_db_user['database_user'] == 'root') {
$app->log("User root not allowed for client databases", LOGLEVEL_WARNING);
$app->log("User root not allowed for client databases", LOGLEVEL_WARN);
} else {
$this->dropUser($old_db_user['database_user'], $db);
}
......@@ -620,7 +620,7 @@ class mongo_clientdb_plugin {
if ((bool) $old_db_user) {
if ($old_db_user['database_user'] == 'root') {
$app->log("User root not allowed for client databases", LOGLEVEL_WARNING);
$app->log("User root not allowed for client databases", LOGLEVEL_WARN);
} else {
$this->dropUser($old_db_user['database_user'], $db);
}
......@@ -631,7 +631,7 @@ class mongo_clientdb_plugin {
if ($data['new']['database_user_id'] != $data['old']['database_user_id']) {
if ((bool) $db_user) {
if ($user == 'root') {
$app->log("User root not allowed for client databases", LOGLEVEL_WARNING);
$app->log("User root not allowed for client databases", LOGLEVEL_WARN);
} else {
$this->addUser($db, array(
'username' => $user,
......@@ -649,7 +649,7 @@ class mongo_clientdb_plugin {
if ($data['new']['database_ro_user_id'] != $data['old']['database_ro_user_iduser_id']) {
if ((bool) $db_ro_user && $data['new']['database_user_id'] != $data['new']['database_ro_user_id']) {
if ($ro_user == 'root') {
$app->log("User root not allowed for client databases", LOGLEVEL_WARNING);
$app->log("User root not allowed for client databases", LOGLEVEL_WARN);
} else {
$this->addUser($db, array(
'username' => $ro_user,
......@@ -671,7 +671,7 @@ class mongo_clientdb_plugin {
if ($this->renameDB($oldName, $newName)) {
$app->log("Renamed MongoDB database: ".$old_name." -> ".$new_name, LOGLEVEL_DEBUG);
} else {
$app->log("Renaming MongoDB database failed: ".$old_name." -> ".$new_name, LOGLEVEL_WARNING);
$app->log("Renaming MongoDB database failed: ".$old_name." -> ".$new_name, LOGLEVEL_WARN);
}
}
*/
......@@ -710,7 +710,7 @@ class mongo_clientdb_plugin {
if ($this->dropDB($db_to_drop)) {
$app->log("Dropping MongoDB database: ".$db_to_drop, LOGLEVEL_DEBUG);
} else {
$app->log("Error while dropping MongoDB database: ".$db_to_drop, LOGLEVEL_WARNING);
$app->log("Error while dropping MongoDB database: ".$db_to_drop, LOGLEVEL_WARN);
}
$this->disconnect();
......@@ -770,13 +770,13 @@ class mongo_clientdb_plugin {
))) {
$app->log("Created user: ".$data['new']['database_user']." in DB: ".$db, LOGLEVEL_DEBUG);
} else {
$app->log("Couldn't create user: ".$data['new']['database_user']." in DB: ".$db, LOGLEVEL_WARNING);
$app->log("Couldn't create user: ".$data['new']['database_user']." in DB: ".$db, LOGLEVEL_WARN);
}
} else {
$app->log("Couldn't drop user: ".$data['old']['database_user']." in DB: ".$db, LOGLEVEL_WARNING);
$app->log("Couldn't drop user: ".$data['old']['database_user']." in DB: ".$db, LOGLEVEL_WARN);
}
} else {
$app->log("User: ".$data['new']['database_user']." already exists in DB: ".$db, LOGLEVEL_WARNING);
$app->log("User: ".$data['new']['database_user']." already exists in DB: ".$db, LOGLEVEL_WARN);
}
}
}
......@@ -794,7 +794,7 @@ class mongo_clientdb_plugin {
if ($this->changePassword($db, $data['new']['database_user'], md5($data['new']['database_password_mongo']))) {
$app->log("Changed user's: ".$data['new']['database_user']." password in DB: ".$db, LOGLEVEL_DEBUG);
} else {
$app->log("Couldn't change user's: ".$data['new']['database_user']." password in DB: ".$db, LOGLEVEL_WARNING);
$app->log("Couldn't change user's: ".$data['new']['database_user']." password in DB: ".$db, LOGLEVEL_WARN);
}
}
}
......@@ -825,7 +825,7 @@ class mongo_clientdb_plugin {
if ($this->dropUser($data['old']['database_user']) === true) {
$app->log("Dropped MongoDB user: ".$data['old']['database_user'], LOGLEVEL_DEBUG);
} else {
$app->log("Error while dropping MongoDB user: ".$data['old']['database_user'], LOGLEVEL_WARNING);
$app->log("Error while dropping MongoDB user: ".$data['old']['database_user'], LOGLEVEL_WARN);
}
$this->disconnect();
......
......@@ -280,7 +280,7 @@ class mysql_clientdb_plugin {
if ($link->query('CREATE DATABASE `'.$link->escape_string($data['new']['database_name']).'`'.$query_charset_table)) {
$app->log('Created MySQL database: '.$data['new']['database_name'], LOGLEVEL_DEBUG);
} else {
$app->log('Unable to create the database: '.$link->error, LOGLEVEL_WARNING);
$app->log('Unable to create the database: '.$link->error, LOGLEVEL_WARN);
}
// Create the database user if database is active
......@@ -299,11 +299,11 @@ class mysql_clientdb_plugin {
$host_list .= 'localhost';
if($db_user) {
if($db_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
if($db_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
else $this->process_host_list('GRANT', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $host_list, $link, '', ($data['new']['quota_exceeded'] == 'y' ? 'rd' : 'rw'));
}
if($db_ro_user && $data['new']['database_user_id'] != $data['new']['database_ro_user_id']) {
if($db_ro_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
if($db_ro_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
else $this->process_host_list('GRANT', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $host_list, $link, '', 'r');
}
......@@ -491,17 +491,17 @@ class mysql_clientdb_plugin {
// Create the database user if database was disabled before
if($data['new']['active'] == 'y') {
if($db_user) {
if($db_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
if($db_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
else $this->process_host_list('GRANT', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $host_list, $link, '', ($data['new']['quota_exceeded'] == 'y' ? 'rd' : 'rw'));
}
if($db_ro_user && $data['new']['database_user_id'] != $data['new']['database_ro_user_id']) {
if($db_ro_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
if($db_ro_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
else $this->process_host_list('GRANT', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $host_list, $link, '', 'r');
}
} elseif($data['new']['active'] == 'n' && $data['old']['active'] == 'y') { // revoke database user, if inactive
if($old_db_user) {
if($old_db_user['database_user'] == 'root'){
$app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
$app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
} else {
// Find out users to drop and users to revoke
$drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $old_host_list);
......@@ -512,7 +512,7 @@ class mysql_clientdb_plugin {
}
if($old_db_ro_user && $data['old']['database_user_id'] != $data['old']['database_ro_user_id']) {
if($old_db_ro_user['database_user'] == 'root'){
$app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
$app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
} else {
// Find out users to drop and users to revoke
$drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_ro_user_id'], $old_host_list);
......@@ -530,7 +530,7 @@ class mysql_clientdb_plugin {
if($data['old']['database_user_id'] && $data['old']['database_user_id'] != $data['new']['database_ro_user_id']) {
if($old_db_user) {
if($old_db_user['database_user'] == 'root'){
$app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
$app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
} else {
// Find out users to drop and users to revoke
$drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $old_host_list);
......@@ -540,7 +540,7 @@ class mysql_clientdb_plugin {
}
}
if($db_user) {
if($db_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
if($db_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
else $this->process_host_list('GRANT', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $host_list, $link, '', ($data['new']['quota_exceeded'] == 'y' ? 'rd' : 'rw'));
}
}
......@@ -548,7 +548,7 @@ class mysql_clientdb_plugin {
if($data['old']['database_ro_user_id'] && $data['old']['database_ro_user_id'] != $data['new']['database_user_id']) {
if($old_db_ro_user) {
if($old_db_ro_user['database_user'] == 'root'){
$app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
$app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
} else {
// Find out users to drop and users to revoke
$drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_ro_user_id'], $old_host_list);
......@@ -558,7 +558,7 @@ class mysql_clientdb_plugin {
}
}
if($db_ro_user && $data['new']['database_user_id'] != $data['new']['database_ro_user_id']) {
if($db_ro_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
if($db_ro_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
else $this->process_host_list('GRANT', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $host_list, $link, '', 'r');
}
}
......@@ -570,19 +570,19 @@ class mysql_clientdb_plugin {
if($data['new']['remote_access'] == 'y') {
if($db_user) {
if($db_user['database_user'] == 'root'){
$app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
$app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
} else {
$this->process_host_list('GRANT', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $data['new']['remote_ips'], $link, '', ($data['new']['quota_exceeded'] == 'y' ? 'rd' : 'rw'));
}
}
if($db_ro_user && $data['new']['database_user_id'] != $data['new']['database_ro_user_id']) {
if($db_ro_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
if($db_ro_user['database_user'] == 'root') $app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
else $this->process_host_list('GRANT', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $data['new']['remote_ips'], $link, '', 'r');
}
} else {
if($old_db_user) {
if($old_db_user['database_user'] == 'root'){
$app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
$app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
} else {
// Find out users to drop and users to revoke
$drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $data['old']['remote_ips']);
......@@ -592,7 +592,7 @@ class mysql_clientdb_plugin {
}
if($old_db_ro_user && $data['old']['database_user_id'] != $data['old']['database_ro_user_id']) {
if($old_db_ro_user['database_user'] == 'root'){
$app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
$app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
} else {
// Find out users to drop and users to revoke
$drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_ro_user_id'], $data['old']['remote_ips']);
......@@ -606,7 +606,7 @@ class mysql_clientdb_plugin {
//* Change remote access list
if($old_db_user) {
if($old_db_user['database_user'] == 'root'){
$app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
$app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
} else {
// Find out users to drop and users to revoke
$drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_user_id'], $data['old']['remote_ips']);
......@@ -616,7 +616,7 @@ class mysql_clientdb_plugin {
}
if($db_user) {
if($db_user['database_user'] == 'root'){
$app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
$app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
} else {
$this->process_host_list('GRANT', $data['new']['database_name'], $db_user['database_user'], $db_user['database_password'], $data['new']['remote_ips'], $link, '', ($data['new']['quota_exceeded'] == 'y' ? 'rd' : 'rw'));
}
......@@ -624,7 +624,7 @@ class mysql_clientdb_plugin {
if($old_db_ro_user && $data['old']['database_user_id'] != $data['old']['database_ro_user_id']) {
if($old_db_ro_user['database_user'] == 'root'){
$app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
$app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
} else {
// Find out users to drop and users to revoke
$drop_or_revoke_user = $this->drop_or_revoke_user($data['old']['database_id'], $data['old']['database_ro_user_id'], $data['old']['remote_ips']);
......@@ -635,7 +635,7 @@ class mysql_clientdb_plugin {
if($db_ro_user && $data['new']['database_user_id'] != $data['new']['database_ro_user_id']) {
if($db_ro_user['database_user'] == 'root'){
$app->log('User root not allowed for Client databases', LOGLEVEL_WARNING);
$app->log('User root not allowed for Client databases', LOGLEVEL_WARN);
} else {
$this->process_host_list('GRANT', $data['new']['database_name'], $db_ro_user['database_user'], $db_ro_user['database_password'], $data['new']['remote_ips'], $link, '', 'r');
}
......@@ -689,7 +689,7 @@ class mysql_clientdb_plugin {
if($link->query('DROP DATABASE `'.$link->escape_string($data['old']['database_name'].'`'))) {
$app->log('Dropping MySQL database: '.$data['old']['database_name'], LOGLEVEL_DEBUG);
} else {
$app->log('Error while dropping MySQL database: '.$data['old']['database_name'].' '.$link->error, LOGLEVEL_WARNING);
$app->log('Error while dropping MySQL database: '.$data['old']['database_name'].' '.$link->error, LOGLEVEL_WARN);
}
$link->close();
......
......@@ -2852,7 +2852,6 @@ class nginx_plugin {
private function php_fpm_pool_update ($data, $web_config, $pool_dir, $pool_name, $socket_dir, $web_folder = null) {
global $app, $conf;
$pool_dir = trim($pool_dir);
$rh_releasefiles = array('/etc/centos-release', '/etc/redhat-release');
// HHVM => PHP-FPM-Fallback
$default_php_fpm = true;
......@@ -2923,21 +2922,14 @@ class nginx_plugin {
$tpl->setVar('fpm_port', $web_config['php_fpm_start_port'] + $data['new']['domain_id'] - 1);
$tpl->setVar('fpm_user', $data['new']['system_user']);
//Red Hat workaround for group ownership of socket files
foreach($rh_releasefiles as $rh_file) {
if(file_exists($rh_file) && (filesize($rh_file) > 0)) {
$tmp = file_get_contents($rh_file);
if(preg_match('/[678]+\.[0-9]+/m', $tmp)) {
$tpl->setVar('fpm_group', $data['new']['system_group']);
$tpl->setVar('fpm_listen_group', $data['new']['system_group']);
}
unset($tmp);
} elseif(!file_exists($rh_file)) {
//OS seems to be not Red Hat'ish
$tpl->setVar('fpm_group', $data['new']['system_group']);
$tpl->setVar('fpm_listen_group', $web_config['group']);
}
break;
// RH workaround here
if($app->system->is_redhat_os() == true) {
$tpl->setVar('fpm_group', $data['new']['system_group']);
$tpl->setVar('fpm_listen_group', $data['new']['system_group']);
} else {
//OS seems to be not Red Hat'ish
$tpl->setVar('fpm_group', $data['new']['system_group']);
$tpl->setVar('fpm_listen_group', $web_config['group']);
}
$tpl->setVar('fpm_listen_user', $data['new']['system_user']);
......
......@@ -281,7 +281,7 @@ class rspamd_plugin {
$app->system->mkdirpath($this->users_config_dir);
}
if((!$this->isValidEmail($app->functions->idn_encode($email_address))) || intval($data['new']['policy_id']) == 0) {
if((!$this->isValidEmail($app->functions->idn_encode($email_address))) || intval($data['new']['policy_id']) == 0 && $type == 'spamfilter_user') {
if(is_file($settings_file)) {
unlink($settings_file);
}
......@@ -508,7 +508,7 @@ class rspamd_plugin {
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
$local_addrs = array();
$ips = $app->db->queryAllRecords('SELECT `ip_address`, `ip_type` FROM ?? WHERE `server_id` = ?', $conf['mysql']['database'].'.server_ip', $conf['server_id']);
$ips = $app->db->queryAllRecords('SELECT `ip_address`, `ip_type` FROM ?? WHERE `server_id` = ?', $conf['db_database'].'.server_ip', $conf['server_id']);
if(is_array($ips) && !empty($ips)){
foreach($ips as $ip){
$local_addrs[] = array(
......
......@@ -147,9 +147,8 @@ class shelluser_base_plugin {
}
}
$app->system->chown($data['new']['dir'],$data['new']['username'],false);
$app->system->chgrp($data['new']['dir'],$data['new']['pgroup'],false);
$app->system->chown($data['new']['dir'], 'root', false);
$app->system->chgrp($data['new']['dir'], 'root', false);
// call the ssh-rsa update function
$app->uses("getconf");
......@@ -337,13 +336,12 @@ class shelluser_base_plugin {
// Get the UID of the user
$userid = intval($app->system->getuid($data['old']['username']));
if($userid > $this->min_uid) {
$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".intval($data['old']['parent_domain_id']));
$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ?", $data['old']['parent_domain_id']);
// check if we have to delete the dir
$check = $app->db->queryOneRecord('SELECT shell_user_id FROM `shell_user` WHERE `dir` = ?', $data['old']['dir']);
if(!$check && is_dir($data['old']['dir'])) {
$web = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ?", $data['old']['parent_domain_id']);
$app->system->web_folder_protection($web['document_root'], false);
// delete dir
......@@ -477,7 +475,11 @@ class shelluser_base_plugin {
// Remove duplicate keys
$existing_keys = @file($sshkeys, FILE_IGNORE_NEW_LINES);
$new_keys = explode("\n", $userkey);
$final_keys_arr = @array_merge($existing_keys, $new_keys);
if(is_array($existing_keys)) {
$final_keys_arr = @array_merge($existing_keys, $new_keys);
} else {
$final_keys_arr = $new_keys;
}
$new_final_keys_arr = array();
if(is_array($final_keys_arr) && !empty($final_keys_arr)){
foreach($final_keys_arr as $key => $val){
......
......@@ -318,6 +318,8 @@ class shelluser_jailkit_plugin {
$options = array('hardlink');
} elseif ($this->jailkit_config['jailkit_hardlinks'] == 'no') {
$options = array();
} else {
$options = array();
}
} else {
$options = array('allow_hardlink');
......@@ -527,7 +529,11 @@ class shelluser_jailkit_plugin {
// Remove duplicate keys
$existing_keys = @file($sshkeys, FILE_IGNORE_NEW_LINES);
$new_keys = explode("\n", $userkey);
$final_keys_arr = @array_merge($existing_keys, $new_keys);
if(is_array($existing_keys)) {
$final_keys_arr = @array_merge($existing_keys, $new_keys);
} else {
$final_keys_arr = $new_keys;
}
$new_final_keys_arr = array();
if(is_array($final_keys_arr) && !empty($final_keys_arr)){
foreach($final_keys_arr as $key => $val){
......
......@@ -15,14 +15,14 @@ if [ -f /usr/local/ispconfig/server/lib/php.ini ]; then
fi
cd /usr/local/ispconfig/server
/usr/bin/php -q \
$(which php) -q \
-d disable_classes= \
-d disable_functions= \
-d open_basedir= \
/usr/local/ispconfig/server/server.php
cd /usr/local/ispconfig/security
/usr/bin/php -q \
$(which php) -q \
-d disable_classes= \
-d disable_functions= \
-d open_basedir= \
......