Disable memberlist

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
gpr
Registered User
Posts: 4
Joined: Sat Apr 21, 2007 3:38 pm

Disable memberlist

Post by gpr »

Hi,

I want to disable the memberlist. I still want it to be there but only for admin to have the permission to. Is this possible and how?

Thanks v. much
ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Re: Disable memberlist

Post by ckwalsh »

Open {root}/memberlist.php
Find:

Code: Select all

init_userprefs($userdata);
After, add:

Code: Select all

if ($userdata['user_level'] == ADMIN)
{
	 redirect(append_sid("login.$phpEx?redirect=memberlist.$phpEx", true)); 
}
Where to post what | Forum Rules | The Dos and Don'ts of General Discussion
In Seattle and want to meet, chat, or have a coffee? Drop me a PM.
gpr
Registered User
Posts: 4
Joined: Sat Apr 21, 2007 3:38 pm

Re: Disable memberlist

Post by gpr »

Thanks

However this has done the opposite to what I intended :lol:

It will now let everyone view the memberlist except the admin.
Adavis
Registered User
Posts: 25
Joined: Wed Dec 31, 2003 1:53 pm

Re: Disable memberlist

Post by Adavis »

gpr wrote: Thanks

However this has done the opposite to what I intended :lol:

It will now let everyone view the memberlist except the admin.


Disable the links and visit the memberlist.php only you.
Adavis
gpr
Registered User
Posts: 4
Joined: Sat Apr 21, 2007 3:38 pm

Re: Disable memberlist

Post by gpr »

Yes I could just do that but anyone could still manually view the memberlist by typing http://xxx/memberlist.php
User avatar
Ash Hi Fi Zone
Registered User
Posts: 409
Joined: Fri Feb 09, 2007 11:55 am

Re: Disable memberlist

Post by Ash Hi Fi Zone »

There's a small mistake in the modification mentioned here by Brainy :
Brainy wrote: Open {root}/memberlist.php
Find:

Code: Select all

init_userprefs($userdata);
After, add:

Code: Select all

if ($userdata['user_level'] == ADMIN)
{
	 redirect(append_sid("login.$phpEx?redirect=memberlist.$phpEx", true)); 
}



The correct and proper one should be something like this :

Find :

Code: Select all

init_userprefs($userdata);
After, add:

Code: Select all

if ($userdata['user_level'] != ADMIN)
{
	if ($userdata['user_id'] == ANONYMOUS)
	{
		redirect(append_sid("login.$phpEx?redirect=memberlist.$phpEx", true));
	}
	else
	{
		message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
	}
}
gpr
Registered User
Posts: 4
Joined: Sat Apr 21, 2007 3:38 pm

Re: Disable memberlist

Post by gpr »

Brilliant! Thats done it.

Thanks alot 8)
Locked

Return to “2.0.x Support Forum”