| | |
| | | } |
| | | $list[$id] = array( |
| | | 'id' => $id, |
| | | 'name' => $prop['name'], |
| | | 'name' => html::quote($prop['name']), |
| | | 'groups' => is_array($prop['groups']), |
| | | 'readonly' => !$prop['writable'], |
| | | 'hidden' => $prop['hidden'], |
| | |
| | | |
| | | /** |
| | | * Init output object for GUI and add common scripts. |
| | | * This will instantiate a rcmail_template object and set |
| | | * This will instantiate a rcube_output_html object and set |
| | | * environment vars according to the current session and configuration |
| | | * |
| | | * @param boolean True if this request is loaded in a (i)frame |
| | |
| | | $username .= '@'.rcube_utils::parse_host($config['username_domain'], $host); |
| | | } |
| | | |
| | | if (!isset($config['login_lc'])) { |
| | | $config['login_lc'] = 2; // default |
| | | } |
| | | |
| | | // Convert username to lowercase. If storage backend |
| | | // is case-insensitive we need to store always the same username (#1487113) |
| | | if ($config['login_lc']) { |
| | |
| | | $storage = $this->get_storage(); |
| | | |
| | | // try to log in |
| | | if (!($login = $storage->connect($host, $username, $pass, $port, $ssl))) { |
| | | // try with lowercase |
| | | $username_lc = mb_strtolower($username); |
| | | if ($username_lc != $username) { |
| | | // try to find user record again -> overwrite username |
| | | if (!$user && ($user = rcube_user::query($username_lc, $host))) |
| | | $username_lc = $user->data['username']; |
| | | |
| | | if ($login = $storage->connect($host, $username_lc, $pass, $port, $ssl)) |
| | | $username = $username_lc; |
| | | } |
| | | } |
| | | |
| | | // exit if login failed |
| | | if (!$login) { |
| | | if (!$storage->connect($host, $username, $pass, $port, $ssl)) { |
| | | return false; |
| | | } |
| | | |
| | |
| | | } |
| | | else { |
| | | if (!empty($date)) { |
| | | $timestamp = rcube_strtotime($date); |
| | | $timestamp = rcube_utils::strtotime($date); |
| | | } |
| | | |
| | | if (empty($timestamp)) { |
| | |
| | | $err_code = $this->storage->get_error_code(); |
| | | $res_code = $this->storage->get_response_code(); |
| | | |
| | | if ($err_code < 0) { |
| | | $this->output->show_message('storageerror', 'error'); |
| | | } |
| | | else if ($res_code == rcube_storage::NOPERM) { |
| | | if ($res_code == rcube_storage::NOPERM) { |
| | | $this->output->show_message('errornoperm', 'error'); |
| | | } |
| | | else if ($res_code == rcube_storage::READONLY) { |
| | |
| | | else { |
| | | $this->output->show_message('servererrormsg', 'error', array('msg' => $err_str)); |
| | | } |
| | | } |
| | | else if ($err_code < 0) { |
| | | $this->output->show_message('storageerror', 'error'); |
| | | } |
| | | else if ($fallback) { |
| | | $this->output->show_message($fallback, 'error', $fallback_args); |
| | |
| | | |
| | | 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'); |
| | | $this->output->show_message('storageerror', 'error'); |
| | | } |
| | | } |
| | | else { |
| | | $this->set_storage_prop(); |
| | | return $storage->is_connected(); |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | return $storage->is_connected(); |
| | | } |
| | | } |