Jump to content

Recommended Posts

Posted

Can Someone tell me the code for only allowing only people above a certain rank to view a page.

I'm guessing it goes something kind off like this but i'm not sure.

<?php
 if(Auth::Rank() => FirstOfficer)
 {
 ?>
 <li><a href="<?php echo url('pages/discounts'); ?>">Discounts</a></li>
 <?php
 }
 ?>

Is this correct?

  • Moderators
Posted
<?php
	 if(Auth::$userinfo->Rank == " FirstOfficer")
	 {
	 ?>
	 <li><a href="<?php echo url('pages/discounts'); ?>">Discounts</a></li>
	 <?php
	 }
	 ?>

  • Like 1
Posted

<?php
	 if(Auth::$userinfo->Rank == " FirstOfficer")
	 {
	 ?>
	 <li><a href="<?php echo url('pages/discounts'); ?>">Discounts</a></li>
	 <?php
	 }
	 ?>

Amazing what a capital letter can do.

Its working now.

It should have been

if(Auth::$userinfo->rank == 'Senior Captain')

Not

if(Auth::$userinfo->Rank == 'Senior Captain')

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