X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fcurrent_user.inc;h=7d80febbe3b4f02f8f1acb00a5bd1a8d6f3d1903;hb=e8ebca8f2b08eeb3bfd3da04ca946dfa8cc1fb3f;hp=90a91a9c079b68e45344f3ed0609b87c9eddf2a8;hpb=0c760ea65c8c6f0a45ea8328abab53be649f2105;p=fa-stable.git diff --git a/includes/current_user.inc b/includes/current_user.inc index 90a91a9c..7d80febb 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -22,6 +22,7 @@ class current_user var $loginname; var $username; var $name; + var $email; var $company; // user's company var $pos; var $access; @@ -58,7 +59,7 @@ class current_user function login($company, $loginname, $password) { - global $security_areas, $security_groups, $security_headings, $path_to_root, $dflt_lang; + global $security_areas, $security_groups, $security_headings, $path_to_root, $dflt_lang, $login_delay; $this->set_company($company); $this->logged = false; @@ -76,7 +77,8 @@ class current_user if (!isset($Auth_Result)) // if not used: standard method $Auth_Result = get_user_auth($loginname, md5($password)); - write_login_filelog($loginname, $Auth_Result); + if ($login_delay > 0) + write_login_filelog($loginname, $Auth_Result); if ($Auth_Result) { @@ -129,6 +131,7 @@ class current_user $this->username = $this->loginname; $this->prefs = new user_prefs($myrow); $this->user = @$myrow["id"]; + $this->email = @$myrow["email"]; update_user_visitdate($this->username); $this->logged = true; $this->last_act = time(); @@ -630,6 +633,14 @@ function array_search_key($needle, $haystack, $valuekey=null) return @$keys[0]; } +// Recalculate report columns if orientation is landscape. +function recalculate_cols(&$cols) +{ + $factor = (user_pagesize() == "A4" ? 1.4 : 1.3); + foreach($cols as $key => $col) + $cols[$key] = intval($col * $factor); +} + function flush_dir($path, $wipe = false) { $dir = opendir($path);