Hide Member list

The 2.0.x discussion forum has been locked; this will remain read-only. The 3.0.x discussion forum has been renamed phpBB Discussion.
John Thawley
Registered User
Posts: 14
Joined: Wed Jan 26, 2005 11:45 pm

Hide Member list

Post by John Thawley »

I would prefer my members list not be available for anyone other than Admin. Is there a way to do this?

Thanks,

John

alanapost
Registered User
Posts: 14
Joined: Wed Jan 26, 2005 7:49 pm
Contact:

Post by alanapost »

i need this as well

User avatar
Jim_UK
Former Team Member
Posts: 18478
Joined: Tue Oct 12, 2004 5:36 pm
Location: Darwen N.West UK

Post by Jim_UK »

This will stop none registered members from viewing it
open memberlist.php in a text editor

Find

Code: Select all

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

Code: Select all

//
// Begin 'Restrict Guest Access' MOD
if ( !$userdata['session_logged_in'] )
   {
      redirect(append_sid("login.".$phpEx."?redirect=memberlist.".$phpEx, true));
      exit;
   }
// End 'Restrict Guest Access' MOD
Jim

User avatar
-jm-
Former Team Member
Posts: 2024
Joined: Fri Jul 16, 2004 10:56 am
Location: Inside the mind of the machine
Contact:

Post by -jm- »

AFAIK you have two ways:

install admin userlist MOD by wGERIC and then remove memberlist.php and tpl files (so you will have only an empowered memberlist from ACP)


put at the top of memberlist.php a line of code that could force a message_die() if userlevel is not admin

better and less brutal than the first system.
-jm- (a.k.a. juanm) - *NO* private support
Hacked?
With so many beautiful colors in the world it’s a shame to make everything black and white - Dennis R. Little
my links: tips&stuff :: stuff only

alanapost
Registered User
Posts: 14
Joined: Wed Jan 26, 2005 7:49 pm
Contact:

Post by alanapost »

thanks very much; i just found http://www.phpbb.com/phpBB/viewtopic.ph ... memberlist and was going to link it in here but you guys covered it for me (:

John Thawley
Registered User
Posts: 14
Joined: Wed Jan 26, 2005 11:45 pm

Post by John Thawley »

I'm getting this error when I insert that piece of code:

Parse error: parse error in /docs/track/phpbb2/memberlist.php on line 37

This is when I click on Memberlist

John Thawley
Registered User
Posts: 14
Joined: Wed Jan 26, 2005 11:45 pm

Post by John Thawley »

Jim_UK wrote: This will stop none registered members from viewing it
open memberlist.php in a text editor

Find

Code: Select all

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

Code: Select all

//
// Begin 'Restrict Guest Access' MOD
if ( !$userdata['session_logged_in'] )
   {
      redirect(append_sid("login.".$phpEx."?redirect=memberlist.".$phpEx, true));
      exit;
   }
// End 'Restrict Guest Access' MOD
Jim


This code caused a error page/meesaage when I made the change and clicked on Meberlist -

Is this the intended outcome?

r_deckard9
Registered User
Posts: 38
Joined: Mon Feb 28, 2005 3:10 am
Contact:

Post by r_deckard9 »

This will stop none registered members from viewing it
open memberlist.php in a text editor

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


After add
Code:
//
// Begin 'Restrict Guest Access' MOD
if ( !$userdata['session_logged_in'] )
{
redirect(append_sid("login.".$phpEx."?redirect=memberlist.".$phpEx, true));
exit;
}
// End 'Restrict Guest Access' MOD


Jim


This worked for me however I noticed that if you still click a member link, you can still see their profile without having to login.
Is there a way to remedy this also?
Visit: http://www.theuniquegeek.com
for a geeked out forum.

SpacePower
Registered User
Posts: 66
Joined: Wed Mar 16, 2005 9:04 pm
Location: Berlin, EU
Contact:

Post by SpacePower »

