ActiveDirectory.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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 RootDSE
  18. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id$
  21. */
  22. /**
  23. * @see Zend_Ldap_Node_RootDse
  24. */
  25. require_once 'Zend/Ldap/Node/RootDse.php';
  26. /**
  27. * Zend_Ldap_Node_RootDse provides a simple data-container for the RootDSE node of
  28. * an Active Directory server.
  29. *
  30. * @category Zend
  31. * @package Zend_Ldap
  32. * @subpackage RootDSE
  33. * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
  34. * @license http://framework.zend.com/license/new-bsd New BSD License
  35. */
  36. class Zend_Ldap_Node_RootDse_ActiveDirectory extends Zend_Ldap_Node_RootDse
  37. {
  38. /**
  39. * Gets the configurationNamingContext.
  40. *
  41. * @return string|null
  42. */
  43. public function getConfigurationNamingContext()
  44. {
  45. return $this->getAttribute('configurationNamingContext', 0);
  46. }
  47. /**
  48. * Gets the currentTime.
  49. *
  50. * @return string|null
  51. */
  52. public function getCurrentTime()
  53. {
  54. return $this->getAttribute('currentTime', 0);
  55. }
  56. /**
  57. * Gets the defaultNamingContext.
  58. *
  59. * @return string|null
  60. */
  61. public function getDefaultNamingContext()
  62. {
  63. return $this->getAttribute('defaultNamingContext', 0);
  64. }
  65. /**
  66. * Gets the dnsHostName.
  67. *
  68. * @return string|null
  69. */
  70. public function getDnsHostName()
  71. {
  72. return $this->getAttribute('dnsHostName', 0);
  73. }
  74. /**
  75. * Gets the domainControllerFunctionality.
  76. *
  77. * @return string|null
  78. */
  79. public function getDomainControllerFunctionality()
  80. {
  81. return $this->getAttribute('domainControllerFunctionality', 0);
  82. }
  83. /**
  84. * Gets the domainFunctionality.
  85. *
  86. * @return string|null
  87. */
  88. public function getDomainFunctionality()
  89. {
  90. return $this->getAttribute('domainFunctionality', 0);
  91. }
  92. /**
  93. * Gets the dsServiceName.
  94. *
  95. * @return string|null
  96. */
  97. public function getDsServiceName()
  98. {
  99. return $this->getAttribute('dsServiceName', 0);
  100. }
  101. /**
  102. * Gets the forestFunctionality.
  103. *
  104. * @return string|null
  105. */
  106. public function getForestFunctionality()
  107. {
  108. return $this->getAttribute('forestFunctionality', 0);
  109. }
  110. /**
  111. * Gets the highestCommittedUSN.
  112. *
  113. * @return string|null
  114. */
  115. public function getHighestCommittedUSN()
  116. {
  117. return $this->getAttribute('highestCommittedUSN', 0);
  118. }
  119. /**
  120. * Gets the isGlobalCatalogReady.
  121. *
  122. * @return string|null
  123. */
  124. public function getIsGlobalCatalogReady()
  125. {
  126. return $this->getAttribute('isGlobalCatalogReady', 0);
  127. }
  128. /**
  129. * Gets the isSynchronized.
  130. *
  131. * @return string|null
  132. */
  133. public function getIsSynchronized()
  134. {
  135. return $this->getAttribute('isSynchronized', 0);
  136. }
  137. /**
  138. * Gets the ldapServiceName.
  139. *
  140. * @return string|null
  141. */
  142. public function getLdapServiceName()
  143. {
  144. return $this->getAttribute('ldapServiceName', 0);
  145. }
  146. /**
  147. * Gets the rootDomainNamingContext.
  148. *
  149. * @return string|null
  150. */
  151. public function getRootDomainNamingContext()
  152. {
  153. return $this->getAttribute('rootDomainNamingContext', 0);
  154. }
  155. /**
  156. * Gets the schemaNamingContext.
  157. *
  158. * @return string|null
  159. */
  160. public function getSchemaNamingContext()
  161. {
  162. return $this->getAttribute('schemaNamingContext', 0);
  163. }
  164. /**
  165. * Gets the serverName.
  166. *
  167. * @return string|null
  168. */
  169. public function getServerName()
  170. {
  171. return $this->getAttribute('serverName', 0);
  172. }
  173. /**
  174. * Determines if the capability is supported
  175. *
  176. * @param string|string|array $oids capability(s) to check
  177. * @return boolean
  178. */
  179. public function supportsCapability($oids)
  180. {
  181. return $this->attributeHasValue('supportedCapabilities', $oids);
  182. }
  183. /**
  184. * Determines if the control is supported
  185. *
  186. * @param string|array $oids control oid(s) to check
  187. * @return boolean
  188. */
  189. public function supportsControl($oids)
  190. {
  191. return $this->attributeHasValue('supportedControl', $oids);
  192. }
  193. /**
  194. * Determines if the version is supported
  195. *
  196. * @param string|array $policies policy(s) to check
  197. * @return boolean
  198. */
  199. public function supportsPolicy($policies)
  200. {
  201. return $this->attributeHasValue('supportedLDAPPolicies', $policies);
  202. }
  203. /**
  204. * Gets the server type
  205. *
  206. * @return int
  207. */
  208. public function getServerType()
  209. {
  210. return self::SERVER_TYPE_ACTIVEDIRECTORY;
  211. }
  212. /**
  213. * Returns the schema DN
  214. *
  215. * @return Zend_Ldap_Dn
  216. */
  217. public function getSchemaDn()
  218. {
  219. $schemaDn = $this->getSchemaNamingContext();
  220. /**
  221. * @see Zend_Ldap_Dn
  222. */
  223. require_once 'Zend/Ldap/Dn.php';
  224. return Zend_Ldap_Dn::fromString($schemaDn);
  225. }
  226. }