File: ldap.php

package info (click to toggle)
codelite 12.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 95,112 kB
  • sloc: cpp: 424,040; ansic: 18,284; php: 9,569; lex: 4,186; yacc: 2,820; python: 2,294; sh: 312; makefile: 51; xml: 13
file content (1101 lines) | stat: -rw-r--r-- 37,808 bytes parent folder | download | duplicates (6)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
<?php

// Start of ldap v.

/**
 * Connect to an LDAP server
 * @link http://www.php.net/manual/en/function.ldap-connect.php
 * @param hostname string[optional] <p>
 *       If you are using OpenLDAP 2.x.x you can specify a URL instead of the
 *       hostname. To use LDAP with SSL, compile OpenLDAP 2.x.x with SSL
 *       support, configure PHP with SSL, and set this parameter as  
 *       ldaps://hostname/.
 *      </p>
 * @param port int[optional] <p>
 *       The port to connect to. Not used when using URLs.
 *      </p>
 * @return resource a positive LDAP link identifier on success, or false on error.
 *   When OpenLDAP 2.x.x is used, ldap_connect 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
 *   ldap_bind.
 *  </p>
 *  <p>
 *   If no arguments are specified then the link identifier of the already
 *   opened link will be returned.
 */
function ldap_connect ($hostname = null, $port = null) {}

/**
 * &Alias; <function>ldap_unbind</function>
 * @link http://www.php.net/manual/en/function.ldap-close.php
 * @param link_identifier
 */
function ldap_close ($link_identifier) {}

/**
 * Bind to LDAP directory
 * @link http://www.php.net/manual/en/function.ldap-bind.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param bind_rdn string[optional] <p>
 *      </p>
 * @param bind_password string[optional] <p>
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_bind ($link_identifier, $bind_rdn = null, $bind_password = null) {}

/**
 * Bind to LDAP directory using SASL
 * @link http://www.php.net/manual/en/function.ldap-sasl-bind.php
 * @param link resource 
 * @param binddn string[optional] 
 * @param password string[optional] 
 * @param sasl_mech string[optional] 
 * @param sasl_realm string[optional] 
 * @param sasl_authc_id string[optional] 
 * @param sasl_authz_id string[optional] 
 * @param props string[optional] 
 * @return bool Returns true on success, false on failure.
 */
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) {}

/**
 * Unbind from LDAP directory
 * @link http://www.php.net/manual/en/function.ldap-unbind.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_unbind ($link_identifier) {}

/**
 * Read an entry
 * @link http://www.php.net/manual/en/function.ldap-read.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param base_dn string <p>
 *       The base DN for the directory.
 *      </p>
 * @param filter string <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 attributes array[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 attrsonly int[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 sizelimit int[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 timelimit int[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 deref int[optional] <p>
 *       Specifies how aliases should be handled during the search. It can be
 *       one of the following:
 *       
 *        
 *         
 *          LDAP_DEREF_NEVER - (default) aliases are never
 *          dereferenced.
 * @return resource a search result identifier or false on error.
 */
function ldap_read ($link_identifier, $base_dn, $filter, array $attributes = null, $attrsonly = null, $sizelimit = null, $timelimit = null, $deref = null) {}

/**
 * Single-level search
 * @link http://www.php.net/manual/en/function.ldap-list.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param base_dn string <p>
 *       The base DN for the directory.
 *      </p>
 * @param filter string <p>
 *      </p>
 * @param attributes array[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 attrsonly int[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 sizelimit int[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 timelimit int[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 deref int[optional] <p>
 *       Specifies how aliases should be handled during the search. It can be
 *       one of the following:
 *       
 *        
 *         
 *          LDAP_DEREF_NEVER - (default) aliases are never
 *          dereferenced.
 * @return resource a search result identifier or false on error.
 */
function ldap_list ($link_identifier, $base_dn, $filter, array $attributes = null, $attrsonly = null, $sizelimit = null, $timelimit = null, $deref = null) {}