r_deckard9 wrote: This worked for me however I noticed that if you still click a member link, you can still see their profile without having to login.
Is there a way to remedy this also?


Do exactly the same procedure at the profile.php and it should work. Just test it now. :lol:
Power to the Peaceful
My forum(s):
http://www.stayhuman.org/phpBB2
http://www.spearhead-home.com/phpBB2
My website:
Image

SpacePower
Registered User
Posts: 66
Joined: Wed Mar 16, 2005 9:04 pm
Location: Berlin, EU
Contact:

Post by SpacePower »

Correction. Not the same way because of the problem "Forget my password" which will bring you always to the login page. You have to do it this way:

#
#-----[ OPEN ]---------------------------------------------
#
profile.php

#
#-----[ FIND ]---------------------------------------------
#
if ( $mode == 'viewprofile' )
{

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


//
// Begin 'Restrict Guest Access' MOD
if ( !$userdata['session_logged_in'] )
{
redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=viewprofile", true));
}
// End 'Restrict Guest Access' MOD
Power to the Peaceful
My forum(s):
http://www.stayhuman.org/phpBB2
http://www.spearhead-home.com/phpBB2
My website:
Image

r_deckard9
Registered User
Posts: 38
Joined: Mon Feb 28, 2005 3:10 am
Contact:

Post by r_deckard9 »

It didn't work.
True, you can't see the user's profile but it just goes to a blank screen, no login screen.
You can see what I am referring to by visiting the site in my signature.
Visit: http://www.theuniquegeek.com
for a geeked out forum.

SpacePower
Registered User
Posts: 66
Joined: Wed Mar 16, 2005 9:04 pm
Location: Berlin, EU
Contact:

Post by SpacePower »

r_deckard9 wrote: It didn't work.
True, you can't see the user's profile but it just goes to a blank screen, no login screen.
You can see what I am referring to by visiting the site in my signature.


I see the blank screen. Suspicious. Check out my Testforum spearhead-home.com and find out that a guest is always redirected to the login.php if they try to watch the memberlist, click profile or if they try to click the profile botton at a posting. I using the latest version 2.0.13 (update from 2.0.10 to 13) and an self made style.

Maybe I can compare the php-files which are involved to this problem.

Is there someoneelse who can test if this works?
Power to the Peaceful
My forum(s):
http://www.stayhuman.org/phpBB2
http://www.spearhead-home.com/phpBB2
My website:
Image

User avatar
spiritdream
Registered User
Posts: 101
Joined: Sun Jan 09, 2005 11:29 pm
Location: MA
Contact:

Post by spiritdream »

Will this solution stop a member from accessing their own profile??? If it does, how could they make changes to their passwords, etc??

r_deckard9
Registered User
Posts: 38
Joined: Mon Feb 28, 2005 3:10 am
Contact:

Post by r_deckard9 »

Will this solution stop a member from accessing their own profile??? If it does, how could they make changes to their passwords, etc??


Ah, yes. I see the problem. I can't see my own profile. I also am using 2.0.13.
Luckily, I made a copy of the profile.php file before I made the change that I can revert back to.
Visit: http://www.theuniquegeek.com
for a geeked out forum.

SpacePower
Registered User
Posts: 66
Joined: Wed Mar 16, 2005 9:04 pm
Location: Berlin, EU
Contact:

Post by SpacePower »

spiritdream wrote: Will this solution stop a member from accessing their own profile??? If it does, how could they make changes to their passwords, etc??


No, it will stop guests watching profiles of registered users. Normally a guest at a forum can watch the memberlist and the profiles of registered users, if there are no modifications or admin restrictions. To prevent this there can be made the changes in the memberlist.php and the profile.php like described before.
Power to the Peaceful
My forum(s):
http://www.stayhuman.org/phpBB2
http://www.spearhead-home.com/phpBB2
My website:
Image

Locked

Return to “2.0.x Discussion”