phpDocumentor

AdminAccessController extends AdminHttpViewController

Class AdminAccessController

Tags
category

System

Table of Contents

$adminAccessService  : AdminAccessService
$assets  : AssetCollectionInterface
$contentView  : ContentViewInterface
$db  : CI_DB_query_builder
$httpContextReader  : HttpContextReaderInterface
$httpResponseProcessor  : HttpResponseProcessorInterface
$languageProvider  : LanguageProvider
$postDataArray  : array<string|int, mixed>
$queryParametersArray  : array<string|int, mixed>
$serverDataArray  : array<string|int, mixed>
$templatePath  : string
$languageTextManager  : LanguageTextManager
__construct()  : mixed
actionAssignRoles()  : RedirectHttpControllerResponse
Saves the assignment of the roles and redirects to the role assignment page.
actionDefault()  : AdminLayoutHttpControllerResponse
Default actions.
actionEditAdmin()  : AdminLayoutHttpControllerResponse
Renders the admin access to edit the admins.
actionManageAdmins()  : AdminLayoutHttpControllerResponse
Renders the admin access to manage the admins.
actionManagePermissions()  : AdminLayoutHttpControllerResponse
Renders the admin access to edit the roles.
actionManageRoles()  : AdminLayoutHttpControllerResponse
Renders the admin access to manage the admins.
actionSavePermissions()  : RedirectHttpControllerResponse
Saves the granted and revoked permissions and redirects to the permission management page.
init()  : mixed
Initialize Controller
proceed()  : mixed
Processes a http response object which is get by invoking an action method.
validateCurrentAdminStatus()  : mixed
Makes sure that the admin status is currently given in session
_appendGroupChildrenToGroupsArray()  : mixed
Appends group children to a given group array.
_callActionMethod()  : HttpControllerResponseInterface
Invokes an action method by the given action name.
_createContentNavigation()  : ContentNavigationCollection
Creates the content navigation object for the admin access pages.
_getAdminById()  : array<string|int, mixed>
Returns the db data for an admin by its given id.
_getAdminEditsListElementActions()  : array<string|int, mixed>
Returns the necessary information to provide the elements actions for the admin edit page.
_getAdminEditsListItems()  : array<string|int, mixed>
Returns the necessary information of the admin roles for the admin edit page.
_getAdminsOverviewsListElementActions()  : array<string|int, mixed>
Returns the necessary information to provide the elements actions for the admins overview listing.
_getAdminsOverviewsListItems()  : array<string|int, mixed>
Returns the necessary information of all admins to generate the overview listing.
_getAssets()  : AssetCollection
Returns the assets for the admin access pages.
_getGlobalPermissonsOverviewListItems()  : array<string|int, mixed>
Returns the necessary information of all global role permissions to generate the overview listing, such as API access and Gambio Admin Web UI access
_getPermissionOverviewsGroupCollection()  : AdminAccessGroupCollection
Returns the necessary group collection with the right sorting to generate the permission overview listing.
_getPermissionsOverviewsListItems()  : array<string|int, mixed>
Returns the necessary information of all role permissions to generate the overview listing.
_getPostData()  : string|null
Returns the expected $_POST value by the given key name.
_getPostDataCollection()  : KeyValueCollection
Creates and returns a key value collection which represent the global $_POST array.
_getQueryParameter()  : mixed|null
Returns the expected $_GET value by the given key name.
_getQueryParametersCollection()  : KeyValueCollection
Creates and returns a key value collection which represent the global $_GET array.
_getRoleById()  : array<string|int, mixed>
Returns the db data for an role by its given id.
_getRolesOverviewsListAction()  : array<string|int, mixed>
Returns the necessary information to provide the action for the roles overview listing.
_getRolesOverviewsListItems()  : array<string|int, mixed>
Returns the necessary information of all admin roles to generate the overview listing.
_getServerData()  : string|null
Returns the expected $_SERVER value by the given key name.
_grantAllPermissionsForRole()  : mixed
Grants all permission to a given role.
_render()  : string
Renders and returns a template file.
_returnHttpResponse()  : AdminLayoutHttpControllerResponse
Creates and returns an AdminLayoutHttpControllerResponse.
_updateAssignedRolesForAdmin()  : mixed
Saves the the given role assignments of an admin.
_updatePermissionsForRole()  : mixed
Updates the given permissions of an admin.
_updateUnknownPermissionsForRole()  : mixed
Updates the permission for unknown groups of a role by a given value.
_validatePageToken()  : mixed
Check if the $_POST['pageToken'] or $_GET['pageToken'] variable is provided and if it's valid.
getTemplateFile()  : ExistingFile
Searches the GXModules directory and admin/html directory for a template file, wich can be useed inside the AdminLayoutHttpControllerResponse object for the template parameter.
isValidJson()  : bool
isValidRequestMethod()  : bool
prepareJsonInput()  : array<string|int, mixed>

