ldap_exop_passwd
PASSWD extended operation helper.
ldap_exop_passwd Function synopsis
ldap_exop_passwd(
LDAP\Connection $ldap,
string $user = "",
string $old_password = "",
string $new_password = "",
&$controls = null
): string|bool
Parameters
$ldap
TypeLDAP\Connection
An LDAP\Connection instance, returned by ldap_connect.
$user
OptionalTypestringDefault value""
dn of the user to change the password of.
$old_password
OptionalTypestringDefault value""
$new_password
OptionalTypestringDefault value""
The new password for this user. May be omitted or empty to have a generated password.
$controls
Passed by reference, OptionalDefault valuenull
If provided, a password policy request control is send with the request and this is filled with an array of LDAP Controls returned with the request.
Note that the parameter
$controlsis passed by reference, and contains additional/updated context data that may be useful.
Return value
Typestring|bool
Returns the generated password if $new_password is empty or omitted.
Otherwise returns true on success and false on failure.
Changes to the ldap_exop_passwd Function
PHP 8.2
- Attribute added for parameter
$old_password:#[SensitiveParameter] - Attribute added for parameter
$new_password:#[SensitiveParameter]
PHP 8.1
- Parameter type added for parameter #1 (
$ldap):LDAP\Connection
ldap_exop_passwd(
- $ldap,
+ LDAP\Connection $ldap,
string $user = "",
string $old_password = "",
string $new_password = "",
&$controls = null
): string|bool PHP 8.0
- Return type added:
string|bool - Parameter name of parameter #1 changed:
$linkto$ldap - Parameter type added for parameter #2 (
$user):string - Parameter default value added for position #2 (
$user):"" - Parameter name of parameter #3 changed:
$oldpwto$old_password - Parameter type added for parameter #3 (
$old_password):string - Parameter default value added for position #3 (
$old_password):"" - Parameter name of parameter #4 changed:
$newpwto$new_password - Parameter type added for parameter #4 (
$new_password):string - Parameter default value added for position #4 (
$new_password):"" - Parameter name of parameter #5 changed:
$serverctrlsto$controls - Parameter default value added for position #5 (
$controls):null
ldap_exop_passwd(
- $link,
+ $ldap,
- $user,
+ string $user = "",
- $oldpw,
+ string $old_password = "",
- $newpw,
+ string $new_password = "",
- &$serverctrls
+ &$controls = null
- )
+ ): string|bool PHP 7.3
- Optional parameter added - #5:
&$serverctrls
ldap_exop_passwd(
$link,
$user,
$oldpw,
- $newpw
+ $newpw,
+ &$serverctrls
) PHP 7.2
- Function added
ldap_exop_passwd Function Availability
ldap_exop_passwd Function Availability| PHP Version | Availability |
|---|---|
| PHP 8.6Upcoming Release | Yes |
| PHP 8.5Supported (Latest) | Yes |
| PHP 8.4Supported | Yes |
| PHP 8.3Security-Fixes Only | Yes |
| PHP 8.2Security-Fixes Only | Yes |
| PHP 8.1Unsupported | Yes |
| PHP 8.0Unsupported | Yes |
| PHP 7.4Unsupported | Yes |
| PHP 7.3Unsupported | Yes |
| PHP 7.2Unsupported | Yes |
| PHP 7.1Unsupported | No |
| PHP 7.0Unsupported | No |
| PHP 5.6Unsupported | No |
| PHP 5.5Unsupported | No |
| PHP 5.4Unsupported | No |
| PHP 5.3Unsupported | No |