FileAccess Orion

Handler extends SecuredServerPlugin
in package

Implement "Send in Blue" handler

This class provides interfaces for service -> send in blue interactions

Tags
category

Plugin

author

Tobias Teichner webmaster@teichner.biz

since

File available since v6.16.0

Table of Contents

$config  : stdClass|null
Buffer for configuration
$defaultPermissions  : array<string|int, mixed>
The default permission set
$dir  : string
The implementation directory
$name  : string
Name of the plugin
$apiInstance  : ContactsApi|null
__construct()  : mixed
set the plugin name
GetAccessList()  : array<string|int, mixed>
Name()  : string
OnAfterAdminRegisterUser()  : void
OnAfterBasketRegisterUser()  : void
OnCommandLineInterfaceCall()  : void
Cli to test all contacts for existing in send in blue context
OnDeleteContent()  : void
React on delete of user and unlink this user on demand
OnGetEntityAttributes()  : void
OnMapArrayIncludes()  : void
OnRegisterWidgetIncludes()  : void
RegisterHooks()  : mixed
RequestOnUrlParsed()  : mixed
ServeRequest()  : mixed
settings()  : Result|object
Get/Set the settings
SetupTemplate()  : mixed
handleConfig()  : void
Handle the context requests
hasAccess()  : bool
Check if endpoint is accessible for this user group
isInContext()  : bool
Is in certain context?
setupAttributes()  : void
Set up the permission attribute table
active()  : bool
addList()  : void
Create a new list
addUsersContactList()  : void
Add user to contact list, create on the fly
addUserToList()  : void
Support method to add existing contacts to a list
attributesToName()  : string
Map configured attributes to name string
connect()  : ContactsApi|null
Create the connection instance
fetchContactAttributes()  : void
Get list of available attributes
fetchContacts()  : void
fetchContactsInList()  : void
Fetch contacts filtered by list
fetchFolders()  : void
Get existing folders
fetchLists()  : void
Fetch the first 50 lists as system result
fetchUsersContactLists()  : void
handleConfigPreset()  : void
Handle the context requests
importMissingContacts()  : void
mapContactsToResult()  : void
Map contacts result to our response object
registerAsContact()  : Result
Register a user as contact
removeContact()  : void
Delete a whole contact
removeContactFromList()  : void
Unlink a contact from a list
removeUserFromContactList()  : void
Remove user from contact list
testContacts()  : void
triggerJob()  : void
Trigger the cronjob for test and import

Properties

$defaultPermissions

The default permission set

protected array<string|int, mixed> $defaultPermissions = [['endpoint' => 'config', 'root' => true, 'admin' => true]]

$apiInstance

private ContactsApi|null $apiInstance = null

Methods

__construct()

set the plugin name

public __construct() : mixed

Handler constructor.

Return values
mixed

GetAccessList()

public GetAccessList(User $user) : array<string|int, mixed>
Parameters
$user : User
Return values
array<string|int, mixed>

OnAfterBasketRegisterUser()

public OnAfterBasketRegisterUser( $reference) : void
Parameters
$reference :

HookArgument

Return values
void

OnCommandLineInterfaceCall()

Cli to test all contacts for existing in send in blue context

public OnCommandLineInterfaceCall( $param) : void
Parameters
$param :

HookArgument

Return values
void

OnDeleteContent()

React on delete of user and unlink this user on demand

public OnDeleteContent( $reference) : void
Parameters
$reference :

HookArgument

Return values
void

OnGetEntityAttributes()

public OnGetEntityAttributes( $reference) : void
Parameters
$reference :

HookArgument

Return values
void

OnMapArrayIncludes()

public OnMapArrayIncludes( $param) : void
Parameters
$param :

HookArgument

Return values
void

OnRegisterWidgetIncludes()

public OnRegisterWidgetIncludes( $param) : void
Parameters
$param :

HookArgument

Return values
void

RegisterHooks()

public RegisterHooks() : mixed
Tags
inheritDoc
Return values
mixed

settings()

Get/Set the settings

public settings([null|object $new = null ]) : Result|object

This method is cached per instance

Parameters
$new : null|object = null

New set of settings to store

Return values
Result|object

SetupTemplate()

public SetupTemplate([mixed $data = null ]) : mixed
Parameters
$data : mixed = null
Tags
inheritDoc
Return values
mixed

