Jump to content

Group


lancaster123

Recommended Posts

Hello

I have set up a module in my phpvms and when I link my button in the nav bar it show to everybody as normal but what I would like to do is only show the button to people in a group I have made up in the admin panel. I have found this but it doesn't work just returns and error on the line with the link on.

<?php

   if(Auth::UserInGroup('GroupName'))
{
echo '<li>Your link here</li>';
}

?>

Any ideas how to fix this?

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

   <?php
if(Auth::LoggedIn())
{
if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN))
   {
?>

<?php

       echo '<li><a href="'.fileurl('/admin').'" class="underline">Admin Center</a></li>';
   }
?>
   <?php
$admin = ExamsData::check_admin(Auth::$userinfo->pilotid);
		    if ($admin->admin_level >= '1')
		    {echo '<li><a href="'.url('/Exams_admin').'" >EXAMCenter Admin</a></li>';}
?>
<?php
}
?>

Something like that. Just change the access_admin part.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...