diff --git a/htdocs/user.class.php3 b/htdocs/user.class.php3 index f407a4cd429..596b6d4f98e 100644 --- a/htdocs/user.class.php3 +++ b/htdocs/user.class.php3 @@ -126,11 +126,19 @@ class User { { $this->id = $this->db->last_insert_id(); $this->update(); - return 1; + return $this->id; } } + else + { + print $this->db->error(); + } } } + else + { + print $this->db->error(); + } } /* * @@ -183,14 +191,14 @@ class User { * * */ - Function password($password='') + Function password($password='',$password_encrypted=0) { if (! $password) { $password = substr(crypt(uniqid("")),0,8); } - if ($conf->password_encrypted) + if ($password_encrypted) { $sqlpass = crypt($password, "CRYPT_STD_DES"); } diff --git a/htdocs/user/fiche.php3 b/htdocs/user/fiche.php3 index fdf40946a3a..5b4ddcc3664 100644 --- a/htdocs/user/fiche.php3 +++ b/htdocs/user/fiche.php3 @@ -26,21 +26,17 @@ llxHeader(); $db = new Db(); -if ($action == 'add' && $user->admin) +if ($HTTP_POST_VARS["action"] == 'add' && $user->admin) { - $service = new Service($db); + $edituser = new User($db,0); - $service->ref = $ref; - $service->libelle = $label; - $service->price = $price; - $service->description = $desc; + $edituser->nom = $HTTP_POST_VARS["nom"]; + $edituser->prenom = $HTTP_POST_VARS["prenom"]; + $edituser->login = $HTTP_POST_VARS["login"]; + $edituser->email = $HTTP_POST_VARS["email"]; + $edituser->admin = 0; - $id = $service->create($user->id); - - if ($comm_now && $id) - { - $service->start_comm($id, $user->id); - } + $id = $edituser->create($user->id); } @@ -65,7 +61,7 @@ if ($action == 'password' && $user->admin) $edituser = new User($db, $id); $edituser->fetch(); - if ($edituser->password()) + if ($edituser->password('',$conf->password_encrypted)) { print "Mot de passe changé et envoyé à $edituser->email
"; } @@ -83,25 +79,19 @@ if ($action == 'create') { print '