Jump to content

Recommended Posts

  • Moderators
Posted

hey all

i wanted to create sertain pages but only visible for a select user group in my dropdown.

i tried it with a modified version i found here on the forum but no luck annybody care to help me out here.

thanks

Posted

Auth::UserInGroup($groupname);

Would return a boolean, either true or false pertaining to whether a logged in user is in a group or not. Use it accordingly within an if statements as such:

if(Auth::UserInGroup('retired_pilots')){
	 echo "User is retired";
}

  • Moderators
Posted

hey thanks

i tried this

<?php
if(Auth::UserInGroup($Aero Club));
{
   if(Auth::UserInGroup('Aero Club'))
   {
    echo '<a href="<?php echo url('/content/aeroclub/'); ?>">Aero Club</a> ';
  }
?>
<?php
}
?>

but its giving me an T string error on the first line

Posted (edited)

if(Auth::UserInGroup($Aero Club));

Delete the semicolon ( ;)

edit: Just noticed you fixed it...sorry :)

Edited by Sava

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...