aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r--phpBB/includes/ucp/ucp_notifications.php38
-rw-r--r--phpBB/includes/ucp/ucp_pm.php24
-rw-r--r--phpBB/includes/ucp/ucp_profile.php9
3 files changed, 44 insertions, 27 deletions
diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php
index 5691302b83..b0aeaba227 100644
--- a/phpBB/includes/ucp/ucp_notifications.php
+++ b/phpBB/includes/ucp/ucp_notifications.php
@@ -95,35 +95,25 @@ class ucp_notifications
case 'notification_list':
default:
// Mark all items read
- if ($request->variable('mark', '') == 'all' && (confirm_box(true) || check_link_hash($request->variable('token', ''), 'mark_all_notifications_read')))
+ if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_notifications_read'))
{
- if (confirm_box(true))
- {
- $phpbb_notifications->mark_notifications_read(false, false, $user->data['user_id'], $form_time);
-
- meta_refresh(3, $this->u_action);
- $message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS'];
+ $phpbb_notifications->mark_notifications_read(false, false, $user->data['user_id'], $form_time);
- if ($request->is_ajax())
- {
- $json_response = new \phpbb\json_response();
- $json_response->send(array(
- 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
- 'MESSAGE_TEXT' => $message,
- 'success' => true,
- ));
- }
- $message .= '<br /><br />' . $user->lang('RETURN_UCP', '<a href="' . $this->u_action . '">', '</a>');
+ meta_refresh(3, $this->u_action);
+ $message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS'];
- trigger_error($message);
- }
- else
+ if ($request->is_ajax())
{
- confirm_box(false, 'NOTIFICATIONS_MARK_ALL_READ', build_hidden_fields(array(
- 'mark' => 'all',
- 'form_time' => $form_time,
- )));
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'success' => true,
+ ));
}
+ $message .= '<br /><br />' . $user->lang('RETURN_UCP', '<a href="' . $this->u_action . '">', '</a>');
+
+ trigger_error($message);
}
// Mark specific notifications read
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index 7a8c694870..425a56cf6c 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -45,7 +45,7 @@ class ucp_pm
function main($id, $mode)
{
- global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config;
+ global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config, $request;
if (!$user->data['is_registered'])
{
@@ -246,6 +246,27 @@ class ucp_pm
$folder_id = (int) $row['folder_id'];
}
+ if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_pms_read'))
+ {
+ mark_folder_read($user->data['user_id'], $folder_id);
+
+ meta_refresh(3, $this->u_action);
+ $message = $user->lang['PM_MARK_ALL_READ_SUCCESS'];
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'success' => true,
+ ));
+ }
+ $message .= '<br /><br />' . $user->lang('RETURN_UCP', '<a href="' . $this->u_action . '">', '</a>');
+
+ trigger_error($message);
+ }
+
$message_row = array();
if ($action == 'view_message' && $msg_id)
{
@@ -332,6 +353,7 @@ class ucp_pm
'U_SENTBOX' => $this->u_action . '&amp;folder=sentbox',
'U_CREATE_FOLDER' => $this->u_action . '&amp;mode=options',
'U_CURRENT_FOLDER' => $this->u_action . '&amp;folder=' . $folder_id,
+ 'U_MARK_ALL' => $this->u_action . '&amp;folder=' . $folder_id . '&amp;mark=all&amp;token=' . generate_link_hash('mark_all_pms_read'),
'S_IN_INBOX' => ($folder_id == PRIVMSGS_INBOX) ? true : false,
'S_IN_OUTBOX' => ($folder_id == PRIVMSGS_OUTBOX) ? true : false,
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 361dc831aa..a876d0133a 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -655,9 +655,14 @@ class ucp_profile
{
if (!empty($keys))
{
+ foreach ($keys as $key => $id)
+ {
+ $keys[$key] = $db->sql_like_expression($id . $db->get_any_char());
+ }
+ $sql_where = '(key_id ' . implode(' OR key_id ', $keys) . ')';
$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
WHERE user_id = ' . (int) $user->data['user_id'] . '
- AND ' . $db->sql_in_set('key_id', $keys) ;
+ AND ' . $sql_where ;
$db->sql_query($sql);
@@ -681,7 +686,7 @@ class ucp_profile
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('sessions', array(
- 'KEY' => $row['key_id'],
+ 'KEY' => substr($row['key_id'], 0, 8),
'IP' => $row['last_ip'],
'LOGIN_TIME' => $user->format_date($row['last_login']),
));