Project

General

Profile

« Previous | Next » 

Revision 1e45d13f

Added by Christian McDonald almost 3 years ago

Rector some direct config gets with pure scalar paths.

View differences:

src/etc/inc/acb.inc
218 218
		$last_backup_date = "";
219 219
	}
220 220

  
221
	$last_config_change = $config['revision']['time'];
221
	$last_config_change = config_get_path('revision/time');
222 222
	$hostname = $config['system']['hostname'] . "." . $config['system']['domain'];
223
	$reason	= $config['revision']['description'];
223
	$reason	= config_get_path('revision/description');
224 224

  
225 225
	if ($manual && array_key_exists('numman', $config['system']['acb'])) {
226
		$manmax = $config['system']['acb']['numman'];
226
		$manmax = config_get_path('system/acb/numman');
227 227
	} else {
228 228
		$manmax = "0";
229 229
	}
230 230

  
231
	$encryptpw = $config['system']['acb']['encryption_password'];
231
	$encryptpw = config_get_path('system/acb/encryption_password');
232 232

  
233 233
	// Define upload_url, must be present after other variable definitions due to username, password
234 234
	$upload_url = "https://acb.netgate.com/save";
src/etc/inc/config.gui.inc
61 61
/* set timezone */
62 62
if (isset($config['system']['timezone']) &&
63 63
    !empty($config['system']['timezone'])) {
64
	$timezone = $config['system']['timezone'];
64
	$timezone = config_get_path('system/timezone');
65 65
} elseif (isset($g['default_timezone']) && !empty($g['default_timezone'])) {
66 66
	$timezone = $g['default_timezone'];
67 67
} else {
src/etc/inc/config.inc
146 146
/* set timezone */
147 147
if (isset($config['system']['timezone']) &&
148 148
    !empty($config['system']['timezone'])) {
149
	$timezone = $config['system']['timezone'];
149
	$timezone = config_get_path('system/timezone');
150 150
} elseif (isset($g['default_timezone']) && !empty($g['default_timezone'])) {
151 151
	$timezone = $g['default_timezone'];
152 152
} else {
src/etc/inc/config.lib.inc
477 477
	}
478 478

  
479 479
	// Save off config version
480
	$prev_version = $config['version'];
480
	$prev_version = config_get_path('version');
481 481

  
482 482
	include_once('auth.inc');
483 483
	include_once('upgrade_config.inc');
......
493 493
	if (!is_array($config['system']['already_run_config_upgrade'])) {
494 494
		$config['system']['already_run_config_upgrade'] = array();
495 495
	}
496
	$already_run = $config['system']['already_run_config_upgrade'];
496
	$already_run = config_get_path('system/already_run_config_upgrade');
497 497

  
498 498
	/* Loop and run upgrade_VER_to_VER() until we're at current version */
499 499
	while ($config['version'] < $g['latest_config']) {
......
1030 1030
	if ($config['revision']['time'] == "") {
1031 1031
		$baktime = 0;
1032 1032
	} else {
1033
		$baktime = $config['revision']['time'];
1033
		$baktime = config_get_path('revision/time');
1034 1034
	}
1035 1035

  
1036 1036
	if ($config['revision']['description'] == "") {
1037 1037
		$bakdesc = "Unknown";
1038 1038
	} else {
1039
		$bakdesc = $config['revision']['description'];
1039
		$bakdesc = config_get_path('revision/description');
1040 1040
	}
1041 1041

  
1042 1042
	$bakver = ($config['version'] == "") ? "?" : $config['version'];
src/etc/inc/gwlb.inc
1687 1687
	global $config;
1688 1688

  
1689 1689
	if (is_array($config['gateways']['gateway_group'])) {
1690
		$groups = $config['gateways']['gateway_group'];
1690
		$groups = config_get_path('gateways/gateway_group');
1691 1691
	} else {
1692 1692
		return false;
1693 1693
	}
......
1715 1715
	global $config;
1716 1716

  
1717 1717
	if (is_array($config['gateways']['gateway_group'])) {
1718
		$groups = $config['gateways']['gateway_group'];
1718
		$groups = config_get_path('gateways/gateway_group');
1719 1719
	} else {
1720 1720
		return false;
1721 1721
	}
src/etc/inc/ipsec.inc
1336 1336
		return;
1337 1337
	}
1338 1338

  
1339
	$ipseccfg = $config['ipsec'];
1339
	$ipseccfg = config_get_path('ipsec');
1340 1340

  
1341 1341
	if (!empty($interface) && is_array($ipseccfg['phase1'])) {
1342 1342
		$found = false;
......
1714 1714
	}
1715 1715

  
1716 1716
	if (isset($config['ipsec']['maxexchange'])) {
1717
		$ssconf['charon']['max_ikev1_exchanges'] = $config['ipsec']['maxexchange'];
1717
		$ssconf['charon']['max_ikev1_exchanges'] = config_get_path('ipsec/maxexchange');
1718 1718
	}
1719 1719

  
1720 1720
	$unity_enabled = isset($config['ipsec']['unityplugin']) ? 'yes' : 'no';
......
1729 1729
	}
1730 1730

  
1731 1731
	if (isset($config['ipsec']['port'])) {
1732
		$ssconf['charon']['port'] = $config['ipsec']['port'];
1732
		$ssconf['charon']['port'] = config_get_path('ipsec/port');
1733 1733
	}
1734 1734

  
1735 1735
	if (isset($config['ipsec']['port_nat_t'])) {
1736
		$ssconf['charon']['port_nat_t'] = $config['ipsec']['port_nat_t'];
1736
		$ssconf['charon']['port_nat_t'] = config_get_path('ipsec/port_nat_t');
1737 1737
	}
1738 1738

  
1739 1739
	/* IKEv2 retransmit options, see https://redmine.pfsense.org/issues/12184 */
1740 1740
	if (isset($config['ipsec']['ikev2_retransmit_tries'])) {
1741
		$ssconf['charon']['retransmit_tries'] = $config['ipsec']['ikev2_retransmit_tries'];
1741
		$ssconf['charon']['retransmit_tries'] = config_get_path('ipsec/ikev2_retransmit_tries');
1742 1742
	}
1743 1743
	if (isset($config['ipsec']['ikev2_retransmit_timeout'])) {
1744
		$ssconf['charon']['retransmit_timeout'] = $config['ipsec']['ikev2_retransmit_timeout'];
1744
		$ssconf['charon']['retransmit_timeout'] = config_get_path('ipsec/ikev2_retransmit_timeout');
1745 1745
	}
1746 1746
	if (isset($config['ipsec']['ikev2_retransmit_base'])) {
1747
		$ssconf['charon']['retransmit_base'] = $config['ipsec']['ikev2_retransmit_base'];
1747
		$ssconf['charon']['retransmit_base'] = config_get_path('ipsec/ikev2_retransmit_base');
1748 1748
	}
1749 1749
	if (isset($config['ipsec']['ikev2_retransmit_jitter'])) {
1750
		$ssconf['charon']['retransmit_jitter'] = $config['ipsec']['ikev2_retransmit_jitter'];
1750
		$ssconf['charon']['retransmit_jitter'] = config_get_path('ipsec/ikev2_retransmit_jitter');
1751 1751
	}
1752 1752
	if (isset($config['ipsec']['ikev2_retransmit_limit'])) {
1753
		$ssconf['charon']['retransmit_limit'] = $config['ipsec']['ikev2_retransmit_limit'];
1753
		$ssconf['charon']['retransmit_limit'] = config_get_path('ipsec/ikev2_retransmit_limit');
1754 1754
	}
1755 1755

  
1756 1756
	$ssconf['charon']['syslog'] = array();
......
1972 1972
 ******/
