mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
Added the option on gui page to remove the extra query for restart or shudown.
This commit is contained in:
@@ -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>
|
||||
|
||||
102
html/cgi-bin/index.cgi
Normal file → Executable file
102
html/cgi-bin/index.cgi
Normal file → Executable file
@@ -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>
|
||||
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>
|
||||
END
|
||||
;
|
||||
} else {
|
||||
|
||||
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 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 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
|
||||
;
|
||||
} 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
|
||||
;
|
||||
} 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>
|
||||
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'}
|
||||
|
||||
@@ -1379,6 +1379,7 @@
|
||||
'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',
|
||||
|
||||
@@ -1407,6 +1407,7 @@
|
||||
'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',
|
||||
|
||||
Reference in New Issue
Block a user