RE: [PHP] Page that checks if a user exists on a remote system
| From: | Jonathan Duncan | Date: | Thu, 02 Dec 2004 16:34:03 +0000 |
| Subject: | RE: [PHP] Page that checks if a user exists on a remote system | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203361@lists.php.net to get a copy of this message | ||
Well, I can honestly say I had not thought of doing it that way. I will keep that as an option. Thanks.
Jonathan
On Thu, 2 Dec 2004, Gryffyn, Trevor wrote:
If it's a un*x system and you have permissions to connect to the SMTP server, you could use the VRFY command to check to see if their email address exists or not maybe:Example of Verifying a User NameEitherS: VRFY Smith R: 250 Fred Smith <Smith@USC-ISIF.ARPA>OrS: VRFY Smith R: 251 User not local; will forward to <Smith@USC-ISIQ.ARPA>OrS: VRFY Jones R: 550 String does not match anything.OrS: VRFY Jones R: 551 User not local; please try <Jones@USC-ISIQ.ARPA>OrS: VRFY Gourzenkyinplatz R: 553 User ambiguous.(examples taken from: http://www.ietf.org/rfc/rfc0821.txt Page 8) Just a thought. -TG-----Original Message----- From: news.php.net [mailto:jonathan@nacnud.com] Sent: Wednesday, December 01, 2004 7:57 PM To: php-general@lists.php.net Subject: [PHP] Page that checks if a user exists on a remote system I have two servers: ServerA and ServerB. One server serves web pages, the other serves mail. I am making a web page on ServerA that will access ServerB to find out if a users exists and if not then add that user to ServerB with information collected from the web page on ServerA. I have this in a php file:$idResults =When I access the page I get:ssh admin@domain.com id bigbob 2>&1; echo "id: (".$idResults.")\r\n"."\r\n"; if (ereg("no such user", $idResults)) { echo 'username is available!'; }Could not create directory '/nonexistent/.ssh'. Host key verification failed.This, of course, is because the script is being run as "www" who has no place to put ssl keys. Could this be solved by having "www" "su" to a user who has remote access privileges? Something like this:$idResults =Anyone else doing or done something like this? Thanks, -- Jonathan Duncan http://www.nacnud.comsu admin | ssh admin@domain.com id bigbob 2>&1; echo "id: (".$idResults.")\r\n"."\r\n"; if (ereg("no such user", $idResults)) { echo 'username is available!'; // function addUserToServerB(vars); }