note 32988 added to function.crypt
| From: | Alexandre at rack1 dot php dot net | Date: | Fri, 13 Jun 2003 05:16:55 +0000 |
| Subject: | note 32988 added to function.crypt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50263@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/function.crypt.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32988
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32988&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32988&report=yes