setACL() публичный Метод

Set ACL rights for a given mailbox/identifier.
public setACL ( mixed $mailbox, string $identifier, array $options )
$mailbox mixed A mailbox. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
$identifier string The identifier to alter (UTF-8).
$options array Additional options: - rights: (string) The rights to alter or set. - action: (string, optional) If 'add' or 'remove', adds or removes the specified rights. Sets the rights otherwise.
Пример #1
0
 /**
  * Delete a set of authentication credentials.
  *
  * @param string $userId  The userId to delete.
  *
  * @throws Horde_Auth_Exception
  */
 public function removeUser($userId)
 {
     if (!empty($this->_params['domain_field']) && $this->_params['domain_field'] != 'none') {
         list($name, $domain) = explode('@', $userId);
         /* Build the SQL query. */
         $query = sprintf('DELETE FROM %s WHERE %s = ? and %s = ?', $this->_params['table'], $this->_params['username_field'], $this->_params['domain_field']);
         $values = array($name, $domain);
         $query2 = 'DELETE FROM virtual WHERE dest = ?';
         $values2 = array($userId);
         try {
             $this->_db->delete($query, $values);
             $this->_db->delete($query2, $values2);
         } catch (Horde_Db_Exception $e) {
             throw new Horde_Auth_Exception($e);
         }
     } else {
         parent::removeUser($userId);
     }
     /* Set ACL for mailbox deletion. */
     list($admin) = explode('@', $this->_params['cyradmin']);
     $mailbox = $this->_params['userhierarchy'];
     try {
         $this->_imap->setACL($mailbox, $admin, array('rights' => 'lrswipcda'));
         $this->_imap->deleteMailbox($mailbox);
     } catch (Horde_Imap_Client_Exception $e) {
         throw new Horde_Auth_Exception($e);
     }
 }