| | |
| | | /* |
| | | +-------------------------------------------------------------------------+ |
| | | | Roundcube Webmail IMAP Client | |
| | | | Version 0.6-svn | |
| | | | Version 0.8-svn | |
| | | | | |
| | | | Copyright (C) 2005-2011, The Roundcube Dev Team | |
| | | | | |
| | |
| | | $OUTPUT->redirect($redir); |
| | | } |
| | | else { |
| | | $error_code = is_object($IMAP) ? $IMAP->get_error_code() : -1; |
| | | $error_code = (isset($RCMAIL->imap) && is_object($RCMAIL->imap)) ? $RCMAIL->imap->get_error_code() : 1; |
| | | |
| | | $OUTPUT->show_message($error_code < -1 ? 'imaperror' : (!$auth['valid'] ? 'invalidrequest' : 'loginfailed'), 'warning'); |
| | | $RCMAIL->plugins->exec_hook('login_failed', array( |
| | |
| | | // check client X-header to verify request origin |
| | | if ($OUTPUT->ajax_call) { |
| | | if (rc_request_header('X-Roundcube-Request') != $RCMAIL->get_request_token() && !$RCMAIL->config->get('devel_mode')) { |
| | | header('HTTP/1.1 404 Not Found'); |
| | | header('HTTP/1.1 403 Forbidden'); |
| | | die("Invalid Request"); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | // we're ready, user is authenticated and the request is safe |
| | | $plugin = $RCMAIL->plugins->exec_hook('ready', array('task' => $RCMAIL->task, 'action' => $RCMAIL->action)); |
| | | $RCMAIL->set_task($plugin['task']); |
| | | $RCMAIL->action = $plugin['action']; |
| | | |
| | | |
| | | // handle special actions |
| | | if ($RCMAIL->action == 'keep-alive') { |
| | | $OUTPUT->reset(); |