%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;
}
};
### Read IPFire Buildversion
-$FIREBUILD = "Datei firebuild nicht gefunden\n";
+$FIREBUILD = "File not found: firebuild\n";
if (open(MYFile, "<${swroot}/firebuild")) {
$FIREBUILD = <MYFile>;
+ 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]$/) {
my %subnetworkhash = ();
my $subnetwork = \%subnetworkhash;
- $subnetwork->{'10.proxy'} = {'caption' => 'Webproxy',
+ $subnetwork->{'10.netconf'} = {'caption' => "$tr{'net config'}",
+ 'uri' => '/cgi-bin/netconfig.cgi',
+ 'title' => "$tr{'net config'}",
+ 'enabled' => 0,
+ };
+ $subnetwork->{'20.proxy'} = {'caption' => 'Webproxy',
'uri' => '/cgi-bin/proxy.cgi',
'title' => "Webproxy",
'enabled' => 1,
};
- $subnetwork->{'20.urlfilter'} = {'caption' => 'URL-Filter',
+ $subnetwork->{'30.urlfilter'} = {'caption' => 'URL-Filter',
'uri' => '/cgi-bin/urlfilter.cgi',
'title' => "URL-Filter",
'enabled' => 1,
};
- $subnetwork->{'30.dhcp'} = {'caption' => $tr{'dhcp server'},
+ $subnetwork->{'40.dhcp'} = {'caption' => $tr{'dhcp server'},
'uri' => '/cgi-bin/dhcp.cgi',
'title' => "$tr{'dhcp server'}",
'enabled' => 1,
};
- $subnetwork->{'40.scheduler'} = {
- 'caption' => $tr{'scheduler'},
+ $subnetwork->{'50.scheduler'} = {
+ 'caption' => $tr{'connscheduler'},
'uri' => '/cgi-bin/connscheduler.cgi',
- 'title' => "$tr{'scheduler'}",
+ 'title' => "$tr{'connscheduler'}",
'enabled' => 1,
};
- $subnetwork->{'50.hosts'} = {
+ $subnetwork->{'60.hosts'} = {
'caption' => $tr{'edit hosts'},
'uri' => '/cgi-bin/hosts.cgi',
'title' => "$tr{'edit hosts'}",
'enabled' => 1,
};
- $subnetwork->{'60.upload'} = {
+ $subnetwork->{'70.upload'} = {
'caption' => $tr{'upload'},
'uri' => '/cgi-bin/upload.cgi',
'title' => "$tr{'upload'}",
'enabled' => 0,
};
- $subnetwork->{'70.aliases'} = {
+ $subnetwork->{'80.aliases'} = {
'caption' => $tr{'aliases'},
'uri' => '/cgi-bin/aliases.cgi',
'title' => "$tr{'aliases'}",
'enabled' => 0,
};
- $subnetwork->{'80.wakeonlan'} = {
+ $subnetwork->{'90.wakeonlan'} = {
'caption' => $tr{'WakeOnLan'},
'uri' => '/cgi-bin/wakeonlan.cgi',
'title' => "$tr{'WakeOnLan'}",
'title' => "$tr{'outgoing firewall'}",
'enabled' => 1,
};
- $subfirewall->{'60.fwopts'} = {
+ $subfirewall->{'60.upnp'} = {
+ 'caption' => 'UPnP',
+ 'uri' => '/cgi-bin/upnp.cgi',
+ 'title' => "Universal Plug and Play",
+ 'enabled' => 1,
+ };
+ $subfirewall->{'70.fwopts'} = {
'caption' => $tr{'options fw'},
'uri' => '/cgi-bin/optionsfw.cgi',
'title' => "$tr{'options fw'}",
'enabled' => 1
};
$sublogs->{'60.urlfilter'} = {
- 'caption' => $tr{'urlfilter log'},
+ 'caption' => $tr{'urlfilter logs'},
'uri' => '/cgi-bin/logs.cgi/urlfilter.dat',
'title' => "$tr{'urlfilter log'}",
'enabled' => 1,
return '';
}
-
-sub showmenu() {
- print <<EOF
- <div id="menu-top">
- <ul>
-EOF
-;
- foreach my $k1 ( sort keys %$menu ) {
- if (! $menu->{$k1}{'enabled'}) {
- next;
- }
-
- my $link = getlink($menu->{$k1});
- if ($link eq '') {
- next;
- }
- if (! is_menu_visible($link)) {
- next;
- }
- if ($menu->{$k1}->{'selected'}) {
- print '<li class="selected">';
- } else {
- print '<li>';
- }
-
- print <<EOF
- <div class="rcorner">
- <a href="$link">$menu->{$k1}{'caption'}</a>
- </div>
- </li>
-EOF
-;
- }
-
- print <<EOF
- </ul>
- </div>
-EOF
-;
-}
-
-sub getselected($) {
- my $root = shift;
- if (!$root) {
- return 0;
- }
-
- foreach my $item (%$root) {
- if ($root->{$item}{'selected'}) {
- return $root->{$item};
- }
- }
-}
-
-sub showsubsection($$) {
- my $root = shift;
- my $id = shift;
- if ($id eq '') {
- $id = 'menu-left';
- }
-
- if (! $root) {
- return;
- }
- my $selected = getselected($root);
- if (! $selected) {
- return;
- }
- my $submenus = $selected->{'subMenu'};
- if (! $submenus) {
- return;
- }
-
- print <<EOF
- <div id="$id">
- <ul>
-EOF
-;
- foreach my $item (sort keys %$submenus) {
- my $hash = $submenus->{$item};
- if (! $hash->{'enabled'}) {
- next;
- }
-
- my $link = getlink($hash);
- if ($link eq '') {
- next;
- }
- if (! is_menu_visible($link)) {
- next;
- }
- if ($hash->{'selected'}) {
- print '<li class="selected">';
- } else {
- print '<li>';
- }
-
- print <<EOF
- <a href="$link">$hash->{'caption'}</a>
- </li>
-EOF
-;
- }
-
- print <<EOF
- </ul>
- </div>
-EOF
-;
-
-}
-
-
-sub showsubsubsection($) {
- my $root = shift;
- if (!$root) {
- return;
- }
- my $selected = getselected($root);
- if (! $selected) {
- return
- }
- if (! $selected->{'subMenu'}) {
- return
- }
-
- showsubsection($selected->{'subMenu'}, 'menu-subtop');
-}
-
-
-sub get_helpuri() {
- my $helpfile = '';
- if ($URI[0] =~ /.*\/([^\/]+)\.cgi/) {
- $helpfile = $1;
- } else {
- return '';
- }
- $helpfile .= '.help.html';
-
- my $helpuri = '/doc/'.$language.'/'.$helpfile;
- if (! -e $ENV{'DOCUMENT_ROOT'}.$helpuri) {
- return '';
- }
- return $helpuri;
-}
-
-
-sub openpage {
- my $title = shift;
- my $boh = shift;
- my $extrahead = shift;
-
- @URI=split ('\?', $ENV{'REQUEST_URI'} );
- &readhash("${swroot}/main/settings", \%settings);
- &genmenu();
-
- my $h2 = gettitle($menu);
- my $helpuri = get_helpuri();
-
- $title = "IPFire - $title";
- if ($settings{'WINDOWWITHHOSTNAME'} eq 'on') {
- $title = "$settings{'HOSTNAME'}.$settings{'DOMAINNAME'} - $title";
- }
-
- print <<END
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html>
- <head>
- <title>$title</title>
-
- $extrahead
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-END
-;
- if ($settings{'FX'} ne 'off') {
- 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>
- <style type="text/css">\@import url(/include/content.css);</style>
- <script language="javascript" type="text/javascript">
-
- function swapVisibility(id) {
- el = document.getElementById(id);
- if(el.style.display != 'block') {
- el.style.display = 'block'
- }
- else {
- el.style.display = 'none'
- }
- }
- </script>
-
- </head>
- <body>
-<!-- IPFIRE HEADER -->
-
-<div id="main">
-
-<div id="header">
- <img id="logo-product" src="/images/logo_ipfire.gif">
- <div id="header-icons">
- <a href="http://users.ipfire.eu/" target="_blank"><img border="0" src="/images/help.gif"></a>
- </div>
-</div>
-
-END
-;
-
- &showmenu();
-
-print <<END
-<div id="content">
- <table width="90%">
- <tr>
- <td valign="top">
-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">
- <h2>$h2</h2>
-END
- ;
-
- &showsubsubsection($menu);
-
- eval {
- require 'ipfire-network.pl';
- $supported = check_support();
- warn_unsupported($supported);
- };
-}
-
-sub openpagewithoutmenu {
- my $title = shift;
- my $boh = shift;
- my $extrahead = shift;
-
- @URI=split ('\?', $ENV{'REQUEST_URI'} );
- &readhash("${swroot}/main/settings", \%settings);
- &genmenu();
-
- my $h2 = gettitle($menu);
- my $helpuri = get_helpuri();
-
- $title = "IPFire - $title";
- if ($settings{'WINDOWWITHHOSTNAME'} eq 'on') {
- $title = "$settings{'HOSTNAME'}.$settings{'DOMAINNAME'} - $title";
- }
-
- print <<END
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html>
- <head>
- <title>$title</title>
-
- $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>
- <style type="text/css">\@import url(/include/content.css);</style>
- <script language="javascript" type="text/javascript">
-
- function swapVisibility(id) {
- el = document.getElementById(id);
- if(el.style.display != 'block') {
- el.style.display = 'block'
- }
- else {
- el.style.display = 'none'
- }
- }
- </script>
-
- </head>
- <body>
-<!-- IPFIRE HEADER -->
-
-<div id="main">
-
-<div id="header">
- <img id="logo-product" src="/images/logo_ipfire.gif">
- <div id="header-icons">
- <a href="http://users.ipfire.eu/" target="_blank"><img border="0" src="/images/help.gif"></a>
- </div>
-</div>
-
-END
-;
-print <<END
-<div id="content">
- <table width="90%">
- <tr>
- <td valign="top">
- <p><center><img src="/images/iptux.png" width='160px' height='160px'></center></p>
- </td>
- <td width="100%" valign="top">
- <div id="page-content">
- <h2>$h2</h2>
-END
- ;
-}
-
-sub closepage () {
- my $status = &connectionstatus();
- $uptime = `/usr/bin/uptime`;
-
- print <<END
- <div align="center">
- <p>
- <div style="font-size: 9px"><b>Status:</b> $status <b>Uptime:</b>$uptime <b>Version:</b> $FIREBUILD</div>
- </p>
- </div>
- </body>
-</html>
-END
-;
-}
-
-sub openbigbox
-{
- my $width = $_[0];
- my $align = $_[1];
- my $sideimg = $_[2];
-
- if ($errormessage) {
- $bgcolor = "style='background-color: $colourerr;'";
- } else {
- $bgcolor = '';
- }
-}
-
-sub closebigbox
-{
-# print "</td></tr></table></td></tr></table>\n"
-}
-
-sub openbox
-{
- $width = $_[0];
- $align = $_[1];
- $caption = $_[2];
-
- if ($caption) { print "<h3>$caption</h3>\n"; } else { print " "; }
-
- print "<table class=\"list\"><tr><td align=\"$align\">\n";
-}
-
-sub closebox
-{
- print "</td></tr></table><br><br>";
-}
-
sub writehash
{
my $filename = $_[0];
} 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>";
+ $connstate = "$Lang::tr{'connected'} ($timestr) $profileused (\@$speed)";
} else {
- $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'connected'} (<span class='ipcop_StatusBigRed'>$timestr</span>) $profileused</span>";
+ $connstate = "$Lang::tr{'connected'} ($timestr) $profileused";
}
} else {
if (-e "${General::swroot}/red/dial-on-demand") {
- $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'dod waiting'} $profileused</span>";
+ $connstate = "$Lang::tr{'dod waiting'} $profileused";
} else {
- $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'connecting'} $profileused</span>";
+ $connstate = "$Lang::tr{'connecting'} $profileused";
}
}
} else {
- $connstate = "<span class='ipcop_StatusBig'>$Lang::tr{'idle'} $profileused</span>";
+ $connstate = "$Lang::tr{'idle'} $profileused";
}
return $connstate;
}
<td width='25%' align='center'><a href='$ENV{'SCRIPT_NAME'}?IPADDR'><b>$tr{'ip address'}</b></a></td>
<td width='25%' align='center'><a href='$ENV{'SCRIPT_NAME'}?ETHER'><b>$tr{'mac address'}</b></a></td>
<td width='20%' align='center'><a href='$ENV{'SCRIPT_NAME'}?HOSTNAME'><b>$tr{'hostname'}</b></a></td>
-<td width='30%' align='center'><a href='$ENV{'SCRIPT_NAME'}?ENDTIME'><b>$tr{'lease expires'} (local time d/m/y)</b></a></td>
+<td width='25%' align='center'><a href='$ENV{'SCRIPT_NAME'}?ENDTIME'><b>$tr{'lease expires'} (local time d/m/y)</b></a></td>
+<td width='5%' align='center'><b>Add to fix leases<b></td>
</tr>
END
;
my $id = 0;
foreach my $key (sort leasesort keys %entries) {
-
+ print "<form method='post' action='/cgi-bin/dhcp.cgi'>\n";
my $hostname = &cleanhtml($entries{$key}->{HOSTNAME},"y");
if ($id % 2) {
}
print <<END
-<td align='center'>$entries{$key}->{IPADDR}</td>
-<td align='center'>$entries{$key}->{ETHER}</td>
-<td align='center'> $hostname </td>
-<td align='center'>
+<td align='center'><input type='hidden' name='FIX_ADDR' value='$entries{$key}->{IPADDR}' />$entries{$key}->{IPADDR}</td>
+<td align='center'><input type='hidden' name='FIX_MAC' value='$entries{$key}->{ETHER}' />$entries{$key}->{ETHER}</td>
+<td align='center'><input type='hidden' name='FIX_REMARK' value='$hostname' /> $hostname</td>
+<td align='center'><input type='hidden' name='FIX_ENABLED' value='on' />
END
;
} else {
print "$enddate";
}
- print "</td></tr>";
+ print <<END
+<td><input type='hidden' name='ACTION' value='$Lang::tr{'add'}2' /><input type='submit' name='SUBMIT' value='$Lang::tr{'add'}' />
+</td></td></tr></form>
+END
+ ;
$id++;
}