Project

General

Profile

« Previous | Next » 

Revision ecbaa35f

Added by Reid Linnemann almost 3 years ago

Replace all direct accesses to $config in authgui.inc. #13446

View differences:

src/etc/inc/authgui.inc
25 25
 */
26 26

  
27 27
include_once("auth.inc");
28
include_once("config.inc");
29
include_once("config.lib.inc");
28 30
include_once("priv.inc");
29 31
if (!function_exists('platform_booting')) {
30 32
	require_once('globals.inc');
......
103 105
 * determine if the user is allowed access to the requested page
104 106
 */
105 107
function display_error_form($http_code, $desc) {
106
	global $config, $user_settings, $g;
108
	global $user_settings, $g;
107 109

  
108 110
	if (isAjax()) {
109 111
		printf(gettext('Error: %1$s Description: %2$s'), $http_code, $desc);
......
170 172

  
171 173
function display_login_form() {
172 174
	require_once("globals.inc");
173
	global $config, $g;
175
	global $g;
174 176

  
175 177
	unset($input_errors);
176 178

  
......
265 267
		$logincssfile = "#" . $user_settings['webgui']['logincss'];
266 268
	}
267 269

  
268
	if (isset($config['system']['webgui']['loginshowhost'])) {
269
		$loginbannerstr = sprintf(gettext('%1$s.%2$s'), htmlspecialchars($config['system']['hostname']), htmlspecialchars($config['system']['domain']));
270
		$login_title = gettext(htmlspecialchars($config['system']['hostname'] . " - Login"));
270
	if (config_path_enabled('system/webgui','loginshowhost')) {
271
		$loginbannerstr = sprintf(gettext('%1$s.%2$s'),
272
								  htmlspecialchars(config_get_path('system/hostname', "")),
273
								  htmlspecialchars(config_get_path('system/domain', "")));
274
		$login_title = gettext(htmlspecialchars(config_get_path('system/hostname', "") . " - Login"));
271 275
	} else {
272 276
		$loginbannerstr = sprintf(gettext('Login to %1$s'), $g['product_label']);
273 277
		$login_title = sprintf(gettext("%s - Login"), $g['product_label']);
274 278
	}
275 279

  
276
	$loginautocomplete = isset($config['system']['webgui']['loginautocomplete']) ? '' : 'autocomplete="off"';
280
	$loginautocomplete = config_path_enabled('system/webgui','loginautocomplete') ? '' : 'autocomplete="off"';
277 281

  
278
	if (is_ipaddr($http_host) && !$local_ip && !isset($config['system']['webgui']['nohttpreferercheck'])) {
282
	if (is_ipaddr($http_host) && !$local_ip &&
283
		!config_path_enabled('system/webgui','nohttpreferercheck')) {
279 284
		$warnclass = "pagebodywarn";	// Make room for a warning display row
280 285
	} else {
281 286
		$warnclass = "pagebody";
......
393 398
		events.push(function() {
394 399
			document.cookie=
395 400
				"cookie_test=1" +
396
				"<?php echo $config['system']['webgui']['protocol'] == 'https' ? '; secure' : '';?>";
401
				"<?php echo config_get_path('system/webgui/protocol') == 'https' ? '; secure' : '';?>";
397 402

  
398 403
			if (document.cookie.indexOf("cookie_test") == -1) {
399 404
				alert("<?=gettext('The browser must support cookies to login.')?>");

Also available in: Unified diff