Project

General

Profile

Download (23.1 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
 * authgui.inc
4
 *
5
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2003-2006 Manuel Kasper <mk@neon1.net>
7
 * Copyright (c) 2005-2006 Bill Marquette <bill.marquette@gmail.com>
8
 * Copyright (c) 2006 Paul Taylor <paultaylor@winn-dixie.com>
9
 * Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
10
 * All rights reserved.
11
 *
12
 * Licensed under the Apache License, Version 2.0 (the "License");
13
 * you may not use this file except in compliance with the License.
14
 * You may obtain a copy of the License at
15
 *
16
 * http://www.apache.org/licenses/LICENSE-2.0
17
 *
18
 * Unless required by applicable law or agreed to in writing, software
19
 * distributed under the License is distributed on an "AS IS" BASIS,
20
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
 * See the License for the specific language governing permissions and
22
 * limitations under the License.
23
 */
24

    
25
include_once("auth.inc");
26
include_once("priv.inc");
27
if (!function_exists('platform_booting')) {
28
	require_once('globals.inc');
29
}
30
require_once('pfsense-utils.inc');
31

    
32
/* Authenticate user - exit if failed */
33
if (!session_auth()) {
34
	display_login_form();
35
	exit;
36
}
37

    
38
phpsession_begin();
39

    
40
/*
41
 * Once here, the user has authenticated with the web server.
42
 * We give them access only to the appropriate pages based on
43
 * the user or group privileges.
44
 */
45
$allowedpages = getAllowedPages($_SESSION['Username'], $_SESSION['user_radius_attributes']);
46

    
47
/*
48
 * Get user-based preference settings so they can be easily referenced.
49
 */
50
$user_settings = get_user_settings($_SESSION['Username']);
51

    
52
/*
53
 * redirect to first allowed page if requesting a wrong url
54
 */
55

    
56
/* Fix this up otherwise the privilege check will fail. See Redmine #5909. */
57
if ($_SERVER['REQUEST_URI'] == "/") {
58
	$_SERVER['REQUEST_URI'] = "/index.php";
59
}
60

    
61
if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
62
	if (count($allowedpages) > 0) {
63
		$page = str_replace('*', '', $allowedpages[0]);
64
		$_SESSION['Post_Login'] = true;
65
		require_once("functions.inc");
66
		pfSenseHeader("/{$page}");
67

    
68
		$username = empty($_SESSION["Username"]) ? "(system)" : $_SESSION['Username'];
69
		if (!empty($_SERVER['REMOTE_ADDR'])) {
70
			$username .= '@' . $_SERVER['REMOTE_ADDR'];
71
		}
72
		log_error("{$username} attempted to access {$_SERVER['SCRIPT_NAME']} but does not have access to that page. Redirecting to {$page}.");
73

    
74
		exit;
75
	} else {
76
		display_error_form("201", gettext("No page assigned to this user! Click here to logout."));
77
		exit;
78
	}
79
} else {
80
	$_SESSION['Post_Login'] = true;
81
}
82

    
83
/*
84
 * redirect browsers post-login to avoid pages
85
 * taking action in response to a POST request
86
 */
87
if (!$_SESSION['Post_Login']) {
88
	$_SESSION['Post_Login'] = true;
89
	require_once("functions.inc");
90
	pfSenseHeader($_SERVER['REQUEST_URI']);
91
	exit;
92
}
93

    
94
/*
95
 * Close session data to allow other scripts from same host to come in.
96
 * A session can be reactivated from calling phpsession_begin again
97
 */
98
phpsession_end(true);
99

    
100
/*
101
 * determine if the user is allowed access to the requested page
102
 */
103
function display_error_form($http_code, $desc) {
104
	global $config, $user_settings, $g;
105

    
106
	if (isAjax()) {
107
		printf(gettext('Error: %1$s Description: %2$s'), $http_code, $desc);
108
		return;
109
	}
110

    
111
	$logincssfile = "#770101";
112
?>
113

    
114
<!DOCTYPE html>
115
<html lang="en">
116
	<head>
117
		<meta name="viewport" content="width=device-width, initial-scale=1">
118
	    <link rel="stylesheet" href="/vendor/bootstrap/css/bootstrap.min.css" type="text/css">
119
	    <link rel="stylesheet" href="/css/login.css" type="text/css">
120
		<title><?=gettext("Error"); ?></title>
121
	</head>
122

    
123
	<body id="error" >
124
		<div id="total">
125
			<header>
126
				<div id="headerrow">
127
					<div class="row">
128
						<div class="col-sm-4">
129
							<div id="logodiv" style="text-align:center" class="nowarning">
130
								<svg role="img" aria-labelledby="pfsense-logo" x="0px" y="0px" viewBox="0 0 282.8 84.2" width="240" height="100%">
131
									<title id="pfsense-logo-svg">pfSense Logo</title>
132
									<style type="text/css">
133
										.logo-st0{fill:#2B40B5;}
134
										.logo-st1{fill:#1475CF;}
135
										.logo-st2{fill:#1C1275;}
136
									</style>
137
									<path class="logo-st0" d="M27.8,57.7c2.9,0,5.4-0.9,7.5-2.6c2.1-1.7,3.6-4,4.4-6.8c0.8-2.8,0.6-5.1-0.5-6.8c-1.1-1.7-3.2-2.6-6.1-2.6 c-2.9,0-5.4,0.9-7.5,2.6c-2.1,1.7-3.5,4-4.3,6.8c-0.8,2.8-0.7,5.1,0.5,6.8C22.8,56.9,24.8,57.7,27.8,57.7"/>
138
									<path class="logo-st0" d="M115.1,46.6c-1.5-0.8-3-1.4-4.7-1.8c-1.7-0.4-3.2-0.7-4.7-1.1c-1.5-0.3-2.7-0.7-3.6-1.1c-0.9-0.4-1.4-1.1-1.4-2 c0-1.1,0.5-1.9,1.4-2.4c0.9-0.5,1.9-0.7,2.8-0.7c2.8,0,5,1,6.7,3.1l7-7c-1.7-1.8-3.9-3.1-6.4-3.8c-2.5-0.7-5-1.1-7.4-1.1 c-1.9,0-3.9,0.2-5.7,0.7c-1.9,0.5-3.6,1.2-5,2.3c-1.5,1-2.6,2.3-3.5,3.9c-0.9,1.6-1.3,3.5-1.3,5.7c0,2.3,0.5,4.2,1.4,5.6 c0.9,1.4,2.1,2.5,3.6,3.3c1.5,0.8,3,1.3,4.7,1.7c1.7,0.4,3.2,0.7,4.7,1.1c1.5,0.3,2.7,0.7,3.6,1.2c0.9,0.5,1.4,1.2,1.4,2.2 c0,1-0.5,1.7-1.6,2.1c-1.1,0.4-2.3,0.6-3.6,0.6c-1.7,0-3.3-0.3-4.6-1c-1.3-0.7-2.5-1.7-3.6-3l-7,7.7c1.8,1.9,4.1,3.2,6.7,3.9 c2.7,0.7,5.3,1.1,7.9,1.1c2,0,4-0.2,6.1-0.6c2-0.4,3.9-1,5.5-2c1.6-0.9,3-2.2,4-3.8c1-1.6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,0.3-1.2,0.5-1.8,0.5c-0.6,0-1.2-0.2-1.8-0.5c-0.6-0.3-1-0.8-1.3-1.3c-0.3-0.6-0.5-1.2-0.5-1.8c0-0.6,0.2-1.2,0.5-1.8 c0.3-0.6,0.8-1,1.3-1.3C277.4,65.2,278,65.1,278.6,65.1z"/>
146
								</svg>
147
							</div>
148
						</div>
149
						<div class="col-sm-8 nowarning msgbox text-center">
150
							<span id="hostspan">
151
							</span>
152
						</div>
153
					</div>
154
				</div>
155
			</header>
156

    
157
			<div style="background: <?=$logincssfile?>;" class="pagebody">
158
				<div class="col-sm-2"></div>
159

    
160
				<div class="col-sm-8 offset-md-4 logoCol">
161
					<div class="loginCont center-block error-panel">
162
						<a href="index.php?logout"><?=$desc;?></a>
163
					</div>
164
				</div>
165

    
166
			<div class="col-sm-2"></div>
167
			</div>
168

    
169
			<footer id="3">
170
			<div id="footertext">
171
					<p class="text-muted">
172
						<a target="_blank" href="https://www.pfsense.org/?gui=bootstrap">pfSense</a> is &copy;
173
						2004 - 2017 by <a href="https://pfsense.org/license" class="tblnk">Rubicon Communications, LLC (Netgate)</a>. All Rights Reserved.
174
						[<a href="/license.php" class="tblnk">view license</a>]
175
					</p>
176
				</div>
177
			</footer>
178
		</div>
179
	</body>
180
</html>
181

    
182
<?php
183

    
184
} // end function
185

    
186

    
187
function display_login_form() {
188
	require_once("globals.inc");
189
	global $config, $g;
190

    
191
	unset($input_errors);
192

    
193
	if (isAjax()) {
194
		if (isset($_POST['login'])) {
195
			if ($_SESSION['Logged_In'] <> "True") {
196
				isset($_SESSION['Login_Error']) ? $login_error = $_SESSION['Login_Error'] : $login_error = gettext("unknown reason");
197
				printf("showajaxmessage('" . gettext("Invalid login (%s).") . "')", $login_error);
198
			}
199
			if (file_exists("{$g['tmp_path']}/webconfigurator.lock")) {
200
				// TODO: add the IP from the user who did lock the device
201
				$whom = file_get_contents("{$g['tmp_path']}/webconfigurator.lock");
202
				printf("showajaxmessage('" . gettext("This device is currently being maintained by: %s.") . "');", $whom);
203
			}
204
		}
205
		exit;
206
	}
207

    
208
	/* Check against locally configured IP addresses, which will catch when someone
209
	   port forwards WebGUI access from WAN to an internal IP on the router. */
210
	global $FilterIflist, $nifty_background;
211

    
212
	$local_ip = false;
213

    
214
	if (strpos($_SERVER['HTTP_HOST'], ":") === FALSE) {
215
		$http_host_port = explode(":", $_SERVER['HTTP_HOST']);
216
		$http_host = $http_host_port[0];
217
	} else {
218
		$http_host = $_SERVER['HTTP_HOST'];
219
	}
220

    
221
	if (empty($FilterIflist)) {
222
		require_once('filter.inc');
223
		require_once('shaper.inc');
224
		filter_generate_optcfg_array();
225
	}
226

    
227
	foreach ($FilterIflist as $iflist) {
228
		if ($iflist['ip'] == $http_host) {
229
			$local_ip = true;
230
		} else if ($iflist['ipv6'] == $http_host) {
231
			$local_ip = true;
232
		} else if (is_array($iflist['vips'])) {
233
			foreach ($iflist['vips'] as $vip) {
234
				if ($vip['ip'] == $http_host) {
235
					$local_ip = true;
236
					break;
237
				}
238
			}
239

    
240
			unset($vip);
241
		}
242

    
243
		if ($local_ip == true) {
244
			break;
245
		}
246
	}
247

    
248
	unset($FilterIflist);
249
	unset($iflist);
250

    
251
	if ($local_ip == false) {
252
		if (is_array($config['openvpn']['openvpn-server'])) {
253
			foreach ($config['openvpn']['openvpn-server'] as $ovpns) {
254
				if (is_ipaddrv4($http_host) && !empty($ovpns['tunnel_network']) && ip_in_subnet($http_host, $ovpns['tunnel_network'])) {
255
					$local_ip = true;
256
				} else if (is_ipaddrv6($http_host) && !empty($ovpns['tunnel_networkv6']) && ip_in_subnet($http_host, $ovpns['tunnel_networkv6'])) {
257
					$local_ip = true;
258
				}
259

    
260
				if ($local_ip == true) {
261
					break;
262
				}
263
			}
264
		}
265
	}
266

    
267
	// For the login form, get the settings of no particular user.
268
	// That ensures we will use the system default theme for the login form.
269
	$user_settings = get_user_settings("");
270
	$cssfile = "/css/pfSense.css";
271

    
272
	if (isset($user_settings['webgui']['webguicss'])) {
273
		if (file_exists("/usr/local/www/css/" . $user_settings['webgui']['webguicss'])) {
274
			$cssfile = "/css/" . $user_settings['webgui']['webguicss'];
275
		}
276
	}
277

    
278
	$logincssfile = "#1e3f75";
279

    
280
	if (isset($user_settings['webgui']['logincss']) && strlen($user_settings['webgui']['logincss']) == 6) {
281
		$logincssfile = "#" . $user_settings['webgui']['logincss'];
282
	}
283

    
284
	if (isset($config['system']['webgui']['loginshowhost'])) {
285
		$loginbannerstr = sprintf(gettext('%1$s.%2$s'), htmlspecialchars($config['system']['hostname']), htmlspecialchars($config['system']['domain']));
286
	} else {
287
		$loginbannerstr = sprintf(gettext('Login to %1$s'), $g['product_name']);
288
	}
289

    
290
	$loginautocomplete = isset($config['system']['webgui']['loginautocomplete']) ? '' : 'autocomplete="off"';
291

    
292
	if (is_ipaddr($http_host) && !$local_ip && !isset($config['system']['webgui']['nohttpreferercheck'])) {
293
		$warnclass = "pagebodywarn";	// Make room for a warning display row
294
	} else {
295
		$warnclass = "pagebody";
296
	}
297
?>
298
<!DOCTYPE html>
299
<html lang="en">
300
	<head>
301
		<meta name="viewport" content="width=device-width, initial-scale=1">
302
	    <link rel="stylesheet" href="/vendor/bootstrap/css/bootstrap.min.css" type="text/css">
303
	    <link rel="stylesheet" href="/css/login.css" type="text/css">
304
		<title><?=gettext("Login"); ?></title>
305
		<script type="text/javascript">
306
			//<![CDATA{
307
			var events = events || [];
308
			//]]>
309
		</script>
310
	</head>
311

    
312
	<body id="login" >
313
		<div id="total">
314
			<header>
315
				<div id="headerrow">
316
					<div class="row">
317
						<!-- Header left logo box -->
318
						<div class="col-sm-4">
319
							<div id="logodiv" style="text-align:center" class="nowarning">
320
								<svg role="img" aria-labelledby="pfsense-logo" x="0px" y="0px" viewBox="0 0 282.8 84.2" width="240" height="100%">
321
									<title id="pfsense-logo-svg">pfSense Logo</title>
322
									<style type="text/css">
323
										.logo-st0{fill:#2B40B5;}
324
										.logo-st1{fill:#1475CF;}
325
										.logo-st2{fill:#1C1275;}
326
									</style>
327
									<path class="logo-st0" d="M27.8,57.7c2.9,0,5.4-0.9,7.5-2.6c2.1-1.7,3.6-4,4.4-6.8c0.8-2.8,0.6-5.1-0.5-6.8c-1.1-1.7-3.2-2.6-6.1-2.6 c-2.9,0-5.4,0.9-7.5,2.6c-2.1,1.7-3.5,4-4.3,6.8c-0.8,2.8-0.7,5.1,0.5,6.8C22.8,56.9,24.8,57.7,27.8,57.7"/>
328
									<path class="logo-st0" d="M115.1,46.6c-1.5-0.8-3-1.4-4.7-1.8c-1.7-0.4-3.2-0.7-4.7-1.1c-1.5-0.3-2.7-0.7-3.6-1.1c-0.9-0.4-1.4-1.1-1.4-2 c0-1.1,0.5-1.9,1.4-2.4c0.9-0.5,1.9-0.7,2.8-0.7c2.8,0,5,1,6.7,3.1l7-7c-1.7-1.8-3.9-3.1-6.4-3.8c-2.5-0.7-5-1.1-7.4-1.1 c-1.9,0-3.9,0.2-5.7,0.7c-1.9,0.5-3.6,1.2-5,2.3c-1.5,1-2.6,2.3-3.5,3.9c-0.9,1.6-1.3,3.5-1.3,5.7c0,2.3,0.5,4.2,1.4,5.6 c0.9,1.4,2.1,2.5,3.6,3.3c1.5,0.8,3,1.3,4.7,1.7c1.7,0.4,3.2,0.7,4.7,1.1c1.5,0.3,2.7,0.7,3.6,1.2c0.9,0.5,1.4,1.2,1.4,2.2 c0,1-0.5,1.7-1.6,2.1c-1.1,0.4-2.3,0.6-3.6,0.6c-1.7,0-3.3-0.3-4.6-1c-1.3-0.7-2.5-1.7-3.6-3l-7,7.7c1.8,1.9,4.1,3.2,6.7,3.9 c2.7,0.7,5.3,1.1,7.9,1.1c2,0,4-0.2,6.1-0.6c2-0.4,3.9-1,5.5-2c1.6-0.9,3-2.2,4-3.8c1-1.6,1.6-3.5,1.6-5.9c0-2.3-0.5-4.2-1.4-5.6 C117.7,48.6,116.5,47.4,115.1,46.6"/>
329
									<path class="logo-st0" d="M156.3,34.1c-1.5-1.7-3.3-3-5.5-3.9c-2.2-0.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6,0.8-1,1.3-1.3C277.4,65.2,278,65.1,278.6,65.1z"/>
336
								</svg>
337
							</div>
338
						</div>
339

    
340
						<!-- Header center message box -->
341
						<div class="col-sm-4 nowarning msgbox text-center text-danger">
342
<?php
343
						if (!empty($_POST['usernamefld'])) {
344
							print("<h4>" . $_SESSION['Login_Error'] . "</h4>");
345
						}
346
?>
347
						</div>
348

    
349
						<!-- Header right message box (hostname or msg)-->
350
						<div class="col-sm-4 nowarning msgbox text-center">
351
							<span id="hostspan">
352
								<a><h4><?=$loginbannerstr?></h4></a>
353
							</span>
354
						</div>
355
					</div>
356
<?php
357
	if ($warnclass == "pagebodywarn") {
358
?>
359
					<div class="row">
360
						<div class="col-sm-12">
361
							<div class="alert alert-warning <?=$warnclass?>">
362
								<?=gettext("The IP address being used to access this router is not configured locally, which may be forwarded by NAT or other means.
363
								If this forwarding is unexpected, it should be verified that a man-in-the-middle attack is not taking place.")?>
364
							</div>
365
						</div>
366
					</div>
367
<?php
368
	}
369
?>
370
	            </div>
371
	        </header>
372

    
373
	        <div style="background: <?=$logincssfile?>;" class="<?=$warnclass?>">
374
	        	<div class="col-sm-4"></div>
375

    
376
	        	<div class="col-sm-4 offset-md-4 logoCol">
377
					<div class="loginCont center-block">
378
		                <form method="post" <?=$loginautocomplete?> class="login">
379
			                <p class="form-title">Sign In</p>
380
			                <input name="usernamefld" id="usernamefld" type="text" placeholder="Username" autocorrect="off" autocapitalize="none"/>
381
			                <input name="passwordfld" id="passwordfld" type="password" placeholder="Password" />
382
			                <input type="submit" name="login" value="Sign In" class="btn btn-success btn-sm" />
383
		                </form>
384
					</div>
385
	            </div>
386

    
387
	        	<div class="col-sm-4"></div>
388
	        </div>
389

    
390
	        <footer id="3">
391
	            <div id="footertext">
392
					<p class="text-muted">
393
						<a target="_blank" href="https://www.pfsense.org/?gui=bootstrap">pfSense</a> is &copy;
394
						2004 - 2017 by <a href="https://pfsense.org/license" class="tblnk">Rubicon Communications, LLC (Netgate)</a>. All Rights Reserved.
395
						[<a href="/license.php" class="tblnk">view license</a>]
396
					</p>
397
	            </div>
398
	        </footer>
399
	    </div>
400

    
401
		<script src="/vendor/jquery/jquery-1.12.0.min.js?v=<?=filemtime('/usr/local/www/vendor/jquery/jquery-1.12.0.min.js')?>"></script>
402
		<script src="/vendor/bootstrap/js/bootstrap.min.js?v=<?=filemtime('/usr/local/www/vendor/bootstrap/js/bootstrap.min.js')?>"></script>
403
		<script src="/js/pfSense.js?v=<?=filemtime('/usr/local/www/js/pfSense.js')?>"></script>
404

    
405
		<script type="text/javascript">
406
		//!<[CDATA[
407
		events.push(function() {
408
			document.cookie=
409
				"cookie_test=1" +
410
				"<?php echo $config['system']['webgui']['protocol'] == 'https' ? '; secure' : '';?>";
411

    
412
			if (document.cookie.indexOf("cookie_test") == -1) {
413
				alert("<?=gettext('The browser must support cookies to login.')?>");
414
			}
415

    
416
			// Delete it
417
			document.cookie = "cookie_test=1; expires=Thu, 01-Jan-1970 00:00:01 GMT";
418
		});
419
		//]]>
420
		</script>
421

    
422
	</body>
423
</html>
424

    
425
<?php
426
} // end function
427

    
(4-4/54)