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,6 +212,12 @@ class mail_compose
'onExecute' => 'javaScript:app.mail.compose_saveDraft2fm', 'onExecute' => 'javaScript:app.mail.compose_saveDraft2fm',
'hint' => 'Save the drafted message as eml file into VFS' 'hint' => 'Save the drafted message as eml file into VFS'
), ),
);
$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 ( 'smime_sign' => array (
'caption' => 'SMIME Sign', 'caption' => 'SMIME Sign',
'icon' => 'smimeSignature', 'icon' => 'smimeSignature',
@ -227,8 +233,8 @@ class mail_compose
'onExecute' => 'javaScript:app.mail.compose_setToggle', 'onExecute' => 'javaScript:app.mail.compose_setToggle',
'checkbox' => true, 'checkbox' => true,
'hint' => 'Encrypt your message with smime certificate' 'hint' => 'Encrypt your message with smime certificate'
) )));
); }
foreach (self::$priorities as $key => $priority) foreach (self::$priorities as $key => $priority)
{ {
$actions['prty']['children'][$key] = array( $actions['prty']['children'][$key] = array(

View File

@ -3087,6 +3087,12 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
} }
catch(Mail\Smime\PassphraseMissing $e) 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 // do NOT include any default CSS
$smimeHtml = $this->get_email_header(). $smimeHtml = $this->get_email_header().
'<div class="smime-message">'.lang("This message is smime encrypted and password protected.").'</div>'. '<div class="smime-message">'.lang("This message is smime encrypted and password protected.").'</div>'.