import v2.0.0.0_RC3 | 2012-07-01

https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
2019-07-17 22:31:04 +02:00
parent 38c146901c
commit 2f397f01f7
2677 changed files with 296182 additions and 45159 deletions

View File

@ -1,111 +1,114 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Attribute.php 16613 2009-07-10 06:55:41Z ralph $
*/
/**
* Zend_Ldap_Attribute is a collection of LDAP attribute related functions.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Attribute
{
const PASSWORD_HASH_MD5 = 'md5';
const PASSWORD_HASH_SHA = 'sha1';
/**
* Sets a LDAP attribute.
*
* @param array $data
* @param string $attribName
* @param mixed $value
* @param boolean $append
* @return void
*/
public static function setAttribute(array &$data, $attribName, $value, $append = false)
{
$attribName = strtolower($attribName);
$valArray = array();
if (is_array($value) || ($value instanceof Traversable))
{
foreach ($value as $v)
{
$v = self::_valueToLdap($v);
if (!is_null($v)) $valArray[] = $v;
}
}
else if (!is_null($value))
{
$value = self::_valueToLdap($value);
if (!is_null($value)) $valArray[] = $value;
}
if ($append === true && isset($data[$attribName]))
{
if (is_string($data[$attribName])) $data[$attribName] = array($data[$attribName]);
$data[$attribName] = array_merge($data[$attribName], $valArray);
}
else
{
$data[$attribName] = $valArray;
}
}
/**
* Gets a LDAP attribute.
*
* @param array $data
* @param string $attribName
* @param integer $index
* @return array|mixed
*/
public static function getAttribute(array $data, $attribName, $index = null)
{
$attribName = strtolower($attribName);
if (is_null($index)) {
if (!isset($data[$attribName])) return array();
$retArray = array();
foreach ($data[$attribName] as $v)
{
$retArray[] = self::_valueFromLdap($v);
}
return $retArray;
} else if (is_int($index)) {
if (!isset($data[$attribName])) {
return null;
} else if ($index >= 0 && $index<count($data[$attribName])) {
return self::_valueFromLdap($data[$attribName][$index]);
} else {
return null;
}
}
return null;
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Attribute.php 17831 2009-08-26 15:24:30Z sgehrig $
*/
/**
* Zend_Ldap_Attribute is a collection of LDAP attribute related functions.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Attribute
{
const PASSWORD_HASH_MD5 = 'md5';
const PASSWORD_HASH_SMD5 = 'smd5';
const PASSWORD_HASH_SHA = 'sha';
const PASSWORD_HASH_SSHA = 'ssha';
const PASSWORD_UNICODEPWD = 'unicodePwd';
/**
* Sets a LDAP attribute.
*
* @param array $data
* @param string $attribName
* @param scalar|array|Traversable $value
* @param boolean $append
* @return void
*/
public static function setAttribute(array &$data, $attribName, $value, $append = false)
{
$attribName = strtolower($attribName);
$valArray = array();
if (is_array($value) || ($value instanceof Traversable))
{
foreach ($value as $v)
{
$v = self::_valueToLdap($v);
if (!is_null($v)) $valArray[] = $v;
}
}
else if (!is_null($value))
{
$value = self::_valueToLdap($value);
if (!is_null($value)) $valArray[] = $value;
}
if ($append === true && isset($data[$attribName]))
{
if (is_string($data[$attribName])) $data[$attribName] = array($data[$attribName]);
$data[$attribName] = array_merge($data[$attribName], $valArray);
}
else
{
$data[$attribName] = $valArray;
}
}
/**
* Gets a LDAP attribute.
*
* @param array $data
* @param string $attribName
* @param integer $index
* @return array|mixed
*/
public static function getAttribute(array $data, $attribName, $index = null)
{
$attribName = strtolower($attribName);
if (is_null($index)) {
if (!isset($data[$attribName])) return array();
$retArray = array();
foreach ($data[$attribName] as $v)
{
$retArray[] = self::_valueFromLdap($v);
}
return $retArray;
} else if (is_int($index)) {
if (!isset($data[$attribName])) {
return null;
} else if ($index >= 0 && $index<count($data[$attribName])) {
return self::_valueFromLdap($data[$attribName][$index]);
} else {
return null;
}
}
return null;
}
/**
* Checks if the given value(s) exist in the attribute
*
* @param array $data
* @param string $attribName
* @param array $data
* @param string $attribName
* @param mixed|array $value
* @return boolean
*/
@ -130,7 +133,7 @@ class Zend_Ldap_Attribute
/**
* Removes duplicate values from a LDAP attribute
*
* @param array $data
* @param array $data
* @param string $attribName
* @return void
*/
@ -139,226 +142,279 @@ class Zend_Ldap_Attribute
$attribName = strtolower($attribName);
if (!isset($data[$attribName])) return;
$data[$attribName] = array_values(array_unique($data[$attribName]));
}
/**
* Remove given values from a LDAP attribute
*
* @param array $data
* @param string $attribName
* @param mixed|array $value
* @return void
*/
public static function removeFromAttribute(array &$data, $attribName, $value)
{
$attribName = strtolower($attribName);
}
/**
* Remove given values from a LDAP attribute
*
* @param array $data
* @param string $attribName
* @param mixed|array $value
* @return void
*/
public static function removeFromAttribute(array &$data, $attribName, $value)
{
$attribName = strtolower($attribName);
if (!isset($data[$attribName])) return;
if (is_scalar($value)) {
$value = array($value);
}
$valArray = array();
foreach ($value as $v)
{
$v = self::_valueToLdap($v);
if ($v !== null) $valArray[] = $v;
}
$resultArray = $data[$attribName];
foreach ($valArray as $rv) {
$keys = array_keys($resultArray, $rv);
foreach ($keys as $k) {
unset($resultArray[$k]);
}
}
$resultArray = array_values($resultArray);
$data[$attribName] = $resultArray;
}
private static function _valueToLdap($value)
{
if (is_string($value)) return $value;
else if (is_int($value) || is_float($value)) return (string)$value;
else if (is_bool($value)) return ($value === true) ? 'TRUE' : 'FALSE';
else if (is_object($value) || is_array($value)) return serialize($value);
else if (is_resource($value) && get_resource_type($value) === 'stream')
return stream_get_contents($value);
else return null;
}
private static function _valueFromLdap($value)
{
$value = (string)$value;
if ($value === 'TRUE') return true;
else if ($value === 'FALSE') return false;
else return $value;
}
/**
* Converts a PHP data type into its LDAP representation
*
* @param mixed $value
* @return string|null - null if the PHP data type cannot be converted.
*/
public static function convertToLdapValue($value)
{
return self::_valueToLdap($value);
}
/**
* Converts an LDAP value into its PHP data type
*
* @param string $value
* @return mixed
*/
public static function convertFromLdapValue($value)
{
return self::_valueFromLdap($value);
}
/**
* Converts a timestamp into its LDAP date/time representation
*
* @param integer $value
* @param boolean $utc
* @return string|null - null if the value cannot be converted.
*/
public static function convertToLdapDateTimeValue($value, $utc = false)
{
return self::_valueToLdapDateTime($value, $utc);
}
/**
* Converts LDAP date/time representation into a timestamp
*
* @param string $value
* @return integer|null - null if the value cannot be converted.
*/
public static function convertFromLdapDateTimeValue($value)
{
return self::_valueFromLdapDateTime($value);
}
/**
* Sets a LDAP password.
*
* @param array $data
* @param string $password
* @param string $hashType
* @param string $attribName
* @return null
*/
public static function setPassword(array &$data, $password, $hashType = self::PASSWORD_HASH_MD5,
$attribName = 'userPassword')
{
}
$valArray = array();
foreach ($value as $v)
{
$v = self::_valueToLdap($v);
if ($v !== null) $valArray[] = $v;
}
$resultArray = $data[$attribName];
foreach ($valArray as $rv) {
$keys = array_keys($resultArray, $rv);
foreach ($keys as $k) {
unset($resultArray[$k]);
}
}
$resultArray = array_values($resultArray);
$data[$attribName] = $resultArray;
}
/**
* @param mixed $value
* @return string|null
*/
private static function _valueToLdap($value)
{
if (is_string($value)) return $value;
else if (is_int($value) || is_float($value)) return (string)$value;
else if (is_bool($value)) return ($value === true) ? 'TRUE' : 'FALSE';
else if (is_object($value) || is_array($value)) return serialize($value);
else if (is_resource($value) && get_resource_type($value) === 'stream')
return stream_get_contents($value);
else return null;
}
/**
* @param string $value
* @return string|boolean
*/
private static function _valueFromLdap($value)
{
$value = (string)$value;
if ($value === 'TRUE') return true;
else if ($value === 'FALSE') return false;
else return $value;
}
/**
* Converts a PHP data type into its LDAP representation
*
* @param mixed $value
* @return string|null - null if the PHP data type cannot be converted.
*/
public static function convertToLdapValue($value)
{
return self::_valueToLdap($value);
}
/**
* Converts an LDAP value into its PHP data type
*
* @param string $value
* @return mixed
*/
public static function convertFromLdapValue($value)
{
return self::_valueFromLdap($value);
}
/**
* Converts a timestamp into its LDAP date/time representation
*
* @param integer $value
* @param boolean $utc
* @return string|null - null if the value cannot be converted.
*/
public static function convertToLdapDateTimeValue($value, $utc = false)
{
return self::_valueToLdapDateTime($value, $utc);
}
/**
* Converts LDAP date/time representation into a timestamp
*
* @param string $value
* @return integer|null - null if the value cannot be converted.
*/
public static function convertFromLdapDateTimeValue($value)
{
return self::_valueFromLdapDateTime($value);
}
/**
* Sets a LDAP password.
*
* @param array $data
* @param string $password
* @param string $hashType
* @param string|null $attribName
* @return null
*/
public static function setPassword(array &$data, $password, $hashType = self::PASSWORD_HASH_MD5,
$attribName = null)
{
if ($attribName === null) {
if ($hashType === self::PASSWORD_UNICODEPWD) {
$attribName = 'unicodePwd';
} else {
$attribName = 'userPassword';
}
}
$hash = self::createPassword($password, $hashType);
self::setAttribute($data, $attribName, $hash, false);
}
/**
* Creates a LDAP password.
*
* @param string $password
* @param string $hashType
* @return string
*/
public static function createPassword($password, $hashType = self::PASSWORD_HASH_MD5)
{
switch ($hashType) {
case self::PASSWORD_HASH_SHA:
$rawHash = sha1($password, true);
$method = '{SHA}';
break;
case self::PASSWORD_HASH_MD5:
default:
$rawHash = md5($password, true);
$method = '{MD5}';
break;
}
return $method . base64_encode($rawHash);
}
/**
* Sets a LDAP date/time attribute.
*
* @param array $data
* @param string $attribName
* @param integer|array $value
* @param boolean $utc
* @param boolean $append
* @return null
*/
public static function setDateTimeAttribute(array &$data, $attribName, $value, $utc = false,
$append = false)
{
$convertedValues = array();
if (is_array($value) || ($value instanceof Traversable))
{
foreach ($value as $v) {
$v = self::_valueToLdapDateTime($v, $utc);
if (!is_null($v)) $convertedValues[] = $v;
}
}
else if (!is_null($value)) {
$value = self::_valueToLdapDateTime($value, $utc);
if (!is_null($value)) $convertedValues[] = $value;
}
self::setAttribute($data, $attribName, $convertedValues, $append);
}
private static function _valueToLdapDateTime($value, $utc)
{
if (is_int($value)) {
if ($utc === true) return gmdate('YmdHis', $value) . 'Z';
else return date('YmdHisO', $value);
}
else return null;
}
/**
* Gets a LDAP date/time attribute.
*
* @param array $data
* @param string $attribName
* @param integer $index
* @return array|integer
*/
public static function getDateTimeAttribute(array $data, $attribName, $index = null)
{
$values = self::getAttribute($data, $attribName, $index);
if (is_array($values)) {
for ($i = 0; $i<count($values); $i++) {
$newVal = self::_valueFromLdapDateTime($values[$i]);
if (!is_null($newVal)) $values[$i] = $newVal;
}
}
else $values = self::_valueFromLdapDateTime($values);
return $values;
}
private static function _valueFromLdapDateTime($value)
{
$matches = array();
if (preg_match('/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})([+-]\d{4}|Z)$/', $value, $matches)) {
$year = $matches[1];
$month = $matches[2];
$day = $matches[3];
$hour = $matches[4];
$minute = $matches[5];
$second = $matches[6];
$timezone = $matches[7];
$date = gmmktime($hour, $minute, $second, $month, $day, $year);
if ($timezone !== 'Z') {
$tzDirection = substr($timezone, 0, 1);
$tzOffsetHour = substr($timezone, 1, 2);
$tzOffsetMinute = substr($timezone, 3, 2);
$tzOffset = ($tzOffsetHour*60*60) + ($tzOffsetMinute*60);
if ($tzDirection == '+') $date -= $tzOffset;
else if ($tzDirection == '-') $date += $tzOffset;
}
return $date;
}
else return null;
}
self::setAttribute($data, $attribName, $hash, false);
}
/**
* Creates a LDAP password.
*
* @param string $password
* @param string $hashType
* @return string
*/
public static function createPassword($password, $hashType = self::PASSWORD_HASH_MD5)
{
switch ($hashType) {
case self::PASSWORD_UNICODEPWD:
/* see:
* http://msdn.microsoft.com/en-us/library/cc223248(PROT.10).aspx
*/
$password = '"' . $password . '"';
if (function_exists('mb_convert_encoding')) {
$password = mb_convert_encoding($password, 'UTF-16LE', 'UTF-8');
} else if (function_exists('iconv')) {
$password = iconv('UTF-8', 'UTF-16LE', $password);
} else {
$len = strlen($password);
$new = '';
for($i=0; $i < $len; $i++) {
$new .= $password[$i] . "\x00";
}
$password = $new;
}
return $password;
case self::PASSWORD_HASH_SSHA:
$salt = substr(sha1(uniqid(mt_rand(), true), true), 0, 4);
$rawHash = sha1($password . $salt, true) . $salt;
$method = '{SSHA}';
break;
case self::PASSWORD_HASH_SHA:
$rawHash = sha1($password, true);
$method = '{SHA}';
break;
case self::PASSWORD_HASH_SMD5:
$salt = substr(sha1(uniqid(mt_rand(), true), true), 0, 4);
$rawHash = md5($password . $salt, true) . $salt;
$method = '{SMD5}';
break;
case self::PASSWORD_HASH_MD5:
default:
$rawHash = md5($password, true);
$method = '{MD5}';
break;
}
return $method . base64_encode($rawHash);
}
/**
* Sets a LDAP date/time attribute.
*
* @param array $data
* @param string $attribName
* @param integer|array|Traversable $value
* @param boolean $utc
* @param boolean $append
* @return null
*/
public static function setDateTimeAttribute(array &$data, $attribName, $value, $utc = false,
$append = false)
{
$convertedValues = array();
if (is_array($value) || ($value instanceof Traversable))
{
foreach ($value as $v) {
$v = self::_valueToLdapDateTime($v, $utc);
if (!is_null($v)) $convertedValues[] = $v;
}
}
else if (!is_null($value)) {
$value = self::_valueToLdapDateTime($value, $utc);
if (!is_null($value)) $convertedValues[] = $value;
}
self::setAttribute($data, $attribName, $convertedValues, $append);
}
/**
* @param integer $value
* @param boolean $utc
* @return string|null
*/
private static function _valueToLdapDateTime($value, $utc)
{
if (is_int($value)) {
if ($utc === true) return gmdate('YmdHis', $value) . 'Z';
else return date('YmdHisO', $value);
}
else return null;
}
/**
* Gets a LDAP date/time attribute.
*
* @param array $data
* @param string $attribName
* @param integer $index
* @return array|integer
*/
public static function getDateTimeAttribute(array $data, $attribName, $index = null)
{
$values = self::getAttribute($data, $attribName, $index);
if (is_array($values)) {
for ($i = 0; $i<count($values); $i++) {
$newVal = self::_valueFromLdapDateTime($values[$i]);
if (!is_null($newVal)) $values[$i] = $newVal;
}
}
else $values = self::_valueFromLdapDateTime($values);
return $values;
}
/**
* @param string $value
* @return integer|null
*/
private static function _valueFromLdapDateTime($value)
{
$matches = array();
if (preg_match('/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})([+-]\d{4}|Z)$/', $value, $matches)) {
$year = $matches[1];
$month = $matches[2];
$day = $matches[3];
$hour = $matches[4];
$minute = $matches[5];
$second = $matches[6];
$timezone = $matches[7];
$date = gmmktime($hour, $minute, $second, $month, $day, $year);
if ($timezone !== 'Z') {
$tzDirection = substr($timezone, 0, 1);
$tzOffsetHour = substr($timezone, 1, 2);
$tzOffsetMinute = substr($timezone, 3, 2);
$tzOffset = ($tzOffsetHour*60*60) + ($tzOffsetMinute*60);
if ($tzDirection == '+') $date -= $tzOffset;
else if ($tzDirection == '-') $date += $tzOffset;
}
return $date;
}
else return null;
}
}

View File

@ -1,197 +1,195 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Collection.php 16613 2009-07-10 06:55:41Z ralph $
*/
/**
* Zend_Ldap_Collection wraps a list of LDAP entries.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Collection implements Iterator, Countable
{
/**
* Iterator
*
* @var Zend_Ldap_Collection_Iterator_Interface
*/
protected $_iterator = null;
/**
* Current item number
*
* @var integer
*/
protected $_currentNumber = -1;
/**
* Container for item caching to speed up multiple iterations
*
* @var array
*/
protected $_cache = array();
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Collection.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
* Zend_Ldap_Collection wraps a list of LDAP entries.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Collection implements Iterator, Countable
{
/**
* Iterator
*
* @var Zend_Ldap_Collection_Iterator_Interface
*/
protected $_iterator = null;
/**
* Current item number
*
* @var integer
*/
protected $_currentNumber = -1;
/**
* Container for item caching to speed up multiple iterations
*
* @var array
*/
protected $_cache = array();
/**
* Constructor.
*
* @param Zend_Ldap $ldap
* @param Zend_Ldap_Collection_Iterator_Interface $iterator
* @return void
*/
public function __construct(Zend_Ldap_Collection_Iterator_Interface $iterator)
{
$this->_iterator = $iterator;
}
public function __destruct()
{
$this->close();
}
/**
* Closes the current result set
*
* @return boolean
*/
public function close()
{
return $this->_iterator->close();
}
/**
* Get all entries as an array
*
* @return array
*/
public function toArray()
{
$data = array();
foreach ($this as $item) {
$data[] = $item;
}
return $data;
}
/**
* Get first entry
*
* @return array
*/
public function getFirst()
{
if ($this->count()>0) {
$this->rewind();
return $this->current();
}
else return null;
}
/**
* Returns the number of items in current result
* Implements Countable
*
* @return int
*/
public function count()
{
return $this->_iterator->count();
}
/**
* Return the current result item
* Implements Iterator
*
* @return array
* @throws Zend_Ldap_Exception
*/
public function current()
{
if (!array_key_exists($this->_currentNumber, $this->_cache))
{
*/
public function __construct(Zend_Ldap_Collection_Iterator_Interface $iterator)
{
$this->_iterator = $iterator;
}
public function __destruct()
{
$this->close();
}
/**
* Closes the current result set
*
* @return boolean
*/
public function close()
{
return $this->_iterator->close();
}
/**
* Get all entries as an array
*
* @return array
*/
public function toArray()
{
$data = array();
foreach ($this as $item) {
$data[] = $item;
}
return $data;
}
/**
* Get first entry
*
* @return array
*/
public function getFirst()
{
if ($this->count()>0) {
$this->rewind();
return $this->current();
}
else return null;
}
/**
* Returns the number of items in current result
* Implements Countable
*
* @return int
*/
public function count()
{
return $this->_iterator->count();
}
/**
* Return the current result item
* Implements Iterator
*
* @return array
* @throws Zend_Ldap_Exception
*/
public function current()
{
if (!array_key_exists($this->_currentNumber, $this->_cache))
{
$this->_cache[$this->_currentNumber] =
$this->_createEntry($this->_iterator->current());
}
return $this->_cache[$this->_currentNumber];
$this->_createEntry($this->_iterator->current());
}
return $this->_cache[$this->_currentNumber];
}
/**
* Creates the data structure for the given entry data
*
* @param array $data
* @param array $data
* @return array
*/
protected function _createEntry(array $data)
{
return $data;
}
/**
* Return the result item key
* Implements Iterator
*
* @return int
*/
public function key()
{
return $this->_currentNumber;
}
/**
* Move forward to next result item
* Implements Iterator
*
* @throws Zend_Ldap_Exception
*/
public function next()
{
$this->_iterator->next();
$this->_currentNumber++;
}
/**
* Rewind the Iterator to the first result item
* Implements Iterator
*
* @throws Zend_Ldap_Exception
*/
public function rewind()
{
$this->_iterator->rewind();
$this->_currentNumber = 0;
}
/**
* Check if there is a current result item
* after calls to rewind() or next()
* Implements Iterator
*
* @return boolean
*/
public function valid()
}
/**
* Return the result item key
* Implements Iterator
*
* @return int
*/
public function key()
{
return $this->_currentNumber;
}
/**
* Move forward to next result item
* Implements Iterator
*
* @throws Zend_Ldap_Exception
*/
public function next()
{
$this->_iterator->next();
$this->_currentNumber++;
}
/**
* Rewind the Iterator to the first result item
* Implements Iterator
*
* @throws Zend_Ldap_Exception
*/
public function rewind()
{
$this->_iterator->rewind();
$this->_currentNumber = 0;
}
/**
* Check if there is a current result item
* after calls to rewind() or next()
* Implements Iterator
*
* @return boolean
*/
public function valid()
{
if (isset($this->_cache[$this->_currentNumber])) {
return true;
} else {
} else {
return $this->_iterator->valid();
}
}
}
}
}

