Project

General

Profile

Download (2.55 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
<?php 
2 b46bfcf5 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	reboot.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6
	
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9
	
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12
	
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15
	
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19
	
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31
32 6b07c15a Matthew Grooms
##|+PRIV
33
##|*IDENT=page-diagnostics-rebootsystem
34
##|*NAME=Diagnostics: Reboot System page
35
##|*DESCR=Allow access to the 'Diagnostics: Reboot System' page.
36
##|*MATCH=reboot.php*
37
##|-PRIV
38
39 5b237745 Scott Ullrich
require("guiconfig.inc");
40 c44417f8 Scott Ullrich
require("functions.inc");
41
require("captiveportal.inc");
42 5b237745 Scott Ullrich
43 276ba521 Scott Ullrich
if ($_POST) {
44
	if ($_POST['Submit'] == " Yes ") {
45
		$rebootmsg = "The system is rebooting now. This may take one minute.";
46 5860dad1 Scott Ullrich
	} else {
47
		Header("Location: /");
48 276ba521 Scott Ullrich
	}
49
}
50
51 d88c6a9f Scott Ullrich
$pgtitle = array("Diagnostics","Reboot System");
52 5860dad1 Scott Ullrich
include("head.inc");
53
54 4df96eff Scott Ullrich
?>
55 5b237745 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
56
<?php include("fbegin.inc"); ?>
57
<?php if ($rebootmsg): echo print_info_box($rebootmsg); else: ?>
58
      <form action="reboot.php" method="post">
59
        <p><strong>Are you sure you want to reboot the system?</strong></p>
60
        <p> 
61 6cd5852e Scott Ullrich
	  <input name="Submit" type="submit" class="formbtn" value=" Yes ">
62 3ee1422f Scott Ullrich
	  <input name="Submit" type="submit" class="formbtn" value=" No ">
63 5b237745 Scott Ullrich
        </p>
64
      </form>
65
<?php endif; ?>
66
<?php include("fend.inc"); ?>
67
</body>
68
</html>
69 6cd5852e Scott Ullrich
70
<?php
71
if ($_POST) {
72
	if ($_POST['Submit'] == " Yes ") {
73 21038c67 Scott Ullrich
		echo "<meta http-equiv=\"refresh\" content=\"70;url=/\">";
74 6cd5852e Scott Ullrich
		system_reboot();
75
		$rebootmsg = "The system is rebooting now. This may take one minute.";
76
	} else {
77
		exit;
78
	}
79
}
80 1d333258 Scott Ullrich
81
?>