This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree".
The branch, next has been updated via 82e2a565bb054dd889b24a9418006f0abfe99cfa (commit) via 21b4b0c78b215763b2aacde13306a2c56fbcb00b (commit) via c27b8825beeed2f45b5c6caa507363982675bd10 (commit) via 934a376918ac343b299b6ffcc5d71d2a9d69cefa (commit) from 449b1aeea70881b1c1cb228e644988ad38001497 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 82e2a565bb054dd889b24a9418006f0abfe99cfa Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Oct 23 10:08:07 2020 +0000
Update credits.cgi
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
commit 21b4b0c78b215763b2aacde13306a2c56fbcb00b Author: Michael Tremer michael.tremer@ipfire.org Date: Fri Oct 23 10:07:37 2020 +0000
Update languages
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
commit c27b8825beeed2f45b5c6caa507363982675bd10 Author: Leo-Andres Hofmann hofmann@leo-andres.de Date: Wed Oct 21 12:48:33 2020 +0100
Improve DHCP dynamic leases list usability. Active and expired leases are now grouped and the list is divided by a horizontal line. Sorting and creating static leases remains unchanged.
Signed-off-by: Leo-Andres Hofmann hofmann@leo-andres.de Signed-off-by: Michael Tremer michael.tremer@ipfire.org
commit 934a376918ac343b299b6ffcc5d71d2a9d69cefa Author: Leo-Andres Hofmann hofmann@leo-andres.de Date: Wed Oct 21 12:48:30 2020 +0100
Improve indentation and HTML output of PrintActualLeases & leasesort
Signed-off-by: Leo-Andres Hofmann hofmann@leo-andres.de Signed-off-by: Michael Tremer michael.tremer@ipfire.org
-----------------------------------------------------------------------
Summary of changes: config/cfgroot/header.pl | 197 ++++++++++++++++++++++++++--------------------- doc/language_issues.en | 2 +- html/cgi-bin/credits.cgi | 10 ++- 3 files changed, 117 insertions(+), 92 deletions(-)
Difference in files: diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index 1046f5992..e2e6fd689 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -403,87 +403,106 @@ sub PrintActualLeases <th width='25%' align='center'><a href='$ENV{'SCRIPT_NAME'}?ETHER'><b>$tr{'mac address'}</b></a></th> <th width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?HOSTNAME'><b>$tr{'hostname'}</b></a></th> <th width='25%' align='center'><a href='$ENV{'SCRIPT_NAME'}?ENDTIME'><b>$tr{'lease expires'} (local time d/m/y)</b></a></th> -<th width='5%' align='center'><b>Add to fix leases<b></th> +<th width='5%' align='center'><b>Add to fix leases</b></th> </tr> END ;
open(LEASES,"/var/state/dhcp/dhcpd.leases") or die "Can't open dhcpd.leases"; - while ($line = <LEASES>) { - next if( $line =~ /^\s*#/ ); - chomp($line); - @temp = split (' ', $line); - - if ($line =~ /^\s*lease/) { - $ip = $temp[1]; - #All field are not necessarily read. Clear everything - $endtime = 0; - $ether = ""; - $hostname = ""; - } + while (my $line = <LEASES>) { + next if( $line =~ /^\s*#/ ); + chomp($line); + @temp = split (' ', $line); + + if ($line =~ /^\s*lease/) { + $ip = $temp[1]; + #All field are not necessarily read. Clear everything + $endtime = 0; + $endtime_print = ""; + $expired = 0; + $ether = ""; + $hostname = ""; + }
- if ($line =~ /^\s*ends/) { - $line =~ /(\d+)/(\d+)/(\d+) (\d+):(\d+):(\d+)/; - $endtime = timegm($6, $5, $4, $3, $2 - 1, $1 - 1900); - } + if ($line =~ /^\s*ends/) { + $line =~ /(\d+)/(\d+)/(\d+) (\d+):(\d+):(\d+)/; + $endtime = timegm($6, $5, $4, $3, $2 - 1, $1 - 1900); + ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $dst) = localtime($endtime); + $endtime_print = sprintf ("%02d/%02d/%d %02d:%02d:%02d",$mday,$mon+1,$year+1900,$hour,$min,$sec); + $expired = $endtime < time(); + }
- if ($line =~ /^\s*hardware ethernet/) { - $ether = $temp[2]; - $ether =~ s/;//g; - } + if ($line =~ /^\s*hardware ethernet/) { + $ether = $temp[2]; + $ether =~ s/;//g; + }
- if ($line =~ /^\s*client-hostname/) { - $hostname = "$temp[1] $temp[2] $temp[3]"; - $hostname =~ s/;//g; - $hostname =~ s/"//g; - } + if ($line =~ /^\s*client-hostname/) { + $hostname = "$temp[1] $temp[2] $temp[3]"; + $hostname =~ s/"|[;\s]+?$//g; # remove quotes, trim semicolon and white space + }
- if ($line eq "}") { - @record = ('IPADDR',$ip,'ENDTIME',$endtime,'ETHER',$ether,'HOSTNAME',$hostname); - $record = {}; # create a reference to empty hash - %{$record} = @record; # populate that hash with @record - $entries{$record->{'IPADDR'}} = $record; # add this to a hash of hashes - } + if ($line eq "}") { + @record = ('IPADDR',$ip,'ENDTIME',$endtime,'ETHER',$ether,'HOSTNAME',$hostname,'endtime_print',$endtime_print,'expired',$expired); + $record = {}; # create a reference to empty hash + %{$record} = @record; # populate that hash with @record + $entries{$record->{'IPADDR'}} = $record; # add this to a hash of hashes + } } close(LEASES);
my $id = 0; - my $col=""; + my $col = ""; + my $divider_printed = 0; foreach my $key (sort leasesort keys %entries) { - print "<form method='post' action='/cgi-bin/dhcp.cgi'>\n"; - my $hostname = &cleanhtml($entries{$key}->{HOSTNAME},"y"); - - if ($id % 2) { - print "<tr>"; - $col="bgcolor='$table1colour'"; - } - else { - print "<tr>"; - $col="bgcolor='$table2colour'"; - } - - print <<END + my $hostname = &cleanhtml($entries{$key}->{HOSTNAME},"y"); + my $hostname_print = $hostname; + if($hostname_print eq "") { #print blank space if no hostname is found + $hostname_print = " "; + } + + # separate active and expired leases with a horizontal line + if(($entries{$key}->{expired}) && ($divider_printed == 0)) { + $divider_printed = 1; + if ($id % 2) { + print "<tr><td colspan='5' bgcolor='$table1colour'><hr size='1'></td></tr>\n"; + } else { + print "<tr><td colspan='5' bgcolor='$table2colour'><hr size='1'></td></tr>\n"; + } + $id++; + } + + print "<form method='post' action='/cgi-bin/dhcp.cgi'><tr>\n"; + if ($id % 2) { + $col="bgcolor='$table1colour'"; + } else { + $col="bgcolor='$table2colour'"; + } + + if($entries{$key}->{expired}) { + print <<END +<td align='center' $col><input type='hidden' name='FIX_ADDR' value='$entries{$key}->{IPADDR}' /><strike><i>$entries{$key}->{IPADDR}</i></strike></td> +<td align='center' $col><input type='hidden' name='FIX_MAC' value='$entries{$key}->{ETHER}' /><strike><i>$entries{$key}->{ETHER}</i></strike></td> +<td align='center' $col><input type='hidden' name='FIX_REMARK' value='$hostname' /><strike><i>$hostname_print<i><strike></td> +<td align='center' $col><input type='hidden' name='FIX_ENABLED' value='on' /><strike><i>$entries{$key}->{endtime_print}</i></strike></td> +END +; + } else { + print <<END <td align='center' $col><input type='hidden' name='FIX_ADDR' value='$entries{$key}->{IPADDR}' />$entries{$key}->{IPADDR}</td> <td align='center' $col><input type='hidden' name='FIX_MAC' value='$entries{$key}->{ETHER}' />$entries{$key}->{ETHER}</td> -<td align='center' $col><input type='hidden' name='FIX_REMARK' value='$hostname' /> $hostname</td> -<td align='center' $col><input type='hidden' name='FIX_ENABLED' value='on' /> +<td align='center' $col><input type='hidden' name='FIX_REMARK' value='$hostname' />$hostname_print</td> +<td align='center' $col><input type='hidden' name='FIX_ENABLED' value='on' />$entries{$key}->{endtime_print}</td> END ; + }
- ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $dst) = localtime ($entries{$key}->{ENDTIME}); - $enddate = sprintf ("%02d/%02d/%d %02d:%02d:%02d",$mday,$mon+1,$year+1900,$hour,$min,$sec); - - if ($entries{$key}->{ENDTIME} < time() ){ - print "<strike>$enddate</strike>"; - } else { - print "$enddate"; - } - print <<END -</td><td $col><input type='hidden' name='ACTION' value='$Lang::tr{'add'}2' /><input type='submit' name='SUBMIT' value='$Lang::tr{'add'}' /> -</td></tr></form> + print <<END +<td $col><input type='hidden' name='ACTION' value='$Lang::tr{'add'}2' /><input type='submit' name='SUBMIT' value='$Lang::tr{'add'}' /></td> +</tr></form> END ; - $id++; + $id++; }
print "</table>"; @@ -493,34 +512,38 @@ END
# This sub is used during display of actives leases sub leasesort { - if (rindex ($dhcpsettings{'SORT_LEASELIST'},'Rev') != -1) - { - $qs=substr ($dhcpsettings{'SORT_LEASELIST'},0,length($dhcpsettings{'SORT_LEASELIST'})-3); - if ($qs eq 'IPADDR') { - @a = split(/./,$entries{$a}->{$qs}); - @b = split(/./,$entries{$b}->{$qs}); - ($b[0]<=>$a[0]) || - ($b[1]<=>$a[1]) || - ($b[2]<=>$a[2]) || - ($b[3]<=>$a[3]); - }else { - $entries{$b}->{$qs} cmp $entries{$a}->{$qs}; - } - } - else #not reverse - { - $qs=$dhcpsettings{'SORT_LEASELIST'}; - if ($qs eq 'IPADDR') { - @a = split(/./,$entries{$a}->{$qs}); - @b = split(/./,$entries{$b}->{$qs}); - ($a[0]<=>$b[0]) || - ($a[1]<=>$b[1]) || - ($a[2]<=>$b[2]) || - ($a[3]<=>$b[3]); - }else { - $entries{$a}->{$qs} cmp $entries{$b}->{$qs}; + if (rindex ($dhcpsettings{'SORT_LEASELIST'},'Rev') != -1) + { + $qs=substr ($dhcpsettings{'SORT_LEASELIST'},0,length($dhcpsettings{'SORT_LEASELIST'})-3); + if ($qs eq 'IPADDR') { + @a = split(/./,$entries{$a}->{$qs}); + @b = split(/./,$entries{$b}->{$qs}); + $entries{$a}->{'expired'} <=> $entries{$b}->{'expired'} || # always sort by expiration first + ($b[0]<=>$a[0]) || + ($b[1]<=>$a[1]) || + ($b[2]<=>$a[2]) || + ($b[3]<=>$a[3]); + } else { + $entries{$a}->{'expired'} <=> $entries{$b}->{'expired'} || + $entries{$b}->{$qs} cmp $entries{$a}->{$qs}; + } + } + else #not reverse + { + $qs=$dhcpsettings{'SORT_LEASELIST'}; + if ($qs eq 'IPADDR') { + @a = split(/./,$entries{$a}->{$qs}); + @b = split(/./,$entries{$b}->{$qs}); + $entries{$a}->{'expired'} <=> $entries{$b}->{'expired'} || + ($a[0]<=>$b[0]) || + ($a[1]<=>$b[1]) || + ($a[2]<=>$b[2]) || + ($a[3]<=>$b[3]); + } else { + $entries{$a}->{'expired'} <=> $entries{$b}->{'expired'} || + $entries{$a}->{$qs} cmp $entries{$b}->{$qs}; + } } - } }
sub colorize { diff --git a/doc/language_issues.en b/doc/language_issues.en index 63106d66b..c0a618da6 100644 --- a/doc/language_issues.en +++ b/doc/language_issues.en @@ -1447,7 +1447,7 @@ WARNING: untranslated string: play = Play WARNING: untranslated string: please reboot to apply your changes = Please reboot to apply your changes WARNING: untranslated string: policy = Policy WARNING: untranslated string: port = Port -WARNING: untranslated string: portscans = portscancs +WARNING: untranslated string: portscans = Port Scans WARNING: untranslated string: ppp setup = PPP setup WARNING: untranslated string: pppoe settings = Additional PPPoE settings: WARNING: untranslated string: pptp netconfig = My Net Config diff --git a/html/cgi-bin/credits.cgi b/html/cgi-bin/credits.cgi index cc0b958ce..fe46a0580 100644 --- a/html/cgi-bin/credits.cgi +++ b/html/cgi-bin/credits.cgi @@ -67,8 +67,8 @@ Christian Schmidt, Alexander Marx, Matthias Fischer, Peter Müller, -Jan Paul Tücking, Erik Kapfer, +Jan Paul Tücking, Jonatan Schlag, Dirk Wagner, Marcel Lorenz, @@ -82,9 +82,10 @@ Stephan Feddersen, Timo Eissler, Jan Lentfer, Marcus Scholz, +Stéphane Pautrel, Ersan Yildirim, Jörn-Ingo Weigert, -Stéphane Pautrel, +Adolf Belka, Alexander Koch, Wolfgang Apolinarski, Alfred Haas, @@ -96,11 +97,11 @@ Florian Bührle, Bernhard Bitsch, Justin Luth, Michael Eitelwein, -Adolf Belka, Alex Koch, Dominik Hassler, Larsen, Gabriel Rolland, +Marcel Follert, Tim FitzGeorge, Anton D. Seliverstov, Bernhard Bittner, @@ -108,6 +109,7 @@ David Kleuker, Hans Horsten, Jakub Ratajczak, Jorrit de Jonge, +Leo-Andres Hofmann, Przemek Zdroik, Ramax Lo, Alexander Rudolf Gruber, @@ -128,7 +130,6 @@ Julian McConnell, Kay-Michael Köhler, Kim Wölfel, Logan Schmidt, -Marcel Follert, Markus Untersee, Mathew McBride, Nico Prenzel, @@ -139,6 +140,7 @@ Rob Brewer, Robert Möker, Stefan Ernst, Stefan Ferstl, +Steffen Klammer, Thomas Ebert, Timmothy Wilson, Umberto Parma
hooks/post-receive -- IPFire 2.x development tree