Properties

Methods

proceed()

Processes a http response object which is get by invoking an action method.

public proceed(HttpContextInterface $httpContext) : mixed

The action method is determined by the http context reader instance and the current request context. Re-implement this method in child classes to enable XSS and CSRF protection on demand.

Parameters
$httpContext : HttpContextInterface

Http context object which hold the request variables.

Tags
throws
LogicException

When no action method is found by the http context reader.

see
HttpContextReaderInterface::getActionName
see
HttpResponseProcessorInterface::proceed
Return values
mixed

_appendGroupChildrenToGroupsArray()

Appends group children to a given group array.

protected _appendGroupChildrenToGroupsArray(array<string|int, mixed> $children, array<string|int, mixed> &$groupsArray, int $parentId) : mixed
Parameters
$children : array<string|int, mixed>
$groupsArray : array<string|int, mixed>
$parentId : int
Return values
mixed

_getAdminById()

Returns the db data for an admin by its given id.

protected _getAdminById(int $adminId) : array<string|int, mixed>
Parameters
$adminId : int
Return values
array<string|int, mixed>

_getAdminEditsListElementActions()

Returns the necessary information to provide the elements actions for the admin edit page.

protected _getAdminEditsListElementActions() : array<string|int, mixed>
Return values
array<string|int, mixed>

_getAdminEditsListItems()

Returns the necessary information of the admin roles for the admin edit page.

protected _getAdminEditsListItems(mixed $adminId) : array<string|int, mixed>
Parameters
$adminId : mixed
Return values
array<string|int, mixed>

_getAdminsOverviewsListElementActions()

Returns the necessary information to provide the elements actions for the admins overview listing.

protected _getAdminsOverviewsListElementActions() : array<string|int, mixed>
Return values
array<string|int, mixed>

_getAdminsOverviewsListItems()

Returns the necessary information of all admins to generate the overview listing.

protected _getAdminsOverviewsListItems() : array<string|int, mixed>
Return values
array<string|int, mixed>

_getGlobalPermissonsOverviewListItems()

Returns the necessary information of all global role permissions to generate the overview listing, such as API access and Gambio Admin Web UI access

protected _getGlobalPermissonsOverviewListItems( $roleId) : array<string|int, mixed>
Parameters
$roleId :
Tags
throws
GroupNotFoundException
Return values
array<string|int, mixed>

_getPermissionsOverviewsListItems()

Returns the necessary information of all role permissions to generate the overview listing.

protected _getPermissionsOverviewsListItems(int $roleId) : array<string|int, mixed>
Parameters
$roleId : int
Tags
throws
GroupNotFoundException
Return values
array<string|int, mixed>

_getPostData()

Returns the expected $_POST value by the given key name.

protected _getPostData(string $keyName) : string|null

This method is the object oriented layer for $_POST[$keyName].

Parameters
$keyName : string

Expected key of post parameter.

Return values
string|null

Either the expected value or null, of not found.

_getQueryParameter()

Returns the expected $_GET value by the given key name.

protected _getQueryParameter(string $keyName) : mixed|null

This method is the object oriented layer for $_GET[$keyName].

Parameters
$keyName : string

Expected key of query parameter.

Return values
mixed|null

Either the expected value or null, of not found.

