diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-05-22 10:33:24 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-05-22 10:33:24 +0200 |
commit | 5a575b7eb08fb9f254f46eb340cbedb0c839446e (patch) | |
tree | 57b130c1e18b8864fc42e7a39adabf577140d882 | |
parent | 4bfe4ec22a08528332085ce4015dcab221b21bee (diff) |
Deprecate storage_connect() method
-rw-r--r-- | program/include/rcmail.php | 31 | ||||
-rw-r--r-- | program/include/rcube.php | 29 |
2 files changed, 31 insertions, 29 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php index 7f9d7af06..e684a15bb 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -2011,4 +2011,35 @@ class rcmail extends rcube { return $this->storage_connect(); } + + /** + * Connect to the mail storage server with stored session data + * + * @return bool True on success, False on error + */ + public function storage_connect() + { + $storage = $this->get_storage(); + + if ($_SESSION['storage_host'] && !$storage->is_connected()) { + $host = $_SESSION['storage_host']; + $user = $_SESSION['username']; + $port = $_SESSION['storage_port']; + $ssl = $_SESSION['storage_ssl']; + $pass = $this->decrypt($_SESSION['password']); + + if (!$storage->connect($host, $user, $pass, $port, $ssl)) { + if (is_object($this->output)) { + $error = $storage->get_error_code() == -1 ? 'storageerror' : 'sessionerror'; + $this->output->show_message($error, 'error'); + } + } + else { + $this->set_storage_prop(); + return $storage->is_connected(); + } + } + + return false; + } } diff --git a/program/include/rcube.php b/program/include/rcube.php index e9add8d5a..cfad77cdb 100644 --- a/program/include/rcube.php +++ b/program/include/rcube.php @@ -362,35 +362,6 @@ class rcube /** - * Connect to the mail storage server with stored session data - * - * @return bool True on success, False on error - */ - public function storage_connect() - { - $storage = $this->get_storage(); - - if ($_SESSION['storage_host'] && !$storage->is_connected()) { - $host = $_SESSION['storage_host']; - $user = $_SESSION['username']; - $port = $_SESSION['storage_port']; - $ssl = $_SESSION['storage_ssl']; - $pass = $this->decrypt($_SESSION['password']); - - if (!$storage->connect($host, $user, $pass, $port, $ssl)) { - if (is_object($this->output)) - $this->output->show_message($storage->get_error_code() == -1 ? 'storageerror' : 'sessionerror', 'error'); - } - else { - $this->set_storage_prop(); - return $storage->is_connected(); - } - } - - return false; - } - - /** * Set storage parameters. * This must be done AFTER connecting to the server! */ |