Properties

$AdminLevel

$AdminLevel :integer

The jump mark for admin group level

Type

integer

$system_groups

$system_groups :array

List of system groups

Type

array—List of groups

$companies

$companies :array<mixed,\FAA\Obj\Generic\Company>

Cache of companies

Type

array<mixed,\FAA\Obj\Generic\Company>

$user_simple_fields

$user_simple_fields :array

list of simple values in user profile

Type

array

Methods

SystemGroups()

SystemGroups(): array

The system groups

Returns

array

ListGroups()

ListGroups(string  $language = null): \FAA\Obj\Result

list groups Read a list of groups from local storage Uses the generic user object load to get the groups list

Parameters

string $language

A language id

Returns

\FAA\Obj\Result —

A default system result set

GetTokenList()

GetTokenList(boolean  $refresh = false,integer  $count = null): \FAA\Obj\Result

Get user token list This is the abstract interface to refresh the anti XSRF token list.

Parameters

boolean $refresh

When set to true, do a refresh of the token list

integer $count

When set, this amount of new tokens is provided

Returns

\FAA\Obj\Result —

A default system result set

TestToken()

TestToken(): \FAA\Obj\Result

Test the anti CSRF token This is the abstract interface for regular system log out

Returns

\FAA\Obj\Result —

a default system result set

GetAccessList()

GetAccessList(\FAA\Obj\Request  $request): \FAA\Obj\Result

get user access list This is the abstract interface for regular system logouts

Parameters

\FAA\Obj\Request $request

Returns

\FAA\Obj\Result —

A default system result set

GetCompanyList()

GetCompanyList(): array<mixed,\FAA\Obj\Generic\Company>

List of system companies

Get the list of raw system companies. This method is cached locally

Returns

array<mixed,\FAA\Obj\Generic\Company> —

A list of companies

JwtAuth()

JwtAuth(string  $header)

JWT auth check Test if a given Jwt Header is valid token and update the linked session

Parameters

string $header

The token header

OauthRefresh()

OauthRefresh(\FAA\Obj\Request  $request)

Parameters

\FAA\Obj\Request $request

OauthLogin()

OauthLogin(\FAA\Obj\Request  $request): integer

perform oauth login This is the abstract interface for regular system logins, it uses the defined post vars to determinate the corresponding user

Parameters

\FAA\Obj\Request $request

Returns

integer —

A http response code

WebLogin()

WebLogin(\FAA\Obj\Request  $request): \FAA\Obj\Result

Perform web login

This is the abstract interface for regular system login, it uses the defined post vars to determinate the corresponding user It does supp post paramters as http_post string as well as json like all endpoints

Parameters

\FAA\Obj\Request $request

Returns

\FAA\Obj\Result —

A default system result set

WebLogout()

WebLogout(boolean  $full = false): \FAA\Obj\Result

perform web logout This is the abstract interface for regular system logout

Parameters

boolean $full

Delete full session

Returns

\FAA\Obj\Result —

A default system result set

FindUser()

FindUser(string  $search,string  $field = 'alias',string  $language = null): \FAA\Obj\Result

Find single user Search the user list by single attribute

Parameters

string $search

The search value

string $field

The field to search in

string $language

Language id or null

Returns

\FAA\Obj\Result —

A system result object

GeoCodeAddress()

GeoCodeAddress(  $address)

Parameters

$address

FindUserByAlias()

FindUserByAlias(array  $data,string  $language = null,boolean  $to_plain = false): \FAA\Obj\Result

Find list of users Load list of user accounts

Parameters

array $data

A search setup object, @see ObjectHandler::FilterTypeListAssoc()

string $language

The language to search in

boolean $to_plain

Convert to plain object when loading

Returns

\FAA\Obj\Result —

A default system result object with user list

FindSingleUserByAlias()

FindSingleUserByAlias(array  $data,string  $language = null): \FAA\Obj\Generic\User

Find a single user by name Load list of user accounts and when only one user was found, return it

Parameters

array $data

A search setup object, @see ObjectHandler::FilterTypeListAssoc()

string $language

The language to search in

Returns

\FAA\Obj\Generic\User —

A user or null when not unique

GetGroup()

GetGroup(string  $id): null|\FAA\Obj\Generic\Group

Fetch group Load a single user group instance

Parameters

string $id

A group object id

Returns

null|\FAA\Obj\Generic\Group

A system user group object or null

GetUser()

GetUser(integer  $id): \FAA\Obj\Generic\User

Fetch user Load a single user instance by given id

Parameters

integer $id

Object id

Returns

\FAA\Obj\Generic\User —

A system user object or null

GetEmployee()

GetEmployee(integer  $id): null|\FAA\Obj\Generic\Employee

Fetch employee Load a single employee instance by given id

Parameters

integer $id

Object id

Returns

null|\FAA\Obj\Generic\Employee —

A system employee object or null

Login()

Login(array  $credentials): \FAA\Obj\Result

