Merge remote-tracking branch 'nickvergessen/ticket/10237' into develop-olympus

* nickvergessen/ticket/10237:
  [ticket/10237] Display login-box for guests, when (un)subscribing
This commit is contained in:
Andreas Fischer 2011-11-11 22:07:11 +01:00
commit f3c9133a6c
3 changed files with 19 additions and 9 deletions

View file

@ -1084,6 +1084,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$match_id = ($mode == 'forum') ? $forum_id : $topic_id;
$u_url = "uid={$user->data['user_id']}";
$u_url .= ($mode == 'forum') ? '&f' : '&f=' . $forum_id . '&t';
$is_watching = 0;
// Is user watching this thread?
if ($user_id != ANONYMOUS)
@ -1110,9 +1111,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$uid = request_var('uid', 0);
$token = request_var('hash', '');
if (($token && check_link_hash($token, "{$mode}_$match_id")) || confirm_box(true))
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
if (($uid != $user_id) || ($_GET['unwatch'] != $mode))
if ($uid != $user_id || $_GET['unwatch'] != $mode)
{
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&start=$start");
$message = $user->lang['ERR_UNWATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
@ -1125,7 +1126,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$db->sql_query($sql);
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
$message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
$message = $user->lang['NOT_WATCHING_' . strtoupper($mode)] . '<br /><br />';
$message .= sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');
meta_refresh(3, $redirect_url);
trigger_error($message);
}
@ -1142,7 +1144,14 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$s_hidden_fields['t'] = $topic_id;
}
$confirm_box_message = (($item_title == '') ? 'UNWATCH_' . strtoupper($mode) : $user->lang('UNWATCH_' . strtoupper($mode) . '_DETAILED', $item_title));
if ($item_title == '')
{
$confirm_box_message = 'UNWATCH_' . strtoupper($mode);
}
else
{
$confirm_box_message = $user->lang('UNWATCH_' . strtoupper($mode) . '_DETAILED', $item_title);
}
confirm_box(false, $confirm_box_message, build_hidden_fields($s_hidden_fields));
}
}
@ -1167,9 +1176,9 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
$uid = request_var('uid', 0);
$token = request_var('hash', '');
if (($token && check_link_hash($token, "{$mode}_$match_id")) || confirm_box(true))
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
if (($uid != $user_id) || ($_GET['watch'] != $mode))
if ($uid != $user_id || $_GET['watch'] != $mode)
{
$redirect_url = append_sid("{$phpbb_root_path}view$mode.$phpEx", "$u_url=$match_id&amp;start=$start");
$message = $user->lang['ERR_WATCHING'] . '<br /><br />' . sprintf($user->lang['RETURN_' . strtoupper($mode)], '<a href="' . $redirect_url . '">', '</a>');

View file

@ -205,7 +205,7 @@ $s_watching_forum = array(
'is_watching' => false,
);
if (($config['email_enable'] || $config['jab_enable']) && $config['allow_forum_notify'] && $forum_data['forum_type'] == FORUM_POST && $auth->acl_get('f_subscribe', $forum_id))
if (($config['email_enable'] || $config['jab_enable']) && $config['allow_forum_notify'] && $forum_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_subscribe', $forum_id) || $user->data['user_id'] == ANONYMOUS))
{
$notify_status = (isset($forum_data['notify_status'])) ? $forum_data['notify_status'] : NULL;
watch_topic_forum('forum', $s_watching_forum, $user->data['user_id'], $forum_id, 0, $notify_status, $start, $forum_data['forum_name']);

View file

@ -493,9 +493,10 @@ $s_watching_topic = array(
'is_watching' => false,
);
if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_notify'] && $user->data['is_registered'])
if (($config['email_enable'] || $config['jab_enable']) && $config['allow_topic_notify'])
{
watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $topic_data['notify_status'], $start, $topic_data['topic_title']);
$notify_status = (isset($topic_data['notify_status'])) ? $topic_data['notify_status'] : null;
watch_topic_forum('topic', $s_watching_topic, $user->data['user_id'], $forum_id, $topic_id, $notify_status, $start, $topic_data['topic_title']);
// Reset forum notification if forum notify is set
if ($config['allow_forum_notify'] && $auth->acl_get('f_subscribe', $forum_id))