X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=config%2Fcfgroot%2Fheader.pl;h=fac3b0d15c13a1f38d2b438750a8da7affe91dc9;hp=251c1e9491bcc243075075c09accb917899e7060;hb=810a7ea2f2079d369c5291e2f91525d16d81637a;hpb=1fde937c88877da136f3056a986335c879348076 diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index 251c1e9491..fac3b0d15c 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -19,6 +19,7 @@ $|=1; # line buffering $Header::revision = 'final'; $Header::swroot = '/var/ipfire'; +$Header::graphdir='/srv/web/ipfire/html/graphs'; $Header::pagecolour = '#ffffff'; #$Header::tablecolour = '#a0a0a0'; $Header::tablecolour = '#FFFFFF'; @@ -43,18 +44,17 @@ my $menu = \%menuhash; %settings = (); %ethsettings = (); @URI = (); -$Header::supported=0; ### Make sure this is an SSL request if ($ENV{'SERVER_ADDR'} && $ENV{'HTTPS'} ne 'on') { print "Status: 302 Moved\r\n"; - print "Location: https://$ENV{'SERVER_ADDR'}:10443/$ENV{'PATH_INFO'}\r\n\r\n"; + print "Location: https://$ENV{'SERVER_ADDR'}:444/$ENV{'PATH_INFO'}\r\n\r\n"; exit 0; } ### Initialize environment -&readhash("${swroot}/main/settings", \%settings); -&readhash("${swroot}/ethernet/settings", \%ethsettings); +&General::readhash("${swroot}/main/settings", \%settings); +&General::readhash("${swroot}/ethernet/settings", \%ethsettings); $language = $settings{'LANGUAGE'}; $hostname = $settings{'HOSTNAME'}; $hostnameintitle = 0; @@ -88,32 +88,34 @@ if ( -d "/var/ipfire/langs/${language}/" ) { }; ### Read IPFire Buildversion -$FIREBUILD = "Datei firebuild nicht gefunden\n"; +$FIREBUILD = "File not found: firebuild\n"; if (open(MYFile, "<${swroot}/firebuild")) { $FIREBUILD = ; + chomp($FIREBUILD); $FIREBUILD = "(Build: $FIREBUILD)"; - close(_File); + close(MYFile); }; require "${swroot}/langs/en.pl"; require "${swroot}/langs/${language}.pl"; +eval `/bin/cat /srv/web/ipfire/html/themes/$settings{'THEME'}/include/functions.pl`; sub orange_used () { - if ($ethsettings{'CONFIG_TYPE'} =~ /^[1357]$/) { + if ($ethsettings{'CONFIG_TYPE'} =~ /^[24]$/) { return 1; } return 0; } sub blue_used () { - if ($ethsettings{'CONFIG_TYPE'} =~ /^[4567]$/) { + if ($ethsettings{'CONFIG_TYPE'} =~ /^[34]$/) { return 1; } return 0; } sub is_modem { - if ($ethsettings{'CONFIG_TYPE'} =~ /^[0145]$/) { + if ($ethsettings{'CONFIG_TYPE'} =~ /^[0]$/) { return 1; } return 0; @@ -121,353 +123,30 @@ sub is_modem { ### Initialize menu sub genmenu { + my %subsystemhash = (); my $subsystem = \%subsystemhash; - $subsystem->{'10.home'} = { - 'caption' => $tr{'alt home'}, - 'uri' => '/cgi-bin/index.cgi', - 'title' => "$tr{'alt home'}", - 'enabled' => 1, - }; - $subsystem->{'20.passwords'} = { - 'caption' => $tr{'sspasswords'}, - 'uri' => '/cgi-bin/changepw.cgi', - 'title' => "$tr{'sspasswords'}", - 'enabled' => 1, - }; - $subsystem->{'30.ssh'} = { - 'caption' => $tr{'ssh access'}, - 'uri' => '/cgi-bin/remote.cgi', - 'title' => "$tr{'ssh access'}", - 'enabled' => 1, - }; - $subsystem->{'40.gui'} = { - 'caption' => $tr{'gui settings'}, - 'uri' => '/cgi-bin/gui.cgi', - 'title' => "$tr{'gui settings'}", - 'enabled' => 1, - }; - $subsystem->{'50.shutdown'} = { - 'caption' => $tr{'shutdown'}, - 'uri' => '/cgi-bin/shutdown.cgi', - 'title' => "$tr{'shutdown'} / $tr{'reboot'}", - 'enabled' => 1, - }; - $subsystem->{'99.credits'} = { - 'caption' => $tr{'credits'}, - 'uri' => '/cgi-bin/credits.cgi', - 'title' => "$tr{'credits'}", - 'enabled' => 1, - }; - my %substatushash = (); my $substatus = \%substatushash; - $substatus->{'10.systemstatus'} = { - 'caption' => $tr{'sssystem status'}, - 'uri' => '/cgi-bin/status.cgi', - 'title' => "$tr{'sssystem status'}", - 'enabled' => 1, - }; - $substatus->{'20.networkstatus'} = { - 'caption' => $tr{'ssnetwork status'}, - 'uri' => '/cgi-bin/netstatus.cgi', - 'title' => "$tr{'ssnetwork status'}", - 'enabled' => 1, - }; - $substatus->{'30.systemgraphs'} = { - 'caption' => $tr{'system graphs'}, - 'uri' => '/cgi-bin/graphs.cgi', - 'novars' => 1, - 'title' => "$tr{'system graphs'}", - 'enabled' => 1, - }; - $substatus->{'40.trafficgraphs'} = { - 'caption' => $tr{'sstraffic graphs'}, - 'uri' => '/cgi-bin/graphs.cgi', - 'vars' => 'graph=network', - 'title' => "$tr{'sstraffic graphs'}", - 'enabled' => 1, - }; - $substatus->{'50.proxygraphs'} = { - 'caption' => $tr{'ssproxy graphs'}, - 'uri' => '/cgi-bin/proxygraphs.cgi', - 'title' => "$tr{'ssproxy graphs'}", - 'enabled' => 1, - }; - $substatus->{'60.fwhits'} = { - 'caption' => 'Firewall-Diagramme', - 'uri' => '/cgi-bin/fwhits.cgi', - 'title' => "Firewall-Diagramme", - 'enabled' => 1, - }; - $substatus->{'70.hddtemp'} = { - 'caption' => "$tr{'harddisk temperature graphs'}", - 'uri' => '/cgi-bin/hddgraph.cgi', - 'title' => "$tr{'harddisk temperature graphs'}", - 'enabled' => 1, - }; - $substatus->{'80.connections'} = { - 'caption' => $tr{'connections'}, - 'uri' => '/cgi-bin/connections.cgi', - 'title' => "$tr{'connections'}", - 'enabled' => 1, - }; - $substatus->{'90.nettraf'} = { - 'caption' => $tr{'sstraffic'}, - 'uri' => '/cgi-bin/traffic.cgi', - 'title' => "$tr{'sstraffic'}", - 'enabled' => 1, - }; - $substatus->{'99.iptable'} = { - 'caption' => $tr{'iptable rules'}, - 'uri' => '/cgi-bin/iptables.cgi', - 'title' => "$tr{'iptable rules'}", - 'enabled' => 1, - }; my %subnetworkhash = (); my $subnetwork = \%subnetworkhash; - $subnetwork->{'10.proxy'} = {'caption' => 'Webproxy', - 'uri' => '/cgi-bin/proxy.cgi', - 'title' => "Webproxy", - 'enabled' => 1, - }; - $subnetwork->{'20.urlfilter'} = {'caption' => 'URL-Filter', - 'uri' => '/cgi-bin/urlfilter.cgi', - 'title' => "URL-Filter", - 'enabled' => 1, - }; - $subnetwork->{'30.dhcp'} = {'caption' => $tr{'dhcp server'}, - 'uri' => '/cgi-bin/dhcp.cgi', - 'title' => "$tr{'dhcp server'}", - 'enabled' => 1, - }; - $subnetwork->{'40.dialup'} = { - 'caption' => $tr{'alt dialup'}, - 'uri' => '/cgi-bin/pppsetup.cgi', - 'title' => "$tr{'alt dialup'}", - 'enabled' => 1, - }; - $subnetwork->{'50.scheduler'} = { - 'caption' => $tr{'scheduler'}, - 'uri' => '/cgi-bin/connscheduler.cgi', - 'title' => "$tr{'scheduler'}", - 'enabled' => 1, - }; - $subnetwork->{'60.hosts'} = { - 'caption' => $tr{'edit hosts'}, - 'uri' => '/cgi-bin/hosts.cgi', - 'title' => "$tr{'edit hosts'}", - 'enabled' => 1, - }; - $subnetwork->{'70.upload'} = { - 'caption' => $tr{'upload'}, - 'uri' => '/cgi-bin/upload.cgi', - 'title' => "$tr{'upload'}", - 'enabled' => 0, - }; - $subnetwork->{'80.aliases'} = { - 'caption' => $tr{'aliases'}, - 'uri' => '/cgi-bin/aliases.cgi', - 'title' => "$tr{'aliases'}", - 'enabled' => 0, - }; - $subnetwork->{'90.wakeonlan'} = { - 'caption' => $tr{'WakeOnLan'}, - 'uri' => '/cgi-bin/wakeonlan.cgi', - 'title' => "$tr{'WakeOnLan'}", - 'enabled' => 1, - }; - my %subserviceshash = (); my $subservices = \%subserviceshash; - - $subservices->{'10.openvpn'} = { - 'caption' => 'OpenVPN', - 'uri' => '/cgi-bin/ovpnmain.cgi', - 'title' => "$tr{'virtual private networking'}", - 'enabled' => 1, - }; - $subservices->{'20.ipsec'} = { - 'caption' => 'IPSec', - 'uri' => '/cgi-bin/vpnmain.cgi', - 'title' => "$tr{'virtual private networking'}", - 'enabled' => 1, - }; - $subservices->{'30.dyndns'} = {'caption' => $tr{'dynamic dns'}, - 'uri' => '/cgi-bin/ddns.cgi', - 'title' => "$tr{'dynamic dns'}", - 'enabled' => 1, - }; - $subservices->{'40.time'} = {'caption' => $tr{'time server'}, - 'uri' => '/cgi-bin/time.cgi', - 'title' => "$tr{'time server'}", - 'enabled' => 1, - }; - $subservices->{'50.qos'} = {'caption' => 'Quality of Service', - 'uri' => '/cgi-bin/qos.cgi', - 'title' => "Quality of Service", - 'enabled' => 1, - }; - $subservices->{'60.ids'} = {'caption' => $tr{'intrusion detection'}, - 'enabled' => 1, - 'uri' => '/cgi-bin/ids.cgi', - 'title' => "$tr{'intrusion detection system'}", - }; - - - my %subfirewallhash = (); my $subfirewall = \%subfirewallhash; - - $subfirewall->{'10.dnat'} = { - 'caption' => $tr{'ssport forwarding'}, - 'uri' => '/cgi-bin/portfw.cgi', - 'title' => "$tr{'ssport forwarding'}", - 'enabled' => 1, - }; - $subfirewall->{'20.xtaccess'} = { - 'caption' => $tr{'external access'}, - 'uri' => '/cgi-bin/xtaccess.cgi', - 'title' => "$tr{'external access'}", - 'enabled' => 1, - }; - $subfirewall->{'30.wireless'} = { - 'caption' => $tr{'blue access'}, - 'uri' => '/cgi-bin/wireless.cgi', - 'title' => "$tr{'blue access'}", - 'enabled' => 1, - }; - $subfirewall->{'40.dmz'} = { - 'caption' => $tr{'ssdmz pinholes'}, - 'uri' => '/cgi-bin/dmzholes.cgi', - 'title' => "$tr{'dmz pinhole configuration'}", - 'enabled' => 1, - }; - $subfirewall->{'50.outgoing'} = { - 'caption' => $tr{'outgoing firewall'}, - 'uri' => '/cgi-bin/outgoingfw.cgi', - 'title' => "$tr{'outgoing firewall'}", - 'enabled' => 1, - }; - $subfirewall->{'60.fwopts'} = { - 'caption' => $tr{'options fw'}, - 'uri' => '/cgi-bin/optionsfw.cgi', - 'title' => "$tr{'options fw'}", - 'enabled' => 1, - }; - + my %subipfirehash = (); + my $subipfire = \%subipfirehash; + my %sublogshash = (); my $sublogs = \%sublogshash; - $sublogs->{'10.summary'} = {'caption' => $tr{'log summary'}, - 'uri' => '/cgi-bin/logs.cgi/summary.dat', - 'title' => "$tr{'log summary'}", - 'enabled' => 1 - }; - $sublogs->{'20.settings'} = {'caption' => $tr{'log settings'}, - 'uri' => '/cgi-bin/logs.cgi/config.dat', - 'title' => "$tr{'log settings'}", - 'enabled' => 1 - }; - $sublogs->{'30.proxy'} = {'caption' => $tr{'proxy logs'}, - 'uri' => '/cgi-bin/logs.cgi/proxylog.dat', - 'title' => "$tr{'proxy logs'}", - 'enabled' => 1 - }; - $sublogs->{'40.firewall'} = {'caption' => $tr{'firewall logs'}, - 'uri' => '/cgi-bin/logs.cgi/firewalllog.dat', - 'title' => "$tr{'firewall logs'}", - 'enabled' => 1 - }; - $sublogs->{'50.ids'} = {'caption' => $tr{'ids logs'}, - 'uri' => '/cgi-bin/logs.cgi/ids.dat', - 'title' => "$tr{'ids logs'}", - 'enabled' => 1 - }; - $sublogs->{'60.urlfilter'} = { - 'caption' => $tr{'urlfilter log'}, - 'uri' => '/cgi-bin/logs.cgi/urlfilter.dat', - 'title' => "$tr{'urlfilter log'}", - 'enabled' => 1, - }; - $sublogs->{'70.openvpn'} = {'caption' => $tr{'openvpn log'}, - 'uri' => '/cgi-bin/logs.cgi/openvpn.dat', - 'title' => "$tr{'openvpn log'}", - 'enabled' => 1 - }; - $sublogs->{'80.system'} = {'caption' => $tr{'system logs'}, - 'uri' => '/cgi-bin/logs.cgi/log.dat', - 'title' => "$tr{'system logs'}", - 'enabled' => 1 - }; - $sublogs->{'90.userlog'} = {'caption' => $tr{'user proxy logs'}, - 'uri' => '/cgi-bin/logs.cgi/userlog.dat', - 'title' => "$tr{'user log'}", - 'enabled' => 1 - }; - - my %subipfirehash = (); - my $subipfire = \%subipfirehash; - $subipfire->{'10.pakfire'} = {'caption' => 'Pakfire', - 'uri' => '/cgi-bin/pakfire.cgi', - 'title' => "Pakfire", - 'enabled' => 1, - }; - $subipfire->{'20.asterisk'} = {'caption' => 'Asterisk', - 'uri' => '/cgi-bin/asterisk.cgi', - 'title' => "Asterisk", - 'enabled' => 1, - }; - $subipfire->{'30.samba'} = {'caption' => 'Samba', - 'uri' => '/cgi-bin/samba.cgi', - 'title' => "Samba", - 'enabled' => 1, - }; - $subipfire->{'99.help'} = {'caption' => $tr{'help'}, - 'uri' => '/cgi-bin/help.cgi', - 'title' => "$tr{'help'}", - 'enabled' => 1, - }; - - - - $menu->{'01.system'} = {'caption' => $tr{'alt system'}, - 'enabled' => 1, - 'subMenu' => $subsystem - }; - $menu->{'02.status'} = {'caption' => $tr{'status'}, - 'enabled' => 1, - 'subMenu' => $substatus - }; - $menu->{'03.network'} = {'caption' => $tr{'network'}, - 'enabled' => 1, - 'subMenu' => $subnetwork - }; - $menu->{'04.services'} = {'caption' => $tr{'alt services'}, - 'enabled' => 1, - 'subMenu' => $subservices - }; - $menu->{'05.firewall'} = {'caption' => $tr{'firewall'}, - 'enabled' => 1, - 'subMenu' => $subfirewall - }; - $menu->{'06.proxy'} = {'caption' => $tr{'alt proxy'}, - 'enabled' => 1, - 'subMenu' => $subproxy - }; - $menu->{'07.ipfire'} = {'caption' => 'IPFire', - 'enabled' => 1, - 'subMenu' => $subipfire - }; - $menu->{'08.logs'} = {'caption' => $tr{'alt logs'}, - 'enabled' => 1, - 'subMenu' => $sublogs - }; + eval `/bin/cat /var/ipfire/menu.d/*.menu`; + eval `/bin/cat /var/ipfire/menu.d/*.main`; if (! blue_used() && ! orange_used()) { $menu->{'05.firewall'}{'subMenu'}->{'40.dmz'}{'enabled'} = 0; @@ -475,16 +154,16 @@ sub genmenu { if (! blue_used()) { $menu->{'05.firewall'}{'subMenu'}->{'30.wireless'}{'enabled'} = 0; } - if ( $ethsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $ethsettings{'RED_TYPE'} eq 'STATIC' ) { + if ( $ethsettings{'CONFIG_TYPE'} =~ /^(1|2|3|4)$/ && $ethsettings{'RED_TYPE'} eq 'STATIC' ) { $menu->{'03.network'}{'subMenu'}->{'70.aliases'}{'enabled'} = 1; } } sub showhttpheaders { - print "Pragma: no-cache\n"; - print "Cache-control: no-cache\n"; - print "Connection: close\n"; +# print "Pragma: no-cache\n"; +# print "Cache-control: no-cache\n"; +# print "Connection: close\n"; print "Content-type: text/html\n\n"; } @@ -574,354 +253,6 @@ sub gettitle($) { return ''; } - -sub showmenu() { - print < -