-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.developers.txt
53 lines (37 loc) · 1.82 KB
/
README.developers.txt
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
General LDAP Project Notes
LDAP Servers is base module or api module. General LDAP functions belong in
LDAP Servers.
--------------------------------------------------------
Case Sensitivity and Character Escaping in LDAP Modules
--------------------------------------------------------
The function ldap_server_massage_text() should be used for dealing with case sensitivity
and character escaping consistently.
The general rule is codified in ldap_server_massage_text() which is:
- escape filter values and attribute values when querying ldap
- use unescaped, lower case attribute names when storing attribute names in arrays (as keys or values), databases, or object properties.
- use unescaped, mixed case attribute values when storing attribute values in arrays (as keys or values), databases, or object properties.
So a filter might be built as follows:
$username = ldap_server_massage_text($username, 'attr_value', LDAP_SERVER_MASSAGE_QUERY_LDAP)
$objectclass = ldap_server_massage_text($objectclass, 'attr_value', LDAP_SERVER_MASSAGE_QUERY_LDAP)
$filter = "(&(cn=$username)(objectClass=$objectclass))";
The following functions are also available:
ldap_pear_escape_dn_value()
ldap_pear_unescape_dn_value()
ldap_pear_unescape_filter_value()
ldap_pear_unescape_filter_value()
--------------------------------------------------------
common variables used in ldap_* and their structures
--------------------------------------------------------
!Structure of $ldap_user and $ldap_entry are different!
-----------
$ldap_user
-----------
@see LdapServer::userUserNameToExistingLdapEntry() return
-----------
$ldap_entry and $ldap_*_entry.
-----------
@see LdapServer::ldap_search() return array
--------------
$user_attr_key
key of form <attr_type>.<attr_name>[:<instance>] such as field.lname, property.mail, field.aliases:2
--------------