*** empty log message ***

This commit is contained in:
Rodolphe Quiedeville 2002-12-22 23:22:56 +00:00
parent 9133bb8b87
commit 4ed68f7565
2 changed files with 28 additions and 30 deletions

View File

@ -126,10 +126,18 @@ class User {
{ {
$this->id = $this->db->last_insert_id(); $this->id = $this->db->last_insert_id();
$this->update(); $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) if (! $password)
{ {
$password = substr(crypt(uniqid("")),0,8); $password = substr(crypt(uniqid("")),0,8);
} }
if ($conf->password_encrypted) if ($password_encrypted)
{ {
$sqlpass = crypt($password, "CRYPT_STD_DES"); $sqlpass = crypt($password, "CRYPT_STD_DES");
} }

View File

@ -26,21 +26,17 @@ llxHeader();
$db = new Db(); $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; $edituser->nom = $HTTP_POST_VARS["nom"];
$service->libelle = $label; $edituser->prenom = $HTTP_POST_VARS["prenom"];
$service->price = $price; $edituser->login = $HTTP_POST_VARS["login"];
$service->description = $desc; $edituser->email = $HTTP_POST_VARS["email"];
$edituser->admin = 0;
$id = $service->create($user->id); $id = $edituser->create($user->id);
if ($comm_now && $id)
{
$service->start_comm($id, $user->id);
}
} }
@ -65,7 +61,7 @@ if ($action == 'password' && $user->admin)
$edituser = new User($db, $id); $edituser = new User($db, $id);
$edituser->fetch(); $edituser->fetch();
if ($edituser->password()) if ($edituser->password('',$conf->password_encrypted))
{ {
print "Mot de passe changé et envoyé à $edituser->email<p>"; print "Mot de passe changé et envoyé à $edituser->email<p>";
} }
@ -83,25 +79,19 @@ if ($action == 'create')
{ {
print '<div class="titre">Nouvel utilisateur</div><br>'; print '<div class="titre">Nouvel utilisateur</div><br>';
print 'A FINIR !!<p><form action="'.$PHP_SELF.'" method="post">'; print '<p><form action="'.$PHP_SELF.'" method="post">';
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
print '<form action="'.$PHP_SELF.'?id='.$id.'" method="post">';
print '<input type="hidden" name="action" value="update">';
print '<table border="1" cellpadding="3" cellspacing="0">'; print '<table border="1" cellpadding="3" cellspacing="0">';
print '<tr><td valign="top">Nom</td>';
print '<td>'.$user->id.'</td></tr>';
print '<tr><td valign="top">Nom</td>';
print '<td><input size="12" type="text" name="ref" value="'.$user->nom.'"></td></tr>';
print '<tr><td valign="top">Prénom</td>'; print '<tr><td valign="top">Prénom</td>';
print '<td><input size="30" type="text" name="label" value="'.$user->prenom.'"></td></tr>'; print '<td><input size="30" type="text" name="prenom" value=""></td></tr>';
print '<tr><td valign="top">Nom</td>';
print '<td><input size="20" type="text" name="nom" value=""></td></tr>';
print '<tr><td valign="top">Login</td>'; print '<tr><td valign="top">Login</td>';
print '<td><input size="30" type="text" name="label" value="'.$user->login.'"></td></tr>'; print '<td><input size="30" type="text" name="login" value=""></td></tr>';
print '<tr><td valign="top">Description</td><td>'; print '<tr><td valign="top">Description</td><td>';
@ -140,7 +130,7 @@ else
print '<td>'.$fuser->email.'</td></tr>'; print '<td>'.$fuser->email.'</td></tr>';
print '<tr><td width="25%" valign="top">Webcal Login</td>'; print '<tr><td width="25%" valign="top">Webcal Login</td>';
print '<td width="25%" bgcolor="#e0e0e0">'.$fuser->webcal_login.'</td>'; print '<td width="25%" bgcolor="#e0e0e0">'.$fuser->webcal_login.'&nbsp;</td>';
print '<td width="25%" valign="top">Administrateur</td>'; print '<td width="25%" valign="top">Administrateur</td>';
print '<td width="25%">'.$yn[$fuser->admin].'</td></tr>'; print '<td width="25%">'.$yn[$fuser->admin].'</td></tr>';