Helper class for creating a new account for an existing person

package org.openpsa.user

 Methods

__construct (\midcom_db_person $person)

Parameters

$person

check_password_age ()

Function to check password age for this user (age is taken from config)

Returns

boolean- true indicates password is ok - false password is to old

check_password_reuse (string $password)

Function to check if passed password was already used

Parameters

$password

stringpassword to check

Returns

boolreturns if password was already used - true indicates passed password wasn't used

check_password_strength (string $password)

Function to check strength of passed password

Parameters

$password

stringContains password to check

generate_password (int $length)

Returns an auto generated password of variable length
Static

Parameters

$length

intThe number of chars the password will contain

Returns

stringThe generated password

generate_safe_password (int $length)

Returns an auto generated password which will pass the persons check_password_strength test

Parameters

$length

intThe number of chars the password will contain

Returns

stringThe generated password

get_person_by_formdata ($data)

Static

Parameters

$data

is_blocked ()

Helper to determine if an account is blocked based on form data sent by client

_check_repetition (integer $plen, string $password)

Function to check repetition for given password

Parameters

$plen

integerlength to check for repetitions inside the password

$password

stringcontains password to check

Returns

string- string without repetitions

_get_old_passwords ()

Function get old passwords

Returns

array- Array with old passwords - empty if there aren't any old passwords

_save_old_password ()

Function to add current password to parameter old passwords - does not update()

 Properties

 

mixed $errstr

   

\midcom_db_person $_person

The person we're working on