if ($result)
{
$obj = $this->db->fetch_object($result);
if ($obj)
{
$this->id = $obj->rowid;
$this->ldap_sid = $obj->ldap_sid;
$this->nom = $obj->name;
$this->prenom = $obj->firstname;
$this->fullname = trim($this->prenom . ' ' .
$this->nom);
$this->login = $obj->login;
$this->pass_indatabase = $obj->pass;
if (! $conf->password_encrypted) $this->pass = $obj->pass;
$this->office_phone = $obj->office_phone;
$this->office_fax = $obj->office_fax;
$this->user_mobile = $obj->user_mobile;
$this->email = $obj->email;
$this->admin = $obj->admin;
$this->contact_id = $obj->fk_socpeople;
$this->note = $obj->note;
$this->statut = $obj->statut;
$this->lang = $obj->lang;
$this->datec = $obj->datec;
$this->datem = $obj->datem;
$this->datelastlogin = $obj->datel;
$this->datepreviouslogin = $obj->datep;
$this->webcal_login = $obj->webcal_login;
$this->societe_id = $obj->fk_societe;
if (! $this->lang) $this->lang='fr_FR';
}
else
{
$this->error=$this->db->error();
dolibarr_syslog("User::fetch Error -1, fails to get user -
".$this->error." - sql=".$sql);
$this->db->free($result);
return -1;
}
$this->db->free($result);
}
else
{
$this->error=$this->db->error();
dolibarr_syslog("User::fetch Error -1, fails to get user -
".$this->error." - sql=".$sql);
return -1;
}