Topic: Making nav link items visible to only certain user groups

i.e.

'Administration' can only be seen by admins/mods. How could i make, say, 'User List' only visible to admins/mods?

Thanks

Re: Making nav link items visible to only certain user groups

http://punbb.org/forums/viewtopic.php?id=9520

3 (edited by liquidat0r 2006-11-08 21:33)

Re: Making nav link items visible to only certain user groups

Thanks. Guess I should have searched.

However, i was looking for a more general solution...

The same way as one would restrict access to a page

4 (edited by liquidat0r 2006-11-09 15:42)

Re: Making nav link items visible to only certain user groups

Thanks Mediator for help in IRC.

Simple really:

Comment out line: 245 in functions.php

And add:

$links[] = '<li id="navuserlist"><a href="userlist.php">'.$lang_common['User list'].'</a>';

after line 272 and before 278

Re: Making nav link items visible to only certain user groups

Just want to comment for anyone else reading this, that the solution above only removes the link, it does not stop guests etc accessing the page directly.

6 (edited by Tubby 2006-11-08 23:53)

Re: Making nav link items visible to only certain user groups

if ($pun_user['g_id'] <= PUN_MOD )
{
// code here
}

to sum it up

correct me if im wrong

Re: Making nav link items visible to only certain user groups

Moved to modifications.

Looking for a certain modification for your forum? Please take a look here before posting.

Re: Making nav link items visible to only certain user groups

Connorhd wrote:

Just want to comment for anyone else reading this, that the solution above only removes the link, it does not stop guests etc accessing the page directly.

Indeed. I also added

if ($pun_user['g_id'] > PUN_MOD) {    
message("You do not have access to this page");
}

To each of the pages that i wanted to remove access to.