thomascube
2009-05-14 f879f4e2f8c81f67b0a0c471c94ebed686939c49
program/include/rcmail.php
@@ -91,7 +91,7 @@
    }
    // set task and action properties
    $this->set_task(strip_quotes(get_input_value('_task', RCUBE_INPUT_GPC)));
    $this->set_task(get_input_value('_task', RCUBE_INPUT_GPC));
    $this->action = asciiwords(get_input_value('_action', RCUBE_INPUT_GPC));
    // connect to database
@@ -124,7 +124,7 @@
    // reset some session parameters when changing task
    if ($_SESSION['task'] != $this->task)
      unset($_SESSION['page']);
      rcube_sess_unset('page');
    // set current task to session
    $_SESSION['task'] = $this->task;
@@ -145,14 +145,12 @@
   */
  public function set_task($task)
  {
    if (!in_array($task, self::$main_tasks))
      $task = 'mail';
    $this->task = $task;
    $this->comm_path = $this->url(array('task' => $task));
    $task = asciiwords($task);
    $this->task = $task ? $task : 'mail';
    $this->comm_path = $this->url(array('task' => $this->task));
    
    if ($this->output)
      $this->output->set_env('task', $task);
      $this->output->set_env('task', $this->task);
  }
  
  
@@ -493,6 +491,13 @@
        // get existing mailboxes (but why?)
        // $a_mailboxes = $this->imap->list_mailboxes();
      }
      else {
        raise_error(array(
          'code' => 600,
          'type' => 'php',
          'message' => "Failed to create a user record. Maybe aborted by a plugin?"
          ), true, false);
      }
    }
    else {
      raise_error(array(
@@ -795,6 +800,7 @@
   */
  public function kill_session()
  {
    rcube_sess_unset();
    $_SESSION = array('language' => $this->user->language, 'auth_time' => time(), 'temp' => true);
    rcmail::setcookie('sessauth', '-del-', time() - 60);
    $this->user->reset();
@@ -936,11 +942,8 @@
  {
    if (!is_array($p))
      $p = array('_action' => @func_get_arg(0));
    $task = $p['_task'] ? $p['_task'] : $p['task'];
    if (!$task || !in_array($task, rcmail::$main_tasks))
      $task = $this->task;
    $task = $p['_task'] ? $p['_task'] : ($p['task'] ? $p['task'] : $this->task);
    $p['_task'] = $task;
    unset($p['task']);