From be1b537623a156b3886e5900c999aae6a8bbda36 Mon Sep 17 00:00:00 2001 From: alec Date: Thu, 8 Jul 2010 07:10:29 +0000 Subject: - Added managesieve_auth_type option (#1486731) git-svn-id: https://svn.roundcube.net/trunk@3808 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/managesieve/lib/rcube_sieve.php | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'plugins/managesieve/lib') diff --git a/plugins/managesieve/lib/rcube_sieve.php b/plugins/managesieve/lib/rcube_sieve.php index 2a79f7f14..7333d1dcd 100644 --- a/plugins/managesieve/lib/rcube_sieve.php +++ b/plugins/managesieve/lib/rcube_sieve.php @@ -36,27 +36,31 @@ class rcube_sieve /** * Object constructor * - * @param string Username (to managesieve login) - * @param string Password (to managesieve login) - * @param string Managesieve server hostname/address - * @param string Managesieve server port number - * @param string Enable/disable TLS use - * @param array Disabled extensions + * @param string Username (for managesieve login) + * @param string Password (for managesieve login) + * @param string Managesieve server hostname/address + * @param string Managesieve server port number + * @param string Managesieve authentication method + * @param boolean Enable/disable TLS use + * @param array Disabled extensions + * @param boolean Enable/disable debugging */ public function __construct($username, $password='', $host='localhost', $port=2000, - $usetls=true, $disabled=array(), $debug=false) + $auth_type=null, $usetls=true, $disabled=array(), $debug=false) { $this->sieve = new Net_Sieve(); - if ($debug) + if ($debug) { $this->sieve->setDebug(true, array($this, 'debug_handler')); - - if (PEAR::isError($this->sieve->connect($host, $port, NULL, $usetls))) + } + if (PEAR::isError($this->sieve->connect($host, $port, NULL, $usetls))) { return $this->_set_error(SIEVE_ERROR_CONNECTION); - - if (PEAR::isError($this->sieve->login($username, $password))) + } + if (PEAR::isError($this->sieve->login($username, $password, + $auth_type ? strtoupper($auth_type) : null)) + ) { return $this->_set_error(SIEVE_ERROR_LOGIN); - + } $this->disabled = $disabled; } -- cgit v1.2.3