ldap_exop_passwd

FunctionMisc changes in PHP 8.2

PASSWD extended operation helper.

PHP 5
PHP 7.0-7.1
PHP 7.2
Added
PHP 7.3
Improved
PHP 7.4
PHP 8.0
Improved
PHP 8.1
Improved
PHP 8.2
Changed
PHP 8.3
PHP 8.4
PHP 8.5
PHP 8.6

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 $controls is 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

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: $link to $ldap
  • Parameter type added for parameter #2 ($user): string
  • Parameter default value added for position #2 ($user): ""
  • Parameter name of parameter #3 changed: $oldpw to $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: $newpw to $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: $serverctrls to $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

PHP VersionAvailability
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