_getRoleById()

Returns the db data for an role by its given id.

protected _getRoleById(int $roleId) : array<string|int, mixed>
Parameters
$roleId : int
Return values
array<string|int, mixed>

_getRolesOverviewsListAction()

Returns the necessary information to provide the action for the roles overview listing.

protected _getRolesOverviewsListAction() : array<string|int, mixed>
Return values
array<string|int, mixed>

_getRolesOverviewsListItems()

Returns the necessary information of all admin roles to generate the overview listing.

protected _getRolesOverviewsListItems() : array<string|int, mixed>
Return values
array<string|int, mixed>

_getServerData()

Returns the expected $_SERVER value by the given key name.

protected _getServerData(string $keyName) : string|null

This method is the object oriented layer for $_SERVER[$keyName].

Parameters
$keyName : string

Expected key of server parameter.

Return values
string|null

Either the expected value or null, of not found.

_grantAllPermissionsForRole()

Grants all permission to a given role.

protected _grantAllPermissionsForRole( $type,  $roleId) : mixed
Parameters
$type :
$roleId :
Tags
throws
GroupNotFoundException
Return values
mixed

_render()

Renders and returns a template file.

protected _render(string $templateFile, array<string|int, mixed> $contentArray) : string
Parameters
$templateFile : string

Template file to render.

$contentArray : array<string|int, mixed>

Content array which represent the variables of the template.

Return values
string

Rendered template.

_returnHttpResponse()

Creates and returns an AdminLayoutHttpControllerResponse.

protected _returnHttpResponse([string $title = '' ][, string $template = 'overview.html' ][, array<string|int, mixed> $templateData = [] ][, string $currentSection = '' ]) : AdminLayoutHttpControllerResponse
Parameters
$title : string = ''
$template : string = 'overview.html'
$templateData : array<string|int, mixed> = []
$currentSection : string = ''
Return values
AdminLayoutHttpControllerResponse

_updateAssignedRolesForAdmin()

Saves the the given role assignments of an admin.

protected _updateAssignedRolesForAdmin( $adminId, array<string|int, mixed> $assignedRoles) : mixed
Parameters
$adminId :
$assignedRoles : array<string|int, mixed>
Return values
mixed

_updatePermissionsForRole()

Updates the given permissions of an admin.

protected _updatePermissionsForRole( $type,  $roleId, array<string|int, mixed> $grantedGroups) : mixed
Parameters
$type :
$roleId :
$grantedGroups : array<string|int, mixed>
Tags
throws
GroupNotFoundException
Return values
mixed

_updateUnknownPermissionsForRole()

Updates the permission for unknown groups of a role by a given value.

protected _updateUnknownPermissionsForRole( $type,  $roleId,  $value) : mixed
Parameters
$type :
$roleId :
$value :
Return values
mixed

_validatePageToken()

Check if the $_POST['pageToken'] or $_GET['pageToken'] variable is provided and if it's valid.

protected _validatePageToken([string $customExceptionMessage = null ]) : mixed

Example: public function proceed(HttpContextInterface $httpContext) { parent::proceed($httpContext); // proceed http context from parent class if($_SERVER['REQUEST_METHOD'] === 'POST') { $this->_validatePageToken(); // CSRF Protection } }

Parameters
$customExceptionMessage : string = null

(optional) You can specify a custom exception message.

Tags
throws
Exception

If the validation fails.

Return values
mixed

getTemplateFile()

Searches the GXModules directory and admin/html directory for a template file, wich can be useed inside the AdminLayoutHttpControllerResponse object for the template parameter.

protected getTemplateFile(string $templateFile) : ExistingFile
Parameters
$templateFile : string

The relative path and filename to search for

Tags
throws
Exception

if the path or file is not found

Return values
ExistingFile

containing absolute file path to the given template file

isValidRequestMethod()

protected isValidRequestMethod(string $method) : bool
Parameters
$method : string
Return values
bool

prepareJsonInput()

protected prepareJsonInput(string $json) : array<string|int, mixed>
Parameters
$json : string
Return values
array<string|int, mixed>

Search results