note 32988 deleted from function.crypt by aidan
| From: | aidan@php.net | Date: | Mon, 05 Jul 2004 10:28:51 +0000 |
| Subject: | note 32988 deleted from function.crypt by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72592@lists.php.net to get a copy of this message | ||
Note Submitter: Alexandre Correaalexandre@sabbath.com.br
----
Many peoples try to adduser via php...
adduser command have -p "password of user in md5"
This php works fine to adduser via PHP:
<?
/* Script by Alexandre Correa */
/* alexandre@sabbath.com.br */
/* Tkz to Wagner Quedi */
if ($senha) {
$saltos = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
$ pass = crypt(strip_tags($senha), $saltos);
$comando = "sudo adduser -g 200 -s /bin/false -c 'Name of User' -p " . $pass .
" loginOFuser";
exec($comando);
}
?>
regards.
Alexandre Correa