Changeset View
Changeset View
Standalone View
Standalone View
lib/drivers/kolab/kolab_file_storage.php
Show First 20 Lines • Show All 965 Lines • ▼ Show 20 Lines | public function folder_list($params = array()) | ||||
$separator = $imap->get_hierarchy_delimiter(); | $separator = $imap->get_hierarchy_delimiter(); | ||||
$root = isset($params['path']) && strlen($params['path']) ? $params['path'] . '/' : ''; | $root = isset($params['path']) && strlen($params['path']) ? $params['path'] . '/' : ''; | ||||
$folders = $imap->list_folders_subscribed($root, '*', 'file', $rights); | $folders = $imap->list_folders_subscribed($root, '*', 'file', $rights); | ||||
if (!is_array($folders)) { | if (!is_array($folders)) { | ||||
throw new Exception("Storage error. Unable to get folders list.", file_storage::ERROR); | throw new Exception("Storage error. Unable to get folders list.", file_storage::ERROR); | ||||
} | } | ||||
// when the file storage has been disabled, return an empty list of folders otherwise | |||||
// inaccessible folders will be listed | |||||
if ($this->rc->config->get('fileapi_backend_storage_disabled')) { | |||||
return array(); | |||||
} | |||||
// create/subscribe 'Files' folder in case there's no folder of type 'file' | // create/subscribe 'Files' folder in case there's no folder of type 'file' | ||||
if (empty($folders) && !$unsubscribed && !strlen($root)) { | if (empty($folders) && !$unsubscribed && !strlen($root)) { | ||||
$default = 'Files'; | $default = 'Files'; | ||||
// the folder may exist but be unsubscribed | // the folder may exist but be unsubscribed | ||||
if (!$imap->folder_exists($default)) { | if (!$imap->folder_exists($default)) { | ||||
if (kolab_storage::folder_create($default, 'file', true)) { | if (kolab_storage::folder_create($default, 'file', true)) { | ||||
$folders[] = $default; | $folders[] = $default; | ||||
▲ Show 20 Lines • Show All 650 Lines • Show Last 20 Lines |