4 // Test authenticator using pipe method. Logins will be accepted if the
5 // login and the password are identical, and will be rejected otherwise.
7 // This authenticator does copious logging by writing all sorts of stuff to
8 // STDERR. A production authenticator would not normally do this, and it
9 // *especially* would not write the plain text password out to the log file.
11 // Get the name of this program
15 $user = trim(fgets(STDIN));
18 $pass = trim(fgets(STDIN));
20 // Print them to the error_log file
21 fwrite(STDERR, $prog . ": user='" . $user . "' pass='" . $pass . "'\n");
23 foreach ($_ENV as $k => $v)
25 fwrite(STDERR, $prog . ': ' . $k . '=' . $v . "\n");
28 // Accept the login if the user name matchs the password
31 fwrite(STDERR, $prog . ": login matches password - Accepted\n");
36 fwrite(STDERR, $prog . ": login doesn't match password - Rejected\n");