--- wpDirAuth.php 2008/07/24 13:17:20 1.3 +++ wpDirAuth.php 2008/07/24 13:21:07 1.4 @@ -60,7 +60,7 @@ Apache Directory, Microsoft Active Directory, Novell eDirectory, Sun Java System Directory Server, etc. Originally revived and upgraded from a patched version of wpLDAP. -Version: 1.3 +Version: 1.4 Author: Stephane Daury and whoever wants to help Author URI: http://stephane.daury.org/ */ @@ -68,7 +68,7 @@ /** * wpDirAuth version. */ -define('WPDIRAUTH_VERSION', '1.3'); +define('WPDIRAUTH_VERSION', '1.4'); /** * wpDirAuth signature. @@ -223,6 +223,7 @@ * */ function wpDirAuth_bindTest(&$connection, &$username, &$password) { + $password = strtr($password, array("\'"=>"'")); if ( ($isBound = @ldap_bind($connection, $username, $password)) === false ) { // @see wpLDAP comment at http://ashay.org/?page_id=133#comment-558 $isBound = @ldap_bind($connection,"uid=$username,$baseDn", $password); @@ -361,7 +362,7 @@ return new WP_Error ('could_not_bind_as_user', $errorTitle . __(' Incorrect password.')); } - elseif ( ! $isBound) { + elseif ( ! $isBound && ! $isPreBound ) { return new WP_Error ('no_directory_available', $errorTitle . __(' wpDirAuth config error: No directory server available for authentication.')); }