Returns whether the IMAP server supports the given capability
(See RFC 3501 [6.1.1]).
public queryCapability ( string $capability ) : mixed | ||
$capability | string | The capability string to query. |
return | mixed | True if the server supports the queried capability, false if it doesn't, or an array if the capability can contain multiple values. |
/** * Checks access rights for a server. * * @param integer $right Access right. * * @return boolean Does the access right exist? */ public function access($right) { global $injector; if (!$this->init) { return false; } switch ($right) { case self::ACCESS_ACL: return $this->config->acl && $this->queryCapability('ACL'); case self::ACCESS_CREATEMBOX: return $this->isImap() && $injector->getInstance('Horde_Core_Perms')->hasAppPermission($this->_getPerm('create_mboxes')); case self::ACCESS_CREATEMBOX_MAX: return $this->isImap() && $injector->getInstance('Horde_Core_Perms')->hasAppPermission($this->_getPerm('max_create_mboxes')); case self::ACCESS_DRAFTS: case self::ACCESS_FLAGS: case self::ACCESS_IMPORT: case self::ACCESS_SEARCH: case self::ACCESS_UNSEEN: return $this->isImap(); case self::ACCESS_FOLDERS: case self::ACCESS_TRASH: return $this->isImap() && $injector->getInstance('Horde_Core_Perms')->hasAppPermission($this->_getPerm('allow_folders')); case self::ACCESS_REMOTE: return $injector->getInstance('Horde_Core_Perms')->hasAppPermission($this->_getPerm('allow_remote')); case self::ACCESS_SORT: return $this->isImap() && ($this->config->sort_force || $this->_ob->queryCapability('SORT')); } return false; }