X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fcurrent_user.inc;h=5d4d5f0e3282b3da3e4235949765154cbb5270f9;hb=a001646bef2b971535791d4e67b8565684d6de24;hp=23887cb65d62d995a7bfce41ba30e2b0c2d651dd;hpb=495ac5fbc5f98dde51645d1691e13dc37654f771;p=fa-stable.git diff --git a/includes/current_user.inc b/includes/current_user.inc index 23887cb6..5d4d5f0e 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -59,7 +59,7 @@ class current_user function login($company, $loginname, $password) { - global $security_areas, $security_groups, $security_headings, $path_to_root, $dflt_lang, $SysPrefs; + global $security_areas, $security_groups, $security_headings, $path_to_root, $dflt_lang, $SysPrefs, $src_version, $db_version, $installed_extensions; $this->set_company($company); $this->logged = false; @@ -132,7 +132,7 @@ class current_user $this->prefs = new user_prefs($myrow); $this->user = @$myrow["id"]; $this->email = @$myrow["email"]; - update_user_visitdate($this->username); + update_user_visitdate($this->username, $src_version, $db_version, $installed_extensions); $this->logged = true; $this->last_act = time(); $this->timeout = session_timeout(); @@ -158,8 +158,14 @@ class current_user $hash = md5($password); update_user_password($user['id'], $user['user_id'], $hash); + + $sender = get_company_pref('email'); + if (empty($sender)) + $header = ""; + else + $header = "From: $sender"; - mail($email, _("New password for")." ".$SysPrefs->app_title, $password); + mail($email, _("New password for")." ".$SysPrefs->app_title, $password, $header); return true; } @@ -315,7 +321,7 @@ function number_format2($number, $decimals=0) $dec = $decimals; } - $num = number_format($number, $dec, $dsep, $tsep); + $num = number_format($number, intval($dec), $dsep, $tsep); return $decimals==='max' ? rtrim($num, '0') : $num;