Fuer den Urlfilter ein Background Image gemacht
authormaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Fri, 13 Jul 2007 18:49:27 +0000 (18:49 +0000)
committermaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Fri, 13 Jul 2007 18:49:27 +0000 (18:49 +0000)
MPFire erweitert
Samba Pagerefresh korrigiert
Tripwire Pagerefreh korrigiert
Backup CGI sollte jetzt fertig sein zum Testen
vpnmain die beiden SHA2 Crypts entfernt
Snort init nochmal angepasst damit die PID alleine angelegt wird

git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@682 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

14 files changed:
config/backup/backup.pl
config/backup/include
doc/language_issues.de
doc/language_missings
html/cgi-bin/backup.cgi
html/cgi-bin/mpfire.cgi
html/cgi-bin/samba.cgi
html/cgi-bin/tripwire.cgi
html/cgi-bin/vpnmain.cgi
html/html/images/background.gif [new file with mode: 0644]
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl
src/initscripts/init.d/snort
src/misc-progs/backupctrl.c

index f0ae002c4423531510957bc46195ad9587587303..7284ad421ecd00e02d72172ab2dd0403c96ccfa9 100644 (file)
@@ -15,45 +15,35 @@ $Minuten = sprintf("%02d", $Minuten);
 
 if ($ARGV[0] eq 'include') {
   &createinclude;
-    my @files = `find / -name *.log`;
+    my @files = `find / -name *.log 2>/dev/null`;
     foreach (@files){
       push(@include,$_);
      }
   open(DATEI, ">/tmp/include") || die "Could not save temp include file";
   print DATEI @include;
   close(DATEI);
-  system("tar -cvzf /srv/web/ipfire/html/backup/$Jahr$Monat$Monatstag-$Stunden:$Minuten.ipf  --files-from=/tmp/include --exclude-from=/var/ipfire/backup/exclude");
+  system("tar -cvzf /var/ipfire/backup/$Jahr$Monat$Monatstag-$Stunden:$Minuten.ipf --files-from='/tmp/include' --exclude-from='/var/ipfire/backup/exclude'");
   system("rm /tmp/include");
 }
