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

Delete a mailbox.
public deleteMailbox ( mixed $mailbox )
$mailbox mixed The mailbox to delete. Either a Horde_Imap_Client_Mailbox object or a string (UTF-8).
Пример #1
0
 /**
  * Deletes an existing mailbox.
  *
  * @todo
  *
  * @param string $user    The name of the mailbox to delete.
  * @param string $domain  The name of the domain in which to delete the
  *                        mailbox.
  *
  * @throws Vilma_Exception
  */
 public function deleteMailbox($user, $domain)
 {
     try {
         $this->_imap->deleteMailbox($this->_params['userhierarchy'] . $user . '@' . $domain);
     } catch (Exception $e) {
         throw new Vilma_Exception($e);
     }
 }
Пример #2
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);
     }
 }