Skip to content

Commit

Permalink
select homedir/maildir from emails if called interally as it is also …
Browse files Browse the repository at this point in the history
…called by customers via EmailAccounts.delete()

Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Apr 28, 2024
1 parent 71746f8 commit 7f8b36e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Froxlor/Api/Commands/EmailAccounts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Froxlor/Api/Commands/Emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) . ")
Expand Down

0 comments on commit 7f8b36e

Please sign in to comment.