1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
|
<html>
<style type="text/css">
.titre1
{
font-size:14px;
color:white;
}
.titre2
{
font-size:13px;
}
</style>
<body>
<br><br><br><br><br><br><br><br>
<FORM ACTION="user.php" METHOD='POST'>
<table width="80%" cellpadding="3" align="center" cellspacing="0" style='border:1px outset gray'>
<tr bgcolor="#00438C">
<td class="titre1">Enregistrer un nouveau compte administateur:</td>
<td></td>
</tr>
<tr>
<td class="titre2">Login:</td>
<td><input type=text name='login' value=''></td>
</tr>
<tr>
<td class="titre2">Password:</td>
<td><input type=password name='passwd' value=''></td>
</tr>
<tr>
<td class="titre2">Entrer a nouveau:</td>
<td><input type=password name='passwd1' value=''></td>
</tr>
<tr>
<td ></td>
</table>
</div>
<table width="80%" align="center" >
<tr>
<br>
<td align="center"><img src="images/user_add.jpg" height="20"/><input type='submit' name='envoi' value='Enregistrer' /></td>
</tr>
</FORM>
</table>
<?
$login=$_POST['login'];
$password=$_POST['passwd'];
$password1=$_POST['passwd1'];
if ($password==$password1)
{
$pass_crypte=crypt($_POST['passwd']);
// On crypte le mot de passe
if (isset($_POST['envoi']) && isset($_POST['login']) && isset($_POST['passwd']) && isset($_POST['passwd1']))
{
echo $pass_crypte;
exec("sudo -u root script/adduser.sh $login $pass_crypte");
}
}
else
{ echo '<script> alert("Erreur: mot de passe incorrect,veuillez remplir les champs vides")</script>';}
// fin envoi
?>
</body>
</html> |
Partager