AuthLDAP

Extends \ls\pluginmanager\AuthPluginBase

Base class for plugins.

Methods

init

init() 

Check availability of LDAP Apache Module

beforeActivate() : \unknown_type

Response

\unknown_type

Create a LDAP user

createNewUser() : \unknown_type

Response

\unknown_type

Create a LDAP user

_createNewUser(string $new_user) : null|string

Arguments

$new_user

string

Response

null|string

New user ID

Create LDAP connection

createConnection() : mixed

Response

mixed

beforeLogin

beforeLogin() 

newLoginForm

newLoginForm() 

Provides meta data on the plugin settings that are available for this plugin.

getPluginSettings($getValues = true) 
inherited

This does not include enable / disable; a disabled plugin is never loaded.

Arguments

$getValues

newUserSession

newUserSession() 

Get the password (if set)

getPassword() : string|null
inherited

Response

string|null

Get the username (if set)

getUserName() : string|null
inherited

Response

string|null

Set username and password

afterLoginFormSubmit() : null
inherited

Response

null

Set authentication result to success for the given user object.

setAuthSuccess(\User $user) : \ls\pluginmanager\AuthPluginBase
inherited

Arguments

$user

\User

Response

\ls\pluginmanager\AuthPluginBase

Set authentication result to failure.

setAuthFailure(int $code = self::ERROR_UNKNOWN_IDENTITY, string $message = '') : \ls\pluginmanager\AuthPluginBase
inherited

Arguments

$code

int

Any of the constants defined in this class

$message

string

An optional message to return about the failure

Response

\ls\pluginmanager\AuthPluginBase

Set this plugin to handle the authentication

setAuthPlugin() : \ls\pluginmanager\AuthPluginBase
inherited

Set the password to use for authentication

setPassword(string $password) : \ls\pluginmanager\AuthPluginBase
inherited

Arguments

$password

string

Response

\ls\pluginmanager\AuthPluginBase

Set the username to use for authentication

setUsername(string $username) : \ls\pluginmanager\AuthPluginBase
inherited

Arguments

$username

string

The username

Response

\ls\pluginmanager\AuthPluginBase

Constructor for the plugin

__construct(\ls\pluginmanager\PluginManager $manager, int $id) 
inherited
todo

Add proper type hint in 3.0

Arguments

$manager

\ls\pluginmanager\PluginManager

The plugin manager instantiating the object

$id

int

The id for storage

This function retrieves plugin data. Do not cache this data; the plugin storage engine will handling caching. After the first call to this function, subsequent calls will only consist of a few function calls and array lookups.

get(string $key = null, string $model = null, int $id = null, mixed $default = null) : boolean
inherited

Arguments

$key

string

$model

string

$id

int

$default

mixed

The default value to use when not was set

Response

boolean

Return the description for this plugin

getDescription() 
inherited static

Get the current event this plugin is responding to

getEvent() : \ls\pluginmanager\PluginEvent
inherited

Returns the id of the plugin

getId() : int
inherited

Used by storage model to find settings specific to this plugin

Response

int

getName

getName() 
inherited static

Returns the plugin storage and takes care of instantiating it

getStore() : \ls\pluginmanager\iPluginStorage
inherited

Publishes plugin assets.

publish($fileName) 
inherited

Arguments

$fileName

registerSetting

registerSetting(string $name, array $options = array('type' => 'string')) 
inherited

Arguments

$name

string

Name of the setting.
The type of the setting is either a basic type or choice. The choice type is either a single or a multiple choice setting.

$options

array

Contains parameters for the setting. The 'type' key contains the parameter type. The type is one of: string, int, float, choice. Supported keys per type: String: max-length(int), min-length(int), regex(string). Int: max(int), min(int). Float: max(float), min(float). Choice: choices(array containing values as keys and names as values), multiple(bool) Note that the values for choice will be translated.

saveSettings

saveSettings(\ls\pluginmanager\type $settings) 
inherited

Arguments

$settings

\ls\pluginmanager\type

This function stores plugin data.

set(string $key, mixed $data, string $model = null, int $id = null) : boolean
inherited

Arguments

$key

string

$data

mixed

$model

string

$id

int

Response

boolean

Set the event to the plugin, this method is executed by the PluginManager just before dispatching the event.

setEvent(\ls\pluginmanager\PluginEvent $event) : \ls\pluginmanager\PluginBase
inherited

This function subscribes the plugin to receive an event.

subscribe(string $event, string $function = null) 
inherited

Arguments

$event

string

$function

string

This function unsubscribes the plugin from an event.

unsubscribe(string $event) 
inherited

Arguments

$event

string

Look for views in plugin views/ folder and render it (no echo)

renderPartial(string $viewfile, array $data, boolean $return = false, boolean $processOutput = false) : \ls\pluginmanager\string;
inherited

Arguments

$viewfile

string

Filename of view in views/ folder

$data

array

$return

boolean

$processOutput

boolean

Response

\ls\pluginmanager\string;

To find the plugin locale file, we need late runtime result of __DIR__.

getDir() : string
inherited

Solution copied from http://stackoverflow.com/questions/18100689/php-dir-evaluated-runtime-late-binding

Response

string

Constants

These constants reflect the error codes to be used by the identity, they are copied from LSUserIdentity and CBaseUserIdentity for easier access.

ERROR_NONE
inherited

ERROR_NOT_ADDED

ERROR_NOT_ADDED
inherited

ERROR_USERNAME_INVALID

ERROR_USERNAME_INVALID
inherited

ERROR_PASSWORD_INVALID

ERROR_PASSWORD_INVALID
inherited

ERROR_AUTH_METHOD_INVALID

ERROR_AUTH_METHOD_INVALID
inherited

ERROR_IP_LOCKED_OUT

ERROR_IP_LOCKED_OUT
inherited

ERROR_UNKNOWN_HANDLER

ERROR_UNKNOWN_HANDLER
inherited

ERROR_UNKNOWN_IDENTITY

ERROR_UNKNOWN_IDENTITY
inherited

ERROR_INVALID_EMAIL

ERROR_INVALID_EMAIL
inherited

ERROR_ALREADY_EXISTING_USER

ERROR_ALREADY_EXISTING_USER
inherited

ERROR_LDAP_CONNECTION

ERROR_LDAP_CONNECTION
inherited

ERROR_LDAP_MODE

ERROR_LDAP_MODE
inherited

ERROR_LDAP_NO_EMAIL

ERROR_LDAP_NO_EMAIL
inherited

ERROR_LDAP_NO_FULLNAME

ERROR_LDAP_NO_FULLNAME
inherited

ERROR_LDAP_NO_BIND

ERROR_LDAP_NO_BIND
inherited

ERROR_LDAP_NO_SEARCH_RESULT

ERROR_LDAP_NO_SEARCH_RESULT
inherited

LDAP_INVALID_PASSWORD_TEXT

LDAP_INVALID_PASSWORD_TEXT
inherited

Properties

storage

storage : 
inherited

description

description : 
inherited static

name

name : 
inherited static

Can we autocreate users? For the moment this is disabled, will be moved to a setting when we have more robust user creation system.

autoCreate : boolean
var

Type(s)

boolean

settings

settings : 
inherited

_username

_username : 
inherited

_password

_password : 
inherited

api

api : \ls\pluginmanager\LimesurveyApi
inherited

event

event : \ls\pluginmanager\PluginEvent
inherited

id

id : 
inherited

store

store : 
inherited

This holds the pluginmanager that instantiated the plugin

pluginManager : \ls\pluginmanager\PluginManager
inherited