Stealthbird97 Posted October 3, 2012 Report Share Posted October 3, 2012 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? Quote Link to comment Share on other sites More sharing options...
Stealthbird97 Posted October 3, 2012 Author Report Share Posted October 3, 2012 Actually No that not it. But it must be close. Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 <?php if(Auth::$userinfo->Rank == " FirstOfficer") { ?> <li><a href="<?php echo url('pages/discounts'); ?>">Discounts</a></li> <?php } ?> 1 Quote Link to comment Share on other sites More sharing options...
Stealthbird97 Posted October 3, 2012 Author Report Share Posted October 3, 2012 Unfortunately that doesn't seem to work. Quote Link to comment Share on other sites More sharing options...
Stealthbird97 Posted October 3, 2012 Author Report Share Posted October 3, 2012 <?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') Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted October 3, 2012 Moderators Report Share Posted October 3, 2012 good 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.