diff options
Diffstat (limited to 'libs/Zend/Auth')
-rw-r--r-- | libs/Zend/Auth/Adapter/DbTable.php | 57 | ||||
-rw-r--r-- | libs/Zend/Auth/Adapter/Digest.php | 16 | ||||
-rw-r--r-- | libs/Zend/Auth/Adapter/Exception.php | 12 | ||||
-rw-r--r-- | libs/Zend/Auth/Adapter/Http.php | 38 | ||||
-rw-r--r-- | libs/Zend/Auth/Adapter/Http/Resolver/Exception.php | 8 | ||||
-rw-r--r-- | libs/Zend/Auth/Adapter/Http/Resolver/File.php | 20 | ||||
-rw-r--r-- | libs/Zend/Auth/Adapter/Http/Resolver/Interface.php | 6 | ||||
-rw-r--r-- | libs/Zend/Auth/Adapter/InfoCard.php | 12 | ||||
-rw-r--r-- | libs/Zend/Auth/Adapter/Interface.php | 8 | ||||
-rw-r--r-- | libs/Zend/Auth/Adapter/Ldap.php | 56 | ||||
-rw-r--r-- | libs/Zend/Auth/Adapter/OpenId.php | 10 | ||||
-rw-r--r-- | libs/Zend/Auth/Exception.php | 8 | ||||
-rw-r--r-- | libs/Zend/Auth/Result.php | 6 | ||||
-rw-r--r-- | libs/Zend/Auth/Storage/Exception.php | 12 | ||||
-rw-r--r-- | libs/Zend/Auth/Storage/Interface.php | 11 | ||||
-rw-r--r-- | libs/Zend/Auth/Storage/NonPersistent.php | 13 | ||||
-rw-r--r-- | libs/Zend/Auth/Storage/Session.php | 14 |
17 files changed, 161 insertions, 146 deletions
diff --git a/libs/Zend/Auth/Adapter/DbTable.php b/libs/Zend/Auth/Adapter/DbTable.php index db64bcba9e..30bbd2478d 100644 --- a/libs/Zend/Auth/Adapter/DbTable.php +++ b/libs/Zend/Auth/Adapter/DbTable.php @@ -14,34 +14,34 @@ * * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Adapter + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: DbTable.php 18066 2009-09-10 18:47:53Z ralph $ + * @version $Id: DbTable.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Auth_Adapter_Interface */ -require_once 'Zend/Auth/Adapter/Interface.php'; +// require_once 'Zend/Auth/Adapter/Interface.php'; /** * @see Zend_Db_Adapter_Abstract */ -require_once 'Zend/Db/Adapter/Abstract.php'; +// require_once 'Zend/Db/Adapter/Abstract.php'; /** * @see Zend_Auth_Result */ -require_once 'Zend/Auth/Result.php'; +// require_once 'Zend/Auth/Result.php'; /** * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Adapter + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface @@ -58,7 +58,7 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface * @var Zend_Db_Select */ protected $_dbSelect = null; - + /** * $_tableName - the table name to check * @@ -185,7 +185,7 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface /** * setCredentialTreatment() - allows the developer to pass a parameterized string that is - * used to transform or treat the input credential data + * used to transform or treat the input credential data. * * In many cases, passwords and other sensitive data are encrypted, hashed, encoded, * obscured, or otherwise treated through some function or algorithm. By specifying a @@ -241,10 +241,10 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface if ($this->_dbSelect == null) { $this->_dbSelect = $this->_zendDb->select(); } - + return $this->_dbSelect; } - + /** * getResultRowObject() - Returns the result row as a stdClass object * @@ -292,8 +292,8 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface /** * authenticate() - defined by Zend_Auth_Adapter_Interface. This method is called to - * attempt an authenication. Previous to this call, this adapter would have already - * been configured with all nessissary information to successfully connect to a database + * attempt an authentication. Previous to this call, this adapter would have already + * been configured with all necessary information to successfully connect to a database * table and attempt to find a record matching the provided identity. * * @throws Zend_Auth_Adapter_Exception if answering the authentication query is impossible @@ -314,8 +314,9 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface } /** - * _authenticateSetup() - This method abstracts the steps involved with making sure - * that this adapter was indeed setup properly with all required peices of information. + * _authenticateSetup() - This method abstracts the steps involved with + * making sure that this adapter was indeed setup properly with all + * required pieces of information. * * @throws Zend_Auth_Adapter_Exception - in the event that setup was not done properly * @return true @@ -340,7 +341,7 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception($exception); } @@ -391,7 +392,8 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface * performs a query against the database with that object. * * @param Zend_Db_Select $dbSelect - * @throws Zend_Auth_Adapter_Exception - when a invalid select object is encoutered + * @throws Zend_Auth_Adapter_Exception - when an invalid select + * object is encountered * @return array */ protected function _authenticateQuerySelect(Zend_Db_Select $dbSelect) @@ -410,17 +412,17 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('The supplied parameters to Zend_Auth_Adapter_DbTable failed to ' . 'produce a valid sql statement, please check table and column names ' - . 'for validity.'); + . 'for validity.', 0, $e); } return $resultIdentities; } /** - * _authenticateValidateResultSet() - This method attempts to make certian that only one - * record was returned in the result set + * _authenticateValidateResultSet() - This method attempts to make + * certain that only one record was returned in the resultset * * @param array $resultIdentities * @return true|Zend_Auth_Result @@ -442,8 +444,9 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface } /** - * _authenticateValidateResult() - This method attempts to validate that the record in the - * result set is indeed a record that matched the identity provided to this adapter. + * _authenticateValidateResult() - This method attempts to validate that + * the record in the resultset is indeed a record that matched the + * identity provided to this adapter. * * @param array $resultIdentity * @return Zend_Auth_Result @@ -451,7 +454,7 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface protected function _authenticateValidateResult($resultIdentity) { $zendAuthCredentialMatchColumn = $this->_zendDb->foldCase('zend_auth_credential_match'); - + if ($resultIdentity[$zendAuthCredentialMatchColumn] != '1') { $this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID; $this->_authenticateResultInfo['messages'][] = 'Supplied credential is invalid.'; @@ -467,8 +470,8 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface } /** - * _authenticateCreateAuthResult() - This method creates a Zend_Auth_Result object - * from the information that has been collected during the authenticate() attempt. + * _authenticateCreateAuthResult() - Creates a Zend_Auth_Result object from + * the information that has been collected during the authenticate() attempt. * * @return Zend_Auth_Result */ diff --git a/libs/Zend/Auth/Adapter/Digest.php b/libs/Zend/Auth/Adapter/Digest.php index 259ae3f3cd..a099bef358 100644 --- a/libs/Zend/Auth/Adapter/Digest.php +++ b/libs/Zend/Auth/Adapter/Digest.php @@ -14,24 +14,24 @@ * * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Adapter + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Digest.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Digest.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Auth_Adapter_Interface */ -require_once 'Zend/Auth/Adapter/Interface.php'; +// require_once 'Zend/Auth/Adapter/Interface.php'; /** * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Adapter + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Digest implements Zend_Auth_Adapter_Interface @@ -186,7 +186,7 @@ class Zend_Auth_Adapter_Digest implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception("Option '$optionRequired' must be set before authentication"); } } @@ -195,7 +195,7 @@ class Zend_Auth_Adapter_Digest implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception("Cannot open '$this->_filename' for reading"); } diff --git a/libs/Zend/Auth/Adapter/Exception.php b/libs/Zend/Auth/Adapter/Exception.php index 0b5a4d43cf..23282dddf2 100644 --- a/libs/Zend/Auth/Adapter/Exception.php +++ b/libs/Zend/Auth/Adapter/Exception.php @@ -14,24 +14,24 @@ * * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Adapter + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * Zend_Auth_Exception */ -require_once 'Zend/Auth/Exception.php'; +// require_once 'Zend/Auth/Exception.php'; /** * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Adapter + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Exception extends Zend_Auth_Exception diff --git a/libs/Zend/Auth/Adapter/Http.php b/libs/Zend/Auth/Adapter/Http.php index 466ce42597..d645d8db93 100644 --- a/libs/Zend/Auth/Adapter/Http.php +++ b/libs/Zend/Auth/Adapter/Http.php @@ -15,16 +15,16 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Http.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Http.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Auth_Adapter_Interface */ -require_once 'Zend/Auth/Adapter/Interface.php'; +// require_once 'Zend/Auth/Adapter/Interface.php'; /** @@ -35,7 +35,7 @@ require_once 'Zend/Auth/Adapter/Interface.php'; * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @todo Support auth-int * @todo Track nonces, nonce-count, opaque for replay protection and stale support @@ -171,7 +171,7 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception(__CLASS__ . ' requires the \'hash\' extension'); } @@ -184,7 +184,7 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('Config key \'accept_schemes\' is required'); } @@ -194,7 +194,7 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('No supported schemes given in \'accept_schemes\'. Valid values: ' . implode(', ', $this->_supportedSchemes)); } @@ -208,7 +208,7 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('Config key \'realm\' is required, and must contain only printable ' . 'characters, excluding quotation marks and colons'); } else { @@ -222,7 +222,7 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('Config key \'digest_domains\' is required, and must contain ' . 'only printable characters, excluding quotation marks'); } else { @@ -234,7 +234,7 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('Config key \'nonce_timeout\' is required, and must be an ' . 'integer'); } else { @@ -368,7 +368,7 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('Request and Response objects must be set before calling ' . 'authenticate()'); } @@ -403,7 +403,7 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface // challenge again the client return $this->_challengeClient(); } - + switch ($clientScheme) { case 'basic': $result = $this->_basicAuth($authHeader); @@ -415,7 +415,7 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('Unsupported authentication scheme'); } @@ -502,14 +502,14 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('The value of the client Authorization header is required'); } if (empty($this->_basicResolver)) { /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('A basicResolver object must be set before doing Basic ' . 'authentication'); } @@ -521,7 +521,7 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('Unable to base64_decode Authorization header value'); } @@ -559,14 +559,14 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('The value of the client Authorization header is required'); } if (empty($this->_digestResolver)) { /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('A digestResolver object must be set before doing Digest authentication'); } @@ -625,7 +625,7 @@ class Zend_Auth_Adapter_Http implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; + // require_once 'Zend/Auth/Adapter/Exception.php'; throw new Zend_Auth_Adapter_Exception('Client requested an unsupported qop option'); } // Using hash() should make parameterizing the hash algorithm diff --git a/libs/Zend/Auth/Adapter/Http/Resolver/Exception.php b/libs/Zend/Auth/Adapter/Http/Resolver/Exception.php index cb7b18be0d..5a4c9bf358 100644 --- a/libs/Zend/Auth/Adapter/Http/Resolver/Exception.php +++ b/libs/Zend/Auth/Adapter/Http/Resolver/Exception.php @@ -15,16 +15,16 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Auth_Exception */ -require_once 'Zend/Auth/Exception.php'; +// require_once 'Zend/Auth/Exception.php'; /** @@ -33,7 +33,7 @@ require_once 'Zend/Auth/Exception.php'; * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Http_Resolver_Exception extends Zend_Auth_Exception diff --git a/libs/Zend/Auth/Adapter/Http/Resolver/File.php b/libs/Zend/Auth/Adapter/Http/Resolver/File.php index 39b548ca66..d17c2ecb37 100644 --- a/libs/Zend/Auth/Adapter/Http/Resolver/File.php +++ b/libs/Zend/Auth/Adapter/Http/Resolver/File.php @@ -15,16 +15,16 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: File.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: File.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Auth_Adapter_Http_Resolver_Interface */ -require_once 'Zend/Auth/Adapter/Http/Resolver/Interface.php'; +// require_once 'Zend/Auth/Adapter/Http/Resolver/Interface.php'; /** @@ -33,7 +33,7 @@ require_once 'Zend/Auth/Adapter/Http/Resolver/Interface.php'; * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_Http_Resolver_File implements Zend_Auth_Adapter_Http_Resolver_Interface @@ -71,7 +71,7 @@ class Zend_Auth_Adapter_Http_Resolver_File implements Zend_Auth_Adapter_Http_Res /** * @see Zend_Auth_Adapter_Http_Resolver_Exception */ - require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; + // require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; throw new Zend_Auth_Adapter_Http_Resolver_Exception('Path not readable: ' . $path); } $this->_file = $path; @@ -116,13 +116,13 @@ class Zend_Auth_Adapter_Http_Resolver_File implements Zend_Auth_Adapter_Http_Res /** * @see Zend_Auth_Adapter_Http_Resolver_Exception */ - require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; + // require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; throw new Zend_Auth_Adapter_Http_Resolver_Exception('Username is required'); } else if (!ctype_print($username) || strpos($username, ':') !== false) { /** * @see Zend_Auth_Adapter_Http_Resolver_Exception */ - require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; + // require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; throw new Zend_Auth_Adapter_Http_Resolver_Exception('Username must consist only of printable characters, ' . 'excluding the colon'); } @@ -130,13 +130,13 @@ class Zend_Auth_Adapter_Http_Resolver_File implements Zend_Auth_Adapter_Http_Res /** * @see Zend_Auth_Adapter_Http_Resolver_Exception */ - require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; + // require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; throw new Zend_Auth_Adapter_Http_Resolver_Exception('Realm is required'); } else if (!ctype_print($realm) || strpos($realm, ':') !== false) { /** * @see Zend_Auth_Adapter_Http_Resolver_Exception */ - require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; + // require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; throw new Zend_Auth_Adapter_Http_Resolver_Exception('Realm must consist only of printable characters, ' . 'excluding the colon.'); } @@ -147,7 +147,7 @@ class Zend_Auth_Adapter_Http_Resolver_File implements Zend_Auth_Adapter_Http_Res /** * @see Zend_Auth_Adapter_Http_Resolver_Exception */ - require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; + // require_once 'Zend/Auth/Adapter/Http/Resolver/Exception.php'; throw new Zend_Auth_Adapter_Http_Resolver_Exception('Unable to open password file: ' . $this->_file); } diff --git a/libs/Zend/Auth/Adapter/Http/Resolver/Interface.php b/libs/Zend/Auth/Adapter/Http/Resolver/Interface.php index d36a0125a2..78c0343147 100644 --- a/libs/Zend/Auth/Adapter/Http/Resolver/Interface.php +++ b/libs/Zend/Auth/Adapter/Http/Resolver/Interface.php @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter_Http - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Auth_Adapter_Http_Resolver_Interface diff --git a/libs/Zend/Auth/Adapter/InfoCard.php b/libs/Zend/Auth/Adapter/InfoCard.php index 1af3a08616..8f2572a571 100644 --- a/libs/Zend/Auth/Adapter/InfoCard.php +++ b/libs/Zend/Auth/Adapter/InfoCard.php @@ -15,25 +15,25 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: InfoCard.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: InfoCard.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Auth_Adapter_Interface */ -require_once 'Zend/Auth/Adapter/Interface.php'; +// require_once 'Zend/Auth/Adapter/Interface.php'; /** * @see Zend_Auth_Result */ -require_once 'Zend/Auth/Result.php'; +// require_once 'Zend/Auth/Result.php'; /** * @see Zend_InfoCard */ -require_once 'Zend/InfoCard.php'; +// require_once 'Zend/InfoCard.php'; /** * A Zend_Auth Authentication Adapter allowing the use of Information Cards as an @@ -42,7 +42,7 @@ require_once 'Zend/InfoCard.php'; * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_InfoCard implements Zend_Auth_Adapter_Interface diff --git a/libs/Zend/Auth/Adapter/Interface.php b/libs/Zend/Auth/Adapter/Interface.php index 67cb6b8b02..3f8204842b 100644 --- a/libs/Zend/Auth/Adapter/Interface.php +++ b/libs/Zend/Auth/Adapter/Interface.php @@ -15,23 +15,23 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Auth_Result */ -require_once 'Zend/Auth/Result.php'; +// require_once 'Zend/Auth/Result.php'; /** * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Auth_Adapter_Interface diff --git a/libs/Zend/Auth/Adapter/Ldap.php b/libs/Zend/Auth/Adapter/Ldap.php index 9c0fc7f785..20f31c1fe0 100644 --- a/libs/Zend/Auth/Adapter/Ldap.php +++ b/libs/Zend/Auth/Adapter/Ldap.php @@ -15,21 +15,21 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Ldap.php 17976 2009-09-04 14:50:25Z sgehrig $ + * @version $Id: Ldap.php 21320 2010-03-04 16:05:09Z sgehrig $ */ /** * @see Zend_Auth_Adapter_Interface */ -require_once 'Zend/Auth/Adapter/Interface.php'; +// require_once 'Zend/Auth/Adapter/Interface.php'; /** * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 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 @@ -161,7 +161,7 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface /** * setIdentity() - set the identity (username) to be used * - * Proxies to {@see setPassword()} + * Proxies to {@see setUsername()} * * Closes ZF-6813 * @@ -199,7 +199,7 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface /** * @see Zend_Ldap */ - require_once 'Zend/Ldap.php'; + // require_once 'Zend/Ldap.php'; $this->_ldap = new Zend_Ldap(); } @@ -247,7 +247,7 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface /** * @see Zend_Ldap_Exception */ - require_once 'Zend/Ldap/Exception.php'; + // require_once 'Zend/Ldap/Exception.php'; $messages = array(); $messages[0] = ''; // reserved @@ -285,8 +285,8 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface /** * @see Zend_Auth_Adapter_Exception */ - require_once 'Zend/Auth/Adapter/Exception.php'; - throw new Zend_Auth_Adapter_Exception('Adapter options array not in array'); + // require_once 'Zend/Auth/Adapter/Exception.php'; + throw new Zend_Auth_Adapter_Exception('Adapter options array not an array'); } $adapterOptions = $this->_prepareOptions($ldap, $options); $dname = ''; @@ -314,6 +314,18 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface $canonicalName = $ldap->getCanonicalAccountName($username); $ldap->bind($canonicalName, $password); + /* + * Fixes problem when authenticated user is not allowed to retrieve + * group-membership information or own account. + * This requires that the user specified with "username" and optionally + * "password" in the Zend_Ldap options is able to retrieve the required + * information. + */ + $requireRebind = false; + if (isset($options['username'])) { + $ldap->bind(); + $requireRebind = true; + } $dn = $ldap->getCanonicalAccountName($canonicalName, Zend_Ldap::ACCTNAME_FORM_DN); $groupResult = $this->_checkGroupMembership($ldap, $canonicalName, $dn, $adapterOptions); @@ -322,6 +334,10 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface $messages[0] = ''; $messages[1] = ''; $messages[] = "$canonicalName authentication successful"; + if ($requireRebind === true) { + // rebinding with authenticated user + $ldap->bind($dn, $password); + } return new Zend_Auth_Result(Zend_Auth_Result::SUCCESS, $canonicalName, $messages); } else { $messages[0] = 'Account is not a member of the specified group'; @@ -408,7 +424,6 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface } } } - $ldap->setOptions($options); return $adapterOptions; } @@ -437,7 +452,7 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface /** * @see Zend_Ldap_Filter */ - require_once 'Zend/Ldap/Filter.php'; + // require_once 'Zend/Ldap/Filter.php'; $groupName = Zend_Ldap_Filter::equals($adapterOptions['groupAttr'], $adapterOptions['group']); $membership = Zend_Ldap_Filter::equals($adapterOptions['memberAttr'], $user); $group = Zend_Ldap_Filter::andFilter($groupName, $membership); @@ -446,14 +461,6 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface $group = $group->addAnd($groupFilter); } - /* - * Fixes problem when authenticated user is not allowed to retrieve - * group-membership information. - * This requires that the user specified with "username" and "password" - * in the Zend_Ldap options is able to retrieve the required information. - */ - $ldap->bind(); - $result = $ldap->count($group, $adapterOptions['groupDn'], $adapterOptions['groupScope']); if ($result === 1) { @@ -466,13 +473,14 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface /** * getAccountObject() - Returns the result entry as a stdClass object * - * This ressembles the feature {@see Zend_Auth_Adapter_DbTable::getResultRowObject()}. + * This resembles the feature {@see Zend_Auth_Adapter_DbTable::getResultRowObject()}. * Closes ZF-6813 * * @param array $returnAttribs + * @param array $omitAttribs * @return stdClass|boolean */ - public function getAccountObject(array $returnAttribs = array()) + public function getAccountObject(array $returnAttribs = array(), array $omitAttribs = array()) { if (!$this->_authenticatedDn) { return false; @@ -480,8 +488,14 @@ class Zend_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface $returnObject = new stdClass(); + $omitAttribs = array_map('strtolower', $omitAttribs); + $entry = $this->getLdap()->getEntry($this->_authenticatedDn, $returnAttribs, true); foreach ($entry as $attr => $value) { + if (in_array($attr, $omitAttribs)) { + // skip attributes marked to be omitted + continue; + } if (is_array($value)) { $returnObject->$attr = (count($value) > 1) ? $value : $value[0]; } else { diff --git a/libs/Zend/Auth/Adapter/OpenId.php b/libs/Zend/Auth/Adapter/OpenId.php index 44e4684456..08f21d949b 100644 --- a/libs/Zend/Auth/Adapter/OpenId.php +++ b/libs/Zend/Auth/Adapter/OpenId.php @@ -15,22 +15,22 @@ * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: OpenId.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: OpenId.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Auth_Adapter_Interface */ -require_once 'Zend/Auth/Adapter/Interface.php'; +// require_once 'Zend/Auth/Adapter/Interface.php'; /** * @see Zend_OpenId_Consumer */ -require_once 'Zend/OpenId/Consumer.php'; +// require_once 'Zend/OpenId/Consumer.php'; /** @@ -40,7 +40,7 @@ require_once 'Zend/OpenId/Consumer.php'; * @category Zend * @package Zend_Auth * @subpackage Zend_Auth_Adapter - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Adapter_OpenId implements Zend_Auth_Adapter_Interface diff --git a/libs/Zend/Auth/Exception.php b/libs/Zend/Auth/Exception.php index c71f41c505..80334c1911 100644 --- a/libs/Zend/Auth/Exception.php +++ b/libs/Zend/Auth/Exception.php @@ -14,22 +14,22 @@ * * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Exception */ -require_once 'Zend/Exception.php'; +// require_once 'Zend/Exception.php'; /** * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Exception extends Zend_Exception diff --git a/libs/Zend/Auth/Result.php b/libs/Zend/Auth/Result.php index 18ba1023f9..964d44d80d 100644 --- a/libs/Zend/Auth/Result.php +++ b/libs/Zend/Auth/Result.php @@ -14,16 +14,16 @@ * * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Result.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Result.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @category Zend * @package Zend_Auth - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Result diff --git a/libs/Zend/Auth/Storage/Exception.php b/libs/Zend/Auth/Storage/Exception.php index 6f3af444c0..218c909c50 100644 --- a/libs/Zend/Auth/Storage/Exception.php +++ b/libs/Zend/Auth/Storage/Exception.php @@ -14,24 +14,24 @@ * * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Storage - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Storage + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Exception.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Auth_Exception */ -require_once 'Zend/Auth/Exception.php'; +// require_once 'Zend/Auth/Exception.php'; /** * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Storage - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Storage + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Storage_Exception extends Zend_Auth_Exception diff --git a/libs/Zend/Auth/Storage/Interface.php b/libs/Zend/Auth/Storage/Interface.php index a604a0d8c6..9fedf01322 100644 --- a/libs/Zend/Auth/Storage/Interface.php +++ b/libs/Zend/Auth/Storage/Interface.php @@ -14,18 +14,17 @@ * * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Storage - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Storage + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Interface.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Interface.php 20096 2010-01-06 02:05:09Z bkarwin $ */ - /** * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Storage - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Storage + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ interface Zend_Auth_Storage_Interface diff --git a/libs/Zend/Auth/Storage/NonPersistent.php b/libs/Zend/Auth/Storage/NonPersistent.php index 6c544fff4b..1dd034b7ef 100644 --- a/libs/Zend/Auth/Storage/NonPersistent.php +++ b/libs/Zend/Auth/Storage/NonPersistent.php @@ -14,17 +14,17 @@ * * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Storage - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Storage + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: NonPersistent.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: NonPersistent.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Auth_Storage_Interface */ -require_once 'Zend/Auth/Storage/Interface.php'; +// require_once 'Zend/Auth/Storage/Interface.php'; /** @@ -36,8 +36,8 @@ require_once 'Zend/Auth/Storage/Interface.php'; * * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Storage - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Storage + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Storage_NonPersistent implements Zend_Auth_Storage_Interface @@ -47,7 +47,6 @@ class Zend_Auth_Storage_NonPersistent implements Zend_Auth_Storage_Interface */ protected $_data; - /** * Returns true if and only if storage is empty * diff --git a/libs/Zend/Auth/Storage/Session.php b/libs/Zend/Auth/Storage/Session.php index 14027968b0..a3775ce3d3 100644 --- a/libs/Zend/Auth/Storage/Session.php +++ b/libs/Zend/Auth/Storage/Session.php @@ -14,30 +14,30 @@ * * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Storage - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Storage + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Session.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Session.php 20096 2010-01-06 02:05:09Z bkarwin $ */ /** * @see Zend_Auth_Storage_Interface */ -require_once 'Zend/Auth/Storage/Interface.php'; +// require_once 'Zend/Auth/Storage/Interface.php'; /** * @see Zend_Session */ -require_once 'Zend/Session.php'; +// require_once 'Zend/Session.php'; /** * @category Zend * @package Zend_Auth - * @subpackage Zend_Auth_Storage - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @subpackage Storage + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Auth_Storage_Session implements Zend_Auth_Storage_Interface |