Changeset 1447 in subversion


Ignore:
Timestamp:
May 28, 2008 6:44:22 PM (5 years ago)
Author:
thomasb
Message:

Pass auth_type as argument; don't start session if started from command line

Location:
trunk/roundcubemail/program/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/rcmail.php

    r1401 r1447  
    102102    } 
    103103 
    104     // start PHP session 
    105     session_start(); 
     104    // start PHP session (if not in CLI mode) 
     105    if ($_SERVER['REMOTE_ADDR']) 
     106      session_start(); 
    106107 
    107108    // set initial session vars 
     
    301302     
    302303    if ($_SESSION['imap_host']) { 
    303       if (!($conn = $this->imap->connect($_SESSION['imap_host'], $_SESSION['username'], $this->decrypt_passwd($_SESSION['password']), $_SESSION['imap_port'], $_SESSION['imap_ssl']))) { 
     304      if (!($conn = $this->imap->connect($_SESSION['imap_host'], $_SESSION['username'], $this->decrypt_passwd($_SESSION['password']), $_SESSION['imap_port'], $_SESSION['imap_ssl'], rcmail::get_instance()->config->get('imap_auth_type', 'check')))) { 
    304305        if ($this->output) 
    305306          $this->output->show_message($this->imap->error_code == -1 ? 'imaperror' : 'sessionerror', 'error'); 
     
    382383 
    383384    // exit if IMAP login failed 
    384     if (!($imap_login  = $this->imap->connect($host, $username, $pass, $imap_port, $imap_ssl))) 
     385    if (!($imap_login  = $this->imap->connect($host, $username, $pass, $imap_port, $imap_ssl, $config['imap_auth_type']))) 
    385386      return false; 
    386387 
     
    728729 
    729730    // before closing the database connection, write session data 
    730     session_write_close(); 
     731    if ($_SERVER['REMOTE_ADDR']) 
     732      session_write_close(); 
    731733  } 
    732734   
  • trunk/roundcubemail/program/include/rcube_imap.php

    r1444 r1447  
    103103   * @access public 
    104104   */ 
    105   function connect($host, $user, $pass, $port=143, $use_ssl=null) 
     105  function connect($host, $user, $pass, $port=143, $use_ssl=null, $auth_type='check') 
    106106    { 
    107107    global $ICL_SSL, $ICL_PORT, $IMAP_USE_INTERNAL_DATE; 
     
    120120    $IMAP_USE_INTERNAL_DATE = false; 
    121121 
    122     $auth_type = rcmail::get_instance()->config->get('imap_auth_type', 'check'); 
    123      
    124122    $this->conn = iil_Connect($host, $user, $pass, array('imap' => $auth_type)); 
    125123    $this->host = $host; 
Note: See TracChangeset for help on using the changeset viewer.