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

RE: [cobalt-users] user and password files!!



Jonathan

Many thanks for your reply, it worked a treat.. I'm chuffed :)

Cheers mate

Steve

> 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
> 
> _______________________________________________
> cobalt-users mailing list
> cobalt-users@xxxxxxxxxxxxxxx
> To Subscribe or Unsubscribe, please go to:
> http://list.cobalt.com/mailman/listinfo/cobalt-users
>