473,408 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

PHP authenticated login access and privlieges

Hi Enthusiasts of programming

I need to do system where in php and mysql system where the users have different roles and
they are given differnt privileges. example
when an admin logs in he has every menu displayed and he can access every page.
and when others login they can only see those menus and access those links which
the admin has given access to them.

Please anyone help me with the database structure and overview about the functionality to be performed.

I appologize for my poor language..

and thanks in advance
Aug 2 '08 #1
4 1511
coolsti
310 100+
What you can do is to create user groups and then assign users to these user groups. Then you can give access to various portions of your sight according to the user group. You can do this simply by checking the if the user is in a user group that has permission to access a page before you have PHP do the code to create the button that gives access to that page.

What I mean is, let us say user "dave" is logged in. Then when you build up your page that dave has requested, some of the buttons and functionalities on that page may need certain access permissions. You then check if dave is part of the group that has the correct access before these buttons and functionalities are displayed.

You can always make a database table that stores the assignements of users to usergroups.
Aug 2 '08 #2
What you can do is to create user groups and then assign users to these user groups. Then you can give access to various portions of your sight according to the user group. You can do this simply by checking the if the user is in a user group that has permission to access a page before you have PHP do the code to create the button that gives access to that page.

What I mean is, let us say user "dave" is logged in. Then when you build up your page that dave has requested, some of the buttons and functionalities on that page may need certain access permissions. You then check if dave is part of the group that has the correct access before these buttons and functionalities are displayed.

You can always make a database table that stores the assignements of users to usergroups.


Thank you very much. I hope that I understand what you had said. Create Users and assign them to Groups that have been assigned permissions.
and generate links to pages which they can access. But if some user with a little privilege gets a URL to remove a record , how to find such things and place
restrictions. I am also confused about making permissions and assigning them.

How to determine that this page should not be accessed by this user even though the user has manually typed in a URL which he has no access.
I need some advice on this.

Can you give me a picture of how that works. Thanks
Aug 4 '08 #3
I think of doing it this way, storing the file names in the database
and when the file is called, using the $_SERVER variable determine the
filename and check the permission and allow/restrict the user to the file

Pls anyone let me know whether I am going in the right way
or I have to do it in a better way.
Aug 8 '08 #4
Hi Everyone
I found an interesting site with the information what I was looking for menu/role based authenticated system. I thought it would be helpful for anyone who is searching for a similar one. thanks guys for all your replies.

http://www.tonymarston.net/php-mysql/menuguide/index.html

If anyother working on a similar thing. pls let me know.
Aug 11 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Sheela | last post by:
hi all, I'm searching all around the web without any good answer, maybe you have the right one. I'm trying to fill&send a form on a site authenticated https via curl. The problem is simply that...
3
by: Kristofer Liljeblad | last post by:
Hi, 1. How can I "terminate" an authenticated user? (I would like the server to redirect the user to the login page again. I'm using "forms authentication".) 2. Is it possible to enumerate...
0
by: SamIAm | last post by:
Hi I have the following in my web.config to specify that all my pages require authorization: <authentication mode="Forms"> <forms loginUrl="Login.aspx" timeout="60" path="/">
0
by: Gareth | last post by:
I cannot find a reference anywhere to anyone having done this successfully... can anyone enlighten me on how you get a SSL login page working with ASP.NET and forms authentication. I have...
1
by: David Gómez Gómez | last post by:
I have a web app running con COMPUTER1 called Proyectos. In web.config i have windows integrated authentication and: <authorization> <allow users="COMPUTER1\John" /> <allow users="COMPUTER1\Liz"...
1
by: Joe | last post by:
Hi, A part of our ASP website is password protected. People need to create accounts in order to gain access to the secured website. The username is email. After the user logs in a session cookie...
5
by: Shimon Sim | last post by:
I am working with LogIn control and need to set some property for profile after user is authenticated. I thought that LoggedIn event is the right place but system tells me that the property can't...
0
by: Keithb | last post by:
I am using the login control on my web site, which has both authenticated an unauthenticated users. I added a logout page that is supposed to allow an authenticated user to drop his authentication...
3
by: shapper | last post by:
Hello, I need to check if a user is authenticated. I tried everything I could think and find: If Membership.ValidateUser("shapper", "27lamps11") Then...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.