aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_mail.inc.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 /include/functions_mail.inc.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 '')
-rw-r--r--include/functions_mail.inc.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/functions_mail.inc.php b/include/functions_mail.inc.php
index 529f2da0d..01a65091b 100644
--- a/include/functions_mail.inc.php
+++ b/include/functions_mail.inc.php
@@ -579,6 +579,7 @@ SELECT
* o theme: theme to use [default value $conf_mail['mail_theme']]
* o mail_title: main title of the mail [default value $conf['gallery_title']]
* o mail_subtitle: subtitle of the mail [default value subject]
+ * o auth_key: authentication key to add on footer link [default value null]
* @param array $tpl - use these options to define a custom content template file
* o filename
* o dirname (optional)
@@ -725,9 +726,15 @@ function pwg_mail($to, $args=array(), $tpl=array())
$template->set_filename('mail_header', 'header.tpl');
$template->set_filename('mail_footer', 'footer.tpl');
+ $add_url_params = array();
+ if (!empty($args['auth_key']))
+ {
+ $add_url_params['auth'] = $args['auth_key'];
+ }
+
$template->assign(
array(
- 'GALLERY_URL' => get_gallery_home_url(),
+ 'GALLERY_URL' => add_url_params(get_gallery_home_url(), $add_url_params),
'GALLERY_TITLE' => isset($page['gallery_title']) ? $page['gallery_title'] : $conf['gallery_title'],
'VERSION' => $conf['show_version'] ? PHPWG_VERSION : '',
'PHPWG_URL' => defined('PHPWG_URL') ? PHPWG_URL : '',