X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fcurrent_user.inc;h=ee9e38f05c06c54718af2d653707c52c03396ffa;hb=8f7ac519b7aaf8ec219862597e878d3a28316ac6;hp=53e7855cdc931db5ccd15d2734719c5b24a8626c;hpb=ce2a1cae35df4f60c3b993d79cb9eb65cb2cb82e;p=fa-stable.git diff --git a/includes/current_user.inc b/includes/current_user.inc index 53e7855c..ee9e38f0 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,8 @@ function add_user_js_data() { //-------------------------------------------------------------------------- +function session_timeout() +{ + return get_company_pref('login_tout'); +} ?> \ No newline at end of file