From: Janusz Dobrowolski Date: Thu, 4 Feb 2010 20:45:35 +0000 (+0000) Subject: Fixed continuation after authorization timeout. X-Git-Tag: 2.3-final~990 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=7f42b5df097dd54ce0165bbc7ef53e26817ca4b8 Fixed continuation after authorization timeout. --- diff --git a/access/login.php b/access/login.php index efdd276d..210d61d4 100644 --- a/access/login.php +++ b/access/login.php @@ -51,21 +51,22 @@ function set_fullmode() { echo "\n"; echo "$title\n"; echo "\n"; - echo " \n"; - echo $js2; + echo " \n"; if (!$login_timeout) { echo $js; } + echo $js2; echo "\n"; - echo "\n"; + echo "\n"; echo "
$title
\n"; + div_start('_page_body'); br();br(); start_form(false, false, $_SESSION['timeout']['uri'], "loginform"); - start_table($table_style2); + start_table("class='login' $table_style2"); start_row(); echo ""; if (!$login_timeout) { // FA logo @@ -103,8 +104,8 @@ function set_fullmode() { end_row(); }; end_table(1); - echo "
\n"; - end_form(1); + echo "
\n"; foreach($_SESSION['timeout']['post'] as $p => $val) { // add all request variables to be resend together with login data @@ -112,6 +113,7 @@ function set_fullmode() { 'password', 'SubmitUser', 'company_login_name'))) echo ""; } + end_form(1); echo ""; + div_end(); echo "\n"; echo ""; if (isset($_SESSION['wa_current_user'])) diff --git a/includes/main.inc b/includes/main.inc index 138ae369..0a63e397 100644 --- a/includes/main.inc +++ b/includes/main.inc @@ -50,11 +50,14 @@ function page($title, $no_menu=false, $is_index=false, $onload="", $js="", $scri function end_page($no_menu=false, $is_index=false, $hide_back_link=false) { - global $path_to_root, $Ajax; - $hide_menu = $no_menu; - div_end(); // _page_body section - include($path_to_root . "/includes/page/footer.inc"); - page_footer($no_menu, $is_index, $hide_back_link); + global $path_to_root; + + if (!$is_index && !$hide_back_link && function_exists('hyperlink_back')) + hyperlink_back(); + div_end(); // end of _page_body section + + include($path_to_root . "/includes/page/footer.inc"); + page_footer($no_menu, $is_index, $hide_back_link); } function flush_dir($path, $wipe = false) diff --git a/includes/page/footer.inc b/includes/page/footer.inc index e07f6983..23318932 100644 --- a/includes/page/footer.inc +++ b/includes/page/footer.inc @@ -13,8 +13,6 @@ function page_footer($no_menu=false, $is_index=false, $hide_back_link=false) { global $path_to_root, $js_lib, $Validate, $Editors, $Ajax; - if (!$is_index && !$hide_back_link && function_exists('hyperlink_back')) - hyperlink_back(); include_once($path_to_root."/themes/".user_theme()."/renderer.php"); $rend = new renderer(); $rend->menu_footer($no_menu, $is_index); diff --git a/includes/session.inc b/includes/session.inc index 8929ff2e..af62f7ff 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -221,16 +221,14 @@ if (strstr($_SERVER['PHP_SELF'], 'logout.php') == false){ // Show login screen if (!isset($_POST["user_name_entry_field"]) or $_POST["user_name_entry_field"] == "") { - $_SESSION['timeout'] = array( 'uri'=> $_SERVER['REQUEST_URI'], + // strip ajax marker from uri, to force synchronous page reload + $_SESSION['timeout'] = array( 'uri'=>preg_replace('/JsHttpRequest=(?:(\d+)-)?([^&]+)/s', + '', @$_SERVER['REQUEST_URI']), 'post' => $_POST); - if (!in_ajax()) { - include($path_to_root . "/access/login.php"); - } else { - // ajax update of current page elements - open login window in popup - // to not interfere with ajaxified page. - $Ajax->popup($path_to_root . "/access/timeout.php"); - } + include($path_to_root . "/access/login.php"); + if (in_ajax()) + $Ajax->activate('_page_body'); exit; } else { $succeed = $_SESSION["wa_current_user"]->login($_POST["company_login_name"], @@ -257,7 +255,6 @@ if (strstr($_SERVER['PHP_SELF'], 'logout.php') == false){ } } - // POST vars cleanup needed for direct reuse. // We quote all values later with db_escape() before db update. $_POST = strip_quotes($_POST);