From 7e1e2c6ca0e1a974e3d606bae5fa322c7fa4d3bc Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Wed, 23 Sep 2009 00:24:03 +0000 Subject: [PATCH] Changed login.php and logout.php to be neutral and tried to use our own api. Parse error in login_fail --- CHANGELOG.txt | 5 + access/login.php | 255 +++++++++++++++++-------------------------- access/logout.php | 35 +++--- includes/session.inc | 2 +- 4 files changed, 122 insertions(+), 175 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index e85d2645..9a45588a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -27,6 +27,11 @@ $ /install/index.php $ install.html /doc/2.2_Beta.txt /doc/sales_quotations.txt +! Changed login.php and logout.php to be neutral and tried to use our own api. +$ /access/login.php + /access/logout.php +# parse error in login_fail +$ /includes/session.inc 21-Sep-2009 Janusz Dobrowolski/Tom Hallman ! Added info on timeout and default bank accounts. diff --git a/access/login.php b/access/login.php index dc873fb9..6ed5eac5 100644 --- a/access/login.php +++ b/access/login.php @@ -11,7 +11,22 @@ ***********************************************************************/ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_to_root'])) die(_("Restricted access")); - include_once($path_to_root . "/includes/ui/ui_view.inc"); + include_once($path_to_root . "/includes/ui.inc"); + + $js = ""; + $js2 = ""; + // Display demo user name and password within login form if "$allow_demo_mode" is true if ($allow_demo_mode == true) { @@ -23,123 +38,79 @@ } if (!isset($def_coy)) $def_coy = 0; - $def_theme = $path_to_root . '/themes/default'; + $def_theme = isset($_SESSION["wa_current_user"]) ? user_theme() : "default"; -$login_timeout = $_SESSION["wa_current_user"]->last_act; + $login_timeout = $_SESSION["wa_current_user"]->last_act; - echo " - "; -if (!$login_timeout) { // page header - echo ''; ?> - - <?php echo $app_title . " " . $version;?> - - - + $title = $login_timeout ? _('Authorization timeout') : $app_title." ".$version." - "._("Login"); + $encoding = isset($_SESSION['language']->encoding) ? $_SESSION['language']->encoding : "iso-8859-1"; + $rtl = isset($_SESSION['language']->dir) ? $_SESSION['language']->dir : "ltr"; + $onload = !$login_timeout ? "onload='defaultCompany()'" : ""; - - - <?php echo _('Authorization timeout'); ?> - - - - - - - + echo "\n"; + echo "\n"; + echo "$title\n"; + echo "\n"; + echo " \n"; + if (!$login_timeout) + { + echo $js2; + echo $js; + } + echo "\n"; - - - - - - - - - - - - - - - - - - - - - - - -
- FrontAccounting - - - -
+ echo "\n"; - - - - - \n"; + end_row(); - - - - - - "; + if (isset($_SESSION['wa_current_user']->company)) + $coy = $_SESSION['wa_current_user']->company; + else + $coy = $def_coy; + echo "


-
- - ui_mode; ?>"> - - - - - + echo "
$title
\n"; + + br();br(); + start_table("$table_style2 width=400"); + start_row(); + echo "
"; + if (!$login_timeout) { // FA logo + echo "FrontAccounting"; + } else { + echo ""._('Authorization timeout').""; + } + echo "
"._("Company")."\n"; + start_row(); + label_cell($demo_text, "colspan=2 align='center'"); + end_row(); + }; + end_table(1); + echo "
\n"; + end_form(1); foreach($_SESSION['timeout']['post'] as $p => $val) { // add all request variables to be resend together with login data @@ -147,53 +118,31 @@ if (!$login_timeout) { // FA version info 'password', 'SubmitUser', 'company_login_name'))) echo ""; } -?> -
- -
 
- - - - - - - + "; + echo "\n"; + echo ""; + if (isset($_SESSION['wa_current_user'])) + $date = Today() . " | " . Now(); + else + $date = date("m/d/Y") . " | " . date("h.i am"); + echo "\n"; + echo "
$date
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
$app_title $version - " . _("Theme:") . " " . $def_theme . "
$power_by


\n"; + echo "\n"; + +?> \ No newline at end of file diff --git a/access/logout.php b/access/logout.php index a8af0239..ee526fda 100644 --- a/access/logout.php +++ b/access/logout.php @@ -16,41 +16,34 @@ include_once($path_to_root . "/includes/ui/ui_view.inc"); page(_("Logout"), true, false, "", get_js_png_fix()); -?> - - +echo "
- + - +echo "$app_title $version"; + +echo " - +
" alt="FrontAccounting" width="250" height="50" onload="fixPNG(this)" />FrontAccounting
 
-
"; +echo _("Thank you for using") . " "; - echo "$app_title $version"; -?> -
 
- " . _("Click here to Login Again.") . ""; -?> -
-
-\n"; +end_page(false, true); +session_unset(); +session_destroy(); ?> diff --git a/includes/session.inc b/includes/session.inc index c9e0becb..b7880a91 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -40,7 +40,7 @@ function login_fail() echo "" . _("The user and password combination is not valid for the system.") . "

"; echo _("If you are not an authorized user, please contact your system administrator to obtain an account to enable you to use the system."); - echo "
" . _("Try again") . ""; + echo "
" . _("Try again") . ""; echo ""; kill_login(); -- 2.30.2