Remove delegators' identities from pgp key generation form
This commit is contained in:
parent
5d6b3ef13d
commit
f422aa853f
1 changed files with 25 additions and 0 deletions
|
@ -59,6 +59,9 @@ class kolab_delegation extends rcube_plugin
|
|||
// delegation support in kolab_auth plugin
|
||||
$this->add_hook('kolab_auth_emails', array($this, 'kolab_auth_emails'));
|
||||
|
||||
// delegation support in Enigma plugin
|
||||
$this->add_hook('enigma_user_identities', array($this, 'user_identities'));
|
||||
|
||||
if ($this->rc->task == 'settings') {
|
||||
// delegation management interface
|
||||
$this->register_action('plugin.delegation', array($this, 'controller_ui'));
|
||||
|
@ -314,6 +317,28 @@ class kolab_delegation extends rcube_plugin
|
|||
return $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delegation support in Enigma plugin
|
||||
*/
|
||||
public function user_identities($args)
|
||||
{
|
||||
// Remove delegators' identities from the key generation form
|
||||
|
||||
if (!empty($_SESSION['delegators'])) {
|
||||
$args['identities'] = array_filter($args['identities'], function($ident) {
|
||||
foreach ($_SESSION['delegators'] as $emails) {
|
||||
if (in_array($ident['email'], $emails)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
return $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delegation UI handler
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue