[RevCMS] How to stop specific ranks viewing pages?

Results 1 to 12 of 12
  1. #1

    shout [RevCMS] How to stop specific ranks viewing pages?

    Hello, I'm current in the process of making my own Housekeeping, and I was trying to work out how to stop specific ranks viewing certain pages in the housekeeping

    E.g /addstaff only to rank 11 (owner)
    and if below rank 11 they would get sent back to the dashboard?

    I've seen the code before, but can't word it on google?


    Would be must appreciated!
    Last edited by Dannie; 25-10-14 at 09:52 PM. Reason: mis-spelling


  2. #2
    Account Upgraded | Title Enabled! Joe Richardson is offline
    MemberRank
    Feb 2013 Join Date
    485Posts

    Re: [RevCMS] How to stop specific ranks viewing pages?

    Here's the code

    Add this to the very top

    <?php
    if($_SESSION['user']['rank'] >= 6){
    ?>


    Add this to the very bottom,

    <?php } else{die('Can't View This Page.');} ?>
    Last edited by Joe Richardson; 25-10-14 at 10:12 PM.

  3. #3

    Re: [RevCMS] How to stop specific ranks viewing pages?

    Ill test this now, thanks x

    - - - Updated - - -

    No its still allowing me through!

  4. #4
    Account Upgraded | Title Enabled! Joe Richardson is offline
    MemberRank
    Feb 2013 Join Date
    485Posts

    Re: [RevCMS] How to stop specific ranks viewing pages?

    Quote Originally Posted by Dannie View Post
    Ill test this now, thanks x

    - - - Updated - - -

    No its still allowing me through!
    I updated the code since i missed a part.

    Tested and works fine for me

  5. #5

    Re: [RevCMS] How to stop specific ranks viewing pages?

    Omg thank youuuu, is they any way you can do a header location to /dash?

  6. #6
    Account Upgraded | Title Enabled! Joe Richardson is offline
    MemberRank
    Feb 2013 Join Date
    485Posts

    Re: [RevCMS] How to stop specific ranks viewing pages?

    Quote Originally Posted by Dannie View Post
    Omg thank youuuu, is they any way you can do a header location to /dash?
    What do you mean

  7. #7

    Re: [RevCMS] How to stop specific ranks viewing pages?

    Dont worry, I've done this, and i meant this <?php } else{die(header('Location: '.$_CONFIG['hotel']['url'].'/asebeta/index.php?url=dash'));;} ?>

  8. #8
    Account Upgraded | Title Enabled! Joe Richardson is offline
    MemberRank
    Feb 2013 Join Date
    485Posts

    Re: [RevCMS] How to stop specific ranks viewing pages?

    Quote Originally Posted by Dannie View Post
    Dont worry, I've done this, and i meant this <?php } else{die(header('Location: '.$_CONFIG['hotel']['url'].'/asebeta/index.php?url=dash'));;} ?>

    Ohh, that lol. Well, glad i could help.

  9. #9

    Re: [RevCMS] How to stop specific ranks viewing pages?

    Thread closed.

  10. #10
    Typescript XOXO LeChris is offline
    MemberRank
    Sep 2011 Join Date
    749Posts

    Re: [RevCMS] How to stop specific ranks viewing pages?

    If you wanted it to be cleaner code and not have to span from top to bottom just do.
    if ($_SESSION['user]['rank'] > minimum rank to view page) { } else { header('Location: /index'); exit; }

  11. #11

    Re: [RevCMS] How to stop specific ranks viewing pages?

    How about HK logging? like if a rank edits a user it gets logged in db?

  12. #12
    Valued Member GrateZ4 is offline
    MemberRank
    Jul 2014 Join Date
    145Posts

    Re: [RevCMS] How to stop specific ranks viewing pages?

    <?php
    $rank = $_SESSION['user']['rank']; // Gets the rank of your user
    if($rank <= '1')
    {
    echo 'You have to be VIP to enter this page!';
    die;
    }
    ?>



Advertisement