Commit 21ee812c authored by Till Brehm's avatar Till Brehm
Browse files

Fixed #4029 client_delete_everything API only database entries removed

parent fdc9446e
......@@ -261,7 +261,6 @@ class db extends mysqli
$aArgs = func_get_args();
$sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs);
$this->securityScan($sQuery);
$this->_iQueryId = @mysqli_query($this->_iConnId, $sQuery);
if (!$this->_iQueryId) {
$this->_sqlerror('Falsche Anfrage / Wrong Query', 'SQL-Query = ' . $sQuery);
......@@ -634,6 +633,7 @@ class db extends mysqli
$diffstr = serialize($diffrec_full);
$username = $_SESSION['s']['user']['username'];
$dbidx = $primary_field.':'.$primary_id;
if(trim($username) == '') $username = 'none';
if($action == 'INSERT') $action = 'i';
if($action == 'UPDATE') $action = 'u';
......
......@@ -404,10 +404,9 @@ class remoting_client extends remoting {
$app->db->query("DELETE FROM sys_user WHERE client_id = ?", $client_id);
//* 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);
$client_group_id = $app->functions->intval($client_group['groupid']);
if($client_group_id > 1) {
foreach($tables_array as $table) {
if($table != '') {
......@@ -418,7 +417,6 @@ class remoting_client extends remoting {
foreach($table_info as $tmp) {
if($tmp['option'] == 'primary') $index_field = $tmp['name'];
}
//* Delete the records
if($index_field != '') {
if(is_array($records)) {
......@@ -441,7 +439,6 @@ class remoting_client extends remoting {
}
}
if (!$this->checkPerm($session_id, 'client_delete')) {
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
return false;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment