From: Janusz Dobrowolski Date: Sun, 19 Oct 2008 20:00:53 +0000 (+0000) Subject: User interface mode detected on login. X-Git-Tag: v2.4.2~19^2~1836 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=bf343dcf1df5d82c25ed8079bed766a54bd1b17c;p=fa-stable.git User interface mode detected on login. --- diff --git a/access/login.php b/access/login.php index 0b961a97..56441518 100644 --- a/access/login.php +++ b/access/login.php @@ -23,6 +23,7 @@ function defaultCompany() { document.forms[0].company_login_name.options[].selected = true; + document.getElementById('ui_mode').value = 1; } <?php echo $app_title . " " . $version;?> @@ -45,6 +46,7 @@ function defaultCompany() + diff --git a/includes/current_user.inc b/includes/current_user.inc index 0948b3d3..05b98800 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -14,7 +14,8 @@ class current_user var $access; var $logged; - + var $ui_mode = 0; + var $prefs; function current_user() @@ -118,6 +119,12 @@ function number_format2($number, $decimals=0) $dsep = $decseps[$_SESSION["wa_current_user"]->prefs->dec_sep()]; return number_format($number, $decimals, $dsep, $tsep); } +// +// Current ui mode. +// +function fallback_mode() { + return $_SESSION["wa_current_user"]->ui_mode==0; +} function price_format($number) { return number_format2($number, diff --git a/includes/session.inc b/includes/session.inc index 0e7d3113..a08344ae 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -136,7 +136,7 @@ if (!isset($_POST["user_name_entry_field"]) or $_POST["user_name_entry_field"] == "") { include($path_to_root . "/access/login.php"); - $Ajax->redirect($path_to_root . "/access/login.php"); + $Ajax->redirect($path_to_root . "/access/login.php"); exit; } } @@ -152,7 +152,8 @@ $succeed = $_SESSION["wa_current_user"]->login($_POST["company_login_name"], $_POST["user_name_entry_field"], md5($_POST["password"])); - + // select full vs fallback ui mode on login + $_SESSION["wa_current_user"]->ui_mode = $_POST['ui_mode']; if (!$succeed) { // Incorrect password diff --git a/includes/ui/ui_input.inc b/includes/ui/ui_input.inc index 230dd495..47cdd0a9 100644 --- a/includes/ui/ui_input.inc +++ b/includes/ui/ui_input.inc @@ -102,7 +102,7 @@ function submit($name, $value, $echo=true, $title=false, $async=false, $icon=fal $submit_str = "