diff options
author | sullrich <sullrich@pfsense.org> | 2009-11-27 19:12:45 -0500 |
---|---|---|
committer | sullrich <sullrich@pfsense.org> | 2009-11-27 19:12:45 -0500 |
commit | 158d9aa6c04d71787e07415c592b3e5ea9a01360 (patch) | |
tree | d6038f95fff32b6d8e7b33c61473a69c1428af0a /etc | |
parent | b4bfd25dc6804c288cd8ea804e0f5844899498fa (diff) | |
download | pfsense-158d9aa6c04d71787e07415c592b3e5ea9a01360.zip pfsense-158d9aa6c04d71787e07415c592b3e5ea9a01360.tar.gz |
Show ajax properly
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/auth.inc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/etc/inc/auth.inc b/etc/inc/auth.inc index 1c75eb5..0b955b3 100644 --- a/etc/inc/auth.inc +++ b/etc/inc/auth.inc @@ -858,7 +858,7 @@ function is_account_disabled($username) { } function session_auth($backing) { - global $g, $debug, $HTTP_SERVER_VARS, $userindex, $config; + global $g, $debug, $HTTP_SERVER_VARS, $userindex, $config, $_SESSION; session_start(); @@ -868,12 +868,19 @@ function session_auth($backing) { $acct_expires = get_user_expiration_date($_POST['usernamefld']); if($acct_expires) { if (strtotime("-1 day") > strtotime(date("m/d/Y",strtotime($acct_expires)))) { - echo "showajaxmessage('{$_SESSION['Login_Error']}');"; - return; + log_error("Attempted login for invalid user '{$_POST['usernamefld']}' from: {$_SERVER['REMOTE_ADDR']}"); + if(isAjax()) { + echo "showajaxmessage('{$_SESSION['Login_Error']}');"; + return; + } } } else { if(is_account_disabled($_POST['usernamefld'])) { - echo "showajaxmessage('{$_SESSION['Login_Error']}');"; + log_error("Attempted login for invalid user '{$_POST['usernamefld']}' from: {$_SERVER['REMOTE_ADDR']}"); + if(isAjax()) { + echo "showajaxmessage('{$_SESSION['Login_Error']}');"; + return; + } } else { $_SESSION['Logged_In'] = "True"; $_SESSION['Username'] = $_POST['usernamefld']; |