From ae1f05e0464f9494ade0979d69049c647593520f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 10 Jul 2005 23:40:36 +0000 Subject: [PATCH] Fix: Gestion erreur sur mise a jour user. --- htdocs/user.class.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/user.class.php b/htdocs/user.class.php index 757bb68858a..d2b43401307 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -641,8 +641,7 @@ class User { global $langs; - if (!strlen($this->code)) - $this->code = $this->login; + if (!strlen($this->code)) $this->code = $this->login; $sql = "UPDATE ".MAIN_DB_PREFIX."user SET "; $sql .= " name = '$this->nom'"; @@ -655,9 +654,7 @@ class User $sql .= ", note = '$this->note'"; $sql .= " WHERE rowid = ".$this->id; - $result = $this->db->query($sql); - if ($result) { if ($this->db->affected_rows()) @@ -668,8 +665,8 @@ class User } else { - dolibarr_print_error($this->db); - return -2; + $this->error=$this->db->error(); + return -1; } }