Changeset 3808 in subversion


Ignore:
Timestamp:
Jul 8, 2010 3:10:29 AM (3 years ago)
Author:
alec
Message:
  • Added managesieve_auth_type option (#1486731)
Location:
trunk/plugins/managesieve
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/managesieve/Changelog

    r3805 r3808  
     1* version 2.8 [2010-07-08] 
     2----------------------------------------------------------- 
     3- Added managesieve_auth_type option (#1486731) 
     4 
    15* version 2.7 [2010-07-06] 
    26----------------------------------------------------------- 
  • trunk/plugins/managesieve/config.inc.php.dist

    r3703 r3808  
    1111// For example %n = mail.domain.tld, %d = domain.tld 
    1212$rcmail_config['managesieve_host'] = 'localhost'; 
     13 
     14// authentication method. Can be CRAM-MD5, DIGEST-MD5, PLAIN, LOGIN, EXTERNAL 
     15// or none. Optional, defaults to best method supported by server. 
     16$rcmail_config['managesieve_auth_type'] = null; 
    1317 
    1418// use or not TLS for managesieve server connection 
     
    4044 
    4145?> 
    42  
  • trunk/plugins/managesieve/lib/rcube_sieve.php

    r3805 r3808  
    3737     * Object constructor 
    3838     * 
    39      * @param  string  Username (to managesieve login) 
    40      * @param  string  Password (to managesieve login) 
    41      * @param  string  Managesieve server hostname/address 
    42      * @param  string  Managesieve server port number 
    43      * @param  string  Enable/disable TLS use 
    44      * @param  array   Disabled extensions 
     39     * @param string  Username (for managesieve login) 
     40     * @param string  Password (for managesieve login) 
     41     * @param string  Managesieve server hostname/address 
     42     * @param string  Managesieve server port number 
     43     * @param string  Managesieve authentication method  
     44     * @param boolean Enable/disable TLS use 
     45     * @param array   Disabled extensions 
     46     * @param boolean Enable/disable debugging 
    4547     */ 
    4648    public function __construct($username, $password='', $host='localhost', $port=2000, 
    47                 $usetls=true, $disabled=array(), $debug=false) 
     49        $auth_type=null, $usetls=true, $disabled=array(), $debug=false) 
    4850    { 
    4951        $this->sieve = new Net_Sieve(); 
    5052 
    51         if ($debug) 
     53        if ($debug) { 
    5254            $this->sieve->setDebug(true, array($this, 'debug_handler')); 
    53  
    54         if (PEAR::isError($this->sieve->connect($host, $port, NULL, $usetls))) 
     55        } 
     56        if (PEAR::isError($this->sieve->connect($host, $port, NULL, $usetls))) { 
    5557            return $this->_set_error(SIEVE_ERROR_CONNECTION); 
    56  
    57         if (PEAR::isError($this->sieve->login($username, $password))) 
     58        } 
     59        if (PEAR::isError($this->sieve->login($username, $password, 
     60            $auth_type ? strtoupper($auth_type) : null)) 
     61        ) { 
    5862            return $this->_set_error(SIEVE_ERROR_LOGIN); 
    59  
     63        } 
    6064        $this->disabled = $disabled; 
    6165    } 
  • trunk/plugins/managesieve/managesieve.php

    r3805 r3808  
    88 * with server using managesieve protocol. Adds Filters tab in Settings. 
    99 * 
    10  * @version 2.6 
     10 * @version 2.8 
    1111 * @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl> 
    1212 * 
     
    6969        $this->sieve = new rcube_sieve($_SESSION['username'], 
    7070            $this->rc->decrypt($_SESSION['password']), $host, $port, 
     71            $this->rc->config->get('managesieve_auth_type'), 
    7172            $this->rc->config->get('managesieve_usetls', false), 
    7273            $this->rc->config->get('managesieve_disabled_extensions'), 
     
    10911092    } 
    10921093} 
    1093  
    1094 ?> 
Note: See TracChangeset for help on using the changeset viewer.