123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- require dirname(__FILE__).'/../inc/prepend.php';
- $con = new connection(DB_USER,DB_PASS,DB_HOST,DB_DBASE);
- $blog = new blog($con,DB_PREFIX,NULL,dc_encoding);
- $rsUser = $blog->getUser();
- $message = '';
- $adminList = '';
- while(!$rsUser->EOF())
- {
- if ($rsUser->field('user_level') == 9)
- $adminList.='<option>'.$rsUser->field('user_id').'</option>';
- $rsUser->moveNext();
- }
- if (isset($_POST['user']))
- {
- $updReq = 'UPDATE '.$blog->t_user.' SET user_pwd = \''.md5($blog->con->escapeStr(trim($_POST['newpwd']))).'\'';
- $updReq.= 'WHERE user_id=\''.$_POST['user'].'\'';
- if($blog->con->execute($updReq))
- $message = "Mot de passe mis à jour. Il est conseillé de supprimer le fichier ".__FILE__.".";
- else
- $message = "Erreur lors de la modification du mot de passe.";
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
- <head>
- <meta http-equiv="Content-Type" content="text/HTML; charset=iso-8859-15" />
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
- <meta http-equiv="Content-Style-Type" content="text/css" />
- <meta http-equiv="Content-Language" content="fr" />
- <title>Récupération de mot de passe pour Dotclear</title>
- </head>
- <body>
- <p><strong><?php echo $message; ?></strong></p>
- <form action="" method="post">
- <fieldset>
- <legend>Liste des administrateurs</legend>
- <label for="admin">Utilisateurs administrateurs</label>
- <select name="user" id="user">
- <?php echo $adminList; ?>
- </select>
- <label for="newpwd" id="newpwd">Nouveau mot de passe</label>
- <input type="text" value="" name="newpwd" id="newpwd" />
- <input type="submit" value="Utiliser comme nouveau mot de passe" />
- </fieldset>
- </form>
- </body>
- </html>
|