tailieunhanh - Beginning PHP and Postgre SQL 8 From Novice to Professional phần 6
chức năng loại bỏ các giá trị của một thực thể thay vì toàn bộ đối tượng. Sự hạn chế này có nghĩa là nó được sử dụng thường xuyên hơn so với ldap_delete (), bởi vì nó là nhiều hơn nữa khả năng là các thuộc tính sẽ yêu cầu loại bỏ hơn là toàn bộ đối tượng. Trong ví dụ sau đây, thuộc tính của công ty Julius Caesar của người sử dụng | 418 CHAPTER 17 PHP AND LDAP ldap_delete boolean ldap_delete resource link_id string dn The ldap_delete function removes an entire entry specified by dn from the LDAP directory returning TRUE on success and FALSE on failure. An example follows dn CN Julius Caesar OU People OU staff DC ad DC example DC com ldap_delete ldapconn dn or die Could not delete entry Completely removing a directory object is rare you ll probably want to remove object attributes rather than an entire object. This feat is accomplished with the function ldap_mod_del introduced next. ldap_mod_del boolean ldap_mod_del resource link_id string dn array entry The ldap_mod_del function removes the value of an entity instead of an entire object. This limitation means it is used more often than ldap_delete because it is much more likely that attributes will require removal rather than entire objects. In the following example user Julius Caesar s company attribute is deleted dn CN Julius Caesar OU People OU staff DC ad DC example DC com ldap_mod_delete ldapconn dn array company In the following example all entries of the multivalued attribute mail are removed dn CN Julius Caesar OU People OU staff DC ad DC example DC com attrs mail array ldap_mod_delete ldapconn dn attrs To remove just a single value from a multivalued attribute you must specifically designate that value like so dn CN Julius Caesar OU People OU staff DC ad DC example DC com attrs mail imperatore@ ldap_mod_delete ldapconn dn attrs Configuration Functions Two functions are available for interacting with PHP s LDAP configuration options ldap_set_option for setting the options and ldap_get_option for retrieving the options. Each function is introduced in this section. However before introducing these functions let s take a moment to review the configuration options available to you. Configuration Options The following configuration options are available for tweaking LDAP s behavior CHAPTER 17 PHP AND LDAP 419 Note LDAP uses the .
đang nạp các trang xem trước