On 1/26/06, J. Rhett Aultman <[EMAIL PROTECTED]> wrote:
> Apache users,
>
> I'm part of a project where we are trying to slightly change the
> behavior of the way the WebDAV module works.  Basically, our goal is to
> be able to create a number of directories under a given webroot
> (/.../htdocs/user1, /.../htdocs/user2, etc), and then make it such that
> each user's requests for file activities take place in their own little
> "sandbox".  Thus, the user "user1" requesting the file "/test.txt" gets
> the file from /.../htdocs/user1/test.txt and is unaware the file is
> coming from his own sandbox directory.  We want to do this in such a way
> that adding a new user doesn't require modifications to httpd.conf, as well.
>
> Our original plan was to require authentication to the root directory.
> This would put the user's id in a field in the request_rec structure.
> Then, we would modify the code in mod_dav.c to detect the user's id and
> rewrite the fields in the request_rec structure to point to a location
> inside the user's sandbox directory.  This seemed like a good idea at
> the time, but our attempts at implementing this haven't worked.  To be
> specific, our modifications seem to do nothing at all.  Specifically,
> we've been focusing on altering the function dav_get_resource( ) in
> mod_dav.c.  Within this function, we have tried rewriting the field
> r->uri and have also tried rewriting the field conf->dir.  In either
> case, the effect produced behavior identical to an unmodified copy of
> mod_dav.c.
>
> So, I have two questions: (1) Is there an easier way to do this?

I would do something like:

RewriteEngine On
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule (.*) /.../htdocs/%1$1 [PT]

I'm not sure if the [PT] is necessary, and I haven't actually tried
this, but it should work.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to