ldap.php 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560
  1. <?php
  2. // Start of ldap v.
  3. /**
  4. * PASSWD extended operation helper
  5. * @link https://www.php.net/manual/en/function.ldap-exop-passwd.php
  6. * @param resource $link An LDAP link identifier, returned by ldap_connect().
  7. * @param string $user [optional] dn of the user to change the password of.
  8. * @param string $oldpw [optional] The old password of this user. May be omitted depending of server configuration.
  9. * @param string $newpw [optional] The new password for this user. May be omitted or empty to have a generated password.
  10. * @param array $serverctrls [optional] If provided, a password policy request control is send with the request and this is filled with an array of LDAP Controls returned with the request.
  11. * @return mixed Returns the generated password if newpw is empty or omitted. Otherwise returns TRUE on success and FALSE on failure.
  12. * @since 7.2
  13. */
  14. function ldap_exop_passwd ($link , $user = "" , $oldpw = "" , $newpw = "" , array &$serverctrls = []) {}
  15. /**
  16. * Refresh extended operation helper
  17. * @link https://www.php.net/manual/en/function.ldap-exop-refresh.php
  18. * @param resource $link An LDAP link identifier, returned by ldap_connect().
  19. * @param string $dn dn of the entry to refresh.
  20. * @param int $ttl $ttl Time in seconds (between 1 and 31557600) that the client requests that the entry exists in the directory before being automatically removed.
  21. * @return mixed From RFC: The responseTtl field is the time in seconds which the server chooses to have as the time-to-live field for that entry. It must not be any smaller than that which the client requested, and it may be larger. However, to allow servers to maintain a relatively accurate directory, and to prevent clients from abusing the dynamic extensions, servers are permitted to shorten a client-requested time-to-live value, down to a minimum of 86400 seconds (one day). FALSE will be returned on error.
  22. * @since 7.3
  23. */
  24. function ldap_exop_refresh ($link, $dn ,$ttl) {}
  25. /**
  26. * WHOAMI extended operation helper
  27. * @link https://www.php.net/manual/en/function.ldap-exop-whoami.php
  28. * @param resource $link An LDAP link identifier, returned by ldap_connect().
  29. * @return mixed The data returned by the server, or FALSE on error.
  30. * @since 7.2
  31. */
  32. function ldap_exop_whoami ($link) {}
  33. /**
  34. * Performs an extended operation on the specified link with reqoid the OID of the operation and reqdata the data.
  35. * @link https://www.php.net/manual/en/function.ldap-exop.php
  36. * @param resource $link An LDAP link identifier, returned by ldap_connect().
  37. * @param string $reqoid The extended operation request OID. You may use one of LDAP_EXOP_START_TLS, LDAP_EXOP_MODIFY_PASSWD, LDAP_EXOP_REFRESH, LDAP_EXOP_WHO_AM_I, LDAP_EXOP_TURN, or a string with the OID of the operation you want to send.
  38. * @param string $reqdata [optional] The extended operation request data. May be NULL for some operations like LDAP_EXOP_WHO_AM_I, may also need to be BER encoded.
  39. * @param array $serverctrls [optional] If provided, a password policy request control is send with the request and this is filled with an array of LDAP Controls returned with the request.
  40. * @param string $retdata [optional] Will be filled with the extended operation response data if provided. If not provided you may use ldap_parse_exop on the result object later to get this data.
  41. * @param string $retoid [optional] Will be filled with the response OID if provided, usually equal to the request OID.
  42. * @return mixed When used with retdata, returns TRUE on success or FALSE on error. When used without retdata, returns a result identifier or FALSE on error.
  43. * @since 7.2
  44. */
  45. function ldap_exop ($link , $reqoid , $reqdata = null , $serverctrls = [], &$retdata, &$retoid) {}
  46. /**
  47. * Parse LDAP extended operation data from result object result
  48. * @link https://www.php.net/manual/en/function.ldap-parse-exop.php
  49. * @param resource $link An LDAP link identifier, returned by ldap_connect().
  50. * @param resource $result An LDAP result resource, returned by ldap_exop().
  51. * @param string $retdata [optional] Will be filled by the response data.
  52. * @param string $retoid [optional] Will be filled by the response OID.
  53. * @return bool Returns TRUE on success or FALSE on failure.
  54. * @since 7.2
  55. */
  56. function ldap_parse_exop ($link , $result, &$retdata, &$retoid) {}
  57. /**
  58. * Translate 8859 characters to t61 characters
  59. * @link https://www.php.net/manual/en/function.ldap-8859-to-t61.php
  60. * @param string $value
  61. * @return string
  62. */
  63. function ldap_8859_to_t61($value) {}
  64. /**
  65. * Translate t61 characters to 8859 characters
  66. * @link https://www.php.net/manual/en/function.ldap-t61-to-8859.php
  67. * @param string $value
  68. * @return string
  69. */
  70. function ldap_t61_to_8859($value) {}
  71. /**
  72. * Connect to an LDAP server
  73. * @link https://php.net/manual/en/function.ldap-connect.php
  74. * @param string $hostname [optional] <p>
  75. * If you are using OpenLDAP 2.x.x you can specify a URL instead of the
  76. * hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL
  77. * support, configure PHP with SSL, and set this parameter as
  78. * ldaps://hostname/.
  79. * </p>
  80. * @param int $port [optional] <p>
  81. * The port to connect to. Not used when using URLs.
  82. * </p>
  83. * @return resource|false a positive LDAP link identifier on success, or <b>FALSE</b> on error.
  84. * When OpenLDAP 2.x.x is used, <b>ldap_connect</b> will always
  85. * return a resource as it does not actually connect but just
  86. * initializes the connecting parameters. The actual connect happens with
  87. * the next calls to ldap_* funcs, usually with
  88. * <b>ldap_bind</b>.
  89. * </p>
  90. * <p>
  91. * If no arguments are specified then the link identifier of the already
  92. * opened link will be returned.
  93. */
  94. function ldap_connect ($hostname = null, $port = 389) {}
  95. /**
  96. * Alias of <b>ldap_unbind</b>
  97. * @link https://php.net/manual/en/function.ldap-close.php
  98. * @param $link_identifier
  99. */
  100. function ldap_close ($link_identifier) {}
  101. /**
  102. * Bind to LDAP directory
  103. * @link https://php.net/manual/en/function.ldap-bind.php
  104. * @param resource $link_identifier <p>
  105. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  106. * </p>
  107. * @param string $bind_rdn [optional]
  108. * @param string $bind_password [optional]
  109. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  110. */
  111. function ldap_bind ($link_identifier, $bind_rdn = null, $bind_password = null) {}
  112. /**
  113. * Bind to LDAP directory
  114. * Does the same thing as ldap_bind() but returns the LDAP result resource to be parsed with ldap_parse_result().
  115. * @link https://php.net/manual/en/function.ldap-bind.php
  116. * @param resource $link_identifier <p>
  117. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  118. * </p>
  119. * @param string $bind_rdn [optional]
  120. * @param string $bind_password [optional]
  121. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  122. * @return resource|false
  123. * @since 7.3
  124. */
  125. function ldap_bind_ext ($link_identifier, $bind_rdn = null, $bind_password = null, $serverctrls = []) {}
  126. /**
  127. * Bind to LDAP directory using SASL
  128. * @link https://php.net/manual/en/function.ldap-sasl-bind.php
  129. * @param resource $link
  130. * @param string $binddn [optional]
  131. * @param string $password [optional]
  132. * @param string $sasl_mech [optional]
  133. * @param string $sasl_realm [optional]
  134. * @param string $sasl_authc_id [optional]
  135. * @param string $sasl_authz_id [optional]
  136. * @param string $props [optional]
  137. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  138. */
  139. function ldap_sasl_bind ($link, $binddn = null, $password = null, $sasl_mech = null, $sasl_realm = null, $sasl_authc_id = null, $sasl_authz_id = null, $props = null) {}
  140. /**
  141. * Unbind from LDAP directory
  142. * @link https://php.net/manual/en/function.ldap-unbind.php
  143. * @param resource $link_identifier <p>
  144. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  145. * </p>
  146. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  147. */
  148. function ldap_unbind ($link_identifier) {}
  149. /**
  150. * Read an entry
  151. * @link https://php.net/manual/en/function.ldap-read.php
  152. * @param resource $link_identifier <p>
  153. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  154. * </p>
  155. * @param string $base_dn <p>
  156. * The base DN for the directory.
  157. * </p>
  158. * @param string $filter <p>
  159. * An empty filter is not allowed. If you want to retrieve absolutely all
  160. * information for this entry, use a filter of
  161. * objectClass=*. If you know which entry types are
  162. * used on the directory server, you might use an appropriate filter such
  163. * as objectClass=inetOrgPerson.
  164. * </p>
  165. * @param array $attributes [optional] <p>
  166. * An array of the required attributes, e.g. array("mail", "sn", "cn").
  167. * Note that the "dn" is always returned irrespective of which attributes
  168. * types are requested.
  169. * </p>
  170. * <p>
  171. * Using this parameter is much more efficient than the default action
  172. * (which is to return all attributes and their associated values).
  173. * The use of this parameter should therefore be considered good
  174. * practice.
  175. * </p>
  176. * @param int $attrsonly [optional] <p>
  177. * Should be set to 1 if only attribute types are wanted. If set to 0
  178. * both attributes types and attribute values are fetched which is the
  179. * default behaviour.
  180. * </p>
  181. * @param int $sizelimit [optional] <p>
  182. * Enables you to limit the count of entries fetched. Setting this to 0
  183. * means no limit.
  184. * </p>
  185. * <p>
  186. * This parameter can NOT override server-side preset sizelimit. You can
  187. * set it lower though.
  188. * </p>
  189. * <p>
  190. * Some directory server hosts will be configured to return no more than
  191. * a preset number of entries. If this occurs, the server will indicate
  192. * that it has only returned a partial results set. This also occurs if
  193. * you use this parameter to limit the count of fetched entries.
  194. * </p>
  195. * @param int $timelimit [optional] <p>
  196. * Sets the number of seconds how long is spend on the search. Setting
  197. * this to 0 means no limit.
  198. * </p>
  199. * <p>
  200. * This parameter can NOT override server-side preset timelimit. You can
  201. * set it lower though.
  202. * </p>
  203. * @param int $deref [optional] <p>
  204. * Specifies how aliases should be handled during the search. It can be
  205. * one of the following:
  206. * <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
  207. * dereferenced.
  208. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  209. * @return resource|false a search result identifier or <b>FALSE</b> on error.
  210. */
  211. function ldap_read ($link_identifier, $base_dn, $filter, array $attributes = null, $attrsonly = null, $sizelimit = null, $timelimit = null, $deref = null, $serverctrls = []) {}
  212. /**
  213. * Single-level search
  214. * @link https://php.net/manual/en/function.ldap-list.php
  215. * @param resource $link_identifier <p>
  216. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  217. * </p>
  218. * @param string $base_dn <p>
  219. * The base DN for the directory.
  220. * </p>
  221. * @param string $filter
  222. * @param array $attributes [optional] <p>
  223. * An array of the required attributes, e.g. array("mail", "sn", "cn").
  224. * Note that the "dn" is always returned irrespective of which attributes
  225. * types are requested.
  226. * </p>
  227. * <p>
  228. * Using this parameter is much more efficient than the default action
  229. * (which is to return all attributes and their associated values).
  230. * The use of this parameter should therefore be considered good
  231. * practice.
  232. * </p>
  233. * @param int $attrsonly [optional] <p>
  234. * Should be set to 1 if only attribute types are wanted. If set to 0
  235. * both attributes types and attribute values are fetched which is the
  236. * default behaviour.
  237. * </p>
  238. * @param int $sizelimit [optional] <p>
  239. * Enables you to limit the count of entries fetched. Setting this to 0
  240. * means no limit.
  241. * </p>
  242. * <p>
  243. * This parameter can NOT override server-side preset sizelimit. You can
  244. * set it lower though.
  245. * </p>
  246. * <p>
  247. * Some directory server hosts will be configured to return no more than
  248. * a preset number of entries. If this occurs, the server will indicate
  249. * that it has only returned a partial results set. This also occurs if
  250. * you use this parameter to limit the count of fetched entries.
  251. * </p>
  252. * @param int $timelimit [optional] <p>
  253. * Sets the number of seconds how long is spend on the search. Setting
  254. * this to 0 means no limit.
  255. * </p>
  256. * <p>
  257. * This parameter can NOT override server-side preset timelimit. You can
  258. * set it lower though.
  259. * </p>
  260. * @param int $deref [optional] <p>
  261. * Specifies how aliases should be handled during the search. It can be
  262. * one of the following:
  263. * <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
  264. * dereferenced.
  265. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  266. * @return resource|false a search result identifier or <b>FALSE</b> on error.
  267. */
  268. function ldap_list ($link_identifier, $base_dn, $filter, array $attributes = null, $attrsonly = null, $sizelimit = null, $timelimit = null, $deref = null, $serverctrls = []) {}
  269. /**
  270. * Search LDAP tree
  271. * @link https://php.net/manual/en/function.ldap-search.php
  272. * @param resource $link_identifier <p>
  273. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  274. * </p>
  275. * @param string $base_dn <p>
  276. * The base DN for the directory.
  277. * </p>
  278. * @param string $filter <p>
  279. * The search filter can be simple or advanced, using boolean operators in
  280. * the format described in the LDAP documentation (see the Netscape Directory SDK for full
  281. * information on filters).
  282. * </p>
  283. * @param array $attributes [optional] <p>
  284. * An array of the required attributes, e.g. array("mail", "sn", "cn").
  285. * Note that the "dn" is always returned irrespective of which attributes
  286. * types are requested.
  287. * </p>
  288. * <p>
  289. * Using this parameter is much more efficient than the default action
  290. * (which is to return all attributes and their associated values).
  291. * The use of this parameter should therefore be considered good
  292. * practice.
  293. * </p>
  294. * @param int $attrsonly [optional] <p>
  295. * Should be set to 1 if only attribute types are wanted. If set to 0
  296. * both attributes types and attribute values are fetched which is the
  297. * default behaviour.
  298. * </p>
  299. * @param int $sizelimit [optional] <p>
  300. * Enables you to limit the count of entries fetched. Setting this to 0
  301. * means no limit.
  302. * </p>
  303. * <p>
  304. * This parameter can NOT override server-side preset sizelimit. You can
  305. * set it lower though.
  306. * </p>
  307. * <p>
  308. * Some directory server hosts will be configured to return no more than
  309. * a preset number of entries. If this occurs, the server will indicate
  310. * that it has only returned a partial results set. This also occurs if
  311. * you use this parameter to limit the count of fetched entries.
  312. * </p>
  313. * @param int $timelimit [optional] <p>
  314. * Sets the number of seconds how long is spend on the search. Setting
  315. * this to 0 means no limit.
  316. * </p>
  317. * <p>
  318. * This parameter can NOT override server-side preset timelimit. You can
  319. * set it lower though.
  320. * </p>
  321. * @param int $deref [optional] <p>
  322. * Specifies how aliases should be handled during the search. It can be
  323. * one of the following:
  324. * <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
  325. * dereferenced.
  326. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  327. * @return resource|false a search result identifier or <b>FALSE</b> on error.
  328. */
  329. function ldap_search ($link_identifier, $base_dn, $filter, array $attributes = null, $attrsonly = null, $sizelimit = null, $timelimit = null, $deref = null, $serverctrls = []) {}
  330. /**
  331. * Free result memory
  332. * @link https://php.net/manual/en/function.ldap-free-result.php
  333. * @param resource $result_identifier
  334. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  335. */
  336. function ldap_free_result ($result_identifier) {}
  337. /**
  338. * Count the number of entries in a search
  339. * @link https://php.net/manual/en/function.ldap-count-entries.php
  340. * @param resource $link_identifier <p>
  341. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  342. * </p>
  343. * @param resource $result_identifier <p>
  344. * The internal LDAP result.
  345. * </p>
  346. * @return int|false number of entries in the result or <b>FALSE</b> on error.
  347. */
  348. function ldap_count_entries ($link_identifier, $result_identifier) {}
  349. /**
  350. * Return first result id
  351. * @link https://php.net/manual/en/function.ldap-first-entry.php
  352. * @param resource $link_identifier <p>
  353. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  354. * </p>
  355. * @param resource $result_identifier
  356. * @return resource|false the result entry identifier for the first entry on success and
  357. * <b>FALSE</b> on error.
  358. */
  359. function ldap_first_entry ($link_identifier, $result_identifier) {}
  360. /**
  361. * Get next result entry
  362. * @link https://php.net/manual/en/function.ldap-next-entry.php
  363. * @param resource $link_identifier <p>
  364. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  365. * </p>
  366. * @param resource $result_entry_identifier
  367. * @return resource|false entry identifier for the next entry in the result whose entries
  368. * are being read starting with <b>ldap_first_entry</b>. If
  369. * there are no more entries in the result then it returns <b>FALSE</b>.
  370. */
  371. function ldap_next_entry ($link_identifier, $result_entry_identifier) {}
  372. /**
  373. * Get all result entries
  374. * @link https://php.net/manual/en/function.ldap-get-entries.php
  375. * @param resource $link_identifier <p>
  376. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  377. * </p>
  378. * @param resource $result_identifier
  379. * @return array a complete result information in a multi-dimensional array on
  380. * success and <b>FALSE</b> on error.
  381. * </p>
  382. * <p>
  383. * The structure of the array is as follows.
  384. * The attribute index is converted to lowercase. (Attributes are
  385. * case-insensitive for directory servers, but not when used as
  386. * array indices.)
  387. * <pre>
  388. * return_value["count"] = number of entries in the result
  389. * return_value[0] : refers to the details of first entry
  390. * return_value[i]["dn"] = DN of the ith entry in the result
  391. * return_value[i]["count"] = number of attributes in ith entry
  392. * return_value[i][j] = NAME of the jth attribute in the ith entry in the result
  393. * return_value[i]["attribute"]["count"] = number of values for
  394. * attribute in ith entry
  395. * return_value[i]["attribute"][j] = jth value of attribute in ith entry
  396. * </pre>
  397. */
  398. function ldap_get_entries ($link_identifier, $result_identifier) {}
  399. /**
  400. * Return first attribute
  401. * @link https://php.net/manual/en/function.ldap-first-attribute.php
  402. * @param resource $link_identifier <p>
  403. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  404. * </p>
  405. * @param resource $result_entry_identifier
  406. * @param int $dummy_ber [optional] is the identifier to internal memory location pointer. This parameter is no longer used as this is now handled automatically by PHP. For backwards compatibility PHP will not throw an error if this parameter is passed.
  407. * @return string|false the first attribute in the entry on success and <b>FALSE</b> on
  408. * error.
  409. */
  410. function ldap_first_attribute ($link_identifier, $result_entry_identifier, $dummy_ber = null) {}
  411. /**
  412. * Get the next attribute in result
  413. * @link https://php.net/manual/en/function.ldap-next-attribute.php
  414. * @param resource $link_identifier <p>
  415. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  416. * </p>
  417. * @param resource $result_entry_identifier
  418. * @param int $dummy_ber [optional] The internal state of the pointer is maintained by this parameter. This parameter is no longer used as this is now handled automatically by PHP. For backwards compatibility PHP will not throw an error if this parameter is passed.
  419. * @return string|false the next attribute in an entry on success and <b>FALSE</b> on
  420. * error.
  421. */
  422. function ldap_next_attribute ($link_identifier, $result_entry_identifier, $dummy_ber) {}
  423. /**
  424. * Get attributes from a search result entry
  425. * @link https://php.net/manual/en/function.ldap-get-attributes.php
  426. * @param resource $link_identifier <p>
  427. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  428. * </p>
  429. * @param resource $result_entry_identifier
  430. * @return array a complete entry information in a multi-dimensional array
  431. * on success and <b>FALSE</b> on error.
  432. */
  433. function ldap_get_attributes ($link_identifier, $result_entry_identifier) {}
  434. /**
  435. * Get all values from a result entry
  436. * @link https://php.net/manual/en/function.ldap-get-values.php
  437. * @param resource $link_identifier <p>
  438. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  439. * </p>
  440. * @param resource $result_entry_identifier
  441. * @param string $attribute
  442. * @return array|false an array of values for the attribute on success and <b>FALSE</b> on
  443. * error. The number of values can be found by indexing "count" in the
  444. * resultant array. Individual values are accessed by integer index in the
  445. * array. The first index is 0.
  446. * </p>
  447. * <p>
  448. * LDAP allows more than one entry for an attribute, so it can, for example,
  449. * store a number of email addresses for one person's directory entry all
  450. * labeled with the attribute "mail"
  451. * return_value["count"] = number of values for attribute
  452. * return_value[0] = first value of attribute
  453. * return_value[i] = ith value of attribute
  454. */
  455. function ldap_get_values ($link_identifier, $result_entry_identifier, $attribute) {}
  456. /**
  457. * Get all binary values from a result entry
  458. * @link https://php.net/manual/en/function.ldap-get-values-len.php
  459. * @param resource $link_identifier <p>
  460. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  461. * </p>
  462. * @param resource $result_entry_identifier
  463. * @param string $attribute
  464. * @return array|false an array of values for the attribute on success and <b>FALSE</b> on
  465. * error. Individual values are accessed by integer index in the array. The
  466. * first index is 0. The number of values can be found by indexing "count"
  467. * in the resultant array.
  468. */
  469. function ldap_get_values_len ($link_identifier, $result_entry_identifier, $attribute) {}
  470. /**
  471. * Get the DN of a result entry
  472. * @link https://php.net/manual/en/function.ldap-get-dn.php
  473. * @param resource $link_identifier <p>
  474. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  475. * </p>
  476. * @param resource $result_entry_identifier
  477. * @return string|false the DN of the result entry and <b>FALSE</b> on error.
  478. */
  479. function ldap_get_dn ($link_identifier, $result_entry_identifier) {}
  480. /**
  481. * Splits DN into its component parts
  482. * @link https://php.net/manual/en/function.ldap-explode-dn.php
  483. * @param string $dn <p>
  484. * The distinguished name of an LDAP entity.
  485. * </p>
  486. * @param int $with_attrib <p>
  487. * Used to request if the RDNs are returned with only values or their
  488. * attributes as well. To get RDNs with the attributes (i.e. in
  489. * attribute=value format) set <i>with_attrib</i> to 0
  490. * and to get only values set it to 1.
  491. * </p>
  492. * @return array an array of all DN components.
  493. * The first element in this array has count key and
  494. * represents the number of returned values, next elements are numerically
  495. * indexed DN components.
  496. */
  497. function ldap_explode_dn ($dn, $with_attrib) {}
  498. /**
  499. * Convert DN to User Friendly Naming format
  500. * @link https://php.net/manual/en/function.ldap-dn2ufn.php
  501. * @param string $dn <p>
  502. * The distinguished name of an LDAP entity.
  503. * </p>
  504. * @return string the user friendly name.
  505. */
  506. function ldap_dn2ufn ($dn) {}
  507. /**
  508. * Add entries to LDAP directory
  509. * @link https://php.net/manual/en/function.ldap-add.php
  510. * @param resource $link_identifier <p>
  511. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  512. * </p>
  513. * @param string $dn <p>
  514. * The distinguished name of an LDAP entity.
  515. * </p>
  516. * @param array $entry <p>
  517. * An array that specifies the information about the entry. The values in
  518. * the entries are indexed by individual attributes.
  519. * In case of multiple values for an attribute, they are indexed using
  520. * integers starting with 0.
  521. * <code>
  522. * $entree["attribut1"] = "value";
  523. * $entree["attribut2"][0] = "value1";
  524. * $entree["attribut2"][1] = "value2";
  525. * </code>
  526. * </p>
  527. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  528. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  529. */
  530. function ldap_add ($link_identifier, $dn, array $entry, $serverctrls = []) {}
  531. /**
  532. * Add entries to LDAP directory
  533. * Does the same thing as ldap_add() but returns the LDAP result resource to be parsed with ldap_parse_result().
  534. * @link https://www.php.net/manual/en/function.ldap-add-ext.php
  535. * @param resource $link_identifier <p>
  536. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  537. * </p>
  538. * @param string $dn <p>
  539. * The distinguished name of an LDAP entity.
  540. * </p>
  541. * @param array $entry <p>
  542. * An array that specifies the information about the entry. The values in
  543. * the entries are indexed by individual attributes.
  544. * In case of multiple values for an attribute, they are indexed using
  545. * integers starting with 0.
  546. * <code>
  547. * $entree["attribut1"] = "value";
  548. * $entree["attribut2"][0] = "value1";
  549. * $entree["attribut2"][1] = "value2";
  550. * </code>
  551. * </p>
  552. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  553. * @return resource|false
  554. * @since 7.4
  555. */
  556. function ldap_add_ext ($link_identifier, $dn, array $entry, $serverctrls = []) {}
  557. /**
  558. * Delete an entry from a directory
  559. * @link https://php.net/manual/en/function.ldap-delete.php
  560. * @param resource $link_identifier <p>
  561. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  562. * </p>
  563. * @param string $dn <p>
  564. * The distinguished name of an LDAP entity.
  565. * </p>
  566. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  567. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  568. */
  569. function ldap_delete ($link_identifier, $dn, $serverctrls = []) {}
  570. /**
  571. * Delete an entry from a directory
  572. * Does the same thing as ldap_delete() but returns the LDAP result resource to be parsed with ldap_parse_result().
  573. * @link https://php.net/manual/en/function.ldap-delete-ext.php
  574. * @param resource $link_identifier <p>
  575. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  576. * </p>
  577. * @param string $dn <p>
  578. * The distinguished name of an LDAP entity.
  579. * </p>
  580. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  581. * @return resource|false
  582. * @since 7.3
  583. */
  584. function ldap_delete_ext ($link_identifier, $dn, $serverctrls = []) {}
  585. /**
  586. * This function is an alias of: ldap_mod_replace().
  587. * Replace attribute values with new ones
  588. * @link https://php.net/manual/en/function.ldap-mod-replace.php
  589. * @param resource $link_identifier <p>
  590. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  591. * </p>
  592. * @param string $dn <p>
  593. * The distinguished name of an LDAP entity.
  594. * </p>
  595. * @param array $entry
  596. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  597. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  598. * @since 7.0
  599. */
  600. function ldap_modify ($link_identifier, $dn, array $entry, $serverctrls = []) {}
  601. /**
  602. * Add attribute values to current attributes
  603. * @link https://php.net/manual/en/function.ldap-mod-add.php
  604. * @param resource $link_identifier <p>
  605. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  606. * </p>
  607. * @param string $dn <p>
  608. * The distinguished name of an LDAP entity.
  609. * </p>
  610. * @param array $entry
  611. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  612. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  613. */
  614. function ldap_mod_add ($link_identifier, $dn, array $entry, $serverctrls = []) {}
  615. /**
  616. * Add attribute values to current attributes
  617. * Does the same thing as ldap_mod_add() but returns the LDAP result resource to be parsed with ldap_parse_result().
  618. * @link https://php.net/manual/en/function.ldap-mod-add-ext.php
  619. * @param resource $link_identifier <p>
  620. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  621. * </p>
  622. * @param string $dn <p>
  623. * The distinguished name of an LDAP entity.
  624. * </p>
  625. * @param array $entry
  626. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  627. * @return resource|false
  628. */
  629. function ldap_mod_add_ext ($link_identifier, $dn, array $entry, $serverctrls = []) {}
  630. /**
  631. * Replace attribute values with new ones
  632. * @link https://php.net/manual/en/function.ldap-mod-replace.php
  633. * @param resource $link_identifier <p>
  634. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  635. * </p>
  636. * @param string $dn <p>
  637. * The distinguished name of an LDAP entity.
  638. * </p>
  639. * @param array $entry
  640. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  641. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  642. */
  643. function ldap_mod_replace ($link_identifier, $dn, array $entry, $serverctrls = []) {}
  644. /**
  645. * Replace attribute values with new ones
  646. * Does the same thing as ldap_mod_replace() but returns the LDAP result resource to be parsed with ldap_parse_result().
  647. * @link https://php.net/manual/en/function.ldap-mod-replace-ext.php
  648. * @param resource $link_identifier <p>
  649. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  650. * </p>
  651. * @param string $dn <p>
  652. * The distinguished name of an LDAP entity.
  653. * </p>
  654. * @param array $entry
  655. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  656. * @return resource|false
  657. * @since 7.3
  658. */
  659. function ldap_mod_replace_ext ($link_identifier, $dn, array $entry, $serverctrls = []) {}
  660. /**
  661. * Delete attribute values from current attributes
  662. * @link https://php.net/manual/en/function.ldap-mod-del.php
  663. * @param resource $link_identifier <p>
  664. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  665. * </p>
  666. * @param string $dn <p>
  667. * The distinguished name of an LDAP entity.
  668. * </p>
  669. * @param array $entry
  670. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  671. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  672. */
  673. function ldap_mod_del ($link_identifier, $dn, array $entry, $serverctrls = []) {}
  674. /**
  675. * Delete attribute values from current attributes
  676. * Does the same thing as ldap_mod_del() but returns the LDAP result resource to be parsed with ldap_parse_result().
  677. * @link https://php.net/manual/en/function.ldap-mod-del-ext.php
  678. * @param resource $link_identifier <p>
  679. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  680. * </p>
  681. * @param string $dn <p>
  682. * The distinguished name of an LDAP entity.
  683. * </p>
  684. * @param array $entry
  685. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  686. * @return resource|false
  687. * @since 7.3
  688. */
  689. function ldap_mod_del_ext ($link_identifier, $dn, array $entry, $serverctrls = []) {}
  690. /**
  691. * Return the LDAP error number of the last LDAP command
  692. * @link https://php.net/manual/en/function.ldap-errno.php
  693. * @param resource $link_identifier <p>
  694. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  695. * </p>
  696. * @return int Return the LDAP error number of the last LDAP command for this
  697. * link.
  698. */
  699. function ldap_errno ($link_identifier) {}
  700. /**
  701. * Convert LDAP error number into string error message
  702. * @link https://php.net/manual/en/function.ldap-err2str.php
  703. * @param int $errno <p>
  704. * The error number.
  705. * </p>
  706. * @return string the error message, as a string.
  707. */
  708. function ldap_err2str ($errno) {}
  709. /**
  710. * Return the LDAP error message of the last LDAP command
  711. * @link https://php.net/manual/en/function.ldap-error.php
  712. * @param resource $link_identifier <p>
  713. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  714. * </p>
  715. * @return string string error message.
  716. */
  717. function ldap_error ($link_identifier) {}
  718. /**
  719. * Compare value of attribute found in entry specified with DN
  720. * @link https://php.net/manual/en/function.ldap-compare.php
  721. * @param resource $link_identifier <p>
  722. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  723. * </p>
  724. * @param string $dn <p>
  725. * The distinguished name of an LDAP entity.
  726. * </p>
  727. * @param string $attribute <p>
  728. * The attribute name.
  729. * </p>
  730. * @param string $value <p>
  731. * The compared value.
  732. * </p>
  733. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  734. * @return mixed <b>TRUE</b> if <i>value</i> matches otherwise returns
  735. * <b>FALSE</b>. Returns -1 on error.
  736. */
  737. function ldap_compare ($link_identifier, $dn, $attribute, $value, $serverctrls = []) {}
  738. /**
  739. * Sort LDAP result entries
  740. * @link https://php.net/manual/en/function.ldap-sort.php
  741. * @param resource $link <p>
  742. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  743. * </p>
  744. * @param resource $result <p>
  745. * An search result identifier, returned by
  746. * <b>ldap_search</b>.
  747. * </p>
  748. * @param string $sortfilter <p>
  749. * The attribute to use as a key in the sort.
  750. * </p>
  751. * @deprecated 7.0
  752. * @removed 8.0
  753. * @return bool
  754. */
  755. function ldap_sort ($link, $result, $sortfilter) {}
  756. /**
  757. * Modify the name of an entry
  758. * @link https://php.net/manual/en/function.ldap-rename.php
  759. * @param resource $link_identifier <p>
  760. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  761. * </p>
  762. * @param string $dn <p>
  763. * The distinguished name of an LDAP entity.
  764. * </p>
  765. * @param string $newrdn <p>
  766. * The new RDN.
  767. * </p>
  768. * @param string $newparent <p>
  769. * The new parent/superior entry.
  770. * </p>
  771. * @param bool $deleteoldrdn <p>
  772. * If <b>TRUE</b> the old RDN value(s) is removed, else the old RDN value(s)
  773. * is retained as non-distinguished values of the entry.
  774. * </p>
  775. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  776. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  777. */
  778. function ldap_rename ($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $serverctrls = []) {}
  779. /**
  780. * Modify the name of an entry
  781. * Does the same thing as ldap_rename() but returns the LDAP result resource to be parsed with ldap_parse_result().
  782. * @link https://php.net/manual/en/function.ldap-rename-ext.php
  783. * @param resource $link_identifier <p>
  784. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  785. * </p>
  786. * @param string $dn <p>
  787. * The distinguished name of an LDAP entity.
  788. * </p>
  789. * @param string $newrdn <p>
  790. * The new RDN.
  791. * </p>
  792. * @param string $newparent <p>
  793. * The new parent/superior entry.
  794. * </p>
  795. * @param bool $deleteoldrdn <p>
  796. * If <b>TRUE</b> the old RDN value(s) is removed, else the old RDN value(s)
  797. * is retained as non-distinguished values of the entry.
  798. * </p>
  799. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  800. * @return resource|false
  801. * @since 7.3
  802. */
  803. function ldap_rename_ext ($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn, $serverctrls = []) {}
  804. /**
  805. * Get the current value for given option
  806. * @link https://php.net/manual/en/function.ldap-get-option.php
  807. * @param resource $link_identifier <p>
  808. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  809. * </p>
  810. * @param int $option <p>
  811. * The parameter <i>option</i> can be one of:
  812. * <tr valign="top">
  813. * <td>Option</td>
  814. * <td>Type</td>
  815. * </tr>
  816. * <tr valign="top">
  817. * <td><b>LDAP_OPT_DEREF</b></td>
  818. * <td>integer</td>
  819. * </tr>
  820. * <tr valign="top">
  821. * <td><b>LDAP_OPT_SIZELIMIT</b></td>
  822. * <td>integer</td>
  823. * </tr>
  824. * <tr valign="top">
  825. * <td><b>LDAP_OPT_TIMELIMIT</b></td>
  826. * <td>integer</td>
  827. * </tr>
  828. * <tr valign="top">
  829. * <td><b>LDAP_OPT_NETWORK_TIMEOUT</b></td>
  830. * <td>integer</td>
  831. * </tr>
  832. * <tr valign="top">
  833. * <td><b>LDAP_OPT_PROTOCOL_VERSION</b></td>
  834. * <td>integer</td>
  835. * </tr>
  836. * <tr valign="top">
  837. * <td><b>LDAP_OPT_ERROR_NUMBER</b></td>
  838. * <td>integer</td>
  839. * </tr>
  840. * <tr valign="top">
  841. * <td><b>LDAP_OPT_REFERRALS</b></td>
  842. * <td>bool</td>
  843. * </tr>
  844. * <tr valign="top">
  845. * <td><b>LDAP_OPT_RESTART</b></td>
  846. * <td>bool</td>
  847. * </tr>
  848. * <tr valign="top">
  849. * <td><b>LDAP_OPT_HOST_NAME</b></td>
  850. * <td>string</td>
  851. * </tr>
  852. * <tr valign="top">
  853. * <td><b>LDAP_OPT_ERROR_STRING</b></td>
  854. * <td>string</td>
  855. * </tr>
  856. * <tr valign="top">
  857. * <td><b>LDAP_OPT_MATCHED_DN</b></td>
  858. * <td>string</td>
  859. * </tr>
  860. * <tr valign="top">
  861. * <td><b>LDAP_OPT_SERVER_CONTROLS</b></td>
  862. * <td>array</td>
  863. * </tr>
  864. * <tr valign="top">
  865. * <td><b>LDAP_OPT_CLIENT_CONTROLS</b></td>
  866. * <td>array</td>
  867. * </tr>
  868. * </p>
  869. * @param mixed $retval <p>
  870. * This will be set to the option value.
  871. * </p>
  872. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  873. */
  874. function ldap_get_option ($link_identifier, $option, &$retval) {}
  875. /**
  876. * Set the value of the given option
  877. * @link https://php.net/manual/en/function.ldap-set-option.php
  878. * @param resource $link_identifier <p>
  879. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  880. * </p>
  881. * @param int $option <p>
  882. * The parameter <i>option</i> can be one of:
  883. * <tr valign="top">
  884. * <td>Option</td>
  885. * <td>Type</td>
  886. * <td>Available since</td>
  887. * </tr>
  888. * <tr valign="top">
  889. * <td><b>LDAP_OPT_DEREF</b></td>
  890. * <td>integer</td>
  891. * <td></td>
  892. * </tr>
  893. * <tr valign="top">
  894. * <td><b>LDAP_OPT_SIZELIMIT</b></td>
  895. * <td>integer</td>
  896. * <td></td>
  897. * </tr>
  898. * <tr valign="top">
  899. * <td><b>LDAP_OPT_TIMELIMIT</b></td>
  900. * <td>integer</td>
  901. * <td></td>
  902. * </tr>
  903. * <tr valign="top">
  904. * <td><b>LDAP_OPT_NETWORK_TIMEOUT</b></td>
  905. * <td>integer</td>
  906. * <td>PHP 5.3.0</td>
  907. * </tr>
  908. * <tr valign="top">
  909. * <td><b>LDAP_OPT_PROTOCOL_VERSION</b></td>
  910. * <td>integer</td>
  911. * <td></td>
  912. * </tr>
  913. * <tr valign="top">
  914. * <td><b>LDAP_OPT_ERROR_NUMBER</b></td>
  915. * <td>integer</td>
  916. * <td></td>
  917. * </tr>
  918. * <tr valign="top">
  919. * <td><b>LDAP_OPT_REFERRALS</b></td>
  920. * <td>bool</td>
  921. * <td></td>
  922. * </tr>
  923. * <tr valign="top">
  924. * <td><b>LDAP_OPT_RESTART</b></td>
  925. * <td>bool</td>
  926. * <td></td>
  927. * </tr>
  928. * <tr valign="top">
  929. * <td><b>LDAP_OPT_HOST_NAME</b></td>
  930. * <td>string</td>
  931. * <td></td>
  932. * </tr>
  933. * <tr valign="top">
  934. * <td><b>LDAP_OPT_ERROR_STRING</b></td>
  935. * <td>string</td>
  936. * <td></td>
  937. * </tr>
  938. * <tr valign="top">
  939. * <td><b>LDAP_OPT_MATCHED_DN</b></td>
  940. * <td>string</td>
  941. * <td></td>
  942. * </tr>
  943. * <tr valign="top">
  944. * <td><b>LDAP_OPT_SERVER_CONTROLS</b></td>
  945. * <td>array</td>
  946. * <td></td>
  947. * </tr>
  948. * <tr valign="top">
  949. * <td><b>LDAP_OPT_CLIENT_CONTROLS</b></td>
  950. * <td>array</td>
  951. * <td></td>
  952. * </tr>
  953. * </p>
  954. * <p>
  955. * <b>LDAP_OPT_SERVER_CONTROLS</b> and
  956. * <b>LDAP_OPT_CLIENT_CONTROLS</b> require a list of
  957. * controls, this means that the value must be an array of controls. A
  958. * control consists of an oid identifying the control,
  959. * an optional value, and an optional flag for
  960. * criticality. In PHP a control is given by an
  961. * array containing an element with the key oid
  962. * and string value, and two optional elements. The optional
  963. * elements are key value with string value
  964. * and key iscritical with boolean value.
  965. * iscritical defaults to <b>FALSE</b>
  966. * if not supplied. See draft-ietf-ldapext-ldap-c-api-xx.txt
  967. * for details. See also the second example below.
  968. * </p>
  969. * @param mixed $newval <p>
  970. * The new value for the specified <i>option</i>.
  971. * </p>
  972. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  973. */
  974. function ldap_set_option ($link_identifier, $option, $newval) {}
  975. /**
  976. * Return first reference
  977. * @link https://php.net/manual/en/function.ldap-first-reference.php
  978. * @param resource $link
  979. * @param resource $result
  980. * @return resource
  981. */
  982. function ldap_first_reference ($link, $result) {}
  983. /**
  984. * Get next reference
  985. * @link https://php.net/manual/en/function.ldap-next-reference.php
  986. * @param resource $link
  987. * @param resource $entry
  988. * @return resource
  989. */
  990. function ldap_next_reference ($link, $entry) {}
  991. /**
  992. * Extract information from reference entry
  993. * @link https://php.net/manual/en/function.ldap-parse-reference.php
  994. * @param resource $link
  995. * @param resource $entry
  996. * @param array $referrals
  997. * @return bool
  998. */
  999. function ldap_parse_reference ($link, $entry, array &$referrals) {}
  1000. /**
  1001. * Extract information from result
  1002. * @link https://php.net/manual/en/function.ldap-parse-result.php
  1003. * @param resource $link
  1004. * @param resource $result
  1005. * @param int $errcode
  1006. * @param string $matcheddn [optional]
  1007. * @param string $errmsg [optional]
  1008. * @param array $referrals [optional]
  1009. * @param array $serverctrls [optional] An array of LDAP Controls which have been sent with the response.
  1010. * @return bool
  1011. */
  1012. function ldap_parse_result ($link, $result, &$errcode, &$matcheddn = null, &$errmsg = null, array &$referrals = null, &$serverctrls = []) {}
  1013. /**
  1014. * Start TLS
  1015. * @link https://php.net/manual/en/function.ldap-start-tls.php
  1016. * @param resource $link
  1017. * @return bool
  1018. */
  1019. function ldap_start_tls ($link) {}
  1020. /**
  1021. * Set a callback function to do re-binds on referral chasing
  1022. * @link https://php.net/manual/en/function.ldap-set-rebind-proc.php
  1023. * @param resource $link
  1024. * @param callable $callback
  1025. * @return bool
  1026. */
  1027. function ldap_set_rebind_proc ($link, callable $callback) {}
  1028. /**
  1029. * Send LDAP pagination control
  1030. * @link https://php.net/manual/en/function.ldap-control-paged-result.php
  1031. * @param resource $link <p>
  1032. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  1033. * </p>
  1034. * @param int $pagesize <p>
  1035. * The number of entries by page.
  1036. * </p>
  1037. * @param bool $iscritical [optional] <p>
  1038. * Indicates whether the pagination is critical of not.
  1039. * If true and if the server doesn't support pagination, the search
  1040. * will return no result.
  1041. * </p>
  1042. * @param string $cookie [optional] <p>
  1043. * An opaque structure sent by the server
  1044. * (<b>ldap_control_paged_result_response</b>).
  1045. * </p>
  1046. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1047. * @since 5.4
  1048. * @deprecated 7.4
  1049. */
  1050. function ldap_control_paged_result ($link, $pagesize, $iscritical = false, $cookie = "") {}
  1051. /**
  1052. * Retrieve the LDAP pagination cookie
  1053. * @link https://php.net/manual/en/function.ldap-control-paged-result-response.php
  1054. * @param resource $link <p>
  1055. * An LDAP link identifier, returned by <b>ldap_connect</b>.
  1056. * </p>
  1057. * @param resource $result
  1058. * @param string $cookie [optional] <p>
  1059. * An opaque structure sent by the server.
  1060. * </p>
  1061. * @param int $estimated [optional] <p>
  1062. * The estimated number of entries to retrieve.
  1063. * </p>
  1064. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1065. * @since 5.4
  1066. * @deprecated 7.4
  1067. */
  1068. function ldap_control_paged_result_response ($link, $result, &$cookie = null, &$estimated = null) {}
  1069. /**
  1070. * Escape a string for use in an LDAP filter or DN
  1071. * @param string $value The value to escape.
  1072. * @param string $ignore [optional] Characters to ignore when escaping.
  1073. * @param int $flags [optional] The context the escaped string will be used in: LDAP_ESCAPE_FILTER for filters to be used with ldap_search(), or LDAP_ESCAPE_DN for DNs. If neither flag is passed, all chars are escaped.
  1074. * @return string
  1075. * @since 5.6
  1076. */
  1077. function ldap_escape ($value, $ignore = "", $flags = 0) {}
  1078. /**
  1079. * (PHP 5.4 &gt;= 5.4.26, PHP 5.5 &gt;= 5.5.10, PHP 5.6 &gt;= 5.6.0)
  1080. * Batch and execute modifications on an LDAP entry
  1081. * @link https://php.net/manual/en/function.ldap-modify-batch.php
  1082. * @param $link_identifier <p>
  1083. * An LDAP link identifier, returned by
  1084. * {@see ldap_connect()}.
  1085. * </p>
  1086. * @param $dn <p>The distinguished name of an LDAP entity.</p>
  1087. * @param $entry <p>An array that specifies the modifications to make. Each entry in this
  1088. * array is an associative array with two or three keys:
  1089. * <em>attrib</em> maps to the name of the attribute to modify,
  1090. * <em>modtype</em> maps to the type of modification to perform,
  1091. * and (depending on the type of modification) <em>values</em>
  1092. * maps to an array of attribute values relevant to the modification.
  1093. * </p>
  1094. * <p>
  1095. * Possible values for <em>modtype</em> include:
  1096. * </p><dl>
  1097. *
  1098. *
  1099. * <dt>
  1100. * <b>LDAP_MODIFY_BATCH_ADD</b></dt>
  1101. *
  1102. * <dd>
  1103. *
  1104. * <p>
  1105. * Each value specified through <em>values</em> is added (as
  1106. * an additional value) to the attribute named by
  1107. * <em>attrib</em>.
  1108. * </p>
  1109. * </dd>
  1110. *
  1111. * <dt>
  1112. * <b>LDAP_MODIFY_BATCH_REMOVE</b></dt>
  1113. *
  1114. * <dd>
  1115. *
  1116. * <p>
  1117. * Each value specified through <em>values</em> is removed
  1118. * from the attribute named by <em>attrib</em>. Any value of
  1119. * the attribute not contained in the <em>values</em> array
  1120. * will remain untouched.
  1121. * </p>
  1122. * </dd>
  1123. * <dt>
  1124. * <b>LDAP_MODIFY_BATCH_REMOVE_ALL</b></dt>
  1125. *
  1126. * <dd>
  1127. *
  1128. * <p>
  1129. * All values are removed from the attribute named by
  1130. * <em>attrib</em>. A <em>values</em> entry must
  1131. * not be provided.
  1132. * </p>
  1133. * </dd>
  1134. *
  1135. * <dt>
  1136. * <b>LDAP_MODIFY_BATCH_REPLACE</b></dt>
  1137. *
  1138. * <dd>
  1139. *
  1140. * <p>
  1141. * All current values of the attribute named by
  1142. * <em>attrib</em> are replaced with the values specified
  1143. * through <em>values</em>.
  1144. * </p>
  1145. * </dd>
  1146. * </dl>
  1147. * <p>
  1148. * Note that any value for <em>attrib</em> must be a string, any
  1149. * value for <em>values</em> must be an array of strings, and
  1150. * any value for <em>modtype</em> must be one of the
  1151. * <b>LDAP_MODIFY_BATCH_*</b> constants listed above.
  1152. * </p></p>
  1153. * @param array $serverctrls [optional] Array of LDAP Controls to send with the request.
  1154. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
  1155. * @since 5.4
  1156. */
  1157. function ldap_modify_batch ( $link_identifier , $dn , $entry, $serverctrls = []) {}
  1158. /**
  1159. * @param resource $link_identifier
  1160. * @param resource $result_identifier
  1161. * @return int returns the number of reference messages in a search result.
  1162. * @since 8.0
  1163. */
  1164. function ldap_count_references($link_identifier, $result_identifier){}
  1165. define('LDAP_ESCAPE_FILTER', 1);
  1166. define ('LDAP_ESCAPE_DN', 2);
  1167. define ('LDAP_DEREF_NEVER', 0);
  1168. define ('LDAP_DEREF_SEARCHING', 1);
  1169. define ('LDAP_DEREF_FINDING', 2);
  1170. define ('LDAP_DEREF_ALWAYS', 3);
  1171. define ('LDAP_MODIFY_BATCH_REMOVE',2);
  1172. define('LDAP_MODIFY_BATCH_ADD', 1);
  1173. define('LDAP_MODIFY_BATCH_REMOVE_ALL', 18);
  1174. define('LDAP_MODIFY_BATCH_REPLACE', 3);
  1175. define('LDAP_OPT_X_TLS_REQUIRE_CERT', 24582);
  1176. define('LDAP_OPT_X_TLS_NEVER', 0);
  1177. define('LDAP_OPT_X_TLS_HARD', 1);
  1178. define('LDAP_OPT_X_TLS_DEMAND', 2);
  1179. define('LDAP_OPT_X_TLS_ALLOW', 3);
  1180. define('LDAP_OPT_X_TLS_TRY', 4);
  1181. define('LDAP_OPT_X_TLS_CERTFILE', 24580);
  1182. define('LDAP_OPT_X_TLS_CIPHER_SUITE', 24584);
  1183. define('LDAP_OPT_X_TLS_KEYFILE', 24581);
  1184. define('LDAP_OPT_X_TLS_DHFILE', 24590);
  1185. define('LDAP_OPT_X_TLS_CRLFILE', 24592);
  1186. define('LDAP_OPT_X_TLS_RANDOM_FILE', 24585);
  1187. define('LDAP_OPT_X_TLS_CRLCHECK', 24587);
  1188. define('LDAP_OPT_X_TLS_CRL_NONE', 0);
  1189. define('LDAP_OPT_X_TLS_CRL_PEER', 1);
  1190. define('LDAP_OPT_X_TLS_CRL_ALL', 2);
  1191. define('LDAP_OPT_X_TLS_PROTOCOL_MIN', 24583);
  1192. define('LDAP_OPT_X_TLS_PROTOCOL_SSL2', 512);
  1193. define('LDAP_OPT_X_TLS_PROTOCOL_SSL3', 768);
  1194. define('LDAP_OPT_X_TLS_PROTOCOL_TLS1_0', 769);
  1195. define('LDAP_OPT_X_TLS_PROTOCOL_TLS1_1', 770);
  1196. define('LDAP_OPT_X_TLS_PROTOCOL_TLS1_2', 771);
  1197. define('LDAP_OPT_X_TLS_PACKAGE', 24593);
  1198. define('LDAP_OPT_X_KEEPALIVE_IDLE', 25344);
  1199. define('LDAP_OPT_X_KEEPALIVE_PROBES', 25345);
  1200. define('LDAP_OPT_X_KEEPALIVE_INTERVAL', 25346);
  1201. define('LDAP_OPT_X_SASL_USERNAME', 24844);
  1202. define('LDAP_OPT_X_SASL_NOCANON', 24843);
  1203. /**
  1204. * Specifies alternative rules for following aliases at the server.
  1205. * @link https://php.net/manual/en/ldap.constants.php
  1206. */
  1207. define ('LDAP_OPT_DEREF', 2);
  1208. /**
  1209. * <p>
  1210. * Specifies the maximum number of entries that can be
  1211. * returned on a search operation.
  1212. * </p>
  1213. * The actual size limit for operations is also bounded
  1214. * by the server's configured maximum number of return entries.
  1215. * The lesser of these two settings is the actual size limit.
  1216. * @link https://php.net/manual/en/ldap.constants.php
  1217. */
  1218. define ('LDAP_OPT_SIZELIMIT', 3);
  1219. /**
  1220. * Specifies the number of seconds to wait for search results.
  1221. * The actual time limit for operations is also bounded
  1222. * by the server's configured maximum time.
  1223. * The lesser of these two settings is the actual time limit.
  1224. * @link https://php.net/manual/en/ldap.constants.php
  1225. */
  1226. define ('LDAP_OPT_TIMELIMIT', 4);
  1227. /**
  1228. * Option for <b>ldap_set_option</b> to allow setting network timeout.
  1229. * (Available as of PHP 5.3.0)
  1230. * @link https://php.net/manual/en/ldap.constants.php
  1231. */
  1232. define ('LDAP_OPT_NETWORK_TIMEOUT', 20485);
  1233. /**
  1234. * Specifies the LDAP protocol to be used (V2 or V3).
  1235. * @link https://php.net/manual/en/ldap.constants.php
  1236. */
  1237. define ('LDAP_OPT_PROTOCOL_VERSION', 17);
  1238. define ('LDAP_OPT_ERROR_NUMBER', 49);
  1239. /**
  1240. * Specifies whether to automatically follow referrals returned
  1241. * by the LDAP server.
  1242. * @link https://php.net/manual/en/ldap.constants.php
  1243. */
  1244. define ('LDAP_OPT_REFERRALS', 8);
  1245. define ('LDAP_OPT_RESTART', 9);
  1246. define ('LDAP_OPT_HOST_NAME', 48);
  1247. define ('LDAP_OPT_ERROR_STRING', 50);
  1248. define ('LDAP_OPT_MATCHED_DN', 51);
  1249. /**
  1250. * Specifies a default list of server controls to be sent with each request.
  1251. * @link https://php.net/manual/en/ldap.constants.php
  1252. */
  1253. define ('LDAP_OPT_SERVER_CONTROLS', 18);
  1254. /**
  1255. * Specifies a default list of client controls to be processed with each request.
  1256. * @link https://php.net/manual/en/ldap.constants.php
  1257. */
  1258. define ('LDAP_OPT_CLIENT_CONTROLS', 19);
  1259. /**
  1260. * Specifies a bitwise level for debug traces.
  1261. * @link https://php.net/manual/en/ldap.constants.php
  1262. */
  1263. define ('LDAP_OPT_DEBUG_LEVEL', 20481);
  1264. define ('LDAP_OPT_X_SASL_MECH', 24832);
  1265. define ('LDAP_OPT_X_SASL_REALM', 24833);
  1266. define ('LDAP_OPT_X_SASL_AUTHCID', 24834);
  1267. define ('LDAP_OPT_X_SASL_AUTHZID', 24835);
  1268. /**
  1269. * Specifies the path of the directory containing CA certificates.
  1270. * @link https://php.net/manual/en/ldap.constants.php
  1271. * @since 7.1
  1272. */
  1273. define('LDAP_OPT_X_TLS_CACERTDIR', 24579);
  1274. /**
  1275. * Specifies the full-path of the CA certificate file.
  1276. * @link https://php.net/manual/en/ldap.constants.php
  1277. * @since 7.1
  1278. */
  1279. define('LDAP_OPT_X_TLS_CACERTFILE', 24578);
  1280. define('LDAP_MODIFY_BATCH_ATTRIB', 'attrib');
  1281. define('LDAP_MODIFY_BATCH_MODTYPE', 'modtype');
  1282. define('LDAP_MODIFY_BATCH_VALUES', 'values');
  1283. define('LDAP_OPT_TIMEOUT', 20482);
  1284. define('LDAP_OPT_DIAGNOSTIC_MESSAGE', 50);
  1285. /**
  1286. * Control Constant - Manage DSA IT (» RFC 3296)
  1287. * @link https://php.net/manual/en/ldap.constants.php
  1288. * @since 7.3
  1289. */
  1290. define("LDAP_CONTROL_MANAGEDSAIT", "2.16.840.1.113730.3.4.2");
  1291. echo
  1292. /**
  1293. * Control Constant - Proxied Authorization (» RFC 4370)
  1294. * @link https://php.net/manual/en/ldap.constants.php
  1295. * @since 7.3
  1296. */
  1297. define("LDAP_CONTROL_PROXY_AUTHZ", "2.16.840.1.113730.3.4.18");
  1298. /**
  1299. * Control Constant - Subentries (» RFC 3672)
  1300. * @link https://php.net/manual/en/ldap.constants.php
  1301. * @since 7.3
  1302. */
  1303. define("LDAP_CONTROL_SUBENTRIES", "1.3.6.1.4.1.4203.1.10.1");
  1304. /**
  1305. * Control Constant - Filter returned values (» RFC 3876)
  1306. * @link https://php.net/manual/en/ldap.constants.php
  1307. * @since 7.3
  1308. */
  1309. define("LDAP_CONTROL_VALUESRETURNFILTER", "1.2.826.0.1.3344810.2.3");
  1310. /**
  1311. * Control Constant - Assertion (» RFC 4528)
  1312. * @link https://php.net/manual/en/ldap.constants.php
  1313. * @since 7.3
  1314. */
  1315. define("LDAP_CONTROL_ASSERT", "1.3.6.1.1.12");
  1316. /**
  1317. * Control Constant - Pre read (» RFC 4527)
  1318. * @link https://php.net/manual/en/ldap.constants.php
  1319. * @since 7.3
  1320. */
  1321. define("LDAP_CONTROL_PRE_READ", "1.3.6.1.1.13.1");
  1322. /**
  1323. * Control Constant - Post read (» RFC 4527)
  1324. * @link https://php.net/manual/en/ldap.constants.php
  1325. * @since 7.3
  1326. */
  1327. define("LDAP_CONTROL_POST_READ", "1.3.6.1.1.13.2");
  1328. /**
  1329. * Control Constant - Sort request (» RFC 2891)
  1330. * @link https://php.net/manual/en/ldap.constants.php
  1331. * @since 7.3
  1332. */
  1333. define("LDAP_CONTROL_SORTREQUEST", "1.2.840.113556.1.4.473");
  1334. /**
  1335. * Control Constant - Sort response (» RFC 2891)
  1336. * @link https://php.net/manual/en/ldap.constants.php
  1337. * @since 7.3
  1338. */
  1339. define("LDAP_CONTROL_SORTRESPONSE", "1.2.840.113556.1.4.474");
  1340. /**
  1341. * Control Constant - Paged results (» RFC 2696)
  1342. * @link https://php.net/manual/en/ldap.constants.php
  1343. * @since 7.3
  1344. */
  1345. define("LDAP_CONTROL_PAGEDRESULTS", "1.2.840.113556.1.4.319");
  1346. /**
  1347. * Control Constant - Content Synchronization Operation (» RFC 4533)
  1348. * @link https://php.net/manual/en/ldap.constants.php
  1349. * @since 7.3
  1350. */
  1351. define("LDAP_CONTROL_SYNC", "1.3.6.1.4.1.4203.1.9.1.1");
  1352. /**
  1353. * Control Constant - Content Synchronization Operation State (» RFC 4533)
  1354. * @link https://php.net/manual/en/ldap.constants.php
  1355. * @since 7.3
  1356. */
  1357. define("LDAP_CONTROL_SYNC_STATE", "1.3.6.1.4.1.4203.1.9.1.2");
  1358. /**
  1359. * Control Constant - Content Synchronization Operation Done (» RFC 4533)
  1360. * @link https://php.net/manual/en/ldap.constants.php
  1361. * @since 7.3
  1362. */
  1363. define("LDAP_CONTROL_SYNC_DONE", "1.3.6.1.4.1.4203.1.9.1.3");
  1364. /**
  1365. * Control Constant - Don't Use Copy (» RFC 6171)
  1366. * @link https://php.net/manual/en/ldap.constants.php
  1367. * @since 7.3
  1368. */
  1369. define("LDAP_CONTROL_DONTUSECOPY", "1.3.6.1.1.22");
  1370. /**
  1371. * Control Constant - Password Policy Request
  1372. * @link https://php.net/manual/en/ldap.constants.php
  1373. * @since 7.3
  1374. */
  1375. define("LDAP_CONTROL_PASSWORDPOLICYREQUEST", "1.3.6.1.4.1.42.2.27.8.5.1");
  1376. /**
  1377. * Control Constant - Password Policy Response
  1378. * @link https://php.net/manual/en/ldap.constants.php
  1379. * @since 7.3
  1380. */
  1381. define("LDAP_CONTROL_PASSWORDPOLICYRESPONSE", "1.3.6.1.4.1.42.2.27.8.5.1");
  1382. /**
  1383. * Control Constant - Active Directory Incremental Values
  1384. * @link https://php.net/manual/en/ldap.constants.php
  1385. * @since 7.3
  1386. */
  1387. define("LDAP_CONTROL_X_INCREMENTAL_VALUES", "1.2.840.113556.1.4.802");
  1388. /**
  1389. * Control Constant - Active Directory Domain Scope
  1390. * @link https://php.net/manual/en/ldap.constants.php
  1391. * @since 7.3
  1392. */
  1393. define("LDAP_CONTROL_X_DOMAIN_SCOPE", "1.2.840.113556.1.4.1339");
  1394. /**
  1395. * Control Constant - Active Directory Permissive Modify
  1396. * @link https://php.net/manual/en/ldap.constants.php
  1397. * @since 7.3
  1398. */
  1399. define("LDAP_CONTROL_X_PERMISSIVE_MODIFY", "1.2.840.113556.1.4.1413");
  1400. /**
  1401. * Control Constant - Active Directory Search Options
  1402. * @link https://php.net/manual/en/ldap.constants.php
  1403. * @since 7.3
  1404. */
  1405. define("LDAP_CONTROL_X_SEARCH_OPTIONS", "1.2.840.113556.1.4.1340");
  1406. /**
  1407. * Control Constant - Active Directory Tree Delete
  1408. * @link https://php.net/manual/en/ldap.constants.php
  1409. * @since 7.3
  1410. */
  1411. define("LDAP_CONTROL_X_TREE_DELETE", "1.2.840.113556.1.4.805");
  1412. /**
  1413. * Control Constant - Active Directory Extended DN
  1414. * @link https://php.net/manual/en/ldap.constants.php
  1415. * @since 7.3
  1416. */
  1417. define("LDAP_CONTROL_X_EXTENDED_DN", "1.2.840.113556.1.4.529");
  1418. /**
  1419. * Control Constant - Virtual List View Request
  1420. * @link https://php.net/manual/en/ldap.constants.php
  1421. * @since 7.3
  1422. */
  1423. define("LDAP_CONTROL_VLVREQUEST", "2.16.840.1.113730.3.4.9");
  1424. /**
  1425. * Control Constant - Virtual List View Response
  1426. * @link https://php.net/manual/en/ldap.constants.php
  1427. * @since 7.3
  1428. */
  1429. define("LDAP_CONTROL_VLVRESPONSE", "2.16.840.1.113730.3.4.10");
  1430. /**
  1431. * Extended Operation constant - Modify password
  1432. */
  1433. define("LDAP_EXOP_MODIFY_PASSWD", "1.3.6.1.4.1.4203.1.11.1");
  1434. /**
  1435. * Extended Operation Constant - Refresh
  1436. */
  1437. define("LDAP_EXOP_REFRESH", "1.3.6.1.4.1.1466.101.119.1");
  1438. /**
  1439. * Extended Operation constant - Start TLS
  1440. */
  1441. define("LDAP_EXOP_START_TLS", "1.3.6.1.4.1.1466.20037");
  1442. /**
  1443. * Extended Operation Constant - Turn
  1444. */
  1445. define("LDAP_EXOP_TURN", "1.3.6.1.1.19");
  1446. /**
  1447. * Extended Operation Constant - WHOAMI
  1448. */
  1449. define("LDAP_EXOP_WHO_AM_I", "1.3.6.1.4.1.4203.1.11.3");
  1450. // End of ldap v.
  1451. ?>