Skip to content

Commit

Permalink
Fix returning all mailboxes when not using subscriptions when using I…
Browse files Browse the repository at this point in the history
…MP >= 6.2.

Bug: 13177
  • Loading branch information
mrubinsk committed May 10, 2014
1 parent 135b0e1 commit 82ca72e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions framework/Core/lib/Horde/Core/ActiveSync/Imap/Factory.php
Expand Up @@ -64,10 +64,19 @@ public function getImapOb()
*/
public function getMailboxes($force = false)
{
global $registry;

if (empty($this->_mailboxlist) || $force) {
$subscriptions = $registry->horde->getPreference(
$registry->hasInterface('mail'),
'subscribe'
);
try {
foreach ($GLOBALS['registry']->mail->mailboxList() as $mbox) {
if ($mbox['a'] & self::MASK_SUBSCRIBED && strpos($mbox['ob']->utf8, "impsearch\000") === false) {
foreach ($registry->mail->mailboxList() as $mbox) {
// @HACK. Don't like having to check for imp specific
// mailbox strings here but don't see anyway around it.
if (strpos($mbox['ob']->utf8, "impsearch\000") === false &&
(!$subscriptions || ($mbox['a'] & self::MASK_SUBSCRIBED))) {
$this->_mailboxlist[$mbox['ob']->utf8] = $mbox;
}
}
Expand Down

0 comments on commit 82ca72e

Please sign in to comment.