views:

18

answers:

2

What I would like to do is for my users to log in with http authentication. Based on their login username the working directory will be different.

I need to use http authentication because I don't want to interfere with the web application (drupal) that is in the users working directories.

I also don't the users to have access to the other users files.

What I visualize is a user loging in with http authentication, we will look up the username in my MySQL database and find out what their working directory should be. What will end up happening is that all user's urls will be the same (http://myhost/index.php) but they all will be accessing a different index.php.

I am comfortable with the php stuff. The thing that has me stumped is dynamically changing the working directory.

A: 

http://us.php.net/chdir

bool chdir (string $directory)

Changes PHP's current directory to $directory.

Spoom
+1  A: 

I would seriously consider giving them each a subdomain, and/or using something like mod_vhost_alias. However, a rewiterule with appending %{REMOTE_USER} (you are using http authentication after all) should do most of the work.

Wrikken
That looks really interesting, I'll check it out.
Icode4food