1973 1973
function ipsec_setup_userpools() {
1974 1974
	global $config, $scconf;
1975
	$a_mobilekey = $config['ipsec']['mobilekey'];
1975
	$a_mobilekey = config_get_path('ipsec/mobilekey');
1976 1976

  
1977 1977
	/* Do not waste time if we do not have all the necessary information. */
1978 1978
	if (!is_array($a_mobilekey) ||
......
2228 2228
			}
2229 2229
			if (($config['ipsec']['client']['group_source'] == 'enabled') &&
2230 2230
			    !empty($config['ipsec']['client']['auth_groups'])) {
2231
				$remote['groups'] = $config['ipsec']['client']['auth_groups'];
2231
				$remote['groups'] = config_get_path('ipsec/client/auth_groups');
2232 2232
			}
2233 2233
			$remote['auth'] = "eap-radius";
2234 2234
			break;
......
3184 3184
	$ipsecpinghostsactive = false;
3185 3185

  
3186 3186
	/* Populate convenience variables */
3187
	$syscfg = $config['system'];
3187
	$syscfg = config_get_path('system');
3188 3188
	init_config_arr(array('ipsec', 'phase1'));
3189
	$ipseccfg = $config['ipsec'];
3190
	$a_phase1 = $config['ipsec']['phase1'];
3189
	$ipseccfg = config_get_path('ipsec');
3190
	$a_phase1 = config_get_path('ipsec/phase1');
3191 3191
	init_config_arr(array('ipsec', 'phase2'));
3192
	$a_phase2 = $config['ipsec']['phase2'];
3192
	$a_phase2 = config_get_path('ipsec/phase2');
3193 3193
	init_config_arr(array('ipsec', 'client'));
3194
	$a_client = $config['ipsec']['client'];
3194
	$a_client = config_get_path('ipsec/client');
3195 3195

  
3196 3196
	$mobile_configured = false;
3197 3197

  
......
3247 3247
	 * use it instead. */
3248 3248
	if (!empty($config['ipsec']['uniqueids']) &&
3249 3249
	    array_key_exists($config['ipsec']['uniqueids'], $ipsec_idhandling)) {
3250
		$conn_defaults['unique'] = $config['ipsec']['uniqueids'];
3250
		$conn_defaults['unique'] = config_get_path('ipsec/uniqueids');
3251 3251
	}
3252 3252
	/* Disable ipcomp for now. redmine #6167
3253 3253
	if (isset($config['ipsec']['compression'])) {
src/etc/inc/notices.inc
366 366
		return;
367 367
	}
368 368

  
369
	$to = $config['notifications']['smtp']['notifyemailaddress'];
369
	$to = config_get_path('notifications/smtp/notifyemailaddress');
370 370

  
371 371
	if (empty($config['notifications']['smtp']['username']) ||
372 372
	    empty($config['notifications']['smtp']['password'])) {
......
377 377
		$auth = isset($config['notifications']['smtp']['authentication_mechanism'])
378 378
		    ? $config['notifications']['smtp']['authentication_mechanism']
379 379
		    : 'PLAIN';
380
		$username = $config['notifications']['smtp']['username'];
381
		$password = $config['notifications']['smtp']['password'];
380
		$username = config_get_path('notifications/smtp/username');
381
		$password = config_get_path('notifications/smtp/password');
382 382
	}
383 383

  
384 384
	$params = array(
......
410 410
	}
411 411

  
412 412
	if ($config['notifications']['smtp']['fromaddress']) {
413
		$from = $config['notifications']['smtp']['fromaddress'];
413
		$from = config_get_path('notifications/smtp/fromaddress');
414 414
	} else {
415 415
		$from = "pfsense@{$config['system']['hostname']}.{$config['system']['domain']}";
416 416
	}
src/etc/inc/priv.inc
242 242
		$authcfg = auth_get_authserver($config['system']['webgui']['authmode']);
243 243
		// cache auth results for a short time to ease load on auth services & logs
244 244
		if (isset($config['system']['webgui']['auth_refresh_time'])) {
245
			$recheck_time = $config['system']['webgui']['auth_refresh_time'];
245
			$recheck_time = config_get_path('system/webgui/auth_refresh_time');
246 246
		} else {
247 247
			$recheck_time = 30;
248 248
		}
src/etc/inc/upgrade_config.inc
191 191
function upgrade_011_to_012() {
192 192
	global $config;
193 193
	/* move LAN DHCP server config */
194
	$tmp = $config['dhcpd'];
194
	$tmp = config_get_path('dhcpd');
195 195
	$config['dhcpd'] = array();
196 196
	$config['dhcpd']['lan'] = $tmp;
197 197

  
......
252 252
	/* Default route moved */
253 253
	if (isset($config['interfaces']['wan']['gateway'])) {
254 254
		if ($config['interfaces']['wan']['gateway'] <> "") {
255
			$config['system']['gateway'] = $config['interfaces']['wan']['gateway'];
255
			$config['system']['gateway'] = config_get_path('interfaces/wan/gateway');
256 256
		}
257 257
		config_del_path('interfaces/wan/gateway');
258 258
	}
......
279 279
	if (isset($config['system']['firmwareurl']) && isset($config['system']['firmwarename'])) { // Only convert if *both* are defined.
280 280
		$config['system']['alt_firmware_url'] = array();
281 281
		$config['system']['alt_firmware_url']['enabled'] = "";
282
		$config['system']['alt_firmware_url']['firmware_base_url'] = $config['system']['firmwareurl'];
283
		$config['system']['alt_firmware_url']['firmware_filename'] = $config['system']['firmwarename'];
282
		$config['system']['alt_firmware_url']['firmware_base_url'] = config_get_path('system/firmwareurl');
283
		$config['system']['alt_firmware_url']['firmware_filename'] = config_get_path('system/firmwarename');
284 284
	}
285 285
	if (isset($config['system']['firmwareurl'])) {
286 286
		config_del_path('system/firmwareurl');
......
395 395
	global $config;
396 396
	/* shaper scheduler moved */
397 397
	if (isset($config['system']['schedulertype'])) {
398
		$config['shaper']['schedulertype'] = $config['system']['schedulertype'];
398
		$config['shaper']['schedulertype'] = config_get_path('system/schedulertype');
399 399
		config_del_path('system/schedulertype');
400 400
	}
401 401
}
......
404 404
function upgrade_021_to_022() {
405 405
	global $config;
406 406
	/* move gateway to wan interface */
407
	$config['interfaces']['wan']['gateway'] = $config['system']['gateway'];
407
	$config['interfaces']['wan']['gateway'] = config_get_path('system/gateway');
408 408
}
409 409

  
410 410
function upgrade_022_to_023() {
......
422 422

  
423 423
function upgrade_024_to_025() {
424 424
	global $config;
425
	$config['interfaces']['wan']['use_rrd_gateway'] = $config['system']['use_rrd_gateway'];
425
	$config['interfaces']['wan']['use_rrd_gateway'] = config_get_path('system/use_rrd_gateway');
426 426
	if (isset($config['system']['use_rrd_gateway'])) {
427 427
		config_del_path('system/use_rrd_gateway');
428 428
	}
......
1180 1180
			$config['ipsec']['client']['group_source'] = 'system';
1181 1181
		}
1182 1182

  
1183
		$mobilecfg = $config['ipsec']['mobileclients'];
1183
		$mobilecfg = config_get_path('ipsec/mobileclients');
1184 1184

  
1185 1185
		$ph1ent = array();
1186 1186
		$ph1ent['ikeid'] = ++$ikeid;
......
1320 1320
		if (isset($config['dyndns'][0]['host'])) {
1321 1321
			$tempdyn = array();
1322 1322
			$tempdyn['enable'] = isset($config['dyndns'][0]['enable']);
1323
			$tempdyn['type'] = $config['dyndns'][0]['type'];
1323
			$tempdyn['type'] = config_get_path('dyndns/0/type');
1324 1324
			$tempdyn['wildcard'] = isset($config['dyndns'][0]['wildcard']);
1325
			$tempdyn['username'] = $config['dyndns'][0]['username'];
1326
			$tempdyn['password'] = $config['dyndns'][0]['password'];
1327
			$tempdyn['host'] = $config['dyndns'][0]['host'];
1328
			$tempdyn['mx'] = $config['dyndns'][0]['mx'];
1325
			$tempdyn['username'] = config_get_path('dyndns/0/username');
1326
			$tempdyn['password'] = config_get_path('dyndns/0/password');
1327
			$tempdyn['host'] = config_get_path('dyndns/0/host');
1328
			$tempdyn['mx'] = config_get_path('dyndns/0/mx');
1329 1329
			$tempdyn['interface'] = "wan";
1330 1330
			$tempdyn['descr'] = sprintf(gettext("Upgraded Dyndns %s"), $tempdyn['type']);
1331 1331
			$config['dyndnses']['dyndns'][] = $tempdyn;
......
1333 1333
		config_del_path('dyndns');
1334 1334
	}
1335 1335
	if (!empty($config['dnsupdate'])) {
1336
		$pconfig = $config['dnsupdate'][0];
1336
		$pconfig = config_get_path('dnsupdate/0');
1337 1337
		if (!$pconfig['ttl']) {
1338 1338
			$pconfig['ttl'] = 60;
1339 1339
		}
......
1347 1347

  
1348 1348
	if (is_array($config['pppoe']) && is_array($config['pppoe'][0])) {
1349 1349
		$pconfig = array();
1350
		$pconfig['username'] = $config['pppoe'][0]['username'];
1351
		$pconfig['password'] = $config['pppoe'][0]['password'];
1352
		$pconfig['provider'] = $config['pppoe'][0]['provider'];
1350
		$pconfig['username'] = config_get_path('pppoe/0/username');
1351
		$pconfig['password'] = config_get_path('pppoe/0/password');
1352
		$pconfig['provider'] = config_get_path('pppoe/0/provider');
1353 1353
		$pconfig['ondemand'] = isset($config['pppoe'][0]['ondemand']);
1354
		$pconfig['timeout'] = $config['pppoe'][0]['timeout'];
1354
		$pconfig['timeout'] = config_get_path('pppoe/0/timeout');
1355 1355
		config_del_path('pppoe');
1356 1356
		$config['interfaces']['wan']['pppoe_username'] = $pconfig['username'];
1357 1357
		$config['interfaces']['wan']['pppoe_password'] = $pconfig['password'];
......
1361 1361
	}
1362 1362
	if (is_array($config['pptp'])) {
1363 1363
		$pconfig = array();
1364
		$pconfig['username'] = $config['pptp']['username'];
1365
		$pconfig['password'] = $config['pptp']['password'];
1366
		$pconfig['provider'] = $config['pptp']['provider'];
1364
		$pconfig['username'] = config_get_path('pptp/username');
1365
		$pconfig['password'] = config_get_path('pptp/password');
1366
		$pconfig['provider'] = config_get_path('pptp/provider');
1367 1367
		$pconfig['ondemand'] = isset($config['pptp']['ondemand']);
1368
		$pconfig['timeout'] = $config['pptp']['timeout'];
1368
		$pconfig['timeout'] = config_get_path('pptp/timeout');
1369 1369
		config_del_path('pptp');
1370 1370
		$config['interfaces']['wan']['pptp_username'] = $pconfig['username'];
1371 1371
		$config['interfaces']['wan']['pptp_password'] = $pconfig['password'];
......
1950 1950
		$cert = array();
1951 1951
		$cert['refid'] = uniqid();
1952 1952
		$cert['descr'] = "webConfigurator SSL/TLS Certificate";
1953
		$cert['crt'] = $config['system']['webgui']['certificate'];
1954
		$cert['prv'] = $config['system']['webgui']['private-key'];
1953
		$cert['crt'] = config_get_path('system/webgui/certificate');
1954
		$cert['prv'] = config_get_path('system/webgui/private-key');
1955 1955
		$config['cert'][] = $cert;
1956 1956

  
1957 1957
		config_del_path('system/webgui/certificate');
......
1962 1962
	/* migrate advanced admin page ssh keys to user manager */
1963 1963
	if ($config['system']['ssh']['authorizedkeys']) {
1964 1964
		$admin_user =& getUserEntryByUID(0);
1965
		$admin_user['authorizedkeys'] = $config['system']['ssh']['authorizedkeys'];
1965
		$admin_user['authorizedkeys'] = config_get_path('system/ssh/authorizedkeys');
1966 1966
		config_del_path('system/ssh/authorizedkeys');
1967 1967
	}
1968 1968
}
......
1971 1971
function upgrade_053_to_054() {
1972 1972
	global $config;
1973 1973
	if (is_array($config['load_balancer']['lbpool'])) {
1974
		$lbpool_arr = $config['load_balancer']['lbpool'];
1974
		$lbpool_arr = config_get_path('load_balancer/lbpool');
1975 1975
		$lbpool_srv_arr = array();
1976 1976
		$gateway_group_arr = array();
1977 1977
		$gateways = return_gateways_array();
......
2539 2539
function upgrade_066_to_067() {
2540 2540
	global $config;
2541 2541
	if (isset($config['system']['ca'])) {
2542
		$config['ca'] = $config['system']['ca'];
2542
		$config['ca'] = config_get_path('system/ca');
2543 2543
		config_del_path('system/ca');
2544 2544
	}
2545 2545
	if (isset($config['system']['cert'])) {
2546
		$config['cert'] = $config['system']['cert'];
2546
		$config['cert'] = config_get_path('system/cert');
2547 2547
		config_del_path('system/cert');
2548 2548
	}
2549 2549
}
......
2554 2554
	if (!empty($config['pppoe'])) {
2555 2555
		$config['pppoes'] = array();
2556 2556
		$config['pppoes']['pppoe'] = array();
2557
		$config['pppoes']['pppoe'][] = $config['pppoe'][0];
2557
		$config['pppoes']['pppoe'][] = config_get_path('pppoe/0');
2558 2558

  
2559 2559
		if (is_array($config['pppoe']['user'])) {
2560 2560
			$username = array();
......
2724 2724
	    !is_array($config['pptpd']['radius']['server'])) {
2725 2725
		$radarr = array();
2726 2726
		$radsvr = array();
2727
		$radsvr['ip'] = $config['pptpd']['radius']['server'];
2728
		$radsvr['secret'] = $config['pptpd']['radius']['secret'];
2727
		$radsvr['ip'] = config_get_path('pptpd/radius/server');
2728
		$radsvr['secret'] = config_get_path('pptpd/radius/secret');
2729 2729
		$radsvr['port'] = 1812;
2730 2730
		$radsvr['acctport'] = 1813;
2731 2731
		$radsvr['enable'] = isset($config['pptpd']['radius']['enable']);
......
2752 2752
	/* Upgrade config in 1.2.3 specifying a username other than admin for syncing. */
2753 2753
	if (!empty($config['system']['username']) && is_array($config['installedpackages']['carpsettings']) &&
2754 2754
	    is_array($config['installedpackages']['carpsettings']['config'])) {
2755
		$config['installedpackages']['carpsettings']['config'][0]['username'] = $config['system']['username'];
2755
		$config['installedpackages']['carpsettings']['config'][0]['username'] = config_get_path('system/username');
2756 2756
		config_del_path('system/username');
2757 2757
	}
2758 2758
}
......
2936 2936

  
2937 2937
	/* Upgrade captiveportal config */
2938 2938
	if (!empty($config['captiveportal'])) {
2939
		$tmpcp = $config['captiveportal'];
2939
		$tmpcp = config_get_path('captiveportal');
2940 2940
		$config['captiveportal'] = array();
2941 2941
		$config['captiveportal']['cpzone'] = array();
2942 2942
		$config['captiveportal']['cpzone'] = $tmpcp;
......
2947 2947
		}
2948 2948
	}
2949 2949
	if (!empty($config['voucher'])) {
2950
		$tmpcp = $config['voucher'];
2950
		$tmpcp = config_get_path('voucher');
2951 2951
		$config['voucher'] = array();
2952 2952
		$config['voucher']['cpzone'] = array();
2953 2953
		$config['voucher']['cpzone'] = $tmpcp;
......
2960 2960
		if (!empty($config['installedpackages']) &&
2961 2961
		    !empty($config['installedpackages']['carpsettings']) &&
2962 2962
		    !empty($config['installedpackages']['carpsettings']['config'])) {
2963
			$config['hasync'] = $config['installedpackages']['carpsettings']['config'][0];
2963
			$config['hasync'] = config_get_path('installedpackages/carpsettings/config/0');
2964 2964
			config_del_path('installedpackages/carpsettings');
2965 2965
		}
2966 2966
		if (empty($config['installedpackages']['carpsettings']) && isset($config['installedpackages']['carpsettings'])) {
......
3213 3213
	global $config;
3214 3214

  
3215 3215
	if (isset($config['system']['powerd_mode'])) {
3216
		$config['system']['powerd_ac_mode'] = $config['system']['powerd_mode'];
3217
		$config['system']['powerd_battery_mode'] = $config['system']['powerd_mode'];
3216
		$config['system']['powerd_ac_mode'] = config_get_path('system/powerd_mode');
3217
		$config['system']['powerd_battery_mode'] = config_get_path('system/powerd_mode');
3218 3218
		config_del_path('system/powerd_mode');
3219 3219
	}
3220 3220
}
......
3368 3368
		$config['nat']['advancedoutbound']['mode'] = "automatic";
3369 3369
	}
3370 3370

  
3371
	$config['nat']['outbound'] = $config['nat']['advancedoutbound'];
3371
	$config['nat']['outbound'] = config_get_path('nat/advancedoutbound');
3372 3372

  
3373 3373
	if (isset($config['nat']['ipsecpassthru'])) {
3374 3374
		config_del_path('nat/ipsecpassthru');
......
3551 3551
		return;
3552 3552
	}
3553 3553

  
3554
	$pkg = $config['installedpackages']['unbound']['config'][0];
3554
	$pkg = config_get_path('installedpackages/unbound/config/0');
3555 3555

  
3556 3556
	if (isset($config['installedpackages']['unboundadvanced']['config'][0])) {
3557 3557
		$pkg = array_merge($pkg, $config['installedpackages']['unboundadvanced']['config'][0]);
......
6310 6310
function upgrade_211_to_212() {
6311 6311
	global $config;
6312 6312
	if (isset($config['unbound']['sslport'])) {
6313
		$config['unbound']['tlsport'] = $config['unbound']['sslport'];
6313
		$config['unbound']['tlsport'] = config_get_path('unbound/sslport');
6314 6314
		config_del_path('unbound/sslport');
6315 6315
	}
6316 6316
}
src/etc/inc/voucher.inc
39 39
		$syncip = $config['captiveportal'][$cpzone]['backwardsyncip'];
40 40
		$username = $config['captiveportal'][$cpzone]['backwardsyncuser'];
41 41
		$password = $config['captiveportal'][$cpzone]['backwardsyncpassword'];
42
		$port = $config['system']['webgui']['port'];
42
		$port = config_get_path('system/webgui/port');
43 43
		if (empty($port)) { // if port is empty lets rely on the protocol selection
44 44
			if ($config['system']['webgui']['protocol'] == "http") {
45 45
				$port = "80";
......
57 57
		return false;
58 58
	}
59 59

  
60
	$syncip = $config['hasync']['synchronizetoip'];
61
	$password = $config['hasync']['password'];
60
	$syncip = config_get_path('hasync/synchronizetoip');
61
	$password = config_get_path('hasync/password');
62 62
	if (empty($config['hasync']['username'])) {
63 63
		$username = "admin";
64 64
	} else {
65
		$username = $config['hasync']['username'];
65
		$username = config_get_path('hasync/username');
66 66
	}
67 67

  
68 68
	/* if port is empty lets rely on the protocol selection */
69
	$port = $config['system']['webgui']['port'];
69
	$port = config_get_path('system/webgui/port');
70 70
	if (empty($port)) {
71 71
		if ($config['system']['webgui']['protocol'] == "http") {
72 72
			$port = "80";
src/etc/inc/wizard_utils.inc
137 137
		$tmp['ptpid'] = "0";
138 138
		$tmp['type'] = $type;
139 139
		$tmp['if'] = $type . "0";
140
		$tmp['ports'] = $config['interfaces']['wan']['if'];
140
		$tmp['ports'] = config_get_path('interfaces/wan/if');
141 141
		$config['ppps']['ppp'][] = array_merge($tmp, $pppfg);
142 142
		unset($tmp);
143 143
		$config['interfaces']['wan']['if'] = $type."0";
src/etc/inc/xmlrpc_client.inc
28 28

  
29 29
	public function __construct() {
30 30
		global $config;
31
		$hasync = $config['hasync'];
31
		$hasync = config_get_path('hasync');
32 32

  
33 33
		if (empty($hasync['username'])) {
34 34
			$username = "admin";
......
36 36
			$username = $hasync['username'];
37 37
		}
38 38
		/* if port is empty lets rely on the protocol selection */
39
		$port = $config['system']['webgui']['port'];
39
		$port = config_get_path('system/webgui/port');
40 40
		if (empty($port)) {
41 41
			if ($config['system']['webgui']['protocol'] == "http") {
42 42
				$port = "80";
src/usr/local/pfSense/include/www/backup.inc
332 332
								/* Save current pkg repo to re-add on new config */
333 333
								unset($pkg_repo_conf_path);
334 334
								if (isset($config['system']['pkg_repo_conf_path'])) {
335
									$pkg_repo_conf_path = $config['system']['pkg_repo_conf_path'];
335
									$pkg_repo_conf_path = config_get_path('system/pkg_repo_conf_path');
336 336
								}
337 337

  
338 338
								/* this will be picked up by /index.php */
src/usr/local/pfSense/include/www/firewall_nat_out.inc
39 39
		$config['nat']['outbound']['mode'] = "automatic";
40 40
	}
41 41
	
42
	$mode = $config['nat']['outbound']['mode'];
42
	$mode = config_get_path('nat/outbound/mode');
43 43

  
44 44
	/* mutually exclusive settings - if user wants advanced NAT, we don't generate automatic rules */
45 45
	if ($post['mode'] == "advanced" && ($mode == "automatic" || $mode == "hybrid")) {
src/usr/local/pfSense/include/www/services_dnsmasq.inc
401 401
    global $config;
402 402

  
403 403
    init_config_arr(array('dnsmasq', 'domainoverrides'));
404
    $a_domainOverrides = $config['dnsmasq']['domainoverrides'];
404
    $a_domainOverrides = config_get_path('dnsmasq/domainoverrides');
405 405

  
406 406
    $pconfig = array();
407 407

  
src/usr/local/pfSense/include/www/system_advanced_admin.inc
49 49
	$pconfig['pagenamefirst'] = config_path_enabled('system/webgui', 'pagenamefirst');
50 50
	$pconfig['loginautocomplete'] = config_path_enabled('system/webgui', 'loginautocomplete');
51 51
	$pconfig['althostnames'] = config_get_path('system/webgui/althostnames');
52
	$pconfig['enableserial'] = $config['system']['enableserial'];
53
	$pconfig['serialspeed'] = $config['system']['serialspeed'];
54
	$pconfig['primaryconsole'] = $config['system']['primaryconsole'];
52
	$pconfig['enableserial'] = config_get_path('system/enableserial');
53
	$pconfig['serialspeed'] = config_get_path('system/serialspeed');
54
	$pconfig['primaryconsole'] = config_get_path('system/primaryconsole');
55 55
	$pconfig['enablesshd'] = config_get_path('system/ssh/enable');
56 56
	$pconfig['sshport'] = config_get_path('system/ssh/port');
57 57
	$pconfig['sshdkeyonly'] = config_get_path('system/ssh/sshdkeyonly');
......
330 330
				list($host) = explode(":", $_SERVER['HTTP_HOST']);
331 331
			}
332 332
			$prot = in_array($config['system']['webgui']['protocol'], $valid_webguiproto) ? $config['system']['webgui']['protocol'] : 'http' ;
333
			$port = $config['system']['webgui']['port'];
333
			$port = config_get_path('system/webgui/port');
334 334
			if ($port) {
335 335
				$url = "{$prot}://{$host}:{$port}/system_advanced_admin.php";
336 336
			} else {
src/usr/local/pfSense/include/www/system_advanced_firewall.inc
34 34

  
35 35
	$pconfig = array();
36 36

  
37
	$pconfig['adaptiveend'] = $config['system']['adaptiveend'];
38
	$pconfig['adaptivestart'] = $config['system']['adaptivestart'];
39
	$pconfig['aliasesresolveinterval'] = $config['system']['aliasesresolveinterval'];
40
	$pconfig['bogonsinterval'] = $config['system']['bogons']['interval'];
37
	$pconfig['adaptiveend'] = config_get_path('system/adaptiveend');
38
	$pconfig['adaptivestart'] = config_get_path('system/adaptivestart');
39
	$pconfig['aliasesresolveinterval'] = config_get_path('system/aliasesresolveinterval');
40
	$pconfig['bogonsinterval'] = config_get_path('system/bogons/interval');
41 41
	$pconfig['bypassstaticroutes'] = isset($config['filter']['bypassstaticroutes']);
42 42
	$pconfig['checkaliasesurlcert'] = isset($config['system']['checkaliasesurlcert']);
43
	$pconfig['disablefilter'] = $config['system']['disablefilter'];
44
	$pconfig['disablenatreflection'] = $config['system']['disablenatreflection'];
43
	$pconfig['disablefilter'] = config_get_path('system/disablefilter');
44
	$pconfig['disablenatreflection'] = config_get_path('system/disablenatreflection');
45 45
	$pconfig['disablenegate'] = isset($config['system']['disablenegate']);
46 46
	$pconfig['disablereplyto'] = isset($config['system']['disablereplyto']);
47 47
	$pconfig['disablescrub'] = isset($config['system']['disablescrub']);
48 48
	$pconfig['disablevpnrules'] = isset($config['system']['disablevpnrules']);
49
	$pconfig['enablebinatreflection'] = $config['system']['enablebinatreflection'];
50
	$pconfig['enablenatreflectionhelper'] = $config['system']['enablenatreflectionhelper'];
51
	$pconfig['enablenatreflectionpurenat'] = $config['system']['enablenatreflectionpurenat'];
52
	$pconfig['icmperrortimeout'] = $config['system']['icmperrortimeout'];
53
	$pconfig['icmpfirsttimeout'] = $config['system']['icmpfirsttimeout'];
54
	$pconfig['maximumfrags'] = $config['system']['maximumfrags'];
55
	$pconfig['maximumstates'] = $config['system']['maximumstates'];
56
	$pconfig['maximumtableentries'] = $config['system']['maximumtableentries'];
49
	$pconfig['enablebinatreflection'] = config_get_path('system/enablebinatreflection');
50
	$pconfig['enablenatreflectionhelper'] = config_get_path('system/enablenatreflectionhelper');
51
	$pconfig['enablenatreflectionpurenat'] = config_get_path('system/enablenatreflectionpurenat');
52
	$pconfig['icmperrortimeout'] = config_get_path('system/icmperrortimeout');
53
	$pconfig['icmpfirsttimeout'] = config_get_path('system/icmpfirsttimeout');
54
	$pconfig['maximumfrags'] = config_get_path('system/maximumfrags');
55
	$pconfig['maximumstates'] = config_get_path('system/maximumstates');
56
	$pconfig['maximumtableentries'] = config_get_path('system/maximumtableentries');
57 57
	$pconfig['no_apipa_block'] = isset($config['system']['no_apipa_block']);
58
	$pconfig['optimization'] = $config['system']['optimization'];
59
	$pconfig['otherfirsttimeout'] = $config['system']['otherfirsttimeout'];
60
	$pconfig['othermultipletimeout'] = $config['system']['othermultipletimeout'];
61
	$pconfig['othersingletimeout'] = $config['system']['othersingletimeout'];
62
	$pconfig['reflectiontimeout'] = $config['system']['reflectiontimeout'];
63
	$pconfig['scrubnodf'] = $config['system']['scrubnodf'];
64
	$pconfig['scrubrnid'] = $config['system']['scrubrnid'];
65
	$pconfig['tcpclosedtimeout'] = $config['system']['tcpclosedtimeout'];
66
	$pconfig['tcpclosingtimeout'] = $config['system']['tcpclosingtimeout'];
67
	$pconfig['tcpestablishedtimeout'] = $config['system']['tcpestablishedtimeout'];
68
	$pconfig['tcpfinwaittimeout'] = $config['system']['tcpfinwaittimeout'];
69
	$pconfig['tcpfirsttimeout'] = $config['system']['tcpfirsttimeout'];
70
	$pconfig['tcpopeningtimeout'] = $config['system']['tcpopeningtimeout'];
71
	$pconfig['tcptsdifftimeout'] = $config['system']['tcptsdifftimeout'];
58
	$pconfig['optimization'] = config_get_path('system/optimization');
59
	$pconfig['otherfirsttimeout'] = config_get_path('system/otherfirsttimeout');
60
	$pconfig['othermultipletimeout'] = config_get_path('system/othermultipletimeout');
61
	$pconfig['othersingletimeout'] = config_get_path('system/othersingletimeout');
62
	$pconfig['reflectiontimeout'] = config_get_path('system/reflectiontimeout');
63
	$pconfig['scrubnodf'] = config_get_path('system/scrubnodf');
64
	$pconfig['scrubrnid'] = config_get_path('system/scrubrnid');
65
	$pconfig['tcpclosedtimeout'] = config_get_path('system/tcpclosedtimeout');
66
	$pconfig['tcpclosingtimeout'] = config_get_path('system/tcpclosingtimeout');
67
	$pconfig['tcpestablishedtimeout'] = config_get_path('system/tcpestablishedtimeout');
68
	$pconfig['tcpfinwaittimeout'] = config_get_path('system/tcpfinwaittimeout');
69
	$pconfig['tcpfirsttimeout'] = config_get_path('system/tcpfirsttimeout');
70
	$pconfig['tcpopeningtimeout'] = config_get_path('system/tcpopeningtimeout');
71
	$pconfig['tcptsdifftimeout'] = config_get_path('system/tcptsdifftimeout');
72 72
	$pconfig['tftpinterface'] = explode(",", $config['system']['tftpinterface']);
73
	$pconfig['udpfirsttimeout'] = $config['system']['udpfirsttimeout'];
74
	$pconfig['udpmultipletimeout'] = $config['system']['udpmultipletimeout'];
75
	$pconfig['udpsingletimeout'] = $config['system']['udpsingletimeout'];
73
	$pconfig['udpfirsttimeout'] = config_get_path('system/udpfirsttimeout');
74
	$pconfig['udpmultipletimeout'] = config_get_path('system/udpmultipletimeout');
75
	$pconfig['udpsingletimeout'] = config_get_path('system/udpsingletimeout');
76 76
	$pconfig['vpn_scrubnodf'] = isset($config['system']['vpn_scrubnodf']);
77 77
	$pconfig['vpn_fragment_reassemble'] = isset($config['system']['vpn_fragment_reassemble']);
78 78
	$pconfig['maxmss_enable'] = isset($config['system']['maxmss_enable']);
79
	$pconfig['maxmss'] = $config['system']['maxmss'];
79
	$pconfig['maxmss'] = config_get_path('system/maxmss');
80 80

  
81 81
	return $json ? json_encode($pconfig) : $pconfig;
82 82
}
src/usr/local/pfSense/include/www/system_advanced_misc.inc
48 48
		$pconfig['available_kernel_memory'] += (int) trim(exec("/bin/df -k /tmp /var | /usr/bin/awk '/\/dev\/md/ {sum += \$2 * 1024} END {print sum}'"));
49 49
	}
50 50

  
51
	$pconfig['proxyurl'] = $config['system']['proxyurl'];
52
	$pconfig['proxyport'] = $config['system']['proxyport'];
53
	$pconfig['proxyuser'] = $config['system']['proxyuser'];
54
	$pconfig['proxypass'] = $config['system']['proxypass'];
55
	$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
51
	$pconfig['proxyurl'] = config_get_path('system/proxyurl');
52
	$pconfig['proxyport'] = config_get_path('system/proxyport');
53
	$pconfig['proxyuser'] = config_get_path('system/proxyuser');
54
	$pconfig['proxypass'] = config_get_path('system/proxypass');
55
	$pconfig['harddiskstandby'] = config_get_path('system/harddiskstandby');
56 56
	$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
57
	$pconfig['srctrack'] = $config['system']['srctrack'];
57
	$pconfig['srctrack'] = config_get_path('system/srctrack');
58 58
	$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
59
	$pconfig['crypto_hardware'] = $config['system']['crypto_hardware'];
60
	$pconfig['thermal_hardware'] = $config['system']['thermal_hardware'];
59
	$pconfig['crypto_hardware'] = config_get_path('system/crypto_hardware');
60
	$pconfig['thermal_hardware'] = config_get_path('system/thermal_hardware');
61 61
	$pconfig['pti_disabled'] = isset($config['system']['pti_disabled']);
62
	$pconfig['mds_disable'] = $config['system']['mds_disable'];
62
	$pconfig['mds_disable'] = config_get_path('system/mds_disable');
63 63
	$pconfig['schedule_states'] = isset($config['system']['schedule_states']);
64
	$pconfig['gw_down_kill_states'] = $config['system']['gw_down_kill_states'];
64
	$pconfig['gw_down_kill_states'] = config_get_path('system/gw_down_kill_states');
65 65
	$pconfig['skip_rules_gw_down'] = isset($config['system']['skip_rules_gw_down']);
66 66
	$pconfig['dpinger_dont_add_static_routes'] = isset($config['system']['dpinger_dont_add_static_routes']);
67 67
	$pconfig['use_mfs_tmpvar'] = isset($config['system']['use_mfs_tmpvar']);
68
	$pconfig['use_mfs_tmp_size'] = $config['system']['use_mfs_tmp_size'];
69
	$pconfig['use_mfs_var_size'] = $config['system']['use_mfs_var_size'];
68
	$pconfig['use_mfs_tmp_size'] = config_get_path('system/use_mfs_tmp_size');
69
	$pconfig['use_mfs_var_size'] = config_get_path('system/use_mfs_var_size');
70 70
	$pconfig['do_not_send_uniqueid'] = isset($config['system']['do_not_send_uniqueid']);
71 71
	$pconfig['pti'] = get_single_sysctl('vm.pmap.pti');
72 72
	$pconfig['mds']= get_single_sysctl('hw.mds_disable_state');
73 73

  
74 74
	$pconfig['powerd_ac_mode'] = "hadp";
75 75
	if (!empty($config['system']['powerd_ac_mode'])) {
76
		$pconfig['powerd_ac_mode'] = $config['system']['powerd_ac_mode'];
76
		$pconfig['powerd_ac_mode'] = config_get_path('system/powerd_ac_mode');
77 77
	}
78 78

  
79 79
	$pconfig['powerd_battery_mode'] = "hadp";
80 80
	if (!empty($config['system']['powerd_battery_mode'])) {
81
		$pconfig['powerd_battery_mode'] = $config['system']['powerd_battery_mode'];
81
		$pconfig['powerd_battery_mode'] = config_get_path('system/powerd_battery_mode');
82 82
	}
83 83

  
84 84
	$pconfig['powerd_normal_mode'] = "hadp";
85 85
	if (!empty($config['system']['powerd_normal_mode'])) {
86
		$pconfig['powerd_normal_mode'] = $config['system']['powerd_normal_mode'];
86
		$pconfig['powerd_normal_mode'] = config_get_path('system/powerd_normal_mode');
87 87
	}
88 88

  
89 89
	return $json ? json_encode($pconfig) : $pconfig;
src/usr/local/pfSense/include/www/system_advanced_notifications.inc
46 46
    	$nconfig['revoked_cert_ignore_notify'] = ($config['notifications']['certexpire']['ignore_revoked'] == "enabled");
47 47

  
48 48
	if ($config['notifications']['certexpire']['expiredays']) {
49
		$nconfig['certexpiredays'] = $config['notifications']['certexpire']['expiredays'];
49
		$nconfig['certexpiredays'] = config_get_path('notifications/certexpire/expiredays');
50 50
	}
51 51

  
52 52
	// SMTP
53 53
	$nconfig['disable_smtp'] = isset($config['notifications']['smtp']['disable']);
54 54

  
55 55
	if ($config['notifications']['smtp']['ipaddress']) {
56
		$nconfig['smtpipaddress'] = $config['notifications']['smtp']['ipaddress'];
56
		$nconfig['smtpipaddress'] = config_get_path('notifications/smtp/ipaddress');
57 57
	}
58 58

  
59 59
	if ($config['notifications']['smtp']['port']) {
60
		$nconfig['smtpport'] = $config['notifications']['smtp']['port'];
60
		$nconfig['smtpport'] = config_get_path('notifications/smtp/port');
61 61
	}
62 62

  
63 63
	$nconfig['smtpssl'] = isset($config['notifications']['smtp']['ssl']);
......
65 65
	$nconfig['sslvalidate'] = ($config['notifications']['smtp']['sslvalidate'] != "disabled");
66 66

  
67 67
	if (!empty($config['notifications']['smtp']['timeout'])) {
68
		$nconfig['smtptimeout'] = $config['notifications']['smtp']['timeout'];
68
		$nconfig['smtptimeout'] = config_get_path('notifications/smtp/timeout');
69 69
	}
70 70

  
71 71
	if ($config['notifications']['smtp']['notifyemailaddress']) {
72
		$nconfig['smtpnotifyemailaddress'] = $config['notifications']['smtp']['notifyemailaddress'];
72
		$nconfig['smtpnotifyemailaddress'] = config_get_path('notifications/smtp/notifyemailaddress');
73 73
	}
74 74

  
75 75
	if ($config['notifications']['smtp']['username']) {
76
		$nconfig['smtpusername'] = $config['notifications']['smtp']['username'];
76
		$nconfig['smtpusername'] = config_get_path('notifications/smtp/username');
77 77
	}
78 78

  
79 79
	if ($config['notifications']['smtp']['password']) {
80
		$nconfig['smtppassword'] = $config['notifications']['smtp']['password'];
80
		$nconfig['smtppassword'] = config_get_path('notifications/smtp/password');
81 81
	}
82 82

  
83 83
	if ($config['notifications']['smtp']['authentication_mechanism']) {
84
		$nconfig['smtpauthmech'] = $config['notifications']['smtp']['authentication_mechanism'];
84
		$nconfig['smtpauthmech'] = config_get_path('notifications/smtp/authentication_mechanism');
85 85
	}
86 86

  
87 87
	if ($config['notifications']['smtp']['fromaddress']) {
88
		$nconfig['smtpfromaddress'] = $config['notifications']['smtp']['fromaddress'];
88
		$nconfig['smtpfromaddress'] = config_get_path('notifications/smtp/fromaddress');
89 89
	}
90 90

  
91 91
	// System Sounds
......
95 95
	$nconfig['enable_telegram'] = isset($config['notifications']['telegram']['enabled']);
96 96

  
97 97
	if ($config['notifications']['telegram']['api']) {
98
		$nconfig['api'] = $config['notifications']['telegram']['api'];
98
		$nconfig['api'] = config_get_path('notifications/telegram/api');
99 99
	}
100 100

  
101 101
	if ($config['notifications']['telegram']['chatid']) {
102
		$nconfig['chatid'] = $config['notifications']['telegram']['chatid'];
102
		$nconfig['chatid'] = config_get_path('notifications/telegram/chatid');
103 103
	}
104 104
	// Pushover
105 105
	$nconfig['enable_pushover'] = isset($config['notifications']['pushover']['enabled']);
106 106

  
107 107
	if ($config['notifications']['pushover']['apikey']) {
108
		$nconfig['pushoverapikey'] = $config['notifications']['pushover']['apikey'];
108
		$nconfig['pushoverapikey'] = config_get_path('notifications/pushover/apikey');
109 109
	}
110 110

  
111 111
	if ($config['notifications']['pushover']['userkey']) {
112
		$nconfig['pushoveruserkey'] = $config['notifications']['pushover']['userkey'];
112
		$nconfig['pushoveruserkey'] = config_get_path('notifications/pushover/userkey');
113 113
	}
114 114

  
115 115
	if ($config['notifications']['pushover']['sound']) {
116
		$nconfig['pushoversound'] = $config['notifications']['pushover']['sound'];
116
		$nconfig['pushoversound'] = config_get_path('notifications/pushover/sound');
117 117
	}
118 118

  
119 119
	if ($config['notifications']['pushover']['priority']) {
120
		$nconfig['pushoverpriority'] = $config['notifications']['pushover']['priority'];
120
		$nconfig['pushoverpriority'] = config_get_path('notifications/pushover/priority');
121 121
	}
122 122

  
123 123
	$nconfig['pushoverretry'] = ($config['notifications']['pushover']['retry']) ? $config['notifications']['pushover']['retry'] : 60;
......
126 126
	$nconfig['enable_slack'] = isset($config['notifications']['slack']['enabled']);
127 127

  
128 128
	if ($config['notifications']['slack']['api']) {
129
		$nconfig['slack_api'] = $config['notifications']['slack']['api'];
129
		$nconfig['slack_api'] = config_get_path('notifications/slack/api');
130 130
	}
131 131

  
132 132
	if ($config['notifications']['slack']['channel']) {
133
		$nconfig['slack_channel'] = $config['notifications']['slack']['channel'];
133
		$nconfig['slack_channel'] = config_get_path('notifications/slack/channel');
134 134
	}
135 135

  
136 136
	return $json? json_encode($nconfig):$nconfig;
src/usr/local/pkg/miniupnpd.inc
157 157
		global $g, $config;
158 158
		global $input_errors;
159 159

  
160
		$upnp_config = $config['installedpackages']['miniupnpd']['config'][0];
160
		$upnp_config = config_get_path('installedpackages/miniupnpd/config/0');
161 161
		$config_file = '/var/etc/miniupnpd.conf';
162 162

  
163 163
		if (!isset($upnp_config['ext_iface']) || empty($upnp_config['ext_iface'])) {
src/usr/local/www/diag_authentication.php
62 62
	}
63 63
} else {
64 64
	if (isset($config['system']['webgui']['authmode'])) {
65
		$pconfig['authmode'] = $config['system']['webgui']['authmode'];
65
		$pconfig['authmode'] = config_get_path('system/webgui/authmode');
66 66
	} else {
67 67
		$pconfig['authmode'] = "Local Database";
68 68
	}
src/usr/local/www/diag_confbak.php
40 40
	if (!$input_errors) {
41 41
		if (is_numericint($_POST['backupcount'])) {
42 42
			$config['system']['backupcount'] = $_POST['backupcount'];
43
			$changedescr = $config['system']['backupcount'];
43
			$changedescr = config_get_path('system/backupcount');
44 44
		} elseif (empty($_POST['backupcount'])) {
45 45
			config_del_path('system/backupcount');
46 46
			$changedescr = gettext("(platform default)");
......
79 79
	$oldtime = $_REQUEST['oldtime'];
80 80
	if ($_REQUEST['newtime'] == 'current') {
81 81
		$newfile = $g['conf_path'] . '/config.xml';
82
		$newtime = $config['revision']['time'];
82
		$newtime = config_get_path('revision/time');
83 83
	} else {
84 84
		$newfile = $g['conf_path'] . '/backup/config-' . $_REQUEST['newtime'] . '.xml';
85 85
		$newtime = $_REQUEST['newtime'];
src/usr/local/www/graph.php
50 50

  
51 51
/********* Other conf *******/
52 52
if (isset($config["widgets"]["trafficgraphs"]["scale_type"])) {
53
	$scale_type = $config["widgets"]["trafficgraphs"]["scale_type"];
53
	$scale_type = config_get_path('widgets/trafficgraphs/scale_type');
54 54
} else {
55 55
	$scale_type = "up";
56 56
}
src/usr/local/www/interfaces_ppps.php
75 75
	$config['ppps']['ppp'] = array();
76 76
}
77 77

  
78
$a_ppps = $config['ppps']['ppp'];
78
$a_ppps = config_get_path('ppps/ppp');
79 79

  
80 80
$pgtitle = array(gettext("Interfaces"), gettext("PPPs"));
81 81
$shortcut_section = "interfaces";
src/usr/local/www/pkg_edit.php
437 437
	global $config;
438 438
	// fixup #1: $myurl -> http[s]://ip_address:port/
439 439
	$https = "";
440
	$port = $config['system']['webguiport'];
440
	$port = config_get_path('system/webguiport');
441 441
	if ($port != "443" and $port != "80") {
442 442
		$urlport = ":" . $port;
443 443
	} else {
......
455 455
	$newstring = str_replace("\$wanip", $curwanip, $string);
456 456
	$string = $newstring;
457 457
	// fixup #3: $lanip
458
	$lancfg = $config['interfaces']['lan'];
458
	$lancfg = config_get_path('interfaces/lan');
459 459
	$lanip = $lancfg['ipaddr'];
460 460
	$newstring = str_replace("\$lanip", $lanip, $string);
461 461
	$string = $newstring;
src/usr/local/www/services_acb.php
36 36
$exp_sep = '||';
37 37

  
38 38
// Encryption password
39
$decrypt_password = $config['system']['acb']['encryption_password'];
39
$decrypt_password = config_get_path('system/acb/encryption_password');
40 40

  
41 41
// Defined username. Username must be sent lowercase. See Redmine #7127 and Netgate Redmine #163
42 42
$username = strtolower($config['system']['acb']['gold_username']);
43
$password = $config['system']['acb']['gold_password'];
43
$password = config_get_path('system/acb/gold_password');
44 44

  
45 45
// Set hostname
46 46
if ($_REQUEST['hostname']) {
src/usr/local/www/services_acb_settings.php
38 38
require_once("services.inc");
39 39
require_once("acb.inc");
40 40

  
41
$pconfig = $config['system']['acb'];
41
$pconfig = config_get_path('system/acb');
42 42

  
43 43
if (isset($_POST['save'])) {
44 44
	unset($input_errors);
src/usr/local/www/services_captiveportal_hasync.php
95 95
		$newcp['backwardsyncip'] = $pconfig['backwardsyncip'];
96 96
		$newcp['backwardsyncuser'] = $pconfig['backwardsyncuser'];
97 97

  
98
		$port = $config['system']['webgui']['port'];
98
		$port = config_get_path('system/webgui/port');
99 99
		if (empty($port)) { // if port is empty lets rely on the protocol selection
100 100
			if ($config['system']['webgui']['protocol'] == "http") {
101 101
				$port = "80";
src/usr/local/www/services_dhcpv6.php
186 186
 */
187 187

  
188 188
$dhcrelay_enabled = false;
189
$dhcrelaycfg = $config['dhcrelay6'];
189
$dhcrelaycfg = config_get_path('dhcrelay6');
190 190

  
191 191
if (is_array($dhcrelaycfg) && isset($dhcrelaycfg['enable']) && isset($dhcrelaycfg['interface']) && !empty($dhcrelaycfg['interface'])) {
192 192
	$dhcrelayifs = explode(",", $dhcrelaycfg['interface']);
src/usr/local/www/services_ntpd_acls.php
40 40
}
41 41

  
42 42
if (is_array($config['ntpd']['restrictions']) && is_array($config['ntpd']['restrictions']['row'])) {
43
	$networkacl = $config['ntpd']['restrictions']['row'];
43
	$networkacl = config_get_path('ntpd/restrictions/row');
44 44
} else {
45 45
	$networkacl = array('0' => array('acl_network' => '', 'mask' => ''));
46 46
}
src/usr/local/www/services_ntpd_gps.php
52 52
	$config['ntpd']['gps']['type'] = 'Default';
53 53
	/* copy an existing configured GPS port if it exists, the unset may be uncommented post production */
54 54
	if (!empty($config['ntpd']['gpsport']) && empty($config['ntpd']['gps']['port'])) {
55
		$config['ntpd']['gps']['port'] = $config['ntpd']['gpsport'];
55
		$config['ntpd']['gps']['port'] = config_get_path('ntpd/gpsport');
56 56
		config_del_path('ntpd/gpsport'); /* this removes the original port config from config.xml */
57 57
		$config['ntpd']['gps']['speed'] = 0;
58 58
		$config['ntpd']['gps']['nmea'] = 0;
src/usr/local/www/services_snmp.php
53 53
}
54 54

  
55 55
$pconfig['enable'] = isset($config['snmpd']['enable']);
56
$pconfig['pollport'] = $config['snmpd']['pollport'];
57
$pconfig['syslocation'] = $config['snmpd']['syslocation'];
58
$pconfig['syscontact'] = $config['snmpd']['syscontact'];
59
$pconfig['rocommunity'] = $config['snmpd']['rocommunity'];
56
$pconfig['pollport'] = config_get_path('snmpd/pollport');
57
$pconfig['syslocation'] = config_get_path('snmpd/syslocation');
58
$pconfig['syscontact'] = config_get_path('snmpd/syscontact');
59
$pconfig['rocommunity'] = config_get_path('snmpd/rocommunity');
60 60
/* disabled until some docs show up on what this does.
61 61
$pconfig['rwenable'] = isset($config['snmpd']['rwenable']);
62 62
$pconfig['rwcommunity'] = $config['snmpd']['rwcommunity'];
63 63
*/
64 64
$pconfig['trapenable'] = isset($config['snmpd']['trapenable']);
65
$pconfig['trapserver'] = $config['snmpd']['trapserver'];
66
$pconfig['trapserverport'] = $config['snmpd']['trapserverport'];
67
$pconfig['trapstring'] = $config['snmpd']['trapstring'];
65
$pconfig['trapserver'] = config_get_path('snmpd/trapserver');
66
$pconfig['trapserverport'] = config_get_path('snmpd/trapserverport');
67
$pconfig['trapstring'] = config_get_path('snmpd/trapstring');
68 68

  
69 69
$pconfig['mibii'] = isset($config['snmpd']['modules']['mibii']);
70 70
$pconfig['netgraph'] = isset($config['snmpd']['modules']['netgraph']);
......
74 74
$pconfig['ucd'] = isset($config['snmpd']['modules']['ucd']);
75 75
$pconfig['regex'] = isset($config['snmpd']['modules']['regex']);
76 76

  
77
$pconfig['ipprotocol'] = $config['snmpd']['ipprotocol'];
77
$pconfig['ipprotocol'] = config_get_path('snmpd/ipprotocol');
78 78
if (empty($config['snmpd']['bindip'])) {
79 79
	$pconfig['bindip'] = array();
80 80
} else {
src/usr/local/www/services_unbound_advanced.php
82 82
	$pconfig['aggressivensec'] = true;
83 83
}
84 84

  
85
$pconfig['msgcachesize'] = $config['unbound']['msgcachesize'];
85
$pconfig['msgcachesize'] = config_get_path('unbound/msgcachesize');
86 86
$pconfig['outgoing_num_tcp'] = isset($config['unbound']['outgoing_num_tcp']) ? $config['unbound']['outgoing_num_tcp'] : '10';
87 87
$pconfig['incoming_num_tcp'] = isset($config['unbound']['incoming_num_tcp']) ? $config['unbound']['incoming_num_tcp'] : '10';
88 88
$pconfig['edns_buffer_size'] = isset($config['unbound']['edns_buffer_size']) ? $config['unbound']['edns_buffer_size'] : 'auto';
89
$pconfig['num_queries_per_thread'] = $config['unbound']['num_queries_per_thread'];
89
$pconfig['num_queries_per_thread'] = config_get_path('unbound/num_queries_per_thread');
90 90
$pconfig['jostle_timeout'] = isset($config['unbound']['jostle_timeout']) ? $config['unbound']['jostle_timeout'] : '200';
91 91
$pconfig['cache_max_ttl'] = isset($config['unbound']['cache_max_ttl']) ? $config['unbound']['cache_max_ttl'] : '86400';
92 92
$pconfig['cache_min_ttl'] = isset($config['unbound']['cache_min_ttl']) ? $config['unbound']['cache_min_ttl'] : '0';
src/usr/local/www/status_dhcpv6_leases.php
101 101

  
102 102
	$dhcpv6leaseinlocaltime = "no";
103 103
	if (is_array($config['dhcpdv6'])) {
104
		$dhcpdv6 = $config['dhcpdv6'];
104
		$dhcpdv6 = config_get_path('dhcpdv6');
105 105
		foreach ($dhcpdv6 as $dhcpdv6params) {
106 106
			$dhcpv6leaseinlocaltime = $dhcpdv6params['dhcpv6leaseinlocaltime'];
107 107
			if ($dhcpv6leaseinlocaltime == "yes") {
src/usr/local/www/status_logs_packages.php
86 86
require_once("status_logs_common.inc");
87 87

  
88 88
global $g;
89
if (!($nentries = $config['syslog']['nentries'])) {
89
if (!($nentries = config_get_path('syslog/nentries'))) {
90 90
	$nentries = $g['default_log_entries'];
91 91
}
92 92

  
src/usr/local/www/status_logs_settings.php
41 41
global $g, $system_log_compression_types, $syslog_formats;
42 42

  
43 43
$pconfig['reverse'] = isset($config['syslog']['reverse']);
44
$pconfig['nentries'] = $config['syslog']['nentries'];
45
$pconfig['remoteserver'] = $config['syslog']['remoteserver'];
46
$pconfig['remoteserver2'] = $config['syslog']['remoteserver2'];
47
$pconfig['remoteserver3'] = $config['syslog']['remoteserver3'];
48
$pconfig['sourceip'] = $config['syslog']['sourceip'];
49
$pconfig['ipproto'] = $config['syslog']['ipproto'];
44
$pconfig['nentries'] = config_get_path('syslog/nentries');
45
$pconfig['remoteserver'] = config_get_path('syslog/remoteserver');
46
$pconfig['remoteserver2'] = config_get_path('syslog/remoteserver2');
47
$pconfig['remoteserver3'] = config_get_path('syslog/remoteserver3');
48
$pconfig['sourceip'] = config_get_path('syslog/sourceip');
49
$pconfig['ipproto'] = config_get_path('syslog/ipproto');
50 50
$pconfig['filter'] = isset($config['syslog']['filter']);
51 51
$pconfig['dhcp'] = isset($config['syslog']['dhcp']);
52 52
$pconfig['auth'] = isset($config['syslog']['auth']);
......
67 67
$pconfig['logprivatenets'] = !isset($config['syslog']['nologprivatenets']);
68 68
$pconfig['lognginx'] = !isset($config['syslog']['nolognginx']);
69 69
$pconfig['rawfilter'] = isset($config['syslog']['rawfilter']);
70
$pconfig['filterdescriptions'] = $config['syslog']['filterdescriptions'];
70
$pconfig['filterdescriptions'] = config_get_path('syslog/filterdescriptions');
71 71
$pconfig['disablelocallogging'] = isset($config['syslog']['disablelocallogging']);
72 72
$pconfig['logconfigchanges'] = ($config['syslog']['logconfigchanges'] != "disabled");
73
$pconfig['logfilesize'] = $config['syslog']['logfilesize'];
73
$pconfig['logfilesize'] = config_get_path('syslog/logfilesize');
74 74
$pconfig['logcompressiontype'] = system_log_get_compression();
75
$pconfig['rotatecount'] = $config['syslog']['rotatecount'];
76
$pconfig['format'] = $config['syslog']['format'];
75
$pconfig['rotatecount'] = config_get_path('syslog/rotatecount');
76
$pconfig['format'] = config_get_path('syslog/format');
77 77

  
78 78
if (!$pconfig['nentries']) {
79 79
	$pconfig['nentries'] = $g['default_log_entries'];
......
140 140
		init_config_arr(array('syslog'));
141 141
		$config['syslog']['reverse'] = $_POST['reverse'] ? true : false;
142 142
		$config['syslog']['nentries'] = (int)$_POST['nentries'];
143
		$pconfig['nentries'] = $config['syslog']['nentries'];
143
		$pconfig['nentries'] = config_get_path('syslog/nentries');
144 144
		if (isset($_POST['logfilesize']) && (strlen($_POST['logfilesize']) > 0)) {
145 145
			$config['syslog']['logfilesize'] = (int)$_POST['logfilesize'];
146
			$pconfig['logfilesize'] = $config['syslog']['logfilesize'];
146
			$pconfig['logfilesize'] = config_get_path('syslog/logfilesize');
147 147
		} else {
148 148
			config_del_path('syslog/logfilesize');
149 149
		}
src/usr/local/www/system_update_settings.php
102 102
	$savemsg = gettext("Changes have been saved successfully");
103 103
}
104 104

  
105
$curcfg = $config['system']['firmware'];
106
$gitcfg = $config['system']['gitsync'];
105
$curcfg = config_get_path('system/firmware');
106
$gitcfg = config_get_path('system/gitsync');
107 107

  
108 108
$pgtitle = array(gettext("System"), gettext("Update"), gettext("Update Settings"));
109 109
$pglinks = array("", "pkg_mgr_install.php?id=firmware", "@self");
src/usr/local/www/system_usermanager_settings.php
98 98
	}
99 99
}
100 100

  
101
$pconfig['session_timeout'] = $config['system']['webgui']['session_timeout'];
101
$pconfig['session_timeout'] = config_get_path('system/webgui/session_timeout');
102 102

  
103 103
if (isset($config['system']['webgui']['authmode'])) {
104
	$pconfig['authmode'] = $config['system']['webgui']['authmode'];
104
	$pconfig['authmode'] = config_get_path('system/webgui/authmode');
105 105
} else {
106 106
	$pconfig['authmode'] = "Local Database";
107 107
}
......
113 113

  
114 114
$pconfig['shellauth'] = isset($config['system']['webgui']['shellauth']) ? true : false;
115 115

  
116
$pconfig['backend'] = $config['system']['webgui']['backend'];
116
$pconfig['backend'] = config_get_path('system/webgui/backend');
117 117

  
118
$pconfig['auth_refresh_time'] = $config['system']['webgui']['auth_refresh_time'];
118
$pconfig['auth_refresh_time'] = config_get_path('system/webgui/auth_refresh_time');
119 119

  
120 120
// Page title for main admin
121 121
$pgtitle = array(gettext("System"), gettext("User Manager"), gettext("Settings"));
src/usr/local/www/vpn_ipsec_settings.php
49 49
$pconfig['pkcs11support'] = isset($config['ipsec']['pkcs11support']);
50 50
$pconfig['enableinterfacesuse'] = isset($config['ipsec']['enableinterfacesuse']);
51 51
$pconfig['acceptunencryptedmainmode'] = isset($config['ipsec']['acceptunencryptedmainmode']);
52
$pconfig['maxexchange'] = $config['ipsec']['maxexchange'];
53
$pconfig['uniqueids'] = $config['ipsec']['uniqueids'];
54
$pconfig['filtermode'] = $config['ipsec']['filtermode'];
55
$pconfig['dns-interval'] = $config['ipsec']['dns-interval'];
56
$pconfig['ikev2_retransmit_tries'] = $config['ipsec']['ikev2_retransmit_tries'];
57
$pconfig['ikev2_retransmit_timeout'] = $config['ipsec']['ikev2_retransmit_timeout'];
58
$pconfig['ikev2_retransmit_base'] = $config['ipsec']['ikev2_retransmit_base'];
59
$pconfig['ikev2_retransmit_jitter'] = $config['ipsec']['ikev2_retransmit_jitter'];
60
$pconfig['ikev2_retransmit_limit'] = $config['ipsec']['ikev2_retransmit_limit'];
52
$pconfig['maxexchange'] = config_get_path('ipsec/maxexchange');
53
$pconfig['uniqueids'] = config_get_path('ipsec/uniqueids');
54
$pconfig['filtermode'] = config_get_path('ipsec/filtermode');
55
$pconfig['dns-interval'] = config_get_path('ipsec/dns-interval');
56
$pconfig['ikev2_retransmit_tries'] = config_get_path('ipsec/ikev2_retransmit_tries');
57
$pconfig['ikev2_retransmit_timeout'] = config_get_path('ipsec/ikev2_retransmit_timeout');
58
$pconfig['ikev2_retransmit_base'] = config_get_path('ipsec/ikev2_retransmit_base');
59
$pconfig['ikev2_retransmit_jitter'] = config_get_path('ipsec/ikev2_retransmit_jitter');
60
$pconfig['ikev2_retransmit_limit'] = config_get_path('ipsec/ikev2_retransmit_limit');
61 61
$pconfig['ipsecbypass'] = isset($config['ipsec']['ipsecbypass']);
62
$pconfig['bypassrules'] = $config['ipsec']['bypassrules'];
63
$pconfig['port'] = $config['ipsec']['port'];
64
$pconfig['port_nat_t'] = $config['ipsec']['port_nat_t'];
62
$pconfig['bypassrules'] = config_get_path('ipsec/bypassrules');
63
$pconfig['port'] = config_get_path('ipsec/port');
64
$pconfig['port_nat_t'] = config_get_path('ipsec/port_nat_t');
65 65

  
66 66
if ($pconfig['ikev2_retransmit_tries'] || $pconfig['ikev2_retransmit_timeout'] ||
67 67
    $pconfig['ikev2_retransmit_base'] || $pconfig['ikev2_retransmit_jitter'] ||
......
285 285
				$needsrestart = true;
286 286
			}
287 287
			$config['ipsec']['maxexchange'] = (int)$_POST['maxexchange'];
288
			$pconfig['maxexchange'] = $config['ipsec']['maxexchange'];
288
			$pconfig['maxexchange'] = config_get_path('ipsec/maxexchange');
289 289
		} elseif (isset($config['ipsec']['maxexchange'])) {
290 290
			$needsrestart = true;
291 291
			config_del_path('ipsec/maxexchange');
......
296 296
				$needsfilterdnsrestart = true;
297 297
			}
298 298
			$config['ipsec']['dns-interval'] = (int)$_POST['dns-interval'];
299
			$pconfig['dns-interval'] = $config['ipsec']['dns-interval'];
299
			$pconfig['dns-interval'] = config_get_path('ipsec/dns-interval');
300 300
		} elseif (isset($config['ipsec']['dns-interval'])) {
301 301
			$needsfilterdnsrestart = true;
302 302
			config_del_path('ipsec/dns-interval');
......
397 397
}
398 398

  
399 399
if (isset($config['ipsec']['async_crypto'])) {
400
	$pconfig['async_crypto'] = $config['ipsec']['async_crypto'];
400
	$pconfig['async_crypto'] = config_get_path('ipsec/async_crypto');
401 401
} else {
402 402
	$pconfig['async_crypto'] = "disabled";
403 403
}
src/usr/local/www/widgets/widgets/dyn_dns_status.widget.php
47 47
}
48 48

  
49 49
init_config_arr(array('dyndnses', 'dyndns'));
50
$a_dyndns = $config['dyndnses']['dyndns'];
50
$a_dyndns = config_get_path('dyndnses/dyndns');
51 51

  
52 52
init_config_arr(array('dnsupdates', 'dnsupdate'));
53
$a_rfc2136 = $config['dnsupdates']['dnsupdate'];
53
$a_rfc2136 = config_get_path('dnsupdates/dnsupdate');
54 54

  
55 55
$all_dyndns = array_merge($a_dyndns, $a_rfc2136);
56 56

  
src/usr/local/www/widgets/widgets/ntp_status.widget.php
127 127
	}
128 128

  
129 129
	if (isset($gps_ok) && isset($config['ntpd']['gps']['extstatus']) && ($config['ntpd']['gps']['nmeaset']['gpgsv'] || $config['ntpd']['gps']['nmeaset']['gpgga'])) {
130
		$lookfor['GPGSV'] = $config['ntpd']['gps']['nmeaset']['gpgsv'];
130
		$lookfor['GPGSV'] = config_get_path('ntpd/gps/nmeaset/gpgsv');
131 131
		$lookfor['GPGGA'] = !isset($gps_sat) && $config['ntpd']['gps']['nmeaset']['gpgga'];
132 132
		$gpsport = fopen('/dev/gps0', 'r+');
133 133
		while ($gpsport && ($lookfor['GPGSV'] || $lookfor['GPGGA'])) {
src/usr/local/www/widgets/widgets/wake_on_lan.widget.php
27 27
require_once("/usr/local/www/widgets/include/wake_on_lan.inc");
28 28

  
29 29
if (isset($config['wol']['wolentry']) && is_array($config['wol']['wolentry'])) {
30
	$wolcomputers = $config['wol']['wolentry'];
30
	$wolcomputers = config_get_path('wol/wolentry');
31 31
} else {
32 32
	$wolcomputers = array();
33 33
}
src/usr/local/www/wizards/openvpn_wizard.inc
267 267
function step9_stepbeforeformdisplay() {
268 268
	global $config, $pkg, $stepid;
269 269

  
270
	$pconfig = $config['ovpnserver'];
270
	$pconfig = config_get_path('ovpnserver');
271 271

  
272 272
	if (isset($pconfig['step6']['uselist'])) {
273 273
		$country = $pconfig['step6']['country'];
......
469 469
function step12_submitphpaction() {
470 470
	global $config;
471 471

  
472
	$pconfig = $config['ovpnserver'];
472
	$pconfig = config_get_path('ovpnserver');
473 473

  
474 474
	if (!is_array($config['ovpnserver'])) {
475 475
		$message = "No configuration found, please try again.";

Also available in: Unified diff