From patchwork Thu Apr 8 08:36:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonatan Schlag X-Patchwork-Id: 4125 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 ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FGF3t6Wbkz3yBV for ; Thu, 8 Apr 2021 08:36:42 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FGF3r5tHpz1YQ; Thu, 8 Apr 2021 08:36:40 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FGF3r0XHyz2yjS; Thu, 8 Apr 2021 08:36:40 +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 ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4FGF3p2tDkz2xXd for ; Thu, 8 Apr 2021 08:36:38 +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 4FGF3n2pF3z1T; Thu, 8 Apr 2021 08:36:37 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1617870997; 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=TqJpyJsY2E8/xV/rhsP9/4fIwsbsjjzhjRnJUUbnbHs=; b=dyqV5NhmuDr3f83fjxdI0UTT0M65i3Xd3ch+VRxEb6XJKONFkICTVU2ZumZwSFo4IuRDDX XRzc24UjJngbhNDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1617870997; 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=TqJpyJsY2E8/xV/rhsP9/4fIwsbsjjzhjRnJUUbnbHs=; b=BWYL4gQZcZ9N9RpUMNkT9CxN0wOal26lP8z2ofhefWrgyVGuiPZp5TneryEbeiSlRTiwod LQbeyEKiMaa4ErXKiEvDsNYpWriJoRlP+Pk0rVnuh/dvbIM786iyVVr0pGWNL8pgQ6L3aK h+VJ/GhE59AXL8ZctmE0Bf3Xyw7oWGn+EAUnOL1VtHISY4CY//s4IA4OSVB9LXROuMl7Kj JEYwM4OnSfSNSIzP8MiQGs25KnUe9m1SImjUgwTDyfM0SUwJx1rjDiNo7HsHE+7INQbMr8 wwKc2LdxgsFqzPmjoGR9X1s+FFZ8uv5G6smLIb0EXXhEeLn5W9f7ppYo7mtasg== From: Jonatan Schlag To: development@lists.ipfire.org Subject: [PATCH 1/2] Hardcode theme to ipfire Date: Thu, 8 Apr 2021 10:36:24 +0200 Message-Id: <20210408083625.24360-1-jonatan.schlag@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: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" This disables the theme support and makes it impossible to use any other themes than the ipfire default theme. The only intention of this patch is to hardcode the theme to ipfire. To change any cgi we have is an ugly way, but the only way to do this fast. The colour handling needs certainly to be improved as well, but this will and should be done in other patches. Signed-off-by: Jonatan Schlag --- config/cfgroot/graphs.pl | 4 +- config/cfgroot/header.pl | 3 +- html/cgi-bin/atm-status.cgi | 2 +- html/cgi-bin/backup.cgi | 2 +- html/cgi-bin/captive.cgi | 2 +- html/cgi-bin/connscheduler.cgi | 2 +- html/cgi-bin/ddns.cgi | 2 +- html/cgi-bin/dhcp.cgi | 2 +- html/cgi-bin/dns.cgi | 2 +- html/cgi-bin/dnsforward.cgi | 2 +- html/cgi-bin/firewall.cgi | 2 +- html/cgi-bin/fwhosts.cgi | 2 +- html/cgi-bin/guardian.cgi | 2 +- html/cgi-bin/gui.cgi | 45 -------------------- html/cgi-bin/hardwaregraphs.cgi | 2 +- html/cgi-bin/hosts.cgi | 2 +- html/cgi-bin/ids.cgi | 2 +- html/cgi-bin/index.cgi | 2 +- html/cgi-bin/ipinfo.cgi | 2 +- html/cgi-bin/location-block.cgi | 2 +- html/cgi-bin/logs.cgi/firewalllog.dat | 2 +- html/cgi-bin/logs.cgi/firewalllogcountry.dat | 2 +- html/cgi-bin/logs.cgi/firewalllogip.dat | 2 +- html/cgi-bin/logs.cgi/firewalllogport.dat | 2 +- html/cgi-bin/logs.cgi/ids.dat | 2 +- html/cgi-bin/logs.cgi/log.dat | 2 +- html/cgi-bin/logs.cgi/ovpnclients.dat | 2 +- html/cgi-bin/logs.cgi/proxylog.dat | 2 +- html/cgi-bin/logs.cgi/urlfilter.dat | 2 +- html/cgi-bin/mail.cgi | 2 +- html/cgi-bin/mdstat.cgi | 2 +- html/cgi-bin/media.cgi | 2 +- html/cgi-bin/memory.cgi | 2 +- html/cgi-bin/mpfire.cgi | 2 +- html/cgi-bin/netexternal.cgi | 2 +- html/cgi-bin/netinternal.cgi | 2 +- html/cgi-bin/netother.cgi | 2 +- html/cgi-bin/netovpnrw.cgi | 2 +- html/cgi-bin/netovpnsrv.cgi | 2 +- html/cgi-bin/ovpnmain.cgi | 2 +- html/cgi-bin/p2p-block.cgi | 2 +- html/cgi-bin/pakfire.cgi | 2 +- html/cgi-bin/pppsetup.cgi | 2 +- html/cgi-bin/proxy.cgi | 2 +- html/cgi-bin/qos.cgi | 2 +- html/cgi-bin/remote.cgi | 2 +- html/cgi-bin/routing.cgi | 2 +- html/cgi-bin/samba.cgi | 2 +- html/cgi-bin/services.cgi | 2 +- html/cgi-bin/system.cgi | 2 +- html/cgi-bin/tor.cgi | 2 +- html/cgi-bin/traffic.cgi | 2 +- html/cgi-bin/updatexlrator.cgi | 2 +- html/cgi-bin/vpnmain.cgi | 2 +- html/cgi-bin/vulnerabilities.cgi | 2 +- html/cgi-bin/wakeonlan.cgi | 2 +- html/cgi-bin/wirelessclient.cgi | 2 +- html/cgi-bin/wlanap.cgi | 2 +- html/html/themes/ipfire/include/functions.pl | 10 ++--- src/scripts/makegraphs | 2 +- src/squid-accounting/accounting.cgi | 2 +- src/wio/wio-graphs.pl | 2 +- src/wio/wio.cgi | 2 +- 63 files changed, 64 insertions(+), 116 deletions(-) diff --git a/config/cfgroot/graphs.pl b/config/cfgroot/graphs.pl index cf4a30de3..441d4c483 100644 --- a/config/cfgroot/graphs.pl +++ b/config/cfgroot/graphs.pl @@ -62,14 +62,12 @@ my @GRAPH_ARGS = ( "--alt-y-grid", ); -# Read the global settings files to get the current theme and after this load -# colors for this theme my %color = (); my %mainsettings = (); my %sensorsettings = (); &General::readhash("${General::swroot}/main/settings", \%mainsettings); -&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); if ( $mainsettings{'RRDLOG'} eq "" ){ $mainsettings{'RRDLOG'}="/var/log/rrd"; diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index 8dea804d0..83ef01951 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -91,11 +91,10 @@ if ( -d "/var/ipfire/langs/${language}/" ) { }; }; -our $THEME_NAME = $settings{'THEME'}; require "${swroot}/langs/en.pl"; require "${swroot}/langs/${language}.pl"; -eval `/bin/cat /srv/web/ipfire/html/themes/$THEME_NAME/include/functions.pl`; +eval `/bin/cat /srv/web/ipfire/html/themes/ipfire/include/functions.pl`; sub green_used() { if ($ethsettings{'GREEN_DEV'} && $ethsettings{'GREEN_DEV'} ne "") { diff --git a/html/cgi-bin/atm-status.cgi b/html/cgi-bin/atm-status.cgi index c2a9914f7..49f19209d 100644 --- a/html/cgi-bin/atm-status.cgi +++ b/html/cgi-bin/atm-status.cgi @@ -33,7 +33,7 @@ my %color = (); my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", \%mainsettings); -&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); &Header::showhttpheaders(); &Header::openpage($Lang::tr{'status information'}, 1, ''); diff --git a/html/cgi-bin/backup.cgi b/html/cgi-bin/backup.cgi index cac4146ab..683f8add4 100644 --- a/html/cgi-bin/backup.cgi +++ b/html/cgi-bin/backup.cgi @@ -42,7 +42,7 @@ my @backupisos = ""; $a = new CGI; &General::readhash("${General::swroot}/main/settings", \%mainsettings); -&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); $cgiparams{'ACTION'} = ''; $cgiparams{'FILE'} = ''; diff --git a/html/cgi-bin/captive.cgi b/html/cgi-bin/captive.cgi index 8204eb7b3..51c5d45f2 100755 --- a/html/cgi-bin/captive.cgi +++ b/html/cgi-bin/captive.cgi @@ -69,7 +69,7 @@ unless (-e $settingsfile) { system("touch $settingsfile"); } &Header::getcgihash(\%cgiparams); &General::readhash("${General::swroot}/main/settings", \%mainsettings); -&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::readhash("$settingsfile", \%settings) if(-f $settingsfile); &General::readhash("${General::swroot}/ethernet/settings", \%netsettings); diff --git a/html/cgi-bin/connscheduler.cgi b/html/cgi-bin/connscheduler.cgi index 90aae52fb..1393df65f 100644 --- a/html/cgi-bin/connscheduler.cgi +++ b/html/cgi-bin/connscheduler.cgi @@ -34,7 +34,7 @@ require '/var/ipfire/connscheduler/lib.pl'; my %color = (); my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", \%mainsettings); -&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); my $buttontext = $Lang::tr{'add'}; my $hiddenvalue = 'add'; diff --git a/html/cgi-bin/ddns.cgi b/html/cgi-bin/ddns.cgi index 9b58db895..7e4ddb5b7 100644 --- a/html/cgi-bin/ddns.cgi +++ b/html/cgi-bin/ddns.cgi @@ -37,7 +37,7 @@ undef (@dummy); my %color = (); my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", \%mainsettings); -&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); # Config file for basic configuration. my $settingsfile = "${General::swroot}/ddns/settings"; diff --git a/html/cgi-bin/dhcp.cgi b/html/cgi-bin/dhcp.cgi index 867614f2a..dd379dc47 100644 --- a/html/cgi-bin/dhcp.cgi +++ b/html/cgi-bin/dhcp.cgi @@ -111,7 +111,7 @@ foreach my $itf (@ITFs) { &General::readhash("${General::swroot}/ethernet/settings", \%netsettings); &General::readhash("${General::swroot}/main/settings", \%mainsettings); &General::readhash("${General::swroot}/time/settings", \%timesettings); -&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); #Get GUI values &Header::getcgihash(\%dhcpsettings); diff --git a/html/cgi-bin/dns.cgi b/html/cgi-bin/dns.cgi index 337166ccf..7dc113582 100755 --- a/html/cgi-bin/dns.cgi +++ b/html/cgi-bin/dns.cgi @@ -65,7 +65,7 @@ my $check_servers; my %color = (); my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", \%mainsettings); -&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); &Header::showhttpheaders(); &Header::getcgihash(\%cgiparams); diff --git a/html/cgi-bin/dnsforward.cgi b/html/cgi-bin/dnsforward.cgi index ed373c09a..749d1216a 100644 --- a/html/cgi-bin/dnsforward.cgi +++ b/html/cgi-bin/dnsforward.cgi @@ -43,7 +43,7 @@ my $changed = 'no'; my %color = (); my %mainsettings = (); &General::readhash("${General::swroot}/main/settings", \%mainsettings); -&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); &Header::showhttpheaders(); diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi index 532f99f91..4f4d63cc8 100644 --- a/html/cgi-bin/firewall.cgi +++ b/html/cgi-bin/firewall.cgi @@ -99,7 +99,7 @@ my $checkorange=''; my @protocols; &General::readhash("${General::swroot}/firewall/settings", \%fwdfwsettings); &General::readhash("${General::swroot}/main/settings", \%mainsettings); -&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::readhash($fwoptions, \%optionsfw); &General::readhash($ifacesettings, \%ifaces); &General::readhash("$configovpn", \%ovpnsettings); diff --git a/html/cgi-bin/fwhosts.cgi b/html/cgi-bin/fwhosts.cgi index fe5117ae5..84b018459 100644 --- a/html/cgi-bin/fwhosts.cgi +++ b/html/cgi-bin/fwhosts.cgi @@ -83,7 +83,7 @@ unless (-e $configsrvgrp) { system("touch $configsrvgrp"); } unless (-e $configlocationgrp) { system("touch $configlocationgrp"); } &General::readhash("${General::swroot}/main/settings", \%mainsettings); -&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::readhash("${General::swroot}/ethernet/settings", \%ownnet); &General::readhash("$configovpn", \%ovpnsettings); &General::readhasharray("$configipsec", \%ipsecconf); diff --git a/html/cgi-bin/guardian.cgi b/html/cgi-bin/guardian.cgi index 7dc6b0149..fb16be00e 100644 --- a/html/cgi-bin/guardian.cgi +++ b/html/cgi-bin/guardian.cgi @@ -60,7 +60,7 @@ our %netsettings = (); our %color = (); our %mainsettings = (); &General::readhash("${General::swroot}/main/settings", \%mainsettings); -&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); # File declarations. my $settingsfile = "${General::swroot}/guardian/settings"; diff --git a/html/cgi-bin/gui.cgi b/html/cgi-bin/gui.cgi index f06b0f923..1b316a2a2 100644 --- a/html/cgi-bin/gui.cgi +++ b/html/cgi-bin/gui.cgi @@ -88,7 +88,6 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") $mainsettings{'WINDOWWITHHOSTNAME'} = $cgiparams{'WINDOWWITHHOSTNAME'}; $mainsettings{'PPPUPDOWNBEEP'} = $cgiparams{'PPPUPDOWNBEEP'}; $mainsettings{'SPEED'} = $cgiparams{'SPEED'}; - $mainsettings{'THEME'} = $cgiparams{'theme'}; $mainsettings{'REFRESHINDEX'} = $cgiparams{'REFRESHINDEX'}; &General::writehash("${General::swroot}/main/settings", \%mainsettings); &Lang::reload($cgiparams{'lang'}); @@ -106,12 +105,6 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}") $cgiparams{'PPPUPDOWNBEEP'} = 'on'; } - if ($mainsettings{'THEME'}) { - $cgiparams{'THEME'} = $mainsettings{'THEME'}; - } else { - $cgiparams{'THEME'} = 'ipfire'; - } - if($mainsettings{'REFRESHINDEX'}) { $cgiparams{'REFRESHINDEX'} = $mainsettings{'REFRESHINDEX'}; } else { @@ -134,7 +127,6 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'restore defaults'}") $cgiparams{'PPPUPDOWNBEEP'} = 'on'; $cgiparams{'REFRESHINDEX'} = 'off'; $cgiparams{'SPEED'} = 'on'; - $cgiparams{'THEME'} = 'ipfire'; } $checked{'WINDOWWITHHOSTNAME'}{'off'} = ''; @@ -210,43 +202,6 @@ END ; } -print < - -END -; -&Header::closebox(); -&Header::openbox('100%','left',$Lang::tr{'theme'}); -print< - -   -