alecpl
2010-02-15 3b1426a1e5ec167f76fccedac7648a84337d1d87
index.php
@@ -30,14 +30,8 @@
// include environment
require_once 'program/include/iniset.php';
// init application and start session with requested task
// init application, start session, init output class, etc.
$RCMAIL = rcmail::get_instance();
// init output class
$OUTPUT = !empty($_REQUEST['_remote']) ? $RCMAIL->init_json() : $RCMAIL->load_gui(!empty($_REQUEST['_framed']));
// init plugin API
$RCMAIL->plugins->init();
// turn on output buffering
ob_start();
@@ -80,7 +74,7 @@
$RCMAIL->action = $startup['action'];
// try to log in
if ($RCMAIL->action=='login' && $RCMAIL->task=='mail') {
if ($RCMAIL->task == 'login' && $RCMAIL->action == 'login') {
  // purge the session in case of new login when a session already exists 
  $RCMAIL->kill_session();
  
@@ -117,6 +111,8 @@
    if ($url = get_input_value('_url', RCUBE_INPUT_POST))
      parse_str($url, $query);
    $RCMAIL->set_task('mail');
    // allow plugins to control the redirect url after login success
    $redir = $RCMAIL->plugins->exec_hook('login_after', $query + array('task' => $RCMAIL->task));
    unset($redir['abort']);
@@ -132,7 +128,7 @@
}
// end session
else if ($RCMAIL->task=='logout' && isset($_SESSION['user_id'])) {
else if ($RCMAIL->task == 'logout' && isset($_SESSION['user_id'])) {
  $userdata = array('user' => $_SESSION['username'], 'host' => $_SESSION['imap_host'], 'lang' => $RCMAIL->user->language);
  $OUTPUT->show_message('loggedout');
  $RCMAIL->logout_actions();
@@ -141,7 +137,7 @@
}
// check session and auth cookie
else if ($RCMAIL->action != 'login' && $_SESSION['user_id'] && $RCMAIL->action != 'send') {
else if ($RCMAIL->task != 'login' && $_SESSION['user_id'] && $RCMAIL->action != 'send') {
  if (!$RCMAIL->authenticate_session()) {
    $OUTPUT->show_message('sessionerror', 'error');
    $RCMAIL->kill_session();
@@ -168,7 +164,7 @@
if (empty($RCMAIL->user->ID)) {
  if ($OUTPUT->ajax_call)
    $OUTPUT->redirect(array(), 2000);
  if (!empty($_REQUEST['_framed']))
    $OUTPUT->command('redirect', '?');