Changeset 4968 in subversion


Ignore:
Timestamp:
Jul 26, 2011 9:22:11 AM (22 months ago)
Author:
alec
Message:
  • Unsubscribe from non-existing folders automaticly on folders listing
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/steps/settings/folders.inc

    r4938 r4968  
    268268    foreach ($list_folders as $i => $folder) { 
    269269        $idx        = $i + 1; 
    270         $subscribed = in_array($folder['id'], $a_subscribed); 
     270        $sub_key    = array_search($folder['id'], $a_subscribed); 
     271        $subscribed = $sub_key !== false; 
    271272        $protected  = ($CONFIG['protect_default_folders'] == true && in_array($folder['id'], $CONFIG['default_imap_folders'])); 
    272273        $noselect   = false; 
     
    277278        $display_folder = str_repeat('    ', $folder['level']) 
    278279            . Q($protected ? rcmail_localize_foldername($folder['id']) : $folder['name']); 
     280 
     281        if ($sub_key !== false) 
     282            unset($a_subscribed[$sub_key]); 
    279283 
    280284        if ($folder['virtual']) { 
     
    326330    } 
    327331 
     332    // Unsubscribe from non-existing folders 
     333    foreach ($a_subscribed as $folder) { 
     334        $IMAP->unsubscribe($folder); 
     335    } 
     336 
    328337    $RCMAIL->plugins->exec_hook('folders_list', array('table' => $table)); 
    329338 
Note: See TracChangeset for help on using the changeset viewer.