Commit 1f8264ac authored by Franco Fichtner's avatar Franco Fichtner

inc: fix authgui indent and hard to read code by adding style

Currently debugging #86 but the file is impossible to read...
parent 708a2cab
......@@ -56,8 +56,9 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
pfSenseHeader("/{$page}");
$username = empty($_SESSION["Username"]) ? "(system)" : $_SESSION['Username'];
if (!empty($_SERVER['REMOTE_ADDR']))
if (!empty($_SERVER['REMOTE_ADDR'])) {
$username .= '@' . $_SERVER['REMOTE_ADDR'];
}
log_error("{$username} attempted to access {$_SERVER['SCRIPT_NAME']} but does not have access to that page. Redirecting to {$page}.");
exit;
......@@ -65,30 +66,32 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
display_error_form("201", gettext("No page assigned to this user! Click here to logout."));
exit;
}
} else
} else {
$_SESSION['Post_Login'] = true;
}
/*
/*
* redirect browsers post-login to avoid pages
* taking action in reponse to a POST request
*/
if (!$_SESSION['Post_Login']) {
if (!$_SESSION['Post_Login']) {
$_SESSION['Post_Login'] = true;
require_once("functions.inc");
pfSenseHeader($_SERVER['REQUEST_URI']);
exit;
}
}
/*
/*
* Close session data to allow other scripts from same host to come in.
* A session can be reactivated from calling session_start again
*/
session_commit();
session_commit();
/*
/*
* determine if the user is allowed access to the requested page
*/
function display_error_form($http_code, $desc) {
function display_error_form($http_code, $desc)
{
global $config, $g;
$g['theme'] = get_current_theme();
if(isAjax()) {
......@@ -96,12 +99,10 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
return;
}
?>
<!doctype html>
<!--[if IE 8 ]><html lang="en" class="ie ie8 lte9 lte8 no-js"><![endif]-->
<!--[if IE 9 ]><html lang="en" class="ie ie9 lte9 no-js"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en" class="no-js"><!--<![endif]-->
?><!doctype html>
<!--[if IE 8 ]><html lang="en" class="ie ie8 lte9 lte8 no-js"><![endif]-->
<!--[if IE 9 ]><html lang="en" class="ie ie9 lte9 no-js"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en" class="no-js"><!--<![endif]-->
<head>
<meta charset="UTF-8" />
......@@ -131,15 +132,12 @@ if (!isAllowedPage($_SERVER['REQUEST_URI'])) {
</p>
</div>
</body>
</html>
<?php
</html><?php
} // end function
function display_login_form() {
function display_login_form()
{
require_once("globals.inc");
global $config, $g;
$g['theme'] = get_current_theme();
......@@ -208,12 +206,10 @@ function display_login_form() {
setcookie("cookie_test", time() + 3600);
$have_cookies = isset($_COOKIE["cookie_test"]);
?>
<!doctype html>
<!--[if IE 8 ]><html lang="en" class="ie ie8 lte9 lte8 no-js"><![endif]-->
<!--[if IE 9 ]><html lang="en" class="ie ie9 lte9 no-js"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en" class="no-js"><!--<![endif]-->
?><!doctype html>
<!--[if IE 8 ]><html lang="en" class="ie ie8 lte9 lte8 no-js"><![endif]-->
<!--[if IE 9 ]><html lang="en" class="ie ie9 lte9 no-js"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--><html lang="en" class="no-js"><!--<![endif]-->
<head>
<meta charset="UTF-8" />
......@@ -301,10 +297,6 @@ function display_login_form() {
//]]>
</script>
</body>
</html>
</html><?php
<?php
} // end function
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment