]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/wio/wio.cgi
Hardcode theme to ipfire
[ipfire-2.x.git] / src / wio / wio.cgi
index c51910f4db483863e58be6bf505815cedf2d08e4..1dcec52fe266e342eb02d7c5404ded26ec31118d 100644 (file)
@@ -3,7 +3,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2017-2018 Stephan Feddersen <sfeddersen@ipfire.org>           #
+# Copyright (C) 2017-2021 Stephan Feddersen <sfeddersen@ipfire.org>           #
 # All Rights Reserved.                                                        #
 #                                                                             #
 # This program is free software: you can redistribute it and/or modify        #
 #                                                                             #
 ###############################################################################
 #
-# Version: 2018/02/27 16:54:23
+# Version: 2021/02/16 21:32:23
 #
-# This wio.cgi is based on the Code from the IPCop WIO Addon
+# This wio.cgi is based on the code from the IPCop WIO Addon
 # and is extremly adapted to work with IPFire.
 #
 # Autor: Stephan Feddersen
 # Co-Autor: Alexander Marx
-# Co-Autor: Frank Mainz
+# Co-Autor: Frank Mainz (for some code for the IPCop WIO Addon)
 #
 
 use strict;
@@ -55,18 +55,19 @@ require '/usr/lib/wio/wio-graphs.pl';
 
 my $logdir = "/var/log/wio";
 
-my ( %mainsettings, %mailsettings, %wiosettings, %cgiparams, %netsettings, %ipshash,
+my ( %mainsettings, %mailsettings, %wiosettings, %cgiparams, %netsettings, %ipshash, %vpnsettings,
         %vpnconfighash, %ovpnconfighash, %ovpnccdconfhash, %ovpnsettings, %checked, %selected, %color ) = ();
 
 &General::readhash('/var/ipfire/main/settings', \%mainsettings);
 &General::readhash('/var/ipfire/ethernet/settings', \%netsettings);
 &General::readhash('/var/ipfire/dma/mail.conf', \%mailsettings);
 &General::readhash('/var/ipfire/wio/wio.conf', \%wiosettings);
-&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
 &General::readhasharray('/var/ipfire/ovpn/ovpnconfig', \%ovpnconfighash);
 &General::readhash('/var/ipfire/ovpn/settings', \%ovpnsettings);
 &General::readhasharray('/var/ipfire/ovpn/ccd.conf', \%ovpnccdconfhash);
 &General::readhasharray('/var/ipfire/vpn/config', \%vpnconfighash);
+&General::readhash('/var/ipfire/vpn/settings', \%vpnsettings);
 
 my $ipadrfile    = "$logdir/wioips";
 my $onoffip      = "$logdir/wioscip";
@@ -112,7 +113,7 @@ my $networksearchbuttontext = "$Lang::tr{'wio_show_table_on'}";
 my ( $message, $infomessage, $errormessage, $importmessage ) = '';
 
 my ( $buttontext, $host, $timestamp, $ipadr, $on, $remark, $dyndns, $dyndnsip, $sendemailon, $net, $dev, $iprange, $output, $write, $webinterface,
-        $sendemailoff, $pingmethode, $online, $color, $bgcolor, $exitcode, $id, $line, $interface, $counter, $vpnn2nip, $vpnn2nmask, $ddns, $edc,
+        $sendemailoff, $pingmethode, $online, $color, $bgcolor, $exitcode, $id, $line, $interface, $counter, $vpnn2nip, $vpnn2nmask, $edc,
         $edd, $wmon, $wmoff, $ipfqdn, $http, $wioscan, $statustxt, $status, $key, $ic, $text, $image ) = (); 
 
 my ( @temp, @dates, @ipaddresses, @names, @remark, @sendemailon, @sendemailoff, @current, @ddns, @match, @webinterface, @arpcache, @arpadd, @line,
@@ -127,6 +128,10 @@ my @devs_alt   = ('green','blue','orange','red');
 
 my %ifacecolor = ( GREEN => 'wio_run_green', BLUE => 'wio_run_blue', ORANGE => 'wio_run_orange');
 
+#if ( $netsettings{'RED_TYPE'} eq 'STATIC' || $netsettings{'RED_TYPE'} eq 'DHCP' ) {
+#      %ifacecolor = ( %ifacecolor, RED => 'wio_run_red' );
+#}
+
 &loadips();
 
 ## some wio settings
@@ -156,7 +161,6 @@ $wiosettings{'LOGGING'} = 'off';
 $wiosettings{'MAILREMARK'} = 'off';
 $wiosettings{'MAILSTYLE'} = 'email';
 $wiosettings{'OVPNRWMAIL'} = 'off';
-$wiosettings{'SHUTDOWN'} = 'off';
 $wiosettings{'WIOGUISHOWARPTABLE'} = '';
 $wiosettings{'WIOGUISHOWCLIENTIMPORTTABLE'} = '';
 $wiosettings{'WIOGUISHOWNETWORKSEARCHTABLE'} = '';
@@ -175,7 +179,9 @@ if ( -e $wiofile ) { goto WIOSCAN; }
 foreach (@devs_color) {
        if ( $netsettings{"${_}_DEV"} ne '' ) {
                $wiosettings{"${_}_IPLOW"} = &Network::find_next_ip_address($netsettings{"${_}_NETADDRESS"}, 1);
-               $wiosettings{"${_}_IPHIGH"} = &Network::find_next_ip_address($netsettings{"${_}_BROADCAST"}, -1);
+
+               my $broadcast = &Network::get_broadcast($netsettings{"${_}_NETADDRESS"} . "/" . $netsettings{"${_}_NETMASK"});
+               $wiosettings{"${_}_IPHIGH"} = &Network::find_next_ip_address($broadcast, -1);
        }
 }
 
@@ -194,7 +200,6 @@ if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_save'}.'1' ) {
                $cgiparams{'MAILREMARK'} = $wiosettings{'MAILREMARK'};
                $cgiparams{'MAILSTYLE'} = $wiosettings{'MAILSTYLE'};
                $cgiparams{'OVPNRWMAIL'} = $wiosettings{'OVPNRWMAIL'};
-               $cgiparams{'SHUTDOWN'} = $wiosettings{'SHUTDOWN'};
 
                &General::writehash($wiosettings, \%cgiparams);
                &General::readhash($wiosettings, \%wiosettings);
@@ -215,7 +220,7 @@ if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_save'}.'2' ) {
        unless ( `ps -A | grep wio.pl` ) {
                while ( $count < $wiosettings{'COUNT'} ) {
                        if ( defined($wiosettings{"USE$count"}) && $wiosettings{"USE$count"} eq 'on' ) {
-                               $wiosettings{'CLIENTID'} = $wiosettings{'CLIENTID$count'};
+                               $wiosettings{'CLIENTID'} = $wiosettings{"CLIENTID$count"};
                                $wiosettings{'TIMESTAMP'} = $wiosettings{"TIMESTAMP$count"};
                                $wiosettings{'IPADR'} = $wiosettings{"IPADR$count"};
                                $wiosettings{'HOST'} = $wiosettings{"HOST$count"};
@@ -226,6 +231,7 @@ if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_save'}.'2' ) {
                                $wiosettings{'SENDEMAILOFF'} = $wiosettings{"SENDEMAILOFF$count"};
                                $wiosettings{'PINGMETHODE'} = $wiosettings{"PINGMETHODE$count"};
                                $wiosettings{'ONLINE'} = $wiosettings{"ONLINE$count"};
+                               $wiosettings{'WEBINTERFACE'} = $wiosettings{"WEBINTERFACE$count"};
 
                                &validSave();
 
@@ -281,39 +287,54 @@ if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_client_add'} ) {
 ## show / hide arptable
 
 if ( $wiosettings{'WIOGUISHOWARPTABLE'} eq 'arptable' ) {
-       if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) {
-               $wiosettings{'WIOGUISHOWARPTABLE'} = 'off';
-               $arpbuttontext = "$Lang::tr{'wio_show_table_on'}";
+       unless ( `ps -A | grep wio.pl` ) {
+               if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) {
+                       $wiosettings{'WIOGUISHOWARPTABLE'} = 'off';
+                       $arpbuttontext = "$Lang::tr{'wio_show_table_on'}";
+               }
+               else {
+                       $wiosettings{'WIOGUISHOWARPTABLE'} = 'on';
+                       $arpbuttontext = "$Lang::tr{'wio_show_table_off'}";
+               }
        }
        else {
-               $wiosettings{'WIOGUISHOWARPTABLE'} = 'on';
-               $arpbuttontext = "$Lang::tr{'wio_show_table_off'}";
+               $infomessage = "$Lang::tr{'wio_error_function'}";
        }
 }
 
 ## show / hide clientimporttable
 
 if ( $wiosettings{'WIOGUISHOWCLIENTIMPORTTABLE'} eq 'clientimport' ) {
-       if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) {
-               $wiosettings{'WIOGUISHOWCLIENTIMPORTTABLE'} = 'off';
-               $clientimportbuttontext = "$Lang::tr{'wio_show_table_on'}";
+       unless ( `ps -A | grep wio.pl` ) {
+               if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) {
+                       $wiosettings{'WIOGUISHOWCLIENTIMPORTTABLE'} = 'off';
+                       $clientimportbuttontext = "$Lang::tr{'wio_show_table_on'}";
+               }
+               else {
+                       $wiosettings{'WIOGUISHOWCLIENTIMPORTTABLE'} = 'on';
+                       $clientimportbuttontext = "$Lang::tr{'wio_show_table_off'}";
+               }
        }
        else {
-               $wiosettings{'WIOGUISHOWCLIENTIMPORTTABLE'} = 'on';
-               $clientimportbuttontext = "$Lang::tr{'wio_show_table_off'}";
+               $infomessage = "$Lang::tr{'wio_error_function'}";
        }
 }
 
 ## show / hide networksearchtable
 
 if ( $wiosettings{'WIOGUISHOWNETWORKSEARCHTABLE'} eq 'networksearch' ) {
-       if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) {
-               $wiosettings{'WIOGUISHOWNETWORKSEARCHTABLE'} = 'off';
-               $networksearchbuttontext = "$Lang::tr{'wio_show_table_on'}";
+       unless ( `ps -A | grep wio.pl` ) {
+               if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_show_table_off'} ) {
+                       $wiosettings{'WIOGUISHOWNETWORKSEARCHTABLE'} = 'off';
+                       $networksearchbuttontext = "$Lang::tr{'wio_show_table_on'}";
+               }
+               else {
+                       $wiosettings{'WIOGUISHOWNETWORKSEARCHTABLE'} = 'on';
+                       $networksearchbuttontext = "$Lang::tr{'wio_show_table_off'}";
+               }
        }
        else {
-               $wiosettings{'WIOGUISHOWNETWORKSEARCHTABLE'} = 'on';
-               $networksearchbuttontext = "$Lang::tr{'wio_show_table_off'}";
+               $infomessage = "$Lang::tr{'wio_error_function'}";
        }
 }
 
@@ -388,6 +409,8 @@ if ( defined($edc) || defined($edd) || defined($wmon) || defined($wmoff) || defi
 
 if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_refresh'} || $wiosettings{'ACTION'} eq $Lang::tr{'wio_sc_refresh'} ) {
 
+unless ( `ps -A | grep wio.pl` ) {
+
        if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_sc_refresh'} ) {
                open(FILE, "> $onoffip");
                print FILE @current[$wiosettings{'ID'}];
@@ -396,8 +419,6 @@ if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_refresh'} || $wiosettings{'ACTION'
                undef($wiosettings{'ID'});
        }
 
-unless ( `ps -A | grep wio.pl` ) {
-
 &Header::showhttpheaders();
 &Header::openpage($Lang::tr{'wio'}, 1, $refreshbox);
 &Header::openbigbox('100%', 'left', '');
@@ -417,7 +438,7 @@ print"
 
 while ( system("/usr/local/bin/wiohelper", "&") ) {}
 
-exit 0;                
+exit 0;
 }
 else {
        $infomessage = "$Lang::tr{'wio_already_running'}";
@@ -519,6 +540,7 @@ if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_back'} ) {
 
 if ( $wiosettings{'ACTION'} eq 'wio_run_green'  ||
         $wiosettings{'ACTION'} eq 'wio_run_blue'   ||
+        $wiosettings{'ACTION'} eq 'wio_run_red'   ||
         $wiosettings{'ACTION'} eq 'wio_run_orange') { $wioscan = 'on'; }
 
 if ( $wiosettings{'ACTION'} eq $Lang::tr{'wio_import'}.'1' ||
@@ -583,13 +605,14 @@ elsif ( $wioscan eq 'on' ) {
 
                        if ( $_ eq 'GREEN' ) { $color = "$Header::colourgreen"; $net = $Lang::tr{'wio_msg_green'}; }
                        elsif ( $_ eq 'BLUE' ) { $color = "$Header::colourblue"; $net = $Lang::tr{'wio_msg_blue'}; }
+                       elsif ( $_ eq 'RED' ) { $color = "$Header::colourred"; $net = $Lang::tr{'wio_msg_red'}; }
                        else { $color = "$Header::colourorange"; $net = $Lang::tr{'wio_msg_orange'}; }
                }
        }
 
 &Header::openbox('100%', 'left', $Lang::tr{'wio_info'});
        print"<table width='100%'>
-                 <tr><td align='center'><font class='base'>$Lang::tr{'wio_msg_left'} </font><font class='base' color='$color'><b>$net</b></font> $Lang::tr{'wio_msg_center'} <font class='base' color='$color'><b>$dev</b></font><font class='base'> $Lang::tr{'wio_msg_right'} $Lang::tr{'wio_msg_hint'}</font></td></tr>
+                 <tr><td align='center'><font class='base'>$Lang::tr{'wio_msg_left'} </font><font class='base' color='$color'><b>$net</b></font> $Lang::tr{'wio_msg_center'} <font class='base'> $Lang::tr{'wio_msg_right'} $Lang::tr{'wio_msg_hint'}</font></td></tr>
                  <tr><td>&nbsp;</td></tr>
                  <tr><td align='center'><img align='middle' src='/images/indicator.gif' /></td></tr>
                  </table>";
@@ -662,7 +685,6 @@ foreach (@hosts) {
                        $wiosettings{'HOST$count'} = gethostbyaddr(inet_aton($line[1]), AF_INET);
                        if ($wiosettings{'HOST$count'} eq '') { $wiosettings{'HOST$count'} = $line[1]; }
                        $wiosettings{'REMARK$count'} = '';
-                       $wiosettings{'WEBINTERFACE$count'} = '';
                }
                else {
                        $wiosettings{'HOST$count'} = $line[7];
@@ -869,9 +891,6 @@ $checked{'MAILREMARK'}{$wiosettings{'MAILREMARK'}} = "checked='checked'";
 $checked{'OVPNRWMAIL'}{'off'} = $checked{'OVPNRWMAIL'}{'on'} = '';
 $checked{'OVPNRWMAIL'}{$wiosettings{'OVPNRWMAIL'}} = "checked='checked'";
 
-$checked{'SHUTDOWN'}{'off'} = $checked{'SHUTDOWN'}{'on'} = '';
-$checked{'SHUTDOWN'}{$wiosettings{'SHUTDOWN'}} = "checked='checked'";
-
 $checked{'MAILSTYLE'}{'smail'} = $checked{'MAILSTYLE'}{'email'} = '';
 $checked{'MAILSTYLE'}{$wiosettings{'MAILSTYLE'}} = "checked='checked'";
 
@@ -927,15 +946,14 @@ print"
 <form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'>
 <table width='100%'>
 <tr>
-       <td width='55%' bgcolor='$color{'color20'}' align='left' height='20'><b>&nbsp;$Lang::tr{'wio_settings_msg'}</b></td>
-       <td width='2%'>&nbsp;</td>
-       <td width='43%'>&nbsp;</td>
+       <td bgcolor='$color{'color20'}' align='left'><b>$Lang::tr{'wio_settings_msg_hint'}</b></td>
+       <td colspan='2'>&nbsp;</td>
 </tr>
-<tr><td colspan='3'>&nbsp;</td></tr>
 <tr>
-       <td colspan='3'>$Lang::tr{'wio_settings_msg_hint'}</td>
+       <td width='48%'>&nbsp;</td>
+       <td width='2%'>&nbsp;</td>
+       <td width='50%'>&nbsp;</td>
 </tr>
-<tr><td colspan='3'>&nbsp;</td></tr>
 <tr>
        <td align='right'>$Lang::tr{'wio enabled'}</td>
 ";
@@ -951,12 +969,6 @@ else {
 print"
 </tr>
 <tr><td colspan='3'>&nbsp;</td></tr>
-<tr>
-       <td align='right'>$Lang::tr{'wio_shutdown'}</td>
-       <td>&nbsp;</td>
-       <td align='left'><input type='checkbox' name='SHUTDOWN' $checked{'SHUTDOWN'}{'on'} /></td>
-</tr>
-<tr><td colspan='3'>&nbsp;</td></tr>
 <tr>
        <td align='right'>$Lang::tr{'wio cron'}</td>
        <td>&nbsp;</td>
@@ -1118,17 +1130,26 @@ print"
 <tr bgcolor='$color{'color20'}' height='20'>
        <td width='3%' align='center'><b>$Lang::tr{'wio_id'}</b></td>
        <td width='15%' align='center'><b>$Lang::tr{'wio ipadress'}</b></td>
-       <td width='3%' align='center'><b>$Lang::tr{'wio network'}</b></td>
+       <td width='7%' align='center'><b>$Lang::tr{'wio network'}</b></td>
        <td width='15%' align='center'><b>$Lang::tr{'wio_lanname'}</b></td>
        <td width='15%' align='center'><b>$Lang::tr{'wio_wanname'}</b></td>
-       <td width='24%' align='center'><b>$Lang::tr{'wio_dyndns_hosts'}</b></td>
+       <td width='20%' align='center'><b>$Lang::tr{'wio_dyndns_hosts'}</b></td>
        <td width='11%' align='center'><b>$Lang::tr{'wio image'}</b></td>
        <td width='14%' align='center'><b>$Lang::tr{'wio_connected'}</b></td>
 </tr>
 <tr bgcolor='$color{'color22'}' height='20'>
        <td align='center'>01</td>
-       <td align='center'><font color='$Header::colourred'>$redip</b></font></td>
-       <td align='center'><img align='middle' src='$imgstatic/red.png' alt='$Lang::tr{'internet'}' title='$Lang::tr{'internet'}' /></td>
+       <td align='center'><font color='$Header::colourred'>$redip</font></td>
+";
+
+if ( $netsettings{"RED_TYPE"} eq 'PPPOE' ) {
+       print"<td align='center'><img align='middle' src='$imgstatic/red.png' alt='$Lang::tr{'internet'}' title='$Lang::tr{'internet'}' /></td>";
+}
+else {
+       print"<td align='center'><img align='middle' src='$imgstatic/red.png' alt='$Lang::tr{'wio_red_lan'}' title='$Lang::tr{'wio_red_lan'}' /></td>";
+}
+
+print"
        <td align='center'><font color='$Header::colourgreen'>".$mainsettings{'HOSTNAME'}.".".$mainsettings{'DOMAINNAME'}."</font></td>
        <td align='center'><font color='$Header::colourred'>".( $redip ne '-' ? (gethostbyaddr(pack("C4", split (/\./, $redip)), 2))[0] : '-' )."</font></td>
        <td align='center'>
@@ -1140,22 +1161,24 @@ open(FILE, "< $dyndnsconfig");
 @ddns = <FILE>;
 close (FILE);
 
-$ddns = @ddns;
-$bgcolor = "blue";
-
        foreach (@ddns) {
                chomp;
-
                @temp = split (/\,/, $_);
 
-               if ( $temp[7] eq "on" ) { $bgcolor = ( &General::DyndnsServiceSync (&General::GetDyndnsRedIP,$temp[1],$temp[2]) ? "$Header::colourgreen" : "$Header::colourred" ); }
+               if ( $temp[7] eq "on" ) {
+                       $bgcolor = ( &General::DyndnsServiceSync (&General::GetDyndnsRedIP,$temp[1],$temp[2]) ? "$Header::colourgreen" : "$Header::colourred" );
+               }
+               else {
+                       $bgcolor = "blue";
+               }
 
                print"<font color='$bgcolor'>$temp[1].$temp[2]</font>";
-
-               if ( $iddyndns++ ne ($ddns-1) ) { print"<b>, </b>"; }
+               if ( $iddyndns++ ne (@ddns-1) ) { print"<br />\n"; }
        }
 }
-else { print"<b> - </b>"; }
+else {
+       print"-";
+}
 
 print"
        </td>
@@ -1202,24 +1225,33 @@ print"
 
 foreach $key (sort SortByTunnelName (keys(%vpnconfighash))) {
 
-my $vpncheck = '';
-
-if ( -e '/var/log/wio/.vpncache' ) {
-       $vpncheck = strftime("%d.%m.%Y - %H:%M:%S",localtime(((stat('/var/log/wio/.vpncache'))[9])));
-}
+my ( $vpnclient, $vpnclientip, $vpnrwnet, $vpnn2nnet, $vpntime, $vpncheck ) = '';
 
 $status = "bgcolor='${Header::colourred}'";
 $statustxt = "$Lang::tr{'capsclosed'}";
+$vpnclient = $vpnconfighash{$key}[1];
+
+my ($ip,$sub) = split(/\//,$vpnsettings{'RW_NET'});
+my @ip = split( /\./, $ip);
+$vpnrwnet = join( '.', ( $ip[0], $ip[1], $ip[2], ) );
 
        if ($vpnconfighash{$key}[0] eq 'off') {
                $status = "bgcolor='${Header::colourblue}'";
                $statustxt = "$Lang::tr{'capsclosed'}";
+               $vpnn2nnet = '-';
+       }
+       else {
+               $vpnn2nnet = $vpnconfighash{$key}[11];
        }
 
        foreach (@vpnstatus) {
-               if ($_ =~ /$vpnconfighash{$key}[1]\{.*INSTALLED/) {
+               if ($_ =~ /$vpnclient.*ESTABLISHED/) {
                        $status = "bgcolor='${Header::colourgreen}'";
                        $statustxt = "$Lang::tr{'capsopen'}";
+                       $vpntime = `/usr/local/bin/ipsecctrl I | grep $vpnclient.*ESTABLISHED | sed 's/^[ \t]*//' | cut -d " " -f 3-4`;
+                       $vpntime = &WIO::contime($vpntime, "ipsec");
+                       $vpnclientip = `/usr/local/bin/ipsecctrl I | grep $vpnclient.*$vpnrwnet | sed 's/^[ \t]*//' | cut -d " " -f 6 | cut -d "/" -f 1`;
+                       $vpncheck = strftime("%d.%m.%Y - %H:%M:%S",localtime);
                        last;
                }
        }
@@ -1228,12 +1260,12 @@ $statustxt = "$Lang::tr{'capsclosed'}";
 
        my $vpnnr = $idvpn+1;
 
-       printf ("<td align='center'> %02d</td>", $vpnnr);
+       printf ("<td align='center'>%02d</td>", $vpnnr);
 
-       print"<td align='center'>$vpncheck</td>
-                 <td align='center'>$vpnconfighash{$key}[1]</td>
-                 <td align='center'><img align='middle' src='$imgstatic/".( $vpnconfighash{$key}[3] eq 'host' ? "vpnrw.png' alt='$Lang::tr{'wio_rw'}' title='$Lang::tr{'wio_rw'}'" : "vpnn2n.png' alt='$Lang::tr{'wio_n2n'}' title='$Lang::tr{'wio_n2n'}'")." /></td>
-                 <td align='center'>".($vpnconfighash{$key}[2] eq '%auth-dn' ? "$vpnconfighash{$key}[9]" : ($vpnconfighash{$key}[4] eq 'cert' ? "$vpnconfighash{$key}[2]" : ($vpnconfighash{$key}[8] ne '' ? "$vpnconfighash{$key}[10]" : "&nbsp;")))."</td>
+       print"<td align='center'>".($vpncheck ne '' ? "$vpncheck" : "-")."</td>
+                 <td align='center'>$vpnclient</td>
+                 <td align='center'><img align='middle' src='$imgstatic/".($vpnconfighash{$key}[3] eq 'host' ? "vpnrw.png' alt='$Lang::tr{'wio_rw'}' title='$Lang::tr{'wio_rw'}'" : "vpnn2n.png' alt='$Lang::tr{'wio_n2n'}' title='$Lang::tr{'wio_n2n'}'")." /></td>
+                 <td align='center'>".($vpnconfighash{$key}[3] eq 'host' ? (defined($vpnclientip) ? "$vpnclientip" : "-") : $vpnconfighash{$key}[3] eq 'net' ? "$vpnn2nnet" : "-")."</td>
                  <td align='center'>
                        <table $status cellpadding='2' cellspacing='0' width='100%'>
                                <tr height='20'>
@@ -1241,15 +1273,16 @@ $statustxt = "$Lang::tr{'capsclosed'}";
                                </tr>
                        </table>
                  </td>
-                 <td align='center' height='20'>&nbsp;</td>
+                 <td align='center' height='20'>".($vpntime ne '' ? "$vpntime" : "-")."</td>
                  </tr>
 ";
 
-if ($vpnconfighash{$key}[25] && $wiosettings{'CLIENTREMARK'} eq 'on') {
-       print"<tr".($idvpn % 2?" bgcolor='$color{'color20'}'":" bgcolor='$color{'color22'}'")." height='20'><td>&nbsp;</td><td colspan='16' align='left'>$vpnconfighash{$key}[25]</td></tr>";
+if ($wiosettings{'CLIENTREMARK'} eq 'on') {
+       print"<tr".($idvpn % 2?" bgcolor='$color{'color20'}'":" bgcolor='$color{'color22'}'")." height='20'><td>&nbsp;</td><td colspan='16' align='left'>".($vpnconfighash{$key}[25] ne '' ? "$vpnconfighash{$key}[25]" : "-")."</td></tr>";
 }
-       print"<tr height='1'><td colspan='7' bgcolor='#696565'></td></tr>";
-       $idvpn++
+
+print"<tr height='1'><td colspan='7' bgcolor='#696565'></td></tr>";
+$idvpn++
 }
 
 print"</table>";
@@ -1274,117 +1307,117 @@ print"
 <tr bgcolor='$color{'color20'}' height='20'>
        <td width='3%' align='center'><b>$Lang::tr{'wio_id'}</b></td>
        <td width='19%' align='center'><b>$Lang::tr{'wio checked'}</b></td>
-       <td width='20%' align='center'><b>$Lang::tr{'wio ipadress'}</b></td>
+       <td width='20%' align='center'><b>$Lang::tr{'name'}</b></td>
        <td width='8%' align='center'><b>$Lang::tr{'type'}</b></td>
-       <td width='25%' align='center'><b>$Lang::tr{'common name'}</b></td>
+       <td width='25%' align='center'><b>$Lang::tr{'wio_common_name'}</b></td>
        <td width='11%' align='center'><b>$Lang::tr{'wio image'}</b></td>
        <td width='14%' align='center'><b>$Lang::tr{'wio_connected'}</b></td>
 </tr>
 ";
 
-       foreach $key (keys %ovpnconfighash) {
+foreach $key (keys %ovpnconfighash) {
 
-               my ( $ovpnclt, $ovpntime, $ovpnrwip, $ovpncheck ) = '';
+       my ( $ovpncheck, $ovpntime, $ovpnclt, $ovpnrwip ) = '';
 
-               if ( -e '/var/log/wio/.ovpncache' ) {
-                       $ovpncheck = strftime("%d.%m.%Y - %H:%M:%S",localtime(((stat('/var/log/wio/.ovpncache'))[9])));
-               }
+       print"<tr".($idovpn % 2?" bgcolor='$color{'color20'}'":" bgcolor='$color{'color22'}'")." height='20'>";
 
-               print"<tr".($idovpn % 2?" bgcolor='$color{'color20'}'":" bgcolor='$color{'color22'}'")." height='20'>";
+       my $ovpnnr = $idovpn+1;
 
-               my $ovpnnr = $idovpn+1;
+       printf ("<td align='center' height='20'> %02d</td>", $ovpnnr);
 
-               printf ("<td align='center' height='20'> %02d</td>", $ovpnnr);
+       if ($ovpnconfighash{$key}[3] eq 'net') {
+               $image = "$imgstatic/ovpnn2n.png";
+               $text = "$Lang::tr{'wio_n2n'}";
+       }
+       else {
+               $image = "$imgstatic/ovpnrw.png";
+               $text = "$Lang::tr{'wio_rw'}";
+       }
 
+       if ( $ovpnconfighash{$key}[0] eq 'off' ) {
+               $status = "${Header::colourblue}";
+               $statustxt = "$Lang::tr{'capsclosed'}";
+               $ovpncheck = "-";
+       }
+       else {
                if ($ovpnconfighash{$key}[3] eq 'net') {
-                       $image = "$imgstatic/ovpnn2n.png";
-                       $text = "$Lang::tr{'wio_n2n'}";
-               }
-               else {
-                       $image = "$imgstatic/ovpnrw.png";
-                       $text = "$Lang::tr{'wio_rw'}";
-               }
-
-               if ( $ovpnconfighash{$key}[0] eq 'off' ) {
-                       $status = "${Header::colourblue}";
-                       $statustxt = "$Lang::tr{'capsclosed'}";
-               }
-               else {
-                       if ($ovpnconfighash{$key}[3] eq 'net') {
-                               if (-e "/var/run/$ovpnconfighash{$key}[1]n2n.pid") {
-                                       my @output = "";
-                                       my @tustate = "";
-                                       my $tport = $ovpnconfighash{$key}[22];
-                                       my $tnet = new Net::Telnet ( Timeout=>5, Errmode=>'return', Port=>$tport); 
-                                       if ($tport ne '') {
-                                               $tnet->open('127.0.0.1');
-                                               @output = $tnet->cmd(String => 'state', Prompt => '/(END.*\n|ERROR:.*\n)/');
-                                               @tustate = split(/\,/, $output[1]);
-                                               $ovpntime = &WIO::contime(scalar localtime($tustate[0]));
-                                               
-                                               if (($tustate[1] eq 'CONNECTED')) {
-                                                       $status = "${Header::colourgreen}";
-                                                       $statustxt = "$Lang::tr{'capsopen'}";
-                                               }else {
-                                                       $status = "${Header::colourred}";
-                                                       $statustxt = "$tustate[1]";
-                                               }
+                       if (-e "/var/run/$ovpnconfighash{$key}[1]n2n.pid") {
+                               my ( @output, @tustate ) = '';
+                               my $tport = $ovpnconfighash{$key}[22];
+                               my $tnet = new Net::Telnet (Timeout=>5, Errmode=>'return', Port=>$tport);
+                               if ($tport ne '') {
+                                       $tnet->open('127.0.0.1');
+                                       @output = $tnet->cmd(String => 'state', Prompt => '/(END.*\n|ERROR:.*\n)/');
+                                       @tustate = split(/\,/, $output[1]);
+                                       $ovpntime = &WIO::contime(scalar localtime($tustate[0]), "ovpn");
+                                       $ovpncheck = strftime("%d.%m.%Y - %H:%M:%S", localtime);
+
+                                       if (($tustate[1] eq 'CONNECTED')) {
+                                               $status = "${Header::colourgreen}";
+                                               $statustxt = "$Lang::tr{'capsopen'}";
+                                               $ovpnrwip = $ovpnconfighash{$key}[11];
+                                       }
+                                       else {
+                                               $status = "${Header::colourred}";
+                                               $statustxt = "$tustate[1]";
                                        }
                                }
                        }
-                       else {
-                               foreach (@ovpnstatus) {
-                                       if ( $_ =~ /^(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/ ) {
-                                               @match = split (m/^(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/, $_);
-                                               $match[1] =~ s/[_]/ /g;
-                                       }
+               }
+               else {
+                       foreach (@ovpnstatus) {
+                               if ( $_ =~ /^(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/ ) {
+                                       @match = split (m/^(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(\d+),(\d+),(.+)/, $_);
+                                       $match[1] =~ s/[_]/ /g;
+                               }
 
-                                       if ( $match[1] ne "Common Name" && ($match[1] eq $ovpnconfighash{$key}[2]) ) {
-                                               $ovpnclt = $match[1];
-                                               $ovpntime = &WIO::contime($match[5]);
-                                       }
+                               if ( $match[1] ne "Common Name" && ($match[1] eq $ovpnconfighash{$key}[2]) ) {
+                                       $ovpnclt = $match[1];
+                                       $ovpntime = &WIO::contime($match[5], "ovpn");
+                               }
 
-                                       if ( $_ =~ /^(\d+\.\d+\.\d+\.\d+),(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(.+)/ ) {
-                                               @match = split(m/^(\d+\.\d+\.\d+\.\d+),(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(.+)/, $_);
-                                       }
+                               if ( $_ =~ /^(\d+\.\d+\.\d+\.\d+),(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(.+)/ ) {
+                                       @match = split(m/^(\d+\.\d+\.\d+\.\d+),(.+),(\d+\.\d+\.\d+\.\d+\:\d+),(.+)/, $_);
+                               }
 
-                                       if ( $match[1] ne "Virtual Address" && $match[2] eq $ovpnclt ) {
-                                                       $ovpnrwip = $match[1];
-                                                       $ovpncheck = &WIO::statustime($match[4]);
-                                       }
+                               if ( $match[1] ne "Virtual Address" && $match[2] eq $ovpnclt ) {
+                                       $ovpnrwip = $match[1];
+                                       $ovpncheck = &WIO::statustime($match[4]);
+                               }
 
-                                       if ( $ovpnclt eq $ovpnconfighash{$key}[2] ) {
-                                               $status = "${Header::colourgreen}";
-                                               $statustxt = "$Lang::tr{'capsopen'}";
-                                       }
-                                       else {
-                                               $status = "${Header::colourred}";
-                                               $statustxt = "$Lang::tr{'capsclosed'}";
-                                       }
+                               if ( $ovpnclt eq $ovpnconfighash{$key}[2] ) {
+                                       $status = "${Header::colourgreen}";
+                                       $statustxt = "$Lang::tr{'capsopen'}";
+                               }
+                               else {
+                                       $status = "${Header::colourred}";
+                                       $statustxt = "$Lang::tr{'capsclosed'}";
                                }
                        }
-}
+               }
+       }
 
-       print"
-       <td align='center'>$ovpncheck</td>
-       <td align='center'>".( defined($ovpnrwip)? "$ovpnrwip" : "&nbsp;")."</td>
+print"
+       <td align='center'>".(defined($ovpncheck) ? "$ovpncheck" : "-")."</td>
+       <td align='center'>".($ovpnconfighash{$key}[2] eq '%auth-dn' ? "$ovpnconfighash{$key}[9]" : ($ovpnconfighash{$key}[4] eq 'cert' ? "$ovpnconfighash{$key}[1]": "-"))."</td>
        <td align='center'><img align='middle' src='$image' alt='$text' title='$text' /></td>
-       <td align='center'>".($ovpnconfighash{$key}[2] eq '%auth-dn' ? "$ovpnconfighash{$key}[9]" : ($ovpnconfighash{$key}[4] eq 'cert' ? "$ovpnconfighash{$key}[2]": "&nbsp;"))."</td>
+       <td align='center'>".($ovpnrwip ne '' ? "$ovpnrwip" : "-")."</td>
        <td align='center'><table bgcolor='$status' cellpadding='2' cellspacing='0' width='100%'><tr height='20'><td align='center'><font color='white'><b>$statustxt</b></font></td></tr></table></td>
-       <td align='center'>".(defined($ovpntime)? "$ovpntime" : "&nbsp;")."</td>
+       <td align='center'>".(defined($ovpntime) ? "$ovpntime" : "-")."</td>
 </tr>
 ";
-               if ($ovpnconfighash{$key}[25] && $wiosettings{'CLIENTREMARK'} eq 'on') {
-                       print"<tr".($idovpn % 2?" bgcolor='$color{'color20'}'":" bgcolor='$color{'color22'}'")." height='20'><td>&nbsp;</td><td colspan='16' align='left'>$ovpnconfighash{$key}[25]</td></tr>";
-               }
 
-               print"<tr height='1'><td colspan='17' bgcolor='#696565'></td></tr>";
-               $idovpn++
-       }
-               print"</table>";
-               &hrline();
+if ($wiosettings{'CLIENTREMARK'} eq 'on') {
+       print"<tr".($idovpn % 2?" bgcolor='$color{'color20'}'":" bgcolor='$color{'color22'}'")." height='20'><td>&nbsp;</td><td colspan='16' align='left'>".($ovpnconfighash{$key}[25] ne '' ? "$ovpnconfighash{$key}[25]" : "-")."</td></tr>";
+}
+
+print"<tr height='1'><td colspan='17' bgcolor='#696565'></td></tr>";
+$idovpn++
+}
+
+print"</table>";
+&hrline();
 }
-#}
 
 ## client status
 
@@ -1406,9 +1439,9 @@ print"
        <td width='4%' align='center'><b>$Lang::tr{'wio_webinterface'}</b></td>
        <td width='11%' align='center'><a href='$ENV{'SCRIPT_NAME'}?IPADR'><b>$Lang::tr{'wio ipadress'}</b></a></td>
        <td width='5%' align='center'><b>$Lang::tr{'wio network'}</b></td>
-       <td width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?HOST'><b>$Lang::tr{'wio name'}</b></a></td>
-       <td width='11%' align='center'><b>$Lang::tr{'wio image'}</b></td>
-       <td width='4%' align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'><input type='hidden' name='ACTION' value='$Lang::tr{'wio_refresh'}' /><input type='image' name='$Lang::tr{'wio_refresh'}' src='$imgstatic/refresh.png' align='middle' alt='$Lang::tr{'wio_refresh'}' title='$Lang::tr{'wio_refresh'}' /></form></td>
+       <td width='23%' align='center'><a href='$ENV{'SCRIPT_NAME'}?HOST'><b>$Lang::tr{'wio name'}</b></a></td>
+       <td width='9%' align='center'><b>$Lang::tr{'wio image'}</b></td>
+       <td width='3%' align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'><input type='hidden' name='ACTION' value='$Lang::tr{'wio_refresh'}' /><input type='image' name='$Lang::tr{'wio_refresh'}' src='$imgstatic/refresh.png' align='middle' alt='$Lang::tr{'wio_refresh'}' title='$Lang::tr{'wio_refresh'}' /></form></td>
        <td width='4%' colspan='2' align='center'><b>$Lang::tr{'wio_dyndns'}</b></td>
        <td width='12%' colspan='4' align='center'><b>$Lang::tr{'action'}</b></td>
        <td width='3%' align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'><input type='hidden' name='ACTION' value='$Lang::tr{'wio_remove_all'}' /><input type='image' name='$Lang::tr{'wio_remove_all'}' src='/images/delete.gif' align='middle' alt='$Lang::tr{'wio_remove_all'}' title='$Lang::tr{'wio_remove_all'}' onClick=\"return confirm('$Lang::tr{'wio_remove_all_hint'}')\"/></form></td>
@@ -1504,11 +1537,16 @@ my $dotip = length($ipaddresses[$a]) - rindex($ipaddresses[$a],'.');
                        $ic = "${_}";
 
                        foreach $interface (@devs_net) {
-                       next if ( $netsettings{"$ic"."_DEV"} eq 'red0' && ($netsettings{"RED_TYPE"} eq 'DHCP' || $netsettings{"RED_TYPE"} eq 'PPPOE'));
+                       next if ( $netsettings{"$ic"."_DEV"} eq 'red0' && $netsettings{"RED_TYPE"} eq 'PPPOE');
                                if ( $netsettings{"$ic"."_DEV"} eq $interface ) {
                                        if ( &General::IpInSubnet($ipaddresses[$a], $netsettings{"$ic"."_NETADDRESS"}, $netsettings{"$ic"."_NETMASK"}) ) {
-                                               print"<td align='center' height='20'><img src='$imgstatic/$devs_img[$in]' alt='$Lang::tr{$devs_alt[$in]}' title='$Lang::tr{$devs_alt[$in]}' /></td>";
-                                               last SWITCH;
+                                               if ( $netsettings{"$ic"."_DEV"} eq 'red0' ) {
+                                                       print"<td align='center' height='20'><img src='$imgstatic/$devs_img[$in]' alt='$Lang::tr{'wio_red_lan'}' title='$Lang::tr{'wio_red_lan'}' /></td>";
+                                               }
+                                               else {
+                                                       print"<td align='center' height='20'><img src='$imgstatic/$devs_img[$in]' alt='$Lang::tr{$devs_alt[$in]}' title='$Lang::tr{$devs_alt[$in]}' /></td>";
+                                               }
+                                       last SWITCH;
                                        }
                                }
                        $in++;
@@ -1527,7 +1565,7 @@ my $dotip = length($ipaddresses[$a]) - rindex($ipaddresses[$a],'.');
                                        $vpnn2nmask = length($net[1]) - rindex($net[1],'.');
 
                                        if (substr($ipaddresses[$a],0,length($ipaddresses[$a])-$dotip) eq substr($vpnn2nip,0,length($vpnn2nip)-$vpnn2nmask)) {
-                                               print"<td align='center'><img align='middle' src='$imgstatic/vpn.png' alt='IPSec' title='IPSec' /></td>";
+                                               print"<td align='center'><img align='middle' src='$imgstatic/vpn.png' alt='IPsec' title='IPsec' /></td>";
                                                last SWITCH;
                                        }
                        }
@@ -1558,35 +1596,31 @@ my $dotip = length($ipaddresses[$a]) - rindex($ipaddresses[$a],'.');
                        }
                }
 
-               if ($netsettings{"RED_TYPE"} eq 'DHCP' || $netsettings{"RED_TYPE"} eq 'PPPOE') {
-                       my $redipadr = qx'ip addr | grep red0 | grep inet | awk "{print \$2}"';
-                       my @rednet = split ("/", $redipadr);
-                       chomp ($rednet[1]);
-                       my $red_netmask = General::iporsubtodec($rednet[1]);
-                       my $red_netaddress = Network::get_netaddress("$rednet[0]/$red_netmask");
+               if ( $netsettings{"RED_TYPE"} eq 'PPPOE' ) {
+                       print"<td align='center' height='20'><img src='$imgstatic/red.png' alt='$Lang::tr{'internet'}' title='$Lang::tr{'internet'}' /></td>";
+                       last SWITCH;
 
-                       if ( &General::IpInSubnet($ipaddresses[$a], $red_netaddress, $red_netmask) ) {
-                               print"<td align='center' height='20'><img src='$imgstatic/red.png' alt='$Lang::tr{'wio_red_lan'}' title='$Lang::tr{'wio_red_lan'}' /></td>";
-                               last SWITCH;
-                       }
-                       else {
+               }
+               else {
                                print"<td align='center'><img align='middle' src='$imgstatic/white.png' alt='$Lang::tr{'wio_unknown_lan'}' title='$Lang::tr{'wio_unknown_lan'}' /></td>";
                                last SWITCH;
-                       }
                }
        }
 
-if ( $webinterface[$a] eq 'HTTP' ) {
-       print"<td align='center'><a title=\"$Lang::tr{'wio_webinterface_link'}\" href=\"http://$names[$a]\" target=\"_blank\">$names[$a]</a></td>";
-}
-elsif ( $webinterface[$a] eq 'HTTPS' ) {
-       print"<td align='center'><a title=\"$Lang::tr{'wio_webinterface_link'}\" href=\"https://$names[$a]\" target=\"_blank\">$names[$a]</a></td>";
-}
-else {
-       print"<td align='center'>$names[$a]</td>";
-}
+print"<td align='center'>";
+
+       if ( $webinterface[$a] eq 'HTTP' ) {
+               print"<a title=\"$Lang::tr{'wio_webinterface_link'}\" href=\"http://$names[$a]\" target=\"_blank\">$names[$a]</a>";
+       }
+       elsif ( $webinterface[$a] eq 'HTTPS' ) {
+               print"<a title=\"$Lang::tr{'wio_webinterface_link'}\" href=\"https://$names[$a]\" target=\"_blank\">$names[$a]</a>";
+       }
+       else {
+               print $names[$a];
+       }
 
 print"
+    </td>
        <td>
                <table bgcolor='$bgcolor' cellpadding='2' cellspacing='0' width='100%'>
                        <tr height='20'>
@@ -1653,8 +1687,8 @@ print"
          <input type='hidden' name='ID' value='$a' /></form></td></tr>
 ";
 
-if ($remark[$a] && $wiosettings{'CLIENTREMARK'} eq 'on') {
-       print"<tr".($a % 2?" bgcolor='$color{'color20'}'":" bgcolor='$color{'color22'}'")." height='20'><td>&nbsp;</td><td colspan='16' align='left'>$remark[$a]</td></tr>";
+if ($wiosettings{'CLIENTREMARK'} eq 'on') {
+       print"<tr".($a % 2?" bgcolor='$color{'color20'}'":" bgcolor='$color{'color22'}'")." height='20'><td>&nbsp;</td><td colspan='16' align='left'>".($remark[$a] ne '' ? "$remark[$a]" : "-")."</td></tr>";
 }
        print"<tr height='1'><td colspan='17' bgcolor='#696565'></td></tr>";
 }
@@ -1872,7 +1906,7 @@ SWITCH: {
                }
        }
 
-                       if ($netsettings{"RED_TYPE"} eq 'DHCP' || $netsettings{"RED_TYPE"} eq 'PPPOE') {
+                       if ($netsettings{"RED_TYPE"} eq 'DHCP' || $netsettings{"RED_TYPE"} eq 'PPPOE' || $netsettings{"RED_TYPE"} eq 'STATIC') {
                        my $redipadr = qx'ip addr | grep red0 | grep inet | awk "{print \$2}"';
                        my @rednet = split ("/", $redipadr);
                        chomp ($rednet[1]);
@@ -1880,7 +1914,7 @@ SWITCH: {
                        my $red_netaddress = Network::get_netaddress("$rednet[0]/$red_netmask");
 
                        if ( &General::IpInSubnet($line[1], $red_netaddress, $red_netmask) ) {
-                               print"<td align='center' height='20'><img src='$imgstatic/red.png' alt='$Lang::tr{'wio_red_lan'}' title='$Lang::tr{'wio_red_lan'}' /></td>";
+                               print"<td align='center' height='20'><img src='$imgstatic/red.png' alt='$Lang::tr{'internet'}' title='$Lang::tr{'internet'}' /></td>";
                                last SWITCH;
                        }
                        else {
@@ -1931,32 +1965,32 @@ print"
 <tr><td colspan='3'>&nbsp;</td></tr>
 <tr bgcolor='$color{'color22'}'>
        <form method='post' action='/cgi-bin/wio.cgi' enctype='multipart/form-data'>
-       <td width='35%' align='right'>$Lang::tr{'wio_import_csv'}&nbsp;</td>
+       <td width='33%' align='right'>$Lang::tr{'wio_import_csv'}&nbsp;</td>
        <td width='40%' align='center'><input type='file' name='CSVFILE' size='30' /></td>
-       <td width='25%' align='right'><input type='hidden' name='ACTION' value='$Lang::tr{'wio_import'}1' /><input type='submit' name='SUBMIT' value='$Lang::tr{'wio_import'}' /></td>
+       <td width='27%' align='right'><input type='hidden' name='ACTION' value='$Lang::tr{'wio_import'}1' /><input type='submit' name='SUBMIT' value='$Lang::tr{'wio_import'}' /></td>
        </form>
 </tr>
 <tr><td colspan='3'>&nbsp;</td></tr>
 <tr bgcolor='$color{'color22'}'>
        <form method='post' action='/cgi-bin/wio.cgi' enctype='multipart/form-data'>
-       <td width='35%' align='right'>$Lang::tr{'wio_import_hosts'}&nbsp;</td>
+       <td width='33%' align='right'>$Lang::tr{'wio_import_hosts'}&nbsp;</td>
        <td width='40%' align='center'>&nbsp;</td>
-       <td width='25%' align='right'><input type='hidden' name='ACTION' value='$Lang::tr{'wio_import'}2' /><input type='submit' name='SUBMIT' value='$Lang::tr{'wio_import'}' /></td>
+       <td width='27%' align='right'><input type='hidden' name='ACTION' value='$Lang::tr{'wio_import'}2' /><input type='submit' name='SUBMIT' value='$Lang::tr{'wio_import'}' /></td>
        </form>
 </tr>
 <tr><td colspan='3'>&nbsp;</td></tr>
 <tr bgcolor='$color{'color22'}'>
        <form method='post' action='/cgi-bin/wio.cgi' enctype='multipart/form-data'>
-       <td width='35%' align='right'>$Lang::tr{'wio_import_fixleases'}&nbsp;</td>
+       <td width='33%' align='right'>$Lang::tr{'wio_import_fixleases'}&nbsp;</td>
        <td width='40%' align='center'>&nbsp;</td>
-       <td width='25%' align='right'><input type='hidden' name='ACTION' value='$Lang::tr{'wio_import'}3' /><input type='submit' name='SUBMIT' value='$Lang::tr{'wio_import'}' /></td>
+       <td width='27%' align='right'><input type='hidden' name='ACTION' value='$Lang::tr{'wio_import'}3' /><input type='submit' name='SUBMIT' value='$Lang::tr{'wio_import'}' /></td>
        </form>
 </tr>
 </table>
 ";
 }
 
-&hrline;
+&hrline();
 
 print"
 <table border='0' width='100%' bordercolor='$Header::bordercolour' cellspacing='0' cellpadding='0' style='border-collapse: collapse'>
@@ -1979,6 +2013,7 @@ print"
 foreach (keys(%ifacecolor)) {
        if ( $_ eq 'GREEN' ) { $color = "$Header::colourgreen"; $net = $Lang::tr{'wio_net_scan_green'}; }
        elsif ( $_ eq 'BLUE' ) { $color = "$Header::colourblue"; $net = $Lang::tr{'wio_net_scan_blue'}; }
+       elsif ( $_ eq 'RED' ) { $color = "$Header::colourred"; $net = $Lang::tr{'wio_net_scan_red'}; }
        else { $color = "$Header::colourorange"; $net = $Lang::tr{'wio_net_scan_orange'}; }
 
        if ( $netsettings{"${_}_DEV"} eq 'disabled' || $netsettings{"${_}_DEV"} eq '' || $netsettings{"${_}_ADDRESS"} eq '' ) { next; }
@@ -1986,9 +2021,9 @@ foreach (keys(%ifacecolor)) {
                print <<END;
 
                        <tr bgcolor='$color{'color22'}'>
-                               <td width='35%' align='right'><form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'>$Lang::tr{'wio_net_scan_vl'} <font color='$color'><b>$net</b></font> $Lang::tr{'wio_net_scan_l'}<font color='$color'><b> $netsettings{"${_}_DEV"} </b></font>$Lang::tr{'wio_net_scan_r'}</td>
+                               <td width='33%' align='right'><form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'>$Lang::tr{'wio_net_scan_l'} <font color='$color'><b>$net&nbsp;</b></font>$Lang::tr{'wio_net_scan_r'}</td>
                                <td width='40%' align='center'><input type='text' name='${_}_IPLOW' value='$wiosettings{"${_}_IPLOW"}' size='14' STYLE='background-color:$color; text-align: center; color:white' /> - <input type='text' name='${_}_IPHIGH' value='$wiosettings{"${_}_IPHIGH"}' size='14' STYLE='background-color:$color; text-align: center; color:white' /></td>
-                               <td width='25%' align='right'><input type='hidden' name='ACTION' value='$ifacecolor{$_}' /><input type='hidden' name='ID' value='$netsettings{"${_}_DEV"}' /><input type='submit' name='SUBMIT' value='$Lang::tr{'wio_net_scan_run'}'></form></td>
+                               <td width='27%' align='right'><input type='hidden' name='ACTION' value='$ifacecolor{$_}' /><input type='hidden' name='ID' value='$netsettings{"${_}_DEV"}' /><input type='submit' name='SUBMIT' value='$Lang::tr{'wio_net_scan_run'}'></form></td>
                        </tr>
                        <tr>
                                <td colspan='3'>&nbsp;</td>
@@ -2023,6 +2058,8 @@ if ( $wiosettings{'LOGGING'} eq 'on' ) {
 print"
        <td width='10%' align='right'><form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'><input type='hidden' name='ACTION' value='$Lang::tr{'edit'}1' /><input type='submit' name='SUBMIT' value='$Lang::tr{'wio_edit_set'}' /></form></td>
 </tr>
+<tr><td colspan='4'><b>&nbsp;</b></td></tr>
+<tr><td colspan='4' align='right'><b><font size='1' color='grey'>wio-1.3.2-12</font></b></td></tr>
 </table>
 ";
 }
@@ -2131,14 +2168,6 @@ print"<table width='100%'><tr><td colspan='2' height='35'><hr></td></tr></table>
 
 ############################################################################################################################
 
-sub back {
-
-print"<table width='100%'><tr><td width='10%'><a href='/cgi-bin/wio.cgi'><img src='/images/wio/back.png' alt='$Lang::tr{'wio_back'}' title='$Lang::tr{'wio_back'}' /></a></td><td>&nbsp;</td></tr></table>";
-
-}
-
-############################################################################################################################
-
 sub loadips {
 
 &General::readhasharray($ipadrfile, \%ipshash);