directory protection with php
Posted: Wed Apr 30, 2003 5:48 pm
Hi Folks,
I am new php developper in the community. Before posting I read some article about authentication, directory protection and did some research but I didn't find anything to solve my problem.
Let me explain my requirement:
This is how the website works and what I want:
there is an authentication with php/mysql (login/passwd). when the user is authenticated I know his group (eg: group1 or group2 or group3).
Now I have 3 directories which are group1 group2 and group3.
I would like users from group1 been able to access all the groups (group1, group2 and group3), user from group2 been able to access group2 and group3 and user form group3 been able to access only group3.
The last constraint is that I don't want to ask again for a login/pass (like .htaccess which ask for a login and pass).
The purpose of this restriction is that in each directories (group1, group2 and group3) there are images. I would like to avoid user to have access to their content by typing the path in the url (eg: http://www.mysite.com/group1/image1.png) That is why I need some restriction.
Is there any way to use php to protect access to these directory?
If you have any idea to implement that could you let me know.
Thank you very much for your help
Akeold
I am new php developper in the community. Before posting I read some article about authentication, directory protection and did some research but I didn't find anything to solve my problem.
Let me explain my requirement:
This is how the website works and what I want:
there is an authentication with php/mysql (login/passwd). when the user is authenticated I know his group (eg: group1 or group2 or group3).
Now I have 3 directories which are group1 group2 and group3.
I would like users from group1 been able to access all the groups (group1, group2 and group3), user from group2 been able to access group2 and group3 and user form group3 been able to access only group3.
The last constraint is that I don't want to ask again for a login/pass (like .htaccess which ask for a login and pass).
The purpose of this restriction is that in each directories (group1, group2 and group3) there are images. I would like to avoid user to have access to their content by typing the path in the url (eg: http://www.mysite.com/group1/image1.png) That is why I need some restriction.
Is there any way to use php to protect access to these directory?
If you have any idea to implement that could you let me know.
Thank you very much for your help
Akeold