Hinzugefügt:

* Kleiner Tux im Webinterface für den eXciter und den Benne :)
Geändert:
  * time.cgi überarbeitet und Funktion verbessert.
  * index.cgi - noch ein Paar Fehler behoben oder was hinzugefügt.
  * FLASH-Eintrag aus der crontab gelöscht.
  * Online-Hilfe-Rettungsringe (die hässlichen) aus den CGIs entfernt.
  * Logger von ipcop nach ipfire umgestellt.
Gelöscht:
  * Nicht benötigte Reste vom IPCop entfernt.


git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@160 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8
This commit is contained in:
ms
2006-06-05 11:30:07 +00:00
parent ca35618d11
commit 39a7cc119a
17 changed files with 57 additions and 176 deletions

View File

@@ -23,14 +23,14 @@ $|=1; # line buffering
$General::version = 'VERSION';
$General::swroot = 'CONFIG_ROOT';
$General::noipprefix = 'noipg-';
$General::adminmanualurl = 'http://www.ipcop.org/1.4.0/en/admin/html';
$General::adminmanualurl = 'http://users.ipfire.eu';
sub log
{
my $logmessage = $_[0];
$logmessage =~ /([\w\W]*)/;
$logmessage = $1;
system('/usr/bin/logger', '-t', 'ipcop', $logmessage);
system('/usr/bin/logger', '-t', 'ipfire', $logmessage);
}
sub readhash
@@ -481,7 +481,7 @@ sub FetchPublicIp {
my ($out, $response) = Net::SSLeay::get_http( 'checkip.dyndns.org',
80,
"/",
Net::SSLeay::make_headers('User-Agent' => 'Ipcop' )
Net::SSLeay::make_headers('User-Agent' => 'IPFire' )
);
if ($response =~ m%HTTP/1\.. 200 OK%) {
$out =~ /Current IP Address: (\d+.\d+.\d+.\d+)/;

View File

@@ -760,7 +760,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">

View File

@@ -3,5 +3,5 @@ UPDATE_PERIOD=daily
UPDATE_VALUE=1
UPDATE_METHOD=manually
ENABLENTP=off
NTP_ADDR_1=pool.ntp.org
NTP_ADDR_1=de.pool.ntp.org
VALID=yes

View File

@@ -9,9 +9,6 @@ HOME=/
# Log rotation
01 * * * * /usr/sbin/logrotate /etc/logrotate.conf
# Backup logs to flashdisk
01 * * * * [ -f "/etc/FLASH" ] && /etc/rc.d/rc.flash.down
# Set time
*/5 * * * * /usr/local/bin/timecheck > /dev/null 2>&1

View File

@@ -576,9 +576,7 @@ print <<END
<td class='base' width='25%'><img src='/blob.gif' align='top' alt='*' />&nbsp;$Lang::tr{'this field may be blank'}</td>
<td class='base' width='30%'>$warnNTPmessage</td>
<td width='40%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
<td width='5%' align='right'>
<a href='${General::adminmanualurl}/services.html#services_dhcp' target='_blank'>
<img src='/images/web-support.png' alt='$Lang::tr{'online help en'}' title='$Lang::tr{'online help en'}' /></a></td>
<td width='5%' align='right'>&nbsp;</td>
</tr>
</table>
</form>

View File

@@ -102,13 +102,12 @@ print <<END;
<!-- Table of networks -->
<table border='0' width=80%>
<!-- Headline -->
<tr> <th bgcolor='lightgrey'>$Lang::tr{'network'}
<th bgcolor='lightgrey'>IP
<th bgcolor='lightgrey'>$Lang::tr{'status'}
<!-- RED -->
<tr> <td bgcolor='$Header::colourred' width='25%'><font size='2' color='white'><b>$Lang::tr{'internet'}:</b></font><br>
<td width='30%'>$ipaddr <td width='45%'>$connstate
<td width='30%'>$ipaddr
<td width='45%'>$connstate
<tr><td colspan='2'>
<form method='post' action='/cgi-bin/dial.cgi'>$Lang::tr{'profile'}:
<select name='PROFILE'>
@@ -161,13 +160,14 @@ END
if ( `cat /var/ipfire/proxy/advanced/settings | grep ^TRANSPARENT_BLUE=on` ) { print " (transparent)"; }
} else { print "Proxy aus"; }
}
if (`ifconfig | grep $netsettings{'ORANGE_DEV'}`) { print <<END;
if ( $netsettings{'ORANGE_DEV'} ) { print <<END;
<tr><td bgcolor='$Header::colourorange' width='25%'><font size='2' color='white'><b>$Lang::tr{'dmz'}:</b></font><br>
<td width='30%'>$netsettings{'ORANGE_ADDRESS'}
<td width='45%'><font color=$Header::colourgreen>Online</font>
END
}
if ( `cat /var/ipfire/vpn/settings | grep ^ENABLED=on` ) {
if ( `cat /var/ipfire/vpn/settings | grep ^ENABLED=on` ||
`cat /var/ipfire/vpn/settings | grep ^ENABLED_BLUE=on` ) {
my $ipsecip = `cat /var/ipfire/vpn/settings | grep ^VPN_IP= | cut -c 8-`;
print <<END;
<tr><td bgcolor='$Header::colourvpn' width='25%'><font size='2' color='white'><b>$Lang::tr{'vpn'}:</b></font><br>

View File

@@ -714,9 +714,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'edit'}){
}
}
print <<END
<td width='5%' align='right'>
<a href='${General::adminmanualurl}/section-firewall.html#section-port-forwarding' target='_blank'>
<img src='/images/web-support.png' alt='$Lang::tr{'online help en'}' title='$Lang::tr{'online help en'}' /></a></td>
<td width='5%' align='right'>&nbsp;</td>
</tr>
</table>
END

