Stealthbird97 Posted October 3, 2012 Report 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
Stealthbird97 Posted October 3, 2012 Author Report Posted October 3, 2012 Actually No that not it. But it must be close. Quote
Moderators Parkho Posted October 3, 2012 Moderators Report Posted October 3, 2012 <?php if(Auth::$userinfo->Rank == " FirstOfficer") { ?> <li><a href="<?php echo url('pages/discounts'); ?>">Discounts</a></li> <?php } ?> 1 Quote
Stealthbird97 Posted October 3, 2012 Author Report Posted October 3, 2012 Unfortunately that doesn't seem to work. Quote
Stealthbird97 Posted October 3, 2012 Author Report 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
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.