Project

General

Profile

Download (16.6 KB) Statistics
| Branch: | Tag: | Revision:
1 facd2d76 Scott Ullrich
<?php
2
/* $Id$ */
3
/*
4
	system_advanced_notifications.php
5
	part of pfSense
6
	Copyright (C) 2009 Scott Ullrich <sullrich@gmail.com>
7 ce77a9c4 Phil Davis
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
8 facd2d76 Scott Ullrich
9
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11
12
	1. Redistributions of source code must retain the above copyright notice,
13
	   this list of conditions and the following disclaimer.
14
15
	2. Redistributions in binary form must reproduce the above copyright
16
	   notice, this list of conditions and the following disclaimer in the
17
	   documentation and/or other materials provided with the distribution.
18
19
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
	POSSIBILITY OF SUCH DAMAGE.
29
*/
30 1d333258 Scott Ullrich
/*
31
	pfSense_MODULE:	system
32
*/
33 facd2d76 Scott Ullrich
34
##|+PRIV
35
##|*IDENT=page-system-advanced-notifications
36 7997ed44 Renato Botelho
##|*NAME=System: Advanced: Notifications page
37
##|*DESCR=Allow access to the 'System: Advanced: Notifications' page.
38
##|*MATCH=system_advanced_notifications.php*
39 facd2d76 Scott Ullrich
##|-PRIV
40
41
require("guiconfig.inc");
42 39163f72 Ermal Lu?i
require_once("notices.inc");
43 facd2d76 Scott Ullrich
44 b19369b7 Scott Ullrich
// Growl
45 48b86f62 jim-p
$pconfig['disable_growl'] = isset($config['notifications']['growl']['disable']);
46 2ee8dea1 Phil Davis
if ($config['notifications']['growl']['password']) {
47 66184513 Scott Ullrich
	$pconfig['password'] = $config['notifications']['growl']['password'];
48 2ee8dea1 Phil Davis
}
49
if ($config['notifications']['growl']['ipaddress']) {
50 66184513 Scott Ullrich
	$pconfig['ipaddress'] = $config['notifications']['growl']['ipaddress'];
51 2ee8dea1 Phil Davis
}
52 d9252b1f Scott Ullrich
53 2ee8dea1 Phil Davis
if ($config['notifications']['growl']['notification_name']) {
54 addbcae7 Scott Ullrich
	$pconfig['notification_name'] = $config['notifications']['growl']['notification_name'];
55 2ee8dea1 Phil Davis
} else {
56 ebb57fe2 Warren Baker
  $pconfig['notification_name'] = "{$g['product_name']} growl alert";
57 2ee8dea1 Phil Davis
}
58
59
if ($config['notifications']['growl']['name']) {
60 addbcae7 Scott Ullrich
	$pconfig['name'] = $config['notifications']['growl']['name'];
61 2ee8dea1 Phil Davis
} else {
62 addbcae7 Scott Ullrich
  $pconfig['name'] = 'PHP-Growl';
63 2ee8dea1 Phil Davis
}
64 addbcae7 Scott Ullrich
65
66 b19369b7 Scott Ullrich
// SMTP
67 48b86f62 jim-p
$pconfig['disable_smtp'] = isset($config['notifications']['smtp']['disable']);
68 2ee8dea1 Phil Davis
if ($config['notifications']['smtp']['ipaddress']) {
69 4090c90f Scott Ullrich
	$pconfig['smtpipaddress'] = $config['notifications']['smtp']['ipaddress'];
70 2ee8dea1 Phil Davis
}
71
if ($config['notifications']['smtp']['port']) {
72 9277b7ef jim-p
	$pconfig['smtpport'] = $config['notifications']['smtp']['port'];
73 2ee8dea1 Phil Davis
}
74
if (isset($config['notifications']['smtp']['ssl'])) {
75 d269747b Warren Baker
	$pconfig['smtpssl'] = true;
76 2ee8dea1 Phil Davis
}
77
if (isset($config['notifications']['smtp']['tls'])) {
78 d269747b Warren Baker
	$pconfig['smtptls'] = true;
79 2ee8dea1 Phil Davis
}
80
if ($config['notifications']['smtp']['notifyemailaddress']) {
81 b19369b7 Scott Ullrich
	$pconfig['smtpnotifyemailaddress'] = $config['notifications']['smtp']['notifyemailaddress'];
82 2ee8dea1 Phil Davis
}
83
if ($config['notifications']['smtp']['username']) {
84 72306d5a Scott Ullrich
	$pconfig['smtpusername'] = $config['notifications']['smtp']['username'];
85 2ee8dea1 Phil Davis
}
86
if ($config['notifications']['smtp']['password']) {
87 72306d5a Scott Ullrich
	$pconfig['smtppassword'] = $config['notifications']['smtp']['password'];
88 2ee8dea1 Phil Davis
}
89
if ($config['notifications']['smtp']['authentication_mechanism']) {
90 305856e8 Phil Davis
	$pconfig['smtpauthmech'] = $config['notifications']['smtp']['authentication_mechanism'];
91 2ee8dea1 Phil Davis
}
92
if ($config['notifications']['smtp']['fromaddress']) {
93 72306d5a Scott Ullrich
	$pconfig['smtpfromaddress'] = $config['notifications']['smtp']['fromaddress'];
94 2ee8dea1 Phil Davis
}
95 b19369b7 Scott Ullrich
96 970ca1b7 Yehuda Katz
// System Sounds
97 66a346b4 Erik Fonnesbeck
$pconfig['disablebeep'] = isset($config['system']['disablebeep']);
98 970ca1b7 Yehuda Katz
99 facd2d76 Scott Ullrich
if ($_POST) {
100
101
	unset($input_errors);
102
	$pconfig = $_POST;
103
104
	/* if this is an AJAX caller then handle via JSON */
105
	if (isAjax() && is_array($input_errors)) {
106
		input_errors2Ajax($input_errors);
107
		exit;
108
	}
109
110
	if ($_POST['apply']) {
111
		$retval = 0;
112 2ee8dea1 Phil Davis
		system_setup_sysctl();
113 facd2d76 Scott Ullrich
		$savemsg = get_std_save_message($retval);
114
	}
115
116 f0d1edc9 Carlos Eduardo Ramos
	if ($_POST['Submit'] == gettext("Save")) {
117 facd2d76 Scott Ullrich
		$tunableent = array();
118
119 b19369b7 Scott Ullrich
		// Growl
120 1afa87e5 Scott Ullrich
		$config['notifications']['growl']['ipaddress'] = $_POST['ipaddress'];
121
		$config['notifications']['growl']['password'] = $_POST['password'];
122 addbcae7 Scott Ullrich
		$config['notifications']['growl']['name'] = $_POST['name'];
123
		$config['notifications']['growl']['notification_name'] = $_POST['notification_name'];
124 facd2d76 Scott Ullrich
125 2ee8dea1 Phil Davis
		if ($_POST['disable_growl'] == "yes") {
126 48b86f62 jim-p
			$config['notifications']['growl']['disable'] = true;
127 2ee8dea1 Phil Davis
		} else {
128 48b86f62 jim-p
			unset($config['notifications']['growl']['disable']);
129 2ee8dea1 Phil Davis
		}
130 48b86f62 jim-p
131 b19369b7 Scott Ullrich
		// SMTP
132
		$config['notifications']['smtp']['ipaddress'] = $_POST['smtpipaddress'];
133 9277b7ef jim-p
		$config['notifications']['smtp']['port'] = $_POST['smtpport'];
134 2ee8dea1 Phil Davis
		if (isset($_POST['smtpssl'])) {
135 d269747b Warren Baker
			$config['notifications']['smtp']['ssl'] = true;
136 2ee8dea1 Phil Davis
		} else {
137 d269747b Warren Baker
			unset($config['notifications']['smtp']['ssl']);
138 2ee8dea1 Phil Davis
		}
139
		if (isset($_POST['smtptls'])) {
140 d269747b Warren Baker
			$config['notifications']['smtp']['tls'] = true;
141 2ee8dea1 Phil Davis
		} else {
142 d269747b Warren Baker
			unset($config['notifications']['smtp']['tls']);
143 2ee8dea1 Phil Davis
		}
144 b19369b7 Scott Ullrich
		$config['notifications']['smtp']['notifyemailaddress'] = $_POST['smtpnotifyemailaddress'];
145 72306d5a Scott Ullrich
		$config['notifications']['smtp']['username'] = $_POST['smtpusername'];
146
		$config['notifications']['smtp']['password'] = $_POST['smtppassword'];
147 305856e8 Phil Davis
		$config['notifications']['smtp']['authentication_mechanism'] = $_POST['smtpauthmech'];
148 72306d5a Scott Ullrich
		$config['notifications']['smtp']['fromaddress'] = $_POST['smtpfromaddress'];
149 b19369b7 Scott Ullrich
150 2ee8dea1 Phil Davis
		if ($_POST['disable_smtp'] == "yes") {
151 48b86f62 jim-p
			$config['notifications']['smtp']['disable'] = true;
152 2ee8dea1 Phil Davis
		} else {
153 48b86f62 jim-p
			unset($config['notifications']['smtp']['disable']);
154 2ee8dea1 Phil Davis
		}
155 48b86f62 jim-p
156 970ca1b7 Yehuda Katz
		// System Sounds
157 2ee8dea1 Phil Davis
		if ($_POST['disablebeep'] == "yes") {
158 66a346b4 Erik Fonnesbeck
			$config['system']['disablebeep'] = true;
159 2ee8dea1 Phil Davis
		} else {
160 66a346b4 Erik Fonnesbeck
			unset($config['system']['disablebeep']);
161 2ee8dea1 Phil Davis
		}
162 970ca1b7 Yehuda Katz
163 facd2d76 Scott Ullrich
		write_config();
164 48b86f62 jim-p
		pfSenseHeader("system_advanced_notifications.php");
165
		return;
166 facd2d76 Scott Ullrich
167 48b86f62 jim-p
	}
168
	if ($_POST['test_growl'] == gettext("Test Growl")) {
169 b19369b7 Scott Ullrich
		// Send test message via growl
170 2ee8dea1 Phil Davis
		if ($config['notifications']['growl']['ipaddress'] &&
171
		    $config['notifications']['growl']['password'] = $_POST['password']) {
172 f670f0a2 Scott Ullrich
			unlink_if_exists($g['vardb_path'] . "/growlnotices_lastmsg.txt");
173 72306d5a Scott Ullrich
			register_via_growl();
174 48b86f62 jim-p
			notify_via_growl(sprintf(gettext("This is a test message from %s.  It is safe to ignore this message."), $g['product_name']), true);
175 72306d5a Scott Ullrich
		}
176 48b86f62 jim-p
	}
177
	if ($_POST['test_smtp'] == gettext("Test SMTP")) {
178 b19369b7 Scott Ullrich
		// Send test message via smtp
179 2ee8dea1 Phil Davis
		if (file_exists("/var/db/notices_lastmsg.txt")) {
180 8b0d920e Scott Ullrich
			unlink("/var/db/notices_lastmsg.txt");
181 2ee8dea1 Phil Davis
		}
182 48b86f62 jim-p
		$savemsg = notify_via_smtp(sprintf(gettext("This is a test message from %s.  It is safe to ignore this message."), $g['product_name']), true);
183
	}
184 facd2d76 Scott Ullrich
}
185
186 2ee8dea1 Phil Davis
$pgtitle = array(gettext("System"), gettext("Advanced: Notifications"));
187 facd2d76 Scott Ullrich
include("head.inc");
188
189
?>
190
191
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
192
<?php include("fbegin.inc"); ?>
193
	<form action="system_advanced_notifications.php" method="post">
194
		<?php
195 2ee8dea1 Phil Davis
			if ($input_errors) {
196 facd2d76 Scott Ullrich
				print_input_errors($input_errors);
197 2ee8dea1 Phil Davis
			}
198
			if ($savemsg) {
199 facd2d76 Scott Ullrich
				print_info_box($savemsg);
200 2ee8dea1 Phil Davis
			}
201 facd2d76 Scott Ullrich
		?>
202
	</form>
203 846ac60f Colin Fleming
	<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="system advanced notifications">
204 facd2d76 Scott Ullrich
		<tr>
205
			<td>
206
				<?php
207
					$tab_array = array();
208 f0d1edc9 Carlos Eduardo Ramos
					$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
209
					$tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php");
210
					$tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php");
211
					$tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php");
212
					$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
213
					$tab_array[] = array(gettext("Notifications"), true, "system_advanced_notifications.php");
214 facd2d76 Scott Ullrich
					display_top_tabs($tab_array);
215
				?>
216
			</td>
217
		</tr>
218
		<tr>
219
			<td id="mainarea">
220
				<div class="tabcont">
221
					<form action="system_advanced_notifications.php" method="post" name="iform">
222 846ac60f Colin Fleming
					<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
223 b19369b7 Scott Ullrich
						<!-- GROWL -->
224 facd2d76 Scott Ullrich
						<tr>
225 f0d1edc9 Carlos Eduardo Ramos
							<td colspan="2" valign="top" class="listtopic"><?=gettext("Growl"); ?></td>
226 facd2d76 Scott Ullrich
						</tr>
227 48b86f62 jim-p
						<tr>
228
							<td width="22%" valign="top" class="vncell"><?=gettext("Disable Growl Notifications"); ?></td>
229
							<td width="78%" class="vtable">
230 8cd558b6 ayvis
								<input type='checkbox' name='disable_growl' value="yes" <?php if ($pconfig['disable_growl']) {?>checked="checked"<?php } ?> /><br />
231 48b86f62 jim-p
								<?=gettext("Check this option to disable growl notifications but preserve the settings below."); ?>
232
							</td>
233
						</tr>
234 addbcae7 Scott Ullrich
						<tr>
235 f0d1edc9 Carlos Eduardo Ramos
							<td width="22%" valign="top" class="vncell"><?=gettext("Registration Name"); ?></td>
236 addbcae7 Scott Ullrich
							<td width="78%" class="vtable">
237 ee3de7b1 jim-p
								<input name='name' value='<?php echo htmlspecialchars($pconfig['name'], ENT_QUOTES | ENT_HTML401); ?>' /><br />
238 f0d1edc9 Carlos Eduardo Ramos
								<?=gettext("Enter the name to register with the Growl server (default: PHP-Growl)."); ?>
239 addbcae7 Scott Ullrich
							</td>
240
						</tr>
241 2ee8dea1 Phil Davis
					<tr>
242 f0d1edc9 Carlos Eduardo Ramos
							<td width="22%" valign="top" class="vncell"><?=gettext("Notification Name"); ?></td>
243 addbcae7 Scott Ullrich
							<td width="78%" class="vtable">
244 ee3de7b1 jim-p
								<input name='notification_name' value='<?php echo htmlspecialchars($pconfig['notification_name'], ENT_QUOTES | ENT_HTML401); ?>' /><br />
245 6840d0e7 Erik Fonnesbeck
								<?=sprintf(gettext("Enter a name for the Growl notifications (default: %s growl alert)."), $g['product_name']); ?>
246 addbcae7 Scott Ullrich
							</td>
247
						</tr>
248 facd2d76 Scott Ullrich
						<tr>
249 f0d1edc9 Carlos Eduardo Ramos
							<td width="22%" valign="top" class="vncell"><?=gettext("IP Address"); ?></td>
250 facd2d76 Scott Ullrich
							<td width="78%" class="vtable">
251 ee3de7b1 jim-p
								<input name='ipaddress' value='<?php echo htmlspecialchars($pconfig['ipaddress'], ENT_QUOTES | ENT_HTML401); ?>' /><br />
252 f0d1edc9 Carlos Eduardo Ramos
								<?=gettext("This is the IP address that you would like to send growl notifications to."); ?>
253 facd2d76 Scott Ullrich
							</td>
254
						</tr>
255
						<tr>
256 f0d1edc9 Carlos Eduardo Ramos
							<td width="22%" valign="top" class="vncell"><?=gettext("Password"); ?></td>
257 facd2d76 Scott Ullrich
							<td width="78%" class="vtable">
258 ee3de7b1 jim-p
								<input name='password' type='password' value='<?php echo htmlspecialchars($pconfig['password'], ENT_QUOTES | ENT_HTML401); ?>' /><br />
259 f0d1edc9 Carlos Eduardo Ramos
								<?=gettext("Enter the password of the remote growl notification device."); ?>
260 facd2d76 Scott Ullrich
							</td>
261
						</tr>
262 48b86f62 jim-p
						<tr>
263
							<td valign="top" class="">
264
								&nbsp;
265
							</td>
266
							<td>
267
								<input type='submit' id='test_growl' name='test_growl' value='<?=gettext("Test Growl"); ?>' />
268
								<br /><?= gettext("NOTE: A test notification will be sent even if the service is marked as disabled.") ?>
269
							</td>
270
						</tr>
271 7d8c8a28 Scott Ullrich
						<tr>
272
							<td colspan="2" class="list" height="12">&nbsp;</td>
273 2ee8dea1 Phil Davis
						</tr>
274 b19369b7 Scott Ullrich
						<!-- SMTP -->
275
						<tr>
276 f0d1edc9 Carlos Eduardo Ramos
							<td colspan="2" valign="top" class="listtopic"><?=gettext("SMTP E-Mail"); ?></td>
277 b19369b7 Scott Ullrich
						</tr>
278 48b86f62 jim-p
						<tr>
279
							<td width="22%" valign="top" class="vncell"><?=gettext("Disable SMTP Notifications"); ?></td>
280
							<td width="78%" class="vtable">
281 8cd558b6 ayvis
								<input type='checkbox' name='disable_smtp' value="yes" <?php if ($pconfig['disable_smtp']) {?>checked="checked"<?php } ?> /><br />
282 48b86f62 jim-p
								<?=gettext("Check this option to disable SMTP notifications but preserve the settings below. Some other mechanisms, such as packages, may need these settings in place to function."); ?>
283
							</td>
284
						</tr>
285 b19369b7 Scott Ullrich
						<tr>
286 d58b93d2 jim-p
							<td width="22%" valign="top" class="vncell"><?=gettext("E-Mail server"); ?></td>
287 b19369b7 Scott Ullrich
							<td width="78%" class="vtable">
288 ee3de7b1 jim-p
								<input name='smtpipaddress' value='<?php echo htmlspecialchars($pconfig['smtpipaddress'], ENT_QUOTES | ENT_HTML401); ?>' /><br />
289 d58b93d2 jim-p
								<?=gettext("This is the FQDN or IP address of the SMTP E-Mail server to which notifications will be sent."); ?>
290 b19369b7 Scott Ullrich
							</td>
291
						</tr>
292 9277b7ef jim-p
						<tr>
293
							<td width="22%" valign="top" class="vncell"><?=gettext("SMTP Port of E-Mail server"); ?></td>
294
							<td width="78%" class="vtable">
295 ee3de7b1 jim-p
								<input name='smtpport' value='<?php echo htmlspecialchars($pconfig['smtpport'], ENT_QUOTES | ENT_HTML401); ?>' /><br />
296 1cddd59c Warren Baker
								<?=gettext("This is the port of the SMTP E-Mail server, typically 25, 587 (submission) or 465 (smtps)"); ?>
297
							</td>
298
						</tr>
299
						<tr>
300
							<td width="22%" valign="top" class="vncell"><?=gettext("Secure SMTP Connection"); ?></td>
301
							<td width="78%" class="vtable">
302 d269747b Warren Baker
								<input type='checkbox' id='smtpssl' name='smtpssl' <?php if (isset($pconfig['smtpssl'])) echo "checked=\"checked\""; ?> />Enable SMTP over SSL/TLS<br />
303
								<input type='checkbox' id='smtptls' name='smtptls' <?php if (isset($pconfig['smtptls'])) echo "checked=\"checked\""; ?> />Enable STARTTLS<br />
304 9277b7ef jim-p
							</td>
305
						</tr>
306 72306d5a Scott Ullrich
						<tr>
307 f0d1edc9 Carlos Eduardo Ramos
							<td width="22%" valign="top" class="vncell"><?=gettext("From e-mail address"); ?></td>
308 72306d5a Scott Ullrich
							<td width="78%" class="vtable">
309 ee3de7b1 jim-p
								<input name='smtpfromaddress' type='text' value='<?php echo htmlspecialchars($pconfig['smtpfromaddress'], ENT_QUOTES | ENT_HTML401); ?>' /><br />
310 f0d1edc9 Carlos Eduardo Ramos
								<?=gettext("This is the e-mail address that will appear in the from field."); ?>
311 72306d5a Scott Ullrich
							</td>
312
						</tr>
313 b19369b7 Scott Ullrich
						<tr>
314 f0d1edc9 Carlos Eduardo Ramos
							<td width="22%" valign="top" class="vncell"><?=gettext("Notification E-Mail address"); ?></td>
315 b19369b7 Scott Ullrich
							<td width="78%" class="vtable">
316 ee3de7b1 jim-p
								<input name='smtpnotifyemailaddress' type='text' value='<?php echo htmlspecialchars($pconfig['smtpnotifyemailaddress'], ENT_QUOTES | ENT_HTML401); ?>' /><br />
317 f0d1edc9 Carlos Eduardo Ramos
								<?=gettext("Enter the e-mail address that you would like email notifications sent to."); ?>
318 b19369b7 Scott Ullrich
							</td>
319
						</tr>
320 72306d5a Scott Ullrich
						<tr>
321 f0d1edc9 Carlos Eduardo Ramos
							<td width="22%" valign="top" class="vncell"><?=gettext("Notification E-Mail auth username (optional)"); ?></td>
322 72306d5a Scott Ullrich
							<td width="78%" class="vtable">
323 ee3de7b1 jim-p
								<input name='smtpusername' type='text' value='<?php echo htmlspecialchars($pconfig['smtpusername'], ENT_QUOTES | ENT_HTML401); ?>' /><br />
324 f0d1edc9 Carlos Eduardo Ramos
								<?=gettext("Enter the e-mail address username for SMTP authentication."); ?>
325 72306d5a Scott Ullrich
							</td>
326
						</tr>
327
						<tr>
328 f0d1edc9 Carlos Eduardo Ramos
							<td width="22%" valign="top" class="vncell"><?=gettext("Notification E-Mail auth password"); ?></td>
329 72306d5a Scott Ullrich
							<td width="78%" class="vtable">
330 ee3de7b1 jim-p
								<input name='smtppassword' type='password' value='<?php echo htmlspecialchars($pconfig['smtppassword'], ENT_QUOTES | ENT_HTML401); ?>' /><br />
331 f0d1edc9 Carlos Eduardo Ramos
								<?=gettext("Enter the e-mail address password for SMTP authentication."); ?>
332 72306d5a Scott Ullrich
							</td>
333
						</tr>
334 305856e8 Phil Davis
						<tr>
335
							<td width="22%" valign="top" class="vncell"><?=gettext("Notification E-Mail auth mechanism"); ?></td>
336
							<td width="78%" class="vtable">
337
								<select name='smtpauthmech' id='smtpauthmech' class="formselect">
338
								<?php
339
									foreach ($smtp_authentication_mechanisms as $name => $desc):
340
										$selected = "";
341 2ee8dea1 Phil Davis
										if ($pconfig['smtpauthmech'] == $name) {
342 305856e8 Phil Davis
											$selected = "selected=\"selected\"";
343 2ee8dea1 Phil Davis
										}
344 305856e8 Phil Davis
								?>
345 2ee8dea1 Phil Davis
									<option value="<?=$name;?>" <?=$selected;?>><?=$desc;?></option>
346 305856e8 Phil Davis
								<?php endforeach; ?>
347
								</select>
348
								<br />
349
								<?=gettext("Select the authentication mechanism used by the SMTP server. Most work with PLAIN, some servers like Exchange or Office365 might require LOGIN."); ?>
350
							</td>
351
						</tr>
352 48b86f62 jim-p
						<tr>
353
							<td valign="top" class="">
354
								&nbsp;
355
							</td>
356
							<td>
357
								<input type='submit' id='test_smtp' name='test_smtp' value='<?=gettext("Test SMTP"); ?>' />
358
								<br /><?= gettext("NOTE: A test message will be sent even if the service is marked as disabled.") ?>
359
							</td>
360
						</tr>
361 66a346b4 Erik Fonnesbeck
						<tr>
362
							<td colspan="2" class="list" height="12">&nbsp;</td>
363 2ee8dea1 Phil Davis
						</tr>
364 970ca1b7 Yehuda Katz
						<!-- System Sounds -->
365
						<tr>
366
							<td colspan="2" valign="top" class="listtopic"><?=gettext("System Sounds"); ?></td>
367
						</tr>
368
						<tr>
369
							<td width="22%" valign="top" class="vncell"><?=gettext("Startup/Shutdown Sound"); ?></td>
370
							<td width="78%" class="vtable">
371 6c07db48 Phil Davis
								<input name="disablebeep" type="checkbox" id="disablebeep" value="yes" <?php if ($pconfig['disablebeep']) echo "checked=\"checked\""; ?> />
372 970ca1b7 Yehuda Katz
								<strong><?=gettext("Disable the startup/shutdown beep"); ?></strong>
373 8cd558b6 ayvis
								<br />
374 970ca1b7 Yehuda Katz
								<span class="vexpl"><?=gettext("When this is checked, startup and shutdown sounds will no longer play."); ?></span>
375
							</td>
376
						</tr>
377 66a346b4 Erik Fonnesbeck
						<tr>
378
							<td colspan="2" class="list" height="12">&nbsp;</td>
379 2ee8dea1 Phil Davis
						</tr>
380 facd2d76 Scott Ullrich
						<tr>
381
							<td valign="top" class="">
382
								&nbsp;
383
							</td>
384
							<td>
385 846ac60f Colin Fleming
								<input type='submit' id='Submit' name='Submit' value='<?=gettext("Save"); ?>' />
386 facd2d76 Scott Ullrich
							</td>
387
						</tr>
388
					</table>
389 846ac60f Colin Fleming
					</form>
390 facd2d76 Scott Ullrich
				</div>
391
			</td>
392
		</tr>
393
	</table>
394 1cddd59c Warren Baker
<script type="text/javascript">
395 1b244d38 Colin Fleming
//<![CDATA[
396 1cddd59c Warren Baker
	jQuery(document).ready(function() {
397
		if (jQuery('#smtpssl').is(':checked')) {
398
			jQuery('#smtptls').prop('disabled', true);
399 6c07db48 Phil Davis
		} else if (jQuery('#smtptls').is(':checked')) {
400 1cddd59c Warren Baker
			jQuery('#smtpssl').prop('disabled', true);
401
		}
402
	});
403
	jQuery('#smtpssl').change( function() {
404
		jQuery('#smtptls').prop('disabled', this.checked);
405
	});
406
	jQuery('#smtptls').change( function() {
407
		jQuery('#smtpssl').prop('disabled', this.checked);
408
	});
409 1b244d38 Colin Fleming
//]]>
410 1cddd59c Warren Baker
</script>
411 facd2d76 Scott Ullrich
<?php include("fend.inc"); ?>
412
</body>
413
</html>