class AuthenticationType extends Object (View source)

Properties

$error from Object
Controller $controller
protected $authTypeID
protected $authTypeName
protected $authTypeHandle
protected $authTypeDisplayOrder
protected $authTypeIsEnabled
protected $pkgID

Methods

loadError($error)

No description

from Object
isError()

No description

from Object
getError()

No description

from Object
setPropertiesFromArray($arr)

No description

from Object
static 
camelcase($file)

No description

from Object
static 
uncamelcase($string)

No description

from Object
static 
getListSorted()

No description

static AuthenticationType[]
getList(bool $sorted = false, bool $activeOnly = false)

Return a raw list of authentication types.

static bool|AuthenticationType
load(array $arr)

Load an AuthenticationType from an array.

loadController()

Load the AuthenticationTypeController into the AuthenticationType.

getPackageHandle()

AuthenticationType::getPackageHandle Return the package handle.

static AuthenticationType[]
getListByPackage(Package $pkg)

Return an array of AuthenticationTypes that are associated with a specific package.

add(string $atHandle, string $atName, int $order = 0, bool|Package $pkg = false)

No description

getByHandle(string $atHandle)

Return loaded AuthenticationType with the given handle.

getByID(int $authTypeID)

Return loaded AuthenticationType with the given ID.

getAuthenticationTypeName()

No description

getController()

No description

setAuthenticationTypeName(string $authTypeName)

Update the name.

setAuthenticationTypeDisplayOrder(int $order)

AuthenticationType::setAuthenticationTypeDisplayOrder Update the order for display.

getAuthenticationTypeID()

No description

toggle()

AuthenticationType::toggle Toggle the active state of an AuthenticationType.

isEnabled()

No description

getAuthenticationTypeStatus()

No description

disable()

AuthenticationType::disable Disable an authentication type.

enable()

AuthenticationType::enable Enable an authentication type.

delete()

AuthenticationType::delete Remove an AuthenticationType, this should be used sparingly.

bool|string
getAuthenticationTypeFilePath(string $_file)

Return the path to a file.

string
mapAuthenticationTypeFilePath(string $_file)

Return the first existing file path in this order: - /models/authentication/types/HANDLE - /packages/PKGHANDLE/authentication/types/HANDLE - /concrete/models/authentication/types/HANDLE - /concrete/core/models/authentication/types/HANDLE.

getAuthenticationTypeHandle()

No description

renderTypeForm()

Render the settings form for this type.

renderForm(string $element = 'form', array $params = array())

Render the login form for this authentication type.

renderHook()

Render the hook form for saving the profile settings.

hasHook()

No description

Details

loadError($error)

Parameters

$error

isError()

getError()

setPropertiesFromArray($arr)

Parameters

$arr

static camelcase($file)

Parameters

$file

static uncamelcase($string)

Parameters

$string

static getListSorted()

static AuthenticationType[] getList(bool $sorted = false, bool $activeOnly = false)

Return a raw list of authentication types.

Parameters

bool $sorted true: Sort by display order, false: sort by install order
bool $activeOnly true: include only active types, false: include active and inactive types

Return Value

AuthenticationType[]

static bool|AuthenticationType load(array $arr)

Load an AuthenticationType from an array.

Parameters

array $arr should be an array of the following key/value pairs to create an object from:

array(
    'authTypeID' => int,
    'authTypeHandle' => string,
    'authTypeName' => string,
    'authTypeDisplayOrder' => int,
    'authTypeIsEnabled' => tinyint,
    'pkgID' => int
)

Return Value

bool|AuthenticationType

protected loadController()

Load the AuthenticationTypeController into the AuthenticationType.

getPackageHandle()

AuthenticationType::getPackageHandle Return the package handle.

static AuthenticationType[] getListByPackage(Package $pkg)

Return an array of AuthenticationTypes that are associated with a specific package.

Parameters

Package $pkg

Return Value

AuthenticationType[]

static AuthenticationType add(string $atHandle, string $atName, int $order = 0, bool|Package $pkg = false)

Parameters

string $atHandle New AuthenticationType handle
string $atName New AuthenticationType name, expect this to be presented with "%s Authentication Type"
int $order Order int, used to order the display of AuthenticationTypes
bool|Package $pkg Package object to which this AuthenticationType is associated.

Return Value

AuthenticationType Returns a loaded authentication type.

Exceptions

Exception

static AuthenticationType getByHandle(string $atHandle)

Return loaded AuthenticationType with the given handle.

Parameters

string $atHandle AuthenticationType handle.

Return Value

AuthenticationType

Exceptions

Exception when an invalid handle is provided

static AuthenticationType getByID(int $authTypeID)

Return loaded AuthenticationType with the given ID.

Parameters

int $authTypeID

Return Value

AuthenticationType

Exceptions

Exception

getAuthenticationTypeName()

getAuthenticationTypeDisplayOrder()

getAuthenticationTypePackageID()

getController()

getAuthenticationTypeIconHTML()

setAuthenticationTypeName(string $authTypeName)

Update the name.

Parameters

string $authTypeName

setAuthenticationTypeDisplayOrder(int $order)

AuthenticationType::setAuthenticationTypeDisplayOrder Update the order for display.

Parameters

int $order value from 0-n to signify order.

getAuthenticationTypeID()

toggle()

AuthenticationType::toggle Toggle the active state of an AuthenticationType.

isEnabled()

getAuthenticationTypeStatus()

disable()

AuthenticationType::disable Disable an authentication type.

enable()

AuthenticationType::enable Enable an authentication type.

delete()

AuthenticationType::delete Remove an AuthenticationType, this should be used sparingly.

bool|string getAuthenticationTypeFilePath(string $_file)

Return the path to a file.

Parameters

string $_file the relative path to the file.

Return Value

bool|string

protected string mapAuthenticationTypeFilePath(string $_file)

Return the first existing file path in this order: - /models/authentication/types/HANDLE - /packages/PKGHANDLE/authentication/types/HANDLE - /concrete/models/authentication/types/HANDLE - /concrete/core/models/authentication/types/HANDLE.

Parameters

string $_file The filename you want.

Return Value

string This will return false if the file is not found.

getAuthenticationTypeHandle()

renderTypeForm()

Render the settings form for this type.

Settings forms are expected to handle their own submissions and redirect to the appropriate page. Otherwise, if the method exists, all $_REQUEST variables with the arrangement: HANDLE[] in an array to the AuthenticationTypeController::saveTypeForm.

renderForm(string $element = 'form', array $params = array())

Render the login form for this authentication type.

Parameters

string $element
array $params

renderHook()

Render the hook form for saving the profile settings.

All settings are expected to be saved by each individual authentication type.

hasHook()