aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewforum.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-02-11 02:16:28 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-02-11 02:16:28 +0000
commit67d98023355e9e14f88c595bca005243fb2235b4 (patch)
treeba5893f1d658f80df432c0e8fc58ae9ee2a565f0 /phpBB/viewforum.php
parentbd6bd36d489a4cf1d2da9e283a32ad20441b8843 (diff)
downloadforums-67d98023355e9e14f88c595bca005243fb2235b4.tar
forums-67d98023355e9e14f88c595bca005243fb2235b4.tar.gz
forums-67d98023355e9e14f88c595bca005243fb2235b4.tar.bz2
forums-67d98023355e9e14f88c595bca005243fb2235b4.tar.xz
forums-67d98023355e9e14f88c595bca005243fb2235b4.zip
Add a login redirect for users not logged in who attempt to visit restricted forums ... also shows a forum/post doesn't exist for hidden forums/topics/posts if user is logged in but not authed to view them
git-svn-id: file:///svn/phpbb/trunk@2079 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewforum.php')
-rw-r--r--phpBB/viewforum.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index aecc3e8c6b..9b8648140b 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -77,11 +77,10 @@ else
// If the query doesn't return any rows this isn't a valid forum. Inform
// the user.
//
-if( !$total_rows = $db->sql_numrows($result) )
+if( !($forum_row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'Forum_not_exist');
}
-$forum_row = $db->sql_fetchrow($result);
//
// Start session management
@@ -100,10 +99,15 @@ $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row);
if( !$is_auth['auth_read'] || !$is_auth['auth_view'] )
{
+ if ( !$userdata['session_logged_in'] )
+ {
+ $redirect = POST_FORUM_URL . "=$forum_id" . ( ( isset($start) ) ? "&start=$start" : "" );
+ header("Location: " . append_sid("posting.$phpEx?redirect=viewforum.$phpEx&$redirect", true));
+ }
//
// The user is not authed to read this forum ...
//
- $message = sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']);
+ $message = ( !$is_auth['auth_view'] ) ? $lang['Forum_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']);
message_die(GENERAL_MESSAGE, $message);
}