summaryrefslogtreecommitdiff
path: root/plugins/managesieve/lib
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-25 13:08:54 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-10-25 13:08:54 +0000
commit20d07a78a8dbb49df6c94ddbdb45b19cad27039a (patch)
treeb7f424afa3cc979879b42932dddfae873aaaf6a5 /plugins/managesieve/lib
parent19fb45036c83a3feb7efa642181e7c96492f97e4 (diff)
- Added support for SASL proxy authentication (#1486691)
git-svn-id: https://svn.roundcube.net/trunk@4133 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/managesieve/lib')
-rw-r--r--plugins/managesieve/lib/rcube_sieve.php16
1 files changed, 14 insertions, 2 deletions
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;
}