Page 1 of 1

Disable memberlist

Posted: Sat Apr 21, 2007 3:43 pm
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

Re: Disable memberlist

Posted: Sat Apr 21, 2007 4:03 pm
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)); 
}

Re: Disable memberlist

Posted: Sat Apr 21, 2007 4:13 pm
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.

Re: Disable memberlist

Posted: Sat Apr 21, 2007 5:38 pm
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.

Re: Disable memberlist

Posted: Sat Apr 21, 2007 6:04 pm
by gpr
Yes I could just do that but anyone could still manually view the memberlist by typing http://xxx/memberlist.php

Re: Disable memberlist

Posted: Sat Apr 21, 2007 6:07 pm
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');
	}
}

Re: Disable memberlist

Posted: Sat Apr 21, 2007 6:17 pm
by gpr
Brilliant! Thats done it.

Thanks alot 8)