diff -r 5e7a0fedabdf -r 877f952ae2bd web/lib/Zend/Auth/Adapter/Ldap.php --- a/web/lib/Zend/Auth/Adapter/Ldap.php Thu Mar 21 17:31:31 2013 +0100 +++ b/web/lib/Zend/Auth/Adapter/Ldap.php Thu Mar 21 19:50:53 2013 +0100 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ldap.php 21319 2010-03-04 16:02:16Z sgehrig $ + * @version $Id: Ldap.php 24618 2012-02-03 08:32:06Z sgehrig $ */ /** @@ -29,7 +29,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface @@ -335,8 +335,8 @@ $messages[1] = ''; $messages[] = "$canonicalName authentication successful"; if ($requireRebind === true) { - // rebinding with authenticated user - $ldap->bind($dn, $password); + // rebinding with authenticated user + $ldap->bind($dn, $password); } return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $canonicalName, $messages); } else { @@ -371,7 +371,11 @@ } else { $line = $zle->getLine(); $messages[] = $zle->getFile() . "($line): " . $zle->getMessage(); - $messages[] = str_replace($password, '*****', $zle->getTraceAsString()); + $messages[] = preg_replace( + '/\b'.preg_quote(substr($password, 0, 15), '/').'\b/', + '*****', + $zle->getTraceAsString() + ); $messages[0] = 'An unexpected failure occurred'; } $messages[1] = $zle->getMessage(); @@ -488,7 +492,9 @@ $returnObject = new stdClass(); - $omitAttribs = array_map('strtolower', $omitAttribs); + $returnAttribs = array_map('strtolower', $returnAttribs); + $omitAttribs = array_map('strtolower', $omitAttribs); + $returnAttribs = array_diff($returnAttribs, $omitAttribs); $entry = $this->getLdap()->getEntry($this->_authenticatedDn, $returnAttribs, true); foreach ($entry as $attr => $value) {