diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-02-28 17:59:13 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-02-28 17:59:13 +0000 |
| commit | bdf3abb107eb0b56a7b4613327eeda62a8ff057a (patch) | |
| tree | cf2bed041c735662eb659df78c195efbd3f75d29 /roundcubemail/program/include | |
| parent | 1ab92f17679a82f2fabab83fec90058f5b600cf0 (diff) | |
- Add simple ACL rights/namespace handling in folder manager (display folder's namespace, modify edit form fields according to MYRIGHTS)
git-svn-id: https://svn.roundcube.net/trunk@4581 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
| -rw-r--r-- | roundcubemail/program/include/rcube_imap.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php index f5a936890..b8cb01748 100644 --- a/roundcubemail/program/include/rcube_imap.php +++ b/roundcubemail/program/include/rcube_imap.php @@ -3321,6 +3321,38 @@ class rcube_imap /** + * Returns the namespace where the folder is in + * + * @param string $mbox_name Folder name + * + * @return string One of 'personal', 'other' or 'shared' + * @access public + */ + function mailbox_namespace($mbox_name) + { + if ($mbox_name == 'INBOX') { + return 'personal'; + } + + foreach ($this->namespace as $type => $namespace) { + if (is_array($namespace)) { + foreach ($namespace as $ns) { + if (strlen($ns[0])) { + if ((strlen($ns[0])>1 && $mbox_name == substr($ns[0], 0, -1)) + || strpos($mbox_name, $ns[0]) === 0 + ) { + return $type; + } + } + } + } + } + + return 'personal'; + } + + + /** * Modify folder name for input/output according to root dir and namespace * * @param string $mbox_name Folder name |
