Passwd_Driver_Pine
extends Passwd_Driver
in package
Changes a user's password in a Pine password file.
Tags
Table of Contents
- FIRSTCH = 0x20
- Lower boundary character.
- LASTCH = 0x7e
- Upper boundary character.
- TABSZ = 0x5f
- Median character.
- $_connected : bool
- Boolean which contains state of the ftp connection.
- $_contents : array<string|int, mixed>
- Contents array of the pine password file.
- $_ftp : VFS
- Horde_Vfs instance.
- $_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.
- _connect() : mixed
- Connects to the FTP server.
- _decode() : array<string|int, mixed>
- Decodes a Pine-encoded password string.
- _disconnect() : mixed
- Disconnect from the FTP server.
- _encode() : array<string|int, mixed>
- Encodes an array of elements into a Pine-readable password string.
- _encryptPassword() : string
- Encrypts a password.
- _lookup() : mixed
- Finds out if a username and password is valid.
- _modify() : mixed
- Modifies a pine password record for a user.
Constants
FIRSTCH
Lower boundary character.
public
mixed
FIRSTCH
= 0x20
LASTCH
Upper boundary character.
public
mixed
LASTCH
= 0x7e
TABSZ
Median character.
public
mixed
TABSZ
= 0x5f
Properties
$_connected
Boolean which contains state of the ftp connection.
protected
bool
$_connected
= \false
$_contents
Contents array of the pine password file.
protected
array<string|int, mixed>
$_contents
= array()
$_ftp
Horde_Vfs instance.
protected
VFS
$_ftp
$_params
Hash containing configuration parameters.
protected
array<string|int, mixed>
$_params
= array()
Methods
__construct()
Constructor.
public
__construct([array<string|int, mixed> $params = array() ]) : mixed
Parameters
- $params : array<string|int, mixed> = array()
-
A hash containing connection 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 —_connect()
Connects to the FTP server.
protected
_connect(mixed $user, mixed $password) : mixed
Parameters
- $user : mixed
- $password : mixed
Tags
Return values
mixed —_decode()
Decodes a Pine-encoded password string.
protected
_decode(string $string) : array<string|int, mixed>
The algorithm is borrowed from read_passfile() and xlate_out() functions in pine/imap.c file distributed in the Pine source archive.
Parameters
- $string : string
-
The contents of a pine-encoded password file.
Return values
array<string|int, mixed> —List of lines of decoded elements.
_disconnect()
Disconnect from the FTP server.
protected
_disconnect() : mixed
Tags
Return values
mixed —_encode()
Encodes an array of elements into a Pine-readable password string.
protected
_encode(array<string|int, mixed> $lines) : array<string|int, mixed>
The algorithm is borrowed from write_passfile() and xlate_in() functions in pine/imap.c file distributed in the Pine source archive.
Parameters
- $lines : array<string|int, mixed>
-
List of lines of decoded elements.
Return values
array<string|int, mixed> —Contents of a pine-readable password file.
_encryptPassword()
Encrypts a password.
protected
_encryptPassword(string $plaintext) : string
Parameters
- $plaintext : string
-
A plaintext password.
Return values
string —The encrypted password.
_lookup()
Finds out if a username and password is valid.
protected
_lookup(string $user, string $oldPassword) : mixed
Parameters
- $user : string
-
The userID to check.
- $oldPassword : string
-
An old password to check.
Tags
Return values
mixed —_modify()
Modifies a pine password record for a user.
protected
_modify(string $user, string $newPassword) : mixed
Parameters
- $user : string
-
The user whose record we will udpate.
- $newPassword : string
-
The new password value to set.