Re: Users changing passwords
| From: | J Smith | Date: | Fri, 12 Oct 2001 18:48:42 +0000 |
| Subject: | Re: Users changing passwords | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-70948@lists.php.net to get a copy of this message | ||
Justin King wrote:
> I'm looking at setting up a way where a user can change their password.
> Short of writing a script which telnets in and changes the password all
> in php, I can't come up with anything. Anyone have an idea on how I can
> go about writing a script to let a user change their password remotely
> without giving them a shell account?
>
> -Justin
Try looking at
http://www.php.net/manual/en/ref.exec.php
exec(), passthru(), system() and the backtick operators let you execute
external programs and commands and such through PHP.
Be very careful with these functions, though -- make sure you validate user
input rigorously. You don't want to be using code like
exec("rm $blah");
and have the user enter
"/etc/passwd && perl -e \"while(1) { fork(); }\""
or something for $blah on you.
J