#!/usr/local/bin/perl require '/httpd/cgi-bin/headfoot.pl'; if ($ENV{'SERVER_PORT'} eq "443") { print "Location:http://www.flash.net/domains\n\n"; } use Fcntl; use DB_File; read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); @in = split(/&/,$in); foreach $i (0 .. $#in) { $in[$i] =~ s/\+/ /g; ($key, $val) = split(/=/,$in[$i],2); $key =~ s/%(..)/pack("c",hex($1))/ge; $val =~ s/%(..)/pack("c",hex($1))/ge; $in{$key} .= "\0" if (defined($in{$key})); $in{$key} .= $val; foreach (keys %in) { $in{$_} =~ tr/"/ /; } } $in{'domain'} =~ /(^.+)/; $domain = $1; # $in{'ddomain'} =~ /(^.+)/; # $ddomain = $1; $ddomain = $in{'ddomain'}; if ($domain) { &get_info; } elsif ($ddomain) { &delete; } else { &startup; } ######################################################################## sub print_header { print "Content-type: text/html \n\n"; print "$header"; } ######################################################################## sub startup { &print_header; print <<_EOF_;
$footer _EOF_ exit; } ######################################################################## sub get_info { &print_header; print <<_EOF_;| VirtualHost | $h |
| SeverAdmin | webmaster\@$host |
| DocumentRoot | $rootdir |
| ServerName | \"$host\" |
| ServerAlias | $serveraliases www.$serveralias |
| TransferLog | "; if($logging eq "y"){ print "$access_log"; }else{ print "n/a"; } print " |
| ErrorLog | logs/error_log |