| | |
| | | $this->output->set_charset(RCMAIL_CHARSET); |
| | | |
| | | // add some basic labels to client |
| | | $this->output->add_label('loading', 'servererror'); |
| | | $this->output->add_label('loading', 'servererror', 'requesttimedout'); |
| | | |
| | | return $this->output; |
| | | } |
| | |
| | | $_SESSION['storage_port'] = $port; |
| | | $_SESSION['storage_ssl'] = $ssl; |
| | | $_SESSION['password'] = $this->encrypt($pass); |
| | | $_SESSION['login_time'] = mktime(); |
| | | $_SESSION['login_time'] = time(); |
| | | |
| | | if (isset($_REQUEST['_timezone']) && $_REQUEST['_timezone'] != '_default_') |
| | | $_SESSION['timezone'] = floatval($_REQUEST['_timezone']); |
| | |
| | | { |
| | | rcube_utils::setcookie($name, $value, $exp); |
| | | } |
| | | |
| | | public function imap_connect() |
| | | { |
| | | 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; |
| | | } |
| | | } |