alecpl
2010-05-18 677e1f26fe47cc0c3e0819cb99a9024af49a619c
program/include/rcmail.php
@@ -28,10 +28,10 @@
 */
class rcmail
{
  static public $main_tasks = array('mail','settings','addressbook','login','logout','dummy');
  static public $main_tasks = array('mail','settings','addressbook','login','logout','utils','dummy');
  static private $instance;
  public $config;
  public $user;
  public $db;
@@ -43,10 +43,10 @@
  public $task;
  public $action = '';
  public $comm_path = './';
  private $texts;
  /**
   * This implements the 'singleton' design pattern
   *
@@ -107,11 +107,12 @@
    $this->action = asciiwords(get_input_value('_action', RCUBE_INPUT_GPC));
    // reset some session parameters when changing task
    if ($_SESSION['task'] != $this->task)
      $this->session->remove('page');
    // set current task to session
    $_SESSION['task'] = $this->task;
    if ($this->task != 'utils') {
      if ($this->session && $_SESSION['task'] != $this->task)
        $this->session->remove('page');
      // set current task to session
      $_SESSION['task'] = $this->task;
    }
    // init output class
    if (!empty($_REQUEST['_remote']))
@@ -292,8 +293,8 @@
  public function get_address_sources($writeable = false)
  {
    $abook_type = strtolower($this->config->get('address_book_type'));
    $ldap_config = (array)$this->config->get('ldap_public');
    $autocomplete = (array)$this->config->get('autocomplete_addressbooks');
    $ldap_config = $this->config->get('ldap_public');
    $autocomplete = (array) $this->config->get('autocomplete_addressbooks');
    $list = array();
    // We are using the DB address book
@@ -308,7 +309,8 @@
      );
    }
    if (is_array($ldap_config)) {
    if ($ldap_config) {
      $ldap_config = (array) $ldap_config;
      foreach ($ldap_config as $id => $prop)
        $list[$id] = array(
          'id' => $id,
@@ -329,7 +331,7 @@
        }
      }
    }
    return $list;
  }
  
@@ -349,7 +351,7 @@
      $this->output = new rcube_template($this->task, $framed);
    // set keep-alive/check-recent interval
    if ($keep_alive = $this->session->get_keep_alive()) {
    if ($this->session && ($keep_alive = $this->session->get_keep_alive())) {
      $this->output->set_env('keep_alive', $keep_alive);
    }
@@ -480,6 +482,10 @@
   */
  public function session_init()
  {
    // session started (Installer?)
    if (session_id())
      return;
    $lifetime = $this->config->get('session_lifetime', 0) * 60;
    // set session domain
@@ -521,6 +527,9 @@
   */
  public function session_configure()
  {
    if (!$this->session)
      return;
    $lifetime = $this->config->get('session_lifetime', 0) * 60;
    // set keep-alive/check-recent interval
@@ -632,7 +641,7 @@
      else {
        raise_error(array(
          'code' => 600, 'type' => 'php',
     'file' => __FILE__, 'line' => __LINE__,
         'file' => __FILE__, 'line' => __LINE__,
          'message' => "Failed to create a user record. Maybe aborted by a plugin?"
          ), true, false);
      }
@@ -979,7 +988,10 @@
        $mem .= '/'.show_bytes(memory_get_peak_usage());
      $log = $this->task . ($this->action ? '/'.$this->action : '') . ($mem ? " [$mem]" : '');
      rcube_print_time(RCMAIL_START, $log);
      if (defined('RCMAIL_START'))
        rcube_print_time(RCMAIL_START, $log);
      else
        console($log);
    }
  }