X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fcurrent_user.inc;h=549c31b045897cf31ea57d23fa94d86a3ec40b8e;hb=7e8c90ee7e898a9181f62f387ccb92158f47f59c;hp=53e7855cdc931db5ccd15d2734719c5b24a8626c;hpb=ce2a1cae35df4f60c3b993d79cb9eb65cb2cb82e;p=fa-stable.git diff --git a/includes/current_user.inc b/includes/current_user.inc index 53e7855c..549c31b0 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -22,6 +22,8 @@ class current_user var $company; var $pos; var $access; + var $timeout; + var $last_act; var $logged; var $ui_mode = 0; @@ -30,7 +32,10 @@ class current_user function current_user() { - $this->loginname = $this->username = $this->name = $this->company = ""; + global $def_coy; + + $this->loginname = $this->username = $this->name = ""; + $this->company = isset($def_coy)? $def_coy : 0; $this->logged = false; $this->prefs = new user_prefs(); @@ -66,6 +71,8 @@ class current_user $this->user = @$myrow["id"]; update_user_visitdate($this->username); $this->logged = true; + $this->last_act = time(); + $this->timeout = session_timeout(); } } @@ -147,6 +154,7 @@ function price_format($number) { return number_format2($number, $_SESSION["wa_current_user"]->prefs->price_dec()); } + // 2008-06-15. Added extra parameter $stock_id and reference for $dec //-------------------------------------------------------------------- function qty_format($number, $stock_id=null, &$dec) { @@ -337,4 +345,9 @@ function add_user_js_data() { //-------------------------------------------------------------------------- +function session_timeout() +{ + $tout = @get_company_pref('login_tout'); // mask warning for db ver. 2.2 + return $tout ? $tout : ini_get('session.gc_maxlifetime'); +} ?> \ No newline at end of file