From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer <git@ipfire.org> To: ipfire-scm@lists.ipfire.org Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. 82e2a565bb054dd889b24a9418006f0abfe99cfa Date: Fri, 23 Oct 2020 10:08:50 +0000 Message-ID: <4CHg1G2F1Vz2xcm@people01.haj.ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4163089618936617125==" List-Id: <ipfire-scm.lists.ipfire.org> --===============4163089618936617125== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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(a)ipfire.org> Date: Fri Oct 23 10:08:07 2020 +0000 Update credits.cgi =20 Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org> commit 21b4b0c78b215763b2aacde13306a2c56fbcb00b Author: Michael Tremer <michael.tremer(a)ipfire.org> Date: Fri Oct 23 10:07:37 2020 +0000 Update languages =20 Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org> commit c27b8825beeed2f45b5c6caa507363982675bd10 Author: Leo-Andres Hofmann <hofmann(a)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 creati= ng static leases remains unchanged. =20 Signed-off-by: Leo-Andres Hofmann <hofmann(a)leo-andres.de> Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org> commit 934a376918ac343b299b6ffcc5d71d2a9d69cefa Author: Leo-Andres Hofmann <hofmann(a)leo-andres.de> Date: Wed Oct 21 12:48:30 2020 +0100 Improve indentation and HTML output of PrintActualLeases & leasesort =20 Signed-off-by: Leo-Andres Hofmann <hofmann(a)leo-andres.de> Signed-off-by: Michael Tremer <michael.tremer(a)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=3D'25%' align=3D'center'><a href=3D'$ENV{'SCRIPT_NAME'}?ETHER'><b>= $tr{'mac address'}</b></a></th> <th width=3D'20%' align=3D'center'><a href=3D'$ENV{'SCRIPT_NAME'}?HOSTNAME'>= <b>$tr{'hostname'}</b></a></th> <th width=3D'25%' align=3D'center'><a href=3D'$ENV{'SCRIPT_NAME'}?ENDTIME'><= b>$tr{'lease expires'} (local time d/m/y)</b></a></th> -<th width=3D'5%' align=3D'center'><b>Add to fix leases<b></th> +<th width=3D'5%' align=3D'center'><b>Add to fix leases</b></th> </tr> END ; =20 open(LEASES,"/var/state/dhcp/dhcpd.leases") or die "Can't open dhcpd.lea= ses"; - while ($line =3D <LEASES>) { - next if( $line =3D~ /^\s*#/ ); - chomp($line); - @temp =3D split (' ', $line); - - if ($line =3D~ /^\s*lease/) { - $ip =3D $temp[1]; - #All field are not necessarily read. Clear everything - $endtime =3D 0; - $ether =3D ""; - $hostname =3D ""; - } + while (my $line =3D <LEASES>) { + next if( $line =3D~ /^\s*#/ ); + chomp($line); + @temp =3D split (' ', $line); + + if ($line =3D~ /^\s*lease/) { + $ip =3D $temp[1]; + #All field are not necessarily read. Clear everything + $endtime =3D 0; + $endtime_print =3D ""; + $expired =3D 0; + $ether =3D ""; + $hostname =3D ""; + } =20 - if ($line =3D~ /^\s*ends/) { - $line =3D~ /(\d+)\/(\d+)\/(\d+) (\d+):(\d+):(\d+)/; - $endtime =3D timegm($6, $5, $4, $3, $2 - 1, $1 - 1900); - } + if ($line =3D~ /^\s*ends/) { + $line =3D~ /(\d+)\/(\d+)\/(\d+) (\d+):(\d+):(\d+)/; + $endtime =3D timegm($6, $5, $4, $3, $2 - 1, $1 - 1900); + ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $dst) =3D localtime= ($endtime); + $endtime_print =3D sprintf ("%02d/%02d/%d %02d:%02d:%02d",$mday,$mon+1,$y= ear+1900,$hour,$min,$sec); + $expired =3D $endtime < time(); + } =20 - if ($line =3D~ /^\s*hardware ethernet/) { - $ether =3D $temp[2]; - $ether =3D~ s/;//g; - } + if ($line =3D~ /^\s*hardware ethernet/) { + $ether =3D $temp[2]; + $ether =3D~ s/;//g; + } =20 - if ($line =3D~ /^\s*client-hostname/) { - $hostname =3D "$temp[1] $temp[2] $temp[3]"; - $hostname =3D~ s/;//g; - $hostname =3D~ s/\"//g; - } + if ($line =3D~ /^\s*client-hostname/) { + $hostname =3D "$temp[1] $temp[2] $temp[3]"; + $hostname =3D~ s/\"|[;\s]+?$//g; # remove quotes, trim semicolon and whit= e space + } =20 - if ($line eq "}") { - @record =3D ('IPADDR',$ip,'ENDTIME',$endtime,'ETHER',$ether,'HOSTNAME',= $hostname); - $record =3D {}; # create a reference to em= pty hash - %{$record} =3D @record; # populate that hash with @rec= ord - $entries{$record->{'IPADDR'}} =3D $record; # add this to a hash of h= ashes - } + if ($line eq "}") { + @record =3D ('IPADDR',$ip,'ENDTIME',$endtime,'ETHER',$ether,'HOSTNAME',$h= ostname,'endtime_print',$endtime_print,'expired',$expired); + $record =3D {}; # create a reference to empty hash + %{$record} =3D @record; # populate that hash with @record + $entries{$record->{'IPADDR'}} =3D $record; # add this to a hash of hashes + } } close(LEASES); =20 my $id =3D 0; - my $col=3D""; + my $col =3D ""; + my $divider_printed =3D 0; foreach my $key (sort leasesort keys %entries) { - print "<form method=3D'post' action=3D'/cgi-bin/dhcp.cgi'>\n"; - my $hostname =3D &cleanhtml($entries{$key}->{HOSTNAME},"y"); - - if ($id % 2) { - print "<tr>"; - $col=3D"bgcolor=3D'$table1colour'"; - } - else { - print "<tr>"; - $col=3D"bgcolor=3D'$table2colour'"; - } - - print <<END + my $hostname =3D &cleanhtml($entries{$key}->{HOSTNAME},"y"); + my $hostname_print =3D $hostname; + if($hostname_print eq "") { #print blank space if no hostname is found + $hostname_print =3D " "; + } + =09 + # separate active and expired leases with a horizontal line + if(($entries{$key}->{expired}) && ($divider_printed =3D=3D 0)) { + $divider_printed =3D 1; + if ($id % 2) { + print "<tr><td colspan=3D'5' bgcolor=3D'$table1colour'><hr size=3D'1'></= td></tr>\n"; + } else { + print "<tr><td colspan=3D'5' bgcolor=3D'$table2colour'><hr size=3D'1'></= td></tr>\n"; + } + $id++; + } + =09 + print "<form method=3D'post' action=3D'/cgi-bin/dhcp.cgi'><tr>\n"; + if ($id % 2) { + $col=3D"bgcolor=3D'$table1colour'"; + } else { + $col=3D"bgcolor=3D'$table2colour'"; + } + =09 + if($entries{$key}->{expired}) { + print <<END +<td align=3D'center' $col><input type=3D'hidden' name=3D'FIX_ADDR' value=3D'= $entries{$key}->{IPADDR}' /><strike><i>$entries{$key}->{IPADDR}</i></strike><= /td> +<td align=3D'center' $col><input type=3D'hidden' name=3D'FIX_MAC' value=3D'$= entries{$key}->{ETHER}' /><strike><i>$entries{$key}->{ETHER}</i></strike></td> +<td align=3D'center' $col><input type=3D'hidden' name=3D'FIX_REMARK' value= =3D'$hostname' /><strike><i>$hostname_print<i><strike></td> +<td align=3D'center' $col><input type=3D'hidden' name=3D'FIX_ENABLED' value= =3D'on' /><strike><i>$entries{$key}->{endtime_print}</i></strike></td> +END +; + } else { + print <<END <td align=3D'center' $col><input type=3D'hidden' name=3D'FIX_ADDR' value=3D'= $entries{$key}->{IPADDR}' />$entries{$key}->{IPADDR}</td> <td align=3D'center' $col><input type=3D'hidden' name=3D'FIX_MAC' value=3D'$= entries{$key}->{ETHER}' />$entries{$key}->{ETHER}</td> -<td align=3D'center' $col><input type=3D'hidden' name=3D'FIX_REMARK' value= =3D'$hostname' /> $hostname</td> -<td align=3D'center' $col><input type=3D'hidden' name=3D'FIX_ENABLED' value= =3D'on' /> +<td align=3D'center' $col><input type=3D'hidden' name=3D'FIX_REMARK' value= =3D'$hostname' />$hostname_print</td> +<td align=3D'center' $col><input type=3D'hidden' name=3D'FIX_ENABLED' value= =3D'on' />$entries{$key}->{endtime_print}</td> END ; + } =20 - ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $dst) =3D localtime (= $entries{$key}->{ENDTIME}); - $enddate =3D 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=3D'hidden' name=3D'ACTION' value=3D'$Lang::tr{'add= '}2' /><input type=3D'submit' name=3D'SUBMIT' value=3D'$Lang::tr{'add'}' /> -</td></tr></form> + print <<END +<td $col><input type=3D'hidden' name=3D'ACTION' value=3D'$Lang::tr{'add'}2' = /><input type=3D'submit' name=3D'SUBMIT' value=3D'$Lang::tr{'add'}' /></td> +</tr></form> END ; - $id++; + $id++; } =20 print "</table>"; @@ -493,34 +512,38 @@ END =20 # This sub is used during display of actives leases sub leasesort { - if (rindex ($dhcpsettings{'SORT_LEASELIST'},'Rev') !=3D -1) - { - $qs=3Dsubstr ($dhcpsettings{'SORT_LEASELIST'},0,length($dhcpsettings= {'SORT_LEASELIST'})-3); - if ($qs eq 'IPADDR') { - @a =3D split(/\./,$entries{$a}->{$qs}); - @b =3D split(/\./,$entries{$b}->{$qs}); - ($b[0]<=3D>$a[0]) || - ($b[1]<=3D>$a[1]) || - ($b[2]<=3D>$a[2]) || - ($b[3]<=3D>$a[3]); - }else { - $entries{$b}->{$qs} cmp $entries{$a}->{$qs}; - } - } - else #not reverse - { - $qs=3D$dhcpsettings{'SORT_LEASELIST'}; - if ($qs eq 'IPADDR') { - @a =3D split(/\./,$entries{$a}->{$qs}); - @b =3D split(/\./,$entries{$b}->{$qs}); - ($a[0]<=3D>$b[0]) || - ($a[1]<=3D>$b[1]) || - ($a[2]<=3D>$b[2]) || - ($a[3]<=3D>$b[3]); - }else { - $entries{$a}->{$qs} cmp $entries{$b}->{$qs}; + if (rindex ($dhcpsettings{'SORT_LEASELIST'},'Rev') !=3D -1) + { + $qs=3Dsubstr ($dhcpsettings{'SORT_LEASELIST'},0,length($dhcpsettings{'SORT= _LEASELIST'})-3); + if ($qs eq 'IPADDR') { + @a =3D split(/\./,$entries{$a}->{$qs}); + @b =3D split(/\./,$entries{$b}->{$qs}); + $entries{$a}->{'expired'} <=3D> $entries{$b}->{'expired'} || # always sor= t by expiration first + ($b[0]<=3D>$a[0]) || + ($b[1]<=3D>$a[1]) || + ($b[2]<=3D>$a[2]) || + ($b[3]<=3D>$a[3]); + } else { + $entries{$a}->{'expired'} <=3D> $entries{$b}->{'expired'} || + $entries{$b}->{$qs} cmp $entries{$a}->{$qs}; + } + } + else #not reverse + { + $qs=3D$dhcpsettings{'SORT_LEASELIST'}; + if ($qs eq 'IPADDR') { + @a =3D split(/\./,$entries{$a}->{$qs}); + @b =3D split(/\./,$entries{$b}->{$qs}); + $entries{$a}->{'expired'} <=3D> $entries{$b}->{'expired'} || + ($a[0]<=3D>$b[0]) || + ($a[1]<=3D>$b[1]) || + ($a[2]<=3D>$b[2]) || + ($a[3]<=3D>$b[3]); + } else { + $entries{$a}->{'expired'} <=3D> $entries{$b}->{'expired'} || + $entries{$a}->{$qs} cmp $entries{$b}->{$qs}; + } } - } } =20 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 =3D Play WARNING: untranslated string: please reboot to apply your changes =3D Please= reboot to apply your changes WARNING: untranslated string: policy =3D Policy WARNING: untranslated string: port =3D Port -WARNING: untranslated string: portscans =3D portscancs +WARNING: untranslated string: portscans =3D Port Scans WARNING: untranslated string: ppp setup =3D PPP setup WARNING: untranslated string: pppoe settings =3D Additional PPPoE settings: WARNING: untranslated string: pptp netconfig =3D 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=C3=BCller, -Jan Paul T=C3=BCcking, Erik Kapfer, +Jan Paul T=C3=BCcking, Jonatan Schlag, Dirk Wagner, Marcel Lorenz, @@ -82,9 +82,10 @@ Stephan Feddersen, Timo Eissler, Jan Lentfer, Marcus Scholz, +St=C3=A9phane Pautrel, Ersan Yildirim, J=C3=B6rn-Ingo Weigert, -St=C3=A9phane Pautrel, +Adolf Belka, Alexander Koch, Wolfgang Apolinarski, Alfred Haas, @@ -96,11 +97,11 @@ Florian B=C3=BChrle, 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=C3=B6hler, Kim W=C3=B6lfel, Logan Schmidt, -Marcel Follert, Markus Untersee, Mathew McBride, Nico Prenzel, @@ -139,6 +140,7 @@ Rob Brewer, Robert M=C3=B6ker, Stefan Ernst, Stefan Ferstl, +Steffen Klammer, Thomas Ebert, Timmothy Wilson, Umberto Parma hooks/post-receive -- IPFire 2.x development tree --===============4163089618936617125==--