File indexing completed on 2024-12-29 05:27:47
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_Ldap 0017 * @subpackage Schema 0018 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0019 * @license http://framework.zend.com/license/new-bsd New BSD License 0020 * @version $Id$ 0021 */ 0022 0023 /** 0024 * @see Zend_Ldap_Node_Schema 0025 */ 0026 // require_once 'Zend/Ldap/Node/Schema.php'; 0027 /** 0028 * @see Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory 0029 */ 0030 // require_once 'Zend/Ldap/Node/Schema/AttributeType/ActiveDirectory.php'; 0031 /** 0032 * @see Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory 0033 */ 0034 // require_once 'Zend/Ldap/Node/Schema/ObjectClass/ActiveDirectory.php'; 0035 0036 /** 0037 * Zend_Ldap_Node_Schema_ActiveDirectory provides a simple data-container for the Schema node of 0038 * an Active Directory server. 0039 * 0040 * @category Zend 0041 * @package Zend_Ldap 0042 * @subpackage Schema 0043 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0044 * @license http://framework.zend.com/license/new-bsd New BSD License 0045 */ 0046 class Zend_Ldap_Node_Schema_ActiveDirectory extends Zend_Ldap_Node_Schema 0047 { 0048 /** 0049 * The attribute Types 0050 * 0051 * @var array 0052 */ 0053 protected $_attributeTypes = array(); 0054 /** 0055 * The object classes 0056 * 0057 * @var array 0058 */ 0059 protected $_objectClasses = array(); 0060 0061 /** 0062 * Parses the schema 0063 * 0064 * @param Zend_Ldap_Dn $dn 0065 * @param Zend_Ldap $ldap 0066 * @return Zend_Ldap_Node_Schema Provides a fluent interface 0067 */ 0068 protected function _parseSchema(Zend_Ldap_Dn $dn, Zend_Ldap $ldap) 0069 { 0070 parent::_parseSchema($dn, $ldap); 0071 foreach ($ldap->search('(objectClass=classSchema)', $dn, 0072 Zend_Ldap::SEARCH_SCOPE_ONE) as $node) { 0073 $val = new Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory($node); 0074 $this->_objectClasses[$val->getName()] = $val; 0075 } 0076 foreach ($ldap->search('(objectClass=attributeSchema)', $dn, 0077 Zend_Ldap::SEARCH_SCOPE_ONE) as $node) { 0078 $val = new Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory($node); 0079 $this->_attributeTypes[$val->getName()] = $val; 0080 } 0081 return $this; 0082 } 0083 0084 /** 0085 * Gets the attribute Types 0086 * 0087 * @return array 0088 */ 0089 public function getAttributeTypes() 0090 { 0091 return $this->_attributeTypes; 0092 } 0093 0094 /** 0095 * Gets the object classes 0096 * 0097 * @return array 0098 */ 0099 public function getObjectClasses() 0100 { 0101 return $this->_objectClasses; 0102 } 0103 }