Ignore:
Timestamp:
Nov 9, 2010 2:54:34 AM (3 years ago)
Author:
alec
Message:
  • Add support for shared folders (#1403507)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcube_imap_generic.php

    r4187 r4198  
    550550 
    551551    /** 
    552      * Gets the root directory and delimiter (of personal namespace) 
    553      * 
    554      * @return mixed A root directory name, or false. 
    555      */ 
    556     function getRootDir() 
    557     { 
    558             if (isset($this->prefs['rootdir']) && is_string($this->prefs['rootdir'])) { 
    559                 return $this->prefs['rootdir']; 
    560             } 
    561  
    562             if (!is_array($data = $this->getNamespace())) { 
    563                 return false; 
    564             } 
    565  
    566             $user_space_data = $data['personal']; 
    567             if (!is_array($user_space_data)) { 
    568                 return false; 
    569             } 
    570  
    571             $first_userspace = $user_space_data[0]; 
    572             if (count($first_userspace) !=2) { 
    573                 return false; 
    574             } 
    575  
    576         $rootdir                  = $first_userspace[0]; 
    577             $this->prefs['delimiter'] = $first_userspace[1]; 
    578             $this->prefs['rootdir']   = $rootdir ? substr($rootdir, 0, -1) : ''; 
    579  
    580             return $this->prefs['rootdir']; 
    581     } 
    582  
    583     /** 
    584      * Gets the delimiter, for example: 
    585      * INBOX.foo -> . 
    586      * INBOX/foo -> / 
    587      * INBOX\foo -> \ 
    588      * 
    589      * @return mixed A delimiter (string), or false. 
    590      * @see connect() 
     552     * Gets the delimiter 
     553     * 
     554     * @return string The delimiter 
    591555     */ 
    592556    function getHierarchyDelimiter() 
     
    594558            if ($this->prefs['delimiter']) { 
    595559                return $this->prefs['delimiter']; 
    596             } 
    597             if (!empty($this->prefs['delimiter'])) { 
    598             return $this->prefs['delimiter']; 
    599560            } 
    600561 
     
    612573        } 
    613574 
    614             // if that fails, try namespace extension 
    615             // try to fetch namespace data 
    616             if (!is_array($data = $this->getNamespace())) { 
    617             return false; 
    618         } 
    619  
    620             // extract user space data (opposed to global/shared space) 
    621             $user_space_data = $data['personal']; 
    622             if (!is_array($user_space_data)) { 
    623                 return false; 
    624             } 
    625  
    626             // get first element 
    627             $first_userspace = $user_space_data[0]; 
    628             if (!is_array($first_userspace)) { 
    629                 return false; 
    630             } 
    631  
    632             // extract delimiter 
    633             return $this->prefs['delimiter'] = $first_userspace[1]; 
     575        return NULL; 
    634576    } 
    635577 
     
    831773                            $this->clearCapability(); 
    832774            } 
    833                     $this->getRootDir(); 
    834775            $this->logged = true; 
    835776 
     
    19441885            } 
    19451886 
    1946             if (empty($ref) && $this->prefs['rootdir']) { 
    1947                 $ref = $this->prefs['rootdir']; 
    1948             } 
    1949  
    19501887        $args = array(); 
    19511888 
Note: See TracChangeset for help on using the changeset viewer.