Changeset 1031 in subversion


Ignore:
Timestamp:
Feb 8, 2008 12:18:32 PM (5 years ago)
Author:
thomasb
Message:

Distinguish ssl and tls for imap connections (#1484667)

Location:
trunk/roundcubemail/program
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/program/include/main.inc

    r1026 r1031  
    563563    { 
    564564    $host = $a_host['host']; 
    565     $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? TRUE : FALSE; 
     565    $imap_ssl = (isset($a_host['scheme']) && in_array($a_host['scheme'], array('ssl','imaps','tls'))) ? $a_host['scheme'] : null; 
    566566    $imap_port = isset($a_host['port']) ? $a_host['port'] : ($imap_ssl ? 993 : $CONFIG['default_port']); 
    567567    } 
  • trunk/roundcubemail/program/include/rcube_imap.inc

    r996 r1031  
    9898   * @param  string   Password for IMAP account 
    9999   * @param  number   Port to connect to 
    100    * @param  boolean  Use SSL connection 
     100   * @param  string   SSL schema (either ssl or tls) or null if plain connection 
    101101   * @return boolean  TRUE on success, FALSE on failure 
    102102   * @access public 
    103103   */ 
    104   function connect($host, $user, $pass, $port=143, $use_ssl=FALSE) 
     104  function connect($host, $user, $pass, $port=143, $use_ssl=null) 
    105105    { 
    106106    global $ICL_SSL, $ICL_PORT, $IMAP_USE_INTERNAL_DATE; 
     
    108108    // check for Open-SSL support in PHP build 
    109109    if ($use_ssl && in_array('openssl', get_loaded_extensions())) 
    110       $ICL_SSL = TRUE; 
     110      $ICL_SSL = $use_ssl == 'imaps' ? 'ssl' : $use_ssl; 
    111111    else if ($use_ssl) 
    112112      { 
  • trunk/roundcubemail/program/lib/imap.inc

    r1016 r1031  
    5050                - Implemented UID FETCH in iil_C_FetchHeaders() 
    5151                - Abort do-loop on socket errors (fgets returns false) 
     52                - $ICL_SSL is not boolean anymore but contains the connection schema (ssl or tls) 
    5253                - Removed some debuggers (echo ...) 
    5354 
     
    456457        //check for SSL 
    457458        if ($ICL_SSL) { 
    458                 $host = "ssl://".$host; 
     459                $host = $ICL_SSL."://".$host; 
    459460        } 
    460461         
Note: See TracChangeset for help on using the changeset viewer.