Changeset 3801 in subversion


Ignore:
Timestamp:
Jul 1, 2010 6:18:44 AM (3 years ago)
Author:
alec
Message:
  • Net_Sieve-1.3.0 with LOGIN fix (#1486816)
Location:
trunk/plugins/managesieve
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/managesieve/Changelog

    r3750 r3801  
    1 - Update Net_Sieve to version 1.2.2 
     1- Update Net_Sieve to version 1.3.0 (fixes LOGIN athentication) 
    22 
    33* version 2.6 [2010-06-03] 
  • trunk/plugins/managesieve/lib/Net/Sieve.php

    r3750 r3801  
    4040 * @copyright 2006-2008 Anish Mistry 
    4141 * @license   http://www.opensource.org/licenses/bsd-license.php BSD 
    42  * @version   SVN: $Id: Sieve.php 300419 2010-06-13 12:10:10Z yunosh $ 
     42 * @version   SVN: $Id: Sieve.php 300898 2010-07-01 09:49:02Z yunosh $ 
    4343 * @link      http://pear.php.net/package/Net_Sieve 
    4444 */ 
     
    8484 * @copyright 2006-2008 Anish Mistry 
    8585 * @license   http://www.opensource.org/licenses/bsd-license.php BSD 
    86  * @version   Release: 1.2.2 
     86 * @version   Release: 1.3.0 
    8787 * @link      http://pear.php.net/package/Net_Sieve 
    8888 * @link      http://www.ietf.org/rfc/rfc3028.txt RFC 3028 (Sieve: A Mail 
     
    205205     * @param array   $options    Additional options for 
    206206     *                            stream_context_create(). 
     207     * @param mixed   $handler    A callback handler for the debug output. 
    207208     */ 
    208209    function Net_Sieve($user = null, $pass  = null, $host = 'localhost', 
    209         $port = 2000, $logintype = '', $euser = '', $debug = false, 
    210         $bypassAuth = false, $useTLS = true, $options = null 
    211     ) { 
     210                       $port = 2000, $logintype = '', $euser = '', 
     211                       $debug = false, $bypassAuth = false, $useTLS = true, 
     212                       $options = null, $handler = null) 
     213    { 
    212214        $this->_state             = NET_SIEVE_STATE_DISCONNECTED; 
    213215        $this->_data['user']      = $user; 
     
    218220        $this->_data['euser']     = $euser; 
    219221        $this->_sock              = new Net_Socket(); 
    220         $this->_debug             = $debug; 
    221222        $this->_bypassAuth        = $bypassAuth; 
    222223        $this->_useTLS            = $useTLS; 
    223224        $this->_options           = $options; 
     225        $this->setDebug($debug, $handler); 
    224226 
    225227        /* Try to include the Auth_SASL package.  If the package is not 
     
    636638            return $result; 
    637639        } 
    638         if (PEAR::isError($result = $this->_doCmd('"' . base64_encode($user) . '"'))) { 
     640        if (PEAR::isError($result = $this->_doCmd('"' . base64_encode($user) . '"', true))) { 
    639641            return $result; 
    640642        } 
    641         return $this->_doCmd('"' . base64_encode($pass) . '"'); 
     643        return $this->_doCmd('"' . base64_encode($pass) . '"', true); 
    642644    } 
    643645 
     
    11001102            return PEAR::raiseError('This server doesn\'t support any authentication methods. SASL problem?'); 
    11011103        } 
    1102  
    1103         $serverMethods = $this->_capability['sasl']; 
     1104        if (!$this->_capability['sasl']) { 
     1105            return PEAR::raiseError('This server doesn\'t support any authentication methods.'); 
     1106        } 
    11041107 
    11051108        if ($userMethod) { 
    1106             $methods = array($userMethod); 
    1107         } else { 
    1108             $methods = $this->supportedAuthMethods; 
    1109         } 
    1110  
    1111         if (!$methods || !$serverMethods) { 
     1109            if (in_array($userMethod, $this->_capability['sasl'])) { 
     1110                return $userMethod; 
     1111            } 
    11121112            return PEAR::raiseError( 
    1113                 'This server doesn\'t support any authentication methods.' 
    1114             ); 
    1115         } 
    1116  
    1117         foreach ($methods as $method) { 
    1118             if (in_array($method, $serverMethods)) { 
     1113                sprintf('No supported authentication method found. The server supports these methods: %s, but we want to use: %s', 
     1114                        implode(', ', $this->_capability['sasl']), 
     1115                        $userMethod)); 
     1116        } 
     1117 
     1118        foreach ($this->supportedAuthMethods as $method) { 
     1119            if (in_array($method, $this->_capability['sasl'])) { 
    11191120                return $method; 
    11201121            } 
     
    11221123 
    11231124        return PEAR::raiseError( 
    1124             'No supported authentication method found. The server supports these methods: ' 
    1125             . implode(',', $serverMethods) 
    1126             . ', but we only support: ' 
    1127             . implode(',', $this->supportedAuthMethods) 
    1128         ); 
     1125            sprintf('No supported authentication method found. The server supports these methods: %s, but we only support: %s', 
     1126                    implode(', ', $this->_capability['sasl']), 
     1127                    implode(', ', $this->supportedAuthMethods))); 
    11291128    } 
    11301129 
Note: See TracChangeset for help on using the changeset viewer.