View File

@ -1,40 +1,40 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Default.php 15546 2009-05-12 07:39:21Z sgehrig $
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Default.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
* @see Zend_Ldap_Collection_Iterator_Interface
*/
require_once 'Zend/Ldap/Collection/Iterator/Interface.php';
/**
require_once 'Zend/Ldap/Collection/Iterator/Interface.php';
/**
* Zend_Ldap_Collection_Iterator_Default is the default collection iterator implementation
* using ext/ldap
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Collection_Iterator_Default implements Zend_Ldap_Collection_Iterator_Interface
{
* using ext/ldap
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Collection_Iterator_Default implements Zend_Ldap_Collection_Iterator_Interface
{
/**
* LDAP Connection
*
@ -73,8 +73,8 @@ class Zend_Ldap_Collection_Iterator_Default implements Zend_Ldap_Collection_Iter
/**
* Constructor.
*
* @param Zend_Ldap $ldap
* @param resource $resultId
* @param Zend_Ldap $ldap
* @param resource $resultId
* @return void
*/
public function __construct(Zend_Ldap $ldap, $resultId)
@ -249,5 +249,5 @@ class Zend_Ldap_Collection_Iterator_Default implements Zend_Ldap_Collection_Iter
{
return (is_resource($this->_current) && is_string($this->_currentDn));
}
}

View File

