LimeSurvey API - Master branch

PasswordRequirement extends PluginBase
in package

Core plugin for LimeSurvey : password requirement settings

Tags
version
1.1.0

Table of Contents

Properties

$allowedPublicMethods  : mixed
$settings  : mixed
$storage  : string
Where to save plugin settings etc.

Methods

checkPasswordRequirement()  : mixed
createRandomPassword()  : mixed
getPluginSettings()  : mixed
Provides meta data on the plugin settings that are available for this plugin.
init()  : void
validateSaveSurveyForm()  : void
checkValidityOfPassword()  : null|array<string|int, mixed>
Chek the validity of a pasword according to option
getRandomString()  : mixed
pickRandomChar()  : string
Returns a random character from a string
safeRandom()  : int
Returns a random number using random_int if available or mt_rand f not.

Properties

$allowedPublicMethods

public mixed $allowedPublicMethods = array()
Tags
inheritdoc

this plugin didn't have any public method

$settings

protected mixed $settings = ['adminPart' => array('content' => 'Password requirements for administration login', 'type' => 'info', 'class' => "h3", 'controlOptions' => array('class' => "col-md-offset-4 col-md-6")), 'needsNumber' => array('label' => 'Require at least one digit', 'type' => 'checkbox', 'default' => \true), 'needsUppercase' => array('label' => 'Require at least one uppercase character', 'type' => 'checkbox', 'default' => \true), 'needsNonAlphanumeric' => array('label' => 'Require at least one special character', 'type' => 'checkbox', 'default' => \false), 'minimumSize' => array('label' => 'Minimum password length', 'type' => 'int', 'default' => 12), 'surveyPart' => array('content' => 'Password requirements for “Save and return later” feature', 'type' => 'info', 'class' => "h3", 'controlOptions' => array('class' => "col-md-offset-4 col-md-6")), 'surveySaveActive' => array('type' => 'boolean', 'label' => 'Check password when saving survey', 'default' => \false), 'surveySaveNeedsNumber' => array('label' => 'Require at least one digit', 'type' => 'checkbox', 'default' => \false), 'surveySaveNeedsUppercase' => array('label' => 'Require at least one uppercase character', 'type' => 'checkbox', 'default' => \false), 'surveySaveNeedsNonAlphanumeric' => array('label' => 'Require at least one special character', 'type' => 'checkbox', 'default' => \false), 'surveySaveMinimumSize' => array('label' => 'Minimum password length', 'type' => 'int', 'default' => 8)]

Methods

getPluginSettings()

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

public getPluginSettings([mixed $getValues = true ]) : mixed

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

Parameters
$getValues : mixed = true

validateSaveSurveyForm()

public validateSaveSurveyForm() : void
Tags
see
event

get the current save action password and add errors if needed

checkValidityOfPassword()

Chek the validity of a pasword according to option

private checkValidityOfPassword(string $password, bool $needsNumber, bool $needsUppercase, bool $needsNonAlphanumeric[, mixed $minimumSize = 8 ]) : null|array<string|int, mixed>
Parameters
$password : string
$needsNumber : bool
$needsUppercase : bool
$needsNonAlphanumeric : bool
$minimumSize : mixed = 8
Return values
null|array<string|int, mixed>

null mean no issue.

getRandomString()

private getRandomString([mixed $length = 8 ][, mixed $uppercase = false ][, mixed $numeric = false ][, mixed $nonAlpha = false ]) : mixed
Parameters
$length : mixed = 8
$uppercase : mixed = false
$numeric : mixed = false
$nonAlpha : mixed = false

pickRandomChar()

Returns a random character from a string

private static pickRandomChar(string $chars) : string
Parameters
$chars : string

Pool fo character from where to pick

Return values
string

Picked character

safeRandom()

Returns a random number using random_int if available or mt_rand f not.

private static safeRandom(int $max[, int $min = 0 ]) : int
Parameters
$max : int

The highest value to be returned

$min : int = 0

The lowest value to be returned

Return values
int

        
On this page

Search results