class AuthenticationType extends ConcreteObject (View source)

Properties

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

Methods

loadError($error)

No description

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

static 
camelcase($file)

No description

static 
uncamelcase($string)

No description

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

string
getAuthenticationTypeDisplayName(string $format = 'html')

Returns the display name for this instance (localized and escaped accordingly to $format)

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 = [])

Render the login form for this authentication type.

renderHook()

Render the hook form for saving the profile settings.

hasHook()

No description

renderHooked()

Render the a form to be displayed when the authentication type is already hooked.

bool
hasHooked()

Does this authentication type support rendering a form when it has already been hooked?

bool|null
isHooked(User|UserInfo|User|int $user)

Is this authentication type already hooked for a specific user?

Details

loadError($error)

No description

Parameters

$error

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

Parameters

$arr

static camelcase($file)

No description

Parameters

$file

static uncamelcase($string)

No description

Parameters

$string

static getListSorted()

No description

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)

No description

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()

No description

string getAuthenticationTypeDisplayName(string $format = 'html')

Returns the display name for this instance (localized and escaped accordingly to $format)

Parameters

string $format

= 'html' Escape the result in html format (if $format is 'html'). If $format is 'text' or any other value, the display name won't be escaped.

Return Value

string

getAuthenticationTypeDisplayOrder()

No description

getAuthenticationTypePackageID()

No description

getController()

No description

getAuthenticationTypeIconHTML()

No description

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()

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.

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()

No description

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 = [])

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()

No description

renderHooked()

Render the a form to be displayed when the authentication type is already hooked.

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

bool hasHooked()

Does this authentication type support rendering a form when it has already been hooked?

Return Value

bool

bool|null isHooked(User|UserInfo|User|int $user)

Is this authentication type already hooked for a specific user?

Parameters

User|UserInfo|User|int $user

Return Value

bool|null

returns null if the controller does not implement a way to determine if a user is already hooked or not