From patchwork Tue Feb 16 21:45:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Feddersen X-Patchwork-Id: 3893 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4DgDzm0nXjz3wps for ; Tue, 16 Feb 2021 21:45:40 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4DgDzk6y2Dz1fc; Tue, 16 Feb 2021 21:45:38 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4DgDzk5gXYz2xkB; Tue, 16 Feb 2021 21:45:38 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4DgDzj1BtCz2x9X for ; Tue, 16 Feb 2021 21:45:37 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4DgDzh39jQzqj; Tue, 16 Feb 2021 21:45:36 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1613511936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=4buk+6zkMFPdFTzEemrSnHL4H/SFkQGfRc/8brXk4w4=; b=DusLvjb97Ur5mIvGUecyOwxyGexGkqQDMyfTdkNEu0a1UHHWw7bGDcJdEB0qfqLoyzL7Ia I/tsWabT4cRLOqCA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1613511936; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=4buk+6zkMFPdFTzEemrSnHL4H/SFkQGfRc/8brXk4w4=; b=jBIEQO3AyvbURoLmTfv30lan2e03CxK2s404Xj58RrhoDZdiiYBB0rQcV8G7wGaLUQ1/7R bgjwnH0goefHxuCyNKnBH9gr97lXXmcgU8N5Zu+PiYQyej13FqoTMe0wKBckpJ3vsAo9+A ljvAUMwDFA2DicRwZ1LwqcoTiWWupwO/l7eEXZBe8CgOQtMOontr1dlcmqVA5k4GqtMIOi c/fu/QT/yQ31qV6HfGE2EMKOD8nM2yNSy5scKzb2fzLRegLdR1HMEHOFQiJqAP2zGOlm+r 2Td5Cfi0VEizhXAEPUldZmHkQD1vuWmVtht8hHhbIuVMMjUphTgpypPTssUf5Q== From: Stephan Feddersen To: development@lists.ipfire.org Subject: [PATCH] WIO - Patch PPPOE show right Icon Date: Tue, 16 Feb 2021 22:45:07 +0100 Message-Id: <20210216214507.28137-1-sfeddersen@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stephan Feddersen Errors-To: development-bounces@lists.ipfire.org Sender: "Development" --- lfs/wio | 6 +++--- src/wio/wio.cgi | 52 +++++++++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/lfs/wio b/lfs/wio index b4222f1b5..b65d244d6 100644 --- a/lfs/wio +++ b/lfs/wio @@ -1,6 +1,6 @@ ############################################################################### -# IPFire.org - An Open Source Firewall Solution # -# Copyright (C) 2007-2020 IPFire Team # +# IPFire.org - An Open Source Firewall Solution # +# Copyright (C) 2007-2021 IPFire Team # ############################################################################### ############################################################################### @@ -15,7 +15,7 @@ THISAPP = wio-$(VER) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) PROG = wio -PAK_VER = 11 +PAK_VER = 12 ############################################################################### # Top-level Rules diff --git a/src/wio/wio.cgi b/src/wio/wio.cgi index d07332e5e..ac8fc1220 100644 --- a/src/wio/wio.cgi +++ b/src/wio/wio.cgi @@ -3,7 +3,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2017-2020 Stephan Feddersen # +# Copyright (C) 2017-2021 Stephan Feddersen # # All Rights Reserved. # # # # This program is free software: you can redistribute it and/or modify # @@ -21,7 +21,7 @@ # # ############################################################################### # -# Version: 2020/08/04 21:12:23 +# Version: 2021/02/16 21:32:23 # # This wio.cgi is based on the code from the IPCop WIO Addon # and is extremly adapted to work with IPFire. @@ -1140,7 +1140,16 @@ print" 01 $redip - $Lang::tr{ +"; + +if ( $netsettings{"RED_TYPE"} eq 'PPPOE' ) { + print"$Lang::tr{"; +} +else { + print"$Lang::tr{"; +} + +print" ".$mainsettings{'HOSTNAME'}.".".$mainsettings{'DOMAINNAME'}." ".( $redip ne '-' ? (gethostbyaddr(pack("C4", split (/\./, $redip)), 2))[0] : '-' )." @@ -1154,7 +1163,6 @@ close (FILE); foreach (@ddns) { chomp; - @temp = split (/\,/, $_); if ( $temp[7] eq "on" ) { @@ -1336,7 +1344,7 @@ foreach $key (keys %ovpnconfighash) { 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); + 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)/'); @@ -1589,16 +1597,9 @@ my $dotip = length($ipaddresses[$a]) - rindex($ipaddresses[$a],'.'); } if ( $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"); + print"$Lang::tr{"; + last SWITCH; - if ( &General::IpInSubnet($ipaddresses[$a], $red_netaddress, $red_netmask) ) { - print"$Lang::tr{"; - last SWITCH; - } } else { print"$Lang::tr{"; @@ -1606,17 +1607,20 @@ my $dotip = length($ipaddresses[$a]) - rindex($ipaddresses[$a],'.'); } } -if ( $webinterface[$a] eq 'HTTP' ) { - print"$names[$a]"; -} -elsif ( $webinterface[$a] eq 'HTTPS' ) { - print"$names[$a]"; -} -else { - print"$names[$a]"; -} +print""; + + if ( $webinterface[$a] eq 'HTTP' ) { + print"$names[$a]"; + } + elsif ( $webinterface[$a] eq 'HTTPS' ) { + print"$names[$a]"; + } + else { + print $names[$a]; + } print" + @@ -2054,6 +2058,8 @@ if ( $wiosettings{'LOGGING'} eq 'on' ) { print" + +
 
wio-1.3.2-12
"; }