Oops.. removed some debugging code.
Better patch:
--- mediawiki-1.3.7/includes/User.php Thu Sep 23 11:41:57 2004
+++ wiki-bioterm/includes/User.php Tue Oct 26 23:06:54 2004
@@ -722,6 +722,7 @@
# Check to see if the given clear-text password is one of the
accepted passwords
function checkPassword( $password ) {
+ global $wgRemotePasswordCheck,
$wgRemotePasswordServer, $wgRemotePasswordPort;
$this->loadFromDatabase();
$ep = $this->encryptPassword( $password );
if ( 0 == strcmp( $ep, $this->mPassword ) ) {
@@ -733,6 +734,22 @@
# Check for this with iconv
$cp1252hash = $this->encryptPassword( iconv(
'UTF-8', 'WINDOWS-1252', $password ) );
if ( 0 == strcmp( $cp1252hash, $this->mPassword ) ) {
+ return true;
+ }
+ }
+ if ( $wgRemotePasswordCheck ) {
+ $lower = strtolower( $this->mName );
+ $credentials = $lower . ":" . $password;
+ $out = "GET / HTTP/1.1\r\n";
+ $out .= "Host: $wgRemotePasswordServer\r\n";
+ $out .= "Authorization: Basic " .
base64_encode($credentials) . "\r\n\r\n";
+ $fp = fsockopen( $wgRemotePasswordServer,
$wgRemotePasswordPort, $errno, $errstr, 30 );
+ if( $fp ) {
+ fwrite( $fp, $out );
+ $test = fgets( $fp, 128);
+ fclose( $fp );
+ }
+ if( 0 == strcmp( $test, "HTTP/1.0 200 OK\r\n" ) ) {
return true;
}
}