return $this->logged;
}
+ function reset_password($company, $email) {
+ global $app_title;
+
+ $this->set_company($company);
+ $this->logged = false;
+
+ set_global_connection();
+
+ $user = get_user_by_email($email);
+
+ if ($user != false) {
+
+ $bytes = openssl_random_pseudo_bytes(8, $cstrong);
+ $password = base64_encode($bytes);
+
+ $hash = md5($password);
+
+ update_user_password($user['id'], $user['user_id'], $hash);
+
+ mail($user['email'], _("New password for")." ".$app_title, $password);
+
+ return true;
+ }
+ return false;
+ }
+
function check_user_access()
{
global $security_groups;