[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] user and password files!!
- Subject: RE: [cobalt-users] user and password files!!
- From: Sales - Way to the Web <sales@xxxxxxxxxxxxxxx>
- Date: Thu Oct 19 01:09:01 2000
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
Hello Steve,
> >$this_server = %ENV{HTTP_HOST};
>
> This would show the domain name they are entering from would it not??
Yes, it would. I misunderstood what you wanted ;-)
Try the following behind your .htaccess file. It's a bit of a hack, but
produces the results on the Cobalt RaQs:
#!/usr/bin/perl
opendir (DIR, "/home/sites");
while ($file = readdir (DIR)) {
$link = readlink ("/home/sites/$file");
if ($link) {
@levels = split (/\//,$link);
$domains{$levels[-1]} = $file;
}
}
closedir (DIR);
$user = $ENV{REMOTE_USER};
$shell = (getpwnam $user)[7];
if ($shell =~ /site\d+/) {$site = $&;} else {$site = "home";}
print "content-type: text/html\n\n";
print " User:[$user] Domain:[$domains{$site}]\n";
exit;
Regards,
Jonathan Michaelson
Way to the Web Ltd
Commercial CGI Scripting, Web Hosting
http://www.waytotheweb.com