Disable showing of memberslist?

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
jchapman
Registered User
Posts: 3
Joined: Fri Apr 18, 2003 6:16 pm

Disable showing of memberslist?

Post by jchapman »

I have searched this forum, and performed the same search using google.com. If I have missed this information, PLEASE point me to the documentation.

I wish to disable the memberlist option, except for the administrator. Is there a recommended way to do this currently?

Thanks,

John Chapman
Flipper
Registered User
Posts: 436
Joined: Sun May 19, 2002 6:24 pm
Location: You are might here ->
Contact:

Post by Flipper »

You can use one of my MODs: Restrict Guest Access (link: http://www.phpbb.com/phpBB/viewtopic.php?t=72817 )

however change the code so that it reads:

Code: Select all

if ( !$userdata['session_logged_in'] ) 
{ 
redirect(append_sid("login.".$phpEx."?redirect=memberlist.".$phpEx, true)); 
exit; 
} 
else if ($userdata['user_level'] != ADMIN) 
{ 
   message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); 
}
~Flipper
_____
Website - #Team.SoC - A Call of Duty clan
No PM/IM Support given :)
jchapman
Registered User
Posts: 3
Joined: Fri Apr 18, 2003 6:16 pm

Reply to flipper.

Post by jchapman »

[quote="Flipper"]You can use one of my MODs: Restrict Guest Access (link: http://www.phpbb.com/phpBB/viewtopic.php?t=72817 )

however change the code so that it reads:
<snip>
quote]

Thank you flipper. I will work on this later this evening when I get time. I appreciate it.

John Chapman
ardri
Registered User
Posts: 5
Joined: Thu May 15, 2003 6:30 am

Restrict membership to Administrators MOD clarification?

Post by ardri »

Like John, I am trying to configure ver 2.0.4 to restrict Membership list access to administrators only. I followed the above MOD instructions -but would appreciate clarification on code change to the profile.php file :
My final copy looks like this, but I have wierd issues - the register function dosn't work - it keeps throwing up a blank log on dialog!

Many thanks!

// Begin 'Restrict Guest Access' MOD
$u = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? intval($HTTP_GET_VARS[POST_USERS_URL]) : intval($HTTP_POST_VARS[POST_USERS_URL]);

$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
if ( !$userdata['session_logged_in'] )
{
redirect(append_sid("login.".$phpEx."?redirect=memberlist.".$phpEx, true));
exit;
}
else if ($userdata['user_level'] != ADMIN)
{
message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
}
// End 'Restrict Guest Access' MOD
Flipper
Registered User
Posts: 436
Joined: Sun May 19, 2002 6:24 pm
Location: You are might here -&gt;
Contact:

Post by Flipper »

Opps that was my mistake, try the following code in profile.php:

Code: Select all

$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; 
if ( !$userdata['session_logged_in']  && $mode == 'viewprofile') 
{ 
      redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=viewprofile&".POST_USERS_URL."=".$u, true));
      exit; 
}
elseif ($userdata['user_level'] != ADMIN && $mode == 'viewprofile') 
{ 
message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); 
} 
// End 'Restrict Guest Access' MOD
~Flipper
_____
Website - #Team.SoC - A Call of Duty clan
No PM/IM Support given :)
ardri
Registered User
Posts: 5
Joined: Thu May 15, 2003 6:30 am

viewtopic.php code at line911

Post by ardri »

Thanks Flipper - the profile.php code is working great with the above fix. :D

It appears the tweak for viewtropic.php may need a quick clarification - applying the 'restrict_guest_111_mod' and the subsequent code below throws a parse error at line 968 - due I believe to the if condition loop being closed prematurely. Would you mind clarifying what the exact code should look like at line 911 pls!
Thanks!
Ardri
Flipper
Registered User
Posts: 436
Joined: Sun May 19, 2002 6:24 pm
Location: You are might here -&gt;
Contact:

Post by Flipper »

Having looked over the code, it should work fine. Remember it's only one line that needs changed and it's just adding to the IF conditional. There doesn't seem anything which could cause the code to break out of the IF statement.

P.S Any further issues should be added to this thread: http://www.phpbb.com/phpBB/viewtopic.php?t=72817
~Flipper
_____
Website - #Team.SoC - A Call of Duty clan
No PM/IM Support given :)
ardri
Registered User
Posts: 5
Joined: Thu May 15, 2003 6:30 am

Post by ardri »

It looks like I omitted the first { after the if statement - you may want to add it to your post - I think it was missing. Is this correct now?

Code: Select all

        if ( !$userdata['session_logged_in'] )
        {
                 {
                 redirect(append_sid("login.".$phpEx."?redirect=memberlist.".$phpEx, true));
                 exit;
                 }
                 else if ($userdata['user_level'] != ADMIN)
                 {
                  message_die(GENERAL_MESSAGE, $lang['Not_Authorised']);
                 }
Thanks again - I'll add to the other thread if anything new pops up
All the best - Ardri
Bradman
Registered User
Posts: 84
Joined: Mon Nov 11, 2002 6:39 am
Location: Ledyard, CT
Contact:

Post by Bradman »

Flipper wrote:

Code: Select all

else if ($userdata['user_level'] != ADMIN) 
{ 
   message_die(GENERAL_MESSAGE, $lang['Not_Authorised']); 
}

I'm not that great with PHP, so I'll ask. Doesn't this make it viewable by admin only?
User avatar
rtrev64
Registered User
Posts: 286
Joined: Wed Nov 24, 2004 5:35 am
Contact:

????

Post by rtrev64 »

So what exactly are these codes changing to deny member seraches, register abuse?
Locked

Return to “2.0.x Support Forum”