View File

@@ -186,9 +186,7 @@ END
<td width='30%' align='center'>
<input type='submit' name='ACTION' value='$Lang::tr{'save'}' />
</td>
<td width='10%' align='right'>
<a href='${General::adminmanualurl}/system.html#shutdown' target='_blank'>
<img src='/images/web-support.png' title='$Lang::tr{'online help en'}' /></a></td>
<td width='10%' align='right'>&nbsp;
</tr>
</table>

View File

@@ -19,7 +19,7 @@ use strict;
#use warnings;
#use CGI::Carp 'fatalsToBrowser';
require 'CONFIG_ROOT/general-functions.pl';
require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
@@ -46,49 +46,6 @@ $timesettings{'SETYEAR'} = '';
&Header::getcgihash(\%timesettings);
if ($timesettings{'ACTION'} eq $Lang::tr{'instant update'})
{
if ($timesettings{'SETHOUR'} eq '' || $timesettings{'SETHOUR'} < 0 || $timesettings{'SETHOUR'} > 23) {
$errormessage = $Lang::tr{'invalid time entered'};
goto UPDTERROR;
}
if ($timesettings{'SETMINUTES'} eq '' || $timesettings{'SETMINUTES'} < 0 || $timesettings{'SETMINUTES'} > 59) {
$errormessage = $Lang::tr{'invalid time entered'};
goto UPDTERROR;
}
if ($timesettings{'SETDAY'} eq '' || $timesettings{'SETDAY'} < 1 || $timesettings{'SETDAY'} > 31) {
$errormessage = $Lang::tr{'invalid date entered'};
goto UPDTERROR;
}
if ($timesettings{'SETMONTH'} eq '' || $timesettings{'SETMONTH'} < 1 || $timesettings{'SETMONTH'} > 12) {
$errormessage = $Lang::tr{'invalid date entered'};
goto UPDTERROR;
}
if ($timesettings{'SETYEAR'} eq '' || $timesettings{'SETYEAR'} < 2003 || $timesettings{'SETYEAR'} > 2030) {
$errormessage = $Lang::tr{'invalid date entered'};
goto UPDTERROR;
}
UPDTERROR:
if ($errormessage) {
$timesettings{'VALID'} = 'no'; }
else {
$timesettings{'VALID'} = 'yes'; }
if ($timesettings{'VALID'} eq 'yes') {
# we want date in YYYY-MM-DD HH:MM format for date command
# EAO changed datestring to ISO 6801 format 2003-08-11
my $datestring = "$timesettings{'SETYEAR'}-$timesettings{'SETMONTH'}-$timesettings{'SETDAY'}";
my $timestring = "$timesettings{'SETHOUR'}:$timesettings{'SETMINUTES'}";
# EAO setdate.c also revised for ISO 6801 date format 2003-08-11
system ('/usr/local/bin/setdate', $datestring, $timestring);
&General::log("$Lang::tr{'time date manually reset'} $datestring $timestring");
}
unless ($errormessage) {
undef %timesettings;
}
}
if ($timesettings{'ACTION'} eq $Lang::tr{'save'})
{
if ($timesettings{'ENABLENTP'} eq 'on')
@@ -203,6 +160,7 @@ $timesettings{'ACTION'} = &Header::cleanhtml ($timesettings{'ACTION'});
if ($timesettings{'ACTION'} eq $Lang::tr{'set time now'} && $timesettings{'ENABLENTP'} eq 'on')
{
system ('/bin/touch', "${General::swroot}/time/settimenow");
system ('/usr/local/bin/timecheckctrl >& /dev/null');
}
&General::readhash("${General::swroot}/time/settings", \%timesettings);
@@ -213,7 +171,7 @@ if ($timesettings{'VALID'} eq '')
$timesettings{'UPDATE_METHOD'} = 'manually';
$timesettings{'UPDATE_VALUE'} = '1';
$timesettings{'UPDATE_PERIOD'} = 'daily';
$timesettings{'NTP_ADDR_1'} = 'pool.ntp.org';
$timesettings{'NTP_ADDR_1'} = 'de.pool.ntp.org';
$timesettings{'NTP_ADDR_2'} = 'pool.ntp.org';
}
@@ -345,9 +303,7 @@ print <<END
<td width='30%'><img src='/blob.gif' alt='*' /> $Lang::tr{'this field may be blank'}</td>
<td width='40%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'set time now'}' /></td>
<td width='25%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
<td width='5%' align='right'>
<a href='${General::adminmanualurl}/services.html#services_time' target='_blank'><img src='/images/web-support.png' title='$Lang::tr{'online help en'}' /></a>
</td>
<td width='5%' align='right'>&nbsp;</td>
</tr>
</table>
END
@@ -355,34 +311,6 @@ END
&Header::closebox();
&Header::openbox('100%', 'left', $Lang::tr{'update time'});
print <<END
<table width='100%'>
<tr>
<td width='65%' class='base'>
<table>
<tr>
<td>$Lang::tr{'year'}:&nbsp;</td>
<td><input type='text' name='SETYEAR' size='4' maxlength='4' value='$timesettings{'SETYEAR'}' /></td>
<td>&nbsp;$Lang::tr{'month'}:&nbsp;</td>
<td><input type='text' name='SETMONTH' size='2' maxlength='2' value='$timesettings{'SETMONTH'}' /></td>
<td>&nbsp;$Lang::tr{'day'}:&nbsp;</td>
<td><input type='text' name='SETDAY' size='2' maxlength='2' value='$timesettings{'SETDAY'}' /></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;$Lang::tr{'hours2'}:&nbsp;</td>
<td><input type='text' name='SETHOUR' size='2' maxlength='2' value='$timesettings{'SETHOUR'}' /></td>
<td>&nbsp;$Lang::tr{'minutes'}:&nbsp;</td>
<td><input type='text' name='SETMINUTES' size='2' maxlength='2' value='$timesettings{'SETMINUTES'}' /></td>
</tr>
</table>
</td>
<td width='35%' align='center' class='base'><input type='submit' name='ACTION' value='$Lang::tr{'instant update'}' /></td>
</tr>
</table>
END
;
&Header::closebox();
print "</form>\n";
&Header::closebigbox();