/**
 * Search LDAP tree
 * @link http://www.php.net/manual/en/function.ldap-search.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param base_dn string <p>
 *       The base DN for the directory.
 *      </p>
 * @param filter string <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 for full
 *       information on filters).
 *      </p>
 * @param attributes array[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 attrsonly int[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 sizelimit int[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 timelimit int[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 deref int[optional] <p>
 *       Specifies how aliases should be handled during the search. It can be
 *       one of the following:
 *       
 *        
 *         
 *          LDAP_DEREF_NEVER - (default) aliases are never
 *          dereferenced.
 * @return resource a search result identifier or false on error.
 */
function ldap_search ($link_identifier, $base_dn, $filter, array $attributes = null, $attrsonly = null, $sizelimit = null, $timelimit = null, $deref = null) {}

/**
 * Free result memory
 * @link http://www.php.net/manual/en/function.ldap-free-result.php
 * @param result_identifier resource <p>
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_free_result ($result_identifier) {}

/**
 * Count the number of entries in a search
 * @link http://www.php.net/manual/en/function.ldap-count-entries.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result_identifier resource <p>
 *       The internal LDAP result.
 *      </p>
 * @return int number of entries in the result or false on error.
 */
function ldap_count_entries ($link_identifier, $result_identifier) {}

/**
 * Return first result id
 * @link http://www.php.net/manual/en/function.ldap-first-entry.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result_identifier resource <p>
 *      </p>
 * @return resource the result entry identifier for the first entry on success and
 *   false on error.
 */
function ldap_first_entry ($link_identifier, $result_identifier) {}

/**
 * Get next result entry
 * @link http://www.php.net/manual/en/function.ldap-next-entry.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result_entry_identifier resource <p>
 *      </p>
 * @return resource entry identifier for the next entry in the result whose entries
 *   are being read starting with ldap_first_entry. If
 *   there are no more entries in the result then it returns false.
 */
function ldap_next_entry ($link_identifier, $result_entry_identifier) {}

/**
 * Get all result entries
 * @link http://www.php.net/manual/en/function.ldap-get-entries.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result_identifier resource <p>
 *      </p>
 * @return array a complete result information in a multi-dimensional array on
 *   success and false 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.)
 */
function ldap_get_entries ($link_identifier, $result_identifier) {}

/**
 * Return first attribute
 * @link http://www.php.net/manual/en/function.ldap-first-attribute.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result_entry_identifier resource <p>
 *      </p>
 * @return string the first attribute in the entry on success and false on
 *   error.
 */
function ldap_first_attribute ($link_identifier, $result_entry_identifier) {}

/**
 * Get the next attribute in result
 * @link http://www.php.net/manual/en/function.ldap-next-attribute.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result_entry_identifier resource <p>
 *      </p>
 * @return string the next attribute in an entry on success and false on
 *   error.
 */
function ldap_next_attribute ($link_identifier, $result_entry_identifier) {}

/**
 * Get attributes from a search result entry
 * @link http://www.php.net/manual/en/function.ldap-get-attributes.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result_entry_identifier resource <p>
 *      </p>
 * @return array a complete entry information in a multi-dimensional array
 *   on success and false on error.
 */
function ldap_get_attributes ($link_identifier, $result_entry_identifier) {}

/**
 * Get all values from a result entry
 * @link http://www.php.net/manual/en/function.ldap-get-values.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result_entry_identifier resource <p>
 *      </p>
 * @param attribute string <p>
 *      </p>
 * @return array an array of values for the attribute on success and false 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, $attribute) {}

/**
 * Get all binary values from a result entry
 * @link http://www.php.net/manual/en/function.ldap-get-values-len.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result_entry_identifier resource <p>
 *      </p>
 * @param attribute string <p>
 *      </p>
 * @return array an array of values for the attribute on success and false 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, $attribute) {}

/**
 * Get the DN of a result entry
 * @link http://www.php.net/manual/en/function.ldap-get-dn.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result_entry_identifier resource <p>
 *      </p>
 * @return string the DN of the result entry and false on error.
 */
function ldap_get_dn ($link_identifier, $result_entry_identifier) {}

/**
 * Splits DN into its component parts
 * @link http://www.php.net/manual/en/function.ldap-explode-dn.php
 * @param dn string <p>
 *       The distinguished name of an LDAP entity.
 *      </p>
 * @param with_attrib int <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 with_attrib 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 ($dn, $with_attrib) {}

/**
 * Convert DN to User Friendly Naming format
 * @link http://www.php.net/manual/en/function.ldap-dn2ufn.php
 * @param dn string <p>
 *       The distinguished name of an LDAP entity.
 *      </p>
 * @return string the user friendly name.
 */
function ldap_dn2ufn ($dn) {}

/**
 * Add entries to LDAP directory
 * @link http://www.php.net/manual/en/function.ldap-add.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param dn string <p>
 *       The distinguished name of an LDAP entity.
 *      </p>
 * @param entry array <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.
 *       
 *        
 *     
 *     ]]>
 *        
 *       
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_add ($link_identifier, $dn, array $entry) {}

/**
 * Delete an entry from a directory
 * @link http://www.php.net/manual/en/function.ldap-delete.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param dn string <p>
 *       The distinguished name of an LDAP entity.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_delete ($link_identifier, $dn) {}

/**
 * Batch and execute modifications on an LDAP entry
 * @link http://www.php.net/manual/en/function.ldap-modify-batch.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param dn string <p>
 *       The distinguished name of an LDAP entity.
 *      </p>
 * @param entry array <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:
 *       
 *        
 *         LDAP_MODIFY_BATCH_ADD
 *         
 *          <p>
 *           Each value specified through values is added (as
 *           an additional value) to the attribute named by
 *           attrib.
 *          </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_modify_batch ($link_identifier, $dn, array $entry) {}

/**
 * Modify an LDAP entry
 * @link http://www.php.net/manual/en/function.ldap-modify.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param dn string <p>
 *       The distinguished name of an LDAP entity.
 *      </p>
 * @param entry array <p>
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_modify ($link_identifier, $dn, array $entry) {}

/**
 * Add attribute values to current attributes
 * @link http://www.php.net/manual/en/function.ldap-mod-add.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param dn string <p>
 *       The distinguished name of an LDAP entity.
 *      </p>
 * @param entry array <p>
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_mod_add ($link_identifier, $dn, array $entry) {}

/**
 * Replace attribute values with new ones
 * @link http://www.php.net/manual/en/function.ldap-mod-replace.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param dn string <p>
 *       The distinguished name of an LDAP entity.
 *      </p>
 * @param entry array <p>
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_mod_replace ($link_identifier, $dn, array $entry) {}

/**
 * Delete attribute values from current attributes
 * @link http://www.php.net/manual/en/function.ldap-mod-del.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param dn string <p>
 *       The distinguished name of an LDAP entity.
 *      </p>
 * @param entry array <p>
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_mod_del ($link_identifier, $dn, array $entry) {}

/**
 * Return the LDAP error number of the last LDAP command
 * @link http://www.php.net/manual/en/function.ldap-errno.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @return int Return the LDAP error number of the last LDAP command for this
 *   link.
 */
function ldap_errno ($link_identifier) {}

/**
 * Convert LDAP error number into string error message
 * @link http://www.php.net/manual/en/function.ldap-err2str.php
 * @param errno int <p>
 *       The error number.
 *      </p>
 * @return string the error message, as a string.
 */
function ldap_err2str ($errno) {}

/**
 * Return the LDAP error message of the last LDAP command
 * @link http://www.php.net/manual/en/function.ldap-error.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @return string string error message.
 */
function ldap_error ($link_identifier) {}

/**
 * Compare value of attribute found in entry specified with DN
 * @link http://www.php.net/manual/en/function.ldap-compare.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param dn string <p>
 *       The distinguished name of an LDAP entity.
 *      </p>
 * @param attribute string <p>
 *       The attribute name.
 *      </p>
 * @param value string <p>
 *       The compared value.
 *      </p>
 * @return mixed true if value matches otherwise returns
 *   false. Returns -1 on error.
 */
function ldap_compare ($link_identifier, $dn, $attribute, $value) {}

/**
 * Sort LDAP result entries
 * @link http://www.php.net/manual/en/function.ldap-sort.php
 * @param link resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result resource <p>
 *       An search result identifier, returned by
 *       ldap_search.
 *      </p>
 * @param sortfilter string <p>
 *       The attribute to use as a key in the sort.
 *      </p>
 * @return bool 
 */
function ldap_sort ($link, $result, $sortfilter) {}

/**
 * Modify the name of an entry
 * @link http://www.php.net/manual/en/function.ldap-rename.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param dn string <p>
 *       The distinguished name of an LDAP entity.
 *      </p>
 * @param newrdn string <p>
 *       The new RDN.
 *      </p>
 * @param newparent string <p>
 *       The new parent/superior entry.
 *      </p>
 * @param deleteoldrdn bool <p>
 *       If true 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 Returns true on success, false on failure.
 */
function ldap_rename ($link_identifier, $dn, $newrdn, $newparent, $deleteoldrdn) {}

/**
 * Get the current value for given option
 * @link http://www.php.net/manual/en/function.ldap-get-option.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param option int <p>
 *       The parameter option can be one of:
 *       
 *        
 *         
 *          <tr valign="top">
 *           <td>Option</td>
 *           <td>Type</td>
 *          </tr>
 *         
 *         
 *          <tr valign="top">
 *           <td>LDAP_OPT_DEREF</td>
 *           <td>integer</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_SIZELIMIT</td>
 *           <td>integer</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_TIMELIMIT</td>
 *           <td>integer</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_NETWORK_TIMEOUT</td>
 *           <td>integer</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_PROTOCOL_VERSION</td>
 *           <td>integer</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_ERROR_NUMBER</td>
 *           <td>integer</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_REFERRALS</td>
 *           <td>bool</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_RESTART</td>
 *           <td>bool</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_HOST_NAME</td>
 *           <td>string</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_ERROR_STRING</td>
 *           <td>string</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_MATCHED_DN</td>
 *           <td>string</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_SERVER_CONTROLS</td>
 *           <td>array</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_CLIENT_CONTROLS</td>
 *           <td>array</td>
 *          </tr>
 *         
 *        
 *       
 *      </p>
 * @param retval mixed <p>
 *       This will be set to the option value.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_get_option ($link_identifier, $option, &$retval) {}

/**
 * Set the value of the given option
 * @link http://www.php.net/manual/en/function.ldap-set-option.php
 * @param link_identifier resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param option int <p>
 *       The parameter option can be one of:
 *       
 *        
 *         
 *          <tr valign="top">
 *           <td>Option</td>
 *           <td>Type</td>
 *           <td>Available since</td>
 *          </tr>
 *         
 *         
 *          <tr valign="top">
 *           <td>LDAP_OPT_DEREF</td>
 *           <td>integer</td>
 *           <td></td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_SIZELIMIT</td>
 *           <td>integer</td>
 *           <td></td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_TIMELIMIT</td>
 *           <td>integer</td>
 *           <td></td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_NETWORK_TIMEOUT</td>
 *           <td>integer</td>
 *           <td>PHP 5.3.0</td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_PROTOCOL_VERSION</td>
 *           <td>integer</td>
 *           <td></td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_ERROR_NUMBER</td>
 *           <td>integer</td>
 *           <td></td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_REFERRALS</td>
 *           <td>bool</td>
 *           <td></td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_RESTART</td>
 *           <td>bool</td>
 *           <td></td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_HOST_NAME</td>
 *           <td>string</td>
 *           <td></td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_ERROR_STRING</td>
 *           <td>string</td>
 *           <td></td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_MATCHED_DN</td>
 *           <td>string</td>
 *           <td></td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_SERVER_CONTROLS</td>
 *           <td>array</td>
 *           <td></td>
 *          </tr>
 *          <tr valign="top">
 *           <td>LDAP_OPT_CLIENT_CONTROLS</td>
 *           <td>array</td>
 *           <td></td>
 *          </tr>
 *         
 *        
 *       
 *      </p>
 *      <p>
 *       LDAP_OPT_SERVER_CONTROLS and 
 *       LDAP_OPT_CLIENT_CONTROLS 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 false
 *       if not supplied. See draft-ietf-ldapext-ldap-c-api-xx.txt
 *       for details. See also the second example below.
 *      </p>
 * @param newval mixed <p>
 *       The new value for the specified option.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_set_option ($link_identifier, $option, $newval) {}

/**
 * Return first reference
 * @link http://www.php.net/manual/en/function.ldap-first-reference.php
 * @param link resource 
 * @param result resource 
 * @return resource 
 */
function ldap_first_reference ($link, $result) {}

/**
 * Get next reference
 * @link http://www.php.net/manual/en/function.ldap-next-reference.php
 * @param link resource 
 * @param entry resource 
 * @return resource 
 */
function ldap_next_reference ($link, $entry) {}

/**
 * Extract information from reference entry
 * @link http://www.php.net/manual/en/function.ldap-parse-reference.php
 * @param link resource 
 * @param entry resource 
 * @param referrals array 
 * @return bool 
 */
function ldap_parse_reference ($link, $entry, array &$referrals) {}

/**
 * Extract information from result
 * @link http://www.php.net/manual/en/function.ldap-parse-result.php
 * @param link resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result resource 
 * @param errcode int <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 matcheddn string[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 &null;.
 *      </p>
 * @param errmsg string[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 referrals array[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 Returns true on success, false on failure.
 */
function ldap_parse_result ($link, $result, &$errcode, &$matcheddn = null, &$errmsg = null, array &$referrals = null) {}

/**
 * Start TLS
 * @link http://www.php.net/manual/en/function.ldap-start-tls.php
 * @param link resource 
 * @return bool 
 */
function ldap_start_tls ($link) {}

/**
 * Set a callback function to do re-binds on referral chasing
 * @link http://www.php.net/manual/en/function.ldap-set-rebind-proc.php
 * @param link resource 
 * @param callback callable 
 * @return bool 
 */
function ldap_set_rebind_proc ($link, $callback) {}

/**
 * Escape a string for use in an LDAP filter or DN
 * @link http://www.php.net/manual/en/function.ldap-escape.php
 * @param value string <p>
 *       The value to escape.
 *      </p>
 * @param ignore string[optional] <p>
 *       Characters to ignore when escaping.
 *      </p>
 * @param flags int[optional] <p>
 *       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.
 *      </p>
 * @return string the escaped string.
 */
function ldap_escape ($value, $ignore = null, $flags = null) {}

/**
 * Send LDAP pagination control
 * @link http://www.php.net/manual/en/function.ldap-control-paged-result.php
 * @param link resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param pagesize int <p>
 *       The number of entries by page.
 *      </p>
 * @param iscritical bool[optional] <p>
 *       Indicates whether the pagination is critical of not. 
 *       If true and if the server doesn't support pagination, the search
 *       will return no result.
 *      </p>
 * @param cookie string[optional] <p>
 *       An opaque structure sent by the server 
 *       (ldap_control_paged_result_response).
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_control_paged_result ($link, $pagesize, $iscritical = null, $cookie = null) {}

/**
 * Retrieve the LDAP pagination cookie
 * @link http://www.php.net/manual/en/function.ldap-control-paged-result-response.php
 * @param link resource <p>
 *       An LDAP link identifier, returned by ldap_connect.
 *      </p>
 * @param result resource <p>
 *      </p>
 * @param cookie string[optional] <p>
 *       An opaque structure sent by the server.
 *      </p>
 * @param estimated int[optional] <p>
 *       The estimated number of entries to retrieve.
 *      </p>
 * @return bool Returns true on success, false on failure.
 */
function ldap_control_paged_result_response ($link, $result, &$cookie = null, &$estimated = null) {}

define ('LDAP_DEREF_NEVER', 0);
define ('LDAP_DEREF_SEARCHING', 1);
define ('LDAP_DEREF_FINDING', 2);
define ('LDAP_DEREF_ALWAYS', 3);
define ('LDAP_MODIFY_BATCH_ADD', 1);
define ('LDAP_MODIFY_BATCH_REMOVE', 2);
define ('LDAP_MODIFY_BATCH_REMOVE_ALL', 18);
define ('LDAP_MODIFY_BATCH_REPLACE', 3);
define ('LDAP_MODIFY_BATCH_ATTRIB', "attrib");
define ('LDAP_MODIFY_BATCH_MODTYPE', "modtype");
define ('LDAP_MODIFY_BATCH_VALUES', "values");

/**
 * Specifies alternative rules for following aliases at the server.
 * @link http://www.php.net/manual/en/ldap.constants.php
 */
define ('LDAP_OPT_DEREF', 2);

/**
 * <p>
 *     Specifies the maximum number of entries that can be
 *     returned on a search operation.
 *    </p>
 *    
 *     
 *      The actual size limit for operations is also bounded
 *      by the server's configured maximum number of return entries.
 *      The lesser of these two settings is the actual size limit.
 * @link http://www.php.net/manual/en/ldap.constants.php
 */
define ('LDAP_OPT_SIZELIMIT', 3);

/**
 * Specifies the number of seconds to wait for search results.
 *    
 *    
 *     
 *      The actual time limit for operations is also bounded
 *      by the server's configured maximum time.
 *      The lesser of these two settings is the actual time limit.
 * @link http://www.php.net/manual/en/ldap.constants.php
 */
define ('LDAP_OPT_TIMELIMIT', 4);

/**
 * Option for ldap_set_option to allow setting network timeout.
 *     (Available as of PHP 5.3.0)
 * @link http://www.php.net/manual/en/ldap.constants.php
 */
define ('LDAP_OPT_NETWORK_TIMEOUT', 20485);

/**
 * Specifies the LDAP protocol to be used (V2 or V3).
 * @link http://www.php.net/manual/en/ldap.constants.php
 */
define ('LDAP_OPT_PROTOCOL_VERSION', 17);
define ('LDAP_OPT_ERROR_NUMBER', 49);

/**
 * Specifies whether to automatically follow referrals returned
 *     by the LDAP server.
 * @link http://www.php.net/manual/en/ldap.constants.php
 */
define ('LDAP_OPT_REFERRALS', 8);
define ('LDAP_OPT_RESTART', 9);
define ('LDAP_OPT_HOST_NAME', 48);
define ('LDAP_OPT_ERROR_STRING', 50);
define ('LDAP_OPT_MATCHED_DN', 51);

/**
 * Specifies a default list of server controls to be sent with each request.
 * @link http://www.php.net/manual/en/ldap.constants.php
 */
define ('LDAP_OPT_SERVER_CONTROLS', 18);

/**
 * Specifies a default list of client controls to be processed with each request.
 * @link http://www.php.net/manual/en/ldap.constants.php
 */
define ('LDAP_OPT_CLIENT_CONTROLS', 19);

/**
 * Specifies a bitwise level for debug traces.
 * @link http://www.php.net/manual/en/ldap.constants.php
 */
define ('LDAP_OPT_DEBUG_LEVEL', 20481);
define ('LDAP_OPT_X_SASL_MECH', 24832);
define ('LDAP_OPT_X_SASL_REALM', 24833);
define ('LDAP_OPT_X_SASL_AUTHCID', 24834);
define ('LDAP_OPT_X_SASL_AUTHZID', 24835);
define ('LDAP_ESCAPE_FILTER', 1);
define ('LDAP_ESCAPE_DN', 2);

// End of ldap v.
?>