dolibarr-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Dolibarr-dev] Classe utilisateur - problèm e gestion d'erreur


From: Laurent Destailleur (Eldy)
Subject: Re: [Dolibarr-dev] Classe utilisateur - problèm e gestion d'erreur
Date: Fri, 13 Apr 2007 18:15:36 +0200
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)


correctif appliqué


ATHANASE Jean-René a écrit :
Hello,

Je vous propose la modification suivante à propos de la méthode fetch de la classe user :
    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;
      }
Si l'utilisateur n'existe pas, l'erreur est remontée lors de l'appel fetch_object($result) et non lors du querry.

Cordialement.

JR ATHANASE


_______________________________________________
Dolibarr-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/dolibarr-dev



--
Laurent Destailleur.
---------------------------------------------------------------
EMail: address@hidden
Web: http://www.destailleur.fr
IM: IRC=Eldy, Jabber=Eldy

AWStats (Author) : http://awstats.sourceforge.net
CVSChangeLogBuilder (Author) : http://cvschangelogb.sourceforge.net
AWBot (Author) : http://awbot.sourceforge.net
Dolibarr (Contributor) : http://www.dolibarr.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]