From e57c66f0d3736132e3040c7b3429f24f9a1dfa10 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 5 Apr 2018 11:55:25 +0000 Subject: [PATCH] Enigma: Add positiblity to modify list of identities for key generation by other plugins --- plugins/enigma/lib/enigma_ui.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/enigma/lib/enigma_ui.php b/plugins/enigma/lib/enigma_ui.php index 92b1e42d8c4..11bbdadffd6 100644 --- a/plugins/enigma/lib/enigma_ui.php +++ b/plugins/enigma/lib/enigma_ui.php @@ -721,7 +721,11 @@ function tpl_key_create_form($attrib) // get user's identities $identities = $this->rc->user->list_identities(null, true); $checkbox = new html_checkbox(array('name' => 'identity[]')); - foreach ((array) $identities as $idx => $ident) { + + $plugin = $this->rc->plugins->exec_hook('enigma_user_identities', array('identities' => $identities)); + $identities = $plugin['identities']; + + foreach ($identities as $idx => $ident) { $name = empty($ident['name']) ? ($ident['email']) : $ident['ident']; $attr = array('value' => $idx, 'data-name' => $ident['name'], 'data-email' => $ident['email']); $identities[$idx] = html::label(null, $checkbox->show($idx, $attr) . rcube::Q($name));