Adldap\Models\User::setPassword PHP Method

setPassword() public method

Sets the password on the current user.
public setPassword ( string $password )
$password string
    public function setPassword($password)
    {
        $connection = $this->query->getConnection();
        if (!$connection->isUsingSSL() && !$connection->isUsingTLS()) {
            $message = 'SSL or TLS must be configured on your web server and enabled to set passwords.';
            throw new AdldapException($message);
        }
        $modification = new BatchModification($this->schema->unicodePassword(), LDAP_MODIFY_BATCH_REPLACE, [Utilities::encodePassword($password)]);
        return $this->addModification($modification);
    }