Changeset 3268 in subversion


Ignore:
Timestamp:
Feb 13, 2010 12:33:25 PM (3 years ago)
Author:
alec
Message:
Location:
trunk/roundcubemail
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/index.php

    r3258 r3268  
    3131require_once 'program/include/iniset.php'; 
    3232 
    33 // init application and start session with requested task 
     33// init application, start session, init output class, etc. 
    3434$RCMAIL = rcmail::get_instance(); 
    35  
    36 // init output class 
    37 $OUTPUT = !empty($_REQUEST['_remote']) ? $RCMAIL->init_json() : $RCMAIL->load_gui(!empty($_REQUEST['_framed'])); 
    38  
    39 // init plugin API 
    40 $RCMAIL->plugins->init(); 
    4135 
    4236// turn on output buffering 
  • trunk/roundcubemail/program/include/rcmail.php

    r3258 r3268  
    131131    $_SESSION['task'] = $this->task; 
    132132 
    133     // create IMAP object 
    134     if ($this->task == 'login') 
    135       $this->imap_init(); 
    136        
     133    // init output class 
     134    if (!empty($_REQUEST['_remote'])) 
     135      $GLOBALS['OUTPUT'] = $this->init_json(); 
     136    else 
     137      $GLOBALS['OUTPUT'] = $this->load_gui(!empty($_REQUEST['_framed'])); 
     138 
    137139    // create plugin API and load plugins 
    138140    $this->plugins = rcube_plugin_api::get_instance(); 
     141 
     142    // init plugins 
     143    $this->plugins->init(); 
    139144  } 
    140145   
     
    396401    // set global object for backward compatibility 
    397402    $GLOBALS['IMAP'] = $this->imap; 
    398      
     403 
     404    $hook = $this->plugins->exec_hook('imap_init', array('fetch_headers' => $this->imap->fetch_add_headers)); 
     405    if ($hook['fetch_headers']) 
     406      $this->imap->fetch_add_headers = $hook['fetch_headers']; 
     407                                         
    399408    if ($connect) 
    400409      $this->imap_connect(); 
     
    410419  { 
    411420    $conn = false; 
     421 
     422    if (!$this->imap) 
     423      $this->imap_init(); 
    412424     
    413425    if ($_SESSION['imap_host'] && !$this->imap->conn) { 
     
    494506    if ($user = rcube_user::query($username, $host)) 
    495507      $username = $user->data['username']; 
     508 
     509    if (!$this->imap) 
     510      $this->imap_init(); 
    496511 
    497512    // exit if IMAP login failed 
  • trunk/roundcubemail/program/include/rcube_plugin_api.php

    r3258 r3268  
    151151     
    152152    // maybe also register a shudown function which triggers shutdown functions of all plugin objects 
    153      
    154      
    155     // call imap_init right now 
    156     // (should actually be done in rcmail::imap_init() but plugins are not initialized then) 
    157     if ($rcmail->imap) { 
    158       $hook = $this->exec_hook('imap_init', array('fetch_headers' => $rcmail->imap->fetch_add_headers)); 
    159       if ($hook['fetch_headers']) 
    160         $rcmail->imap->fetch_add_headers = $hook['fetch_headers']; 
    161     } 
    162153  } 
    163154   
  • trunk/roundcubemail/program/steps/mail/func.inc

    r3261 r3268  
    2525$NOIMAP_ACTIONS = array('spell', 'addcontact', 'autocomplete', 'upload', 'display-attachment', 'remove-attachment'); 
    2626 
    27 // Init IMAP object 
    28 $RCMAIL->imap_init(); 
    29  
    3027// log in to imap server 
    3128if (!in_array($RCMAIL->action, $NOIMAP_ACTIONS) && !$RCMAIL->imap_connect()) { 
     
    4340if ($mbox = get_input_value('_mbox', RCUBE_INPUT_GPC)) 
    4441  $IMAP->set_mailbox(($_SESSION['mbox'] = $mbox)); 
    45 else 
     42else if ($IMAP) 
    4643  $_SESSION['mbox'] = $IMAP->get_mailbox_name(); 
    4744 
Note: See TracChangeset for help on using the changeset viewer.