From: <dot...@us...> - 2008-03-28 19:40:43
|
Revision: 1239 http://ipcop.svn.sourceforge.net/ipcop/?rev=1239&view=rev Author: dotzball Date: 2008-03-28 12:40:45 -0700 (Fri, 28 Mar 2008) Log Message: ----------- Some more errorboxes and the first warningbox :-) More to come. Modified Paths: -------------- ipcop/trunk/html/cgi-bin/ids.cgi ipcop/trunk/html/cgi-bin/logs.cgi/config.dat ipcop/trunk/html/cgi-bin/portfw.cgi ipcop/trunk/html/cgi-bin/shaping.cgi ipcop/trunk/html/cgi-bin/time.cgi Modified: ipcop/trunk/html/cgi-bin/ids.cgi =================================================================== --- ipcop/trunk/html/cgi-bin/ids.cgi 2008-03-28 19:32:21 UTC (rev 1238) +++ ipcop/trunk/html/cgi-bin/ids.cgi 2008-03-28 19:40:45 UTC (rev 1239) @@ -26,6 +26,7 @@ my %checked=(); my %netsettings=(); our $errormessage = ''; +my $error = ''; my $logfile = '/var/log/snort/lastrulesupdate'; my $rulestargz = '/var/log/snort/rules.tar.gz'; @@ -175,17 +176,19 @@ print "<class name='base'>$errormessage\n"; print " </class>\n"; &Header::closebox(); + + $error = 'error'; } if ($swapused>1000 && $free<10_000) { # values are arbitrary - &Header::openbox('100%', 'left', $Lang::tr{'capswarning'}); + &Header::openbox('100%', 'left', $Lang::tr{'capswarning'}, 'warning'); print "<class name='base'>$Lang::tr{'swap warning'} <a href='/cgi-bin/status.cgi'>$Lang::tr{'sssystem status'}</a>\n"; print " </class>\n"; &Header::closebox(); } -&Header::openbox('100%', 'left', "$Lang::tr{'intrusion detection system'}:"); +&Header::openbox('100%', 'left', "$Lang::tr{'intrusion detection system'}:", $error); print <<END <form method='post' action='$ENV{'SCRIPT_NAME'}'> <table border='0' width='100%'> Modified: ipcop/trunk/html/cgi-bin/logs.cgi/config.dat =================================================================== --- ipcop/trunk/html/cgi-bin/logs.cgi/config.dat 2008-03-28 19:32:21 UTC (rev 1238) +++ ipcop/trunk/html/cgi-bin/logs.cgi/config.dat 2008-03-28 19:40:45 UTC (rev 1239) @@ -15,7 +15,7 @@ #use warnings; #use CGI::Carp 'fatalsToBrowser'; -require 'CONFIG_ROOT/general-functions.pl'; +require '/var/ipcop/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; @@ -23,6 +23,7 @@ my %checked=(); my %selected=(); my $errormessage=''; +my $error =''; &Header::showhttpheaders(); @@ -86,14 +87,16 @@ &Header::openbigbox('100%', 'left', '', $errormessage); if ($errormessage) { - &Header::openbox('100%', 'left', $Lang::tr{'error messages'}); + &Header::openbox('100%', 'left', $Lang::tr{'error messages'}, 'error'); print "<font class='base'>$errormessage </font>\n"; &Header::closebox(); + + $error = 'error'; } print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>\n"; -&Header::openbox('100%', 'left', $Lang::tr{'log settings'}); +&Header::openbox('100%', 'left', $Lang::tr{'log settings'}, $error); print <<END <table width='100%'> <tr> @@ -137,7 +140,7 @@ <tr> <td width='55%'> </td> <td width='40%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td> - <td width='5%' align='right'> + <td width='5%' align='right'> <a href='${General::adminmanualurl}/logs.html#log-settings' target='_blank'><img src='/images/web-support.png' title='$Lang::tr{'online help en'}' /></a> </td> </tr> Modified: ipcop/trunk/html/cgi-bin/portfw.cgi =================================================================== --- ipcop/trunk/html/cgi-bin/portfw.cgi 2008-03-28 19:32:21 UTC (rev 1238) +++ ipcop/trunk/html/cgi-bin/portfw.cgi 2008-03-28 19:40:45 UTC (rev 1239) @@ -44,6 +44,7 @@ our $prtrange1=0; our $prtrange2=0; our $errormessage = ''; +my $error = ''; my $filename = "${General::swroot}/portfw/config"; my $aliasfile = "${General::swroot}/ethernet/aliases"; @@ -560,14 +561,16 @@ print "<class name='base'><font color='${Header::colourred}'>$errormessage\n</font>"; print " </class>\n"; &Header::closebox(); + + $error = 'error'; } print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>\n"; if ($cgiparams{'ACTION'} eq $Lang::tr{'edit'}){ - &Header::openbox('100%', 'left', $Lang::tr{'edit a rule'}); + &Header::openbox('100%', 'left', $Lang::tr{'edit a rule'}, $error); } else { - &Header::openbox('100%', 'left', $Lang::tr{'add a new rule'}); + &Header::openbox('100%', 'left', $Lang::tr{'add a new rule'}, $error); } if ($cgiparams{'ACTION'} eq $Lang::tr{'edit'} && $cgiparams{'KEY2'} ne "0" || $cgiparams{'ACTION'} eq $Lang::tr{'add xtaccess'}){ Modified: ipcop/trunk/html/cgi-bin/shaping.cgi =================================================================== --- ipcop/trunk/html/cgi-bin/shaping.cgi 2008-03-28 19:32:21 UTC (rev 1238) +++ ipcop/trunk/html/cgi-bin/shaping.cgi 2008-03-28 19:40:45 UTC (rev 1239) @@ -115,6 +115,8 @@ undef %shapingsettings; system ('/usr/local/bin/restartshaping'); } else { + $error_config = 'error'; + # stay on edit mode if an error occur if ($shapingsettings{'EDITING'} ne 'no') { @@ -246,9 +248,9 @@ my $buttontext = $Lang::tr{'add'}; if($shapingsettings{'ACTION'} eq $Lang::tr{'edit'}) { $buttontext = $Lang::tr{'update'}; - &Header::openbox('100%', 'left', $Lang::tr{'edit service'}); + &Header::openbox('100%', 'left', $Lang::tr{'edit service'}, $error_config); } else { - &Header::openbox('100%', 'left', $Lang::tr{'add service'}); + &Header::openbox('100%', 'left', $Lang::tr{'add service'}, $error_config); } print <<END Modified: ipcop/trunk/html/cgi-bin/time.cgi =================================================================== --- ipcop/trunk/html/cgi-bin/time.cgi 2008-03-28 19:32:21 UTC (rev 1238) +++ ipcop/trunk/html/cgi-bin/time.cgi 2008-03-28 19:40:45 UTC (rev 1239) @@ -27,6 +27,8 @@ my %timesettings=(); my %netsettings=(); my $errormessage = ''; +my $error_settings =''; +my $error_instant = ''; my @ITFs=('GREEN','BLUE'); &Header::showhttpheaders(); @@ -88,6 +90,10 @@ # Restart service (if enabled etc.) system '/usr/local/bin/restartntpd'; } + else + { + $error_instant = 'error'; + } unless ($errormessage) { undef %timesettings; } @@ -163,6 +169,10 @@ # Write changes to ntp.conf and restartntpd &buildConfFile; } + else + { + $error_settings = 'error'; + } } # To enter an ' into a pushbutton solution is to use ' in it's definition @@ -209,7 +219,7 @@ print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>\n"; -&Header::openbox('100%', 'left', $Lang::tr{'network time'}); +&Header::openbox('100%', 'left', $Lang::tr{'network time'}, $error_settings); print <<END <table width='100%' border='0'> <tr> @@ -264,7 +274,7 @@ &Header::closebox(); -&Header::openbox('100%', 'left', $Lang::tr{'update time'}); +&Header::openbox('100%', 'left', $Lang::tr{'update time'}, $error_instant); print <<END <table width='100%'> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |