555 |
{ |
{ |
556 |
global $langs; |
global $langs; |
557 |
|
|
558 |
|
// Nettoyage parametres |
559 |
|
$this->login = trim($this->login); |
560 |
|
|
561 |
$this->db->begin(); |
$this->db->begin(); |
562 |
|
|
563 |
$sql = "SELECT login FROM ".MAIN_DB_PREFIX."user WHERE login ='".$this->login."';"; |
$sql = "SELECT login FROM ".MAIN_DB_PREFIX."user WHERE login ='".addslashes($this->login)."'"; |
564 |
$resql=$this->db->query($sql); |
$resql=$this->db->query($sql); |
565 |
if ($resql) |
if ($resql) |
566 |
{ |
{ |
574 |
} |
} |
575 |
else |
else |
576 |
{ |
{ |
577 |
$sql = "INSERT INTO ".MAIN_DB_PREFIX."user (datec,login) VALUES(now(),'$this->login');"; |
$sql = "INSERT INTO ".MAIN_DB_PREFIX."user (datec,login) VALUES(now(),'".addslashes($this->login)."')"; |
578 |
$result=$this->db->query($sql); |
$result=$this->db->query($sql); |
579 |
|
|
580 |
if ($result) |
if ($result) |
756 |
{ |
{ |
757 |
global $langs; |
global $langs; |
758 |
|
|
759 |
|
// Nettoyage parametres |
760 |
|
$this->nom=trim($this->nom); |
761 |
|
$this->prenom=trim($this->prenom); |
762 |
|
$this->login=trim($this->login); |
763 |
|
$this->pass=trim($this->pass); |
764 |
|
$this->email=trim($this->email); |
765 |
|
$this->note=trim($this->note); |
766 |
|
|
767 |
$error=0; |
$error=0; |
768 |
|
|
769 |
if (!strlen($this->code)) $this->code = $this->login; |
if (!strlen($this->code)) $this->code = $this->login; |
770 |
|
|
771 |
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET "; |
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET "; |
772 |
$sql .= " name = '$this->nom'"; |
$sql .= " name = '".addslashes($this->nom)."'"; |
773 |
$sql .= ", firstname = '$this->prenom'"; |
$sql .= ", firstname = '".addslashes($this->prenom)."'"; |
774 |
$sql .= ", login = '$this->login'"; |
$sql .= ", login = '".addslashes($this->login)."'"; |
775 |
if ($this->pass) $sql .= ", pass = '$this->pass'"; |
if ($this->pass) $sql .= ", pass = '".addslashes($this->pass)."'"; |
776 |
$sql .= ", admin = $this->admin"; |
$sql .= ", admin = $this->admin"; |
777 |
$sql .= ", office_phone = '$this->office_phone'"; |
$sql .= ", office_phone = '$this->office_phone'"; |
778 |
$sql .= ", office_fax = '$this->office_fax'"; |
$sql .= ", office_fax = '$this->office_fax'"; |
779 |
$sql .= ", user_mobile = '$this->user_mobile'"; |
$sql .= ", user_mobile = '$this->user_mobile'"; |
780 |
$sql .= ", email = '$this->email'"; |
$sql .= ", email = '".addslashes($this->email)."'"; |
781 |
$sql .= ", webcal_login = '$this->webcal_login'"; |
$sql .= ", webcal_login = '$this->webcal_login'"; |
782 |
$sql .= ", code = '$this->code'"; |
$sql .= ", code = '$this->code'"; |
783 |
$sql .= ", note = '$this->note'"; |
$sql .= ", note = '".addslashes($this->note)."'"; |
784 |
$sql .= " WHERE rowid = ".$this->id; |
$sql .= " WHERE rowid = ".$this->id; |
785 |
|
|
786 |
$result = $this->db->query($sql); |
$result = $this->db->query($sql); |
864 |
$sqlpass = $password; |
$sqlpass = $password; |
865 |
} |
} |
866 |
$this->pass=$password; |
$this->pass=$password; |
867 |
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET pass = '".$sqlpass."'"; |
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET pass = '".addslashes($sqlpass)."'"; |
868 |
$sql.= " WHERE rowid = $this->id"; |
$sql.= " WHERE rowid = ".$this->id; |
869 |
|
|
870 |
$result = $this->db->query($sql); |
$result = $this->db->query($sql); |
871 |
if ($result) |
if ($result) |