From 20d07a78a8dbb49df6c94ddbdb45b19cad27039a Mon Sep 17 00:00:00 2001 From: alec Date: Mon, 25 Oct 2010 13:08:54 +0000 Subject: - Added support for SASL proxy authentication (#1486691) git-svn-id: https://svn.roundcube.net/trunk@4133 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/managesieve/lib/rcube_sieve.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'plugins/managesieve/lib') diff --git a/plugins/managesieve/lib/rcube_sieve.php b/plugins/managesieve/lib/rcube_sieve.php index 4c7eaad58..cec86a1db 100644 --- a/plugins/managesieve/lib/rcube_sieve.php +++ b/plugins/managesieve/lib/rcube_sieve.php @@ -44,23 +44,35 @@ class rcube_sieve * @param boolean Enable/disable TLS use * @param array Disabled extensions * @param boolean Enable/disable debugging + * @param string Proxy authentication identifier + * @param string Proxy authentication password */ public function __construct($username, $password='', $host='localhost', $port=2000, - $auth_type=null, $usetls=true, $disabled=array(), $debug=false) + $auth_type=null, $usetls=true, $disabled=array(), $debug=false, + $auth_cid=null, $auth_pw=null) { $this->sieve = new Net_Sieve(); if ($debug) { $this->sieve->setDebug(true, array($this, 'debug_handler')); } + if (PEAR::isError($this->sieve->connect($host, $port, NULL, $usetls))) { return $this->_set_error(SIEVE_ERROR_CONNECTION); } + + if (!empty($auth_cid)) { + $authz = $username; + $username = $auth_cid; + $password = $auth_pw; + } + if (PEAR::isError($this->sieve->login($username, $password, - $auth_type ? strtoupper($auth_type) : null)) + $auth_type ? strtoupper($auth_type) : null, $authz)) ) { return $this->_set_error(SIEVE_ERROR_LOGIN); } + $this->disabled = $disabled; } -- cgit v1.2.3