Changeset 4133 in subversion


Ignore:
Timestamp:
Oct 25, 2010 9:08:54 AM (3 years ago)
Author:
alec
Message:
  • Added support for SASL proxy authentication (#1486691)
Location:
trunk/plugins/managesieve
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/managesieve/Changelog

    r4071 r4133  
     1- Added support for SASL proxy authentication (#1486691) 
     2 
    13* version 2.10 [2010-10-10] 
    24----------------------------------------------------------- 
  • trunk/plugins/managesieve/config.inc.php.dist

    r3808 r4133  
    1515// or none. Optional, defaults to best method supported by server. 
    1616$rcmail_config['managesieve_auth_type'] = null; 
     17 
     18// Optional managesieve authentication identifier to be used as authorization proxy. 
     19// Authenticate as a different user but act on behalf of the logged in user. 
     20// Works with PLAIN and DIGEST-MD5 auth. 
     21$rcmail_config['managesieve_auth_cid'] = null; 
     22 
     23// Optional managesieve authentication password to be used for imap_auth_cid 
     24$rcmail_config['managesieve_auth_pw'] = null; 
    1725 
    1826// use or not TLS for managesieve server connection 
  • trunk/plugins/managesieve/lib/rcube_sieve.php

    r4068 r4133  
    4545     * @param array   Disabled extensions 
    4646     * @param boolean Enable/disable debugging 
     47     * @param string  Proxy authentication identifier 
     48     * @param string  Proxy authentication password 
    4749     */ 
    4850    public function __construct($username, $password='', $host='localhost', $port=2000, 
    49         $auth_type=null, $usetls=true, $disabled=array(), $debug=false) 
     51        $auth_type=null, $usetls=true, $disabled=array(), $debug=false, 
     52        $auth_cid=null, $auth_pw=null) 
    5053    { 
    5154        $this->sieve = new Net_Sieve(); 
     
    5457            $this->sieve->setDebug(true, array($this, 'debug_handler')); 
    5558        } 
     59 
    5660        if (PEAR::isError($this->sieve->connect($host, $port, NULL, $usetls))) { 
    5761            return $this->_set_error(SIEVE_ERROR_CONNECTION); 
    5862        } 
     63 
     64        if (!empty($auth_cid)) { 
     65            $authz    = $username; 
     66            $username = $auth_cid; 
     67            $password = $auth_pw; 
     68        } 
     69 
    5970        if (PEAR::isError($this->sieve->login($username, $password, 
    60             $auth_type ? strtoupper($auth_type) : null)) 
     71            $auth_type ? strtoupper($auth_type) : null, $authz)) 
    6172        ) { 
    6273            return $this->_set_error(SIEVE_ERROR_LOGIN); 
    6374        } 
     75 
    6476        $this->disabled = $disabled; 
    6577    } 
  • trunk/plugins/managesieve/managesieve.php

    r4071 r4133  
    7575            $this->rc->config->get('managesieve_usetls', false), 
    7676            $this->rc->config->get('managesieve_disabled_extensions'), 
    77             $this->rc->config->get('managesieve_debug', false) 
     77            $this->rc->config->get('managesieve_debug', false), 
     78            $this->rc->config->get('managesieve_auth_cid'),  
     79            $this->rc->config->get('managesieve_auth_pw') 
    7880        ); 
    7981 
Note: See TracChangeset for help on using the changeset viewer.