handleConfig()

Handle the context requests

protected handleConfig(Request &$request, Response &$response) : void
Parameters
$request : Request
$response : Response
Tags
inheritDoc
Return values
void

hasAccess()

Check if endpoint is accessible for this user group

protected hasAccess(string|array<string|int, string> $right[, Response|null $response = null ][, User|null $user = null ]) : bool
Parameters
$right : string|array<string|int, string>
$response : Response|null = null
$user : User|null = null
Return values
bool

isInContext()

Is in certain context?

protected isInContext(HookArgument $param, string $type, string $widget) : bool
Parameters
$param : HookArgument

The hook argument

$type : string

The type can be scss, css and js to search in widgets or _ to search in global includes

$widget : string

The widget to search for

Return values
bool

setupAttributes()

Set up the permission attribute table

protected setupAttributes( &$attributes,  $l) : void
Parameters
$attributes :

array List of attributes

$l :

string The language

Return values
void

active()

private active() : bool
Return values
bool

addList()

Create a new list

private addList(Request $request, Response $resp) : void

Requires a name and a folder id

Parameters
$request : Request
$resp : Response
Return values
void

addUsersContactList()

Add user to contact list, create on the fly

private addUsersContactList(string $user_id, Request $request, Response $resp) : void
Parameters
$user_id : string
$request : Request
$resp : Response
Return values
void

addUserToList()

Support method to add existing contacts to a list

private addUserToList(string $mode, int $id, Request $request, Response $resp) : void

Mainly used in additional hook in the users widget

Parameters
$mode : string

Step of registration

$id : int

The id to add to

$request : Request

System request reference

$resp : Response

System response reference

Return values
void

attributesToName()

Map configured attributes to name string

private attributesToName(object $attributes) : string
Parameters
$attributes : object
Return values
string

connect()

Create the connection instance

private connect() : ContactsApi|null
Return values
ContactsApi|null

fetchContactAttributes()

Get list of available attributes

private fetchContactAttributes(Response $resp) : void
Parameters
$resp : Response
Return values
void

fetchContactsInList()

Fetch contacts filtered by list

private fetchContactsInList(int $id, Request $request, Response $resp) : void
Parameters
$id : int
$request : Request
$resp : Response
Return values
void

fetchLists()

Fetch the first 50 lists as system result

private fetchLists(Request $request, Response $resp) : void
Parameters
$request : Request
$resp : Response
Return values
void

fetchUsersContactLists()

private fetchUsersContactLists(string $user_id, Request $request, Response $resp) : void
Parameters
$user_id : string
$request : Request
$resp : Response
Return values
void

handleConfigPreset()

Handle the context requests

private handleConfigPreset(Request $request, Response $response) : void
Parameters
$request : Request
$response : Response
Return values
void

importMissingContacts()

private importMissingContacts(Response $resp) : void
Parameters
$resp : Response
Return values
void

mapContactsToResult()

Map contacts result to our response object

private mapContactsToResult(int $echo, Response $resp, GetContacts $result) : void
Parameters
$echo : int
$resp : Response
$result : GetContacts
Return values
void

registerAsContact()

Register a user as contact

private registerAsContact(User $user[, array<string|int, mixed>|null $ids = null ][, bool $force_new = false ]) : Result
Parameters
$user : User
$ids : array<string|int, mixed>|null = null
$force_new : bool = false
Return values
Result

removeContact()

Delete a whole contact

private removeContact(Request $request, Response $resp[, string|null $user_id = null ]) : void
Parameters
$request : Request
$resp : Response
$user_id : string|null = null
Return values
void

removeContactFromList()

Unlink a contact from a list

private removeContactFromList(int $id, int $contact_id, Response $resp) : void
Parameters
$id : int

The list id

$contact_id : int
$resp : Response
Return values
void

removeUserFromContactList()

Remove user from contact list

private removeUserFromContactList(string $user_id, int $id, Response $resp) : void
Parameters
$user_id : string
$id : int
$resp : Response
Return values
void

triggerJob()

Trigger the cronjob for test and import

private triggerJob(Response $resp, array<string|int, mixed> $setup) : void
Parameters
$resp : Response
$setup : array<string|int, mixed>
Return values
void

Search results