ZenMagick 0.9.8


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

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
Version:
$Id: ZMAuthenticationManager.php 2610 2009-11-20 02:45:25Z dermanomann $

Fields inherited from org.zenmagick.core.ZMObject
properties_
Constructor Summary

ZMAuthenticationManager()

Create new instance.

Method Summary
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
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Constructor Detail

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

ZMAuthenticationManager

public ZMAuthenticationManager()

Create new instance.


Method Detail

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

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 137

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 116

getDefaultProvider

public ZMAuthentication getDefaultProvider()

Get the default provider.

Returns:
A provider or null if none are configured.

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

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 62

instance

public static void instance()

Get instance.


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

mkPassword

public string mkPassword()

Generate a new random password.

Returns:
The new password.

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

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.8