diff -r 5b37998e522e -r 162c1de6545a web/lib/Zend/Ldap/Node/RootDse.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/lib/Zend/Ldap/Node/RootDse.php Fri Mar 11 15:05:35 2011 +0100 @@ -0,0 +1,158 @@ +getEntry($dn, array('*', '+'), true); + if (isset($data['domainfunctionality'])) { + /** + * @see Zend_Ldap_Node_RootDse_ActiveDirectory + */ + require_once 'Zend/Ldap/Node/RootDse/ActiveDirectory.php'; + return new Zend_Ldap_Node_RootDse_ActiveDirectory($dn, $data); + } else if (isset($data['dsaname'])) { + /** + * @see Zend_Ldap_Node_RootDse_ActiveDirectory + */ + require_once 'Zend/Ldap/Node/RootDse/eDirectory.php'; + return new Zend_Ldap_Node_RootDse_eDirectory($dn, $data); + } else if (isset($data['structuralobjectclass']) && + $data['structuralobjectclass'][0] === 'OpenLDAProotDSE') { + /** + * @see Zend_Ldap_Node_RootDse_OpenLdap + */ + require_once 'Zend/Ldap/Node/RootDse/OpenLdap.php'; + return new Zend_Ldap_Node_RootDse_OpenLdap($dn, $data); + } else { + return new self($dn, $data); + } + } + + /** + * Constructor. + * + * Constructor is protected to enforce the use of factory methods. + * + * @param Zend_Ldap_Dn $dn + * @param array $data + */ + protected function __construct(Zend_Ldap_Dn $dn, array $data) + { + parent::__construct($dn, $data, true); + } + + /** + * Gets the namingContexts. + * + * @return array + */ + public function getNamingContexts() + { + return $this->getAttribute('namingContexts', null); + } + + /** + * Gets the subschemaSubentry. + * + * @return string|null + */ + public function getSubschemaSubentry() + { + return $this->getAttribute('subschemaSubentry', 0); + } + + /** + * Determines if the version is supported + * + * @param string|int|array $versions version(s) to check + * @return boolean + */ + public function supportsVersion($versions) + { + return $this->attributeHasValue('supportedLDAPVersion', $versions); + } + + /** + * Determines if the sasl mechanism is supported + * + * @param string|array $mechlist SASL mechanisms to check + * @return boolean + */ + public function supportsSaslMechanism($mechlist) + { + return $this->attributeHasValue('supportedSASLMechanisms', $mechlist); + } + + /** + * Gets the server type + * + * @return int + */ + public function getServerType() + { + return self::SERVER_TYPE_GENERIC; + } + + /** + * Returns the schema DN + * + * @return Zend_Ldap_Dn + */ + public function getSchemaDn() + { + $schemaDn = $this->getSubschemaSubentry(); + /** + * @see Zend_Ldap_Dn + */ + require_once 'Zend/Ldap/Dn.php'; + return Zend_Ldap_Dn::fromString($schemaDn); + } +} \ No newline at end of file