/** * Returns a list of all additional folders of the given device and the Request::GetGETUser(). * * @param string $deviceId device id that should be listed. * * @access public * @return array */ public function AdditionalFolderList($deviceId) { $user = Request::GetGETUser(); $deviceId = preg_replace("/[^A-Za-z0-9]/", "", $deviceId); $folders = ZPushAdmin::AdditionalFolderList($user, $deviceId); ZLog::Write(LOGLEVEL_INFO, sprintf("WebserviceDevice::AdditionalFolderList(): found %d folders for device '%s' of user '%s'", count($folders), $deviceId, $user)); // retrieve the permission flags from the backend $backend = ZPush::GetBackend(); foreach ($folders as &$folder) { $folder['readable'] = $backend->Setup($folder['store'], true, $folder['folderid'], true); $folder['writeable'] = $backend->Setup($folder['store'], true, $folder['folderid']); } // make sure folder is not pointing to our last folder anymore unset($folder); ZPush::GetTopCollector()->AnnounceInformation(sprintf("Retrieved details of %d folders", count($folders)), true); return $folders; }