Mozilla LDAP SDK Programmer's Guide/LDAP C SDK Function Reference: Difference between revisions

Jump to navigation Jump to search
Update to reflect correct function names and parameters
(Typo)
(Update to reflect correct function names and parameters)
Line 7,621: Line 7,621:
*LDAP_NOT_SUPPORTED if your LDAP client does not specify that it is using LDAP v3. Make sure that you set the version of your LDAP client to version 3 before calling this function.
*LDAP_NOT_SUPPORTED if your LDAP client does not specify that it is using LDAP v3. Make sure that you set the version of your LDAP client to version 3 before calling this function.


=== ldap_parse_pwdpolicy_control()  ===
=== ldap_parse_passwordpolicy_control()  ===


The ldap_parse_pwdpolicy_control() function parses information about the password policy relative to a user account contained in a control returned with a bind, add, modify, or compare result after the ldap_create_userstatus_control() is used to create a request control sent to the server. The ldap_parse_pwdpolicy_control() function populates an LDAPpwdpolicy structure.  
The ldap_parse_passwordpolicy_control() function parses information about the password policy relative to a user account contained in a control returned with a bind, add, modify, or compare result after the ldap_create_passwordpolicy_control() is used to create a request control sent to the server. The ldap_parse_passwordpolicy_control() function populates an LDAPPasswordPolicyError structure, an expiration time counter, and a grace logins remaining counter.  


<br> '''Syntax'''  
<br> '''Syntax'''  
<pre>#include &lt;ldap.h&gt;
<pre>#include &lt;ldap.h&gt;
LDAP_API(int) LDAP_CALL ldap_parse_pwdpolicy_control( LDAP *ld,
LDAP_API(int) LDAP_CALL ldap_parse_passwordpolicy_control( LDAP *ld,
  LDAPControl **ctrlp, LDAPpwdpolicy *pp );</pre>  
    LDAPControl *ctrlp, ber_int_t *expirep, ber_int_t *gracep,
    LDAPPasswordPolicyError *errorp );</pre>  
'''Parameters'''  
'''Parameters'''  


<br>  
<br>  


{| width="100%" cellspacing="1" cellpadding="1" border="1" summary="ldap_parse_pwdpolicy_control() Function Parameters"
{| width="100%" cellspacing="1" cellpadding="1" border="1" summary="ldap_parse_passwordpolicy_control() Function Parameters"
|+ ldap_parse_pwdpolicy_control() Function Parameters  
|+ ldap_parse_passwordpolicy_control() Function Parameters  
|-
|-
! scope="col" | Parameter  
! scope="col" | Parameter  
Line 7,644: Line 7,645:
| ctrlp  
| ctrlp  
| Pointer to an LDAPControl structure retrieved from the server.
| Pointer to an LDAPControl structure retrieved from the server.
|-
| expirep
| Pointer to an ber_int_t structure to hold password expiration time in seconds.
|-
| gracep
| Pointer to an ber_int_t structure to hold number of grace logins remaining.
|-
| pp
| Pointer to an LDAPPasswordPolicyError structure to hold information about the password policy state.
|}
<br> '''Returns'''
<br> One of the following values:
*LDAP_SUCCESS if successful.
*LDAP_PARAM_ERROR if any of the arguments are invalid.
*LDAP_NO_MEMORY if memory cannot be allocated to decode the control returned by the server.
*LDAP_DECODING_ERROR if an error occurred when decoding the BER-encoded message.
*LDAP_CONTROL_NOT_FOUND if no control can be found in the response returned from the server.
*LDAP_NOT_SUPPORTED if controls are included in your request (for example, as a session preference) and your LDAP client does not specify that it is using the LDAP v3. Make sure that you set the version of your LDAP client to version 3 before calling this function.
<br> '''See Also'''
<br> ldap_create_pwdpolicy_control(), LDAPPasswordPolicyError
=== ldap_parse_passwordpolicy_control_ext()  ===
The ldap_parse_passwordpolicy_control_ext() function parses information about the password policy relative to a user account contained in a control returned with a bind, add, modify, or compare result after the ldap_create_passwordpolicy_control() is used to create a request control sent to the server. The ldap_parse_passwordpolicy_control_ext() function populates an LDAPPasswordPolicyError structure, an expiration time counter, and a grace logins remaining counter.
<br> '''Syntax'''
<pre>#include &lt;ldap.h&gt;
LDAP_API(int) LDAP_CALL ldap_parse_passwordpolicy_control_ext( LDAP *ld,
    LDAPControl *ctrlp, ber_int_t *expirep, ber_int_t *gracep,
    LDAPPasswordPolicyError *errorp );</pre>
'''Parameters'''
<br>
{| width="100%" cellspacing="1" cellpadding="1" border="1" summary="ldap_parse_passwordpolicy_control_ext() Function Parameters"
|+ ldap_parse_passwordpolicy_control_ext() Function Parameters
|-
! scope="col" | Parameter
! scope="col" | Description
|-
| ld
| Pointer to an LDAP structure containing information about the connection to the LDAP server.
|-
| ctrlp
| Pointer to an LDAPControl structure retrieved from the server.
|-
| expirep
| Pointer to an ber_int_t structure to hold password expiration time in seconds.
|-
| gracep
| Pointer to an ber_int_t structure to hold number of grace logins remaining.
|-
|-
| pp  
| pp  
| Pointer to an LDAPpwdpolicy structure to hold the information about password policy.
| Pointer to an LDAPPasswordPolicyError structure to hold information about the password policy state.
|}
|}


Line 7,662: Line 7,719:
<br> '''See Also'''  
<br> '''See Also'''  


<br> ldap_create_pwdpolicy_control(), LDAPpwdpolicy()
<br> ldap_create_pwdpolicy_control(), LDAPPasswordPolicyError


=== ldap_parse_reference()  ===
=== ldap_parse_reference()  ===
123

edits

Navigation menu