Skip to content

Commit

Permalink
LDAP -> Ldap
Browse files Browse the repository at this point in the history
- Renamed directories and filenames from LDAP to Ldap
- Renamed namespaces and classnames from LDAP to Ldap
- Renamed LDIF -> Ldif
- Renamed RootDSE -> RootDse
- Renamed DN -> Dn
- Renamed OpenLDAP -> OpenLdap
  • Loading branch information
weierophinney committed Jul 20, 2010
1 parent 228b607 commit 057d695
Show file tree
Hide file tree
Showing 66 changed files with 1,303 additions and 1,303 deletions.
30 changes: 15 additions & 15 deletions library/Zend/Authentication/Adapter/Ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public function setCredential($credential)
public function getLdap()
{
if ($this->_ldap === null) {
$this->_ldap = new \Zend\LDAP\LDAP();
$this->_ldap = new \Zend\Ldap\Ldap();
}

return $this->_ldap;
Expand All @@ -216,7 +216,7 @@ public function getLdap()
* @param Zend_Ldap $ldap An existing Ldap object
* @return Zend\Authentication\Adapter\Ldap Provides a fluent interface
*/
public function setLdap(\Zend\LDAP\LDAP $ldap)
public function setLdap(\Zend\Ldap\Ldap $ldap)
{
$this->_ldap = $ldap;

Expand Down Expand Up @@ -321,7 +321,7 @@ public function authenticate()
$ldap->bind();
$requireRebind = true;
}
$dn = $ldap->getCanonicalAccountName($canonicalName, \Zend\LDAP\LDAP::ACCTNAME_FORM_DN);
$dn = $ldap->getCanonicalAccountName($canonicalName, \Zend\Ldap\Ldap::ACCTNAME_FORM_DN);

$groupResult = $this->_checkGroupMembership($ldap, $canonicalName, $dn, $adapterOptions);
if ($groupResult === true) {
Expand All @@ -339,7 +339,7 @@ public function authenticate()
$messages[1] = $groupResult;
$failedAuthorities[$dname] = $groupResult;
}
} catch (\Zend\LDAP\Exception $zle) {
} catch (\Zend\Ldap\Exception $zle) {

/* LDAP based authentication is notoriously difficult to diagnose. Therefore
* we bend over backwards to capture and record every possible bit of
Expand All @@ -348,18 +348,18 @@ public function authenticate()

$err = $zle->getCode();

if ($err == \Zend\LDAP\Exception::LDAP_X_DOMAIN_MISMATCH) {
if ($err == \Zend\Ldap\Exception::LDAP_X_DOMAIN_MISMATCH) {
/* This error indicates that the domain supplied in the
* username did not match the domains in the server options
* and therefore we should just skip to the next set of
* server options.
*/
continue;
} else if ($err == \Zend\LDAP\Exception::LDAP_NO_SUCH_OBJECT) {
} else if ($err == \Zend\Ldap\Exception::LDAP_NO_SUCH_OBJECT) {
$code = AuthenticationResult::FAILURE_IDENTITY_NOT_FOUND;
$messages[0] = "Account not found: $username";
$failedAuthorities[$dname] = $zle->getMessage();
} else if ($err == \Zend\LDAP\Exception::LDAP_INVALID_CREDENTIALS) {
} else if ($err == \Zend\Ldap\Exception::LDAP_INVALID_CREDENTIALS) {
$code = AuthenticationResult::FAILURE_CREDENTIAL_INVALID;
$messages[0] = 'Invalid credentials';
$failedAuthorities[$dname] = $zle->getMessage();
Expand All @@ -386,12 +386,12 @@ public function authenticate()
* @param array $options
* @return array of auth-adapter specific options
*/
protected function _prepareOptions(\Zend\LDAP\LDAP $ldap, array $options)
protected function _prepareOptions(\Zend\Ldap\Ldap $ldap, array $options)
{
$adapterOptions = array(
'group' => null,
'groupDn' => $ldap->getBaseDn(),
'groupScope' => \Zend\LDAP\LDAP::SEARCH_SCOPE_SUB,
'groupScope' => \Zend\Ldap\Ldap::SEARCH_SCOPE_SUB,
'groupAttr' => 'cn',
'groupFilter' => 'objectClass=groupOfUniqueNames',
'memberAttr' => 'uniqueMember',
Expand All @@ -404,8 +404,8 @@ protected function _prepareOptions(\Zend\LDAP\LDAP $ldap, array $options)
switch ($key) {
case 'groupScope':
$value = (int)$value;
if (in_array($value, array(\Zend\LDAP\LDAP::SEARCH_SCOPE_BASE,
\Zend\LDAP\LDAP::SEARCH_SCOPE_ONE, \Zend\LDAP\LDAP::SEARCH_SCOPE_SUB), true)) {
if (in_array($value, array(\Zend\Ldap\Ldap::SEARCH_SCOPE_BASE,
\Zend\Ldap\Ldap::SEARCH_SCOPE_ONE, \Zend\Ldap\Ldap::SEARCH_SCOPE_SUB), true)) {
$adapterOptions[$key] = $value;
}
break;
Expand All @@ -432,7 +432,7 @@ protected function _prepareOptions(\Zend\LDAP\LDAP $ldap, array $options)
* @param array $adapterOptions
* @return string|true
*/
protected function _checkGroupMembership(\Zend\LDAP\LDAP $ldap, $canonicalName, $dn, array $adapterOptions)
protected function _checkGroupMembership(\Zend\Ldap\Ldap $ldap, $canonicalName, $dn, array $adapterOptions)
{
if ($adapterOptions['group'] === null) {
return true;
Expand All @@ -444,9 +444,9 @@ protected function _checkGroupMembership(\Zend\LDAP\LDAP $ldap, $canonicalName,
$user = $dn;
}

$groupName = \Zend\LDAP\Filter\Filter::equals($adapterOptions['groupAttr'], $adapterOptions['group']);
$membership = \Zend\LDAP\Filter\Filter::equals($adapterOptions['memberAttr'], $user);
$group = \Zend\LDAP\Filter\Filter::andFilter($groupName, $membership);
$groupName = \Zend\Ldap\Filter\Filter::equals($adapterOptions['groupAttr'], $adapterOptions['group']);
$membership = \Zend\Ldap\Filter\Filter::equals($adapterOptions['memberAttr'], $user);
$group = \Zend\Ldap\Filter\Filter::andFilter($groupName, $membership);
$groupFilter = $adapterOptions['groupFilter'];
if (!empty($groupFilter)) {
$group = $group->addAnd($groupFilter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_LDAP
* @package Zend_Ldap
* @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$
Expand All @@ -22,13 +22,13 @@
/**
* @namespace
*/
namespace Zend\LDAP;
namespace Zend\Ldap;

/**
* Zend_LDAP_Attribute is a collection of LDAP attribute related functions.
* Zend_Ldap_Attribute is a collection of LDAP attribute related functions.
*
* @category Zend
* @package Zend_LDAP
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_LDAP
* @package Zend_Ldap
* @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$
Expand All @@ -22,15 +22,15 @@
/**
* @namespace
*/
namespace Zend\LDAP;
namespace Zend\Ldap;

/**
* Zend_LDAP_Collection wraps a list of LDAP entries.
* Zend_Ldap_Collection wraps a list of LDAP entries.
*
* @uses Countable
* @uses Iterator
* @category Zend
* @package Zend_LDAP
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
Expand All @@ -39,7 +39,7 @@ class Collection implements \Iterator, \Countable
/**
* Iterator
*
* @var \Zend\LDAP\Collection\DefaultIterator
* @var \Zend\Ldap\Collection\DefaultIterator
*/
protected $_iterator = null;

Expand All @@ -60,7 +60,7 @@ class Collection implements \Iterator, \Countable
/**
* Constructor.
*
* @param \Zend\LDAP\Collection\DefaultIterator $iterator
* @param \Zend\Ldap\Collection\DefaultIterator $iterator
*/
public function __construct(Collection\DefaultIterator $iterator)
{
Expand Down Expand Up @@ -114,7 +114,7 @@ public function getFirst()
/**
* Returns the underlying iterator
*
* @return \Zend\LDAP\Collection\DefaultIterator
* @return \Zend\Ldap\Collection\DefaultIterator
*/
public function getInnerIterator()
{
Expand All @@ -137,7 +137,7 @@ public function count()
* Implements Iterator
*
* @return array|null
* @throws \Zend\LDAP\Exception
* @throws \Zend\Ldap\Exception
*/
public function current()
{
Expand Down Expand Up @@ -208,7 +208,7 @@ public function key()
* Move forward to next result item
* Implements Iterator
*
* @throws \Zend\LDAP\Exception
* @throws \Zend\Ldap\Exception
*/
public function next()
{
Expand All @@ -220,7 +220,7 @@ public function next()
* Rewind the Iterator to the first result item
* Implements Iterator
*
* @throws \Zend\LDAP\Exception
* @throws \Zend\Ldap\Exception
*/
public function rewind()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_LDAP
* @package Zend_Ldap
* @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$
Expand All @@ -22,18 +22,18 @@
/**
* @namespace
*/
namespace Zend\LDAP\Collection;
use Zend\LDAP;
namespace Zend\Ldap\Collection;
use Zend\Ldap;

/**
* Zend_LDAP_Collection_Iterator_Default is the default collection iterator implementation
* Zend_Ldap_Collection_Iterator_Default is the default collection iterator implementation
* using ext/ldap
*
* @uses Countable
* @uses Iterator
* @uses \Zend\LDAP\Exception
* @uses \Zend\Ldap\Exception
* @category Zend
* @package Zend_LDAP
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
Expand All @@ -46,7 +46,7 @@ class DefaultIterator implements \Iterator, \Countable
/**
* LDAP Connection
*
* @var \Zend\LDAP\LDAP
* @var \Zend\Ldap\Ldap
*/
protected $_ldap = null;

Expand Down Expand Up @@ -81,17 +81,17 @@ class DefaultIterator implements \Iterator, \Countable
/**
* Constructor.
*
* @param \Zend\LDAP\LDAP $ldap
* @param \Zend\Ldap\Ldap $ldap
* @param resource $resultId
* @return void
*/
public function __construct(LDAP\LDAP $ldap, $resultId)
public function __construct(Ldap\Ldap $ldap, $resultId)
{
$this->_ldap = $ldap;
$this->_resultId = $resultId;
$this->_itemCount = @ldap_count_entries($ldap->getResource(), $resultId);
if ($this->_itemCount === false) {
throw new LDAP\Exception($this->_ldap, 'counting entries');
throw new Ldap\Exception($this->_ldap, 'counting entries');
}
}

Expand Down Expand Up @@ -119,7 +119,7 @@ public function close()
/**
* Gets the current LDAP connection.
*
* @return \Zend\LDAP\LDAP
* @return \Zend\Ldap\Ldap
*/
public function getLDAP()
{
Expand All @@ -130,14 +130,14 @@ public function getLDAP()
* Sets the attribute name treatment.
*
* Can either be one of the following constants
* - Zend_LDAP_Collection_Iterator_Default::ATTRIBUTE_TO_LOWER
* - Zend_LDAP_Collection_Iterator_Default::ATTRIBUTE_TO_UPPER
* - Zend_LDAP_Collection_Iterator_Default::ATTRIBUTE_NATIVE
* - Zend_Ldap_Collection_Iterator_Default::ATTRIBUTE_TO_LOWER
* - Zend_Ldap_Collection_Iterator_Default::ATTRIBUTE_TO_UPPER
* - Zend_Ldap_Collection_Iterator_Default::ATTRIBUTE_NATIVE
* or a valid callback accepting the attribute's name as it's only
* argument and returning the new attribute's name.
*
* @param integer|callback $attributeNameTreatment
* @return \Zend\LDAP\Collection\DefaultIterator Provides a fluent interface
* @return \Zend\Ldap\Collection\DefaultIterator Provides a fluent interface
*/
public function setAttributeNameTreatment($attributeNameTreatment)
{
Expand Down Expand Up @@ -192,7 +192,7 @@ public function count()
* Implements Iterator
*
* @return array|null
* @throws \Zend\LDAP\Exception
* @throws \Zend\Ldap\Exception
*/
public function current()
{
Expand Down Expand Up @@ -247,7 +247,7 @@ public function key()
if (is_resource($this->_current)) {
$currentDn = @ldap_get_dn($this->_ldap->getResource(), $this->_current);
if ($currentDn === false) {
throw new LDAP\Exception($this->_ldap, 'getting dn');
throw new Ldap\Exception($this->_ldap, 'getting dn');
}
return $currentDn;
} else {
Expand All @@ -259,19 +259,19 @@ public function key()
* Move forward to next result item
* Implements Iterator
*
* @throws \Zend\LDAP\Exception
* @throws \Zend\Ldap\Exception
*/
public function next()
{
if (is_resource($this->_current)) {
$this->_current = @ldap_next_entry($this->_ldap->getResource(), $this->_current);
if ($this->_current === false) {
$msg = $this->_ldap->getLastError($code);
if ($code === LDAP\Exception::LDAP_SIZELIMIT_EXCEEDED) {
if ($code === Ldap\Exception::LDAP_SIZELIMIT_EXCEEDED) {
// we have reached the size limit enforced by the server
return;
} else if ($code > LDAP\Exception::LDAP_SUCCESS) {
throw new LDAP\Exception($this->_ldap, 'getting next entry (' . $msg . ')');
} else if ($code > Ldap\Exception::LDAP_SUCCESS) {
throw new Ldap\Exception($this->_ldap, 'getting next entry (' . $msg . ')');
}
}
}
Expand All @@ -281,15 +281,15 @@ public function next()
* Rewind the Iterator to the first result item
* Implements Iterator
*
* @throws \Zend\LDAP\Exception
* @throws \Zend\Ldap\Exception
*/
public function rewind()
{
if (is_resource($this->_resultId)) {
$this->_current = @ldap_first_entry($this->_ldap->getResource(), $this->_resultId);
if ($this->_current === false &&
$this->_ldap->getLastErrorCode() > LDAP\Exception::LDAP_SUCCESS) {
throw new LDAP\Exception($this->_ldap, 'getting first entry');
$this->_ldap->getLastErrorCode() > Ldap\Exception::LDAP_SUCCESS) {
throw new Ldap\Exception($this->_ldap, 'getting first entry');
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* to [email protected] so we can send you a copy immediately.
*
* @category Zend
* @package Zend_LDAP
* @package Zend_Ldap
* @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$
Expand All @@ -22,13 +22,13 @@
/**
* @namespace
*/
namespace Zend\LDAP;
namespace Zend\Ldap;

/**
* Zend_LDAP_Converter is a collection of useful LDAP related conversion functions.
* Zend_Ldap_Converter is a collection of useful LDAP related conversion functions.
*
* @category Zend
* @package Zend_LDAP
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
Expand Down
Loading

0 comments on commit 057d695

Please sign in to comment.