Fix: Gestion erreur sur mise a jour user.
This commit is contained in:
parent
374499c065
commit
ae1f05e046
@ -641,8 +641,7 @@ class User
|
|||||||
{
|
{
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if (!strlen($this->code))
|
if (!strlen($this->code)) $this->code = $this->login;
|
||||||
$this->code = $this->login;
|
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET ";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET ";
|
||||||
$sql .= " name = '$this->nom'";
|
$sql .= " name = '$this->nom'";
|
||||||
@ -655,9 +654,7 @@ class User
|
|||||||
$sql .= ", note = '$this->note'";
|
$sql .= ", note = '$this->note'";
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
$sql .= " WHERE rowid = ".$this->id;
|
||||||
|
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
if ($this->db->affected_rows())
|
if ($this->db->affected_rows())
|
||||||
@ -668,8 +665,8 @@ class User
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dolibarr_print_error($this->db);
|
$this->error=$this->db->error();
|
||||||
return -2;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user