Adapt to security change

This commit is contained in:
sparkyx 2022-01-16 12:50:15 +01:00
parent 35500e7448
commit ad125d0321
2 changed files with 5 additions and 3 deletions

View file

@ -42,7 +42,7 @@ class User
var $name;
var $active; //!< 1 active , 0 disables
var $login; //!< login lower case
var $password; //!< password
var $password; //!< md5 of the password
var $email; //!< user's email
var $access_mode; //!< MOBILE or PC depending if when connecting $login contains @mobile
@ -66,7 +66,9 @@ class User
function can_connect()
{
$cn=new \Database();
$can_connect=$cn->get_value("select count(*) from ac_users where use_login=$1 and use_pass=$2",
$can_connect=$cn->get_value("select count(*) from ac_users
where use_active=1 and
use_login=$1 and use_pass=$2",
[$this->login,$this->password]);
return $can_connect;
}

View file

@ -32,7 +32,7 @@ $g_parameter = new Noalyss_Parameter_Folder($g_connection);
$_SESSION[SESSION_KEY.'use_name']='unit test';
$_SESSION[SESSION_KEY.'use_first_name']='automatic';
$_SESSION[SESSION_KEY.'g_user']='admin';
$_SESSION[SESSION_KEY.'g_pass']='phpcompta';
$_SESSION[SESSION_KEY.'g_pass']=md5('dany');
$_SESSION[SESSION_KEY.'g_pagesize']='50';
$_SESSION[SESSION_KEY.'csv_fieldsep']='0';
$_SESSION[SESSION_KEY.'csv_decimal']='1';