W.I.P. SMIME:

- Warn user if the SMIME private key is not configured
- Do not show smime actions in compose dialog if private key is not configured
This commit is contained in:
Hadi Nategh 2017-07-21 12:34:22 +02:00
parent dc943abfe5
commit 93b8b7ab6d
2 changed files with 28 additions and 16 deletions

View File

@ -212,23 +212,29 @@ class mail_compose
'onExecute' => 'javaScript:app.mail.compose_saveDraft2fm',
'hint' => 'Save the drafted message as eml file into VFS'
),
'smime_sign' => array (
'caption' => 'SMIME Sign',
'icon' => 'smimeSignature',
'group' => ++$group,
'onExecute' => 'javaScript:app.mail.compose_setToggle',
'checkbox' => true,
'hint' => 'Sign your message with smime certificate'
),
'smime_encrypt' => array (
'caption' => 'SMIME Encryption',
'icon' => 'smimeEncryption',
'group' => ++$group,
'onExecute' => 'javaScript:app.mail.compose_setToggle',
'checkbox' => true,
'hint' => 'Encrypt your message with smime certificate'
)
);
$credentials = Mail\Credentials::read($this->mail_bo->profileID, Mail\Credentials::SMIME, $GLOBALS['egw_info']['user']['account_id']);
if ($credentials['acc_smime_password'])
{
$actions = array_merge($actions, array(
'smime_sign' => array (
'caption' => 'SMIME Sign',
'icon' => 'smimeSignature',
'group' => ++$group,
'onExecute' => 'javaScript:app.mail.compose_setToggle',
'checkbox' => true,
'hint' => 'Sign your message with smime certificate'
),
'smime_encrypt' => array (
'caption' => 'SMIME Encryption',
'icon' => 'smimeEncryption',
'group' => ++$group,
'onExecute' => 'javaScript:app.mail.compose_setToggle',
'checkbox' => true,
'hint' => 'Encrypt your message with smime certificate'
)));
}
foreach (self::$priorities as $key => $priority)
{
$actions['prty']['children'][$key] = array(

View File

@ -3087,6 +3087,12 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
}
catch(Mail\Smime\PassphraseMissing $e)
{
$credentials = Mail\Credentials::read($this->mail_bo->profileID, Mail\Credentials::SMIME, $GLOBALS['egw_info']['user']['account_id']);
if (empty($credentials['acc_smime_password']))
{
self::callWizard($e->getMessage().' '.lang('Please configure your S/MIME private key in Encryption tab.'));
}
// do NOT include any default CSS
$smimeHtml = $this->get_email_header().
'<div class="smime-message">'.lang("This message is smime encrypted and password protected.").'</div>'.