Skip to content

Commit 21ee812

Browse files
author
Till Brehm
committed
Fixed #4029 client_delete_everything API only database entries removed
1 parent fdc9446 commit 21ee812

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

interface/lib/classes/db_mysql.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ private function _query($sQuery = '') {
261261
$aArgs = func_get_args();
262262
$sQuery = call_user_func_array(array(&$this, '_build_query_string'), $aArgs);
263263
$this->securityScan($sQuery);
264-
265264
$this->_iQueryId = @mysqli_query($this->_iConnId, $sQuery);
266265
if (!$this->_iQueryId) {
267266
$this->_sqlerror('Falsche Anfrage / Wrong Query', 'SQL-Query = ' . $sQuery);
@@ -634,6 +633,7 @@ public function datalogSave($db_table, $action, $primary_field, $primary_id, $re
634633
$diffstr = serialize($diffrec_full);
635634
$username = $_SESSION['s']['user']['username'];
636635
$dbidx = $primary_field.':'.$primary_id;
636+
if(trim($username) == '') $username = 'none';
637637

638638
if($action == 'INSERT') $action = 'i';
639639
if($action == 'UPDATE') $action = 'u';

interface/lib/classes/remote.d/client.inc.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,9 @@ public function client_delete_everything($session_id, $client_id)
404404
$app->db->query("DELETE FROM sys_user WHERE client_id = ?", $client_id);
405405

406406
//* Delete all records (sub-clients, mail, web, etc....) of this client.
407-
$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';
407+
$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';
408408
$tables_array = explode(',', $tables);
409409
$client_group_id = $app->functions->intval($client_group['groupid']);
410-
411410
if($client_group_id > 1) {
412411
foreach($tables_array as $table) {
413412
if($table != '') {
@@ -418,7 +417,6 @@ public function client_delete_everything($session_id, $client_id)
418417
foreach($table_info as $tmp) {
419418
if($tmp['option'] == 'primary') $index_field = $tmp['name'];
420419
}
421-
422420
//* Delete the records
423421
if($index_field != '') {
424422
if(is_array($records)) {
@@ -441,7 +439,6 @@ public function client_delete_everything($session_id, $client_id)
441439
}
442440

443441
}
444-
445442
if (!$this->checkPerm($session_id, 'client_delete')) {
446443
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
447444
return false;

0 commit comments

Comments
 (0)