mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
upnp.cgi und status.cgi von Maniac eingebaut
IPSec aktualisiert git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@453 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
@@ -6,14 +6,13 @@
|
||||
#
|
||||
# (c) The SmoothWall Team
|
||||
#
|
||||
# $Id: status.cgi,v 1.6.2.7 2005/02/24 07:44:35 gespinasse Exp $
|
||||
#
|
||||
|
||||
use strict;
|
||||
|
||||
# enable only the following on debugging purpose
|
||||
#use warnings;
|
||||
#use CGI::Carp 'fatalsToBrowser';
|
||||
use warnings;
|
||||
use CGI::Carp 'fatalsToBrowser';
|
||||
|
||||
require '/var/ipfire/general-functions.pl';
|
||||
require "${General::swroot}/lang.pl";
|
||||
@@ -31,35 +30,45 @@ my %cgiparams=();
|
||||
# is also the name of the program
|
||||
my %servicenames =
|
||||
(
|
||||
$Lang::tr{'dhcp server'} => 'dhcpd',
|
||||
$Lang::tr{'web server'} => 'httpd',
|
||||
$Lang::tr{'cron server'} => 'fcron',
|
||||
$Lang::tr{'dns proxy server'} => 'dnsmasq',
|
||||
$Lang::tr{'logging server'} => 'syslogd',
|
||||
$Lang::tr{'kernel logging server'} => 'klogd',
|
||||
$Lang::tr{'ntp server'} => 'ntpd',
|
||||
$Lang::tr{'secure shell server'} => 'sshd',
|
||||
$Lang::tr{'vpn'} => 'pluto',
|
||||
$Lang::tr{'web proxy'} => 'squid',
|
||||
'OpenVPN' => 'openvpn'
|
||||
$Lang::tr{'dhcp server'} => 'dhcpd',
|
||||
$Lang::tr{'web server'} => 'httpd',
|
||||
$Lang::tr{'cron server'} => 'fcron',
|
||||
$Lang::tr{'dns proxy server'} => 'dnsmasq',
|
||||
$Lang::tr{'logging server'} => 'syslogd',
|
||||
$Lang::tr{'kernel logging server'} => 'klogd',
|
||||
$Lang::tr{'ntp server'} => 'ntpd',
|
||||
$Lang::tr{'secure shell server'} => 'sshd',
|
||||
$Lang::tr{'vpn'} => 'pluto',
|
||||
$Lang::tr{'web proxy'} => 'squid',
|
||||
'OpenVPN' => 'openvpn'
|
||||
);
|
||||
|
||||
my $iface = '';
|
||||
if (open(FILE, "${General::swroot}/red/iface"))
|
||||
{
|
||||
$iface = <FILE>;
|
||||
close FILE;
|
||||
chomp $iface;
|
||||
$iface = <FILE>;
|
||||
close FILE;
|
||||
chomp $iface;
|
||||
}
|
||||
$servicenames{"$Lang::tr{'intrusion detection system'} (RED)"} = "snort_${iface}";
|
||||
$servicenames{"$Lang::tr{'intrusion detection system'} (GREEN)"} = "snort_$netsettings{'GREEN_DEV'}";
|
||||
if ($netsettings{'ORANGE_DEV'} ne '') {
|
||||
$servicenames{"$Lang::tr{'intrusion detection system'} (ORANGE)"} = "snort_$netsettings{'ORANGE_DEV'}";
|
||||
$servicenames{"$Lang::tr{'intrusion detection system'} (ORANGE)"} = "snort_$netsettings{'ORANGE_DEV'}";
|
||||
}
|
||||
if ($netsettings{'BLUE_DEV'} ne '') {
|
||||
$servicenames{"$Lang::tr{'intrusion detection system'} (BLUE)"} = "snort_$netsettings{'BLUE_DEV'}";
|
||||
$servicenames{"$Lang::tr{'intrusion detection system'} (BLUE)"} = "snort_$netsettings{'BLUE_DEV'}";
|
||||
}
|
||||
|
||||
my %dhcpsettings=();
|
||||
my %netsettings=();
|
||||
my %dhcpinfo=();
|
||||
my %pppsettings=();
|
||||
my $output='';
|
||||
|
||||
&General::readhash("${General::swroot}/dhcp/settings", \%dhcpsettings);
|
||||
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
|
||||
&General::readhash("${General::swroot}/ppp/settings", \%pppsettings);
|
||||
|
||||
&Header::showhttpheaders();
|
||||
|
||||
&Header::getcgihash(\%cgiparams);
|
||||
@@ -80,16 +89,16 @@ my $lines = 0;
|
||||
my $key = '';
|
||||
foreach $key (sort keys %servicenames)
|
||||
{
|
||||
if ($lines % 2) {
|
||||
print "<tr bgcolor='${Header::table1colour}'>\n"; }
|
||||
else {
|
||||
print "<tr bgcolor='${Header::table2colour}'>\n"; }
|
||||
print "<td align='left'>$key</td>\n";
|
||||
my $shortname = $servicenames{$key};
|
||||
my $status = &isrunning($shortname);
|
||||
print "$status\n";
|
||||
print "</tr>\n";
|
||||
$lines++;
|
||||
if ($lines % 2) {
|
||||
print "<tr bgcolor='${Header::table1colour}'>\n"; }
|
||||
else {
|
||||
print "<tr bgcolor='${Header::table2colour}'>\n"; }
|
||||
print "<td align='left'>$key</td>\n";
|
||||
my $shortname = $servicenames{$key};
|
||||
my $status = &isrunning($shortname);
|
||||
print "$status\n";
|
||||
print "</tr>\n";
|
||||
$lines++;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +106,7 @@ print "</table></div>\n";
|
||||
|
||||
&Header::closebox();
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'memory'});
|
||||
&Header::openbox('100%', 'center', $Lang::tr{'memory'});
|
||||
print "<table><tr><td><table>";
|
||||
my $ram=0;
|
||||
my $size=0;
|
||||
@@ -110,8 +119,8 @@ my $cached=0;
|
||||
open(FREE,'/usr/bin/free |');
|
||||
while(<FREE>)
|
||||
{
|
||||
if ($_ =~ m/^\s+total\s+used\s+free\s+shared\s+buffers\s+cached$/ )
|
||||
{
|
||||
if ($_ =~ m/^\s+total\s+used\s+free\s+shared\s+buffers\s+cached$/ )
|
||||
{
|
||||
print <<END
|
||||
<tr>
|
||||
<td> </td>
|
||||
@@ -179,14 +188,14 @@ END
|
||||
;
|
||||
&Header::closebox();
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'disk usage'});
|
||||
print "<table>\n";
|
||||
&Header::openbox('100%', 'center', $Lang::tr{'disk usage'});
|
||||
print "<table width=66%>\n";
|
||||
open(DF,'/bin/df -B M -x rootfs|');
|
||||
while(<DF>)
|
||||
{
|
||||
if ($_ =~ m/^Filesystem/ )
|
||||
{
|
||||
print <<END
|
||||
if ($_ =~ m/^Filesystem/ )
|
||||
{
|
||||
print <<END
|
||||
<tr>
|
||||
<td align='left' class='boldbase'><b>$Lang::tr{'device'}</b></td>
|
||||
<td align='left' class='boldbase'><b>$Lang::tr{'mounted on'}</b></td>
|
||||
@@ -197,11 +206,11 @@ while(<DF>)
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
my ($device,$size,$used,$free,$percent,$mount) = split;
|
||||
print <<END
|
||||
}
|
||||
else
|
||||
{
|
||||
my ($device,$size,$used,$free,$percent,$mount) = split;
|
||||
print <<END
|
||||
<tr>
|
||||
<td>$device</td>
|
||||
<td>$mount</td>
|
||||
@@ -211,35 +220,217 @@ END
|
||||
<td>
|
||||
END
|
||||
;
|
||||
&percentbar($percent);
|
||||
print <<END
|
||||
&percentbar($percent);
|
||||
print <<END
|
||||
</td>
|
||||
<td align='right'>$percent</td>
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
close DF;
|
||||
print "<tr><td colspan='6'> \n<tr><td colspan='6'><h2>Inodes</h2>\n";
|
||||
|
||||
open(DF,'/bin/df -i -x rootfs|');
|
||||
while(<DF>)
|
||||
{
|
||||
if ($_ =~ m/^Filesystem/ )
|
||||
{
|
||||
print <<END
|
||||
<tr>
|
||||
<td align='left' class='boldbase'><b>$Lang::tr{'device'}</b></td>
|
||||
<td align='left' class='boldbase'><b>$Lang::tr{'mounted on'}</b></td>
|
||||
<td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td>
|
||||
<td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td>
|
||||
<td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td>
|
||||
<td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td>
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
my ($device,$size,$used,$free,$percent,$mount) = split;
|
||||
print <<END
|
||||
<tr>
|
||||
<td>$device</td>
|
||||
<td>$mount</td>
|
||||
<td align='right'>$size</td>
|
||||
<td align='right'>$used</td>
|
||||
<td align='right'>$free</td>
|
||||
<td>
|
||||
END
|
||||
;
|
||||
&percentbar($percent);
|
||||
print <<END
|
||||
</td>
|
||||
<td align='right'>$percent</td>
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
}
|
||||
}
|
||||
close DF;
|
||||
print "</table>\n";
|
||||
&Header::closebox();
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'uptime and users'});
|
||||
my $output = `/usr/bin/who`;
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'interfaces'});
|
||||
$output = `/sbin/ifconfig`;
|
||||
$output = &Header::cleanhtml($output,"y");
|
||||
|
||||
my @itfs = ('ORANGE','BLUE','GREEN');
|
||||
foreach my $itf (@itfs) {
|
||||
my $ColorName='';
|
||||
my $lc_itf=lc($itf);
|
||||
my $dev = $netsettings{"${itf}_DEV"};
|
||||
if ($dev){
|
||||
$ColorName = "${lc_itf}"; #dereference variable name...
|
||||
$output =~ s/$dev/<b><font color="$ColorName">$dev<\/font><\/b>/ ;
|
||||
}
|
||||
}
|
||||
|
||||
if (open(REDIFACE, "${General::swroot}/red/iface")) {
|
||||
my $lc_itf='red';
|
||||
my $reddev = <REDIFACE>;
|
||||
close(REDIFACE);
|
||||
chomp $reddev;
|
||||
$output =~ s/$reddev/<b><font color='red'>${reddev}<\/font><\/b>/;
|
||||
}
|
||||
print "<pre>$output</pre>\n";
|
||||
&Header::closebox();
|
||||
|
||||
|
||||
if ( $netsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $netsettings{'RED_TYPE'} eq "DHCP") {
|
||||
|
||||
print "<a name='reddhcp'/>\n";
|
||||
&Header::openbox('100%', 'left', "RED $Lang::tr{'dhcp configuration'}");
|
||||
if (-s "${General::swroot}/dhcpc/dhcpcd-$netsettings{'RED_DEV'}.info") {
|
||||
|
||||
&General::readhash("${General::swroot}/dhcpc/dhcpcd-$netsettings{'RED_DEV'}.info", \%dhcpinfo);
|
||||
|
||||
my $DNS1=`echo $dhcpinfo{'DNS'} | cut -f 1 -d ,`;
|
||||
my $DNS2=`echo $dhcpinfo{'DNS'} | cut -f 2 -d ,`;
|
||||
|
||||
my $lsetme=0;
|
||||
my $leasetime="";
|
||||
if ($dhcpinfo{'LEASETIME'} ne "") {
|
||||
$lsetme=$dhcpinfo{'LEASETIME'};
|
||||
$lsetme=($lsetme/60);
|
||||
if ($lsetme > 59) {
|
||||
$lsetme=($lsetme/60); $leasetime=$lsetme." Hour";
|
||||
} else {
|
||||
$leasetime=$lsetme." Minute";
|
||||
}
|
||||
if ($lsetme > 1) {
|
||||
$leasetime=$leasetime."s";
|
||||
}
|
||||
}
|
||||
my $rentme=0;
|
||||
my $rnwltime="";
|
||||
if ($dhcpinfo{'RENEWALTIME'} ne "") {
|
||||
$rentme=$dhcpinfo{'RENEWALTIME'};
|
||||
$rentme=($rentme/60);
|
||||
if ($rentme > 59){
|
||||
$rentme=($rentme/60); $rnwltime=$rentme." Hour";
|
||||
} else {
|
||||
$rnwltime=$rentme." Minute";
|
||||
}
|
||||
if ($rentme > 1){
|
||||
$rnwltime=$rnwltime."s";
|
||||
}
|
||||
}
|
||||
my $maxtme=0;
|
||||
my $maxtime="";
|
||||
if ($dhcpinfo{'REBINDTIME'} ne "") {
|
||||
$maxtme=$dhcpinfo{'REBINDTIME'};
|
||||
$maxtme=($maxtme/60);
|
||||
if ($maxtme > 59){
|
||||
$maxtme=($maxtme/60); $maxtime=$maxtme." Hour";
|
||||
} else {
|
||||
$maxtime=$maxtme." Minute";
|
||||
}
|
||||
if ($maxtme > 1) {
|
||||
$maxtime=$maxtime."s";
|
||||
}
|
||||
}
|
||||
|
||||
print "<table width='100%'>";
|
||||
if ($dhcpinfo{'HOSTNAME'}) {
|
||||
print "<tr><td width='30%'>$Lang::tr{'hostname'}</td><td>$dhcpinfo{'HOSTNAME'}.$dhcpinfo{'DOMAIN'}</td></tr>\n";
|
||||
} else {
|
||||
print "<tr><td width='30%'>$Lang::tr{'domain'}</td><td>$dhcpinfo{'DOMAIN'}</td></tr>\n";
|
||||
}
|
||||
print <<END
|
||||
<tr><td>$Lang::tr{'gateway'}</td><td>$dhcpinfo{'GATEWAY'}</td></tr>
|
||||
<tr><td>$Lang::tr{'primary dns'}</td><td>$DNS1</td></tr>
|
||||
<tr><td>$Lang::tr{'secondary dns'}</td><td>$DNS2</td></tr>
|
||||
<tr><td>$Lang::tr{'dhcp server'}</td><td>$dhcpinfo{'DHCPSIADDR'}</td></tr>
|
||||
<tr><td>$Lang::tr{'def lease time'}</td><td>$leasetime</td></tr>
|
||||
<tr><td>$Lang::tr{'default renewal time'}</td><td>$rnwltime</td></tr>
|
||||
<tr><td>$Lang::tr{'max renewal time'}</td><td>$maxtime</td></tr>
|
||||
</table>
|
||||
END
|
||||
;
|
||||
}
|
||||
else
|
||||
{
|
||||
print "$Lang::tr{'no dhcp lease'}";
|
||||
}
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
if ($dhcpsettings{'ENABLE_GREEN'} eq 'on' || $dhcpsettings{'ENABLE_BLUE'} eq 'on') {
|
||||
|
||||
print "<a name='leases'/>";
|
||||
&Header::CheckSortOrder;
|
||||
&Header::PrintActualLeases;
|
||||
}
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'routing table entries'});
|
||||
$output = `/sbin/route -n`;
|
||||
$output = &Header::cleanhtml($output,"y");
|
||||
print "<pre>$output</pre>\n";
|
||||
&Header::closebox();
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'arp table entries'});
|
||||
$output = `/sbin/arp -n`;
|
||||
$output = &Header::cleanhtml($output,"y");
|
||||
print "<pre>$output</pre>\n";
|
||||
&Header::closebox();
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'loaded modules'});
|
||||
$output = qx+/bin/lsmod+;
|
||||
($output = &Header::cleanhtml($output,"y")) =~ s/\[.*\]//g;
|
||||
print "<pre>\n$output\n</pre>\n";
|
||||
&Header::closebox();
|
||||
my $module = qx(/bin/lsmod | awk -F" " '{print \$1}');
|
||||
my $size = qx(/bin/lsmod | awk -F" " '{print \$2}');
|
||||
my $used = qx(/bin/lsmod | awk -F" " '{print \$3}');
|
||||
my @usedby = qx(/bin/lsmod | awk -F" " '{print \$4}');
|
||||
my @usedbyf;
|
||||
my $usedbyline;
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'kernel version'});
|
||||
print "<pre>\n";
|
||||
print `/bin/uname -a`;
|
||||
print "</pre>\n";
|
||||
foreach $usedbyline(@usedby)
|
||||
{
|
||||
my $laenge = length($usedbyline);
|
||||
|
||||
if ( $laenge > 30)
|
||||
{
|
||||
my $usedbylinef=substr($usedbyline,0,30);
|
||||
$usedbyline="$usedbylinef ...\n";
|
||||
push(@usedbyf,$usedbyline);
|
||||
}
|
||||
else
|
||||
{push(@usedbyf,$usedbyline);}
|
||||
}
|
||||
print <<END
|
||||
<table cellspacing=25><tr>
|
||||
<td><pre>$module</pre></td>
|
||||
<td><pre>$size</pre></td>
|
||||
<td><pre>$used</pre></td>
|
||||
<td><pre>@usedbyf</pre></td>
|
||||
</tr></table>
|
||||
END
|
||||
;
|
||||
|
||||
print "";
|
||||
&Header::closebox();
|
||||
|
||||
&Header::closebigbox();
|
||||
@@ -248,35 +439,35 @@ print "</pre>\n";
|
||||
|
||||
sub isrunning
|
||||
{
|
||||
my $cmd = $_[0];
|
||||
my $status = "<td bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
|
||||
my $pid = '';
|
||||
my $testcmd = '';
|
||||
my $exename;
|
||||
my $cmd = $_[0];
|
||||
my $status = "<td bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
|
||||
my $pid = '';
|
||||
my $testcmd = '';
|
||||
my $exename;
|
||||
|
||||
$cmd =~ /(^[a-z]+)/;
|
||||
$exename = $1;
|
||||
$cmd =~ /(^[a-z]+)/;
|
||||
$exename = $1;
|
||||
|
||||
if (open(FILE, "/var/run/${cmd}.pid"))
|
||||
{
|
||||
$pid = <FILE>; chomp $pid;
|
||||
close FILE;
|
||||
if (open(FILE, "/proc/${pid}/status"))
|
||||
{
|
||||
while (<FILE>)
|
||||
{
|
||||
if (/^Name:\W+(.*)/) {
|
||||
$testcmd = $1; }
|
||||
}
|
||||
close FILE;
|
||||
if ($testcmd =~ /$exename/)
|
||||
{
|
||||
$status = "<td bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (open(FILE, "/var/run/${cmd}.pid"))
|
||||
{
|
||||
$pid = <FILE>; chomp $pid;
|
||||
close FILE;
|
||||
if (open(FILE, "/proc/${pid}/status"))
|
||||
{
|
||||
while (<FILE>)
|
||||
{
|
||||
if (/^Name:\W+(.*)/) {
|
||||
$testcmd = $1; }
|
||||
}
|
||||
close FILE;
|
||||
if ($testcmd =~ /$exename/)
|
||||
{
|
||||
$status = "<td bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $status;
|
||||
return $status;
|
||||
}
|
||||
|
||||
sub percentbar
|
||||
|
||||
@@ -26,7 +26,7 @@ my %selected= () ;
|
||||
|
||||
my %servicenames =
|
||||
(
|
||||
'UPnP Daemon' => 'upnpd',
|
||||
'UPnP Daemon' => 'upnpd',
|
||||
);
|
||||
|
||||
&Header::showhttpheaders();
|
||||
@@ -42,8 +42,14 @@ $upnpsettings{'UPSTREAM'} = '16000000';
|
||||
$upnpsettings{'DESCRIPTION'} = 'gatedesc.xml';
|
||||
$upnpsettings{'XML'} = '/etc/linuxigd';
|
||||
$upnpsettings{'ENABLED'} = 'off';
|
||||
$upnpsettings{'GREEN'} = 'on';
|
||||
$upnpsettings{'BLUE'} = 'off';
|
||||
$upnpsettings{'GREENi'} = 'on';
|
||||
$upnpsettings{'BLUEi'} = 'off';
|
||||
$upnpsettings{'REDi'} = 'off';
|
||||
$upnpsettings{'ORANGEi'} = 'off';
|
||||
$upnpsettings{'GREENe'} = 'off';
|
||||
$upnpsettings{'BLUEe'} = 'off';
|
||||
$upnpsettings{'REDe'} = 'on';
|
||||
$upnpsettings{'ORANGEe'} = 'off';
|
||||
### Values that have to be initialized
|
||||
$upnpsettings{'ACTION'} = '';
|
||||
|
||||
@@ -60,9 +66,9 @@ if ($upnpsettings{'ACTION'} eq $Lang::tr{'save'})
|
||||
{
|
||||
&General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
|
||||
|
||||
open (FILE, ">${General::swroot}/upnp/upnpd.conf") or die "Can't save the upnp config: $!";
|
||||
flock (FILE, 2);
|
||||
|
||||
open (FILE, ">${General::swroot}/upnp/upnpd.conf") or die "Can't save the upnp config: $!";
|
||||
flock (FILE, 2);
|
||||
|
||||
print FILE <<END
|
||||
|
||||
# UPnP Config by Ipfire Project
|
||||
@@ -82,90 +88,144 @@ close FILE;
|
||||
}
|
||||
elsif ($upnpsettings{'ACTION'} eq 'Start')
|
||||
{
|
||||
$upnpsettings{'ENABLED'} = 'on';
|
||||
&General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
|
||||
system('/usr/local/bin/upnpctrl start');
|
||||
}
|
||||
$upnpsettings{'ENABLED'} = 'on';
|
||||
&General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
|
||||
system('/usr/local/bin/upnpctrl upnpdstart $netsettings{'RED_DEV'} $netsettings{'GREEN_DEV'}');
|
||||
}
|
||||
elsif ($upnpsettings{'ACTION'} eq 'Stop')
|
||||
{
|
||||
$upnpsettings{'ENABLED'} = 'off';
|
||||
&General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
|
||||
system('/usr/local/bin/upnpctrl stop');
|
||||
}
|
||||
$upnpsettings{'ENABLED'} = 'off';
|
||||
&General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
|
||||
system('/usr/local/bin/upnpctrl upnpstop');
|
||||
}
|
||||
elsif ($upnpsettings{'ACTION'} eq $Lang::tr{'restart'})
|
||||
{
|
||||
&General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
|
||||
system('/usr/local/bin/upnpctrl restart');
|
||||
&General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
|
||||
system('/usr/local/bin/upnpctrl upnpstop');
|
||||
system('/usr/local/bin/upnpctrl upnpstart $netsettings{'RED_DEV'} $netsettings{'GREEN_DEV'}');
|
||||
}
|
||||
|
||||
&General::readhash("${General::swroot}/upnp/settings", \%upnpsettings);
|
||||
|
||||
if ($errormessage) {
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
|
||||
print "<class name='base'>$errormessage\n";
|
||||
print " </class>\n";
|
||||
&Header::closebox();
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'error messages'});
|
||||
print "<class name='base'>$errormessage\n";
|
||||
print " </class>\n";
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
$checked{'GREEN'}{'on'} = '';
|
||||
$checked{'GREEN'}{'off'} = '';
|
||||
$checked{'GREEN'}{"$upnpsettings{'GREEN'}"} = 'checked';
|
||||
$checked{'BLUE'}{'on'} = '';
|
||||
$checked{'BLUE'}{'off'} = '';
|
||||
$checked{'BLUE'}{"$upnpsettings{'BLUE'}"} = 'checked';
|
||||
$checked{'GREENi'}{'on'} = '';
|
||||
$checked{'GREENi'}{'off'} = '';
|
||||
$checked{'GREENi'}{"$upnpsettings{'GREENi'}"} = 'checked';
|
||||
$checked{'BLUEi'}{'on'} = '';
|
||||
$checked{'BLUEi'}{'off'} = '';
|
||||
$checked{'BLUEi'}{"$upnpsettings{'BLUEi'}"} = 'checked';
|
||||
$checked{'REDi'}{'on'} = '';
|
||||
$checked{'REDi'}{'off'} = '';
|
||||
$checked{'REDi'}{"$upnpsettings{'REDi'}"} = 'checked';
|
||||
$checked{'ORANGEi'}{'on'} = '';
|
||||
$checked{'ORANGEi'}{'off'} = '';
|
||||
$checked{'ORANGEi'}{"$upnpsettings{'ORANGEi'}"} = 'checked';
|
||||
$checked{'GREENe'}{'on'} = '';
|
||||
$checked{'GREENe'}{'off'} = '';
|
||||
$checked{'GREENe'}{"$upnpsettings{'GREENe'}"} = 'checked';
|
||||
$checked{'BLUEe'}{'on'} = '';
|
||||
$checked{'BLUEe'}{'off'} = '';
|
||||
$checked{'BLUEe'}{"$upnpsettings{'BLUEe'}"} = 'checked';
|
||||
$checked{'REDe'}{'on'} = '';
|
||||
$checked{'REDe'}{'off'} = '';
|
||||
$checked{'REDe'}{"$upnpsettings{'REDe'}"} = 'checked';
|
||||
$checked{'ORANGEe'}{'on'} = '';
|
||||
$checked{'ORANGEe'}{'off'} = '';
|
||||
$checked{'ORANGEe'}{"$upnpsettings{'ORANGEe'}"} = 'checked';
|
||||
|
||||
############################################################################################################################
|
||||
############################################################################################################################
|
||||
|
||||
&Header::openbox('100%', 'center', 'UPnP');
|
||||
print <<END
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='400' cellspacing='0'>
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='95%' cellspacing='0'>
|
||||
END
|
||||
;
|
||||
if ( $message ne "" ) {
|
||||
print "<tr><td colspan='3' align='center'><font color='red'>$message</font>";
|
||||
}
|
||||
if ( $message ne "" ) {
|
||||
print "<tr><td colspan='3' align='center'><font color='red'>$message</font>";
|
||||
}
|
||||
|
||||
my $lines = 0;
|
||||
my $key = '';
|
||||
foreach $key (sort keys %servicenames)
|
||||
{
|
||||
if ($lines % 2) {
|
||||
print "<tr bgcolor='${Header::table1colour}'>\n"; }
|
||||
else {
|
||||
print "<tr bgcolor='${Header::table2colour}'>\n"; }
|
||||
print "<td align='left'>$key\n";
|
||||
my $shortname = $servicenames{$key};
|
||||
my $status = &isrunning($shortname);
|
||||
print "$status\n";
|
||||
$lines++;
|
||||
}
|
||||
print <<END
|
||||
<tr><td><b>Alle Dienste:</b></td><td colspan='2'>
|
||||
<input type='submit' name='ACTION' value='Start' />
|
||||
<input type='submit' name='ACTION' value='Stop' />
|
||||
<input type='submit' name='ACTION' value='$Lang::tr{'restart'}' />
|
||||
</table>
|
||||
</form>
|
||||
<hr />
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='500'>
|
||||
<tr><td colspan='2' align='left'><b>$Lang::tr{'options'}</b>
|
||||
<tr><td align='left'>$Lang::tr{'interfaces'}
|
||||
<td align='left'> <td><input type='checkbox' name='GREEN' $checked{'GREEN'}{'on'} /> <font size='2' color='$Header::colourgreen'><b>$Lang::tr{'green'} - $netsettings{'GREEN_DEV'}</b></font>
|
||||
END
|
||||
;
|
||||
if (&Header::blue_used()){
|
||||
my $lines = 0;
|
||||
my $key = '';
|
||||
foreach $key (sort keys %servicenames)
|
||||
{
|
||||
if ($lines % 2) {
|
||||
print "<tr bgcolor='${Header::table1colour}'>\n"; }
|
||||
else {
|
||||
print "<tr bgcolor='${Header::table2colour}'>\n"; }
|
||||
print "<td align='left'>$key\n";
|
||||
my $shortname = $servicenames{$key};
|
||||
my $status = &isrunning($shortname);
|
||||
print "$status\n";
|
||||
$lines++;
|
||||
}
|
||||
print <<END
|
||||
<tr><td align='left'> <td><input type='checkbox' name='BLUE' $checked{'BLUE'}{'on'} /> <font size='2' color='$Header::colourblue'><b>$Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'}</b></font>
|
||||
<tr><td><b>Alle Dienste:</b></td><td colspan='2'>
|
||||
<input type='submit' name='ACTION' value='Start' />
|
||||
<input type='submit' name='ACTION' value='Stop' />
|
||||
<input type='submit' name='ACTION' value='$Lang::tr{'restart'}' />
|
||||
</table>
|
||||
END
|
||||
;
|
||||
}
|
||||
print <<END
|
||||
</table>
|
||||
|
||||
#print <<END
|
||||
# <br></br>
|
||||
# <hr />
|
||||
# <br></br>
|
||||
#
|
||||
# <table width='95%'>
|
||||
# <tr><td colspan='2' align='left' bgcolor='${Header::table1colour}'><b>External Interface</b></td></tr>
|
||||
# <tr><td align='left'> </td><td><input type='radio' name='External' value='$netsettings{'RED_DEV'}' $checked{'REDe'}{'on'}><font size='2' color='$Header::colourred'><b>RED - $netsettings{'RED_DEV'}</b></font><br></br>
|
||||
# <input type='radio' name='External' value='$netsettings{'GREEN_DEV'}' $checked{'GREENe'}{'on'}><font size='2' color='$Header::colourgreen'><b>$Lang::tr{'green'} - $netsettings{'GREEN_DEV'}</b></font><br></br>
|
||||
#END
|
||||
#;
|
||||
# if (&Header::blue_used()){
|
||||
# print <<END
|
||||
# <input type='radio' name='External' value='$netsettings{'BLUE_DEV'}' $checked{'BLUEe'}{'on'}><font size='2' color='$Header::colourblue'><b>$Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'}</b></font><br></br>
|
||||
#END
|
||||
#;
|
||||
# }
|
||||
# if (&Header::orange_used()){
|
||||
# print <<END
|
||||
# <input type='radio' name='External' value='$netsettings{'ORANGE_DEV'}' $checked{'ORANGEe'}{'on'}><font size='2' color='$Header::colourorange'><b>$Lang::tr{'dmz'} - $netsettings{'ORANGE_DEV'}</b></font><br></br>
|
||||
#END
|
||||
#;
|
||||
# }
|
||||
# print <<END
|
||||
# </td></tr>
|
||||
# <tr><td colspan='2' align='left'><br></br></td></tr>
|
||||
# <tr><td colspan='2' align='left' bgcolor='${Header::table1colour}'><b>Internal Interface</b></td></tr>
|
||||
# <tr><td align='left'> </td><td><input type='radio' name='Internal' value='$netsettings{'RED_DEV'}' $checked{'REDi'}{'on'}><font size='2' color='$Header::colourred'><b>RED - $netsettings{'RED_DEV'}</b></font><br></br>
|
||||
# <input type='radio' name='Internal' value='$netsettings{'GREEN_DEV'}' $checked{'GREENi'}{'on'}><font size='2' color='$Header::colourgreen'><b>$Lang::tr{'green'} - $netsettings{'GREEN_DEV'}</b></font><br></br>
|
||||
#END
|
||||
#;
|
||||
# if (&Header::blue_used()){
|
||||
# print <<END
|
||||
# <input type='radio' name='Internal' value='$netsettings{'BLUE_DEV'}' $checked{'BLUEi'}{'on'}><font size='2' color='$Header::colourblue'><b>$Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'}</b></font><br></br>
|
||||
#END
|
||||
#;
|
||||
# }
|
||||
# if (&Header::orange_used()){
|
||||
# print <<END
|
||||
# <input type='radio' name='Internal' value='$netsettings{'ORANGE_DEV'}' $checked{'ORANGEi'}{'on'}><font size='2' color='$Header::colourorange'><b>$Lang::tr{'dmz'} - $netsettings{'ORANGE_DEV'}</b></font><br></br>
|
||||
#END
|
||||
#;
|
||||
# }
|
||||
# print <<END
|
||||
# </td></tr></table>
|
||||
print <<END
|
||||
</form>
|
||||
<br></br>
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='95%' cellspacing='0'>
|
||||
<tr><td colspan='2' align='left' bgcolor='${Header::table1colour}'><b>$Lang::tr{'options'}</b></td></tr>
|
||||
<tr><td colspan='2' align='left'><br></br></td></tr>
|
||||
<tr><td align='left'>Debug Mode:</td><td><input type='text' name='DEBUGMODE' value='$upnpsettings{'DEBUGMODE'}' size="30"></input></td></tr>
|
||||
<tr><td align='left'>Forward Rules:</td><td><input type='text' name='FORWARDRULES' value='$upnpsettings{'FORWARDRULES'}' size="30"></input></td></tr>
|
||||
<tr><td align='left'>Forward Chain:</td><td><input type='text' name='FORWARDCHAIN' value='$upnpsettings{'FORWARDCHAIN'}' size="30"></input></td></tr>
|
||||
@@ -174,6 +234,7 @@ END
|
||||
<tr><td align='left'>Up Strean:</td><td><input type='text' name='UPSTREAM' value='$upnpsettings{'UPSTREAM'}' size="30"></input></td></tr>
|
||||
<tr><td align='left'>Description Document:</td><td><input type='text' name='DESCRIPTION' value='$upnpsettings{'DESCRIPTION'}' size="30"></input></td></tr>
|
||||
<tr><td align='left'>XML Document:</td><td><input type='text' name='XML' value='$upnpsettings{'XML'}' size="30"></input></td></tr>
|
||||
<tr><td colspan='2' align='left'><br></br></td></tr>
|
||||
<tr><td colspan='2' align='center'><input type='submit' name='ACTION' value=$Lang::tr{'save'} />
|
||||
</table></form>
|
||||
<br></br>
|
||||
@@ -190,33 +251,33 @@ END
|
||||
|
||||
sub isrunning
|
||||
{
|
||||
my $cmd = $_[0];
|
||||
my $status = "<td bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
|
||||
my $pid = '';
|
||||
my $testcmd = '';
|
||||
my $exename;
|
||||
my $cmd = $_[0];
|
||||
my $status = "<td bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
|
||||
my $pid = '';
|
||||
my $testcmd = '';
|
||||
my $exename;
|
||||
|
||||
$cmd =~ /(^[a-z]+)/;
|
||||
$exename = $1;
|
||||
$cmd =~ /(^[a-z]+)/;
|
||||
$exename = $1;
|
||||
|
||||
if (open(FILE, "/var/run/${cmd}.pid"))
|
||||
{
|
||||
$pid = <FILE>; chomp $pid;
|
||||
close FILE;
|
||||
if (open(FILE, "/proc/${pid}/status"))
|
||||
{
|
||||
while (<FILE>)
|
||||
{
|
||||
if (/^Name:\W+(.*)/) {
|
||||
$testcmd = $1; }
|
||||
}
|
||||
close FILE;
|
||||
if ($testcmd =~ /$exename/)
|
||||
{
|
||||
$status = "<td bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (open(FILE, "/var/run/${cmd}.pid"))
|
||||
{
|
||||
$pid = <FILE>; chomp $pid;
|
||||
close FILE;
|
||||
if (open(FILE, "/proc/${pid}/status"))
|
||||
{
|
||||
while (<FILE>)
|
||||
{
|
||||
if (/^Name:\W+(.*)/) {
|
||||
$testcmd = $1; }
|
||||
}
|
||||
close FILE;
|
||||
if ($testcmd =~ /$exename/)
|
||||
{
|
||||
$status = "<td bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $status;
|
||||
}
|
||||
return $status;
|
||||
}
|
||||
@@ -1,25 +1,4 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# This file is part of the IPCop Firewall.
|
||||
#
|
||||
# IPCop is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# IPCop is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with IPCop; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# Copyright (C) 2003-05-25 Mark Wormgoor <mark@wormgoor.com>
|
||||
#
|
||||
# $Id: vpnmain.cgi,v 1.10.2.104 2006/11/30 12:43:10 franck78 Exp $
|
||||
#
|
||||
|
||||
use Net::DNS;
|
||||
use File::Copy;
|
||||
@@ -56,9 +35,6 @@ my $errormessage = '';
|
||||
|
||||
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
|
||||
$cgiparams{'ENABLED'} = 'off';
|
||||
$cgiparams{'ENABLED_GREEN'} = 'off';
|
||||
$cgiparams{'ENABLED_ORANGE'} = 'off';
|
||||
$cgiparams{'ENABLED_BLUE'} = 'off';
|
||||
$cgiparams{'EDIT_ADVANCED'} = 'off';
|
||||
$cgiparams{'ACTION'} = '';
|
||||
$cgiparams{'CA_NAME'} = '';
|
||||
@@ -124,10 +100,7 @@ sub valid_dns_host {
|
||||
### Just return true is one interface is vpn enabled
|
||||
###
|
||||
sub vpnenabled {
|
||||
return ($vpnsettings{'ENABLED'} eq 'on' ||
|
||||
$vpnsettings{'ENABLED_GREEN'} eq 'on' ||
|
||||
$vpnsettings{'ENABLED_ORANGE'} eq 'on' ||
|
||||
$vpnsettings{'ENABLED_BLUE'} eq 'on');
|
||||
return ($vpnsettings{'ENABLED'} eq 'on');
|
||||
}
|
||||
###
|
||||
### old version: maintain serial number to one, without explication.
|
||||
@@ -232,9 +205,6 @@ sub makeconnname ($) {
|
||||
### the side is always defined as 'left'.
|
||||
### configihash[14]: 'VHOST' is allowed
|
||||
###
|
||||
###Type=Net : GUI can choose to be left or right. This serve nothing in the conf!
|
||||
### interface is fixed to RED only. No special reason for this also.
|
||||
###
|
||||
|
||||
sub writeipsecfiles {
|
||||
my %lconfighash = ();
|
||||
@@ -249,11 +219,15 @@ sub writeipsecfiles {
|
||||
print CONF "version 2\n\n";
|
||||
print CONF "config setup\n";
|
||||
#create an ipsec Interface for each 'enabled' ones
|
||||
#loop trought configuration and add physical interfaces to the list
|
||||
my $interfaces = "\tinterfaces=\"";
|
||||
$interfaces .= "%defaultroute " if ($lvpnsettings{'ENABLED'} eq 'on');
|
||||
$interfaces .= "ipsec1=$netsettings{'GREEN_DEV'} " if ($lvpnsettings{'ENABLED_GREEN'} eq 'on');
|
||||
$interfaces .= "ipsec2=$netsettings{'BLUE_DEV'} " if ($lvpnsettings{'ENABLED_BLUE'} eq 'on');
|
||||
$interfaces .= "ipsec3=$netsettings{'ORANGE_DEV'} " if ($lvpnsettings{'ENABLED_ORANGE'} eq 'on');
|
||||
foreach my $key (keys %lconfighash) {
|
||||
next if ($lconfighash{$key}[0] ne 'on');
|
||||
$interfaces .= "%defaultroute " if ($interfaces !~ /defaultroute/ && $lconfighash{$key}[26] eq 'RED');
|
||||
$interfaces .= "ipsec1=$netsettings{'GREEN_DEV'} " if ($interfaces !~ /ipsec1/ && $lconfighash{$key}[26] eq 'GREEN');
|
||||
$interfaces .= "ipsec2=$netsettings{'BLUE_DEV'} " if ($interfaces !~ /ipsec2/ && $lconfighash{$key}[26] eq 'BLUE');
|
||||
$interfaces .= "ipsec3=$netsettings{'ORANGE_DEV'} " if ($interfaces !~ /ipsec3/ && $lconfighash{$key}[26] eq 'ORANGE');
|
||||
}
|
||||
print CONF $interfaces . "\"\n";
|
||||
|
||||
my $plutodebug = ''; # build debug list
|
||||
@@ -266,8 +240,6 @@ sub writeipsecfiles {
|
||||
# deprecated in ipsec.conf version 2
|
||||
#print CONF "\tplutoload=%search\n";
|
||||
#print CONF "\tplutostart=%search\n";
|
||||
print CONF "\tplutoload=%search\n";
|
||||
print CONF "\tplutostart=%search\n";
|
||||
print CONF "\tuniqueids=yes\n";
|
||||
print CONF "\tnat_traversal=yes\n";
|
||||
print CONF "\toverridemtu=$lvpnsettings{'VPN_OVERRIDE_MTU'}\n" if ($lvpnsettings{'VPN_OVERRIDE_MTU'} ne '');
|
||||
@@ -301,47 +273,39 @@ sub writeipsecfiles {
|
||||
#remote peer is not set? => use '%any'
|
||||
$lconfighash{$key}[10] = '%any' if ($lconfighash{$key}[10] eq '');
|
||||
|
||||
my ($L,$R); #Local & Remote sides
|
||||
|
||||
print CONF "conn $lconfighash{$key}[1]\n";
|
||||
#always choose LEFT localside for roadwarrior
|
||||
if ($lconfighash{$key}[3] eq 'host' || $lconfighash{$key}[6] eq 'left') {
|
||||
$L = 'left';
|
||||
$R = 'right';
|
||||
} else {
|
||||
$R = 'left';
|
||||
$L = 'right';
|
||||
}
|
||||
print CONF "\t${L}=";
|
||||
my $localside;
|
||||
if ($lconfighash{$key}[26] eq 'BLUE') {
|
||||
print CONF "$netsettings{'BLUE_ADDRESS'}\n";
|
||||
} elsif ($lconfighash{$key}[26] eq 'ORANGE') {
|
||||
print CONF "$netsettings{'ORANGE_ADDRESS'}\n";
|
||||
$localside = $netsettings{'BLUE_ADDRESS'};
|
||||
} elsif ($lconfighash{$key}[26] eq 'GREEN') {
|
||||
print CONF "$netsettings{'GREEN_ADDRESS'}\n";
|
||||
} elsif ($lconfighash{$key}[26] eq 'RED') {
|
||||
print CONF "$lvpnsettings{'VPN_IP'}\n";
|
||||
print CONF "\t${L}nexthop=%defaultroute\n" if ($lvpnsettings{'VPN_IP'} ne '%defaultroute');
|
||||
$localside = $netsettings{'GREEN_ADDRESS'};
|
||||
} elsif ($lconfighash{$key}[26] eq 'ORANGE') {
|
||||
$localside = $netsettings{'ORANGE_ADDRESS'};
|
||||
} else { # it is RED
|
||||
$localside = $lvpnsettings{'VPN_IP'};
|
||||
}
|
||||
print CONF "\t${L}subnet=$lconfighash{$key}[8]\n";
|
||||
print CONF "\t${R}=$lconfighash{$key}[10]\n";
|
||||
|
||||
print CONF "conn $lconfighash{$key}[1] #$lconfighash{$key}[26]\n";
|
||||
print CONF "\tleft=$localside\n";
|
||||
print CONF "\tleftnexthop=%defaultroute\n" if ($lconfighash{$key}[26] eq 'RED' && $lvpnsettings{'VPN_IP'} ne '%defaultroute');
|
||||
print CONF "\tleftsubnet=$lconfighash{$key}[8]\n";
|
||||
|
||||
print CONF "\tright=$lconfighash{$key}[10]\n";
|
||||
if ($lconfighash{$key}[3] eq 'net') {
|
||||
print CONF "\t${R}subnet=$lconfighash{$key}[11]\n";
|
||||
print CONF "\t${R}nexthop=%defaultroute\n";
|
||||
} elsif ($lconfighash{$key}[10] eq '%any' && $lconfighash{$key}[14] eq 'on') { #vhost allowed?
|
||||
print CONF "\trightsubnet=$lconfighash{$key}[11]\n";
|
||||
print CONF "\trightnexthop=%defaultroute\n";
|
||||
} elsif ($lconfighash{$key}[10] eq '%any' && $lconfighash{$key}[14] eq 'on') { #vhost allowed for roadwarriors?
|
||||
print CONF "\trightsubnet=vhost:%no,%priv\n";
|
||||
}
|
||||
|
||||
# Local Cert and Remote Cert (unless auth is DN dn-auth)
|
||||
if ($lconfighash{$key}[4] eq 'cert') {
|
||||
print CONF "\t${L}cert=${General::swroot}/certs/hostcert.pem\n";
|
||||
print CONF "\t${R}cert=${General::swroot}/certs/$lconfighash{$key}[1]cert.pem\n" if ($lconfighash{$key}[2] ne '%auth-dn');
|
||||
print CONF "\tleftcert=${General::swroot}/certs/hostcert.pem\n";
|
||||
print CONF "\trightcert=${General::swroot}/certs/$lconfighash{$key}[1]cert.pem\n" if ($lconfighash{$key}[2] ne '%auth-dn');
|
||||
}
|
||||
|
||||
# Local and Remote IDs
|
||||
print CONF "\t${L}id=\"$lconfighash{$key}[7]\"\n" if ($lconfighash{$key}[7]);
|
||||
print CONF "\t${R}id=\"$lconfighash{$key}[9]\"\n" if ($lconfighash{$key}[9]);
|
||||
print CONF "\tleftid=\"$lconfighash{$key}[7]\"\n" if ($lconfighash{$key}[7]);
|
||||
print CONF "\trightid=\"$lconfighash{$key}[9]\"\n" if ($lconfighash{$key}[9]);
|
||||
|
||||
# Algorithms
|
||||
if ($lconfighash{$key}[18] && $lconfighash{$key}[19] && $lconfighash{$key}[20]) {
|
||||
@@ -406,16 +370,6 @@ sub writeipsecfiles {
|
||||
# Build Authentication details: LEFTid RIGHTid : PSK psk
|
||||
my $psk_line;
|
||||
if ($lconfighash{$key}[4] eq 'psk') {
|
||||
my $localside;
|
||||
if ($lconfighash{$key}[26] eq 'BLUE') {
|
||||
$localside = $netsettings{'BLUE_ADDRESS'};
|
||||
} elsif ($lconfighash{$key}[26] eq 'GREEN') {
|
||||
$localside = $netsettings{'GREEN_ADDRESS'};
|
||||
} elsif ($lconfighash{$key}[26] eq 'ORANGE') {
|
||||
$localside = $netsettings{'ORANGE_ADDRESS'};
|
||||
} else { # it is RED
|
||||
$localside = $lvpnsettings{'VPN_IP'};
|
||||
}
|
||||
$psk_line = ($lconfighash{$key}[7] ? $lconfighash{$key}[7] : $localside) . " " ;
|
||||
$psk_line .= $lconfighash{$key}[9] ? $lconfighash{$key}[9] : $lconfighash{$key}[10]; #remoteid or remote address?
|
||||
$psk_line .= " : PSK '$lconfighash{$key}[5]'\n";
|
||||
@@ -472,7 +426,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'} && $cgiparams{'TYPE'} eq '' && $cg
|
||||
}
|
||||
|
||||
map ($vpnsettings{$_} = $cgiparams{$_},
|
||||
('ENABLED','ENABLED_GREEN','ENABLED_ORANGE','ENABLED_BLUE','DBG_CRYPT','DBG_PARSING','DBG_EMITTING','DBG_CONTROL',
|
||||
('ENABLED','DBG_CRYPT','DBG_PARSING','DBG_EMITTING','DBG_CONTROL',
|
||||
'DBG_KLIPS','DBG_DNS','DBG_NAT_T'));
|
||||
|
||||
$vpnsettings{'VPN_IP'} = $cgiparams{'VPN_IP'};
|
||||
@@ -881,7 +835,7 @@ END
|
||||
|
||||
# Create empty CRL cannot be done because we don't have
|
||||
# the private key for this CAROOT
|
||||
# Ipcop can only import certificates
|
||||
# IPFire can only import certificates
|
||||
|
||||
&General::log("ipsec", "p12 import completed!");
|
||||
&cleanssldatabase();
|
||||
@@ -1072,7 +1026,7 @@ END
|
||||
<table width='100%' border='0' cellspacing='1' cellpadding='0'>
|
||||
<tr><td width='40%' class='base'>$Lang::tr{'organization name'}:</td>
|
||||
<td width='60%' class='base' nowrap='nowrap'><input type='text' name='ROOTCERT_ORGANIZATION' value='$cgiparams{'ROOTCERT_ORGANIZATION'}' size='32' /></td></tr>
|
||||
<tr><td class='base'>$Lang::tr{'ipcops hostname'}:</td>
|
||||
<tr><td class='base'>$Lang::tr{'IPFires hostname'}:</td>
|
||||
<td class='base' nowrap='nowrap'><input type='text' name='ROOTCERT_HOSTNAME' value='$cgiparams{'ROOTCERT_HOSTNAME'}' size='32' /></td></tr>
|
||||
<tr><td class='base'>$Lang::tr{'your e-mail'}: <img src='/blob.gif' alt='*' /></td>
|
||||
<td class='base' nowrap='nowrap'><input type='text' name='ROOTCERT_EMAIL' value='$cgiparams{'ROOTCERT_EMAIL'}' size='32' /></td></tr>
|
||||
@@ -1186,10 +1140,10 @@ END
|
||||
&writeipsecfiles();
|
||||
system('/usr/local/bin/ipsecctrl', 'S', $cgiparams{'KEY'}) if (&vpnenabled);
|
||||
} else {
|
||||
system('/usr/local/bin/ipsecctrl', 'D', $cgiparams{'KEY'}) if (&vpnenabled);
|
||||
$confighash{$cgiparams{'KEY'}}[0] = 'off';
|
||||
&General::writehasharray("${General::swroot}/vpn/config", \%confighash);
|
||||
&writeipsecfiles();
|
||||
system('/usr/local/bin/ipsecctrl', 'D', $cgiparams{'KEY'}) if (&vpnenabled);
|
||||
}
|
||||
sleep $sleepDelay;
|
||||
} else {
|
||||
@@ -1278,7 +1232,7 @@ END
|
||||
$cgiparams{'TYPE'} = $confighash{$cgiparams{'KEY'}}[3];
|
||||
$cgiparams{'AUTH'} = $confighash{$cgiparams{'KEY'}}[4];
|
||||
$cgiparams{'PSK'} = $confighash{$cgiparams{'KEY'}}[5];
|
||||
$cgiparams{'SIDE'} = $confighash{$cgiparams{'KEY'}}[6];
|
||||
#$cgiparams{'free'} = $confighash{$cgiparams{'KEY'}}[6];
|
||||
$cgiparams{'LOCAL_ID'} = $confighash{$cgiparams{'KEY'}}[7];
|
||||
$cgiparams{'LOCAL_SUBNET'} = $confighash{$cgiparams{'KEY'}}[8];
|
||||
$cgiparams{'REMOTE_ID'} = $confighash{$cgiparams{'KEY'}}[9];
|
||||
@@ -1323,11 +1277,6 @@ END
|
||||
goto VPNCONF_ERROR;
|
||||
}
|
||||
|
||||
if (($cgiparams{'TYPE'} eq 'net') && ($cgiparams{'SIDE'} !~ /^(left|right)$/)) {
|
||||
$errormessage = $Lang::tr{'ipcop side is invalid'};
|
||||
goto VPNCONF_ERROR;
|
||||
}
|
||||
|
||||
# Check if there is no other entry with this name
|
||||
if (! $cgiparams{'KEY'}) { #only for add
|
||||
foreach my $key (keys %confighash) {
|
||||
@@ -1394,8 +1343,8 @@ END
|
||||
) {
|
||||
$errormessage = $Lang::tr{'invalid local-remote id'} . '<br />' .
|
||||
'DER_ASN1_DN: @c=FR/ou=Paris/ou=Home/cn=*<br />' .
|
||||
'FQDN: @ipcop.org<br />' .
|
||||
'USER_FQDN: franck@ipcop.org<br />' .
|
||||
'FQDN: @ipfire.org<br />' .
|
||||
'USER_FQDN: info@ipfire.org<br />' .
|
||||
'IPV4_ADDR: @123.123.123.123';
|
||||
goto VPNCONF_ERROR;
|
||||
}
|
||||
@@ -1786,7 +1735,6 @@ END
|
||||
$confighash{$key}[4] = 'cert';
|
||||
}
|
||||
if ($cgiparams{'TYPE'} eq 'net') {
|
||||
$confighash{$key}[6] = $cgiparams{'SIDE'};
|
||||
$confighash{$key}[11] = $cgiparams{'REMOTE_SUBNET'};
|
||||
}
|
||||
$confighash{$key}[7] = $cgiparams{'LOCAL_ID'};
|
||||
@@ -1813,6 +1761,7 @@ END
|
||||
$confighash{$key}[14] = $cgiparams{'VHOST'};
|
||||
|
||||
#free unused fields!
|
||||
$confighash{$key}[6] = 'off';
|
||||
$confighash{$key}[15] = 'off';
|
||||
|
||||
&General::writehasharray("${General::swroot}/vpn/config", \%confighash);
|
||||
@@ -1828,7 +1777,6 @@ END
|
||||
goto VPNCONF_END;
|
||||
} else { # add new connection
|
||||
$cgiparams{'ENABLED'} = 'on';
|
||||
$cgiparams{'SIDE'} = 'left';
|
||||
if ( ! -f "${General::swroot}/private/cakey.pem" ) {
|
||||
$cgiparams{'AUTH'} = 'psk';
|
||||
} elsif ( ! -f "${General::swroot}/ca/cacert.pem") {
|
||||
@@ -1878,24 +1826,11 @@ END
|
||||
$checked{'ENABLED'}{'off'} = '';
|
||||
$checked{'ENABLED'}{'on'} = '';
|
||||
$checked{'ENABLED'}{$cgiparams{'ENABLED'}} = "checked='checked'";
|
||||
$checked{'ENABLED_GREEN'}{'off'} = '';
|
||||
$checked{'ENABLED_GREEN'}{'on'} = '';
|
||||
$checked{'ENABLED_GREEN'}{$cgiparams{'ENABLED_GREEN'}} = "checked='checked'";
|
||||
$checked{'ENABLED_ORANGE'}{'off'} = '';
|
||||
$checked{'ENABLED_ORANGE'}{'on'} = '';
|
||||
$checked{'ENABLED_ORANGE'}{$cgiparams{'ENABLED_ORANGE'}} = "checked='checked'";
|
||||
$checked{'ENABLED_BLUE'}{'off'} = '';
|
||||
$checked{'ENABLED_BLUE'}{'on'} = '';
|
||||
$checked{'ENABLED_BLUE'}{$cgiparams{'ENABLED_BLUE'}} = "checked='checked'";
|
||||
|
||||
$checked{'EDIT_ADVANCED'}{'off'} = '';
|
||||
$checked{'EDIT_ADVANCED'}{'on'} = '';
|
||||
$checked{'EDIT_ADVANCED'}{$cgiparams{'EDIT_ADVANCED'}} = "checked='checked'";
|
||||
|
||||
$selected{'SIDE'}{'left'} = '';
|
||||
$selected{'SIDE'}{'right'} = '';
|
||||
$selected{'SIDE'}{$cgiparams{'SIDE'}} = "selected='selected'";
|
||||
|
||||
$checked{'AUTH'}{'psk'} = '';
|
||||
$checked{'AUTH'}{'certreq'} = '';
|
||||
$checked{'AUTH'}{'certgen'} = '';
|
||||
@@ -1964,69 +1899,53 @@ END
|
||||
print "<td width='25%'><input type='text' name='NAME' value='$cgiparams{'NAME'}' size='30' /></td>";
|
||||
}
|
||||
print "<td>$Lang::tr{'enabled'}</td><td><input type='checkbox' name='ENABLED' $checked{'ENABLED'}{'on'} /></td></tr>";
|
||||
print '</tr><td><br /></td><tr>';
|
||||
|
||||
my $disabled;
|
||||
my $blob;
|
||||
if ($cgiparams{'TYPE'} eq 'host') {
|
||||
$disabled = "disabled='disabled'";
|
||||
$blob = "<img src='/blob.gif' alt='*' />";
|
||||
};
|
||||
|
||||
print "<tr><td>$Lang::tr{'interface'}</td>";
|
||||
print "<td><select name='INTERFACE'>";
|
||||
print "<option value='RED' $selected{'INTERFACE'}{'RED'}>RED</option>";
|
||||
print "<option value='BLUE' $selected{'INTERFACE'}{'BLUE'}>BLUE</option>" if ($netsettings{'BLUE_DEV'} ne '');
|
||||
print "<option value='GREEN' $selected{'INTERFACE'}{'GREEN'}>GREEN</option>";
|
||||
# print "<option value='ORANGE' $selected{'INTERFACE'}{'ORANGE'}>ORANGE</option>";
|
||||
print "</select></td></tr>";
|
||||
print <<END
|
||||
<tr><td class='boldbase'>$Lang::tr{'local subnet'}</td>
|
||||
<td><input type='text' name='LOCAL_SUBNET' value='$cgiparams{'LOCAL_SUBNET'}' size='30' /></td>
|
||||
<td colspan='2'> </td>
|
||||
</tr><tr>
|
||||
<td class='boldbase'>$Lang::tr{'remote host/ip'}: <img src='/blob.gif' alt='*' /></td>
|
||||
print "<tr><td>$Lang::tr{'host ip'}:</td>";
|
||||
print "<td><select name='INTERFACE'>";
|
||||
print "<option value='RED' $selected{'INTERFACE'}{'RED'}>RED ($vpnsettings{'VPN_IP'})</option>";
|
||||
print "<option value='GREEN' $selected{'INTERFACE'}{'GREEN'}>GREEN ($netsettings{'GREEN_ADDRESS'})</option>";
|
||||
print "<option value='BLUE' $selected{'INTERFACE'}{'BLUE'}>BLUE ($netsettings{'BLUE_ADDRESS'})</option>" if ($netsettings{'BLUE_DEV'} ne '');
|
||||
print "<option value='ORANGE' $selected{'INTERFACE'}{'ORANGE'}>ORANGE ($netsettings{'ORANGE_ADDRESS'})</option>" if ($netsettings{'ORANGE_DEV'} ne '');
|
||||
print "</select></td>";
|
||||
print <<END
|
||||
<td class='boldbase'>$Lang::tr{'remote host/ip'}: $blob</td>
|
||||
<td><input type='text' name='REMOTE' value='$cgiparams{'REMOTE'}' size='30' /></td>
|
||||
<td colspan='2'> </td>
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
} else {
|
||||
print <<END
|
||||
<tr><td class='boldbase' nowrap='nowrap'>$Lang::tr{'ipcop side'}
|
||||
<input type='hidden' name='INTERFACE' value='RED' /></td>
|
||||
<td><select name='SIDE'><option value='left' $selected{'SIDE'}{'left'}>left</option>
|
||||
<option value='right' $selected{'SIDE'}{'right'}>right</option></select></td>
|
||||
<td class='boldbase'>$Lang::tr{'remote host/ip'}:</td>
|
||||
<td><input type='text' name='REMOTE' value='$cgiparams{'REMOTE'}' size ='30' /></td>
|
||||
</tr><tr>
|
||||
<td class='boldbase' nowrap='nowrap'>$Lang::tr{'local subnet'}</td>
|
||||
<td><input type='text' name='LOCAL_SUBNET' value='$cgiparams{'LOCAL_SUBNET'}' size='30' /></td>
|
||||
<td class='boldbase' nowrap='nowrap'>$Lang::tr{'remote subnet'}</td>
|
||||
<td><input type='text' name='REMOTE_SUBNET' value='$cgiparams{'REMOTE_SUBNET'}' size='30' /></td>
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
}
|
||||
print <<END
|
||||
<tr>
|
||||
<td>$Lang::tr{'dpd action'}:</td>
|
||||
<td><select name='DPD_ACTION'>
|
||||
<option value='clear' $selected{'DPD_ACTION'}{'clear'}>clear</option>
|
||||
<option value='hold' $selected{'DPD_ACTION'}{'hold'}>hold</option>
|
||||
<option value='restart' $selected{'DPD_ACTION'}{'restart'}>restart</option>
|
||||
</select> <a href='http://www.openswan.com/docs/local/README.DPD'>?</a>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td><input $disabled type='text' name='REMOTE_SUBNET' value='$cgiparams{'REMOTE_SUBNET'}' size='30' /></td>
|
||||
</tr><tr>
|
||||
<td class='boldbase'>$Lang::tr{'vpn local id'}: <img src='/blob.gif' alt='*' />
|
||||
<br />($Lang::tr{'eg'} <tt>@xy.example.com</tt>)</td>
|
||||
<td><input type='text' name='LOCAL_ID' value='$cgiparams{'LOCAL_ID'}' /></td>
|
||||
<td class='boldbase'>$Lang::tr{'vpn remote id'}: <img src='/blob.gif' alt='*' /></td>
|
||||
<td><input type='text' name='REMOTE_ID' value='$cgiparams{'REMOTE_ID'}' /></td>
|
||||
</tr><tr>
|
||||
</tr><td><br /></td><tr>
|
||||
<td>$Lang::tr{'dpd action'}:</td>
|
||||
<td><select name='DPD_ACTION'>
|
||||
<option value='clear' $selected{'DPD_ACTION'}{'clear'}>clear</option>
|
||||
<option value='hold' $selected{'DPD_ACTION'}{'hold'}>hold</option>
|
||||
<option value='restart' $selected{'DPD_ACTION'}{'restart'}>restart</option>
|
||||
</select> <a href='http://www.openswan.com/docs/local/README.DPD'>?</a>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<!--http://www.openswan.com/docs/local/README.DPD
|
||||
http://bugs.xelerance.com/view.php?id=156
|
||||
restart = clear + reinitiate connection
|
||||
-->
|
||||
<td><b>$Lang::tr{'options'}</b></td>
|
||||
</tr><tr>
|
||||
<td class='boldbase'>$Lang::tr{'vpn local id'}: <img src='/blob.gif' alt='*' />
|
||||
<br />($Lang::tr{'eg'} <tt>@xy.example.com</tt>)</td>
|
||||
<td><input type='text' name='LOCAL_ID' value='$cgiparams{'LOCAL_ID'}' /></td>
|
||||
<td class='boldbase'>$Lang::tr{'vpn remote id'}: <img src='/blob.gif' alt='*' /></td>
|
||||
<td><input type='text' name='REMOTE_ID' value='$cgiparams{'REMOTE_ID'}' /></td>
|
||||
</tr><tr>
|
||||
<td class='boldbase'>$Lang::tr{'remark title'} <img src='/blob.gif' alt='*' /></td>
|
||||
<td colspan='3'><input type='text' name='REMARK' value='$cgiparams{'REMARK'}' size='55' maxlength='50' /></td>
|
||||
</tr>
|
||||
<td class='boldbase'>$Lang::tr{'remark title'} <img src='/blob.gif' alt='*' /></td>
|
||||
<td colspan='3'><input type='text' name='REMARK' value='$cgiparams{'REMARK'}' size='55' maxlength='50' /></td>
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
if (!$cgiparams{'KEY'}) {
|
||||
@@ -2502,7 +2421,7 @@ EOF
|
||||
$cgiparams{'VPN_DELAYED_START'} = 0 if (! defined ($cgiparams{'VPN_DELAYED_START'}));
|
||||
$checked{'VPN_WATCH'} = $cgiparams{'VPN_WATCH'} eq 'on' ? "checked='checked'" : '' ;
|
||||
map ($checked{$_} = $cgiparams{$_} eq 'on' ? "checked='checked'" : '',
|
||||
('ENABLED','ENABLED_GREEN','ENABLED_ORANGE','ENABLED_BLUE','DBG_CRYPT','DBG_PARSING','DBG_EMITTING','DBG_CONTROL',
|
||||
('ENABLED','DBG_CRYPT','DBG_PARSING','DBG_EMITTING','DBG_CONTROL',
|
||||
'DBG_KLIPS','DBG_DNS','DBG_NAT_T'));
|
||||
|
||||
|
||||
@@ -2518,47 +2437,27 @@ EOF
|
||||
}
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'global settings'});
|
||||
my $checkbox="";
|
||||
print <<END
|
||||
<form method='post' action='$ENV{'SCRIPT_NAME'}'>
|
||||
<table width='100%'>
|
||||
<tr>
|
||||
<td width='20%' class='base' nowrap='nowrap'>$Lang::tr{'local vpn hostname/ip'}:</td>
|
||||
<td width='20%' class='base' nowrap='nowrap'>$Lang::tr{'vpn red name'}:</td>
|
||||
<td width='20%'><input type='text' name='VPN_IP' value='$cgiparams{'VPN_IP'}' /></td>
|
||||
<td width='20%' class='base'>$Lang::tr{'enabled'}<input type='checkbox' name='ENABLED' $checked{'ENABLED'} /></td>
|
||||
<td width='20%' class='base' nowrap='nowrap'>$Lang::tr{'vpn on green'}:</td>
|
||||
<td width='20%' class='base'>$Lang::tr{'enabled'}<input type='checkbox' name='ENABLED_GREEN' $checked{'ENABLED_GREEN'} /></td>
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
if ($netsettings{'ORANGE_DEV'} ne '') {
|
||||
$checkbox=<<END
|
||||
<td class='base' nowrap='nowrap'>$Lang::tr{'vpn on orange'}:</td>
|
||||
<td class='base'>$Lang::tr{'enabled'}<input type='checkbox' name='ENABLED_ORANGE' $checked{'ENABLED_ORANGE'} /></td>
|
||||
END
|
||||
;}
|
||||
|
||||
print <<END
|
||||
<tr>
|
||||
<td class='base' nowrap='nowrap'>$Lang::tr{'override mtu'}: <img src='/blob.gif' alt='*' /></td>
|
||||
<td ><input type='text' name='VPN_OVERRIDE_MTU' value='$cgiparams{'VPN_OVERRIDE_MTU'}' /></td>
|
||||
<td></td>
|
||||
$checkbox
|
||||
</tr>
|
||||
END
|
||||
;
|
||||
if ($netsettings{'BLUE_DEV'} ne '') {
|
||||
$checkbox=<<END
|
||||
<td class='base' nowrap='nowrap'>$Lang::tr{'vpn on blue'}:</td>
|
||||
<td class='base'>$Lang::tr{'enabled'}<input type='checkbox' name='ENABLED_BLUE' $checked{'ENABLED_BLUE'} /></td>
|
||||
END
|
||||
;}
|
||||
print <<END
|
||||
<tr>
|
||||
<td class='base' nowrap='nowrap'>$Lang::tr{'vpn delayed start'}: <img src='/blob.gif' alt='*' /><img src='/blob.gif' alt='*' /></td>
|
||||
<td ><input type='text' name='VPN_DELAYED_START' value='$cgiparams{'VPN_DELAYED_START'}' /></td>
|
||||
<td></td>
|
||||
$checkbox
|
||||
</tr>
|
||||
</table>
|
||||
<p>$Lang::tr{'vpn watch'}:<input type='checkbox' name='VPN_WATCH' $checked{'VPN_WATCH'} /></p>
|
||||
@@ -2587,7 +2486,6 @@ END
|
||||
;
|
||||
print "</form>";
|
||||
&Header::closebox();
|
||||
undef ($checkbox);
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'connection status and controlc'});
|
||||
print <<END
|
||||
@@ -2622,16 +2520,17 @@ END
|
||||
print "<td align='left'> </td>";
|
||||
}
|
||||
print "<td align='center'>$confighash{$key}[25]</td>";
|
||||
# get real state
|
||||
my $active = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourred}' width='100%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'capsclosed'}</font></b></td></tr></table>";
|
||||
if ($confighash{$key}[0] eq 'off') {
|
||||
$active = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourblue}' width='100%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'capsclosed'}</font></b></td></tr></table>";
|
||||
} else {
|
||||
foreach my $line (@status) {
|
||||
if ($line =~ /\"$confighash{$key}[1]\".*IPsec SA established/) {
|
||||
$active = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourgreen}' width='100%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'capsopen'}</font></b></td></tr></table>";
|
||||
}
|
||||
foreach my $line (@status) {
|
||||
if ($line =~ /\"$confighash{$key}[1]\".*IPsec SA established/) {
|
||||
$active = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourgreen}' width='100%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'capsopen'}</font></b></td></tr></table>";
|
||||
}
|
||||
}
|
||||
# move to blueif really down
|
||||
if ($confighash{$key}[0] eq 'off' && $active =~ /${Header::colourred}/ ) {
|
||||
$active = "<table cellpadding='2' cellspacing='0' bgcolor='${Header::colourblue}' width='100%'><tr><td align='center'><b><font color='#FFFFFF'>$Lang::tr{'capsclosed'}</font></b></td></tr></table>";
|
||||
}
|
||||
print <<END
|
||||
<td align='center'>$active</td>
|
||||
<td align='center'>
|
||||
@@ -2825,14 +2724,15 @@ END
|
||||
END
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
my $rowcolor = 0;
|
||||
if (keys %cahash > 0) {
|
||||
foreach my $key (keys %cahash) {
|
||||
if (($key + 1) % 2) {
|
||||
print "<tr bgcolor='${Header::table1colour}'>\n";
|
||||
} else {
|
||||
print "<tr bgcolor='${Header::table2colour}'>\n";
|
||||
}
|
||||
foreach my $key (keys %cahash) {
|
||||
if ($rowcolor++ % 2) {
|
||||
print "<tr bgcolor='${Header::table1colour}'>\n";
|
||||
} else {
|
||||
print "<tr bgcolor='${Header::table2colour}'>\n";
|
||||
}
|
||||
print "<td class='base'>$cahash{$key}[0]</td>\n";
|
||||
print "<td class='base'>$cahash{$key}[1]</td>\n";
|
||||
print <<END
|
||||
@@ -2898,9 +2798,5 @@ END
|
||||
END
|
||||
;
|
||||
&Header::closebox();
|
||||
|
||||
print "$Lang::tr{'this feature has been sponsored by'} : ";
|
||||
print "<a href='http://www.seminolegas.com/' target='_blank'>Seminole Canada Gas Company</a>.\n";
|
||||
|
||||
&Header::closebigbox();
|
||||
&Header::closepage();
|
||||
|
||||
Reference in New Issue
Block a user