ZenMagick 0.9.10


org.zenmagick.core.services.authentication\ZMAuthenticationManager
core\services\authentication\ZMAuthenticationManager.php at line 35

Class ZMAuthenticationManager

ZMObject
└─ZMAuthenticationManager

public class ZMAuthenticationManager
extends ZMObject

Authentication service.

Delegates to one or more ZMAuthentication providers.

If no provider is set as default, the first registered provider will be taken to encrypt passwords.

.

Author:
DerManoMann

Fields inherited from org.zenmagick.core\ZMObject
properties_
Method Summary
void

__construct()

Create new instance.

void

addProvider(string auth, boolean default)

Add an authentication provider (class).

string

encryptPassword(string plaintext, string salt)

Encrypt a given password.

ZMAuthentication

getDefaultProvider()

Get the default provider.

protected array

getImplementations(string class)

Get instances of all registered providers.

static void

instance()

Get instance.

string

mkPassword()

Generate a new random password.

boolean

validatePassword(string plaintext, string encrypted)

Validate the given clear text password against the encrypted one.

Methods inherited from org.zenmagick.core\ZMObject
__construct, attachMethod, get, getAttachedMethods, getProperties, getPropertyNames, set, singleton

Method Detail

core\services\authentication\ZMAuthenticationManager.php at line 43

__construct

public void __construct()

Create new instance.


core\services\authentication\ZMAuthenticationManager.php at line 99

addProvider

public void addProvider(string auth, boolean default)

Add an authentication provider (class).

Parameters:
auth - The authentication implementation class.
default - Optional flag make auth the default provider; default is false.

core\services\authentication\ZMAuthenticationManager.php at line 136

encryptPassword

public string encryptPassword(string plaintext, string salt)

Encrypt a given password.

Parameters:
plaintext - The plain text password.
salt - Optional salt to improve encryption; default is null.
Returns:
The encrypted password.

core\services\authentication\ZMAuthenticationManager.php at line 115

getDefaultProvider

public ZMAuthentication getDefaultProvider()

Get the default provider.

Returns:
A provider or null if none are configured.

core\services\authentication\ZMAuthenticationManager.php at line 75

getImplementations

protected array getImplementations(string class)

Get instances of all registered providers.

This method is part of the internal optimizations to allow to register class names, rather than actual instances.

Parameters:
class - Optional parameter if only a specific implementation is required; default is null.
Returns:
List of ZMAuthentication instances.

core\services\authentication\ZMAuthenticationManager.php at line 61

instance

public static void instance()

Get instance.


core\services\authentication\ZMAuthenticationManager.php at line 162

mkPassword

public string mkPassword()

Generate a new random password.

Returns:
The new password.

core\services\authentication\ZMAuthenticationManager.php at line 147

validatePassword

public boolean validatePassword(string plaintext, string encrypted)

Validate the given clear text password against the encrypted one.

Parameters:
plaintext - The plain text password.
encrypted - The encrypted password.
Returns:
true if the plain text password matches the encrypted, false if not.

ZenMagick 0.9.10