Results 1 to 5 of 5

Thread: PHP Login Admin Features

  1. #1
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default PHP Login Admin Features

    I have implemented the login script found here:
    http://www.evolt.org/PHP-Login-Syste...Admin-Features
    It works very well allowing only the admin to view the admin control panel. However, i want to be able to specify different user level's besides 1, and 9. For instance, i want a user to be able to access a certain page only if there user level is set to 5. Perhaps this question to too broad, and lacks posted code, but i am really not sure where to even begin in decoding the user level codes.
    Help is greatly appreciated.

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    find this:

    PHP Code:
    define("ADMIN_NAME""admin");
    define("GUEST_NAME""Guest");
    define("ADMIN_LEVEL"9);
    define("USER_LEVEL",  1);
    define("GUEST_LEVEL"0); 
    add your new user:

    PHP Code:
    define("ADMIN_NAME""admin");
    define("GUEST_NAME""Guest");
    define("POWER_NAME""Power User");
    define("ADMIN_LEVEL"9);
    define("USER_LEVEL",  1);
    define("GUEST_LEVEL"0);
    define("POWER_LEVEL"5); 
    That should get you started
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Feb 2008
    Posts
    90
    Thanks
    3
    Thanked 2 Times in 2 Posts

    Default

    I was able to find this in my code, however i do not want to specify the 'power_user' in my code. As it is now, in my admin control panel i can change the level of a user. I want to change a user to level to 5. And on another page if they are 5 or greater, they are able to view the contents.

  4. #4
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    By looking at Blizz's post, it appears that the user level is defined within some function / class.

    There are ways of referencing a function on a different page, by using commands within the specific page you wish to reference to.

    The only other way would be to use a database, however you would still require the function / class to access the database and validate the users appropriate permissions.

  5. #5
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    Yup,. and all instructions are listed on the page the OP linked too. Just have to read
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •