rfc:ldap_modify_batch
Differences
This shows you the differences between two versions of the page.
rfc:ldap_modify_batch [2014/01/02 13:25] ondrahosek three spaces in the front. fix voting again. |
rfc:ldap_modify_batch [2017/09/22 13:28] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | |||
- | ====== PHP RFC: ldap_modify_batch ====== | ||
- | * Version: 1.0 | ||
- | * Date: 2013-03-01 | ||
- | * Author: Ondřej Hošek, ondra.hosek@gmail.com | ||
- | * Status: Voting (until 2014-01-16) | ||
- | * First Published at: http:// | ||
- | |||
- | ===== Introduction ===== | ||
- | |||
- | PHP's LDAP API already allows all the common directory modification operations while abstracting away some of the protocol details. However, some directory services (such as Active Directory) require a slightly more specific approach when performing special modifications, | ||
- | |||
- | This RFC introduces a new '' | ||
- | |||
- | ===== Specification ===== | ||
- | |||
- | ==== Description ==== | ||
- | |||
- | bool ldap_modify_batch(resource $link_identifier, | ||
- | |||
- | Modify an existing entry in the LDAP directory. Allows detailed specification of the modifications to perform. | ||
- | |||
- | ==== Parameters ==== | ||
- | |||
- | **link_identifier** | ||
- | |||
- | > An LDAP link identifier, returned by **// | ||
- | |||
- | **dn** | ||
- | |||
- | > The distinguished name of the LDAP entity to modify. | ||
- | |||
- | **entry** | ||
- | |||
- | > An array that specifies the modifications to make. Each entry in this array is an associative array with two or three keys: ''" | ||
- | > | ||
- | > If the ''" | ||
- | > If the ''" | ||
- | > If the ''" | ||
- | > If the ''" | ||
- | > | ||
- | > Note that any value for ''" | ||
- | |||
- | ==== Return Values ==== | ||
- | |||
- | Returns '' | ||
- | |||
- | ==== Examples ==== | ||
- | |||
- | === Example #1: Add a telephone number to a contact === | ||
- | |||
- | $modifs = array( | ||
- | array( | ||
- | " | ||
- | " | ||
- | " | ||
- | ) | ||
- | ); | ||
- | ldap_modify_batch($connection, | ||
- | |||
- | === Example #2: Rename a user === | ||
- | |||
- | $modifs = array( | ||
- | array( | ||
- | " | ||
- | " | ||
- | " | ||
- | ), | ||
- | array( | ||
- | " | ||
- | " | ||
- | " | ||
- | ) | ||
- | ); | ||
- | ldap_modify_batch($connection, | ||
- | ldap_rename($connection, | ||
- | |||
- | === Example #3: Add two e-mail addresses to a user === | ||
- | |||
- | $modifs = array( | ||
- | array( | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | ) | ||
- | ) | ||
- | ); | ||
- | ldap_modify_batch($connection, | ||
- | |||
- | === Example #4: Change a user's password === | ||
- | |||
- | $modifs = array( | ||
- | array( | ||
- | " | ||
- | " | ||
- | " | ||
- | ), | ||
- | array( | ||
- | " | ||
- | " | ||
- | " | ||
- | ) | ||
- | ); | ||
- | ldap_modify_batch($connection, | ||
- | |||
- | === Example #5: Change a user's password (Active Directory) === | ||
- | |||
- | | ||
- | { | ||
- | | ||
- | } | ||
- | |||
- | | ||
- | | ||
- | " | ||
- | " | ||
- | " | ||
- | ), | ||
- | | ||
- | " | ||
- | " | ||
- | " | ||
- | ) | ||
- | ); | ||
- | ldap_modify_batch($connection, | ||
- | |||
- | ===== Possible Issues ===== | ||
- | |||
- | (The author would like further feedback on the following facets of the proposal and implementation -- if you deem any of them problematic, | ||
- | |||
- | * The structure of '' | ||
- | |||
- | * The types are currently rather inflexible. The value that ''" | ||
- | |||
- | * The function is implemented in a way that first validates all argument values and only then re-formats them into what is expected by the underlying C API. This approach was chosen to make cleanup easier (nothing is allocated until everything has been validated, so there is only one deallocation code path), but it does come with a slight performance penalty (each array must be iterated through twice). | ||
- | |||
- | * The included utility functions might be duplicates of existing ones. These functions are '' | ||
- | |||
- | ===== Open Issues ===== | ||
- | |||
- | None yet. | ||
- | |||
- | ===== Proposal and Patch ===== | ||
- | |||
- | The current revision of the patch (including tests) is available as [[https:// | ||
- | |||
- | ===== Mailing list discussion ===== | ||
- | |||
- | The mailing list discussion is available on MARC: [[http:// | ||
- | |||
- | ===== Vote ===== | ||
- | |||
- | <doodle title=" | ||
- | * Yes | ||
- | * No | ||
- | </ | ||
- | |||
- | Voting ends on January 16th, 2014 (unless it is aborted due to a change request). | ||
- | |||
- | ===== Changelog ===== | ||
- | |||
- | * 1.0 (2013-03-01): | ||
rfc/ldap_modify_batch.txt · Last modified: 2017/09/22 13:28 (external edit)