aboutsummaryrefslogtreecommitdiffstats
path: root/admin/notification_by_mail.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2016-01-04 19:54:40 +0100
committerplegall <plg@piwigo.org>2016-01-04 19:54:40 +0100
commit67e142f33197af955e179a1ad09b990ac80b6698 (patch)
tree914d524eb8f5ac3f92703e1f8790f74682d57bdf /admin/notification_by_mail.php
parentf2f9e5ecb7d6c16332aaccf8bc7b1c4248e6e889 (diff)
feature #392, add authentication key in NBM mails
There are many links in NBM (Notification By Mail, see screen [Administration > Users > Notification]). I had to change several functions to take this authentication key into account.
Diffstat (limited to 'admin/notification_by_mail.php')
-rw-r--r--admin/notification_by_mail.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/admin/notification_by_mail.php b/admin/notification_by_mail.php
index 38cadff6c..f146ba30f 100644
--- a/admin/notification_by_mail.php
+++ b/admin/notification_by_mail.php
@@ -289,13 +289,24 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l
if ($is_action_send)
{
+ $auth = null;
+ $add_url_params = array();
+
+ $auth_key = create_user_auth_key($nbm_user['user_id'], $nbm_user['status']);
+
+ if ($auth_key !== false)
+ {
+ $auth = $auth_key['auth_key'];
+ $add_url_params['auth'] = $auth;
+ }
+
set_make_full_url();
// Fill return list of "treated" check_key for 'send'
$return_list[] = $nbm_user['check_key'];
if ($conf['nbm_send_detailed_content'])
{
- $news = news($nbm_user['last_send'], $dbnow, false, $conf['nbm_send_html_mail']);
+ $news = news($nbm_user['last_send'], $dbnow, false, $conf['nbm_send_html_mail'], $auth);
$exist_data = count($news) > 0;
}
else
@@ -362,7 +373,7 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l
array
(
'TITLE' => get_title_recent_post_date($date_detail),
- 'HTML_DATA' => get_html_description_recent_post_date($date_detail)
+ 'HTML_DATA' => get_html_description_recent_post_date($date_detail, $auth)
)
);
}
@@ -373,7 +384,7 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l
array
(
'GOTO_GALLERY_TITLE' => $conf['gallery_title'],
- 'GOTO_GALLERY_URL' => get_gallery_home_url(),
+ 'GOTO_GALLERY_URL' => add_url_params(get_gallery_home_url(), $add_url_params),
'SEND_AS_NAME' => $env_nbm['send_as_name'],
)
);
@@ -389,6 +400,7 @@ function do_action_send_mail_notification($action = 'list_to_send', $check_key_l
'email_format' => $env_nbm['email_format'],
'content' => $env_nbm['mail_template']->parse('notification_by_mail', true),
'content_format' => $env_nbm['email_format'],
+ 'auth_key' => $auth,
)
);