]> git.donarmstrong.com Git - roundcube.git/blobdiff - program/steps/settings/folders.inc
Fix symlink mess
[roundcube.git] / program / steps / settings / folders.inc
index 69339e29a3a09ee5f9fb2f1f275070402bcfc9fe..bde7b5a5b7409ef80108c3b6b1e19aab92f29932 100644 (file)
@@ -16,7 +16,7 @@
  | Author: Aleksander Machniak <alec@alec.pl>                            |
  +-----------------------------------------------------------------------+
 
- $Id: folders.inc 5091 2011-08-18 18:34:56Z thomasb $
+ $Id: folders.inc 5635 2011-12-21 10:07:42Z alec $
 
 */
 
@@ -203,7 +203,7 @@ function rcube_subscription_form($attrib)
     $IMAP->clear_cache('mailboxes', true);
 
     $a_unsubscribed = $IMAP->list_unsubscribed();
-    $a_subscribed   = $IMAP->list_mailboxes();
+    $a_subscribed   = $IMAP->list_mailboxes('', '*', null, null, true); // unsorted
     $delimiter      = $IMAP->get_hierarchy_delimiter();
     $namespace      = $IMAP->get_namespace();
     $a_js_folders   = array();
@@ -283,8 +283,8 @@ function rcube_subscription_form($attrib)
         }
 
         if (!$protected) {
-            $opts = $IMAP->mailbox_options($folder['id']);
-            $noselect = in_array('\\Noselect', $opts);
+            $attrs = $IMAP->mailbox_attributes($folder['id']);
+            $noselect = in_array('\\Noselect', $attrs);
         }
 
         $disabled = (($protected && $subscribed) || $noselect);
@@ -293,10 +293,12 @@ function rcube_subscription_form($attrib)
         if (!$disabled && $folder['virtual'] && $folder['level'] == 0 && !empty($namespace)) {
             $fname = $folder['id'] . $delimiter;
             foreach ($namespace as $ns) {
-                foreach ($ns as $item) {
-                    if ($item[0] === $fname) {
-                        $disabled = true;
-                        break 2;
+                if (is_array($ns)) {
+                    foreach ($ns as $item) {
+                        if ($item[0] === $fname) {
+                            $disabled = true;
+                            break 2;
+                        }
                     }
                 }
             }