To Stop Guests from...

Solutions for other frequently encountered problems with running phpBB.

Moderator: Moderators

To Stop Guests from...

Postby UseLess on Mon Sep 12, 2005 10:06 pm

Greetings,

Important: If using a Free host then you will not be able to make the changes outlined here.

To stop Guests viewing the memberlist

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#

memberlist.php

#
#-----[ FIND ]------------------------------------------
#

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_VIEWMEMBERS);
init_userprefs($userdata);
//
// End session management
//

#
#-----[ AFTER, ADD ]------------------------------------------
#

//
// Stop anonymous viewing of memberlist
//
if (!$userdata['session_logged_in'])
{
   message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


To stop Guests viewing the User Groups

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#

groupcp.php

#
#-----[ FIND ]------------------------------------------
#

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_GROUPCP);
init_userprefs($userdata);
//
// End session management
//

#
#-----[ AFTER, ADD ]------------------------------------------
#

//
// Stop anonymous viewing of usergroups
//
if (!$userdata['session_logged_in'])
{
   message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


To stop Guests viewing the User Profiles

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#

profile.php

#
#-----[ FIND ]------------------------------------------
#

//
// Start of program proper
//
if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
   $mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
   $mode = htmlspecialchars($mode);

   if ( $mode == 'viewprofile' )
   {

#
#-----[ AFTER, ADD ]------------------------------------------
#

      //
      // Stop anonymous viewing of users profiles
      //
      if (!$userdata['session_logged_in'])
      {
         message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
      }

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


To stop Guests being able to search..

Code: Select all
#
#-----[ OPEN ]------------------------------------------
#

search.php

#
#-----[ FIND ]------------------------------------------
#

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_SEARCH);
init_userprefs($userdata);
//
// End session management

#
#-----[ AFTER, ADD ]------------------------------------------
#

//
// Stop anonymous searching
//
if (!$userdata['session_logged_in'])
{
   message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Movie Quote:
It's not the years honey, it's the mileage...

I do not provide any install services for phpBB, Mods or Styles.
Please do not pm me for support/scripting help - you won't get any reply. If you have a question then make a post in the appropriate forum.
User avatar
UseLess
Registered User
Registered User
 
Posts: 6220
Joined: Mon Sep 27, 2004 2:14 am
Location: North East, UK

Return to Common Problems

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron