Project

General

Profile

« Previous | Next » 

Revision 8f65151c

Added by Phil Davis over 9 years ago

Code style System Advanced

View differences:

src/usr/local/www/system.php
80 80
$arr_gateways = return_gateways_array();
81 81

  
82 82
// set default colmns to two if unset
83
if(!isset($config['system']['webgui']['dashboardcolumns'])) {
83
if (!isset($config['system']['webgui']['dashboardcolumns'])) {
84 84
	$config['system']['webgui']['dashboardcolumns'] = 2;
85 85
}
86 86

  
......
149 149
	} else {
150 150
		unset($config['system']['webgui']['webguicss']);
151 151
	}
152
	
152

  
153 153
	if ($_POST['webguifixedmenu']) {
154 154
		$config['system']['webgui']['webguifixedmenu'] = $_POST['webguifixedmenu'];
155 155
	} else {
......
160 160
		$config['system']['webgui']['dashboardcolumns'] = $_POST['dashboardcolumns'];
161 161
	} else {
162 162
		unset($config['system']['webgui']['dashboardcolumns']);
163
	}	
164
	
163
	}
164

  
165 165
	if ($_POST['hostname']) {
166 166
		if (!is_hostname($_POST['hostname'])) {
167 167
			$input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'. It may not start or end with '-'.");
......
340 340
$pgtitle = array(gettext("System"), gettext("General Setup"));
341 341
include("head.inc");
342 342

  
343
if ($input_errors)
343
if ($input_errors) {
344 344
	print_input_errors($input_errors);
345
}
345 346

  
346
if ($savemsg)
347
if ($savemsg) {
347 348
	print_info_box($savemsg, success);
349
}
348 350
?>
349 351
<div id="container">
350 352
<?php
......
371 373

  
372 374
$section = new Form_Section('DNS server settings');
373 375

  
374
for ($i=1; $i<5; $i++)
375
{
376
for ($i=1; $i<5; $i++) {
376 377
//	if (!isset($pconfig['dns'.$i]))
377 378
//		continue;
378 379

  
......
391 392
	if ($multiwan)	{
392 393
		$options = array('none' => 'none');
393 394

  
394
		foreach($arr_gateways as $gwname => $gwitem) {
395
			if((is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv6($gwitem['gateway'])))) {
395
		foreach ($arr_gateways as $gwname => $gwitem) {
396
			if ((is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv6($gwitem['gateway'])))) {
396 397
				continue;
397 398
			}
398 399

  
399
			if((is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv4($gwitem['gateway'])))) {
400
			if ((is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv4($gwitem['gateway'])))) {
400 401
				continue;
401 402
			}
402 403

  
......
414 415
			"When using multiple WAN connections there should be at least one unique DNS server per gateway.";
415 416
	}
416 417

  
417
	if($i == 4)
418
	if ($i == 4) {
418 419
		$group->setHelp($help);
420
	}
419 421

  
420 422
	$section->add($group);
421 423
}
......
469 471
$css = glob("/usr/local/www/bootstrap/css/*.css");
470 472
foreach ($css as $file) {
471 473
	$file = basename($file);
472
	if(substr($file, 0, 9) !== 'bootstrap') {
474
	if (substr($file, 0, 9) !== 'bootstrap') {
473 475
		$csslist[$file] = pathinfo($file, PATHINFO_FILENAME);
474 476
	}
475 477
}
src/usr/local/www/system_advanced_admin.php
266 266
		}
267 267

  
268 268
		if (($sshd_enabled != $config['system']['enablesshd']) ||
269
			($sshd_keyonly != $config['system']['sshdkeyonly']) ||
270
			($sshd_port != $config['system']['ssh']['port'])) {
269
		    ($sshd_keyonly != $config['system']['sshdkeyonly']) ||
270
		    ($sshd_port != $config['system']['ssh']['port'])) {
271 271
			$restart_sshd = true;
272 272
		}
273 273

  
......
320 320
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Admin Access"));
321 321
include("head.inc");
322 322

  
323
if ($input_errors)
323
if ($input_errors) {
324 324
	print_input_errors($input_errors);
325
}
325 326

  
326
if ($savemsg)
327
if ($savemsg) {
327 328
	print_info_box($savemsg, 'success');
329
}
328 330

  
329 331
$tab_array = array();
330 332
$tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php");
......
345 347
	'webguiproto',
346 348
	'Protocol',
347 349
	'HTTP',
348
	($pconfig['webguiproto']=='http'),
350
	($pconfig['webguiproto'] == 'http'),
349 351
	'http'
350 352
))->displayAsRadio();
351 353

  
......
353 355
	'webguiproto',
354 356
	'Protocol',
355 357
	'HTTPS',
356
	($pconfig['webguiproto']=='https'),
358
	($pconfig['webguiproto'] == 'https'),
357 359
	'https'
358 360
))->displayAsRadio();
359 361

  
......
364 366
$section->add($group);
365 367

  
366 368
$values = array();
367
foreach($a_cert as $cert)
369
foreach ($a_cert as $cert) {
368 370
	$values[ $cert['refid'] ] = $cert['descr'];
371
}
369 372

  
370 373
$section->addInput($input = new Form_Select(
371 374
	'ssl-certref',
......
421 424
))->setHelp('When this is checked, successful logins to the webConfigurator will '.
422 425
	'not be logged.');
423 426

  
424
if ($config['interfaces']['lan'])
427
if ($config['interfaces']['lan']) {
425 428
	$lockout_interface = "LAN";
426
else
429
} else {
427 430
	$lockout_interface = "WAN";
431
}
428 432

  
429 433
$section->addInput(new Form_Checkbox(
430 434
	'noantilockout',
......
508 512
))->setHelp('Note: Leave this blank for the default of 22.');
509 513

  
510 514

  
511
if (!$g['enableserial_force'] && ($g['platform'] == $g['product_name'] || $g['platform'] == "cdrom"))
512
{
515
if (!$g['enableserial_force'] && ($g['platform'] == $g['product_name'] || $g['platform'] == "cdrom")) {
513 516
	$form->add($section);
514 517
	$section = new Form_Section('Serial Communications');
515 518

  
......
559 562
?>
560 563
<script type="text/javascript">
561 564
//<![CDATA[
562
events.push(function(){
565
events.push(function() {
563 566

  
564 567
	// ---------- On initial page load ------------------------------------------------------------
565 568

  
......
577 580
<?php
578 581
include("foot.inc");
579 582

  
580
if ($restart_webgui)
583
if ($restart_webgui) {
581 584
	echo "<meta http-equiv=\"refresh\" content=\"20;url={$url}\" />";
585
}
582 586

  
583
if ($restart_sshd)
584
{
587
if ($restart_sshd) {
585 588
	killbyname("sshd");
586 589
	log_error(gettext("secure shell configuration has changed. Stopping sshd."));
587 590

  
......
591 594
	}
592 595
}
593 596

  
594
if ($restart_webgui)
595
{
597
if ($restart_webgui) {
596 598
	ob_flush();
597 599
	flush();
598 600
	log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
src/usr/local/www/system_advanced_misc.php
301 301
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Miscellaneous"));
302 302
include("head.inc");
303 303

  
304
if ($input_errors)
304
if ($input_errors) {
305 305
	print_input_errors($input_errors);
306
}
306 307

  
307
if ($savemsg)
308
if ($savemsg) {
308 309
	print_info_box($savemsg, success);
310
}
309 311

  
310 312
$tab_array = array();
311 313
$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
......
561 563
	$opts = array(0.5,  1, 2,  3,  4,  5,  7.5,  10,  15,  20,  30,  60);
562 564
	$vals = array(  6, 12, 24, 36, 48, 60,  90, 120, 180, 240, 241, 242);
563 565

  
564
	$section->addINput(new Form_Select(
566
	$section->addInput(new Form_Select(
565 567
		'harddiskstandby',
566 568
		'Hard disk standby time',
567 569
		$pconfig['harddiskstandby'],
src/usr/local/www/system_advanced_network.php
174 174
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Networking"));
175 175
include("head.inc");
176 176

  
177
if ($input_errors)
177
if ($input_errors) {
178 178
	print_input_errors($input_errors);
179
if ($savemsg)
179
}
180
if ($savemsg) {
180 181
	print_info_box($savemsg);
182
}
181 183

  
182 184
$tab_array = array();
183 185
$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
......
284 286
))->setHelp('This option will suppress ARP log messages when multiple interfaces '.
285 287
	'reside on the same broadcast domain');
286 288

  
287
if (get_freebsd_version() == 8)
288
{
289
if (get_freebsd_version() == 8) {
289 290
	$section->addInput(new Form_Checkbox(
290 291
		'flowtable',
291 292
		'Enable flowtable support',
292 293
		$pconfig['flowtable']
293 294
	))->setHelp('Enables infrastructure for caching flows as a means of accelerating '.
294
		'L3 and L2 lookupsas well as providing stateful load balancing when used with '.
295
		'L3 and L2 lookups as well as providing stateful load balancing when used with '.
295 296
		'RADIX_MPATH.');
296 297
}
297 298

  
src/usr/local/www/system_advanced_notifications.php
183 183
	if (isset($_POST['test-growl'])) {
184 184
		// Send test message via growl
185 185
		if ($config['notifications']['growl']['ipaddress'] &&
186
			$config['notifications']['growl']['password'] = $_POST['password']) {
186
		    $config['notifications']['growl']['password'] = $_POST['password']) {
187 187
			unlink_if_exists($g['vardb_path'] . "/growlnotices_lastmsg.txt");
188 188
			register_via_growl();
189 189
			notify_via_growl(sprintf(gettext("This is a test message from %s.  It is safe to ignore this message."), $g['product_name']), true);
......
202 202
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Notifications"));
203 203
include("head.inc");
204 204

  
205
if ($input_errors)
205
if ($input_errors) {
206 206
	print_input_errors($input_errors);
207
}
207 208

  
208
if ($savemsg)
209
if ($savemsg) {
209 210
	print_info_box($savemsg, 'success');
211
}
210 212

  
211 213
$tab_array = array();
212 214
$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
src/usr/local/www/system_advanced_sysctl.php
143 143

  
144 144
		$tunableent = array();
145 145

  
146
		if(!$_POST['tunable'] || !isset($_POST['value'])) {
146
		if (!$_POST['tunable'] || !isset($_POST['value'])) {
147 147
			$input_errors[] = gettext("Both a name and a value must be specified.");
148 148
		} else if (!ctype_alnum($_POST['value'])) {
149 149
			$input_errors[] = gettext("The value may contain alphanumeric characters only.");
......
169 169
$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("System Tunables"));
170 170
include("head.inc");
171 171

  
172
if ($input_errors)
172
if ($input_errors) {
173 173
	print_input_errors($input_errors);
174
}
174 175

  
175
if ($savemsg)
176
if ($savemsg) {
176 177
	print_info_box($savemsg, 'success');
178
}
177 179

  
178
if (is_subsystem_dirty('sysctl') && ($act != "edit" ))
180
if (is_subsystem_dirty('sysctl') && ($act != "edit" )) {
179 181
	print_info_box_np(gettext("The firewall tunables have changed. You must apply the configuration for them to take affect."));
182
}
180 183

  
181 184
$tab_array = array();
182 185
$tab_array[] = array(gettext("Admin Access"), false, "system_advanced_admin.php");
......
187 190
$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
188 191
display_top_tabs($tab_array);
189 192

  
190
if ($act != "edit" ): ?>
193
if ($act != "edit"): ?>
191 194
<div class="panel panel-default">
192 195
	<div class="panel-heading">
193 196
		<h2 class="panel-title"><?=gettext('System Tunables'); ?></h2>
......
204 207
						<th><a class="btn btn-xs btn-primary" href="system_advanced_sysctl.php?act=edit"><?=gettext('New'); ?></a></th>
205 208
					</tr>
206 209
				</thead>
207
				<?php foreach ($tunables as $i => $tunable):
208
					if (!isset($tunable['modified']))
209
						$i = $tunable['tunable']; ?>
210
				<?php
211
					foreach ($tunables as $i => $tunable):
212
						if (!isset($tunable['modified'])) {
213
							$i = $tunable['tunable'];
214
						}
215
				?>
210 216
				<tr>
211 217
					<td><?=$tunable['tunable']; ?></td>
212 218
					<td><?=$tunable['descr']; ?></td>
213 219
					<td><?=$tunable['value']; ?>
214
					<?php if($tunable['value'] == "default")
215
						echo "(" . get_default_sysctl_value($tunable['tunable']) . ")"; ?>
220
					<?php
221
						if ($tunable['value'] == "default") {
222
							echo "(" . get_default_sysctl_value($tunable['tunable']) . ")";
223
						}
224
					?>
216 225
					</td>
217 226
					<td>
218 227
					<a class="fa fa-pencil" title="<?=gettext("Edit tunable"); ?>" href="system_advanced_sysctl.php?act=edit&amp;id=<?=$i;?>"></a>

Also available in: Unified diff