View File

@@ -225,9 +225,7 @@ print <<END
<input type='hidden' name='ACTION' value='add' />
<input type='submit' name='SUBMIT' value='$buttontext' />
</td>
<td width='5%' align='right'>
<a href='${General::adminmanualurl}/section-firewall.html#section-blue-access' target='_blank'>
<img src='/images/web-support.png' alt='$Lang::tr{'online help en'}' title='$Lang::tr{'online help en'}' /></a></td>
<td width='5%' align='right'>&nbsp;</td>
</tr>
</table>
END

BIN
html/html/images/iptux.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -1361,8 +1361,9 @@ usr/local/bin/setddns.pl
usr/local/bin/setreservedports
usr/local/bin/settime
usr/local/bin/timecheck
usr/local/bin/timecheckctrl
#usr/local/bin/tunerrd.pl
usr/local/bin/updatelists.pl
#usr/local/bin/updatelists.pl
usr/local/bin/resetusb
#usr/local/doc
#usr/local/etc

View File

@@ -9,7 +9,7 @@ SUID_PROGS = setdmzholes setportfw setfilters setxtaccess restartdhcp restartsno
ipfirebkcfg ipfirerscfg installpackage installfcdsl ipsecctrl \
setaliases ipfirebackup restartntpd \
restartapplejuice setdate rebuildhosts \
restartsyslogd logwatch openvpnctrl
restartsyslogd logwatch openvpnctrl timecheckctrl
# restartwireless
install : all
@@ -78,5 +78,8 @@ restartwireless: restartwireless.c setuid.o ../install+setup/libsmooth/varval.o
ipsecctrl: ipsecctrl.c setuid.o ../install+setup/libsmooth/varval.o
$(COMPILE) -I../install+setup/libsmooth/ ipsecctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
timecheckctrl: timecheckctrl.c setuid.o ../install+setup/libsmooth/varval.o
$(COMPILE) -I../install+setup/libsmooth/ timecheckctrl.c setuid.o ../install+setup/libsmooth/varval.o -o $@
ipfirebackup: ipfirebackup.c setuid.o
$(COMPILE) -lcrypt ipfirebackup.c setuid.o -o $@

