web/lib/Zend/Ldap/Node/Schema/ActiveDirectory.php
changeset 64 162c1de6545a
parent 19 1c2f13fd785c
child 68 ecaf28ffe26e
equal deleted inserted replaced
63:5b37998e522e 64:162c1de6545a
       
     1 <?php
       
     2 /**
       
     3  * Zend Framework
       
     4  *
       
     5  * LICENSE
       
     6  *
       
     7  * This source file is subject to the new BSD license that is bundled
       
     8  * with this package in the file LICENSE.txt.
       
     9  * It is also available through the world-wide-web at this URL:
       
    10  * http://framework.zend.com/license/new-bsd
       
    11  * If you did not receive a copy of the license and are unable to
       
    12  * obtain it through the world-wide-web, please send an email
       
    13  * to license@zend.com so we can send you a copy immediately.
       
    14  *
       
    15  * @category   Zend
       
    16  * @package    Zend_Ldap
       
    17  * @subpackage Schema
       
    18  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    19  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    20  * @version    $Id: ActiveDirectory.php 20096 2010-01-06 02:05:09Z bkarwin $
       
    21  */
       
    22 
       
    23 /**
       
    24  * @see Zend_Ldap_Node_Schema
       
    25  */
       
    26 require_once 'Zend/Ldap/Node/Schema.php';
       
    27 /**
       
    28  * @see Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory
       
    29  */
       
    30 require_once 'Zend/Ldap/Node/Schema/AttributeType/ActiveDirectory.php';
       
    31 /**
       
    32  * @see Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory
       
    33  */
       
    34 require_once 'Zend/Ldap/Node/Schema/ObjectClass/ActiveDirectory.php';
       
    35 
       
    36 /**
       
    37  * Zend_Ldap_Node_Schema_ActiveDirectory provides a simple data-container for the Schema node of
       
    38  * an Active Directory server.
       
    39  *
       
    40  * @category   Zend
       
    41  * @package    Zend_Ldap
       
    42  * @subpackage Schema
       
    43  * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
       
    44  * @license    http://framework.zend.com/license/new-bsd     New BSD License
       
    45  */
       
    46 class Zend_Ldap_Node_Schema_ActiveDirectory extends Zend_Ldap_Node_Schema
       
    47 {
       
    48     /**
       
    49      * The attribute Types
       
    50      *
       
    51      * @var array
       
    52      */
       
    53     protected $_attributeTypes = array();
       
    54     /**
       
    55      * The object classes
       
    56      *
       
    57      * @var array
       
    58      */
       
    59     protected $_objectClasses = array();
       
    60 
       
    61     /**
       
    62      * Parses the schema
       
    63      *
       
    64      * @param  Zend_Ldap_Dn $dn
       
    65      * @param  Zend_Ldap    $ldap
       
    66      * @return Zend_Ldap_Node_Schema Provides a fluid interface
       
    67      */
       
    68     protected function _parseSchema(Zend_Ldap_Dn $dn, Zend_Ldap $ldap)
       
    69     {
       
    70         parent::_parseSchema($dn, $ldap);
       
    71         foreach ($ldap->search('(objectClass=classSchema)', $dn,
       
    72                 Zend_Ldap::SEARCH_SCOPE_ONE) as $node) {
       
    73             $val = new Zend_Ldap_Node_Schema_ObjectClass_ActiveDirectory($node);
       
    74             $this->_objectClasses[$val->getName()] = $val;
       
    75         }
       
    76         foreach ($ldap->search('(objectClass=attributeSchema)', $dn,
       
    77                 Zend_Ldap::SEARCH_SCOPE_ONE) as $node) {
       
    78             $val = new Zend_Ldap_Node_Schema_AttributeType_ActiveDirectory($node);
       
    79             $this->_attributeTypes[$val->getName()] = $val;
       
    80         }
       
    81         return $this;
       
    82     }
       
    83 
       
    84     /**
       
    85      * Gets the attribute Types
       
    86      *
       
    87      * @return array
       
    88      */
       
    89     public function getAttributeTypes()
       
    90     {
       
    91         return $this->_attributeTypes;
       
    92     }
       
    93 
       
    94     /**
       
    95      * Gets the object classes
       
    96      *
       
    97      * @return array
       
    98      */
       
    99     public function getObjectClasses()
       
   100     {
       
   101         return $this->_objectClasses;
       
   102     }
       
   103 }