Passwd_Driver_Adsi
extends Passwd_Driver
in package
The ADSI class changes a user's password on any Windows Machine/NT-Domain using the ADSI COM Interface.
NOTES:
-
If you plan to implement passwd over Active Direcory you must use the LDAP driver and not this one! This driver is designed for standalone machines or NT4 domains, only.
-
The host server must be Win32 with ADSI support.
Sample backend configuration:
$backends['adsi'] = array(
'name' => 'Sample ADSI backend',
'preferred' => 'localhost',
'policy' => array(
'minLength' => 8,
'maxLength' => 14
),
'driver' => 'adsi',
'params' => array(
'target' => 'YOUR_MACHINE/DOMAIN_NAME_HERE'
)
)
Backend parameters: target = Target Windows machine/domain name (Required)
Tags
Table of Contents
- $_params : array<string|int, mixed>
- Hash containing configuration parameters.
- __construct() : mixed
- Constructor.
- changePassword() : mixed
- Changes the user's password.
- _changePassword() : mixed
- Changes the user's password.
- _comparePasswords() : mixed
- Compares a plaintext password with an encrypted password.
- _encryptPassword() : string
- Encrypts a password.
Properties
$_params
Hash containing configuration parameters.
protected
array<string|int, mixed>
$_params
= array()
Methods
__construct()
Constructor.
public
__construct([ $params = array() ]) : mixed
Parameters
Return values
mixed —changePassword()
Changes the user's password.
public
changePassword(string $user, string $oldpass, string $newpass) : mixed
Parameters
- $user : string
-
The user for which to change the password.
- $oldpass : string
-
The old (current) user password.
- $newpass : string
-
The new user password to set.
Tags
Return values
mixed —_changePassword()
Changes the user's password.
protected
_changePassword(mixed $user, mixed $oldpass, mixed $newpass) : mixed
Parameters
- $user : mixed
-
The user for which to change the password (converted to backend username).
- $oldpass : mixed
-
The old (current) user password.
- $newpass : mixed
-
The new user password to set.
Return values
mixed —_comparePasswords()
Compares a plaintext password with an encrypted password.
protected
_comparePasswords(string $encrypted, string $plaintext) : mixed
Parameters
- $encrypted : string
-
An encrypted password.
- $plaintext : string
-
An unencrypted password.
Tags
Return values
mixed —_encryptPassword()
Encrypts a password.
protected
_encryptPassword(string $plaintext) : string
Parameters
- $plaintext : string
-
A plaintext password.
Return values
string —The encrypted password.