View File

@@ -0,0 +1,25 @@
/* SmoothWall helper program - smoothiedeath
*
* This program is distributed under the terms of the GNU General Public
* Licence. See the file COPYING for details.
*
* (c) Lawrence Manning, 2001
* Simple program intended to be installed setuid(0) that can be used for
* starting shutdown.
*
* $Id: ipcopdeath.c,v 1.2 2003/12/11 10:57:34 riddles Exp $
*
*/
#include <stdlib.h>
#include "setuid.h"
int main(void)
{
if (!(initsetuid()))
exit(1);
safe_system("/usr/local/bin/timecheck");
return 0;
}

View File

@@ -89,7 +89,7 @@ sub updatecpugraph {
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#EAE9EE",
"--color", "BACK#FFFFFF",
"-t $tr{'cpu usage per'} $tr{$period}",
"DEF:user=$rrdlog/cpu.rrd:user:AVERAGE",
"DEF:system=$rrdlog/cpu.rrd:system:AVERAGE",
@@ -156,7 +156,7 @@ sub updatememgraph {
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#EAE9EE",
"--color", "BACK#FFFFFF",
"-t $tr{'memory usage per'} $tr{$period}",
"DEF:used=$rrdlog/mem.rrd:memused:AVERAGE",
"DEF:free=$rrdlog/mem.rrd:memfree:AVERAGE",
@@ -198,7 +198,7 @@ sub updatememgraph {
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-u 100", "-r",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#EAE9EE",
"--color", "BACK#FFFFFF",
"-t $tr{'swap usage per'} $tr{$period}",
"DEF:used=$rrdlog/mem.rrd:swapused:AVERAGE",
"DEF:free=$rrdlog/mem.rrd:swapfree:AVERAGE",
@@ -269,7 +269,7 @@ sub updatediskgraph {
"--alt-y-grid", "-w 600", "-h 100", "-l 0", "-r",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#EAE9EE",
"--color", "BACK#FFFFFF",
"-t $tr{'disk access per'} $tr{$period}",
"DEF:read=$rrdlog/disk.rrd:readsect:AVERAGE",
"DEF:write=$rrdlog/disk.rrd:writesect:AVERAGE",
@@ -350,7 +350,7 @@ sub updateifgraph {
"--alt-y-grid", "-w 600", "-h 100",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#EAE9EE",
"--color", "BACK#FFFFFF",
"-t $tr{'traffic on'} $interface ($tr{'graph per'} $tr{$period})",
"-v$tr{'bytes per second'}",
"DEF:incoming=$rrdlog/$interface.rrd:incoming:AVERAGE",
@@ -398,7 +398,7 @@ sub updatefwhitsgraph {
"--alt-y-grid", "-w 600", "-h 200",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#EAE9EE",
"--color", "BACK#FFFFFF",
"-t firewall hits over the last $interval",
"DEF:amount=$rrdlog/firewallhits.rrd:amount:AVERAGE",
"AREA:amount#6464FF:firewallhits",
@@ -418,7 +418,7 @@ sub updatefwhitsgraph {
"--alt-y-grid", "-w 600", "-h 200",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#EAE9EE",
"--color", "BACK#FFFFFF",
"-t firewall hits over the last $interval",
"DEF:amount=$rrdlog/firewallhits.rrd:amount:AVERAGE",
"LINE2:amount#6464FF:firewallhits",
@@ -545,7 +545,7 @@ sub updatelqgraph {
"--lazy",
"--color", "SHADEA#EAE9EE",
"--color", "SHADEB#EAE9EE",
"--color", "BACK#EAE9EE",
"--color", "BACK#FFFFFF",
"-v ms / pkts (% x10)",
"DEF:roundtrip=$rrdlog/lq.rrd:roundtrip:AVERAGE",
"DEF:loss=$rrdlog/lq.rrd:loss:AVERAGE",

View File

@@ -1,42 +0,0 @@
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
require "CONFIG_ROOT/general-functions.pl";
my @this;
my $return = &downloadlist();
if($return && $return->is_success) {
unless(open(LIST, ">CONFIG_ROOT/patches/available")) {
die "Could not open available lists database.";
}
flock LIST, 2;
@this = split(/----START LIST----\n/,$return->content);
print LIST $this[1];
close(LIST);
} else {
die "Could not download patches list.";
}
sub downloadlist {
unless(-e "CONFIG_ROOT/red/active") {
die "Not connected.";
}
my $downloader = LWP::UserAgent->new;
$downloader->timeout(5);
my %proxysettings;
&General::readhash("CONFIG_ROOT/proxy/settings", \%proxysettings);
if ($_=$proxysettings{'UPSTREAM_PROXY'}) {
my ($peer, $peerport) = (/^(?:[a-zA-Z ]+\:\/\/)?(?:[A-Za-z0-9\_\.\-]*?(?:\:[A-Za-z0-9\_\.\-]*?)?\@)?([a-zA-Z0-9\.\_\-]*?)(?:\:([0-9]{1,5}))?(?:\/.*?)?$/);
if ($proxysettings{'UPSTREAM_USER'}) {
$downloader->proxy("http","http://$proxysettings{'UPSTREAM_USER'}:$proxysettings{'UPSTREAM_PASSWORD'}@"."$peer:$peerport/");
} else {
$downloader->proxy("http","http://$peer:$peerport/");
}
}
return $downloader->get("http://www.ipcop.org/patches/${General::version}", 'Cache-Control', 'no-cache');
}

View File

@@ -1,23 +0,0 @@
#!/bin/bash
UPGRADEVERSION="1.4.x" # configured by ./make.sh newupdate
PREVIOUSVERSION="1.4."$((`echo $UPGRADEVERSION | /usr/bin/cut -f3 -d '.'`-1))
echo "This is the $UPGRADEVERSION update patch for IPCop $PREVIOUSVERSION installing."
CURRENTVERSION=`perl -e "require '/var/ipfire/general-functions.pl';print \\$General::version;"`
if [ "$CURRENTVERSION" != "$PREVIOUSVERSION" ]; then
echo "You are not running IPCop v$PREVIOUSVERSION for this patch to install."
echo "Aborting installation."
exit -1
fi
# general-functions might not be overwrited by patch...
/bin/sed -i -e "s+= '1.4.*$+= '$UPGRADEVERSION';+" /var/ipfire/general-functions.pl
/bin/tar -zxpf patch.tar.gz -C /
#build cachelang file after all "lang/*.pl" updates
perl -e "require '/var/ipfire/lang.pl'; &Lang::BuildCacheLang"
killall mingetty #redisplay correct version
echo "end of $UPGRADEVERSION update"