From 303587cf25a6045dd86abb3051a085613207e8f7 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 14 Mar 2017 10:53:50 +0100 Subject: [PATCH] Fix folder taglist searches the wrong mail account if it gets called from none active profile --- mail/inc/class.mail_acl.inc.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/mail/inc/class.mail_acl.inc.php b/mail/inc/class.mail_acl.inc.php index a2e5423600..c1611a91a3 100644 --- a/mail/inc/class.mail_acl.inc.php +++ b/mail/inc/class.mail_acl.inc.php @@ -27,7 +27,7 @@ class mail_acl ); /** - * static used define abbrevations for common access rights + * static used define abbreviations for common access rights * * @array * @@ -42,7 +42,7 @@ class mail_acl ); /** - * imap object instanciated in constructor for account to edit + * imap object instantiated in constructor for account to edit * * @var Mail\Imap */ @@ -81,7 +81,8 @@ class mail_acl $account = Mail\Account::read($acc_id, $account_id); $this->imap = $account->imapServer(isset($account_id) ? (int)$account_id : false); - $mailbox = $_GET['mailbox']? base64_decode($_GET['mailbox']): $content['mailbox'][0]; + $mailbox = $_GET['mailbox']? base64_decode($_GET['mailbox']): + preg_replace("/^".$acc_id."::/",'',$content['mailbox'][0]); if (empty($mailbox)) { $mailbox = $this->imap->isAdminConnection ? $this->imap->getUserMailboxString($account_id) : 'INBOX'; @@ -89,6 +90,7 @@ class mail_acl if (!$this->imap->isAdminConnection) { $tmpl->setElementAttribute('mailbox', 'autocomplete_url', 'mail.mail_compose.ajax_searchFolder'); + $tmpl->setElementAttribute('mailbox', 'autocomplete_params', array('mailaccount' => $acc_id)); } else { @@ -179,9 +181,6 @@ class mail_acl //Send message Framework::message($msg); if ($button == "apply") break; - - //Fall through - case 'cancel': Framework::window_close(); exit; @@ -428,7 +427,7 @@ class mail_acl } catch (Exception $e) { - error_log(__METHOD__. "Could not delete ACL rights of folder " . $mailbox . " for account ". $identifier ." because of " .$e->getMessage()); + error_log(__METHOD__. "Could not delete ACL rights of folder " . $mailbox . " for account ". $identifier ."." .$e->getMessage()); return false; } } @@ -490,7 +489,7 @@ class mail_acl catch (Exception $e) { $msg = $e->getMessage(); - error_log(__METHOD__. "Could not set ACL rights on folder " . $mailbox . " for account ". $identifier . " because of " .$e->getMessage()); + error_log(__METHOD__. "Could not set ACL rights on folder " . $mailbox . " for account ". $identifier . "." .$e->getMessage()); return false; } } @@ -510,7 +509,7 @@ class mail_acl $acl = $this->imap->getACL($mailbox); return $acl; } catch (Exception $e) { - error_log(__METHOD__. "Could not get ACL rights from folder " . $mailbox . " because of " .$e->getMessage()); + error_log(__METHOD__. "Could not get ACL rights from folder " . $mailbox . "." .$e->getMessage()); return false; } }