Cleanup in types.inc
[fa-stable.git] / includes / current_user.inc
index edfae0a92b2b8b6725f0d39f32dc8109cee79d87..5d4d5f0e3282b3da3e4235949765154cbb5270f9 100644 (file)
@@ -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);
-
-                       mail($email, _("New password for")." ".$SysPrefs->app_title, $password);
+                       
+                       $sender = get_company_pref('email');
+                       if (empty($sender))
+                               $header = "";
+                       else
+                               $header = "From: $sender";
+
+                       mail($email, _("New password for")." ".$SysPrefs->app_title, $password, $header);
 
                        return true;
                }