@ -1,34 +1,34 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 13152 2008-12-11 11:28:02Z sgehrig $
*/
/**
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Interface.php 17826 2009-08-26 15:01:34Z sgehrig $
*/
/**
* Zend_Ldap_Collection_Iterator_Interface provides a contract for
* adapter specific collection iterators
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Ldap_Collection_Iterator_Interface extends Iterator, Countable
* adapter specific collection iterators
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
interface Zend_Ldap_Collection_Iterator_Interface extends Iterator, Countable
{
/**
* Closes the current result set

View File

@ -1,71 +1,71 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Converter.php 16613 2009-07-10 06:55:41Z ralph $
*/
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Converter.php 17826 2009-08-26 15:01:34Z sgehrig $
*/
/**
* Zend_Ldap_Converter is a collection of useful LDAP related conversion functions.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Converter
{
/**
* Converts all ASCII chars < 32 to "\HEX"
*
* @see Net_LDAP2_Util::asc2hex32() from Benedikt Hallinger <beni@php.net>
* @link http://pear.php.net/package/Net_LDAP2
* @author Benedikt Hallinger <beni@php.net>
*
* @param string $string String to convert
* @return string
*/
public static function ascToHex32($string)
{
for ($i = 0; $i<strlen($string); $i++) {
$char = substr($string, $i, 1);
if (ord($char)<32) {
$hex = dechex(ord($char));
if (strlen($hex) == 1) $hex = '0' . $hex;
$string = str_replace($char, '\\' . $hex, $string);
}
}
return $string;
}
/**
* Converts all Hex expressions ("\HEX") to their original ASCII characters
*
* @see Net_LDAP2_Util::hex2asc() from Benedikt Hallinger <beni@php.net>,
* heavily based on work from DavidSmith@byu.net
* @link http://pear.php.net/package/Net_LDAP2
* @author Benedikt Hallinger <beni@php.net>, heavily based on work from DavidSmith@byu.net
*
* @param string $string String to convert
* @return string
*/
public static function hex32ToAsc($string)
{
$string = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''", $string);
return $string;
}
/**
* Zend_Ldap_Converter is a collection of useful LDAP related conversion functions.
*
* @category Zend
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Converter
{
/**
* Converts all ASCII chars < 32 to "\HEX"
*
* @see Net_LDAP2_Util::asc2hex32() from Benedikt Hallinger <beni@php.net>
* @link http://pear.php.net/package/Net_LDAP2
* @author Benedikt Hallinger <beni@php.net>
*
* @param string $string String to convert
* @return string
*/
public static function ascToHex32($string)
{
for ($i = 0; $i<strlen($string); $i++) {
$char = substr($string, $i, 1);
if (ord($char)<32) {
$hex = dechex(ord($char));
if (strlen($hex) == 1) $hex = '0' . $hex;
$string = str_replace($char, '\\' . $hex, $string);
}
}
return $string;
}
/**
* Converts all Hex expressions ("\HEX") to their original ASCII characters
*
* @see Net_LDAP2_Util::hex2asc() from Benedikt Hallinger <beni@php.net>,
* heavily based on work from DavidSmith@byu.net
* @link http://pear.php.net/package/Net_LDAP2
* @author Benedikt Hallinger <beni@php.net>, heavily based on work from DavidSmith@byu.net
*
* @param string $string String to convert
* @return string
*/
public static function hex32ToAsc($string)
{
$string = preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''", $string);
return $string;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@
* @package Zend_Ldap
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 16880 2009-07-20 13:12:36Z mikaelkael $
* @version $Id: Exception.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
@ -118,8 +118,8 @@ class Zend_Ldap_Exception extends Zend_Exception
/**
* @param Zend_Ldap $ldap A Zend_Ldap object
* @param string $str An informtive exception message
* @param int $code An LDAP error code
* @param string $str An informtive exception message
* @param int $code An LDAP error code
*/
public function __construct(Zend_Ldap $ldap = null, $str = null, $code = 0)
{

View File

@ -1,265 +1,265 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Filter.php 16613 2009-07-10 06:55:41Z ralph $
*/
/**
* @see Zend_Ldap_Filter_String
*/
require_once 'Zend/Ldap/Filter/String.php';
/**
* Zend_Ldap_Filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter extends Zend_Ldap_Filter_String
{
const TYPE_EQUALS = '=';
const TYPE_GREATER = '>';
const TYPE_GREATEROREQUAL = '>=';
const TYPE_LESS = '<';
const TYPE_LESSOREQUAL = '<=';
const TYPE_APPROX = '~=';
/**
* Creates an 'equals' filter.
* (attr=value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function equals($attr, $value)
{
return new self($attr, $value, self::TYPE_EQUALS, null, null);
}
/**
* Creates a 'begins with' filter.
* (attr=value*)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function begins($attr, $value)
{
return new self($attr, $value, self::TYPE_EQUALS, null, '*');
}
/**
* Creates an 'ends with' filter.
* (attr=*value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function ends($attr, $value)
{
return new self($attr, $value, self::TYPE_EQUALS, '*', null);
}
/**
* Creates a 'contains' filter.
* (attr=*value*)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function contains($attr, $value)
{
return new self($attr, $value, self::TYPE_EQUALS, '*', '*');
}
/**
* Creates a 'greater' filter.
* (attr>value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function greater($attr, $value)
{
return new self($attr, $value, self::TYPE_GREATER, null, null);
}
/**
* Creates a 'greater or equal' filter.
* (attr>=value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function greaterOrEqual($attr, $value)
{
return new self($attr, $value, self::TYPE_GREATEROREQUAL, null, null);
}
/**
* Creates a 'less' filter.
* (attr<value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function less($attr, $value)
{
return new self($attr, $value, self::TYPE_LESS, null, null);
}
/**
* Creates an 'less or equal' filter.
* (attr<=value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function lessOrEqual($attr, $value)
{
return new self($attr, $value, self::TYPE_LESSOREQUAL, null, null);
}
/**
* Creates an 'approx' filter.
* (attr~=value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function approx($attr, $value)
{
return new self($attr, $value, self::TYPE_APPROX, null, null);
}
/**
* Creates an 'any' filter.
* (attr=*)
*
* @param string $attr
* @return Zend_Ldap_Filter
*/
public static function any($attr)
{
return new self($attr, '', self::TYPE_EQUALS, '*', null);
}
/**
* Creates a simple custom string filter.
*
* @param string $filter
* @return Zend_Ldap_Filter_String
*/
public static function string($filter)
{
return new Zend_Ldap_Filter_String($filter);
}
/**
* Creates a simple string filter to be used with a mask.
*
* @param string $mask
* @param string $value
* @return Zend_Ldap_Filter_Mask
*/
public static function mask($mask, $value)
{
/**
* Zend_Ldap_Filter_Mask
*/
require_once 'Zend/Ldap/Filter/Mask.php';
return new Zend_Ldap_Filter_Mask($mask, $value);
}
/**
* Creates an 'and' filter.
*
* @param Zend_Ldap_Filter_Abstract $filter,...
* @return Zend_Ldap_Filter_And
*/
public static function andFilter($filter)
{
/**
* Zend_Ldap_Filter_And
*/
require_once 'Zend/Ldap/Filter/And.php';
return new Zend_Ldap_Filter_And(func_get_args());
}
/**
* Creates an 'or' filter.
*
* @param Zend_Ldap_Filter_Abstract $filter,...
* @return Zend_Ldap_Filter_Or
*/
public static function orFilter($filter)
{
/**
* Zend_Ldap_Filter_Or
*/
require_once 'Zend/Ldap/Filter/Or.php';
return new Zend_Ldap_Filter_Or(func_get_args());
}
/**
* Create a filter string.
*
* @param string $attr
* @param string $value
* @param string $filtertype
* @param string $prepend
* @param string $append
* @return string
*/
private static function _createFilterString($attr, $value, $filtertype, $prepend = null, $append = null)
{
$str = $attr . $filtertype;
if (!is_null($prepend)) $str .= $prepend;
$str .= self::escapeValue($value);
if (!is_null($append)) $str .= $append;
return $str;
}
/**
* Creates a new Zend_Ldap_Filter.
*
* @param string $attr
* @param string $value
* @param string $filtertype
* @param string $prepend
* @param string $append
*/
public function __construct($attr, $value, $filtertype, $prepend = null, $append = null)
{
$filter = self::_createFilterString($attr, $value, $filtertype, $prepend, $append);
parent::__construct($filter);
}
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Filter.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_String
*/
require_once 'Zend/Ldap/Filter/String.php';
/**
* Zend_Ldap_Filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter extends Zend_Ldap_Filter_String
{
const TYPE_EQUALS = '=';
const TYPE_GREATER = '>';
const TYPE_GREATEROREQUAL = '>=';
const TYPE_LESS = '<';
const TYPE_LESSOREQUAL = '<=';
const TYPE_APPROX = '~=';
/**
* Creates an 'equals' filter.
* (attr=value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function equals($attr, $value)
{
return new self($attr, $value, self::TYPE_EQUALS, null, null);
}
/**
* Creates a 'begins with' filter.
* (attr=value*)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function begins($attr, $value)
{
return new self($attr, $value, self::TYPE_EQUALS, null, '*');
}
/**
* Creates an 'ends with' filter.
* (attr=*value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function ends($attr, $value)
{
return new self($attr, $value, self::TYPE_EQUALS, '*', null);
}
/**
* Creates a 'contains' filter.
* (attr=*value*)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function contains($attr, $value)
{
return new self($attr, $value, self::TYPE_EQUALS, '*', '*');
}
/**
* Creates a 'greater' filter.
* (attr>value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function greater($attr, $value)
{
return new self($attr, $value, self::TYPE_GREATER, null, null);
}
/**
* Creates a 'greater or equal' filter.
* (attr>=value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function greaterOrEqual($attr, $value)
{
return new self($attr, $value, self::TYPE_GREATEROREQUAL, null, null);
}
/**
* Creates a 'less' filter.
* (attr<value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function less($attr, $value)
{
return new self($attr, $value, self::TYPE_LESS, null, null);
}
/**
* Creates an 'less or equal' filter.
* (attr<=value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function lessOrEqual($attr, $value)
{
return new self($attr, $value, self::TYPE_LESSOREQUAL, null, null);
}
/**
* Creates an 'approx' filter.
* (attr~=value)
*
* @param string $attr
* @param string $value
* @return Zend_Ldap_Filter
*/
public static function approx($attr, $value)
{
return new self($attr, $value, self::TYPE_APPROX, null, null);
}
/**
* Creates an 'any' filter.
* (attr=*)
*
* @param string $attr
* @return Zend_Ldap_Filter
*/
public static function any($attr)
{
return new self($attr, '', self::TYPE_EQUALS, '*', null);
}
/**
* Creates a simple custom string filter.
*
* @param string $filter
* @return Zend_Ldap_Filter_String
*/
public static function string($filter)
{
return new Zend_Ldap_Filter_String($filter);
}
/**
* Creates a simple string filter to be used with a mask.
*
* @param string $mask
* @param string $value
* @return Zend_Ldap_Filter_Mask
*/
public static function mask($mask, $value)
{
/**
* Zend_Ldap_Filter_Mask
*/
require_once 'Zend/Ldap/Filter/Mask.php';
return new Zend_Ldap_Filter_Mask($mask, $value);
}
/**
* Creates an 'and' filter.
*
* @param Zend_Ldap_Filter_Abstract $filter,...
* @return Zend_Ldap_Filter_And
*/
public static function andFilter($filter)
{
/**
* Zend_Ldap_Filter_And
*/
require_once 'Zend/Ldap/Filter/And.php';
return new Zend_Ldap_Filter_And(func_get_args());
}
/**
* Creates an 'or' filter.
*
* @param Zend_Ldap_Filter_Abstract $filter,...
* @return Zend_Ldap_Filter_Or
*/
public static function orFilter($filter)
{
/**
* Zend_Ldap_Filter_Or
*/
require_once 'Zend/Ldap/Filter/Or.php';
return new Zend_Ldap_Filter_Or(func_get_args());
}
/**
* Create a filter string.
*
* @param string $attr
* @param string $value
* @param string $filtertype
* @param string $prepend
* @param string $append
* @return string
*/
private static function _createFilterString($attr, $value, $filtertype, $prepend = null, $append = null)
{
$str = $attr . $filtertype;
if (!is_null($prepend)) $str .= $prepend;
$str .= self::escapeValue($value);
if (!is_null($append)) $str .= $append;
return $str;
}
/**
* Creates a new Zend_Ldap_Filter.
*
* @param string $attr
* @param string $value
* @param string $filtertype
* @param string $prepend
* @param string $append
*/
public function __construct($attr, $value, $filtertype, $prepend = null, $append = null)
{
$filter = self::_createFilterString($attr, $value, $filtertype, $prepend, $append);
parent::__construct($filter);
}
}

View File

@ -1,157 +1,157 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Abstract.php 13089 2008-12-07 14:00:24Z sgehrig $
*/
/**
* Zend_Ldap_Filter_Abstract provides a base implementation for filters.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Ldap_Filter_Abstract
{
/**
* Returns a string representation of the filter.
*
* @return string
*/
abstract public function toString();
/**
* Returns a string representation of the filter.
* @see toString()
*
* @return string
*/
public function __toString()
{
return $this->toString();
}
/**
* Negates the filter.
*
* @return Zend_Ldap_Filter_Abstract
*/
public function negate()
{
/**
* Zend_Ldap_Filter_Not
*/
require_once 'Zend/Ldap/Filter/Not.php';
return new Zend_Ldap_Filter_Not($this);
}
/**
* Creates an 'and' filter.
*
* @param Zend_Ldap_Filter_Abstract $filter,...
* @return Zend_Ldap_Filter_And
*/
public function addAnd($filter)
{
/**
* Zend_Ldap_Filter_And
*/
require_once 'Zend/Ldap/Filter/And.php';
$fa = func_get_args();
$args = array_merge(array($this), $fa);
return new Zend_Ldap_Filter_And($args);
}
/**
* Creates an 'or' filter.
*
* @param Zend_Ldap_Filter_Abstract $filter,...
* @return Zend_Ldap_Filter_Or
*/
public function addOr($filter)
{
/**
* Zend_Ldap_Filter_Or
*/
require_once 'Zend/Ldap/Filter/Or.php';
$fa = func_get_args();
$args = array_merge(array($this), $fa);
return new Zend_Ldap_Filter_Or($args);
}
/**
* Escapes the given VALUES according to RFC 2254 so that they can be safely used in LDAP filters.
*
* Any control characters with an ACII code < 32 as well as the characters with special meaning in
* LDAP filters "*", "(", ")", and "\" (the backslash) are converted into the representation of a
* backslash followed by two hex digits representing the hexadecimal value of the character.
* @see Net_LDAP2_Util::escape_filter_value() from Benedikt Hallinger <beni@php.net>
* @link http://pear.php.net/package/Net_LDAP2
* @author Benedikt Hallinger <beni@php.net>
*
* @param string|array $values Array of values to escape
* @return array Array $values, but escaped
*/
public static function escapeValue($values = array())
{
/**
* @see Zend_Ldap_Converter
*/
require_once 'Zend/Ldap/Converter.php';
if (!is_array($values)) $values = array($values);
foreach ($values as $key => $val) {
// Escaping of filter meta characters
$val = str_replace(array('\\', '*', '(', ')'), array('\5c', '\2a', '\28', '\29'), $val);
// ASCII < 32 escaping
$val = Zend_Ldap_Converter::ascToHex32($val);
if (null === $val) $val = '\0'; // apply escaped "null" if string is empty
$values[$key] = $val;
}
return (count($values) == 1) ? $values[0] : $values;
}
/**
* Undoes the conversion done by {@link escapeValue()}.
*
* Converts any sequences of a backslash followed by two hex digits into the corresponding character.
* @see Net_LDAP2_Util::escape_filter_value() from Benedikt Hallinger <beni@php.net>
* @link http://pear.php.net/package/Net_LDAP2
* @author Benedikt Hallinger <beni@php.net>
*
* @param string|array $values Array of values to escape
* @return array Array $values, but unescaped
*/
public static function unescapeValue($values = array())
{
/**
* @see Zend_Ldap_Converter
*/
require_once 'Zend/Ldap/Converter.php';
if (!is_array($values)) $values = array($values);
foreach ($values as $key => $value) {
// Translate hex code into ascii
$values[$key] = Zend_Ldap_Converter::hex32ToAsc($value);
}
return (count($values) == 1) ? $values[0] : $values;
}
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Abstract.php 17826 2009-08-26 15:01:34Z sgehrig $
*/
/**
* Zend_Ldap_Filter_Abstract provides a base implementation for filters.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Ldap_Filter_Abstract
{
/**
* Returns a string representation of the filter.
*
* @return string
*/
abstract public function toString();
/**
* Returns a string representation of the filter.
* @see toString()
*
* @return string
*/
public function __toString()
{
return $this->toString();
}
/**
* Negates the filter.
*
* @return Zend_Ldap_Filter_Abstract
*/
public function negate()
{
/**
* Zend_Ldap_Filter_Not
*/
require_once 'Zend/Ldap/Filter/Not.php';
return new Zend_Ldap_Filter_Not($this);
}
/**
* Creates an 'and' filter.
*
* @param Zend_Ldap_Filter_Abstract $filter,...
* @return Zend_Ldap_Filter_And
*/
public function addAnd($filter)
{
/**
* Zend_Ldap_Filter_And
*/
require_once 'Zend/Ldap/Filter/And.php';
$fa = func_get_args();
$args = array_merge(array($this), $fa);
return new Zend_Ldap_Filter_And($args);
}
/**
* Creates an 'or' filter.
*
* @param Zend_Ldap_Filter_Abstract $filter,...
* @return Zend_Ldap_Filter_Or
*/
public function addOr($filter)
{
/**
* Zend_Ldap_Filter_Or
*/
require_once 'Zend/Ldap/Filter/Or.php';
$fa = func_get_args();
$args = array_merge(array($this), $fa);
return new Zend_Ldap_Filter_Or($args);
}
/**
* Escapes the given VALUES according to RFC 2254 so that they can be safely used in LDAP filters.
*
* Any control characters with an ACII code < 32 as well as the characters with special meaning in
* LDAP filters "*", "(", ")", and "\" (the backslash) are converted into the representation of a
* backslash followed by two hex digits representing the hexadecimal value of the character.
* @see Net_LDAP2_Util::escape_filter_value() from Benedikt Hallinger <beni@php.net>
* @link http://pear.php.net/package/Net_LDAP2
* @author Benedikt Hallinger <beni@php.net>
*
* @param string|array $values Array of values to escape
* @return array Array $values, but escaped
*/
public static function escapeValue($values = array())
{
/**
* @see Zend_Ldap_Converter
*/
require_once 'Zend/Ldap/Converter.php';
if (!is_array($values)) $values = array($values);
foreach ($values as $key => $val) {
// Escaping of filter meta characters
$val = str_replace(array('\\', '*', '(', ')'), array('\5c', '\2a', '\28', '\29'), $val);
// ASCII < 32 escaping
$val = Zend_Ldap_Converter::ascToHex32($val);
if (null === $val) $val = '\0'; // apply escaped "null" if string is empty
$values[$key] = $val;
}
return (count($values) == 1) ? $values[0] : $values;
}
/**
* Undoes the conversion done by {@link escapeValue()}.
*
* Converts any sequences of a backslash followed by two hex digits into the corresponding character.
* @see Net_LDAP2_Util::escape_filter_value() from Benedikt Hallinger <beni@php.net>
* @link http://pear.php.net/package/Net_LDAP2
* @author Benedikt Hallinger <beni@php.net>
*
* @param string|array $values Array of values to escape
* @return array Array $values, but unescaped
*/
public static function unescapeValue($values = array())
{
/**
* @see Zend_Ldap_Converter
*/
require_once 'Zend/Ldap/Converter.php';
if (!is_array($values)) $values = array($values);
foreach ($values as $key => $value) {
// Translate hex code into ascii
$values[$key] = Zend_Ldap_Converter::hex32ToAsc($value);
}
return (count($values) == 1) ? $values[0] : $values;
}
}

