Skip to content
Snippets Groups Projects
Commit 21ee812c authored by Till Brehm's avatar Till Brehm
Browse files

Fixed #4029 client_delete_everything API only database entries removed

parent fdc9446e
No related branches found
No related tags found
No related merge requests found
...@@ -261,7 +261,6 @@ class db extends mysqli ...@@ -261,7 +261,6 @@ class db extends mysqli
$aArgs = func_get_args(); $aArgs = func_get_args();
$sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs); $sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs);
$this->securityScan($sQuery); $this->securityScan($sQuery);
$this->_iQueryId = @mysqli_query($this->_iConnId, $sQuery); $this->_iQueryId = @mysqli_query($this->_iConnId, $sQuery);
if (!$this->_iQueryId) { if (!$this->_iQueryId) {
$this->_sqlerror('Falsche Anfrage / Wrong Query', 'SQL-Query = ' . $sQuery); $this->_sqlerror('Falsche Anfrage / Wrong Query', 'SQL-Query = ' . $sQuery);
...@@ -634,6 +633,7 @@ class db extends mysqli ...@@ -634,6 +633,7 @@ class db extends mysqli
$diffstr = serialize($diffrec_full); $diffstr = serialize($diffrec_full);
$username = $_SESSION['s']['user']['username']; $username = $_SESSION['s']['user']['username'];
$dbidx = $primary_field.':'.$primary_id; $dbidx = $primary_field.':'.$primary_id;
if(trim($username) == '') $username = 'none';
if($action == 'INSERT') $action = 'i'; if($action == 'INSERT') $action = 'i';
if($action == 'UPDATE') $action = 'u'; if($action == 'UPDATE') $action = 'u';
......
...@@ -404,10 +404,9 @@ class remoting_client extends remoting { ...@@ -404,10 +404,9 @@ class remoting_client extends remoting {
$app->db->query("DELETE FROM sys_user WHERE client_id = ?", $client_id); $app->db->query("DELETE FROM sys_user WHERE client_id = ?", $client_id);
//* Delete all records (sub-clients, mail, web, etc....) of this client. //* Delete all records (sub-clients, mail, web, etc....) of this client.
$tables = 'cron,client,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_traffic,domain'; $tables = 'cron,dns_rr,dns_soa,dns_slave,ftp_user,mail_access,mail_content_filter,mail_domain,mail_forwarding,mail_get,mail_user,mail_user_filter,shell_user,spamfilter_users,support_message,web_database,web_database_user,web_domain,web_traffic,domain,mail_mailinglist,client';
$tables_array = explode(',', $tables); $tables_array = explode(',', $tables);
$client_group_id = $app->functions->intval($client_group['groupid']); $client_group_id = $app->functions->intval($client_group['groupid']);
if($client_group_id > 1) { if($client_group_id > 1) {
foreach($tables_array as $table) { foreach($tables_array as $table) {
if($table != '') { if($table != '') {
...@@ -418,7 +417,6 @@ class remoting_client extends remoting { ...@@ -418,7 +417,6 @@ class remoting_client extends remoting {
foreach($table_info as $tmp) { foreach($table_info as $tmp) {
if($tmp['option'] == 'primary') $index_field = $tmp['name']; if($tmp['option'] == 'primary') $index_field = $tmp['name'];
} }
//* Delete the records //* Delete the records
if($index_field != '') { if($index_field != '') {
if(is_array($records)) { if(is_array($records)) {
...@@ -441,7 +439,6 @@ class remoting_client extends remoting { ...@@ -441,7 +439,6 @@ class remoting_client extends remoting {
} }
} }
if (!$this->checkPerm($session_id, 'client_delete')) { if (!$this->checkPerm($session_id, 'client_delete')) {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.'); throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment