diff --git a/html/cgi-bin/aliases.cgi b/html/cgi-bin/aliases.cgi index 85ed27204..7b80b3c84 100644 --- a/html/cgi-bin/aliases.cgi +++ b/html/cgi-bin/aliases.cgi @@ -62,7 +62,7 @@ $settings{'IP'} = ''; $settings{'ENABLED'} = 'off'; # Every check box must be set to off $settings{'NAME'} = ''; my @nosaved=('IP','ENABLED','NAME'); # List here ALL setting2 fields. Mandatory - + $settings{'ACTION'} = ''; # add/edit/remove $settings{'KEY1'} = ''; # point record for ACTION @@ -94,16 +94,16 @@ if (open(FILE, "$datafile")) { # Remove if no Setting1 needed # if ($settings{'ACTION'} eq $Lang::tr{'save'}) { - + # #Validate static Settings1 here # unless ($errormessage) { # Everything is ok, save settings - #map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1'));# Must never be saved + #map (delete ($settings{$_}) ,(@nosaved,'ACTION','KEY1'));# Must never be saved #&General::writehash($setting, \%settings); # Save good settings #$settings{'ACTION'} = $Lang::tr{'save'}; # Recreate 'ACTION' #map ($settings{$_}= '',(@nosaved,'KEY1')); # and reinit var to empty - + # Rebuild configuration file if needed &BuildConfiguration; @@ -133,14 +133,14 @@ if ($settings{'ACTION'} eq $Lang::tr{'toggle enable disable'}) { $temp[2] = '' if ( $temp[2] eq '' ); @current[$settings{'KEY1'}] = join (',',@temp)."\n"; $settings{'KEY1'} = ''; # End edit mode - + &General::log($Lang::tr{'ip alias changed'}); - + #Save current open(FILE, ">$datafile") or die 'Unable to open aliases file.'; print FILE @current; close(FILE); - + # Rebuild configuration file &BuildConfiguration; @@ -230,7 +230,7 @@ if ($settings{'ACTION'} eq $Lang::tr{'add'}) { # Handle Suricata related actions. &HandleSuricata(); - + ## ## if entering data line is repetitive, choose here to not erase fields between each addition ## @@ -253,7 +253,7 @@ if ($settings{'ACTION'} eq $Lang::tr{'edit'}) { } if ($settings{'ACTION'} eq $Lang::tr{'remove'}) { - splice (@current,$settings{'KEY1'},1); # Delete line + splice (@current,$settings{'KEY1'},1); # Delete line open(FILE, ">$datafile") or die 'Unable to open aliases file.'; print FILE @current; close(FILE); @@ -291,7 +291,7 @@ if ($ENV{'QUERY_STRING'} =~ /$sortstring/ ) { if ($settings{'ACTION'} eq '' ) { # First launch from GUI $settings{'ENABLED'} ='on'; } - + &Header::openpage($Lang::tr{'external aliases configuration'}, 1, ''); &Header::openbigbox('100%', 'left', '', $errormessage); my %checked =(); # Checkbox manipulations @@ -314,7 +314,7 @@ END ; &Header::closebox(); } - + # # Second check box is for editing the list # @@ -406,7 +406,7 @@ foreach my $line (@current) { $gdesc = $Lang::tr{'click to disable'}; } else { $gif = 'off.gif'; - $gdesc = $Lang::tr{'click to enable'}; + $gdesc = $Lang::tr{'click to enable'}; } #Colorize each line @@ -488,7 +488,7 @@ END sub SortDataFile { our %entries = (); - + # Sort pair of record received in $a $b special vars. # When IP is specified use numeric sort else alpha. # If sortname ends with 'Rev', do reverse sort. @@ -527,27 +527,27 @@ sub SortDataFile foreach my $line (@current) { chomp( $line); #remove newline because can be on field 5 or 6 (addition of REMARK) my @temp = split (',',$line); - + # Build a pair 'Field Name',value for each of the data dataline. # Each SORTABLE field must have is pair. # Other data fields (non sortable) can be grouped in one - + # Exemple # F1,F2,F3,F4,F5 only F1 F2 for sorting # my @record = ('KEY',$key++, # 'F1',$temp[0], # 'F2',$temp[1], # 'DATA',join(',',@temp[2..4]) ); #group remainning values, with separator (,) - + # The KEY,key record permits doublons. If removed, then F1 becomes the key without doublon permitted. - - + + my @record = ('KEY',$key++,'IP',$temp[0],'ENABLED',$temp[1],'NAME',$temp[2]); my $record = {}; # create a reference to empty hash %{$record} = @record; # populate that hash with @record $entries{$record->{KEY}} = $record; # add this to a hash of hashes } - + open(FILE, ">$datafile") or die 'Unable to open aliases file.'; # Each field value is printed , with the newline ! Don't forget separator and order of them. @@ -562,7 +562,7 @@ sub SortDataFile close (FILE); } -# +# # Build the configuration file for application aliases # sub BuildConfiguration { diff --git a/html/cgi-bin/atm-status.cgi b/html/cgi-bin/atm-status.cgi index 49f19209d..fb38dc030 100644 --- a/html/cgi-bin/atm-status.cgi +++ b/html/cgi-bin/atm-status.cgi @@ -53,18 +53,18 @@ foreach (@modems){ my $value= `cat /sys/class/atm/$modem/parameters/$param`; chomp($param); chomp($value); - if (!($param =~"uevent") + if (!($param =~"uevent") && !($param =~"resource") && !($param eq "") ) { - + $lines++; if ($lines % 2){ print ""; }else{ print ""; } - print "$param$value "; + print "$param$value "; } } my @pfile = `grep . /sys/class/atm/$modem/device/* 2>/dev/null`; @@ -74,8 +74,8 @@ foreach (@modems){ my $value= `cat /sys/class/atm/$modem/device/$param`; chomp($param); chomp($value); - if (!($param =~"uevent") - && !($param =~"modalias") + if (!($param =~"uevent") + && !($param =~"modalias") && !($param =~"bInterface") && !($param =~"bAlternateSetting") && !($param =~"bNumEndpoints") @@ -83,14 +83,14 @@ foreach (@modems){ && !($param =~"resource") && !($param eq "") ) { - + $lines++; if ($lines % 2){ print ""; }else{ print ""; } - print "$param$value "; + print "$param$value "; } } print "
\n"; diff --git a/html/cgi-bin/chpasswd.cgi b/html/cgi-bin/chpasswd.cgi index 0a66062ed..4930c4ca3 100644 --- a/html/cgi-bin/chpasswd.cgi +++ b/html/cgi-bin/chpasswd.cgi @@ -240,7 +240,7 @@ sub readhash { $val =~ s/^\'//g; $val =~ s/\'$//g; - + # Untaint variables read from hash $var =~ /([A-Za-z0-9_-]*)/; $var = $1; $val =~ /([\w\W]*)/; $val = $1; diff --git a/html/cgi-bin/connections.cgi b/html/cgi-bin/connections.cgi index 10ac8748c..7f06a5594 100644 --- a/html/cgi-bin/connections.cgi +++ b/html/cgi-bin/connections.cgi @@ -57,7 +57,7 @@ if (length ($ENV{'QUERY_STRING'}) > 0){ ($name, $value) = split(/=/, $pair); $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # e.g. "%20" => " " $value =~ s/[^a-zA-Z0-9]*//g; # a-Z 0-9 will pass - $cgiin{$name} = $value; + $cgiin{$name} = $value; } } @@ -96,8 +96,8 @@ if ( $cgiin{'sort_field'} ~~ [ '1','2','3','4','5','6','7','8','9' ] ) { } # Read and sort the connection tracking table -# do sorting -if ($SORT_FIELD and $SORT_ORDER) { +# do sorting +if ($SORT_FIELD and $SORT_ORDER) { # field sorting when sorting arguments are sane open(CONNTRACK, "/usr/local/bin/getconntracktable | /usr/local/bin/consort.sh $SORT_FIELD $SORT_ORDER |") or die "Unable to read conntrack table"; } else { @@ -247,13 +247,13 @@ if (-e "${General::swroot}/ovpn/settings") { # Add OpenVPN net for custom OVPNs if (-e "${General::swroot}/ovpn/ccd.conf") { - open(OVPNSUB, "${General::swroot}/ovpn/ccd.conf"); + open(OVPNSUB, "${General::swroot}/ovpn/ccd.conf"); my @ovpnsub = ; close(OVPNSUB); foreach (@ovpnsub) { my ($network, $mask) = split '/', (split ',', $_)[2]; - + $mask = ipv4_cidr2msk($mask) unless &General::validip($mask); push(@network, $network); diff --git a/html/cgi-bin/connscheduler.cgi b/html/cgi-bin/connscheduler.cgi index 1393df65f..cc78cbc1b 100644 --- a/html/cgi-bin/connscheduler.cgi +++ b/html/cgi-bin/connscheduler.cgi @@ -138,7 +138,7 @@ if ( $cgiparams{'ACTION'} eq 'toggle' ) { $CONNSCHED::config[$cgiparams{'ID'}]{'ACTIVE'} = 'on'; } - + &CONNSCHED::WriteConfig; } @@ -194,7 +194,7 @@ if ( ($cgiparams{'ACTION'} eq 'add') || ($cgiparams{'ACTION'} eq 'update') ) if ( $cgiparams{'ACTION'} eq 'edit' ) { $i = $cgiparams{'ID'}; - + $selected_hour = substr($CONNSCHED::config[$i]{'TIME'},0,2); $selected_minute = substr($CONNSCHED::config[$i]{'TIME'},3,2); @@ -412,7 +412,7 @@ END my $col=""; for my $id ( 0 .. $#CONNSCHED::config ) { - if ( ($cgiparams{'ACTION'} eq 'edit') && ($id == $cgiparams{'ID'}) ) + if ( ($cgiparams{'ACTION'} eq 'edit') && ($id == $cgiparams{'ID'}) ) { print ""; $col="bgcolor='${Header::colouryellow}'"; @@ -422,7 +422,7 @@ for my $id ( 0 .. $#CONNSCHED::config ) print ""; $col="bgcolor='$color{'color20'}'"; } - else + else { print ""; $col="bgcolor='$color{'color22'}'"; diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi index f1fbfd235..0a0a21d68 100644 --- a/html/cgi-bin/dhcp.cgi +++ b/html/cgi-bin/dhcp.cgi @@ -47,7 +47,7 @@ my $warnNTPmessage = ''; my @nosaved=(); my %color = (); -#Basic syntax allowed for new Option definition. Not implemented: RECORDS & array of RECORDS +#Basic syntax allowed for new Option definition. Not implemented: RECORDS & array of RECORDS our $OptionTypes = 'boolean|((un)?signed )?integer (8|16|32)|ip-address|text|string|encapsulate \w+|array of ip-address'; &Header::showhttpheaders(); @@ -153,14 +153,14 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'save'}) { $errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid end address'}; goto ERROR; } - if (! &General::IpInSubnet ( $dhcpsettings{"START_ADDR_${itf}"}, + if (! &General::IpInSubnet ( $dhcpsettings{"START_ADDR_${itf}"}, $netsettings{"${itf}_NETADDRESS"}, $netsettings{"${itf}_NETMASK"})) { $errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid start address'}; goto ERROR; } } - + if ($dhcpsettings{"END_ADDR_${itf}"}) { if (!(&General::validip($dhcpsettings{"END_ADDR_${itf}"}))) { $errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid end address'}; @@ -170,9 +170,9 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'save'}) { $errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid start address'}; goto ERROR; } - if (! &General::IpInSubnet ( $dhcpsettings{"END_ADDR_${itf}"}, + if (! &General::IpInSubnet ( $dhcpsettings{"END_ADDR_${itf}"}, $netsettings{"${itf}_NETADDRESS"}, - $netsettings{"${itf}_NETMASK"})) { + $netsettings{"${itf}_NETMASK"})) { $errormessage = "DHCP on ${itf}: " . $Lang::tr{'invalid end address'}; goto ERROR; } @@ -214,7 +214,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'save'}) { goto ERROR; } if (! $dhcpsettings{"DNS1_${itf}"}) { - $errormessage = "DHCP on ${itf}: " . $Lang::tr{'cannot specify secondary dns without specifying primary'}; + $errormessage = "DHCP on ${itf}: " . $Lang::tr{'cannot specify secondary dns without specifying primary'}; goto ERROR; } } @@ -233,7 +233,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'save'}) { if (! $dhcpsettings{"WINS1_${itf}"} ) { $errormessage = "DHCP on ${itf}: " . $Lang::tr{'cannot specify secondary wins without specifying primary'}; goto ERROR; - } + } } if ($dhcpsettings{"NEXT_${itf}"}) { if (!(&General::validip($dhcpsettings{"NEXT_${itf}"}))) { @@ -295,14 +295,14 @@ if ($ENV{'QUERY_STRING'} =~ /^FETHER|^FIPADDR/ ) { &General::writehash($setting, \%dhcpsettings); &sortcurrent2; $dhcpsettings{'ACTION'} = 'SORT'; # create an 'ACTION' - map ($dhcpsettings{$_} = '',@nosaved,'KEY1','KEY2');# and reinit vars to empty + map ($dhcpsettings{$_} = '',@nosaved,'KEY1','KEY2');# and reinit vars to empty } #Sorting of allocated leases &Header::CheckSortOrder; -## Now manipulate the two multi-line list with Settings2. +## Now manipulate the two multi-line list with Settings2. # '1' suffix is for ADVANCED OPTIONS # '2' suffix is for FIXED LEASES @@ -319,12 +319,12 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'toggle enable disable'}.'1') { open(FILE, ">$filename1") or die 'Unable to open dhcp advanced options file.'; print FILE @current1; close(FILE); - + #Write changes to dhcpd.conf. &buildconf; } - + if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'1' && $dhcpsettings{'SUBMIT'} ne $Lang::tr{'dhcp advopt help'}) { @@ -334,7 +334,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'1' && if ($dhcpsettings{'ADVOPT_DATA'} eq '') { $errormessage=$Lang::tr{'dhcp advopt blank value'}; } - + # Test for a new option definition string (join field name & data) if (ExistNewOptionDefinition ($dhcpsettings{'ADVOPT_NAME'} . ' ' . $dhcpsettings{'ADVOPT_DATA'})) { #only edit permitted if option definition exists @@ -352,7 +352,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'1' && } unless ($errormessage) { - + my $scope = ''; foreach my $itf (@ITFs) { # buils "RED,GREEN,ORANGE,... based on selection $scope .= $dhcpsettings{"ADVOPT_SCOPE_${itf}"} eq 'on' ? "\t$itf" : "\toff" ; @@ -387,7 +387,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'edit'}.'1') { if ($itf ne 'off') # Only is an interface name is read { $dhcpsettings{"ADVOPT_SCOPE_${itf}"} = 'on'; - } + } } } @@ -416,7 +416,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'toggle enable disable'}.'2') { open(FILE, ">$filename2") or die 'Unable to open fixed leases file.'; print FILE @current2; close(FILE); - + #Write changes to dhcpd.conf. &buildconf; } @@ -428,7 +428,7 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { if ($dhcpsettings{'FIX_NEXTADDR'}) { unless(&General::validip($dhcpsettings{'FIX_NEXTADDR'})) { $errormessage = $Lang::tr{'invalid fixed ip address'}; } } - + my $key = 0; CHECK:foreach my $line (@current2) { my @temp = split(/\,/,$line); @@ -438,13 +438,13 @@ if ($dhcpsettings{'ACTION'} eq $Lang::tr{'add'}.'2') { # Also it may be needed to put duplicate fixed lease in their right subnet definition.. foreach my $itf (@ITFs) { my $scoped = &General::IpInSubnet($dhcpsettings{'FIX_ADDR'}, - $netsettings{"${itf}_NETADDRESS"}, + $netsettings{"${itf}_NETADDRESS"}, $netsettings{"${itf}_NETMASK"}) && $dhcpsettings{"ENABLE_${itf}"} eq 'on'; if ( $scoped && (lc($dhcpsettings{'FIX_MAC'}) eq lc($temp[0])) && &General::IpInSubnet($temp[1], - $netsettings{"${itf}_NETADDRESS"}, + $netsettings{"${itf}_NETADDRESS"}, $netsettings{"${itf}_NETMASK"})) { $errormessage = "$Lang::tr{'mac address in use'} $dhcpsettings{'FIX_MAC'}"; last CHECK; @@ -755,10 +755,10 @@ print <" : "disabled='disabled' />"; print "   "; @@ -812,7 +812,7 @@ if ($dhcpsettings{'SUBMIT'} eq $Lang::tr{'dhcp advopt help'}) { print 'wpadcode 252=text'; print 'wpad"http://www.server.fr/path-to/proxy.pac"'; print ''; - + } print <"; } else { - print ""; + print ""; } print < 1) { + if ($macdupl{$temp[0]} > 1) { $ipdup = 1; # Flag up duplicates for use later } $ipinuse{$temp[1]} += 1; - if ($ipinuse{$temp[1]} > 1) { + if ($ipinuse{$temp[1]} > 1) { $ipdup = 1; # Flag up duplicates for use later } # Mark IP addresses outwith known subnets $ipoutside{$temp[1]} = 1; foreach my $itf (@ITFs) { if ( &General::IpInSubnet($temp[1], - $netsettings{"${itf}_NETADDRESS"}, + $netsettings{"${itf}_NETADDRESS"}, $netsettings{"${itf}_NETMASK"})) { $ipoutside{$temp[1]} = 0; } @@ -1055,7 +1055,7 @@ foreach my $line (@current2) { $gdesc = $Lang::tr{'click to disable'}; } else { $gif = 'off.gif'; - $gdesc = $Lang::tr{'click to enable'}; + $gdesc = $Lang::tr{'click to enable'}; } # Skip all entries that do not match the search query @@ -1081,15 +1081,15 @@ foreach my $line (@current2) { my $TAG2 = ''; my $TAG3 = ''; my $TAG4 = ''; - if ($ipinuse{$temp[1]} > 1) { + if ($ipinuse{$temp[1]} > 1) { $TAG0 = ''; $TAG1 = ''; } - if ($macdupl{$temp[0]} > 1) { + if ($macdupl{$temp[0]} > 1) { $TAG2 = ''; $TAG3 = ''; } - if ($ipoutside{$temp[1]} > 0) { + if ($ipoutside{$temp[1]} > 0) { $TAG4 = "bgcolor='orange'" if ($dhcpsettings{'KEY2'} ne $key); } @@ -1230,7 +1230,7 @@ sub sortcurrent2 # use combination of ether & IP as key to allow duplicates in either but not both $entries{$record->{FETHER} . $record->{FIPADDR}} = $record; # add this to a hash of hashes } - + open(FILE, ">$filename2") or die 'Unable to open fixed lease file.'; foreach my $entry ( sort fixedleasesort keys %entries) { print FILE "$entries{$entry}->{FETHER},$entries{$entry}->{FIPADDR},$entries{$entry}->{DATA}\n"; @@ -1243,7 +1243,7 @@ sub sortcurrent2 close (FILE); undef (%entries); #This array is reused latter. Clear it. } - + # Build the configuration file mixing settings, fixed leases and advanced options sub buildconf { open(FILE, ">/${General::swroot}/dhcp/dhcpd.conf") or die "Unable to write dhcpd.conf file"; @@ -1263,7 +1263,7 @@ sub buildconf { } else { print FILE "ddns-update-style none;\n"; } - + # Write first new option definition foreach my $line (@current1) { chomp($line); # remove newline @@ -1276,7 +1276,7 @@ sub buildconf { foreach my $line (@current1) { chomp($line); # remove newline my @temp = split(/\t/,$line); - + if ($temp[0] eq 'on' && !ExistNewOptionDefinition ($temp[1] . ' ' . $temp[2])){ # active & !definition my $global=1; for (my $key=0; $key<@ITFs; $key++) { @@ -1289,7 +1289,7 @@ sub buildconf { if ($global) { print FILE "option $temp[1] $temp[2];\n"; } - }# on + }# on }# foreach line print FILE "\n"; @@ -1329,7 +1329,7 @@ sub buildconf { foreach my $line (@current1) { chomp($line); # remove newline my @temp = split(/\t/,$line); # Use TAB separator ! - + if ($temp[0] eq 'on'){ for (my $key=0; $key<@ITFs; $key++) { if ($itf eq $temp[3+$key]) # Only is an interface name is read @@ -1337,7 +1337,7 @@ sub buildconf { print FILE "\toption $temp[1] $temp[2];\n"; } } - }# on + }# on }# foreach line print FILE "} #$itf\n\n"; diff --git a/html/cgi-bin/dnsforward.cgi b/html/cgi-bin/dnsforward.cgi index e2843a81f..4af5ed200 100644 --- a/html/cgi-bin/dnsforward.cgi +++ b/html/cgi-bin/dnsforward.cgi @@ -18,7 +18,7 @@ # along with this program. If not, see . # # # ############################################################################### - + use strict; # enable only the following on debugging purpose diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index 154efd7b2..36c0efc2e 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -100,8 +100,8 @@ END ; &General::system("/usr/local/bin/extrahdctrl", "mount", "$extrahdsettings{'PATH'}"); } -} -elsif ($extrahdsettings{'ACTION'} eq $Lang::tr{'delete'}) +} +elsif ($extrahdsettings{'ACTION'} eq $Lang::tr{'delete'}) { if ( &General::system("/usr/local/bin/extrahdctrl", "umount", "$extrahdsettings{'PATH'}")) { open( FILE, "< $devicefile" ) or die "Unable to read $devicefile"; diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi index 1341f5209..681d42770 100644 --- a/html/cgi-bin/firewall.cgi +++ b/html/cgi-bin/firewall.cgi @@ -100,7 +100,7 @@ my @protocols; &General::readhash("${General::swroot}/firewall/settings", \%fwdfwsettings); &General::readhash("${General::swroot}/main/settings", \%mainsettings); &General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color); -&General::readhash($fwoptions, \%optionsfw); +&General::readhash($fwoptions, \%optionsfw); &General::readhash($ifacesettings, \%ifaces); &General::readhash("$configovpn", \%ovpnsettings); &General::readhash("$configipsecrw", \%ipsecsettings); @@ -554,7 +554,7 @@ sub checksource if (&General::validport($_)){ push (@values,$_); }else{ - + } } } @@ -836,7 +836,7 @@ sub checkrule if (&General::validport($_)){ push (@values,$_); }else{ - + } } } @@ -974,16 +974,16 @@ sub checkvpn # A Test if manual ip is part of dynamic openvpn subnet is made in getcolor # because if one creates a custom host with the ip, we need to check the color there! # It does not make sense to check this here - + # Test if manual IP is part of an OpenVPN N2N subnet does also not make sense here # Is also checked in getcolor - + # Test if manual ip is part of an IPsec Network is also checked in getcolor return 1; } sub checkvpncolor { - + } sub deleterule { @@ -1247,7 +1247,7 @@ END print"$Lang::tr{'fwhost ipsec net'}"; } if ($show eq '1'){$show='';print"";} - + print""; print"
"; } @@ -1585,10 +1585,10 @@ sub newrule $fwdfwsettings{'RULE_ACTION'} = $hash{$key}[0]; $fwdfwsettings{'chain'} = $hash{$key}[1]; $fwdfwsettings{'ACTIVE'} = $hash{$key}[2]; - $fwdfwsettings{'grp1'} = $hash{$key}[3]; - $fwdfwsettings{$fwdfwsettings{'grp1'}} = $hash{$key}[4]; - $fwdfwsettings{'grp2'} = $hash{$key}[5]; - $fwdfwsettings{$fwdfwsettings{'grp2'}} = $hash{$key}[6]; + $fwdfwsettings{'grp1'} = $hash{$key}[3]; + $fwdfwsettings{$fwdfwsettings{'grp1'}} = $hash{$key}[4]; + $fwdfwsettings{'grp2'} = $hash{$key}[5]; + $fwdfwsettings{$fwdfwsettings{'grp2'}} = $hash{$key}[6]; $fwdfwsettings{'USE_SRC_PORT'} = $hash{$key}[7]; $fwdfwsettings{'PROT'} = $hash{$key}[8]; $fwdfwsettings{'ICMP_TYPES'} = $hash{$key}[9]; @@ -1695,7 +1695,7 @@ sub newrule if ( &General::IpInSubnet($sip,$netsettings{'ORANGE_ADDRESS'},$netsettings{'ORANGE_NETMASK'})){ $fwdfwsettings{'oldorange'} ='on'; } - } + } } # Split manual source and target address and delete the subnet my ($sip,$scidr) = split("/",$fwdfwsettings{$fwdfwsettings{'grp1'}}); @@ -1811,7 +1811,7 @@ END #---TARGET------------------------------------------------------ &Header::openbox('100%', 'left', $Lang::tr{'fwdfw target'}); print< + END print""; if($fwdfwsettings{'updatefwrule'} eq 'on' || $fwdfwsettings{'copyfwrule'} eq 'on'){ print "
$Lang::tr{'fwdfw targetip'}Firewall
$Lang::tr{'remark'}:
$Lang::tr{'fwdfw rulepos'}: END @@ -2590,7 +2590,7 @@ END $color="$color{'color14'}"; $coloryellow=''; }elsif($coloryellow eq ''){ - if ($count % 2){ + if ($count % 2){ $color="$color{'color22'}"; } else{ diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index c66e3002a..baf745a0a 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -145,7 +145,7 @@ if ($fwhostsettings{'ACTION'} eq 'updatenet' ) $fwhostsettings{'netremark'} = $customnetwork{$key}[3]; $fwhostsettings{'count'} = $customnetwork{$key}[4]; delete $customnetwork{$key}; - + } } &General::writehasharray("$confignet", \%customnetwork); @@ -284,7 +284,7 @@ if ($fwhostsettings{'ACTION'} eq 'savenet' ) #convert ip if leading '0' exists $fwhostsettings{'IP'} = &Network::ip_remove_zero($fwhostsettings{'IP'}); - #check valid ip + #check valid ip if (!&General::validipandmask($fwhostsettings{'IP'}."/".$fwhostsettings{'SUBNET'})) { $errormessage=$errormessage.$Lang::tr{'fwhost err addr'}; @@ -448,7 +448,7 @@ if ($fwhostsettings{'ACTION'} eq 'savehost') } } #only check plausi when no error till now - if (!$errormessage){ + if (!$errormessage){ &plausicheck("edithost"); } if($fwhostsettings{'actualize'} eq 'on' && $fwhostsettings{'newhost'} ne 'on' && $errormessage){ @@ -465,7 +465,7 @@ if ($fwhostsettings{'ACTION'} eq 'savehost') $customhost{$key}[3] = $fwhostsettings{'orgremark'}; &General::writehasharray("$confighost", \%customhost); undef %customhost; - } + } if (!$errormessage){ #get count if host was edited if($fwhostsettings{'actualize'} eq 'on'){ @@ -560,7 +560,7 @@ if ($fwhostsettings{'ACTION'} eq 'savegrp') #check standard networks if ($fwhostsettings{'grp2'} eq 'std_net'){ @target=$fwhostsettings{'DEFAULT_SRC_ADR'}; - $type='Standard Network'; + $type='Standard Network'; } #check custom networks if ($fwhostsettings{'grp2'} eq 'cust_net' && $fwhostsettings{'CUST_SRC_NET'} ne ''){ @@ -626,7 +626,7 @@ if ($fwhostsettings{'ACTION'} eq 'savegrp') $fwhostsettings{'remark'}=''; } #check if host/net exists in grp - + my $test="$grp,$fwhostsettings{'oldremark'},@target,$type"; foreach my $key (keys %customgrp) { my $test1="$customgrp{$key}[0],$customgrp{$key}[1],$customgrp{$key}[2],$customgrp{$key}[3]"; @@ -636,7 +636,7 @@ if ($fwhostsettings{'ACTION'} eq 'savegrp') } } } - + if (!$errormessage){ #on first save, we have an empty @target, so fill it with nothing my $targetvalues=@target; @@ -1168,7 +1168,7 @@ if ($fwhostsettings{'ACTION'} eq 'changegrpremark') { $customgrp{$key}[1]=''; $customgrp{$key}[1]=$fwhostsettings{'newrem'}; - } + } } &General::writehasharray("$configgrp", \%customgrp); $fwhostsettings{'update'}='on'; @@ -1218,7 +1218,7 @@ if ($fwhostsettings{'ACTION'} eq 'changesrvgrpremark') { $customservicegrp{$key}[1]=''; $customservicegrp{$key}[1]=$fwhostsettings{'newsrvrem'}; - } + } } &General::writehasharray("$configsrvgrp", \%customservicegrp); $fwhostsettings{'updatesrvgrp'}='on'; @@ -1323,7 +1323,7 @@ sub showmenu {
END &Header::closebox(); - + } # Add sub addnet @@ -1367,11 +1367,11 @@ END if ($fwhostsettings{'ACTION'} eq 'edithost' || $fwhostsettings{'error'} eq 'on') { - + print " "; }else{ print " "; - } + } print "
"; &Header::closebox(); } @@ -1397,7 +1397,7 @@ sub addgrp $fwhostsettings{'oldgrpname'}=$fwhostsettings{'grp_name'}; my $grp=$fwhostsettings{'grp_name'}; my $rem=$fwhostsettings{'remark'}; - if ($fwhostsettings{'update'} eq ''){ + if ($fwhostsettings{'update'} eq ''){ print< @@ -1869,9 +1869,9 @@ sub viewtablenet &General::readhasharray("$fwconfiginp", \%fwinp); &General::readhasharray("$fwconfigout", \%fwout); - if (!keys %customnetwork) - { - print "
$Lang::tr{'fwhost empty'}"; + if (!keys %customnetwork) + { + print "
$Lang::tr{'fwhost empty'}"; }else{ print< @@ -1885,7 +1885,7 @@ END print" "; $col="bgcolor='${Header::colouryellow}'"; }elsif ($count % 2) - { + { $col="bgcolor='$color{'color20'}'"; print" "; }else @@ -1915,7 +1915,7 @@ END } print""; &Header::closebox(); - } + } } sub getcolor @@ -2015,9 +2015,9 @@ sub viewtablehost &General::readhasharray("$fwconfiginp", \%fwinp); &General::readhasharray("$fwconfigout", \%fwout); &General::readhasharray("$configgrp", \%customgrp); - if (!keys %customhost) - { - print "
$Lang::tr{'fwhost empty'}"; + if (!keys %customhost) + { + print "
$Lang::tr{'fwhost empty'}"; }else{ print< @@ -2085,7 +2085,7 @@ sub viewtablegrp my $delflag; my @counter; my %hash; - if (!keys %customgrp) + if (!keys %customgrp) { print "
$Lang::tr{'fwhost err emptytable'}"; }else{ @@ -2136,7 +2136,7 @@ sub viewtablegrp print""; $col="bgcolor='$color{'color22'}'"; } - my $ip=&getipforgroup($customgrp{$key}[2],$customgrp{$key}[3]); + my $ip=&getipforgroup($customgrp{$key}[2],$customgrp{$key}[3]); if ($ip eq ''){ print""; $col="bgcolor='${Header::colouryellow}'"; @@ -2548,7 +2548,7 @@ sub checkname } } return 1; - + } sub checkgroup { @@ -2574,7 +2574,7 @@ sub checkservice } sub checkip { - + my %hash=%{(shift)}; my $a=shift; foreach my $key (keys %hash) { @@ -2603,7 +2603,7 @@ sub checkservicegroup foreach my $key (keys %customservicegrp) { if( $customservicegrp{$key}[0] eq $fwhostsettings{'SRVGRP_NAME'} ){ $errormessage.=$Lang::tr{'fwhost err grpexist'}."
"; - + } } } @@ -2667,7 +2667,7 @@ sub get_name foreach my $network (sort keys %defaultNetworks) { return "$network" if ($val eq $defaultNetworks{$network}{'NAME'}); - } + } } sub gethostcount { @@ -2827,7 +2827,7 @@ sub deletefromgrp } } &General::writehasharray("$config",\%hash); - + } sub plausicheck { @@ -2893,13 +2893,13 @@ sub plausicheck $errormessage=$errormessage."
".$Lang::tr{'fwhost err netexist'}; $fwhostsettings{'HOSTNAME'} = $fwhostsettings{'orgname'}; if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}=$edit;} - } - #check if network ip already exists + } + #check if network ip already exists if (!&checkip(\%customnetwork,1)) { $errormessage=$errormessage."
".$Lang::tr{'fwhost err net'}; if ($fwhostsettings{'update'} eq 'on'){$fwhostsettings{'ACTION'}=$edit;} - } + } #check if host with this name already exists &General::readhasharray("$confighost", \%customhost); if (!&checkname(\%customhost)) @@ -2920,7 +2920,7 @@ sub getipforgroup my $name=$_[0], my $type=$_[1]; my $value; - + #get address from IPSEC NETWORK if ($type eq 'IpSec Network'){ foreach my $key (keys %ipsecconf) { @@ -2946,7 +2946,7 @@ sub getipforgroup } &deletefromgrp($name,$configgrp); } - + #get address from IPSEC HOST if ($type eq 'IpSec Host'){ foreach my $key (keys %ipsecconf) { @@ -2956,7 +2956,7 @@ sub getipforgroup } &deletefromgrp($name,$configgrp); } - + #get address from ovpn ccd Net-2-Net if ($type eq 'OpenVPN N-2-N'){ foreach my $key (keys %ccdhost) { @@ -2968,7 +2968,7 @@ sub getipforgroup } &deletefromgrp($name,$configgrp); } - + #get address from ovpn ccd static host if ($type eq 'OpenVPN static host'){ foreach my $key (keys %ccdhost) { @@ -2980,7 +2980,7 @@ sub getipforgroup } &deletefromgrp($name,$configgrp); } - + #get address from ovpn ccd static net if ($type eq 'OpenVPN static network'){ foreach my $key (keys %ccdnet) { @@ -2991,7 +2991,7 @@ sub getipforgroup } } } - + #check custom addresses if ($type eq 'Custom Host'){ foreach my $key (keys %customhost) { @@ -3001,7 +3001,7 @@ sub getipforgroup } } } - + ##check custom networks if ($type eq 'Custom Network'){ foreach my $key (keys %customnetwork) { @@ -3010,7 +3010,7 @@ sub getipforgroup } } } - + #check standard networks if ($type eq 'Standard Network'){ if ($name =~ /OpenVPN/i){ @@ -3060,7 +3060,7 @@ sub decrease } } } - + if (($customgrp{$key}[0] eq $grp) && ($customgrp{$key}[3] eq 'Custom Host')){ foreach my $key2 (sort keys %customhost){ if ($customhost{$key2}[0] eq $customgrp{$key}[2]){ @@ -3068,7 +3068,7 @@ sub decrease last; } } - + } } &General::writehasharray("$confignet", \%customnetwork); @@ -3079,7 +3079,7 @@ sub decreaseservice my $grp=$_[0]; &General::readhasharray("$configsrv", \%customservice); &General::readhasharray("$configsrvgrp", \%customservicegrp); - + foreach my $key (sort keys %customservicegrp){ if ($customservicegrp{$key}[0] eq $grp ){ foreach my $key2 (sort keys %customservice){ @@ -3090,7 +3090,7 @@ sub decreaseservice } } &General::writehasharray("$configsrv", \%customservice); - + } sub changenameinfw { @@ -3130,7 +3130,7 @@ sub changenameinfw } sub checkports { - + my %hash=%{(shift)}; #check empty fields if ($fwhostsettings{'SRV_NAME'} eq '' ){ @@ -3145,7 +3145,7 @@ sub checkports } #change dashes with : $fwhostsettings{'SRV_PORT'}=~ tr/-/:/; - + if ($fwhostsettings{'SRV_PORT'} eq "*") { $fwhostsettings{'SRV_PORT'} = "1:65535"; } diff --git a/html/cgi-bin/getrrdimage.cgi b/html/cgi-bin/getrrdimage.cgi index 26bcf0905..26e026bba 100644 --- a/html/cgi-bin/getrrdimage.cgi +++ b/html/cgi-bin/getrrdimage.cgi @@ -52,8 +52,8 @@ my $range = lc $query{'range'}; # lower case unless(($origin =~ /^\w+?\.cgi$/) && ($graph =~ /^[\w\-.,; ]+?$/) && ($range ~~ @Graphs::time_ranges)) { # Send HTTP headers _start_svg_output(); - - _print_error("URL parameters missing or malformed."); + + _print_error("URL parameters missing or malformed."); exit; } @@ -62,13 +62,13 @@ unless(($origin =~ /^\w+?\.cgi$/) && ($graph =~ /^[\w\-.,; ]+?$/) && ($range ~~ unless(($origin ~~ @supported_origins) || ($origin eq "getrrdimage.cgi")) { # Rewrite to old URL format: /[graph origin cgi]?[graph name]?[time range] my $location = "https://$ENV{'SERVER_NAME'}:$ENV{'SERVER_PORT'}/cgi-bin/${origin}?${graph}?${range}"; - + # Send HTTP redirect print "Status: 302 Found\n"; print "Location: $location\n"; print "Content-type: text/html; charset=UTF-8\n"; print "\n"; # End of HTTP headers - + print "Unsupported origin, request redirected to '$location'"; exit; } diff --git a/html/cgi-bin/gpl.cgi b/html/cgi-bin/gpl.cgi index 140fd2178..029b048e8 100644 --- a/html/cgi-bin/gpl.cgi +++ b/html/cgi-bin/gpl.cgi @@ -57,7 +57,7 @@ print <
END -; +; if ( -e "/usr/share/doc/licenses/GPLv3" ) { print '$Lang::tr{'ccd iroutehint'}
$Lang::tr{'ccd iroute2'} DNS2: WINS:

- + END ; &Header::closebox(); @@ -5147,7 +5147,7 @@ END } } } - + #default setzen if ($cgiparams{'DCIPHER'} eq '') { $cgiparams{'DCIPHER'} = 'AES-256-CBC'; @@ -5275,8 +5275,8 @@ END $activeonrun = ""; } else { $activeonrun = "disabled='disabled'"; - } - &Header::openbox('100%', 'LEFT', $Lang::tr{'global settings'}); + } + &Header::openbox('100%', 'LEFT', $Lang::tr{'global settings'}); print <
@@ -5293,7 +5293,7 @@ END print "$Lang::tr{'ovpn on blue'}"; print ""; } - if (&haveOrangeNet()) { + if (&haveOrangeNet()) { print "$Lang::tr{'ovpn on orange'}"; print ""; } @@ -5310,7 +5310,7 @@ END $Lang::tr{'ovpn subnet'}
$Lang::tr{'protocol'} + $Lang::tr{'destination port'}: $Lang::tr{'MTU'}  @@ -5363,12 +5363,12 @@ END

END -; - +; + if ( $srunning eq "yes" ) { print ""; print ""; - print ""; + print ""; print ""; } else{ print ""; @@ -5378,13 +5378,13 @@ END -e "${General::swroot}/ovpn/ca/dh1024.pem" && -e "${General::swroot}/ovpn/certs/servercert.pem" && -e "${General::swroot}/ovpn/certs/serverkey.pem") && - (( $cgiparams{'ENABLED'} eq 'on') || + (( $cgiparams{'ENABLED'} eq 'on') || ( $cgiparams{'ENABLED_BLUE'} eq 'on') || ( $cgiparams{'ENABLED_ORANGE'} eq 'on'))){ print ""; } else { - print ""; - } + print ""; + } } print "
"; &Header::closebox(); @@ -5476,7 +5476,7 @@ END my @output = ""; my @tustate = ""; my $tport = $confighash{$key}[22]; - my $tnet = new Net::Telnet ( Timeout=>5, Errmode=>'return', Port=>$tport); + 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)/'); @@ -5526,7 +5526,7 @@ END print <$active - +
@@ -5560,7 +5560,7 @@ END ; } else { print " "; } - if ($confighash{$key}[4] eq 'cert' && -f "${General::swroot}/ovpn/certs/$confighash{$key}[1].p12") { + if ($confighash{$key}[4] eq 'cert' && -f "${General::swroot}/ovpn/certs/$confighash{$key}[1].p12") { print < @@ -5929,7 +5929,7 @@ END - +

END ; diff --git a/html/cgi-bin/proxy.cgi b/html/cgi-bin/proxy.cgi index 8faf4490c..0111a240b 100644 --- a/html/cgi-bin/proxy.cgi +++ b/html/cgi-bin/proxy.cgi @@ -3606,7 +3606,7 @@ END print ASNBLFILE</dev/null"); } else { diff --git a/html/cgi-bin/routing.cgi b/html/cgi-bin/routing.cgi index e69dc425a..109fc3e3e 100644 --- a/html/cgi-bin/routing.cgi +++ b/html/cgi-bin/routing.cgi @@ -49,7 +49,7 @@ $settings{'IP'} = ''; $settings{'GATEWAY'} = ''; $settings{'REMARK'} = ''; my @nosaved=('EN','IP','GATEWAY','REMARK'); # List here ALL setting2 fields. Mandatory - + $settings{'ACTION'} = ''; # add/edit/remove $settings{'KEY1'} = ''; # point record for ACTION @@ -105,14 +105,14 @@ if ($settings{'ACTION'} eq $Lang::tr{'toggle enable disable'}) { $temp[0] = $temp[0] ne '' ? '' : 'on'; # Toggle the field @current[$settings{'KEY1'}] = join (',',@temp)."\n"; $settings{'KEY1'} = ''; # End edit mode - + &General::log($Lang::tr{'routing config changed'}); #Save current open(FILE, ">$datafile") or die 'routing datafile error'; print FILE @current; close(FILE); - + # Rebuild configuration file &BuildConfiguration; } @@ -174,7 +174,7 @@ if ($settings{'ACTION'} eq $Lang::tr{'add'}) { # Write changes to config file. &SortDataFile; # sort newly added/modified entry &BuildConfiguration; # then re-build routing - + #map ($settings{$_}='' ,@nosaved); # Clear fields } } @@ -192,7 +192,7 @@ if ($settings{'ACTION'} eq $Lang::tr{'edit'}) { } if ($settings{'ACTION'} eq $Lang::tr{'remove'}) { - splice (@current,$settings{'KEY1'},1); # Delete line + splice (@current,$settings{'KEY1'},1); # Delete line open(FILE, ">$datafile") or die 'route datafile error'; print FILE @current; close(FILE); @@ -315,7 +315,7 @@ foreach my $line (@current) { $gdesc = $Lang::tr{'click to disable'}; } else { $gif = 'off.gif'; - $gdesc = $Lang::tr{'click to enable'}; + $gdesc = $Lang::tr{'click to enable'}; } #Colorize each line @@ -405,7 +405,7 @@ if ( $output != "" ) { sub SortDataFile { our %entries = (); - + # Sort pair of record received in $a $b special vars. # When IP is specified use numeric sort else alpha. # If sortname ends with 'Rev', do reverse sort. @@ -449,13 +449,13 @@ sub SortDataFile # Build a pair 'Field Name',value for each of the data dataline. # Each SORTABLE field must have is pair. # Other data fields (non sortable) can be grouped in one - + my @record = ('KEY',$key++,'EN',$temp[0],'IP',$temp[1],'GATEWAY',$temp[2],'REMARK',$temp[3]); my $record = {}; # create a reference to empty hash %{$record} = @record; # populate that hash with @record $entries{$record->{KEY}} = $record; # add this to a hash of hashes } - + open(FILE, ">$datafile") or die 'routing datafile error'; # Each field value is printed , with the newline ! Don't forget separator and order of them. diff --git a/html/cgi-bin/samba.cgi b/html/cgi-bin/samba.cgi index 9289b4519..0a3cd8c04 100644 --- a/html/cgi-bin/samba.cgi +++ b/html/cgi-bin/samba.cgi @@ -142,7 +142,7 @@ if ($sambasettings{'ACTION'} eq $Lang::tr{'save'}) { } &General::readhash("${General::swroot}/samba/settings", \%sambasettings); - + if ($errormessage) { @@ -759,7 +759,7 @@ sub isrunning { if (/^Name:\W+(.*)/) { - $testcmd = $1; + $testcmd = $1; } } close FILE; @@ -775,7 +775,7 @@ sub isrunning sub writeconfiguration() { open (FILE, ">${General::swroot}/samba/global") or die "Can't save the global settings: $!"; flock (FILE, 2); - + print FILE <$Lang::tr{'green'}"; -if (&haveBlueNet()) +if (&haveBlueNet()) { print ""; } -if (&haveOrangeNet()) +if (&haveOrangeNet()) { print ""; } @@ -269,7 +269,7 @@ print <\n"; print ""; @@ -309,12 +309,12 @@ for $i ( 0 .. $#wol_devices ) my $wol_iface = $wol_devices[$i]{'IFace'}; my $wol_txt = &Header::cleanhtml($wol_devices[$i]{'Comment'}); - if ( (($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update')) && ($i == $cgiparams{'ID'}) ) + if ( (($cgiparams{'ACTION'} eq 'edit') || ($cgiparams{'ACTION'} eq 'update')) && ($i == $cgiparams{'ID'}) ) { print ""; $col="bgcolor='${Header::colouryellow}'"; } - elsif ( $i % 2) + elsif ( $i % 2) { print ""; $col="bgcolor='$color{'color20'}'"; @@ -332,7 +332,7 @@ for $i ( 0 .. $#wol_devices ) END ; - if ( (($wol_iface eq 'blue') && ! &haveBlueNet()) + if ( (($wol_iface eq 'blue') && ! &haveBlueNet()) || (($wol_iface eq 'orange') && ! &haveOrangeNet()) ) { # configured IFace (momentarily) not available -> now wakeup button/image @@ -384,7 +384,7 @@ sub ReadConfig { # datafileformat: # ID,MAC,IFACE,,Comment - # + # my @tmpfile = (); if ( open(FILE, "$datafile") ) { @@ -421,14 +421,14 @@ sub WriteConfig unless(&General::validmac($wol_devices[$i]{'MAC'})) { next; } unshift (@tmp_clients, uc($wol_devices[$i]{'MAC'}).",$wol_devices[$i]{'IFace'},,$wol_devices[$i]{'Comment'}"); } - + # sort tmp_clients on MAC @tmp_clients = sort ( @tmp_clients ); open(FILE, ">$datafile") or die 'hosts datafile error'; my $count = 0; - foreach $line (@tmp_clients) + foreach $line (@tmp_clients) { print FILE "$count,$line\n"; $count++; diff --git a/html/cgi-bin/webaccess.cgi b/html/cgi-bin/webaccess.cgi index 934fe6beb..b819dd309 100644 --- a/html/cgi-bin/webaccess.cgi +++ b/html/cgi-bin/webaccess.cgi @@ -82,7 +82,7 @@ if ((-e $svhosts_file) && (!-z $svhosts_file)) if (($cgiparams{'ACTION'} eq 'submit') && ($is_supervisor)) { - if ( ($cgiparams{'PASSWORD'} eq $proxysettings{'SUPERVISOR_PASSWORD'}) && (!($proxysettings{'SUPERVISOR_PASSWORD'} eq '')) || + if ( ($cgiparams{'PASSWORD'} eq $proxysettings{'SUPERVISOR_PASSWORD'}) && (!($proxysettings{'SUPERVISOR_PASSWORD'} eq '')) || ((defined($proxysettings{'SUPERVISOR_PASSWORD'})) && ($proxysettings{'SUPERVISOR_PASSWORD'} eq ''))) { &write_acl; @@ -269,7 +269,7 @@ sub readhash { $val =~ s/^\'//g; $val =~ s/\'$//g; - + # Untaint variables read from hash $var =~ /([A-Za-z0-9_-]*)/; $var = $1; $val =~ /([\w\W]*)/; $val = $1; diff --git a/html/cgi-bin/wireless.cgi b/html/cgi-bin/wireless.cgi index 35bdaaa60..27a2d9dd7 100644 --- a/html/cgi-bin/wireless.cgi +++ b/html/cgi-bin/wireless.cgi @@ -39,7 +39,7 @@ my %checked=(); my $errormessage = ''; my $filename = "${General::swroot}/wireless/config"; my $hostsfile = "${General::swroot}/main/hosts"; -our %dhcpsettings=(); +our %dhcpsettings=(); our %netsettings=(); $cgiparams{'ENABLED'} = 'off'; @@ -92,9 +92,9 @@ if ($cgiparams{'ACTION'} eq 'add') { $cgiparams{'SOURCE_IP'} = 'NONE'; } else { - unless(&General::validipormask($cgiparams{'SOURCE_IP'})) + unless(&General::validipormask($cgiparams{'SOURCE_IP'})) { - $errormessage = $Lang::tr{'invalid fixed ip address'}; + $errormessage = $Lang::tr{'invalid fixed ip address'}; goto ADDERROR; } } @@ -102,9 +102,9 @@ if ($cgiparams{'ACTION'} eq 'add') { $cgiparams{'SOURCE_MAC'} = 'NONE'; } else { - unless(&General::validmac($cgiparams{'SOURCE_MAC'})) - { - $errormessage = $Lang::tr{'invalid fixed mac address'}; + unless(&General::validmac($cgiparams{'SOURCE_MAC'})) + { + $errormessage = $Lang::tr{'invalid fixed mac address'}; } } @@ -323,7 +323,7 @@ foreach my $line (@current) } if ( $hname eq "" ) { my ($aliases, $addrtype, $length, @addrs); - ($hname, $aliases, $addrtype, $length, @addrs) = + ($hname, $aliases, $addrtype, $length, @addrs) = gethostbyaddr(pack("C4", split(/\./, $sourceip)), 2); } } diff --git a/html/cgi-bin/wirelessclient.cgi b/html/cgi-bin/wirelessclient.cgi index 7cd23aed4..00d177904 100644 --- a/html/cgi-bin/wirelessclient.cgi +++ b/html/cgi-bin/wirelessclient.cgi @@ -303,7 +303,7 @@ END $gdesc = $Lang::tr{'click to disable'}; } else { $gif = 'off.gif'; - $gdesc = $Lang::tr{'click to enable'}; + $gdesc = $Lang::tr{'click to enable'}; } # Colorize each line @@ -576,7 +576,7 @@ sub showEditBox() {

- + $Lang::tr{'wlan client advanced settings'}: diff --git a/html/cgi-bin/zoneconf.cgi b/html/cgi-bin/zoneconf.cgi index 62f18e308..07a1f51da 100644 --- a/html/cgi-bin/zoneconf.cgi +++ b/html/cgi-bin/zoneconf.cgi @@ -67,7 +67,7 @@ my $extraHead = <= 1) && ($vlan_tag <= 4094)) { $VALIDATE_error = $Lang::tr{"zoneconf val vlan tag range error"}; @@ -507,7 +507,7 @@ END if ($access_selected{"NONE"} eq "") { $highlight = $_; } - + print <