| | |
| | | const ERROR_INVALID_REQUEST = 1; |
| | | const ERROR_INVALID_HOST = 2; |
| | | const ERROR_COOKIES_DISABLED = 3; |
| | | const ERROR_RATE_LIMIT = 4; |
| | | |
| | | |
| | | /** |
| | |
| | | // user already registered -> overwrite username |
| | | if ($user = rcube_user::query($username, $host)) { |
| | | $username = $user->data['username']; |
| | | |
| | | // Brute-force prevention |
| | | if ($user->is_locked()) { |
| | | $this->login_error = self::ERROR_RATE_LIMIT; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | $storage = $this->get_storage(); |
| | | |
| | | // try to log in |
| | | if (!$storage->connect($host, $username, $password, $port, $ssl)) { |
| | | if ($user) { |
| | | $user->failed_login(); |
| | | } |
| | | |
| | | // Wait a second to slow down brute-force attacks (#1490549) |
| | | sleep(1); |
| | | return false; |
| | |
| | | // this need to be full url to make redirects work |
| | | $absolute = true; |
| | | } |
| | | else if ($secure && ($token = $this->get_request_token())) |
| | | $url .= $delm . '_token=' . urlencode($token); |
| | | |
| | | if ($absolute || $full) { |
| | | // add base path to this Roundcube installation |
| | |
| | | $spelldict = intval($this->config->get('spellcheck_dictionary')); |
| | | $disabled_plugins = array(); |
| | | $disabled_buttons = array(); |
| | | $extra_plugins = array(); |
| | | $extra_buttons = array(); |
| | | |
| | | if (!$spellcheck) { |
| | | $disabled_plugins[] = 'spellchecker'; |
| | |
| | | 'mode' => $mode, |
| | | 'disabled_plugins' => $disabled_plugins, |
| | | 'disabled_buttons' => $disabled_buttons, |
| | | 'extra_plugins' => $extra_plugins, |
| | | 'extra_buttons' => $extra_buttons, |
| | | )); |
| | | |
| | | if ($hook['abort']) { |
| | |
| | | 'spelldict' => $spelldict, |
| | | 'disabled_plugins' => $hook['disabled_plugins'], |
| | | 'disabled_buttons' => $hook['disabled_buttons'], |
| | | 'extra_plugins' => $hook['extra_plugins'], |
| | | 'extra_buttons' => $hook['extra_buttons'], |
| | | ); |
| | | |
| | | $this->output->add_label('selectimage', 'addimage', 'selectmedia', 'addmedia'); |
| | |
| | | } |
| | | |
| | | return $options['body']; |
| | | } |
| | | |
| | | |
| | | /************************************************************************ |
| | | ********* Deprecated methods (to be removed) ********* |
| | | ***********************************************************************/ |
| | | |
| | | public static function setcookie($name, $value, $exp = 0) |
| | | { |
| | | rcube_utils::setcookie($name, $value, $exp); |
| | | } |
| | | |
| | | public function imap_connect() |
| | | { |
| | | return $this->storage_connect(); |
| | | } |
| | | |
| | | public function imap_init() |
| | | { |
| | | return $this->storage_init(); |
| | | } |
| | | |
| | | /** |