Project

General

Profile

Download (4.7 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	system_advanced_notifications.php
5
	part of pfSense
6
	Copyright (C) 2009 Scott Ullrich <sullrich@gmail.com>
7

    
8
	Redistribution and use in source and binary forms, with or without
9
	modification, are permitted provided that the following conditions are met:
10

    
11
	1. Redistributions of source code must retain the above copyright notice,
12
	   this list of conditions and the following disclaimer.
13

    
14
	2. Redistributions in binary form must reproduce the above copyright
15
	   notice, this list of conditions and the following disclaimer in the
16
	   documentation and/or other materials provided with the distribution.
17

    
18
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
20
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
22
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
	POSSIBILITY OF SUCH DAMAGE.
28
*/
29

    
30
##|+PRIV
31
##|*IDENT=page-system-advanced-notifications
32
##|*NAME=System: Advanced: Tunables page
33
##|*DESCR=Allow access to the 'System: Advanced: Tunables' page.
34
##|*MATCH=system_advanced-sysctrl.php*
35
##|-PRIV
36

    
37
require("guiconfig.inc");
38

    
39
if($config['notifications']['growl']['password']) 
40
	$pconfig['password'] = $config['notifications']['growl']['password'];
41
if($config['notifications']['growl']['ipaddress']) 
42
	$pconfig['ipaddress'] = $config['notifications']['growl']['ipaddress'];
43

    
44
if ($_POST) {
45

    
46
	unset($input_errors);
47
	$pconfig = $_POST;
48

    
49
	/* if this is an AJAX caller then handle via JSON */
50
	if (isAjax() && is_array($input_errors)) {
51
		input_errors2Ajax($input_errors);
52
		exit;
53
	}
54

    
55
	if ($_POST['apply']) {
56
		$retval = 0;
57
		system_setup_sysctl();		
58
		$savemsg = get_std_save_message($retval);
59
	}
60

    
61
	if ($_POST['Submit'] == "Save") {
62
		$tunableent = array();
63

    
64
		$config['notifications']['growl']['ipaddress'] = $_POST['ipaddress'];
65
		$config['notifications']['growl']['password'] = $_POST['password'];
66

    
67
		write_config();
68

    
69
		register_via_growl();
70
		notify_via_growl("This is a test message form pfSense.  It is safe to ignore this message.");
71
		
72
		pfSenseHeader("system_advanced_notifications.php");
73
		exit;
74
    }
75
}
76

    
77
include("head.inc");
78

    
79
$pgtitle = array("System","Advanced: Notifications");
80
include("head.inc");
81

    
82
?>
83

    
84
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
85
<?php include("fbegin.inc"); ?>
86
	<form action="system_advanced_notifications.php" method="post">
87
		<?php
88
			if ($input_errors)
89
				print_input_errors($input_errors);
90
			if ($savemsg)
91
				print_info_box($savemsg);
92
		?>
93
	</form>
94
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
95
		<tr>
96
			<td>
97
				<?php
98
					$tab_array = array();
99
					$tab_array[] = array("Admin Access", false, "system_advanced_admin.php");
100
					$tab_array[] = array("Firewall / NAT", false, "system_advanced_firewall.php");
101
					$tab_array[] = array("Networking", false, "system_advanced_network.php");
102
					$tab_array[] = array("Miscellaneous", false, "system_advanced_notifications.php");
103
					$tab_array[] = array("System Tunables", false, "system_advanced_sysctl.php");
104
					$tab_array[] = array("Notifications", true, "system_advanced_notifications.php");
105
					display_top_tabs($tab_array);
106
				?>
107
			</td>
108
		</tr>
109
		<tr>
110
			<td id="mainarea">
111
				<div class="tabcont">
112
					<form action="system_advanced_notifications.php" method="post" name="iform">
113
					<table width="100%" border="0" cellpadding="6" cellspacing="0">
114
						<tr>
115
							<td colspan="2" valign="top" class="listtopic">Growl</td>
116
						</tr>
117
						<tr>
118
							<td width="22%" valign="top" class="vncell">IP Address</td>
119
							<td width="78%" class="vtable">
120
								<input name='ipaddress' value='<?php echo $pconfig['ipaddress']; ?>'><br/>
121
								This is the IP address that you would like to send growl notifications to.
122
							</td>
123
						</tr>
124
						<tr>
125
							<td width="22%" valign="top" class="vncell">Password</td>
126
							<td width="78%" class="vtable">
127
								<input name='password' type='password' value='<?php echo $pconfig['password']; ?>'><br/>
128
								Enter the password of the remote growl notification device.
129
							</td>
130
						</tr>
131
						<tr>
132
							<td valign="top" class="">
133
								&nbsp;
134
							</td>
135
							<td>
136
								<br/>
137
								<input type='submit' id='Submit' name='Submit' value='Save'></form>
138
							</td>
139
						</tr>
140
					</table>
141
				</div>
142
			</td>
143
		</tr>
144
	</table>
145
<?php include("fend.inc"); ?>
146
</body>
147
</html>
(173-173/217)