Skip to content

Commit

Permalink
[jan] Show warning on S/MIME page if personal certificate has expired.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Feb 12, 2015
1 parent f7a0b71 commit 69dc29a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions imp/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v7.0.0-git
----------

[jan] Show warning on S/MIME page if personal certificate has expired.
[mjr] Improve support for vTodo iTip handling.
[mms] Add resent information to message header display.
[mms] Added an option to the mailboxList API call to force inclusion of
Expand Down
12 changes: 11 additions & 1 deletion imp/lib/Prefs/Special/SmimePrivateKey.php
Expand Up @@ -52,10 +52,20 @@ public function display(Horde_Core_Prefs_Ui $ui)
$view->has_key = ($prefs->getValue('smime_public_key') && $prefs->getValue('smime_private_key'));

if ($view->has_key) {
$smime = $injector->getInstance('IMP_Crypt_Smime');
$cert = $smime->parseCert($smime->getPersonalPublicKey());
if (!empty($cert['validity']['notafter'])) {
$expired = new Horde_Date($cert['validity']['notafter']);
if ($expired->before(time())) {
$view->expiredate = $expired->strftime($prefs->getValue('date_format'));
$view->expiretime = $expired->strftime($prefs->getValue('time_format'));
}
}

$view->viewpublic = Horde::link($smime_url->copy()->add('actionID', 'view_personal_public_key'), _("View Personal Public Certificate"), null, 'view_key');
$view->infopublic = Horde::link($smime_url->copy()->add('actionID', 'info_personal_public_key'), _("Information on Personal Public Certificate"), null, 'info_key');

if ($injector->getInstance('IMP_Crypt_Smime')->getPassphrase()) {
if ($smime->getPassphrase()) {
$view->passphrase = Horde::link($ui->selfUrl(array(
'special' => true,
'token' => true
Expand Down
1 change: 1 addition & 0 deletions imp/package.xml
Expand Up @@ -33,6 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] Show warning on S/MIME page if personal certificate has expired.
* [mjr] Improve support for vTodo iTip handling.
* [mms] Add resent information to message header display.
* [mms] Added an option to the mailboxList API call to force inclusion of unsubscribed mailboxes.
Expand Down
3 changes: 3 additions & 0 deletions imp/templates/prefs/smimeprivatekey.html.php
Expand Up @@ -11,6 +11,9 @@
<em class="prefsSmimeWarning"><?php echo _("S/MIME Personal Certificate support requires a secure web connection.") ?></em>
</div>
<?php elseif ($this->has_key): ?>
<?php if ($this->expiredate): ?>
<p class="prefsSmimeWarning"><?php printf(_("Your S/MIME Personal Certificate has expired on %s at %s."), $this->expiredate, $this->expiretime) ?></p>
<?php endif ?>
<div>
<table>
<tr>
Expand Down

0 comments on commit 69dc29a

Please sign in to comment.