]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - config/cfgroot/header.pl
Hinzugefuegt:
[ipfire-2.x.git] / config / cfgroot / header.pl
index 065bb690b2bcf16c98b61870486d62e1563ff406..251c1e9491bcc243075075c09accb917899e7060 100644 (file)
@@ -87,6 +87,13 @@ if ( -d "/var/ipfire/langs/${language}/" ) {
     };
 };
 
+### Read IPFire Buildversion
+$FIREBUILD = "Datei firebuild nicht gefunden\n";
+if (open(MYFile, "<${swroot}/firebuild")) {
+    $FIREBUILD = <MYFile>;
+    $FIREBUILD = "(Build: $FIREBUILD)";
+    close(_File);
+};
 
 require "${swroot}/langs/en.pl";
 require "${swroot}/langs/${language}.pl";
@@ -117,31 +124,31 @@ sub genmenu {
     my %subsystemhash = ();
     my $subsystem = \%subsystemhash;
 
-    $subsystem->{'01.home'} = {
+    $subsystem->{'10.home'} = {
                                'caption' => $tr{'alt home'},
                                'uri' => '/cgi-bin/index.cgi',
                                'title' => "$tr{'alt home'}",
                                'enabled' => 1,
                                };
-    $subsystem->{'02.passwords'} = {
+    $subsystem->{'20.passwords'} = {
                                'caption' => $tr{'sspasswords'},
                                'uri' => '/cgi-bin/changepw.cgi',
                                'title' => "$tr{'sspasswords'}",
                                'enabled' => 1,
                                };
-    $subsystem->{'03.ssh'} = {
+    $subsystem->{'30.ssh'} = {
                                'caption' => $tr{'ssh access'},
                                'uri' => '/cgi-bin/remote.cgi',
                                'title' => "$tr{'ssh access'}",
                                'enabled' => 1,
                                };
-    $subsystem->{'04.gui'} = {
+    $subsystem->{'40.gui'} = {
                                'caption' => $tr{'gui settings'},
                                'uri' => '/cgi-bin/gui.cgi',
                                'title' => "$tr{'gui settings'}",
                                'enabled' => 1,
                                };
-    $subsystem->{'05.shutdown'} = {
+    $subsystem->{'50.shutdown'} = {
                                'caption' => $tr{'shutdown'},
                                'uri' => '/cgi-bin/shutdown.cgi',
                                'title' => "$tr{'shutdown'} / $tr{'reboot'}",
@@ -156,239 +163,269 @@ sub genmenu {
 
     my %substatushash = ();
     my $substatus = \%substatushash;
-    $substatus->{'01.systemstatus'} = {
+    $substatus->{'10.systemstatus'} = {
                                 'caption' => $tr{'sssystem status'},
                                 'uri' => '/cgi-bin/status.cgi',
-                                'title' => "$tr{'system status information'}",
+                                'title' => "$tr{'sssystem status'}",
                                 'enabled' => 1,
                                 };
-    $substatus->{'02.networkstatus'} = {
+    $substatus->{'20.networkstatus'} = {
                                'caption' => $tr{'ssnetwork status'},
                                'uri' => '/cgi-bin/netstatus.cgi',
-                               'title' => "$tr{'network status information'}",
+                               'title' => "$tr{'ssnetwork status'}",
                                'enabled' => 1,
                                };
-    $substatus->{'03.systemgraphs'} = {
+    $substatus->{'30.systemgraphs'} = {
                                'caption' => $tr{'system graphs'},
                                'uri' => '/cgi-bin/graphs.cgi',
                                'novars' => 1,
                                'title' => "$tr{'system graphs'}",
                                'enabled' => 1,
                                };
-    $substatus->{'04.trafficgraphs'} = {
+    $substatus->{'40.trafficgraphs'} = {
                                'caption' => $tr{'sstraffic graphs'},
                                'uri' => '/cgi-bin/graphs.cgi',
                                'vars' => 'graph=network',
-                               'title' => "$tr{'network traffic graphs'}",
+                               'title' => "$tr{'sstraffic graphs'}",
                                'enabled' => 1,
                                };
-    $substatus->{'05.proxygraphs'} = {
+    $substatus->{'50.proxygraphs'} = {
                                'caption' => $tr{'ssproxy graphs'},
                                'uri' => '/cgi-bin/proxygraphs.cgi',
-                               'title' => "$tr{'proxy access graphs'}",
+                               'title' => "$tr{'ssproxy graphs'}",
                                'enabled' => 1,
                                };
-    $substatus->{'06.connections'} = {
+    $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->{'99.iptfilters'} = {
-                               'caption' => $tr{'iptfilters iptable rules'},
-                               'uri' => '/cgi-bin/iptfilters.cgi',
-                               'title' => "$tr{'iptfilters iptable rules'}",
+    $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->{'01.dialup'} = {
+    $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{'dialup settings'}",
+                                 'title' => "$tr{'alt dialup'}",
                                  'enabled' => 1,
                                  };
-    $subnetwork->{'02.hosts'} = {
+    $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{'host configuration'}",
+                                'title' => "$tr{'edit hosts'}",
                                 'enabled' => 1,
                                 };
-    $subnetwork->{'03.upload'} = {
+    $subnetwork->{'70.upload'} = {
                                  'caption' => $tr{'upload'},
                                  'uri' => '/cgi-bin/upload.cgi',
-                                 'title' => "$tr{'firmware upload'}",
+                                 'title' => "$tr{'upload'}",
                                  'enabled' => 0,
                                  };
-    $subnetwork->{'04.aliases'} = {
+    $subnetwork->{'80.aliases'} = {
                                  'caption' => $tr{'aliases'},
                                  'uri' => '/cgi-bin/aliases.cgi',
-                                 'title' => "$tr{'external aliases configuration'}",
+                                 'title' => "$tr{'aliases'}",
+                                 'enabled' => 0,
+                                 };
+    $subnetwork->{'90.wakeonlan'} = {
+                                 'caption' => $tr{'WakeOnLan'},
+                                 'uri' => '/cgi-bin/wakeonlan.cgi',
+                                 'title' => "$tr{'WakeOnLan'}",
                                  'enabled' => 1,
                                  };
-    $subnetwork->{'05.nettraf'} = {
-                                 'caption' => $tr{'sstraffic'},
-                                 'uri' => '/cgi-bin/traffic.cgi',
-                                 'title' => "$tr{'sstraffic'}",
-                                'enabled' => 1,
-                                 };
-    $subnetwork->{'06.fwhits'} = {
-                                 'caption' => 'Firewallhits',
-                                 'uri' => '/cgi-bin/fwhits.cgi',
-                                 'title' => "IPFire Firewallhits",
-                                'enabled' => 1,
-                                 };
-    $subnetwork->{'07.openvpn'} = {
-                                 'caption' => 'OpenVPN',
-                                 'uri' => '/cgi-bin/ovpnmain.cgi',
-                                 'title' => "$tr{'virtual private networking'}",
-                                'enabled' => 1,
-                                 };
-    $subnetwork->{'08.ipsec'} = {
-                                 'caption' => 'IPSec',
-                                 'uri' => '/cgi-bin/vpnmain.cgi',
-                                 'title' => "$tr{'virtual private networking'}",
-                                 'enabled' => 1,
-                                 };
-
 
     my %subserviceshash = ();
     my $subservices = \%subserviceshash;
 
-    $subservices->{'01.proxy'} = {'caption' => $tr{'proxy'},
-                               'uri' => '/cgi-bin/proxy.cgi',
-                               'title' => "HTTP: $tr{'web proxy configuration'}",
-                               'enabled' => 1,
-                               };
-    $subservices->{'02.dhcp'} = {'caption' => $tr{'dhcp server'},
-                                'uri' => '/cgi-bin/dhcp.cgi',
-                                'title' => "$tr{'dhcp configuration'}",
-                                'enabled' => 1,
-                                };
-    $subservices->{'03.dyndns'} = {'caption' => $tr{'dynamic dns'},
+
+    $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 client'}",
+                               'title' => "$tr{'dynamic dns'}",
                                'enabled' => 1,
                                };
-    $subservices->{'04.time'} = {'caption' => $tr{'time server'},
+    $subservices->{'40.time'} = {'caption' => $tr{'time server'},
                                'uri' => '/cgi-bin/time.cgi',
                                'title' => "$tr{'time server'}",
                                'enabled' => 1,
                                };
-    $subservices->{'05.qos'} = {'caption' => 'Quality of Service',
+    $subservices->{'50.qos'} = {'caption' => 'Quality of Service',
                                'uri' => '/cgi-bin/qos.cgi',
-                               'title' => "$tr{'traffic shaping settings'}",
+                               'title' => "Quality of Service",
                                'enabled' => 1,
                                };
-    $subservices->{'06.ids'} = {'caption' => $tr{'intrusion detection'},
+    $subservices->{'60.ids'} = {'caption' => $tr{'intrusion detection'},
                                'enabled' => 1,
                                'uri' => '/cgi-bin/ids.cgi',
-                               'title' => "$tr{'intrusion detection system'} (Snort)",
+                               'title' => "$tr{'intrusion detection system'}",
                                };
 
 
+
     my %subfirewallhash = ();
     my $subfirewall = \%subfirewallhash;
 
     
-    $subfirewall->{'01.dnat'} = {
+    $subfirewall->{'10.dnat'} = {
                                 'caption' => $tr{'ssport forwarding'},
                                 'uri' => '/cgi-bin/portfw.cgi',
-                                'title' => "$tr{'port forwarding configuration'}",
+                                'title' => "$tr{'ssport forwarding'}",
                                 'enabled' => 1,
                                 };
-    $subfirewall->{'02.xtaccess'} = {
+    $subfirewall->{'20.xtaccess'} = {
                                 'caption' => $tr{'external access'},
                                 'uri' => '/cgi-bin/xtaccess.cgi',
-                                'title' => "$tr{'external access configuration'}",
+                                'title' => "$tr{'external access'}",
                                 'enabled' => 1,
                                 };
-    $subfirewall->{'03.wireless'} = {
+    $subfirewall->{'30.wireless'} = {
                                'caption' => $tr{'blue access'},
                                'uri' => '/cgi-bin/wireless.cgi',
                                'title' => "$tr{'blue access'}",
                                'enabled' => 1,
                                 };
-    $subfirewall->{'04.dmz'} = {
+    $subfirewall->{'40.dmz'} = {
                                'caption' => $tr{'ssdmz pinholes'},
                                'uri' => '/cgi-bin/dmzholes.cgi',
                                'title' => "$tr{'dmz pinhole configuration'}",
                                'enabled' => 1,
                                 };
-    $subfirewall->{'05.outgoing'} = {
+    $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 %sublogshash = ();
     my $sublogs = \%sublogshash;
 
-    $sublogs->{'01.summary'} = {'caption' => $tr{'log summary'},
+    $sublogs->{'10.summary'} = {'caption' => $tr{'log summary'},
                                 'uri' => '/cgi-bin/logs.cgi/summary.dat',
                                 'title' => "$tr{'log summary'}",
                                 'enabled' => 1
                                 };
-    $sublogs->{'02.settings'} = {'caption' => $tr{'log settings'},
+    $sublogs->{'20.settings'} = {'caption' => $tr{'log settings'},
                                 'uri' => '/cgi-bin/logs.cgi/config.dat',
                                 'title' => "$tr{'log settings'}",
                                 'enabled' => 1
                                 };
-    $sublogs->{'03.proxy'} = {'caption' => $tr{'proxy logs'},
+    $sublogs->{'30.proxy'} = {'caption' => $tr{'proxy logs'},
                                 'uri' => '/cgi-bin/logs.cgi/proxylog.dat',
-                                'title' => "$tr{'proxy log viewer'}",
+                                'title' => "$tr{'proxy logs'}",
                                 'enabled' => 1
                                 };
-    $sublogs->{'04.firewall'} = {'caption' => $tr{'firewall logs'},
+    $sublogs->{'40.firewall'} = {'caption' => $tr{'firewall logs'},
                                 'uri' => '/cgi-bin/logs.cgi/firewalllog.dat',
-                                'title' => "$tr{'firewall log viewer'}",
+                                'title' => "$tr{'firewall logs'}",
                                 'enabled' => 1
                                 };
-    $sublogs->{'05.ids'} = {'caption' => $tr{'ids logs'},
+    $sublogs->{'50.ids'} = {'caption' => $tr{'ids logs'},
                                'uri' => '/cgi-bin/logs.cgi/ids.dat',
-                               'title' => "$tr{'intrusion detection system log viewer'}",
+                               'title' => "$tr{'ids logs'}",
                                'enabled' => 1
                                };
-    $sublogs->{'07.urlfilter'} = {
+    $sublogs->{'60.urlfilter'} = {
                                'caption' => $tr{'urlfilter log'},
                                'uri' => '/cgi-bin/logs.cgi/urlfilter.dat',
                                'title' => "$tr{'urlfilter log'}",
                                'enabled' => 1,
                                };
-    $sublogs->{'08.openvpn'} = {'caption' => $tr{'openvpn log'},
+    $sublogs->{'70.openvpn'} = {'caption' => $tr{'openvpn log'},
                                'uri' => '/cgi-bin/logs.cgi/openvpn.dat',
                                'title' => "$tr{'openvpn log'}",
                                'enabled' => 1
                                };
-    $sublogs->{'09.system'} = {'caption' => $tr{'system logs'},
+    $sublogs->{'80.system'} = {'caption' => $tr{'system logs'},
                                'uri' => '/cgi-bin/logs.cgi/log.dat',
-                               'title' => "$tr{'system log viewer'}",
+                               'title' => "$tr{'system logs'}",
                                'enabled' => 1
                                };
-    $sublogs->{'10.userlog'} = {'caption' => $tr{'user proxy logs'},
+    $sublogs->{'90.userlog'} = {'caption' => $tr{'user proxy logs'},
                                'uri' => '/cgi-bin/logs.cgi/userlog.dat',
-                               'title' => "$tr{'user log viewer'}",
+                               'title' => "$tr{'user log'}",
                                'enabled' => 1
                                };
 
     my %subipfirehash = ();
     my $subipfire = \%subipfirehash;
-    $subipfire->{'01.pakfire'} = {'caption' => $tr{'pakfire'},
+    $subipfire->{'10.pakfire'} = {'caption' => 'Pakfire',
                                  'uri' => '/cgi-bin/pakfire.cgi',
-                                 'title' => "$tr{'paketmanager'}",
+                                 'title' => "Pakfire",
                                  'enabled' => 1,
                                  };
-    $subipfire->{'02.asterisk'} = {'caption' => $tr{'asterisk'},
+    $subipfire->{'20.asterisk'} = {'caption' => 'Asterisk',
                                  'uri' => '/cgi-bin/asterisk.cgi',
-                                 'title' => "$tr{'asterisk'}",
+                                 'title' => "Asterisk",
                                  'enabled' => 1,
                                  };
-    $subipfire->{'02.samba'} = {'caption' => $tr{'samba'},
+    $subipfire->{'30.samba'} = {'caption' => 'Samba',
                                  'uri' => '/cgi-bin/samba.cgi',
-                                 'title' => "$tr{'samba'}",
+                                 'title' => "Samba",
                                  'enabled' => 1,
                                  };
     $subipfire->{'99.help'} = {'caption' => $tr{'help'},
@@ -433,13 +470,13 @@ sub genmenu {
                                };
 
     if (! blue_used() && ! orange_used()) {
-       $menu->{'05.firewall'}{'subMenu'}->{'04.dmz'}{'enabled'} = 0;
+       $menu->{'05.firewall'}{'subMenu'}->{'40.dmz'}{'enabled'} = 0;
     }
     if (! blue_used()) {
-       $menu->{'05.firewall'}{'subMenu'}->{'03.wireless'}{'enabled'} = 0;
+       $menu->{'05.firewall'}{'subMenu'}->{'30.wireless'}{'enabled'} = 0;
     }
-    if (! $ethsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $ethsettings{'RED_TYPE'} eq 'STATIC' ) {
-       $menu->{'03.network'}{'subMenu'}->{'04.aliases'}{'enabled'} = 0;
+    if ( $ethsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $ethsettings{'RED_TYPE'} eq 'STATIC' ) {
+       $menu->{'03.network'}{'subMenu'}->{'70.aliases'}{'enabled'} = 1;
     }
 }
 
@@ -712,8 +749,16 @@ sub openpage {
 
     $extrahead
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+END
+;
+    if ($settings{'FX'} eq 'on') {
+    print <<END
     <meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5,Transition=12)">
     <meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5,Transition=12)">
+END
+;
+    }
+    print <<END
     <link rel="shortcut icon" href="/favicon.ico" />
     <style type="text/css">\@import url(/include/style.css);</style>
     <style type="text/css">\@import url(/include/menu.css);</style>
@@ -760,7 +805,7 @@ END
     &showsubsection($menu);
 
     print <<END
-
+      <p><center><img src="/images/iptux.png" width='160px' height='160px'></center></p>
       </td>
         <td width="100%" valign="top">
         <div id="page-content">
@@ -784,7 +829,7 @@ sub closepage () {
     print <<END
          <div align="center">
             <p>
-             <div style="font-size: 9px"><b>Status:</b> $status <b>Uptime:</b>$uptime</div>
+             <div style="font-size: 9px"><b>Status:</b> $status <b>Uptime:</b>$uptime <b>Version:</b> $FIREBUILD</div> 
             </p>
           </div>
        </body>
@@ -1223,33 +1268,125 @@ sub cleanhtml
        $outstring =~ s/>/&gt;/g;
        return $outstring;
 }
+
 sub connectionstatus
 {
-        my $status;
-        opendir UPLINKS, "/var/ipfire/uplinks" or die "Cannot read uplinks: $!";
-                foreach my $uplink (sort grep !/^\./, readdir UPLINKS) {
-                    if ( -f "${swroot}/uplinks/${uplink}/active") {
-                        if ( ! $status ) {
-                                $timestr = &age("${swroot}/uplinks/${uplink}/active");
-                                $status = "$tr{'connected'}: $uplink (<span class='ipcop_StatusBigRed'>$timestr</span>) ";
-                        } else {
-                                $timestr = &age("${swroot}/uplinks/${uplink}/active");
-                                $status = "$status , $uplink (<span class='ipcop_StatusBigRed'>$timestr</span>) ";
-                        }
-                    } elsif ( -f "${swroot}/uplinks/${uplink}/connecting") {
-                        if ( ! $status ) {
-                                $status = "$tr{'connecting'} $uplink";
-                        } else {
-                                $status = "$status , $tr{'connecting'} $uplink (<span class='ipcop_StatusBigRed'>$timestr</span>) ";
-                        }
-                    }
-                    $lines++;
-                }
-                closedir(UPLINKS);
-                if ( ! $status ) {
-                        $status = "$tr{'idle'}";
-                }
-                $connstate = "<span class='ipcop_StatusBig'>$status</span>";
+    my %pppsettings = ();
+    my %netsettings = ();
+    my $iface='';
+
+    $pppsettings{'PROFILENAME'} = 'None';
+    &General::readhash("${General::swroot}/ppp/settings", \%pppsettings);
+    &General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
+
+    my $profileused='';
+    if ( ! ( $netsettings{'CONFIG_TYPE'} =~ /^(2|3|6|7)$/ && $netsettings{'RED_TYPE'} =~ /^(DHCP|STATIC)$/ ) ) {
+       $profileused="- $pppsettings{'PROFILENAME'}";
+    }
+
+    if ( ( $pppsettings{'METHOD'} eq 'DHCP' && $netsettings{'RED_TYPE'} ne 'PPTP') 
+                                               || $netsettings{'RED_TYPE'} eq 'DHCP' ) {
+               if (open(IFACE, "${General::swroot}/red/iface")) {
+                       $iface = <IFACE>;
+                       close IFACE;
+                       chomp ($iface);
+                       $iface =~ /([a-zA-Z0-9]*)/; $iface = $1;
+               }
+    }
+
+    my ($timestr, $connstate);
+    if ($netsettings{'CONFIG_TYPE'} =~ /^(0|1|4|5)$/ &&  $pppsettings{'TYPE'} =~ /^isdn/) {
+       # Count ISDN channels
+       my ($idmap, $chmap, $drmap, $usage, $flags, $phone);
+       my @phonenumbers;
+       my $count=0;
+
+       open (FILE, "/dev/isdninfo");
+
+       $idmap = <FILE>; chop $idmap;
+       $chmap = <FILE>; chop $chmap;
+       $drmap = <FILE>; chop $drmap;
+       $usage = <FILE>; chop $usage;
+       $flags = <FILE>; chop $flags;
+       $phone = <FILE>; chop $phone;
+
+       $phone =~ s/^phone(\s*):(\s*)//;
+
+       @phonenumbers = split / /, $phone;
+
+       foreach (@phonenumbers) {
+               if ($_ ne '???') {
+                       $count++;
+               }
+       }
+       close (FILE);
+
+       ## Connection status
+       my $number;
+       if ($count == 0) {
+               $number = 'none!';
+       } elsif ($count == 1) {
+               $number = 'single';
+       } else {
+               $number = 'dual';
+       }
+
+       if (-e "${General::swroot}/red/active") {
+               $timestr = &General::age("${General::swroot}/red/active");
+               $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'connected'} - $number channel (<span class='ipcop_StatusBigRed'>$timestr</span>) $profileused</span>";
+       } else {
+               if ($count == 0) {
+                       if (-e "${General::swroot}/red/dial-on-demand") {
+                               $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'dod waiting'} $profileused</span>";
+                       } else {
+                               $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'idle'} $profileused</span>";
+                       }
+               } else {
+                       $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'connecting'} $profileused</span>";
+               }
+       }
+    } elsif ($netsettings{'RED_TYPE'} eq "STATIC" || $pppsettings {'METHOD'} eq 'STATIC') {
+       if (-e "${General::swroot}/red/active") {
+               $timestr = &General::age("${General::swroot}/red/active");
+               $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'connected'} (<span class='ipcop_StatusBigRed'>$timestr</span>) $profileused</span>";
+       } else {
+               $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'idle'} $profileused</span>";
+       }
+    } elsif ( ( (-e "${General::swroot}/dhcpc/dhcpcd-$iface.pid") && $netsettings{'RED_TYPE'} ne 'PPTP' ) || 
+       !system("/bin/ps -ef | /bin/grep -q '[p]ppd'") || !system("/bin/ps -ef | /bin/grep -q '[c]onnectioncheck'")) {
+       if (-e "${General::swroot}/red/active") {
+               $timestr = &General::age("${General::swroot}/red/active");
+               if ($pppsettings{'TYPE'} =~ /^(modem|bewanadsl|conexantpciadsl|eagleusbadsl)$/) {
+                       my $speed;
+                       if ($pppsettings{'TYPE'} eq 'modem') {
+                               open(CONNECTLOG, "/var/log/connect.log");
+                               while (<CONNECTLOG>) {
+                                       if (/CONNECT/) {
+                                               $speed = (split / /)[6];
+                                       }
+                               }
+                               close (CONNECTLOG);
+                       } elsif ($pppsettings{'TYPE'} eq 'bewanadsl') {
+                               $speed = `/usr/bin/unicorn_status | /bin/grep Rate | /usr/bin/cut -f2 -d ':'`;
+                       } elsif ($pppsettings{'TYPE'} eq 'conexantpciadsl') {
+                               $speed = `/bin/cat /proc/net/atm/CnxAdsl:* | /bin/grep 'Line Rates' | /bin/sed -e 's+Line Rates:   Receive+Rx+' -e 's+Transmit+Tx+'`;
+                       } elsif ($pppsettings{'TYPE'} eq 'eagleusbadsl') {
+                               $speed = `/usr/sbin/eaglestat | /bin/grep Rate`;
+                       }
+                       $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'connected'} (<span class='ipcop_StatusBigRed'>$timestr</span>) $profileused (\@$speed)</span>";
+               } else {
+                       $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'connected'} (<span class='ipcop_StatusBigRed'>$timestr</span>) $profileused</span>";
+               }
+       } else {
+               if (-e "${General::swroot}/red/dial-on-demand") {
+                   $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'dod waiting'} $profileused</span>";
+               } else {
+                   $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'connecting'} $profileused</span>";
+               }
+       }
+    } else {
+       $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'idle'} $profileused</span>";
+    }
     return $connstate;
 }
 
@@ -1380,7 +1517,7 @@ sub PrintActualLeases
 END
     ;
 
-    open(LEASES,"/var/lib/dhcp/dhcpd.leases") or die "Can't open dhcpd.leases";
+    open(LEASES,"/var/state/dhcp/dhcpd.leases") or die "Can't open dhcpd.leases";
     while ($line = <LEASES>) {
        next if( $line =~ /^\s*#/ );
        chomp($line);