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;
$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();
$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;
}