The login interface Registers the desired user as current session account when credentials are fitting Supports the FAA_SESSION_PHOENIX_ACCOUNT for drive by login and calls the On2FactorRequired hook after login.

Parameters

array $credentials

The request with at least: name string a system user name password string a system user password source string The source url of this request ignore_second bool Skip the hook on demand

Returns

\FAA\Obj\Result —

a default system result object

GetLoginRedirect()

GetLoginRedirect(string  $origin): \FAA\Obj\Result

Get redirect url based on request source

Parameters

string $origin

The original url

Returns

\FAA\Obj\Result —

The result and secondary with target

CompareUsersLevel()

CompareUsersLevel(\FAA\Obj\Generic\User  $user1,\FAA\Obj\Generic\User  $user2): integer

compare two users compares the level of two users and returns the difference, lower values say user2 has higher level

Parameters

\FAA\Obj\Generic\User $user1

The admin user account

\FAA\Obj\Generic\User $user2

The system user account

Returns

integer —

The level difference, e.g. -1 say user 2 has higher level than user 1

ResetPassword()

ResetPassword(string  $password,string  $token,string  $language): \FAA\Obj\Result

reset a user password when the given token is linked to an existing account the function will override the users password

Parameters

string $password

The new password

string $token

The activation token

string $language

The request language code

Returns

\FAA\Obj\Result —

A default system result object

RegisterResetPassword()

RegisterResetPassword(array  $payload,array  $setup = array()): \FAA\Obj\Result

register reset a user password registers a rest token to a user account and send a mail to registered email address with reset instructions

Parameters

array $payload

The set of username/alias and password

array $setup

The mail preset that should be used, should contain language and template name

Returns

\FAA\Obj\Result —

A default system result object

SendResetPasswordInstructions()

SendResetPasswordInstructions(\FAA\Obj\Generic\User  $user,array  $setup,string|null  $password = null): \FAA\Obj\Result

Register the reset token and send the email with the reset link

Parameters

\FAA\Obj\Generic\User $user

The user object

array $setup

The template setup

string|null $password

The new password

Returns

\FAA\Obj\Result —

The result

RegisterUser()

RegisterUser(array  $data,array  $options = array()): \FAA\Obj\Result

Register a new user registers a new user into the system, will send welcome email when template defined in options

Parameters

array $data

The basic attributes of th user surname string the users last name firstname string the users first name emailaddress string the users email address or, none for dynamic created one alias string the users account login alias or, none for dynamic created one password string the users password or empty for dynamic created one external string the external id in app register mode, e.g. a facebook id dateformat string The dat format, defaults to 'DD.MM.YYYY HH:mm' active bool The users initial activation state, defaults to true groups array List of initial groups {key: 'group', value: [...]}, defaults to 'customer'

array $options

Configuration options for this function language string the request language code mail_register string the key for the registration mail preset

Returns

\FAA\Obj\Result —

a default system result object

SendRegisterMail()

SendRegisterMail(string  $template,string  $language,\FAA\Obj\Generic\User  $user,array  $data): \FAA\Obj\Result

Send registration email Sends an email to the newly generated user based on the given language and preset name.

Parameters

string $template

The template name

string $language

The target language

\FAA\Obj\Generic\User $user

The user

array $data

The payload from creation

Returns

\FAA\Obj\Result —

A system result object

RegisterSession()

RegisterSession(integer  $id): \FAA\Obj\Result

Register user session

Registers the desired user as current session account this function will regenerate the session id

Parameters

integer $id

A system user id

Returns

\FAA\Obj\Result —

A default system result object

GetCurrentUser()

GetCurrentUser(): \FAA\Obj\Generic\User

Get the current logged in user Get a registered session user from the super global session

Returns

\FAA\Obj\Generic\User —

A user object or null

GetSessionVar()

GetSessionVar(string  $key): mixed

Get session variable Get a registered session variable from the super global session

Parameters

string $key

The array key

Returns

mixed —

If no value was found, return null

SetSessionVar()

SetSessionVar(string  $key,mixed  $value = null,boolean  $permanent = false): boolean

Set session variable Set a new session variable in the super global session

Parameters

string $key

The array key

mixed $value

If no value was given the entry will be deleted

boolean $permanent

If set to true the system will try to persist this var in the user session storage

Returns

boolean —

True when setting was successful, that is the regular case.

GetPersistentSessionVar()

GetPersistentSessionVar(string  $key = null): mixed

Get persistent session variable Get a registered session variable from the super global session

Parameters

string $key

The array key or, null for whole persistent session data

Returns

mixed —

If no value was found, return null

SetPersistentSessionVar()

SetPersistentSessionVar(string  $key,mixed  $value): boolean

Set persistent session variable Set a session variable in the persistent session storage

Parameters

string $key

The array key

mixed $value

If null value is given the entry will be deleted

Returns

boolean —

True when setting was successful, that is the regular case.