\User

Maintains the user profiles.

Summary

Methods
Properties
Constants
getIdByName()
validateAuthCode()
validatePassword()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
setup()
$isSetup
$jsonReader
$userArray
N/A

Properties

$isSetup

$isSetup : bool

Indicates whether the setup has been done or not.

Type

normal

$jsonReader

$jsonReader : \JsonReader

JsonReader object to deal with json files.

Type

\JsonReader

$userArray

$userArray : array

Holds the user data.

Type

normal

Methods

getIdByName()

getIdByName(string  $user) : string

Finds the corresponding user id to an user name.

Parameters

string $user

The user for which we want to find out the id.

Returns

string —

The corresponding id to that user name.

validateAuthCode()

validateAuthCode(string  $id, string  $auth) : bool

Validates a given authentication code for a specific user.

Parameters

string $id

The id of the user for which the authentication code should be validated.

string $auth

The authentication code to be validated.

Returns

bool —

True if the authentication code is correct, else false.

validatePassword()

validatePassword(string  $user, string  $pwd) : bool

Validates a given password for a specific user.

Parameters

string $user

The user name for the user.

string $pwd

The password for the user.

Returns

bool —

True if the password is correct, else false.

setup()

setup() : void

Initializes the JsonReader object and saves the user list.