Page 1 of 1

Disable showing of memberslist?

Posted: Tue Apr 22, 2003 1:20 pm
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

Posted: Tue Apr 22, 2003 1:24 pm
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']); 
}

Reply to flipper.

Posted: Tue Apr 22, 2003 5:22 pm
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

Restrict membership to Administrators MOD clarification?

Posted: Thu May 15, 2003 6:40 am
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

Posted: Thu May 15, 2003 8:39 am
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

viewtopic.php code at line911

Posted: Thu May 15, 2003 6:22 pm
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!

Posted: Thu May 15, 2003 6:40 pm
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

Posted: Thu May 15, 2003 8:55 pm
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

Posted: Fri Nov 26, 2004 2:20 am
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?

????

Posted: Fri Nov 26, 2004 5:32 am
by rtrev64
So what exactly are these codes changing to deny member seraches, register abuse?