-
-if ($ARGV[0] eq 'exclude') {
+elsif ($ARGV[0] eq 'exclude') {
   &createinclude;
   open(DATEI, ">/tmp/include") || die "Could not save temp include file";
   print DATEI @include;
   close(DATEI);
-  system("tar -cvzf /srv/web/ipfire/html/backup/$Jahr$Monat$Monatstag-$Stunden:$Minuten.ipf --files-from='/tmp/include' --exclude-from='/var/ipfire/backup/exclude'");
+  system("tar -cvzf /var/ipfire/backup/$Jahr$Monat$Monatstag-$Stunden:$Minuten.ipf --files-from='/tmp/include' --exclude-from='/var/ipfire/backup/exclude'");
   system("rm /tmp/include");
 }
-
-if ($ARGV[0] eq 'restore') {
+elsif ($ARGV[0] eq 'restore') {
   system("tar -xvz --preserve -f /tmp/restore.ipf");
 }
-
-if ($ARGV[0] eq 'exclude') {
-  &createinclude;
-  open(DATEI, ">/tmp/include") || die "Could not save temp include file";
-  print DATEI @include;
-  close(DATEI);
-  system("tar -cvzf /srv/web/ipfire/html/backup/$Jahr$Monat$Monatstag-$Stunden:$Minuten.ipf --files-from='/tmp/include' --exclude-from='/var/ipfire/backup/exclude'");
-  system("rm /tmp/include");
+elsif ($ARGV[0] eq 'cli') {
+  system("tar -cvzf /var/ipfire/backup/$Jahr$Monat$Monatstag-$Stunden:$Minuten-$ARGV[1].ipf --files-from='$ARGV[2]' --exclude-from='$ARGV[3]'");
 }
-
-if ($ARGV[0] eq 'cli') {
-  system("tar -cvzf /srv/web/ipfire/html/backup/$Jahr$Monat$Monatstag-$Stunden:$Minuten-$ARGV[1].ipf --files-from='$ARGV[2]' --exclude-from='$ARGV[3]'");
+elsif ($ARGV[0] =~ /ipf$/ ) {
+  system("rm /var/ipfire/backup/$ARGV[0]");
 }
-
-if ($ARGV[0] eq '') {
- printf "No argument given, please use <include><exclude>\n"
+elsif ($ARGV[0] eq '') {
+ printf "No argument given, please use <include><exclude><cli>\n"
 }
 
 sub createinclude(){
index 802ebc25c446e42b50616ff837b3014aaa7d8432..17588a2697ebabdbd4eb580e6458745f207189d1 100644 (file)
@@ -1,6 +1,7 @@
 /var/ipfire/*/settings
 /var/ipfire/*/*.conf
 /var/ipfire/*/*.pem
+/var/ipfire/*/config
 /etc/passwd
 /etc/shadow
 /etc/group
index a8c448c6b6c21bd6c8dd7471c83000cd34ce1513..182d95c4a098d19b063e1ceffe4fefa02c59fe3f 100644 (file)
@@ -109,7 +109,6 @@ WARNING: translation string unused: display traffic at home
 WARNING: translation string unused: dns server
 WARNING: translation string unused: do not log this port list
 WARNING: translation string unused: downlink speed
-WARNING: translation string unused: download
 WARNING: translation string unused: dynamic dns client
 WARNING: translation string unused: eciadsl help
 WARNING: translation string unused: eciadsl upload
index a3ddc4b1d6c6d089aa9b55ba8d402c348630c41a..8f98f6dee3153449a8d65a77ee405d9a80d69654 100644 (file)
@@ -17,7 +17,6 @@
 < dhcp fixed lease err1
 < dhcp fixed lease help1
 < dns server
-< download
 < err bk 10 password
 < or
 < password crypting key
index fbc96271b984db3b5c0d18b10dbd647d719bbc03..fc770657145948d8cf6af9e2e4aacff148b45307 100644 (file)
@@ -22,7 +22,7 @@ my %cgiparams=();
 my %checked = ();
 my $message = "";
 my $errormessage = "";
-my @backups = `cd /srv/web/ipfire/html/backup && ls *.ipf`;
+my @backups = `cd /var/ipfire/backup/ && ls *.ipf`;
 
 $a = new CGI;
 
@@ -33,19 +33,16 @@ $cgiparams{'ACTION'} = '';
 $cgiparams{'FILE'} = '';
 $cgiparams{'UPLOAD'} = '';
 $cgiparams{'BACKUPLOGS'} = '';
+
 &Header::getcgihash(\%cgiparams);
 
 ############################################################################################################################
-######################################## Scanne Verzeichnisse nach Mp3 Dateien #############################################
+############################################## System calls ohne Http Header ###############################################
 
-if ( $cgiparams{'ACTION'} eq "backup" )
-{
- if ( $cgiparams{'BACKUPLOGS'} eq "include" ){system("/usr/local/bin/backupctrl include");}
- else {system("/usr/local/bin/backupctrl exclude");}
-}
-elsif ( $cgiparams{'ACTION'} eq "download" )
+
+if ( $cgiparams{'ACTION'} eq "download" )
 {
-    open(DLFILE, "</srv/web/ipfire/html/backup/$cgiparams{'FILE'}") or die "Unable to open $cgiparams{'FILE'}: $!";
+    open(DLFILE, "</var/ipfire/backup/$cgiparams{'FILE'}") or die "Unable to open $cgiparams{'FILE'}: $!";
     my @fileholder = <DLFILE>;
     print "Content-Type:application/x-download\n";
     print "Content-Disposition:attachment;filename=$cgiparams{'FILE'}\n\n";
@@ -64,13 +61,31 @@ elsif ( $cgiparams{'ACTION'} eq "restore" )
   system("/usr/local/bin/backupctrl restore");
 }
 
-############################################################################################################################
-########################################### rekursiv nach neuen Mp3s Scannen ##############################################ä
-
 &Header::showhttpheaders();
+
+sub refreshpage{&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'pagerefresh'}</font></center>";&Header::closebox();}
+
 &Header::openpage($Lang::tr{'backup'}, 1, "");
 &Header::openbigbox('100%', 'left', '', $errormessage);
 
+############################################################################################################################
+################################################### Default System calls ###################################################
+
+if ( $cgiparams{'ACTION'} eq "backup" )
+{
+ if ( $cgiparams{'BACKUPLOGS'} eq "include" ){system("/usr/local/bin/backupctrl include >/dev/null");}
+ else {system("/usr/local/bin/backupctrl exclude >/dev/null");}
+ refreshpage();
+}
+elsif ( $cgiparams{'ACTION'} eq "delete" )
+{
+  system("/usr/local/bin/backupctrl $cgiparams{'FILE'} >/dev/null");
+  refreshpage();
+}
+
+############################################################################################################################
+########################################### rekursiv nach neuen Mp3s Scannen ##############################################ä
+
 if ( $message ne "" ){
        &Header::openbox('100%','left',$Lang::tr{'error messages'});
        print "<font color='red'>$message</font>\n";
@@ -100,11 +115,12 @@ END
 ;
 foreach (@backups){
 chomp($_);
-my $Datei = "/srv/web/ipfire/html/backup/".$_;
+my $Datei = "/var/ipfire/backup/".$_;
 my @Info = stat($Datei);
 my $Size = $Info[7] / 1024;
 $Size = sprintf("%02d", $Size);
-print "<tr><td align='left'><form method='post' action='$ENV{'SCRIPT_NAME'}'>$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB <input type='hidden' name='ACTION' value='download' /><input type='hidden' name='FILE' value='$_' /><input type='image' src='/images/package-x-generic.png' /></form></td></tr>";
+print "<tr><td align='center'>$Lang::tr{'backup from'} $_ $Lang::tr{'size'} $Size KB</td><td width='5'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='download' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'download'}' title='$Lang::tr{'download'}' src='/images/package-x-generic.png' /></form></td>";
+print "<td width='5'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='delete' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'delete'}' title='$Lang::tr{'delete'}' src='/images/user-trash.png' /></form></td></tr>";
 }
 print <<END                                                                                                    
 </table>
@@ -116,7 +132,7 @@ END
 
 print <<END
 <table width='95%' cellspacing='0'>
-<tr><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'>$Lang::tr{'backup'}</td><td align='left'><input type="file" size='50' name="UPLOAD" /><input type='submit' name='ACTION' value='restore' /></form></td></tr>
+<tr><td align='left'>$Lang::tr{'backup'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restore' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
 </table>
 END
 ;
index dcf6c17649585bd60666d0561629350763466528..6b6b4acb5e6ea06aaced0eb393989ba56d0414fd 100644 (file)
@@ -31,8 +31,10 @@ close(DATEI);
 &General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
 
 &Header::showhttpheaders();
-&Header::getcgihash(\%mpfiresettings);
 
+sub refreshpage{&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'pagerefresh'}</font></center>";&Header::closebox();}
+
+&Header::getcgihash(\%mpfiresettings);
 &Header::openpage($Lang::tr{'mpfire'}, 1, "<meta http-equiv='refresh' content='120'>");
 &Header::openbigbox('100%', 'left', '', $errormessage);
 
@@ -44,6 +46,7 @@ if ( $mpfiresettings{'ACTION'} eq "scan" )
 delete $mpfiresettings{'__CGI__'};delete $mpfiresettings{'x'};delete $mpfiresettings{'y'};
 &General::writehash("${General::swroot}/mpfire/settings", \%mpfiresettings);
 system("/usr/local/bin/mpfirectrl scan $mpfiresettings{'SCANDIR'} $mpfiresettings{'SCANDIRDEPS'}");
+refreshpage();
 }
 
 if ( $mpfiresettings{'ACTION'} eq ">" ){system("/usr/local/bin/mpfirectrl","play","\"$mpfiresettings{'FILE'}\"");}
@@ -139,8 +142,12 @@ my $song = qx(/usr/local/bin/mpfirectrl song);
 if ( $song eq "" ){$song = "None";}
 
 &Header::openbox('100%', 'center', $Lang::tr{'mpfire controls'});
-print "<table width='95%' cellspacing='0'><tr bgcolor='$color{'color20'}'><td colspan='5' align='center'><marquee behavior='alternate' scrollamount='1' scrolldelay='5'><font color=red>-= $song =-</font></marquee></td></tr><tr><td colspan='5'><br/></td></tr><tr>";
 print <<END
+
+    <table width='95%' cellspacing='0'>
+    <tr bgcolor='$color{'color20'}'>    <td colspan='5' align='center'><marquee behavior='alternate' scrollamount='1' scrolldelay='5'><font color=red>-= $song =-</font></marquee></td></tr>
+    <tr><td colspan='5' align='center'><br/><b>total $#songdb songs</b><br/><br/></td></tr>
+    <tr>
     <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='x' /><input type='image' alt='$Lang::tr{'stop'}' title='$Lang::tr{'stop'}' src='/images/media-playback-stop.png' /></form></td>
     <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='||' /><input type='image' alt='$Lang::tr{'pause'}' title='$Lang::tr{'pause'}' src='/images/media-playback-pause.png' /></form></td>
     <td align='center'><form method='post' action='$ENV{'SCRIPT_NAME'}'><input type='hidden' name='ACTION' value='|>' /><input type='image' alt='$Lang::tr{'resume'}' title='$Lang::tr{'resume'}' src='/images/media-resume.png' /></form></td>
@@ -175,9 +182,10 @@ foreach (@songdb){
   @album = sort keys %hash;
 print <<END
   <table width='95%' cellspacing='0'>
+  <tr><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'artist'} - $#artist</b></td><td align='center' bgcolor='$color{'color20'}'><b>$Lang::tr{'album'} - $#album</b></td></tr>
   <tr><td align='center'>
       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
-      <select name='artist' size='8' multiple='multiple'>
+      <select name='artist' size='8' multiple='multiple' style='width:300px;'>
 END
 ;
   foreach (@artist){print "<option>$_</option>";}
@@ -188,7 +196,7 @@ print <<END
       </form></td>
       <td align='center'>
       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
-      <select name='album' size='8' multiple='multiple'>
+      <select name='album' size='8' multiple='multiple' style='width:300px;'>
 END
 ;
   foreach (@album){print "<option>$_</option>";}
index 0d506dea65403b0dabb486bb06454b17f413c93c..f7bdfa9f55fd2cd14f1e7174165a7447dcd4c1c2 100644 (file)
@@ -98,7 +98,7 @@ my $PDCOPTIONS = `cat ${General::swroot}/samba/pdc`;
 &General::readhash("${General::swroot}/samba/settings", \%sambasettings);
 &Header::getcgihash(\%sambasettings);
 
-sub refreshpage{&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );}
+sub refreshpage{&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'pagerefresh'}</font></center>";&Header::closebox();}
 
 &Header::openpage('Samba', 1, '');
 &Header::openbigbox('100%', 'left', '', $errormessage);
index 3fa8fc7e784bfe7e856db68b2315df3142b41602..3b4015a958c8f9e41c241240ea25ac39601e1574 100644 (file)
@@ -248,7 +248,7 @@ END
 
 if ($tripwiresettings{'ACTION'} eq 'globalresetyes')
 {
-&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'tripwireoperating'}</font></center>";
+&Header::openbox( 'Waiting', 1, "<meta http-equiv='refresh' content='1;'>" );print "<center><img src='/images/clock.gif' alt='' /><br/><font color='red'>$Lang::tr{'tripwireoperating'}</font></center>";&Header::closebox();
 $tripwiresettings{'ROOT'} = '/usr/sbin';
 $tripwiresettings{'POLFILE'} = '/var/ipfire/tripwire/tw.pol';
 $tripwiresettings{'DBFILE'} = '/var/ipfire/tripwire/$(HOSTNAME).twd';
index 6abfa8fac229118839bde0b12c5b11089b281642..e14fa86646dfaf1e91d2818f6c800819d3aa3945 100644 (file)
@@ -2302,8 +2302,6 @@ if(($cgiparams{'ACTION'} eq $Lang::tr{'advanced'}) ||
 
            <td class='boldbase' align='right' valign='top'>$Lang::tr{'ike integrity'}</td><td class='boldbase' valign='top'>
                <select name='IKE_INTEGRITY' multiple='multiple' size='4'>
-               <option value='sha2_512' $checked{'IKE_INTEGRITY'}{'sha2_512'}>SHA2 (512)</option>
-               <option value='sha2_256' $checked{'IKE_INTEGRITY'}{'sha2_256'}>SHA2 (256)</option>
                <option value='sha' $checked{'IKE_INTEGRITY'}{'sha'}>SHA</option>
                <option value='md5' $checked{'IKE_INTEGRITY'}{'md5'}>MD5</option>
                </select></td>
@@ -2340,8 +2338,6 @@ if(($cgiparams{'ACTION'} eq $Lang::tr{'advanced'}) ||
 
            <td class='boldbase' align='right' valign='top'>$Lang::tr{'esp integrity'}</td><td class='boldbase' valign='top'>
                <select name='ESP_INTEGRITY' multiple='multiple' size='4'>
-               <option value='sha2_512' $checked{'ESP_INTEGRITY'}{'sha2_512'}>SHA2 (512)</option>
-               <option value='sha2_256' $checked{'ESP_INTEGRITY'}{'sha2_256'}>SHA2 (256)</option>
                <option value='sha1' $checked{'ESP_INTEGRITY'}{'sha1'}>SHA1</option>
                <option value='md5' $checked{'ESP_INTEGRITY'}{'md5'}>MD5</option></select></td>
 
diff --git a/html/html/images/background.gif b/html/html/images/background.gif
new file mode 100644 (file)
index 0000000..816b23e
Binary files /dev/null and b/html/html/images/background.gif differ
index 4dcea18dcb7e6d242e012179c5b0b4c6a84d145c..26db4e4785e95aa43b091d058aa150f3539e0b92 100644 (file)
 'domain name suffix' => 'Domain-Name-Suffix:',
 'domain not set' => 'Domain nicht eingegeben.',
 'downlink speed' => 'Downlink-Geschwindigkeit (kBit/sek)',
-'download' => 'Download',
+'download' => 'herunterladen',
 'download ca certificate' => 'CA Zertifikat herunterladen',
 'download certificate' => 'Zertifikate herunterladen',
 'download host certificate' => 'Host Zertifikat herunterladen',
 'ovpnstatus log' => 'OVPN-Status-Log',
 'ovpnsys log' => 'OVPN-System-Log',
 'package failed to install' => 'Programmpaket konnte nicht installiert werden.',
+'pagerefresh' => 'Seite wird aktualisiert. Bitte warten.',
 'pakfire configuration' => 'Pakfire Konfiguration',
 'pap or chap' => 'PAP oder CHAP',
 'password' => 'Passwort:',
index 7cbafd5ad46aed6b54693daf5bb73f0c57a8c6ec..5a52ed3178370ef311879589336d4f0d495d32a5 100644 (file)
 'domain not set' => 'Domain not set.',
 'done' => 'Do it',
 'downlink speed' => 'Downlink speed (kbit/sec)',
+'download' => 'download',
 'download ca certificate' => 'Download CA Certificate',
 'download certificate' => 'Download Certificate',
 'download host certificate' => 'Download Host Certificate',
 'ovpnstatus log' => 'OVPN-Status-Log',
 'ovpnsys log' => 'OVPN-System-Log',
 'package failed to install' => 'Package failed to install.',
+'pagerefresh' => 'Page is beeing refreshed, please wait.',
 'pakfire configuration' => 'Pakfire Configuration',
 'pap or chap' => 'PAP or CHAP',
 'password' => 'Password:',
index e0d93c6ec5169caed8a91b6255c634f1fdd0cde1..bb4e9b9416509e71d5ddea5b38b5e2e714c53e8b 100755 (executable)
@@ -62,7 +62,7 @@ case "$1" in
        start)
                for DEVICE in $DEVICES; do
                        boot_mesg "Starting Intrusion Detection System on $DEVICE..."
-                       /usr/sbin/snort -c /etc/snort/snort.conf -i $DEVICE -D -l /var/log/snort --pid-path /var/run/
+                       /usr/sbin/snort -c /etc/snort/snort.conf -i $DEVICE -D -l /var/log/snort --create-pidfile --nolock-pidfile --pid-path /var/run/
                        evaluate_retval
                        chmod 644 /var/run/snort_$DEVICE.pid
                done
index f09eda0d314e736b2790a63168a5dd7522b76189..120a51be46a0d708f6905b35720ffcf7e174ba8b 100644 (file)
@@ -43,7 +43,5 @@ int main(int argc, char *argv[]) {
                sprintf(add, " %s", argv[i]);
                strcat(command, add);
        }
-       
-  snprintf(command, STRING_SIZE, " >/dev/null 2>/dev/null");
        return safe_system(command);
 }