X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fsession.inc;h=0e7d31138d0d35d32eb9e774fad08fcddc5584fe;hb=b1c79afd0a78ec37ff813f1305e9e0804be78ef3;hp=026ad125a321fcd3ecf40392aa8b4c3cb4803038;hpb=463ab9029b1efa51c96aca12aa8537d262fe6f82;p=fa-stable.git diff --git a/includes/session.inc b/includes/session.inc index 026ad125..0e7d3113 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -9,13 +9,21 @@ | by Joe Hunt Consulting | \--------------------------------------------------*/ - function output_html($text) + function output_html($text) { - global $before_box; + global $before_box, $Ajax, $messages; + // Fatal errors are not send to error_handler, + // so we must check the output + if ($text && preg_match('/\bFatal error(<.*?>)?:(.*)/i', $text, $m)) { + $Ajax->aCommands = array(); // Don't update page via ajax on errors + $text = preg_replace('/\bFatal error(<.*?>)?:(.*)/i','', $text); + $messages[] = array(E_ERROR, $m[2], null, null); + } + $Ajax->run(); return in_ajax() ? fmt_errors() : ($before_box.fmt_errors().$text); } - if (!isset($path_to_root)) + if (!isset($path_to_root)) { $path_to_root = "."; } @@ -48,7 +56,7 @@ //---------------------------------------------------------------------------------------- - function kill_login() + function kill_login() { session_unset(); session_destroy(); @@ -56,7 +64,7 @@ //---------------------------------------------------------------------------------------- - function login_fail() + function login_fail() { echo "


" . _("Incorrect Password") . "

"; echo "" . _("The user and password combination is not valid for the system.") . "

"; @@ -71,9 +79,9 @@ //---------------------------------------------------------------------------------------- - function check_page_security($page_security) + function check_page_security($page_security) { - if (!$_SESSION["wa_current_user"]->check_user_access()) + if (!$_SESSION["wa_current_user"]->check_user_access()) { echo "


"; echo "" . _("Security settings have not been defined for your user account."); @@ -83,14 +91,13 @@ exit; } - if (!$_SESSION["wa_current_user"]->can_access_page($page_security)) + if (!$_SESSION["wa_current_user"]->can_access_page($page_security)) { page(_("Access denied")); echo "



"; echo _("The security settings on your account do not permit you to access this function"); echo ""; - echo "

" . _("Back") . ""; - echo "



"; + echo "



"; //echo '