Results 1 to 7 of 7
  1. #1

    User management in PHP

    Hi!

    I am developing an applicaton in PHP where different users would have different permissions and access to different functions/pages of website. Now whats the best way to do tht?

    One way I can think of is keep all permissions in a table and divide everyting on site into functions..and when every function is called, check whether thecurrent user has permission to particular function..

    But this method looks quiet complicated..is ther any other way to do this?

    Also if you can give me some links to articles/tutorials on user/levels management in PHP, it would be really helpful..

    Thanks in advance
    Wholesale Domain Prices for Retail Customers - Rushtoweb.com

  2. #2
    Join Date
    Apr 2005
    Location
    Berlin Heights, Ohio
    Posts
    21
    i think the easiest way is make a table with all the sections in it, and then have it say Yes or No or True or False, then if(Whatever == "True"){
    show content
    }elseif(Whatever == "False"){
    print "You are not authorized to use this feature.";
    }

    i dont know i think that would be the easiest way... maybe id be able to help you if you need it:
    [email protected] (email and MSN username)
    aim: k0n
    Last edited by rapture9; 04-13-2005 at 03:21 PM.

  3. #3
    Join Date
    Feb 2005
    Location
    Seattle, Washington
    Posts
    144
    PEAR::Auth makes this task very easy,
    http://pear.php.net/package/Auth
    Regards,
    Matthew Fonda
    PHP Developer

  4. #4
    Originally posted by mfonda
    PEAR::Auth makes this task very easy,
    http://pear.php.net/package/Auth
    Thanks Please send me some links to tutorials/examples etc on how to implement it

    rapture9, thanks .. actually this is how i guess we will show each page.. we also needed a system to manage users/leveles/groups/permissions etc..
    Wholesale Domain Prices for Retail Customers - Rushtoweb.com

  5. #5
    Join Date
    Feb 2005
    Location
    Seattle, Washington
    Posts
    144
    Thanks Please send me some links to tutorials/examples etc on how to implement it
    Click on the documentation button, then click End User Documentation, there is some tutorials/examples there.
    Regards,
    Matthew Fonda
    PHP Developer

  6. #6
    Join Date
    Apr 2005
    Location
    Berlin Heights, Ohio
    Posts
    21
    Originally posted by domainwala
    Thanks Please send me some links to tutorials/examples etc on how to implement it

    rapture9, thanks .. actually this is how i guess we will show each page.. we also needed a system to manage users/leveles/groups/permissions etc..
    right, set the true or false in the tables in a DB....
    check, on each section.. like say downloads, and the table name is downloads, check if the value is True for that user.... then use that code

  7. #7
    Join Date
    Mar 2002
    Location
    England
    Posts
    2,014
    I'd recommend creating a user management object, a usergroup table and a users table. However, the OOP approach, although making your code easier to manage, will require you to know a little about OOP techniques.
    <?php include_once('signature'); ?>

Posting Permissions

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