diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-12-01 10:55:13 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-12-01 10:55:13 +0100 |
commit | 38bf401cf88bc88d3b4d96fee8d2166cc2cac8c6 (patch) | |
tree | 9ba1d402acbc2d1efad4d3275c89c7d80a6c17e8 /program/lib/Roundcube | |
parent | 6dee834ca06f449cc9a1d99d98979cc1ab12e12a (diff) |
Fix performance of listing writeable folders (#1489451)
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r-- | program/lib/Roundcube/rcube_imap.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index fdda1d4b2..dc5305808 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -2843,12 +2843,21 @@ class rcube_imap extends rcube_storage /** * Filter the given list of folders according to access rights + * + * For performance reasons we assume user has full rights + * on all personal folders. */ protected function filter_rights($a_folders, $rights) { $regex = '/('.$rights.')/'; + foreach ($a_folders as $idx => $folder) { + if ($this->folder_namespace($folder) == 'personal') { + continue; + } + $myrights = join('', (array)$this->my_rights($folder)); + if ($myrights !== null && !preg_match($regex, $myrights)) { unset($a_folders[$idx]); } |