Added the option on gui page to remove the extra query for restart or shudown.
authorJan Paul Tuecking <earl@ipfire.org>
Thu, 6 Aug 2009 19:38:06 +0000 (21:38 +0200)
committerJan Paul Tuecking <earl@ipfire.org>
Thu, 6 Aug 2009 19:38:06 +0000 (21:38 +0200)
html/cgi-bin/gui.cgi
html/cgi-bin/index.cgi [changed mode: 0644->0755]
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index a56a20d..5abf88e 100644 (file)
@@ -39,6 +39,7 @@ my $errormessage='';
 $cgiparams{'FX'} = 'off';
 $cgiparams{'SPEED'} = 'off';
 $cgiparams{'WINDOWWITHHOSTNAME'} = 'off';
+$cgiparams{'REBOOTQUESTION'} = 'off';
 $cgiparams{'REFRESHINDEX'} = 'off';
 $cgiparams{'ACTION'} = '';
 &Header::getcgihash(\%cgiparams);
@@ -87,6 +88,7 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}")
         # write cgi vars to the file.
        $mainsettings{'LANGUAGE'} = $cgiparams{'lang'};
        $mainsettings{'WINDOWWITHHOSTNAME'} = $cgiparams{'WINDOWWITHHOSTNAME'};
+       $mainsettings{'REBOOTQUESTION'} = $cgiparams{'REBOOTQUESTION'};
        $mainsettings{'PPPUPDOWNBEEP'} = $cgiparams{'PPPUPDOWNBEEP'};
        $mainsettings{'FX'} = $cgiparams{'FX'};
        $mainsettings{'SPEED'} = $cgiparams{'SPEED'};
@@ -101,6 +103,12 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}")
        } else {
                $cgiparams{'WINDOWWITHHOSTNAME'} = 'off';
        }
+       
+       if ($mainsettings{'REBOOTQUESTION'}) {
+               $cgiparams{'REBOOTQUESTION'} = $mainsettings{'REBOOTQUESTION'};
+       } else {
+               $cgiparams{'REBOOTQUESTION'} = 'on';
+       }
 
        if ($mainsettings{'PPPUPDOWNBEEP'}) {
                $cgiparams{'PPPUPDOWNBEEP'} = $mainsettings{'PPPUPDOWNBEEP'};
@@ -139,6 +147,7 @@ if ($cgiparams{'ACTION'} eq "$Lang::tr{'save'}")
 if ($cgiparams{'ACTION'} eq "$Lang::tr{'restore defaults'}")
 {
        $cgiparams{'WINDOWWITHHOSTNAME'} = 'off';
+       $cgiparams{'REBOOTQUESTION'} = 'on';
        $cgiparams{'PPPUPDOWNBEEP'} = 'on';
        $cgiparams{'REFRESHINDEX'} = 'off';
        $cgiparams{'FX'} = 'on';
@@ -150,6 +159,10 @@ $checked{'WINDOWWITHHOSTNAME'}{'off'} = '';
 $checked{'WINDOWWITHHOSTNAME'}{'on'} = '';
 $checked{'WINDOWWITHHOSTNAME'}{$cgiparams{'WINDOWWITHHOSTNAME'}} = "checked='checked'";
 
+$checked{'REBOOTQUESTION'}{'off'} = '';
+$checked{'REBOOTQUESTION'}{'on'} = '';
+$checked{'REBOOTQUESTION'}{$cgiparams{'REBOOTQUESTION'}} = "checked='checked'";
+
 $checked{'PPPUPDOWNBEEP'}{'off'} = '';
 $checked{'PPPUPDOWNBEEP'}{'on'} = '';
 $checked{'PPPUPDOWNBEEP'}{$cgiparams{'PPPUPDOWNBEEP'}} = "checked='checked'";
@@ -191,6 +204,10 @@ print <<END
     <td><input type='checkbox' name='WINDOWWITHHOSTNAME' $checked{'WINDOWWITHHOSTNAME'}{'on'} /></td>
     <td>$Lang::tr{'display hostname in window title'}</td>
 </tr>
+<tr>
+    <td><input type='checkbox' name='REBOOTQUESTION' $checked{'REBOOTQUESTION'}{'on'} /></td>
+    <td>$Lang::tr{'reboot question'}</td>
+</tr>
 <tr>
     <td><input type='checkbox' name='REFRESHINDEX' $checked{'REFRESHINDEX'}{'on'} /></td>
     <td>$Lang::tr{'refresh index page while connected'}</td>
old mode 100644 (file)
new mode 100755 (executable)
index b0a9018..df78315
@@ -166,55 +166,71 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'shutdown'}) {
 }
 
 if ($death == 0 && $rebirth == 0) {
-
-if ($cgiparams{'ACTION'} eq $Lang::tr{'reboot ask'}) {
-       print <<END
-<form method='post' action='$ENV{'SCRIPT_NAME'}'>
-<table width='100%'>
-  <tr>
-    <td colspan="3" align='left'><font color="red">$Lang::tr{'reboot sure'}</font></td>
-    </tr>
-  <tr>
-       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'reboot'}' /></td>
-       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'refresh'}' /></td>
-       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'shutdown ask'}' /></td>
-</tr>
-</table>
-</form>
+       
+if ($mainsettings{'REBOOTQUESTION'} eq "off") {        
+print <<END
+       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+       <table width='100%'>
+       <tr>
+               <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'reboot'}' /></td>
+               <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'refresh'}' /></td>
+               <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'shutdown'}' /></td>
+       </tr>
+       </table>
+       </form>
 END
 ;
-} elsif ($cgiparams{'ACTION'} eq $Lang::tr{'shutdown ask'}) {
-       print <<END
-<form method='post' action='$ENV{'SCRIPT_NAME'}'>
-<table width='100%'>
-  <tr>
-    <td colspan="3" align='right'><font color="red">$Lang::tr{'shutdown sure'}</font></td>
-    </tr>
-  <tr>
-       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'reboot ask'}' /></td>
-       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'refresh'}' /></td>
-       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'shutdown'}' /></td>
-</tr>
-</table>
-</form>
+} else {               
+       if ($cgiparams{'ACTION'} eq $Lang::tr{'reboot ask'}) {
+print <<END
+       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+       <table width='100%'>
+         <tr>
+           <td colspan="3" align='left'><font color="red">$Lang::tr{'reboot sure'}</font></td>
+           </tr>
+         <tr>
+               <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'reboot'}' /></td>
+               <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'refresh'}' /></td>
+               <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'shutdown ask'}' /></td>
+       </tr>
+       </table>
+       </form>
 END
 ;
-} else {
+       } elsif ($cgiparams{'ACTION'} eq $Lang::tr{'shutdown ask'}) {
 print <<END
-<form method='post' action='$ENV{'SCRIPT_NAME'}'>
-<table width='100%'>
-<tr>
-       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'reboot ask'}' /></td>
-       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'refresh'}' /></td>
-       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'shutdown ask'}' /></td>
-</tr>
-</table>
-</form>
+       <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+       <table width='100%'>
+         <tr>
+           <td colspan="3" align='right'><font color="red">$Lang::tr{'shutdown sure'}</font></td>
+           </tr>
+         <tr>
+               <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'reboot ask'}' /></td>
+               <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'refresh'}' /></td>
+               <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'shutdown'}' /></td>
+       </tr>
+       </table>
+       </form>
 END
 ;
+       } else {
+print <<END
+               <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+               <table width='100%'>
+               <tr>
+                       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'reboot ask'}' /></td>
+                       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'refresh'}' /></td>
+                       <td width='33%' align='center'><input type='submit' name='ACTION' value='$Lang::tr{'shutdown ask'}' /></td>
+               </tr>
+               </table>
+               </form>
+END
+;
+       }
 }
 print <<END;
 
+
 <!-- Table of networks -->
 <table border='0' width=80%>
   <tr> <th bgcolor='$color{'color20'}'>$Lang::tr{'network'}
index 014262d..6ffd0d4 100644 (file)
 'reboot ask' => 'Neustart?',
 'reboot sure' => 'Sind Sie sicher, dass Sie neustarten wollen?',
 'reboot schedule' => 'Zeitsteuerung für IPFire Neustarts',
+'reboot question' => 'Extra Abfrage bei neustart und herunterfahren einschalten',
 'rebooting' => 'Starte neu ...',
 'rebooting ipfire' => 'Starte IPFire neu',
 'reconnect' => 'Neu Verbinden',
index 76aaae9..a283938 100644 (file)
 'reboot' => 'Reboot',
 'reboot ask' => 'Reboot?',
 'reboot sure' => 'Are you sure that you want to reboot?',
+'reboot question' => 'Extra query for restart and shutdown',
 'reboot schedule' => 'Schedule IPFire reboots',
 'rebooting' => 'Rebooting',
 'rebooting ipfire' => 'Rebooting IPFire',