On Tue, Aug 17, 2004 at 10:09:12PM -0700, Stas Bekman wrote: > >In Apache2, mod_userdir sets a note named "mod_userdir_user" in > >the r->notes table, so there is a way to detect if you are in a > >Userdir request (if using mod_userdir). However, that note only > >tells you the target user, not the path. > > Ah, cool, thanks, I was just about to look at userdir > > >The path is typically $HOME/public_html of the user, though > >that is configurable with the UserDir directive, so YMMV. > > So how do other applications that desire to rely on document_root get this > special userdir doc-root?
There is no direct way in the Apache C API. One might pull the mod_userdir server config (peeking through the veil and requiring too much knowledge of mod_userdir internals). Then you'd still have to perform getpwnam() again to get the user homedir and then add the mod_userdir suffix. Messy. Of course, mod_userdir is not the only module out there which might perform filesystem mapping. mod_rewrite, Alias directives, and other custom userdir modules (e.g. that look users up in a db) might be in the mix. What is/are the problem(s) we're trying to solve here? We can use "mod_userdir_user" to detect that it is a userdir request and that document_root does not apply, even if we can't get the userdir root path. We can't easily do the same for other mappings. With regards to mod_userdir, I had a thought about patching it to also provide "mod_userdir_group" and "mod_userdir_path" notes. Does that sound like a useful thing? Or, instead of in r->notes, this sort of userdir information seems useful for a new sub-struct in the request_rec. Wish me luck suggesting that on [EMAIL PROTECTED] :) Cheers, Glenn -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html