| | |
| | | | Author: Aleksander Machniak <alec@alec.pl> | |
| | | | Author: Ryo Chijiiwa <Ryo@IlohaMail.org> | |
| | | +-----------------------------------------------------------------------+ |
| | | |
| | | $Id$ |
| | | |
| | | */ |
| | | |
| | | // for backward compat. |
| | | class rcube_mail_header extends rcube_message_header { } |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | function enable($extension) |
| | | { |
| | | if (empty($extension)) |
| | | if (empty($extension)) { |
| | | return false; |
| | | } |
| | | |
| | | if (!$this->hasCapability('ENABLE')) |
| | | if (!$this->hasCapability('ENABLE')) { |
| | | return false; |
| | | } |
| | | |
| | | if (!is_array($extension)) |
| | | if (!is_array($extension)) { |
| | | $extension = array($extension); |
| | | } |
| | | |
| | | if (!empty($this->extensions_enabled)) { |
| | | // check if all extensions are already enabled |
| | | $diff = array_diff($extension, $this->extensions_enabled); |
| | | |
| | | if (empty($diff)) { |
| | | return $extension; |
| | | } |
| | | |
| | | // Make sure the mailbox isn't selected, before enabling extension(s) |
| | | if ($this->selected !== null) { |
| | | $this->close(); |
| | | } |
| | | } |
| | | |
| | | list($code, $response) = $this->execute('ENABLE', $extension); |
| | | |
| | |
| | | $response = substr($response, 10); // remove prefix "* ENABLED " |
| | | $result = (array) $this->tokenizeResponse($response); |
| | | |
| | | return $result; |
| | | $this->extensions_enabled = array_unique(array_merge((array)$this->extensions_enabled, $result)); |
| | | |
| | | return $this->extensions_enabled; |
| | | } |
| | | |
| | | return false; |