| | |
| | | } |
| | | else { |
| | | if (!$auth['valid']) { |
| | | $error_code = RCMAIL::ERROR_INVALID_REQUEST; |
| | | $error_code = RCMAIL::ERROR_INVALID_REQUEST; |
| | | } |
| | | else { |
| | | $error_code = $auth['error'] ? $auth['error'] : $RCMAIL->login_error(); |
| | |
| | | ); |
| | | |
| | | $error_message = $error_labels[$error_code] ? $error_labels[$error_code] : 'loginfailed'; |
| | | |
| | | // log failed login |
| | | $RCMAIL->log_login($auth['user'], true, $error_code); |
| | | |
| | | $OUTPUT->show_message($error_message, 'warning'); |
| | | $RCMAIL->plugins->exec_hook('login_failed', array( |
| | |
| | | $session_error = true; |
| | | } |
| | | |
| | | if ($OUTPUT->ajax_call) |
| | | $OUTPUT->redirect(array('_err' => 'session'), 2000); |
| | | |
| | | if (!empty($_REQUEST['_framed'])) |
| | | $OUTPUT->command('redirect', $RCMAIL->url(array('_err' => 'session'))); |
| | | |
| | | // check if installer is still active |
| | | if ($RCMAIL->config->get('enable_installer') && is_readable('./installer/index.php')) { |
| | | $OUTPUT->add_footer(html::div(array('style' => "background:#ef9398; border:2px solid #dc5757; padding:0.5em; margin:2em auto; width:50em"), |
| | |
| | | ); |
| | | } |
| | | |
| | | if ($session_error || $_REQUEST['_err'] == 'session') |
| | | if ($session_error || $_REQUEST['_err'] == 'session') { |
| | | $OUTPUT->show_message('sessionerror', 'error', null, true, -1); |
| | | } |
| | | |
| | | if ($OUTPUT->ajax_call || !empty($_REQUEST['_framed'])) { |
| | | $OUTPUT->command('session_error', $RCMAIL->url(array('_err' => 'session'))); |
| | | $OUTPUT->send('iframe'); |
| | | } |
| | | |
| | | $plugin = $RCMAIL->plugins->exec_hook('unauthenticated', array('task' => 'login', 'error' => $session_error)); |
| | | |
| | |
| | | } |
| | | |
| | | if ($RCMAIL->action == 'refresh') { |
| | | $RCMAIL->plugins->exec_hook('refresh', array()); |
| | | $RCMAIL->plugins->exec_hook('refresh', array('last' => intval(rcube_utils::get_input_value('_last', rcube_utils::INPUT_GPC)))); |
| | | } |
| | | |
| | | // parse main template (default) |