Merge branch 'master' of https://github.com/neilmunday/roundcubemail into neilmunday-master

pull/5742/merge
Aleksander Machniak 7 years ago
commit 9752e26162

@ -24,6 +24,7 @@ class krb_authentication extends rcube_plugin
$this->add_hook('authenticate', array($this, 'authenticate'));
$this->add_hook('login_after', array($this, 'login'));
$this->add_hook('storage_connect', array($this, 'storage_connect'));
$this->add_hook('managesieve_connect', array($this, 'managesieve_connect'));
}
/**
@ -106,4 +107,20 @@ class krb_authentication extends rcube_plugin
return $args;
}
/**
* managesieve_connect hook handler
*/
function managesieve_connect($args)
{
if ((!isset($args['auth_type']) || $args['auth_type'] == 'GSSAPI') && !empty($_SERVER['REMOTE_USER']) && !empty($_SERVER['KRB5CCNAME'])) {
$rcmail = rcmail::get_instance();
$context = $rcmail->config->get('krb_authentication_context');
$args['gssapi_context'] = $context ?: 'imap/kolab.example.org@EXAMPLE.ORG';
$args['gssapi_cn'] = $_SERVER['KRB5CCNAME'];
$args['auth_type'] = 'GSSAPI';
}
return $args;
}
}

@ -1,3 +1,4 @@
- Added GSSAPI support(#5779) - requires updated Net_Sieve class
- Added option managesieve_default_headers
- Added option managesieve_forward to enable settings dialog for simple forwarding (#6021)
- Support filter action with custom IMAP flags (#6011)

@ -62,7 +62,8 @@ class rcube_sieve
*/
public function __construct($username, $password='', $host='localhost', $port=2000,
$auth_type=null, $usetls=true, $disabled=array(), $debug=false,
$auth_cid=null, $auth_pw=null, $options=array())
$auth_cid=null, $auth_pw=null, $options=array(), $gssapi_principal=null,
$gssapi_cname=null)
{
$this->sieve = new Net_Sieve();
@ -70,6 +71,14 @@ class rcube_sieve
$this->sieve->setDebug(true, array($this, 'debug_handler'));
}
if (isset($gssapi_principal)) {
$this->sieve->setServicePrincipal($gssapi_principal);
}
if (isset($gssapi_cname)) {
$this->sieve->setServiceCN($gssapi_cname);
}
$result = $this->sieve->connect($host, $port, $options, $usetls);
if (is_a($result, 'PEAR_Error')) {

@ -195,7 +195,7 @@ class rcube_sieve_engine
'debug' => $this->rc->config->get('managesieve_debug', false),
'auth_cid' => $this->rc->config->get('managesieve_auth_cid'),
'auth_pw' => $this->rc->config->get('managesieve_auth_pw'),
'socket_options' => $this->rc->config->get('managesieve_conn_options'),
'socket_options' => $this->rc->config->get('managesieve_conn_options')
));
// Handle per-host socket options
@ -213,7 +213,9 @@ class rcube_sieve_engine
$plugin['debug'],
$plugin['auth_cid'],
$plugin['auth_pw'],
$plugin['socket_options']
$plugin['socket_options'],
$plugin['gssapi_context'],
$plugin['gssapi_cn']
);
$error = $this->sieve->error();

Loading…
Cancel
Save