This is a discussion on Per-file auth within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi all, I'm unsucessfull to find a way to do this : In a given folder I want to use ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi all,
I'm unsucessfull to find a way to do this : In a given folder I want to use Auth (LDAP based would be gread but basic sufficient). The folder contains one file per user. Each user shall only have access to the file named after him. I obviously don't want to generate a set of rule for each user but a global conf. Some kind of ninja RewriteCond maybe ? Thanks ! Nicolas -- Nicolas - 06 20 71 62 34 - http://nicolas.bouthors.org/album/ |
|
|||
|
Nicolas BOUTHORS a écrit :
> In a given folder I want to use Auth (LDAP based would be gread but > basic sufficient). The folder contains one file per user. Each user > shall only have access to the file named after him. I obviously don't > want to generate a set of rule for each user but a global conf. Anyone ? -- Nicolas Bouthors -=- Tel : 06 20 71 62 34 -=- Fax : 01 46 87 21 99 NBi SARL -=- http://nbi.fr -=- nbouthors@nbi.fr |
|
|||
|
Nicolas BOUTHORS schreef:
> Hi all, > > I'm unsucessfull to find a way to do this : > > In a given folder I want to use Auth (LDAP based would be gread but > basic sufficient). The folder contains one file per user. Each user > shall only have access to the file named after him. I obviously don't > want to generate a set of rule for each user but a global conf. > > Some kind of ninja RewriteCond maybe ? > > Thanks ! > > Nicolas > may be use mod_rewrite to rewrite the URL based on username? but this depends a bit on your statement "Each user shall only have access to the file named after him." -- Luuk |
|
|||
|
Luuk a écrit :
> may be use mod_rewrite to rewrite the URL based on username? That was one of my ideas, but I couldn't find how to implement. Care to give an example of how you see it ? > but this depends a bit on your statement > "Each user shall only have access to the file named after him." Bob can access the file named bob, and not the file jack. Jack can access the file named jack and not the file bob. N -- Nicolas Bouthors -=- Tel : 06 20 71 62 34 -=- Fax : 01 46 87 21 99 NBi SARL -=- http://nbi.fr -=- nbouthors@nbi.fr |
|
|||
|
Nicolas BOUTHORS schreef:
> Luuk a écrit : >> may be use mod_rewrite to rewrite the URL based on username? > > That was one of my ideas, but I couldn't find how to implement. Care to > give an example of how you see it ? > >> but this depends a bit on your statement >> "Each user shall only have access to the file named after him." > > Bob can access the file named bob, and not the file jack. > Jack can access the file named jack and not the file bob. > > N > maybe i was nog clear ;-) let met try to explain what i meant. if you redirect all users for that directory to index.php and your index.php looks like this: <?php include(getenv("REMOTE_USER").".html"); ?> Then, if jack logs on, he will see jack.html, and not bob.html and bob will see bob.html, and not jack.html a new user (i.e. susan) will work instantly, (after susan.html is created) -- Luuk |
|
|||
|
Luuk a écrit :
> and your index.php looks like this: > <?php > include(getenv("REMOTE_USER").".html"); > ?> Yeah yeah. I wanted to NOT need PHP. Hence posting in an Apache related forum. Your solution is trivial, but requires PHP. Cheers, N -- Nicolas Bouthors -=- Tel : 06 20 71 62 34 -=- Fax : 01 46 87 21 99 NBi SARL -=- http://nbi.fr -=- nbouthors@nbi.fr |
|
|||
|
Nicolas BOUTHORS schreef:
> Luuk a écrit : >> and your index.php looks like this: >> <?php >> include(getenv("REMOTE_USER").".html"); >> ?> > > Yeah yeah. I wanted to NOT need PHP. Hence posting in an Apache related > forum. Your solution is trivial, but requires PHP. > > Cheers, > N > The nice thing is, once you read the docs, you will see that mod_rewrite is also capable of using REMOTE_USER variable.... so, redirection, based on 'REMOTE_USER' is also possible without PHP (http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html) -- Luuk |
|
|||
|
Luuk a écrit :
> The nice thing is, once you read the docs, you will see that > mod_rewrite is also capable of using REMOTE_USER variable.... > > so, redirection, based on 'REMOTE_USER' is also possible without PHP > > (http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html) Yeah I know. But we are drifting away from the original question. Not a problem, I'll implement this as PHP. Cheers, Nico -- Nicolas Bouthors -=- Tel : 06 20 71 62 34 -=- Fax : 01 46 87 21 99 NBi SARL -=- http://nbi.fr -=- nbouthors@nbi.fr |
| Thread Tools | |
| Display Modes | |
|
|