[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] htaccess



on 4/18/00 1:51 AM, Myles Agnew at myles@xxxxxxxxxxxxxxx wrote:

> Hi All,
> Has anyone her used htaccess for to seprate groups/members ie
> GroupA goto Group A Directory
> GroupB goto Group B Directory

I haven't used htaccess for this, but I certainly have used PHP or PERL.

Basically, you can use either $REMOTE_USER (apache authentication,
accessible from PERL or php) or $PHP_AUTH_USER (php authentication) to
determine who they are, and then use that info to redirect them.

You can then parse the groups file, or better yet a database to find out
where they are supposed to go and take it from there.

ie.

$sql_query = "SELECT location FROM groups WHERE user =\"$PHP_AUTH_USER\"";
$sql_result = mysql_query($sql_query,$db);
$location = mysql_result($sql_result,0,"location");
header("Location: $location");

-k