mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-06 15:45:34 +02:00
adding more hashes
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8904 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
20f9b87f04
commit
e1d1c6039b
@ -232,23 +232,30 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
if ($mark_read == 'forums' || $mark_read == 'all')
|
||||
{
|
||||
$redirect = build_url('mark');
|
||||
|
||||
$token = request_var('hash', '');
|
||||
if (check_link_hash($token, 'global'))
|
||||
{
|
||||
if ($mark_read == 'all')
|
||||
{
|
||||
markread('all');
|
||||
|
||||
$message = sprintf($user->lang['RETURN_INDEX'], '<a href="' . $redirect . '">', '</a>');
|
||||
}
|
||||
else
|
||||
{
|
||||
markread('topics', $forum_ids);
|
||||
|
||||
$message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
|
||||
}
|
||||
|
||||
meta_refresh(3, $redirect);
|
||||
trigger_error($user->lang['FORUMS_MARKED'] . '<br /><br />' . $message);
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>');
|
||||
meta_refresh(3, $redirect);
|
||||
trigger_error($message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Grab moderators ... if necessary
|
||||
if ($display_moderators)
|
||||
@ -444,7 +451,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $root_data['forum_id'] . '&mark=forums') : '',
|
||||
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . '&f=' . $root_data['forum_id'] . '&mark=forums') : '',
|
||||
'S_HAS_SUBFORUM' => ($visible_forums) ? true : false,
|
||||
'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'],
|
||||
'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'))
|
||||
@ -989,7 +996,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
$table_sql = ($mode == 'forum') ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE;
|
||||
$where_sql = ($mode == 'forum') ? 'forum_id' : 'topic_id';
|
||||
$match_id = ($mode == 'forum') ? $forum_id : $topic_id;
|
||||
$u_url = "uid={$user->data['user_id']}&hash=" . generate_link_hash("{$mode}_$topic_id");
|
||||
$u_url = "uid={$user->data['user_id']}&hash=" . generate_link_hash("{$mode}_$match_id");
|
||||
$u_url .= ($mode == 'forum') ? '&f' : '&f=' . $forum_id . '&t';
|
||||
|
||||
// Is user watching this thread?
|
||||
@ -1059,7 +1066,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
|
||||
$token = request_var('hash', '');
|
||||
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
|
||||
|
||||
if ($_GET['watch'] == $mode && check_link_hash($token, "{$mode}_$topic_id"))
|
||||
if ($_GET['watch'] == $mode && check_link_hash($token, "{$mode}_$match_id"))
|
||||
{
|
||||
$is_watching = true;
|
||||
|
||||
|
@ -117,7 +117,7 @@ $template->assign_vars(array(
|
||||
'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
|
||||
'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,
|
||||
|
||||
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums') : '',
|
||||
'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums') : '',
|
||||
'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '')
|
||||
);
|
||||
|
||||
|
@ -172,9 +172,12 @@ if (!$auth->acl_get('f_read', $forum_id))
|
||||
|
||||
// Handle marking posts
|
||||
if ($mark_read == 'topics')
|
||||
{
|
||||
$token = request_var('hash', '');
|
||||
if (check_link_hash($token, 'global'))
|
||||
{
|
||||
markread('topics', $forum_id);
|
||||
|
||||
}
|
||||
$redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
|
||||
meta_refresh(3, $redirect_url);
|
||||
|
||||
@ -307,7 +310,7 @@ $template->assign_vars(array(
|
||||
'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", true, $user->session_id) : '',
|
||||
'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&f=' . $forum_id) : '',
|
||||
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&$u_sort_param" : '') . "&start=$start"),
|
||||
'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&mark=topics") : '',
|
||||
'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&f=$forum_id&mark=topics") : '',
|
||||
));
|
||||
|
||||
// Grab icons
|
||||
|
Loading…
x
Reference in New Issue
Block a user