View File

@ -1,48 +1,48 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: And.php 13089 2008-12-07 14:00:24Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_Logical
*/
require_once 'Zend/Ldap/Filter/Logical.php';
/**
* Zend_Ldap_Filter_And provides an 'and' filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_And extends Zend_Ldap_Filter_Logical
{
/**
* Creates an 'and' grouping filter.
*
* @param array $subfilters
*/
public function __construct(array $subfilters)
{
parent::__construct($subfilters, self::TYPE_AND);
}
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: And.php 17826 2009-08-26 15:01:34Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_Logical
*/
require_once 'Zend/Ldap/Filter/Logical.php';
/**
* Zend_Ldap_Filter_And provides an 'and' filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_And extends Zend_Ldap_Filter_Logical
{
/**
* Creates an 'and' grouping filter.
*
* @param array $subfilters
*/
public function __construct(array $subfilters)
{
parent::__construct($subfilters, self::TYPE_AND);
}
}

View File

@ -1,37 +1,37 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 13089 2008-12-07 14:00:24Z sgehrig $
*/
/**
* @see Zend_Exception
*/
require_once 'Zend/Exception.php';
/**
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_Exception extends Zend_Exception
{
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Exception.php 17826 2009-08-26 15:01:34Z sgehrig $
*/
/**
* @see Zend_Exception
*/
require_once 'Zend/Exception.php';
/**
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_Exception extends Zend_Exception
{
}

View File

@ -1,107 +1,107 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Logical.php 13089 2008-12-07 14:00:24Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_Abstract
*/
require_once 'Zend/Ldap/Filter/Abstract.php';
/**
* @see Zend_Ldap_Filter_String
*/
require_once 'Zend/Ldap/Filter/String.php';
/**
* Zend_Ldap_Filter_Logical provides a base implementation for a grouping filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Ldap_Filter_Logical extends Zend_Ldap_Filter_Abstract
{
const TYPE_AND = '&';
const TYPE_OR = '|';
/**
* All the sub-filters for this grouping filter.
*
* @var array
*/
private $_subfilters;
/**
* The grouping symbol.
*
* @var string
*/
private $_symbol;
/**
* Creates a new grouping filter.
*
* @param array $subfilters
* @param string $symbol
*/
protected function __construct(array $subfilters, $symbol)
{
foreach ($subfilters as $key => $s) {
if (is_string($s)) $subfilters[$key] = new Zend_Ldap_Filter_String($s);
else if (!($s instanceof Zend_Ldap_Filter_Abstract)) {
/**
* @see Zend_Ldap_Filter_Exception
*/
require_once 'Zend/Ldap/Filter/Exception.php';
throw new Zend_Ldap_Filter_Exception('Only strings or Zend_Ldap_Filter_Abstract allowed.');
}
}
$this->_subfilters = $subfilters;
$this->_symbol = $symbol;
}
/**
* Adds a filter to this grouping filter.
*
* @param Zend_Ldap_Filter_Abstract $filter
* @return Zend_Ldap_Filter_Logical
*/
public function addFilter(Zend_Ldap_Filter_Abstract $filter)
{
$new = clone $this;
$new->_subfilters[] = $filter;
return $new;
}
/**
* Returns a string representation of the filter.
*
* @return string
*/
public function toString()
{
$return = '(' . $this->_symbol;
foreach ($this->_subfilters as $sub) $return .= $sub->toString();
$return .= ')';
return $return;
}
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Logical.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_Abstract
*/
require_once 'Zend/Ldap/Filter/Abstract.php';
/**
* @see Zend_Ldap_Filter_String
*/
require_once 'Zend/Ldap/Filter/String.php';
/**
* Zend_Ldap_Filter_Logical provides a base implementation for a grouping filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Ldap_Filter_Logical extends Zend_Ldap_Filter_Abstract
{
const TYPE_AND = '&';
const TYPE_OR = '|';
/**
* All the sub-filters for this grouping filter.
*
* @var array
*/
private $_subfilters;
/**
* The grouping symbol.
*
* @var string
*/
private $_symbol;
/**
* Creates a new grouping filter.
*
* @param array $subfilters
* @param string $symbol
*/
protected function __construct(array $subfilters, $symbol)
{
foreach ($subfilters as $key => $s) {
if (is_string($s)) $subfilters[$key] = new Zend_Ldap_Filter_String($s);
else if (!($s instanceof Zend_Ldap_Filter_Abstract)) {
/**
* @see Zend_Ldap_Filter_Exception
*/
require_once 'Zend/Ldap/Filter/Exception.php';
throw new Zend_Ldap_Filter_Exception('Only strings or Zend_Ldap_Filter_Abstract allowed.');
}
}
$this->_subfilters = $subfilters;
$this->_symbol = $symbol;
}
/**
* Adds a filter to this grouping filter.
*
* @param Zend_Ldap_Filter_Abstract $filter
* @return Zend_Ldap_Filter_Logical
*/
public function addFilter(Zend_Ldap_Filter_Abstract $filter)
{
$new = clone $this;
$new->_subfilters[] = $filter;
return $new;
}
/**
* Returns a string representation of the filter.
*
* @return string
*/
public function toString()
{
$return = '(' . $this->_symbol;
foreach ($this->_subfilters as $sub) $return .= $sub->toString();
$return .= ')';
return $return;
}
}

