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
You are not logged in. Please login or register.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → 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
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
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
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.
if ($pun_user['g_id'] <= PUN_MOD )
{
// code here
}
to sum it up
correct me if im wrong
Moved to modifications.
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.
PunBB Forums → PunBB 1.2 modifications, plugins and integrations → Making nav link items visible to only certain user groups
Powered by PunBB, supported by Informer Technologies, Inc.