From 77888174cff00f8bdf8b0a4c04aca64b3fdcc5f4 Mon Sep 17 00:00:00 2001
From: plegall
Date: Fri, 29 Jan 2016 11:47:30 +0100
Subject: fixes #411, auth keys details on notification forms
---
admin/album_notification.php | 13 +++++++++++++
admin/notification_by_mail.php | 14 ++++++++++++++
admin/themes/default/template/album_notification.tpl | 7 +++++++
admin/themes/default/template/notification_by_mail.tpl | 10 ++++++++++
4 files changed, 44 insertions(+)
(limited to 'admin')
diff --git a/admin/album_notification.php b/admin/album_notification.php
index 492d555fd..fb2a1b027 100644
--- a/admin/album_notification.php
+++ b/admin/album_notification.php
@@ -205,6 +205,19 @@ $template->assign(
)
);
+if ($conf['auth_key_duration'] > 0)
+{
+ $template->assign(
+ 'auth_key_duration',
+ time_since(
+ strtotime('now -'.$conf['auth_key_duration'].' second'),
+ 'second',
+ null,
+ false
+ )
+ );
+}
+
// +-----------------------------------------------------------------------+
// | form construction |
// +-----------------------------------------------------------------------+
diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php
index cd61964d0..ca3d4127c 100644
--- a/admin/notification_by_mail.php
+++ b/admin/notification_by_mail.php
@@ -719,6 +719,20 @@ switch ($page['mode'])
}
}
$template->assign($page['mode'], $tpl_var);
+
+ if ($conf['auth_key_duration'] > 0)
+ {
+ $template->assign(
+ 'auth_key_duration',
+ time_since(
+ strtotime('now -'.$conf['auth_key_duration'].' second'),
+ 'second',
+ null,
+ false
+ )
+ );
+ }
+
break;
}
}
diff --git a/admin/themes/default/template/album_notification.tpl b/admin/themes/default/template/album_notification.tpl
index 8573cf16e..1b3aa73bd 100644
--- a/admin/themes/default/template/album_notification.tpl
+++ b/admin/themes/default/template/album_notification.tpl
@@ -101,6 +101,13 @@ span.errors {
+{if isset($auth_key_duration)}
+
+ {'Each email sent will contain its own automatic authentication key on links, valid for %s.'|translate:$auth_key_duration}
+ {'For security reason, authentication keys do not work for administrators.'|translate}
+
+{/if}
+
✘ {'No recipient selected'|translate}
diff --git a/admin/themes/default/template/notification_by_mail.tpl b/admin/themes/default/template/notification_by_mail.tpl
index 0be49bdd1..95506616c 100644
--- a/admin/themes/default/template/notification_by_mail.tpl
+++ b/admin/themes/default/template/notification_by_mail.tpl
@@ -127,6 +127,16 @@ jQuery(document).ready(function(){
+{if isset($auth_key_duration)}
+
+ {'Informations'|@translate}
+
+ {'Each email sent will contain its own automatic authentication key on links, valid for %s.'|translate:$auth_key_duration}
+ {'For security reason, authentication keys do not work for administrators.'|translate}
+
+
+{/if}
+
--
cgit v1.2.3