View File

@ -1,66 +1,66 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Mask.php 13089 2008-12-07 14:00:24Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_String
*/
require_once 'Zend/Ldap/Filter/String.php';
/**
* Zend_Ldap_Filter_Mask provides a simple string filter to be used with a mask.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_Mask extends Zend_Ldap_Filter_String
{
/**
* Creates a Zend_Ldap_Filter_String.
*
* @param string $mask
* @param string $value,...
*/
public function __construct($mask, $value)
{
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Mask.php 17826 2009-08-26 15:01:34Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_String
*/
require_once 'Zend/Ldap/Filter/String.php';
/**
* Zend_Ldap_Filter_Mask provides a simple string filter to be used with a mask.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_Mask extends Zend_Ldap_Filter_String
{
/**
* Creates a Zend_Ldap_Filter_String.
*
* @param string $mask
* @param string $value,...
*/
public function __construct($mask, $value)
{
$args = func_get_args();
array_shift($args);
for ($i = 0; $i<count($args); $i++) {
$args[$i] = self::escapeValue($args[$i]);
}
$filter = vsprintf($mask, $args);
parent::__construct($filter);
}
/**
* Returns a string representation of the filter.
*
* @return string
*/
public function toString()
{
return $this->_filter;
}
array_shift($args);
for ($i = 0; $i<count($args); $i++) {
$args[$i] = self::escapeValue($args[$i]);
}
$filter = vsprintf($mask, $args);
parent::__construct($filter);
}
/**
* Returns a string representation of the filter.
*
* @return string
*/
public function toString()
{
return $this->_filter;
}
}

View File

@ -1,75 +1,75 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Not.php 13089 2008-12-07 14:00:24Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_Abstract
*/
require_once 'Zend/Ldap/Filter/Abstract.php';
/**
* Zend_Ldap_Filter_Not provides a negation filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_Not extends Zend_Ldap_Filter_Abstract
{
/**
* The underlying filter.
*
* @var Zend_Ldap_Filter_Abstract
*/
private $_filter;
/**
* Creates a Zend_Ldap_Filter_Not.
*
* @param Zend_Ldap_Filter_Abstract $filter
*/
public function __construct(Zend_Ldap_Filter_Abstract $filter)
{
$this->_filter = $filter;
}
/**
* Negates the filter.
*
* @return Zend_Ldap_Filter_Abstract
*/
public function negate()
{
return $this->_filter;
}
/**
* Returns a string representation of the filter.
*
* @return string
*/
public function toString()
{
return '(!' . $this->_filter->toString() . ')';
}
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Not.php 17826 2009-08-26 15:01:34Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_Abstract
*/
require_once 'Zend/Ldap/Filter/Abstract.php';
/**
* Zend_Ldap_Filter_Not provides a negation filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_Not extends Zend_Ldap_Filter_Abstract
{
/**
* The underlying filter.
*
* @var Zend_Ldap_Filter_Abstract
*/
private $_filter;
/**
* Creates a Zend_Ldap_Filter_Not.
*
* @param Zend_Ldap_Filter_Abstract $filter
*/
public function __construct(Zend_Ldap_Filter_Abstract $filter)
{
$this->_filter = $filter;
}
/**
* Negates the filter.
*
* @return Zend_Ldap_Filter_Abstract
*/
public function negate()
{
return $this->_filter;
}
/**
* Returns a string representation of the filter.
*
* @return string
*/
public function toString()
{
return '(!' . $this->_filter->toString() . ')';
}
}

View File

@ -1,48 +1,48 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Or.php 13089 2008-12-07 14:00:24Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_Logical
*/
require_once 'Zend/Ldap/Filter/Logical.php';
/**
* Zend_Ldap_Filter_Or provides an 'or' filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_Or extends Zend_Ldap_Filter_Logical
{
/**
* Creates an 'or' grouping filter.
*
* @param array $subfilters
*/
public function __construct(array $subfilters)
{
parent::__construct($subfilters, self::TYPE_OR);
}
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Or.php 17826 2009-08-26 15:01:34Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_Logical
*/
require_once 'Zend/Ldap/Filter/Logical.php';
/**
* Zend_Ldap_Filter_Or provides an 'or' filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_Or extends Zend_Ldap_Filter_Logical
{
/**
* Creates an 'or' grouping filter.
*
* @param array $subfilters
*/
public function __construct(array $subfilters)
{
parent::__construct($subfilters, self::TYPE_OR);
}
}

View File

@ -1,65 +1,65 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: String.php 13089 2008-12-07 14:00:24Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_Abstract
*/
require_once 'Zend/Ldap/Filter/Abstract.php';
/**
* Zend_Ldap_Filter_String provides a simple custom string filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_String extends Zend_Ldap_Filter_Abstract
{
/**
* The filter.
*
* @var string
*/
protected $_filter;
/**
* Creates a Zend_Ldap_Filter_String.
*
* @param string $filter
*/
public function __construct($filter)
{
$this->_filter = $filter;
}
/**
* Returns a string representation of the filter.
*
* @return string
*/
public function toString()
{
return '(' . $this->_filter . ')';
}
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: String.php 17826 2009-08-26 15:01:34Z sgehrig $
*/
/**
* @see Zend_Ldap_Filter_Abstract
*/
require_once 'Zend/Ldap/Filter/Abstract.php';
/**
* Zend_Ldap_Filter_String provides a simple custom string filter.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Filter
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Filter_String extends Zend_Ldap_Filter_Abstract
{
/**
* The filter.
*
* @var string
*/
protected $_filter;
/**
* Creates a Zend_Ldap_Filter_String.
*
* @param string $filter
*/
public function __construct($filter)
{
$this->_filter = $filter;
}
/**
* Returns a string representation of the filter.
*
* @return string
*/
public function toString()
{
return '(' . $this->_filter . ')';
}
}

View File

