diff --git a/htdocs/user.class.php b/htdocs/user.class.php index 02d982c187c..22da6ad8038 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -39,8 +39,8 @@ require_once(DOL_DOCUMENT_ROOT ."/commonobject.class.php"); /** - \class User - \brief Classe permettant la gestion d'un utilisateur + * \class User + * \brief Classe permettant la gestion d'un utilisateur */ class User extends CommonObject { @@ -817,10 +817,12 @@ class User extends CommonObject if ($result > 0) { $sql = "UPDATE ".MAIN_DB_PREFIX."user"; - $sql.= " SET fk_socpeople=".$contact->id.", fk_societe=".$contact->societeid; + $sql.= " SET fk_socpeople=".$contact->id; + if ($contact->societeid) $sql.=", fk_societe=".$contact->societeid; $sql.= " WHERE rowid=".$this->id; $resql=$this->db->query($sql); + dolibarr_syslog("User::create_from_contact sql=".$sql, LOG_DEBUG); if ($resql) { $this->db->commit(); @@ -828,8 +830,8 @@ class User extends CommonObject } else { - $this->error=$this->db->error()." - $sql"; - dolibarr_syslog("User::create_from_contact - 10 - ".$this->error); + $this->error=$this->db->error(); + dolibarr_syslog("User::create_from_contact ".$this->error, LOG_ERR); $this->db->rollback(); return -1; @@ -878,6 +880,7 @@ class User extends CommonObject $sql.= " WHERE rowid=".$this->id; $resql=$this->db->query($sql); + dolibarr_syslog("User::create_from_member sql=".$sql, LOG_DEBUG); if ($resql) { $this->db->commit(); @@ -886,7 +889,7 @@ class User extends CommonObject else { $this->error=$this->db->error()." - ".$sql; - dolibarr_syslog("User::create_from_member - 1 - ".$this->error); + dolibarr_syslog("User::create_from_member - ".$this->error, LOG_ERR); $this->db->rollback(); return -1; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 8494769310e..85a0628dc2e 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -22,10 +22,10 @@ */ /** - \file htdocs/user/fiche.php - \brief Onglet user et permissions de la fiche utilisateur - \version $Id$ -*/ + * \file htdocs/user/fiche.php + * \brief Onglet user et permissions de la fiche utilisateur + * \version $Id$ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); @@ -276,7 +276,7 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $caneditfield) if (is_dir($conf->users->dir_output)) { $newfile=$conf->users->dir_output . "/" . $edituser->id . ".jpg"; - if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1)) + if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1) > 0) { $message .= '