From 7f8b36e0bdd682568e816a37a7b1caf769bd451a Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 28 Apr 2024 14:03:38 +0200 Subject: [PATCH] select homedir/maildir from emails if called interally as it is also called by customers via EmailAccounts.delete() Signed-off-by: Michael Kaufmann --- lib/Froxlor/Api/Commands/EmailAccounts.php | 2 +- lib/Froxlor/Api/Commands/Emails.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Froxlor/Api/Commands/EmailAccounts.php b/lib/Froxlor/Api/Commands/EmailAccounts.php index 4c2cfc3bea..df7f73ca2a 100644 --- a/lib/Froxlor/Api/Commands/EmailAccounts.php +++ b/lib/Froxlor/Api/Commands/EmailAccounts.php @@ -523,7 +523,7 @@ public function delete() $result = $this->apiCall('Emails.get', [ 'id' => $id, 'emailaddr' => $emailaddr - ]); + ], true); $id = $result['id']; if (empty($result['popaccountid']) || $result['popaccountid'] == 0) { diff --git a/lib/Froxlor/Api/Commands/Emails.php b/lib/Froxlor/Api/Commands/Emails.php index 007dbea21b..60e81f5974 100644 --- a/lib/Froxlor/Api/Commands/Emails.php +++ b/lib/Froxlor/Api/Commands/Emails.php @@ -221,7 +221,7 @@ public function get() $customer_ids = $this->getAllowedCustomerIds('email'); $params['idea'] = ($id <= 0 ? $emailaddr : $id); - $result_stmt = Database::prepare("SELECT v.*, u.`quota`, u.`imap`, u.`pop3`, u.`postfix`, u.`mboxsize` " . ($this->isAdmin() ? ", `u`.`homedir`, `u`.`maildir`" : "") . " + $result_stmt = Database::prepare("SELECT v.*, u.`quota`, u.`imap`, u.`pop3`, u.`postfix`, u.`mboxsize` " . ($this->isInternal() ? ", `u`.`homedir`, `u`.`maildir`" : "") . " FROM `" . TABLE_MAIL_VIRTUAL . "` v LEFT JOIN `" . TABLE_MAIL_USERS . "` u ON v.`popaccountid` = u.`id` WHERE v.`customerid` IN (" . implode(", ", $customer_ids) . ")