@ -1,35 +1,35 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Ldif
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Encoder.php 13089 2008-12-07 14:00:24Z sgehrig $
*/
/**
* Zend_Ldap_Ldif_Encoder provides methods to encode and decode LDAP data into/from LDIF.
*
* @category Zend
* @subpackage Ldif
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Encoder.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
* Zend_Ldap_Ldif_Encoder provides methods to encode and decode LDAP data into/from LDIF.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Ldif
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Ldif_Encoder
* @subpackage Ldif
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Ldif_Encoder
{
/**
* Additional options used during encoding
@ -42,12 +42,15 @@ class Zend_Ldap_Ldif_Encoder
'wrap' => 78
);
/**
* @var boolean
*/
protected $_versionWritten = false;
/**
* Constructor.
*
* @param array $options Additional options used during encoding
* @param array $options Additional options used during encoding
* @return void
*/
protected function __construct(array $options = array())
@ -58,7 +61,7 @@ class Zend_Ldap_Ldif_Encoder
/**
* Decodes the string $string into an array of LDIF items
*
* @param string $string
* @param string $string
* @return array
*/
public static function decode($string)
@ -70,7 +73,7 @@ class Zend_Ldap_Ldif_Encoder
/**
* Decodes the string $string into an array of LDIF items
*
* @param string $string
* @param string $string
* @return array
*/
protected function _decode($string)
@ -137,8 +140,8 @@ class Zend_Ldap_Ldif_Encoder
/**
* Encode $value into a LDIF representation
*
* @param mixed $value The value to be encoded
* @param array $options Additional options used during encoding
* @param mixed $value The value to be encoded
* @param array $options Additional options used during encoding
* @return string The encoded value
*/
public static function encode($value, array $options = array())
@ -151,7 +154,7 @@ class Zend_Ldap_Ldif_Encoder
* Recursive driver which determines the type of value to be encoded
* and then dispatches to the appropriate method.
*
* @param $value mixed The value to be encoded
* @param mixed $value The value to be encoded
* @return string Encoded value
*/
protected function _encode($value)
@ -171,8 +174,8 @@ class Zend_Ldap_Ldif_Encoder
*
* @link http://www.faqs.org/rfcs/rfc2849.html
*
* @param string $string
* @param boolen $base64
* @param string $string
* @param boolen $base64
* @return string
*/
protected function _encodeString($string, &$base64 = null)
@ -229,8 +232,8 @@ class Zend_Ldap_Ldif_Encoder
*
* @link http://www.faqs.org/rfcs/rfc2849.html
*
* @param string $name
* @param array|string $value
* @param string $name
* @param array|string $value
* @return string
*/
protected function _encodeAttribute($name, $value)
@ -267,7 +270,7 @@ class Zend_Ldap_Ldif_Encoder
*
* @link http://www.faqs.org/rfcs/rfc2849.html
*
* @param array $attributes
* @param array $attributes
* @return string
*/
protected function _encodeAttributes(array $attributes)

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +1,23 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Node
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Abstract.php 13235 2008-12-14 16:27:27Z sgehrig $
* @subpackage Node
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Abstract.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
@ -27,19 +27,19 @@ require_once 'Zend/Ldap/Attribute.php';
/**
* @see Zend_Ldap_Dn
*/
require_once 'Zend/Ldap/Dn.php';
/**
* Zend_Ldap_Node_Abstract provides a bas eimplementation for LDAP nodes
*
* @category Zend
require_once 'Zend/Ldap/Dn.php';
/**
* Zend_Ldap_Node_Abstract provides a bas eimplementation for LDAP nodes
*
* @category Zend
* @package Zend_Ldap
* @subpackage Node
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
{
* @subpackage Node
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
{
protected static $_systemAttributes=array('createtimestamp', 'creatorsname',
'entrycsn', 'entrydn', 'entryuuid', 'hassubordinates', 'modifiersname',
'modifytimestamp', 'structuralobjectclass', 'subschemasubentry',
@ -66,8 +66,8 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
* Constructor is protected to enforce the use of factory methods.
*
* @param Zend_Ldap_Dn $dn
* @param array $data
* @param boolean $fromDataSource
* @param array $data
* @param boolean $fromDataSource
*/
protected function __construct(Zend_Ldap_Dn $dn, array $data, $fromDataSource)
{
@ -76,7 +76,7 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
}
/**
* @param array $data
* @param array $data
* @param boolean $fromDataSource
* @throws Zend_Ldap_Exception
*/
@ -95,7 +95,7 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
* This is an online method.
*
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node_Abstract *Provides a fluid interface*
* @return Zend_Ldap_Node_Abstract Provides a fluid interface
* @throws Zend_Ldap_Exception
*/
public function reload(Zend_Ldap $ldap = null)
@ -202,7 +202,7 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
*
* This is an offline method.
*
* @param boolean $includeSystemAttributes
* @param boolean $includeSystemAttributes
* @return array
*/
public function getAttributes($includeSystemAttributes = true)
@ -237,7 +237,7 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
/**
* Returns an array representation of the current node
*
* @param boolean $includeSystemAttributes
* @param boolean $includeSystemAttributes
* @return array
*/
public function toArray($includeSystemAttributes = true)
@ -249,7 +249,7 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
/**
* Returns a JSON representation of the current node
*
* @param boolean $includeSystemAttributes
* @param boolean $includeSystemAttributes
* @return string
*/
public function toJson($includeSystemAttributes = true)
@ -264,7 +264,7 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
*
* This is an offline method.
*
* @param boolean $includeSystemAttributes
* @param boolean $includeSystemAttributes
* @return array
*/
public function getData($includeSystemAttributes = true)
@ -291,7 +291,7 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
* true. In this case method returns false only if the attribute name is
* missing in the key-collection.
*
* @param string $name
* @param string $name
* @param boolean $emptyExists
* @return boolean
*/
@ -308,8 +308,8 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
/**
* Checks if the given value(s) exist in the attribute
*
* @param string $attribName
* @param mixed|array $value
* @param string $attribName
* @param mixed|array $value
* @return boolean
*/
public function attributeHasValue($attribName, $value)
@ -322,7 +322,7 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
*
* This is an offline method.
*
* @param string $name
* @param string $name
* @param integer $index
* @return mixed
* @throws Zend_Ldap_Exception
@ -342,7 +342,7 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
*
* This is an offline method.
*
* @param string $name
* @param string $name
* @param integer $index
* @return array|integer
* @throws Zend_Ldap_Exception
@ -358,7 +358,7 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
* This is an offline method.
*
* @param string $name
* @param mixed $value
* @param mixed $value
* @return null
* @throws BadMethodCallException
*/
@ -417,7 +417,7 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
* This is an offline method.
*
* @param string $name
* @param mixed $value
* @param mixed $value
* @return null
* @throws BadMethodCallException
*/
@ -481,5 +481,5 @@ abstract class Zend_Ldap_Node_Abstract implements ArrayAccess, Countable
public function count()
{
return count($this->_currentData);
}
}
}

View File

@ -17,7 +17,7 @@
* @subpackage Node
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ChildrenIterator.php 13152 2008-12-11 11:28:02Z sgehrig $
* @version $Id: ChildrenIterator.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
@ -46,7 +46,7 @@ class Zend_Ldap_Node_ChildrenIterator implements Iterator, Countable, RecursiveI
/**
* Constructor.
*
* @param array $data
* @param array $data
* @return void
*/
public function __construct(array $data)

View File

@ -1,46 +1,46 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Node
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Collection.php 13089 2008-12-07 14:00:24Z sgehrig $
*/
/**
* @see Zend_Ldap_Collection
*/
require_once 'Zend/Ldap/Collection.php';
/**
* Zend_Ldap_Node_Collection provides a collecion of nodes.
*
* @category Zend
* @subpackage Node
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Collection.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
* @see Zend_Ldap_Collection
*/
require_once 'Zend/Ldap/Collection.php';
/**
* Zend_Ldap_Node_Collection provides a collecion of nodes.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Node
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Node_Collection extends Zend_Ldap_Collection
{
* @subpackage Node
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Node_Collection extends Zend_Ldap_Collection
{
/**
* Creates the data structure for the given entry data
*
* @param array $data
* @param array $data
* @return Zend_Ldap_Node
*/
protected function _createEntry(array $data)
@ -52,16 +52,16 @@ class Zend_Ldap_Node_Collection extends Zend_Ldap_Collection
$node = Zend_Ldap_Node::fromArray($data, true);
$node->attachLdap($this->_iterator->getLdap());
return $node;
}
/**
* Return the child key (DN).
* Implements Iterator and RecursiveIterator
*
* @return string
*/
public function key()
{
return $this->_iterator->key();
}
}
/**
* Return the child key (DN).
* Implements Iterator and RecursiveIterator
*
* @return string
*/
public function key()
{
return $this->_iterator->key();
}
}

View File

