-
Notifications
You must be signed in to change notification settings - Fork 8
/
ldap.php
1104 lines (1047 loc) · 36.8 KB
/
ldap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
// Start of ldap v.7.0.4-7ubuntu2
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Connect to an LDAP server
* @link http://php.net/manual/en/function.ldap-connect.php
* @param string $host [optional] <p>
* This field supports using a hostname or, with OpenLDAP 2.x.x and
* later, a full LDAP URI of the form ldap://hostname:port
* or ldaps://hostname:port for SSL encryption.
* </p>
* <p>
* You can also provide multiple LDAP-URIs separated by a space as one string
* </p>
* <p>
* Note that hostname:port is not a supported LDAP URI as the schema is missing.
* </p>
* @param int $port [optional] <p>
* The port to connect to. Not used when using LDAP URIs.
* </p>
* @return resource a positive LDAP link identifier when the provided hostname/port combination or LDAP URI
* seems plausible. It's a syntactic check of the provided parameters but the server(s) will not
* be contacted! If the syntactic check fails it returns <b>FALSE</b>.
* When OpenLDAP 2.x.x is used, <b>ldap_connect</b> will always
* return a resource as it does not actually connect but just
* initializes the connecting parameters. The actual connect happens with
* the next calls to ldap_* funcs, usually with
* <b>ldap_bind</b>.
* </p>
* <p>
* If no arguments are specified then the link identifier of the already
* opened link will be returned.
*/
function ldap_connect(string $host = null, int $port = 389) {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Alias of <b>ldap_unbind</b>
* @link http://php.net/manual/en/function.ldap-close.php
* @param $link_identifier
*/
function ldap_close($link_identifier) {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Bind to LDAP directory
* @link http://php.net/manual/en/function.ldap-bind.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $bind_rdn [optional]
* @param string $bind_password [optional]
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_bind($link_identifier, string $bind_rdn = null, string $bind_password = null): bool {}
/**
* (PHP 5, PHP 7)<br/>
* Bind to LDAP directory using SASL
* @link http://php.net/manual/en/function.ldap-sasl-bind.php
* @param resource $link
* @param string $binddn [optional]
* @param string $password [optional]
* @param string $sasl_mech [optional]
* @param string $sasl_realm [optional]
* @param string $sasl_authc_id [optional]
* @param string $sasl_authz_id [optional]
* @param string $props [optional]
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_sasl_bind($link, string $binddn = null, string $password = null, string $sasl_mech = null, string $sasl_realm = null, string $sasl_authc_id = null, string $sasl_authz_id = null, string $props = null): bool {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Unbind from LDAP directory
* @link http://php.net/manual/en/function.ldap-unbind.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_unbind($link_identifier): bool {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Read an entry
* @link http://php.net/manual/en/function.ldap-read.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $base_dn <p>
* The base DN for the directory.
* </p>
* @param string $filter <p>
* An empty filter is not allowed. If you want to retrieve absolutely all
* information for this entry, use a filter of
* objectClass=*. If you know which entry types are
* used on the directory server, you might use an appropriate filter such
* as objectClass=inetOrgPerson.
* </p>
* @param array $attributes [optional] <p>
* An array of the required attributes, e.g. array("mail", "sn", "cn").
* Note that the "dn" is always returned irrespective of which attributes
* types are requested.
* </p>
* <p>
* Using this parameter is much more efficient than the default action
* (which is to return all attributes and their associated values).
* The use of this parameter should therefore be considered good
* practice.
* </p>
* @param int $attrsonly [optional] <p>
* Should be set to 1 if only attribute types are wanted. If set to 0
* both attributes types and attribute values are fetched which is the
* default behaviour.
* </p>
* @param int $sizelimit [optional] <p>
* Enables you to limit the count of entries fetched. Setting this to 0
* means no limit.
* </p>
* <p>
* This parameter can NOT override server-side preset sizelimit. You can
* set it lower though.
* </p>
* <p>
* Some directory server hosts will be configured to return no more than
* a preset number of entries. If this occurs, the server will indicate
* that it has only returned a partial results set. This also occurs if
* you use this parameter to limit the count of fetched entries.
* </p>
* @param int $timelimit [optional] <p>
* Sets the number of seconds how long is spend on the search. Setting
* this to 0 means no limit.
* </p>
* <p>
* This parameter can NOT override server-side preset timelimit. You can
* set it lower though.
* </p>
* @param int $deref [optional] <p>
* Specifies how aliases should be handled during the search. It can be
* one of the following:
* <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
* dereferenced.
* @return resource a search result identifier or <b>FALSE</b> on error.
*/
function ldap_read($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = null, int $sizelimit = null, int $timelimit = null, int $deref = null) {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Single-level search
* @link http://php.net/manual/en/function.ldap-list.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $base_dn <p>
* The base DN for the directory.
* </p>
* @param string $filter
* @param array $attributes [optional] <p>
* An array of the required attributes, e.g. array("mail", "sn", "cn").
* Note that the "dn" is always returned irrespective of which attributes
* types are requested.
* </p>
* <p>
* Using this parameter is much more efficient than the default action
* (which is to return all attributes and their associated values).
* The use of this parameter should therefore be considered good
* practice.
* </p>
* @param int $attrsonly [optional] <p>
* Should be set to 1 if only attribute types are wanted. If set to 0
* both attributes types and attribute values are fetched which is the
* default behaviour.
* </p>
* @param int $sizelimit [optional] <p>
* Enables you to limit the count of entries fetched. Setting this to 0
* means no limit.
* </p>
* <p>
* This parameter can NOT override server-side preset sizelimit. You can
* set it lower though.
* </p>
* <p>
* Some directory server hosts will be configured to return no more than
* a preset number of entries. If this occurs, the server will indicate
* that it has only returned a partial results set. This also occurs if
* you use this parameter to limit the count of fetched entries.
* </p>
* @param int $timelimit [optional] <p>
* Sets the number of seconds how long is spend on the search. Setting
* this to 0 means no limit.
* </p>
* <p>
* This parameter can NOT override server-side preset timelimit. You can
* set it lower though.
* </p>
* @param int $deref [optional] <p>
* Specifies how aliases should be handled during the search. It can be
* one of the following:
* <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
* dereferenced.
* @return resource a search result identifier or <b>FALSE</b> on error.
*/
function ldap_list($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = null, int $sizelimit = null, int $timelimit = null, int $deref = null) {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Search LDAP tree
* @link http://php.net/manual/en/function.ldap-search.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $base_dn <p>
* The base DN for the directory.
* </p>
* @param string $filter <p>
* The search filter can be simple or advanced, using boolean operators in
* the format described in the LDAP documentation (see the Netscape Directory SDK or
* RFC4515 for full
* information on filters).
* </p>
* @param array $attributes [optional] <p>
* An array of the required attributes, e.g. array("mail", "sn", "cn").
* Note that the "dn" is always returned irrespective of which attributes
* types are requested.
* </p>
* <p>
* Using this parameter is much more efficient than the default action
* (which is to return all attributes and their associated values).
* The use of this parameter should therefore be considered good
* practice.
* </p>
* @param int $attrsonly [optional] <p>
* Should be set to 1 if only attribute types are wanted. If set to 0
* both attributes types and attribute values are fetched which is the
* default behaviour.
* </p>
* @param int $sizelimit [optional] <p>
* Enables you to limit the count of entries fetched. Setting this to 0
* means no limit.
* </p>
* <p>
* This parameter can NOT override server-side preset sizelimit. You can
* set it lower though.
* </p>
* <p>
* Some directory server hosts will be configured to return no more than
* a preset number of entries. If this occurs, the server will indicate
* that it has only returned a partial results set. This also occurs if
* you use this parameter to limit the count of fetched entries.
* </p>
* @param int $timelimit [optional] <p>
* Sets the number of seconds how long is spend on the search. Setting
* this to 0 means no limit.
* </p>
* <p>
* This parameter can NOT override server-side preset timelimit. You can
* set it lower though.
* </p>
* @param int $deref [optional] <p>
* Specifies how aliases should be handled during the search. It can be
* one of the following:
* <b>LDAP_DEREF_NEVER</b> - (default) aliases are never
* dereferenced.
* @return resource a search result identifier or <b>FALSE</b> on error.
*/
function ldap_search($link_identifier, string $base_dn, string $filter, array $attributes = null, int $attrsonly = null, int $sizelimit = null, int $timelimit = null, int $deref = null) {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Free result memory
* @link http://php.net/manual/en/function.ldap-free-result.php
* @param resource $result_identifier
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_free_result($result_identifier): bool {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Count the number of entries in a search
* @link http://php.net/manual/en/function.ldap-count-entries.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result_identifier <p>
* The internal LDAP result.
* </p>
* @return int number of entries in the result or <b>FALSE</b> on error.
*/
function ldap_count_entries($link_identifier, $result_identifier): int {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Return first result id
* @link http://php.net/manual/en/function.ldap-first-entry.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result_identifier
* @return resource the result entry identifier for the first entry on success and
* <b>FALSE</b> on error.
*/
function ldap_first_entry($link_identifier, $result_identifier) {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Get next result entry
* @link http://php.net/manual/en/function.ldap-next-entry.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result_entry_identifier
* @return resource entry identifier for the next entry in the result whose entries
* are being read starting with <b>ldap_first_entry</b>. If
* there are no more entries in the result then it returns <b>FALSE</b>.
*/
function ldap_next_entry($link_identifier, $result_entry_identifier) {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Get all result entries
* @link http://php.net/manual/en/function.ldap-get-entries.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result_identifier
* @return array a complete result information in a multi-dimensional array on
* success and <b>FALSE</b> on error.
* </p>
* <p>
* The structure of the array is as follows.
* The attribute index is converted to lowercase. (Attributes are
* case-insensitive for directory servers, but not when used as
* array indices.)
* <pre>
* return_value["count"] = number of entries in the result
* return_value[0] : refers to the details of first entry
* return_value[i]["dn"] = DN of the ith entry in the result
* return_value[i]["count"] = number of attributes in ith entry
* return_value[i][j] = NAME of the jth attribute in the ith entry in the result
* return_value[i]["attribute"]["count"] = number of values for
* attribute in ith entry
* return_value[i]["attribute"][j] = jth value of attribute in ith entry
* </pre>
*/
function ldap_get_entries($link_identifier, $result_identifier): array {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Return first attribute
* @link http://php.net/manual/en/function.ldap-first-attribute.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result_entry_identifier
* @return string the first attribute in the entry on success and <b>FALSE</b> on
* error.
*/
function ldap_first_attribute($link_identifier, $result_entry_identifier): string {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Get the next attribute in result
* @link http://php.net/manual/en/function.ldap-next-attribute.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result_entry_identifier
* @return string the next attribute in an entry on success and <b>FALSE</b> on
* error.
*/
function ldap_next_attribute($link_identifier, $result_entry_identifier): string {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Get attributes from a search result entry
* @link http://php.net/manual/en/function.ldap-get-attributes.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result_entry_identifier
* @return array a complete entry information in a multi-dimensional array
* on success and <b>FALSE</b> on error.
*/
function ldap_get_attributes($link_identifier, $result_entry_identifier): array {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Get all values from a result entry
* @link http://php.net/manual/en/function.ldap-get-values.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result_entry_identifier
* @param string $attribute
* @return array an array of values for the attribute on success and <b>FALSE</b> on
* error. The number of values can be found by indexing "count" in the
* resultant array. Individual values are accessed by integer index in the
* array. The first index is 0.
* </p>
* <p>
* LDAP allows more than one entry for an attribute, so it can, for example,
* store a number of email addresses for one person's directory entry all
* labeled with the attribute "mail"
* return_value["count"] = number of values for attribute
* return_value[0] = first value of attribute
* return_value[i] = ith value of attribute
*/
function ldap_get_values($link_identifier, $result_entry_identifier, string $attribute): array {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Get all binary values from a result entry
* @link http://php.net/manual/en/function.ldap-get-values-len.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result_entry_identifier
* @param string $attribute
* @return array an array of values for the attribute on success and <b>FALSE</b> on
* error. Individual values are accessed by integer index in the array. The
* first index is 0. The number of values can be found by indexing "count"
* in the resultant array.
*/
function ldap_get_values_len($link_identifier, $result_entry_identifier, string $attribute): array {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Get the DN of a result entry
* @link http://php.net/manual/en/function.ldap-get-dn.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result_entry_identifier
* @return string the DN of the result entry and <b>FALSE</b> on error.
*/
function ldap_get_dn($link_identifier, $result_entry_identifier): string {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Splits DN into its component parts
* @link http://php.net/manual/en/function.ldap-explode-dn.php
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param int $with_attrib <p>
* Used to request if the RDNs are returned with only values or their
* attributes as well. To get RDNs with the attributes (i.e. in
* attribute=value format) set <i>with_attrib</i> to 0
* and to get only values set it to 1.
* </p>
* @return array an array of all DN components.
* The first element in this array has count key and
* represents the number of returned values, next elements are numerically
* indexed DN components.
*/
function ldap_explode_dn(string $dn, int $with_attrib): array {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Convert DN to User Friendly Naming format
* @link http://php.net/manual/en/function.ldap-dn2ufn.php
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @return string the user friendly name.
*/
function ldap_dn2ufn(string $dn): string {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Add entries to LDAP directory
* @link http://php.net/manual/en/function.ldap-add.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry <p>
* An array that specifies the information about the entry. The values in
* the entries are indexed by individual attributes.
* In case of multiple values for an attribute, they are indexed using
* integers starting with 0.
* <code>
* $entry["attribute1"] = "value";
* $entry["attribute2"][0] = "value1";
* $entry["attribute2"][1] = "value2";
* </code>
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_add($link_identifier, string $dn, array $entry): bool {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Delete an entry from a directory
* @link http://php.net/manual/en/function.ldap-delete.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_delete($link_identifier, string $dn): bool {}
/**
* (PHP 5.4 >= 5.4.26, PHP 5.5 >= 5.5.10, PHP 5.6 >= 5.6.0, PHP 7)<br/>
* Batch and execute modifications on an LDAP entry
* @link http://php.net/manual/en/function.ldap-modify-batch.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry <p>
* An array that specifies the modifications to make. Each entry in this
* array is an associative array with two or three keys:
* attrib maps to the name of the attribute to modify,
* modtype maps to the type of modification to perform,
* and (depending on the type of modification) values
* maps to an array of attribute values relevant to the modification.
* </p>
* <p>
* Possible values for modtype include:
* <b>LDAP_MODIFY_BATCH_ADD</b>
* <p>
* Each value specified through values is added (as
* an additional value) to the attribute named by
* attrib.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_modify_batch($link_identifier, string $dn, array $entry): bool {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Modify an LDAP entry
* @link http://php.net/manual/en/function.ldap-modify.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_modify($link_identifier, string $dn, array $entry): bool {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Add attribute values to current attributes
* @link http://php.net/manual/en/function.ldap-mod-add.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_mod_add($link_identifier, string $dn, array $entry): bool {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Replace attribute values with new ones
* @link http://php.net/manual/en/function.ldap-mod-replace.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_mod_replace($link_identifier, string $dn, array $entry): bool {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Delete attribute values from current attributes
* @link http://php.net/manual/en/function.ldap-mod-del.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param array $entry
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_mod_del($link_identifier, string $dn, array $entry): bool {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Return the LDAP error number of the last LDAP command
* @link http://php.net/manual/en/function.ldap-errno.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @return int Return the LDAP error number of the last LDAP command for this
* link.
*/
function ldap_errno($link_identifier): int {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Convert LDAP error number into string error message
* @link http://php.net/manual/en/function.ldap-err2str.php
* @param int $errno <p>
* The error number.
* </p>
* @return string the error message, as a string.
*/
function ldap_err2str(int $errno): string {}
/**
* (PHP 4, PHP 5, PHP 7)<br/>
* Return the LDAP error message of the last LDAP command
* @link http://php.net/manual/en/function.ldap-error.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @return string string error message.
*/
function ldap_error($link_identifier): string {}
/**
* (PHP 4 >= 4.0.2, PHP 5, PHP 7)<br/>
* Compare value of attribute found in entry specified with DN
* @link http://php.net/manual/en/function.ldap-compare.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param string $attribute <p>
* The attribute name.
* </p>
* @param string $value <p>
* The compared value.
* </p>
* @return mixed <b>TRUE</b> if <i>value</i> matches otherwise returns
* <b>FALSE</b>. Returns -1 on error.
*/
function ldap_compare($link_identifier, string $dn, string $attribute, string $value) {}
/**
* (PHP 4 >= 4.2.0, PHP 5, PHP 7)<br/>
* Sort LDAP result entries on the client side
* @link http://php.net/manual/en/function.ldap-sort.php
* @param resource $link <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result <p>
* An search result identifier, returned by
* <b>ldap_search</b>.
* </p>
* @param string $sortfilter <p>
* The attribute to use as a key in the sort.
* </p>
* @return bool
*/
function ldap_sort($link, $result, string $sortfilter): bool {}
/**
* (PHP 4 >= 4.0.5, PHP 5, PHP 7)<br/>
* Modify the name of an entry
* @link http://php.net/manual/en/function.ldap-rename.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param string $dn <p>
* The distinguished name of an LDAP entity.
* </p>
* @param string $newrdn <p>
* The new RDN.
* </p>
* @param string $newparent <p>
* The new parent/superior entry.
* </p>
* @param bool $deleteoldrdn <p>
* If <b>TRUE</b> the old RDN value(s) is removed, else the old RDN value(s)
* is retained as non-distinguished values of the entry.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_rename($link_identifier, string $dn, string $newrdn, string $newparent, bool $deleteoldrdn): bool {}
/**
* (PHP 4 >= 4.0.4, PHP 5, PHP 7)<br/>
* Get the current value for given option
* @link http://php.net/manual/en/function.ldap-get-option.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param int $option <p>
* The parameter <i>option</i> can be one of:
* <tr valign="top">
* <td>Option</td>
* <td>Type</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_DEREF</b></td>
* <td>integer</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_SIZELIMIT</b></td>
* <td>integer</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_TIMELIMIT</b></td>
* <td>integer</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_NETWORK_TIMEOUT</b></td>
* <td>integer</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_PROTOCOL_VERSION</b></td>
* <td>integer</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_ERROR_NUMBER</b></td>
* <td>integer</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_REFERRALS</b></td>
* <td>bool</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_RESTART</b></td>
* <td>bool</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_HOST_NAME</b></td>
* <td>string</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_ERROR_STRING</b></td>
* <td>string</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_MATCHED_DN</b></td>
* <td>string</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_SERVER_CONTROLS</b></td>
* <td>array</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_CLIENT_CONTROLS</b></td>
* <td>array</td>
* </tr>
* </p>
* @param mixed $retval <p>
* This will be set to the option value.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_get_option($link_identifier, int $option, &$retval): bool {}
/**
* (PHP 4 >= 4.0.4, PHP 5, PHP 7)<br/>
* Set the value of the given option
* @link http://php.net/manual/en/function.ldap-set-option.php
* @param resource $link_identifier <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param int $option <p>
* The parameter <i>option</i> can be one of:
* <tr valign="top">
* <td>Option</td>
* <td>Type</td>
* <td>Available since</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_DEREF</b></td>
* <td>integer</td>
* <td></td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_SIZELIMIT</b></td>
* <td>integer</td>
* <td></td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_TIMELIMIT</b></td>
* <td>integer</td>
* <td></td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_NETWORK_TIMEOUT</b></td>
* <td>integer</td>
* <td>PHP 5.3.0</td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_PROTOCOL_VERSION</b></td>
* <td>integer</td>
* <td></td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_ERROR_NUMBER</b></td>
* <td>integer</td>
* <td></td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_REFERRALS</b></td>
* <td>bool</td>
* <td></td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_RESTART</b></td>
* <td>bool</td>
* <td></td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_HOST_NAME</b></td>
* <td>string</td>
* <td></td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_ERROR_STRING</b></td>
* <td>string</td>
* <td></td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_MATCHED_DN</b></td>
* <td>string</td>
* <td></td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_SERVER_CONTROLS</b></td>
* <td>array</td>
* <td></td>
* </tr>
* <tr valign="top">
* <td><b>LDAP_OPT_CLIENT_CONTROLS</b></td>
* <td>array</td>
* <td></td>
* </tr>
* </p>
* <p>
* <b>LDAP_OPT_SERVER_CONTROLS</b> and
* <b>LDAP_OPT_CLIENT_CONTROLS</b> require a list of
* controls, this means that the value must be an array of controls. A
* control consists of an oid identifying the control,
* an optional value, and an optional flag for
* criticality. In PHP a control is given by an
* array containing an element with the key oid
* and string value, and two optional elements. The optional
* elements are key value with string value
* and key iscritical with boolean value.
* iscritical defaults to <b>FALSE</b>
* if not supplied. See draft-ietf-ldapext-ldap-c-api-xx.txt
* for details. See also the second example below.
* </p>
* @param mixed $newval <p>
* The new value for the specified <i>option</i>.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_set_option($link_identifier, int $option, $newval): bool {}
/**
* (PHP 4 >= 4.0.5, PHP 5, PHP 7)<br/>
* Return first reference
* @link http://php.net/manual/en/function.ldap-first-reference.php
* @param resource $link
* @param resource $result
* @return resource
*/
function ldap_first_reference($link, $result) {}
/**
* (PHP 4 >= 4.0.5, PHP 5, PHP 7)<br/>
* Get next reference
* @link http://php.net/manual/en/function.ldap-next-reference.php
* @param resource $link
* @param resource $entry
* @return resource
*/
function ldap_next_reference($link, $entry) {}
/**
* (PHP 4 >= 4.0.5, PHP 5, PHP 7)<br/>
* Extract information from reference entry
* @link http://php.net/manual/en/function.ldap-parse-reference.php
* @param resource $link
* @param resource $entry
* @param array $referrals
* @return bool
*/
function ldap_parse_reference($link, $entry, array &$referrals): bool {}
/**
* (PHP 4 >= 4.0.5, PHP 5, PHP 7)<br/>
* Extract information from result
* @link http://php.net/manual/en/function.ldap-parse-result.php
* @param resource $link <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param resource $result
* @param int $errcode <p>
* A reference to a variable that will be set to the LDAP error code in
* the result, or 0 if no error occurred.
* </p>
* @param string $matcheddn [optional] <p>
* A reference to a variable that will be set to a matched DN if one was
* recognised within the request, otherwise it will be set to <b>NULL</b>.
* </p>
* @param string $errmsg [optional] <p>
* A reference to a variable that will be set to the LDAP error message in
* the result, or an empty string if no error occurred.
* </p>
* @param array $referrals [optional] <p>
* A reference to a variable that will be set to an array set
* to all of the referral strings in the result, or an empty array if no
* referrals were returned.
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_parse_result($link, $result, int &$errcode, string &$matcheddn = null, string &$errmsg = null, array &$referrals = null): bool {}
/**
* (PHP 4 >= 4.2.0, PHP 5, PHP 7)<br/>
* Start TLS
* @link http://php.net/manual/en/function.ldap-start-tls.php
* @param resource $link
* @return bool
*/
function ldap_start_tls($link): bool {}
/**
* (PHP 4 >= 4.2.0, PHP 5, PHP 7)<br/>
* Set a callback function to do re-binds on referral chasing
* @link http://php.net/manual/en/function.ldap-set-rebind-proc.php
* @param resource $link
* @param callable $callback
* @return bool
*/
function ldap_set_rebind_proc($link, callable $callback): bool {}
/**
* (PHP 5 >= 5.6.0, PHP 7)<br/>
* Escape a string for use in an LDAP filter or DN
* @link http://php.net/manual/en/function.ldap-escape.php
* @param string $value <p>
* The value to escape.
* </p>
* @param string $ignore [optional] <p>
* Characters to ignore when escaping.
* </p>
* @param int $flags [optional] <p>
* The context the escaped string will be used in:
* <b>LDAP_ESCAPE_FILTER</b> for filters to be used with
* <b>ldap_search</b>, or
* <b>LDAP_ESCAPE_DN</b> for DNs.
* </p>
* @return string the escaped string.
*/
function ldap_escape(string $value, string $ignore = null, int $flags = null): string {}
/**
* (PHP 5 >= 5.4.0, PHP 7)<br/>
* Send LDAP pagination control
* @link http://php.net/manual/en/function.ldap-control-paged-result.php
* @param resource $link <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.
* </p>
* @param int $pagesize <p>
* The number of entries by page.
* </p>
* @param bool $iscritical [optional] <p>
* Indicates whether the pagination is critical or not.
* If true and if the server doesn't support pagination, the search
* will return no result.
* </p>
* @param string $cookie [optional] <p>
* An opaque structure sent by the server
* (<b>ldap_control_paged_result_response</b>).
* </p>
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
*/
function ldap_control_paged_result($link, int $pagesize, bool $iscritical = false, string $cookie = ""): bool {}
/**
* (PHP 5 >= 5.4.0, PHP 7)<br/>
* Retrieve the LDAP pagination cookie
* @link http://php.net/manual/en/function.ldap-control-paged-result-response.php
* @param resource $link <p>
* An LDAP link identifier, returned by <b>ldap_connect</b>.