Not Solved Page Manager + Usergroups
#1
Not Solved
Hi all,
I'm trying to restrict users from seeing a custom page in Page Manager. I'm not too good with php, could someone lend a hand - this is my code so far.


I want those usergroups restricting and everybody else permitted.


Quote:<?php



global $headerinclude, $header, $theme, $footer, $lang;


if(!$mybb->user['usergroup'] == "1") error_no_permission();
if(!$mybb->user['usergroup'] == "2") error_no_permission();
if(!$mybb->user['usergroup'] == "5") error_no_permission();
if(!$mybb->user['usergroup'] == "7") error_no_permission();


$template='<html>

<head>

<title>'.$pages['name'].'</title>

{$headerinclude}

</head>

<body>

{$header}


test



{$footer}

</body>

</html>';



$template=str_replace("\'", "'", addslashes($template));



add_breadcrumb($pages['name']);



eval("\$page=\"".$template."\";");



output_page($page);


?>
Reply
#2
Not Solved
Change the 4 lines to:
if(in_array($mybb->user['usergroup'], array(1, 2, 5, 7)))
error_no_permission();
Reply
#3
Not Solved
Worked perfectly. Thank you so much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)