@ -1,46 +1,46 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage RootDSE
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: RootDse.php 13449 2008-12-23 17:49:44Z sgehrig $
* @subpackage RootDSE
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: RootDse.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
* @see Zend_Ldap_Node_Abstract
*/
require_once 'Zend/Ldap/Node/Abstract.php';
/**
* Zend_Ldap_Node_RootDse provides a simple data-container for the RootDSE node.
*
* @category Zend
require_once 'Zend/Ldap/Node/Abstract.php';
/**
* Zend_Ldap_Node_RootDse provides a simple data-container for the RootDSE node.
*
* @category Zend
* @package Zend_Ldap
* @subpackage RootDSE
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Node_RootDse extends Zend_Ldap_Node_Abstract
* @subpackage RootDSE
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Node_RootDse extends Zend_Ldap_Node_Abstract
{
const SERVER_TYPE_GENERIC = 1;
const SERVER_TYPE_OPENLDAP = 2;
const SERVER_TYPE_ACTIVEDIRECTORY = 3;
const SERVER_TYPE_EDIRECTORY = 4;
/**
* Factory method to create the RootDSE.
*
@ -82,7 +82,7 @@ class Zend_Ldap_Node_RootDse extends Zend_Ldap_Node_Abstract
* Constructor is protected to enforce the use of factory methods.
*
* @param Zend_Ldap_Dn $dn
* @param array $data
* @param array $data
*/
protected function __construct(Zend_Ldap_Dn $dn, array $data)
{
@ -112,7 +112,7 @@ class Zend_Ldap_Node_RootDse extends Zend_Ldap_Node_Abstract
/**
* Determines if the version is supported
*
* @param string|int|array $versions version(s) to check
* @param string|int|array $versions version(s) to check
* @return boolean
*/
public function supportsVersion($versions)
@ -123,7 +123,7 @@ class Zend_Ldap_Node_RootDse extends Zend_Ldap_Node_Abstract
/**
* Determines if the sasl mechanism is supported
*
* @param string|array $mechlist SASL mechanisms to check
* @param string|array $mechlist SASL mechanisms to check
* @return boolean
*/
public function supportsSaslMechanism($mechlist)

View File

@ -17,7 +17,7 @@
* @subpackage RootDSE
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: OpenLdap.php 13449 2008-12-23 17:49:44Z sgehrig $
* @version $Id: OpenLdap.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
@ -60,7 +60,7 @@ class Zend_Ldap_Node_RootDse_OpenLdap extends Zend_Ldap_Node_RootDse
/**
* Determines if the control is supported
*
* @param string|array $oids control oid(s) to check
* @param string|array $oids control oid(s) to check
* @return boolean
*/
public function supportsControl($oids)
@ -71,7 +71,7 @@ class Zend_Ldap_Node_RootDse_OpenLdap extends Zend_Ldap_Node_RootDse
/**
* Determines if the extension is supported
*
* @param string|array $oids oid(s) to check
* @param string|array $oids oid(s) to check
* @return boolean
*/
public function supportsExtension($oids)
@ -82,7 +82,7 @@ class Zend_Ldap_Node_RootDse_OpenLdap extends Zend_Ldap_Node_RootDse
/**
* Determines if the feature is supported
*
* @param string|array $oids feature oid(s) to check
* @param string|array $oids feature oid(s) to check
* @return boolean
*/
public function supportsFeature($oids)

View File

@ -17,7 +17,7 @@
* @subpackage RootDSE
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: eDirectory.php 13449 2008-12-23 17:49:44Z sgehrig $
* @version $Id: eDirectory.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
@ -40,7 +40,7 @@ class Zend_Ldap_Node_RootDse_eDirectory extends Zend_Ldap_Node_RootDse
/**
* Determines if the extension is supported
*
* @param string|array $oids oid(s) to check
* @param string|array $oids oid(s) to check
* @return boolean
*/
public function supportsExtension($oids)

View File

@ -1,40 +1,40 @@
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Schema
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Schema.php 13449 2008-12-23 17:49:44Z sgehrig $
* @subpackage Schema
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Schema.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
* @see Zend_Ldap_Node_Abstract
*/
require_once 'Zend/Ldap/Node/Abstract.php';
/**
* Zend_Ldap_Node_Schema provides a simple data-container for the Schema node.
*
* @category Zend
require_once 'Zend/Ldap/Node/Abstract.php';
/**
* Zend_Ldap_Node_Schema provides a simple data-container for the Schema node.
*
* @category Zend
* @package Zend_Ldap
* @subpackage Schema
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Node_Schema extends Zend_Ldap_Node_Abstract
* @subpackage Schema
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Ldap_Node_Schema extends Zend_Ldap_Node_Abstract
{
const OBJECTCLASS_TYPE_UNKNOWN = 0;
const OBJECTCLASS_TYPE_STRUCTURAL = 1;
@ -77,8 +77,8 @@ class Zend_Ldap_Node_Schema extends Zend_Ldap_Node_Abstract
* Constructor is protected to enforce the use of factory methods.
*
* @param Zend_Ldap_Dn $dn
* @param array $data
* @param Zend_Ldap $ldap
* @param array $data
* @param Zend_Ldap $ldap
*/
protected function __construct(Zend_Ldap_Dn $dn, array $data, Zend_Ldap $ldap)
{
@ -90,8 +90,8 @@ class Zend_Ldap_Node_Schema extends Zend_Ldap_Node_Abstract
* Parses the schema
*
* @param Zend_Ldap_Dn $dn
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node_Schema *Provides a fluid interface*
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node_Schema Provides a fluid interface
*/
protected function _parseSchema(Zend_Ldap_Dn $dn, Zend_Ldap $ldap)
{

View File

@ -17,7 +17,7 @@
* @subpackage Schema
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: ActiveDirectory.php 13449 2008-12-23 17:49:44Z sgehrig $
* @version $Id: ActiveDirectory.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
@ -62,8 +62,8 @@ class Zend_Ldap_Node_Schema_ActiveDirectory extends Zend_Ldap_Node_Schema
* Parses the schema
*
* @param Zend_Ldap_Dn $dn
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node_Schema *Provides a fluid interface*
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node_Schema Provides a fluid interface
*/
protected function _parseSchema(Zend_Ldap_Dn $dn, Zend_Ldap $ldap)
{

View File

@ -17,7 +17,7 @@
* @subpackage Schema
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Item.php 13449 2008-12-23 17:49:44Z sgehrig $
* @version $Id: Item.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
@ -52,8 +52,8 @@ abstract class Zend_Ldap_Node_Schema_Item implements ArrayAccess, Countable
/**
* Sets the data
*
* @param array $data
* @return Zend_Ldap_Node_Schema_Item *Provides a fluid interface*
* @param array $data
* @return Zend_Ldap_Node_Schema_Item Provides a fluid interface
*/
public function setData(array $data)
{

View File

@ -17,7 +17,7 @@
* @subpackage Schema
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: OpenLdap.php 13453 2008-12-23 19:38:48Z sgehrig $
* @version $Id: OpenLdap.php 17829 2009-08-26 15:07:10Z sgehrig $
*/
/**
@ -80,8 +80,8 @@ class Zend_Ldap_Node_Schema_OpenLdap extends Zend_Ldap_Node_Schema
* Parses the schema
*
* @param Zend_Ldap_Dn $dn
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node_Schema *Provides a fluid interface*
* @param Zend_Ldap $ldap
* @return Zend_Ldap_Node_Schema Provides a fluid interface
*/
protected function _parseSchema(Zend_Ldap_Dn $dn, Zend_Ldap $ldap)
{
@ -172,7 +172,7 @@ class Zend_Ldap_Node_Schema_OpenLdap extends Zend_Ldap_Node_Schema
/**
* Parses an attributeType value
*
* @param string $value
* @param string $value
* @return array
*/
protected function _parseAttributeType($value)
@ -271,7 +271,7 @@ class Zend_Ldap_Node_Schema_OpenLdap extends Zend_Ldap_Node_Schema
* Resolves inheritance in objectClasses and attributes
*
* @param Zend_Ldap_Node_Schema_Item $node
* @param array $repository
* @param array $repository
*/
protected function _resolveInheritance(Zend_Ldap_Node_Schema_Item $node, array $repository)
{
@ -306,7 +306,7 @@ class Zend_Ldap_Node_Schema_OpenLdap extends Zend_Ldap_Node_Schema
/**
* Parses an ldapSyntaxes value
*
* @param string $value
* @param string $value
* @return array
*/
protected function _parseLdapSyntax($value)
@ -341,7 +341,7 @@ class Zend_Ldap_Node_Schema_OpenLdap extends Zend_Ldap_Node_Schema
/**
* Parses an matchingRules value
*
* @param string $value
* @param string $value
* @return array
*/
protected function _parseMatchingRule($value)
@ -381,7 +381,7 @@ class Zend_Ldap_Node_Schema_OpenLdap extends Zend_Ldap_Node_Schema
/**
* Parses an matchingRuleUse value
*
* @param string $value
* @param string $value
* @return array
*/
protected function _parseMatchingRuleUse($value)
@ -427,8 +427,8 @@ class Zend_Ldap_Node_Schema_OpenLdap extends Zend_Ldap_Node_Schema
/**
* Parse the given tokens into a data structure
*
* @param array $data
* @param array $tokens
* @param array $data
* @param array $tokens
* @return void
*/
protected function _parseLdapSchemaSyntax(array &$data, array $tokens)
@ -475,7 +475,7 @@ class Zend_Ldap_Node_Schema_OpenLdap extends Zend_Ldap_Node_Schema
/**
* Tokenizes the given value into an array
*
* @param string $value string
* @param string $value
* @return array tokens
*/
protected function _tokenizeString($value)