aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2016-01-06 14:41:25 +0100
committerplegall <plg@piwigo.org>2016-01-06 14:41:25 +0100
commit646aa6f19a45618abaf35f1b889d421e9c184bc9 (patch)
tree96eff284a7f90fc24327cea3a9714a6b6e79365d /admin
parentaa581bd3dec54984845096e3a73d1ce72c6922bb (diff)
parent426e10e235689211fc52ee0077dce32ea3124bd6 (diff)
Merge branch 'feature/392-auth-keys'
Diffstat (limited to 'admin')
-rw-r--r--admin/album_notification.php26
-rw-r--r--admin/include/functions_notification_by_mail.inc.php14
-rw-r--r--admin/notification_by_mail.php18
3 files changed, 35 insertions, 23 deletions
diff --git a/admin/album_notification.php b/admin/album_notification.php
index cafaad170..4dd578b1a 100644
--- a/admin/album_notification.php
+++ b/admin/album_notification.php
@@ -54,6 +54,8 @@ if (isset($_POST['submitEmail']) and !empty($_POST['group']))
is empty find child representative_picture_id */
if (!empty($category['representative_picture_id']))
{
+ $img = array();
+
$query = '
SELECT id, file, path, representative_ext
FROM '.IMAGES_TABLE.'
@@ -65,21 +67,19 @@ SELECT id, file, path, representative_ext
{
$element = pwg_db_fetch_assoc($result);
- $img_url = '<a href="'.
- make_picture_url(array(
- 'image_id' => $element['id'],
- 'image_file' => $element['file'],
- 'category' => $category
- ))
- .'" class="thumblnk"><img src="'.DerivativeImage::url(IMG_THUMB, $element).'"></a>';
+ $img = array(
+ 'link' => make_picture_url(
+ array(
+ 'image_id' => $element['id'],
+ 'image_file' => $element['file'],
+ 'category' => $category
+ )
+ ),
+ 'src' => DerivativeImage::url(IMG_THUMB, $element),
+ );
}
}
- if (!isset($img_url))
- {
- $img_url = '';
- }
-
pwg_mail_group(
$_POST['group'],
array(
@@ -90,7 +90,7 @@ SELECT id, file, path, representative_ext
array(
'filename' => 'cat_group_info',
'assign' => array(
- 'IMG_URL' => $img_url,
+ 'IMG' => $img,
'CAT_NAME' => trigger_change('render_category_name', $category['name'], 'admin_cat_list'),
'LINK' => make_index_url(array(
'category' => array(
diff --git a/admin/include/functions_notification_by_mail.inc.php b/admin/include/functions_notification_by_mail.inc.php
index 8d0fe2621..7dc113b0f 100644
--- a/admin/include/functions_notification_by_mail.inc.php
+++ b/admin/include/functions_notification_by_mail.inc.php
@@ -125,12 +125,12 @@ select
U.'.$conf['user_fields']['username'].' as username,
U.'.$conf['user_fields']['email'].' as mail_address,
N.enabled,
- N.last_send
-from
- '.USER_MAIL_NOTIFICATION_TABLE.' as N,
- '.USERS_TABLE.' as U
-where
- N.user_id = U.'.$conf['user_fields']['id'];
+ N.last_send,
+ UI.status
+from '.USER_MAIL_NOTIFICATION_TABLE.' as N
+ JOIN '.USERS_TABLE.' as U on N.user_id = U.'.$conf['user_fields']['id'].'
+ JOIN '.USER_INFOS_TABLE.' as UI on UI.user_id = N.user_id
+where 1=1';
if ($action == 'send')
{
@@ -159,7 +159,7 @@ order by';
else
{
$query .= '
- username;';
+ username';
}
$query .= ';';
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,
)
);