Documentation

AccessManager extends AccessLib

User Management Backend

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

CLOUDREXX Development Team info@cloudrexx.com

subpackage

coremodule_access

version
1.0.0

Table of Contents

Constants

MANAGE_GROUPS_ACCESS_ID  : mixed = 203
Static Access id to manage the user groups
MANAGE_USER_ACCESS_ID  : mixed = 202
Static Access id to manage the users(add/edit)

Properties

$_objTpl  : Sigma
$accountAttributeNamePrefix  : mixed
$cx  : Cx
$defaultProfileThumbnailScaleColor  : mixed
$modulePrefix  : mixed
$objUserFW  : object
User FRAMEWORK Object
$_pageTitle  : string
Page title of the current section
$act  : mixed
$arrStatusMsg  : array<string|int, mixed>
Contains the info messages about done operations

Methods

__construct()  : mixed
Constructor
_config()  : mixed
_configAttributes()  : mixed
_configCommunity()  : mixed
_configDeleteAttribute()  : mixed
_configDeleteMail()  : mixed
_configGeneral()  : mixed
_configMails()  : mixed
_configModifyAttribute()  : mixed
_configModifyMails()  : mixed
_createGroup()  : unknown
Create Group Page
_deleteGroup()  : mixed
_deleteUser()  : mixed
_group()  : mixed
Group Management Page
_groupList()  : mixed
Group Overview Page
_modifyGroup()  : unknown
Modify Group Page
_parsePermissionAreas()  : mixed
checkManageGroupAccessPermission()  : bool
Additional permission check for users with access permission MANAGE_GROUPS_ACCESS_ID.
getImageUploader()  : Uploader
Initialize the access image uploader and get the uploader instance
getPage()  : mixed
Get page
getPasswordInfo()  : string
Returns the password information string
import_csv()  : mixed
Import Users from a CSV file
parseAccountAttributes()  : mixed
parseAttribute()  : mixed
This method has two purposes (see param $return): 1. Parse the \Cx\Core\Html\Sigma template block of a specific profile attribute 2. Generate the HTML code of a specific profile attribute and return it
removeUselessImages()  : mixed
setAccountAttributeNamePrefix()  : mixed
When using this library from within a different place (not access module), use this method to specify the template block prefix to be used when parsing a user's account attributes (username, email, password, etc.).
setAttributeNamePrefix()  : mixed
When using this library from within a different place (not access module), use this method to specify the template block prefix to be used when parsing a user's profile attribute.
setModulePrefix()  : mixed
When using this library from within a different place (not access module), use this method to specify the template placeholder prefix to be used when parsing a user's profile attribute.
show_import()  : mixed
Sets up the User import page
addUploadedImagesToProfile()  : bool
Move the uploaded images into place and link to the user
attachJavaScriptFunction()  : mixed
buildAreaTree()  : array<string|int, mixed>
Collect an access area and its complete subtree
checkUserModifyPermission()  : bool
Check user add/edit permission
detachAllJavaScriptFunctions()  : mixed
escapeCsvValue()  : string
Escape a value that it could be inserted into a csv file.
exportUsers()  : mixed
Export users of a group as CSV
fetchSearchArgumentFromRequest()  : array<string|int, mixed>
getCustomExpirationDate()  : int
Returns the custom expiration date chosen in the validity menu as a UNIX timestamp at end of day (23:59:59), or 0 if none was set. End of day matches validity-period expirations (see User::setValidityTimePeriod()).
getGroupListOfUser()  : array<string|int, mixed>
Get a list of user groups a user is a member of
getIntegerAttributeCode()  : string|int
Generates the code for an integer attribute.
getJavaScriptCode()  : mixed
isSettingUserStatusAllowed()  : bool
Determines whether the currently signed-in user is allowed to change the active status of the specified user.
parseAccountAttribute()  : mixed
parseLetterIndexList()  : mixed
parseModuleSpecificExtensions()  : void
parseNewsletterLists()  : void
Parse a user's newsletter-list subscription interface
_configAttributeCode()  : mixed
Show the HTML code of an attribute.
changeGroupStatus()  : mixed
changeUserStatus()  : mixed
getGroupMenu()  : mixed
getGroupTypeMenu()  : mixed
getMailFormatMenu()  : mixed
getMailLanguageMenu()  : mixed
getUserAccountMenu()  : mixed
getUserRoleMenu()  : mixed
getUserStatusMenu()  : mixed
getUserValidityMenu()  : mixed
modifyUser()  : mixed
notifyUserAboutAccountStatusChange()  : mixed
overview()  : mixed
parseContentTree()  : mixed
parseDigitalAssetManagementExtension()  : mixed
processDigitalAssetManagementExtension()  : mixed
processModuleSpecificExtensions()  : mixed
setNavigation()  : mixed
user()  : mixed
User Management Page
userList()  : mixed
validateHexRGBColor()  : mixed

Constants

MANAGE_GROUPS_ACCESS_ID

Static Access id to manage the user groups

public mixed MANAGE_GROUPS_ACCESS_ID = 203

MANAGE_USER_ACCESS_ID

Static Access id to manage the users(add/edit)

public mixed MANAGE_USER_ACCESS_ID = 202

Properties

$accountAttributeNamePrefix

protected mixed $accountAttributeNamePrefix = 'access_user_'

$defaultProfileThumbnailScaleColor

protected mixed $defaultProfileThumbnailScaleColor = '#FFFFFF'

$objUserFW

User FRAMEWORK Object

protected object $objUserFW
Tags
access

private

$_pageTitle

Page title of the current section

private string $_pageTitle = ''
Tags
access

private

$arrStatusMsg

Contains the info messages about done operations

private static array<string|int, mixed> $arrStatusMsg = array('ok' => array(), 'error' => array())
Tags
access

private

Methods

__construct()

Constructor

public __construct() : mixed
Tags
global

\Cx\Core\Html\Sigma

array

_configModifyMails()

public _configModifyMails([mixed $copy = false ]) : mixed
Parameters
$copy : mixed = false

_createGroup()

Create Group Page

public _createGroup() : unknown

This section is used to create a new group.

Return values
unknown

_group()

Group Management Page

public _group() : mixed

This is the main group management section

_groupList()

Group Overview Page

public _groupList() : mixed

This section lists all registered groups.

_modifyGroup()

Modify Group Page

public _modifyGroup() : unknown

This page shows the dialog to modify a group.

Return values
unknown

_parsePermissionAreas()

public _parsePermissionAreas(mixed $arrAreas, mixed $areaId, mixed $scope[, mixed $depth = 0 ]) : mixed
Parameters
$arrAreas : mixed
$areaId : mixed
$scope : mixed
$depth : mixed = 0

checkManageGroupAccessPermission()

Additional permission check for users with access permission MANAGE_GROUPS_ACCESS_ID.

public checkManageGroupAccessPermission(int $groupId) : bool

Exists to avoid that the user removes his permission to manage access groups

Will return false when the group which is edited/deactivated/deleted is the only group which grants the user the permission to edit groups

Will return true otherwise (or if the user has administrator privileges)

Parameters
$groupId : int

The id of the group which is edited

Return values
bool

getPasswordInfo()

Returns the password information string

public static getPasswordInfo() : string

The string returned depends on the password complexity setting

Tags
author

Reto Kohli reto.kohli@comvation.com

Return values
string

The password complexity information

import_csv()

Import Users from a CSV file

public static import_csv(string $file_name) : mixed

Sets up common User and Profile fields as well as Newsletter list relations. Fields and their mapping: Anrede -> Titel Vorname Name eMail Firma Strasse -> Zusammen mit Hausnummer in Adresse Hausnummer -> Zusammen mit Strasse in Adresse PLZ Ort Land Bundesland -> Evtl in Ort? Tel.-Vorwahl -> Zusammen mit Tel.-Nummer in phone_office Tel.-Nummer -> Zusammen mit Tel.-Vorwahl in phone_office Fax-Vorwahl -> Zusammen mit Fax.-Nummer in phone_fax Fax-Nummer -> Zusammen mit Fax.-Vorwahl in phone_fax Mobil-Vorwahl -> Zusammen mit Mobil-Nummer in phone_mobile Mobil-Nummer -> Zusammen mit Mobil-Vorwahl in phone_mobile P1 -> Interessen: Newsletter Listen, kommagetrennt -> Nicht vorhandene Listen werden angelegt P2 -> Antwort: ? P3 -> ? P4 -> Titel: ? P5 -> ? Ursprungsformular -> ? Permission -> ? Ausgetragen -> Wenn true, alle Listenzuordnungen entfernen, sonst fehlende anlegen Anzahl Hard-Bounces -> Nicht vorhanden? Status -> Bedeutung? Sprache -> Wird die verwendet? ID -> Bedeutung? Eintragungsdatum -> regdate Aenderungsdatum -> ? (Nur regdate) Austragungsdatum -> ? (Nur regdate)

Parameters
$file_name : string

The CSV file name

parseAccountAttributes()

public parseAccountAttributes(mixed $objUser[, mixed $edit = false ]) : mixed
Parameters
$objUser : mixed
$edit : mixed = false

parseAttribute()

This method has two purposes (see param $return): 1. Parse the \Cx\Core\Html\Sigma template block of a specific profile attribute 2. Generate the HTML code of a specific profile attribute and return it

public parseAttribute(mixed $objUser, mixed $attributeId[, mixed $historyId = 0 ][, mixed $edit = false ][, mixed $return = false ][, mixed $isChild = false ][, mixed $inFrame = false ][, mixed $useMagicBlock = true ][, mixed $arrAdditionalPlaceholders = null ]) : mixed
Parameters
$objUser : mixed
$attributeId : mixed
$historyId : mixed = 0
$edit : mixed = false
$return : mixed = false
$isChild : mixed = false
$inFrame : mixed = false
$useMagicBlock : mixed = true
$arrAdditionalPlaceholders : mixed = null

setAccountAttributeNamePrefix()

When using this library from within a different place (not access module), use this method to specify the template block prefix to be used when parsing a user's account attributes (username, email, password, etc.).

public setAccountAttributeNamePrefix(mixed $prefix) : mixed

For instance when setting the prefix to 'shop_customer_attribute', then the method will try to parse the \Cx\Core\Html\Sigma template block shop_customer_attribute_email in the case of the account attribute email. Defaults to 'access_user'

Parameters
$prefix : mixed
Tags
see
AccessLib::parseAccountAttribute()

setAttributeNamePrefix()

When using this library from within a different place (not access module), use this method to specify the template block prefix to be used when parsing a user's profile attribute.

public setAttributeNamePrefix(mixed $prefix) : mixed

For instance when setting the prefix to 'shop_customer_profile_attribute', then the method will try to parse the \Cx\Core\Html\Sigma template block shop_customer_profile_attribute_firstname in the case of the profile attribute firstname. Defaults to 'access_profile_attribute'

Parameters
$prefix : mixed
Tags
see
AccessLib::parseAttribute()

setModulePrefix()

When using this library from within a different place (not access module), use this method to specify the template placeholder prefix to be used when parsing a user's profile attribute.

public setModulePrefix(mixed $prefix) : mixed

For instance when setting the prefix to 'SHOP_', then the method will parse the \Cx\Core\Html\Sigma variable SHOP_PROFILE_ATTRIBUTE_FIRSTNAME in the case of the profile attribute firstname. Defaults to 'ACCESS_'

Parameters
$prefix : mixed
Tags
see
AccessLib::parseAttribute()

addUploadedImagesToProfile()

Move the uploaded images into place and link to the user

protected addUploadedImagesToProfile(User $objUser, array<string|int, mixed> &$arrProfile, array<string|int, mixed> $arrImages, string $uploaderId) : bool
Parameters
$objUser : User

\User object

$arrProfile : array<string|int, mixed>

Array profile data

$arrImages : array<string|int, mixed>

Uploaded images array

$uploaderId : string

Uploader id

Return values
bool

TRUE on success false otherwise

attachJavaScriptFunction()

protected attachJavaScriptFunction(mixed $function) : mixed
Parameters
$function : mixed

buildAreaTree()

Collect an access area and its complete subtree

protected buildAreaTree(array<string|int, mixed> $arrAreas, int $areaId, int $depth, string $scope) : array<string|int, mixed>

Walks the area tree by parent_area_id and returns an ordered list of array($areaId, $depth) tuples for the given area and all of its descendants, regardless of nesting depth. An area is only included if it is in the given scope or if at least one of its descendants is; this keeps out-of-scope ancestors visible as labels above their in-scope children while dropping branches (and groups) that are entirely out of scope. Siblings are returned in the order they appear in $arrAreas (order_id).

Parameters
$arrAreas : array<string|int, mixed>

All loaded areas, keyed by area_id

$areaId : int

The area to start from

$depth : int

Nesting depth of $areaId (0 = group/tab root)

$scope : string

User group type to match the area scope against

Return values
array<string|int, mixed>

Ordered list of array($areaId, $depth)

checkUserModifyPermission()

Check user add/edit permission

protected checkUserModifyPermission(User $objUser) : bool
Parameters
$objUser : User

user object

Return values
bool

detachAllJavaScriptFunctions()

protected detachAllJavaScriptFunctions() : mixed

escapeCsvValue()

Escape a value that it could be inserted into a csv file.

protected escapeCsvValue(string $value) : string
Parameters
$value : string
Return values
string

exportUsers()

Export users of a group as CSV

protected exportUsers([int $groupId = 0 ][, int $langId = null ]) : mixed
Parameters
$groupId : int = 0

Id of a user group to filter the export by

$langId : int = null

Id of frontend locale to filter the export by

Tags
throws
InstanceException

At the end of the CSV export to properly end the script execution.

fetchSearchArgumentFromRequest()

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

List of strings that have been submitted through the GET or POST argument 'search'.

getCustomExpirationDate()

Returns the custom expiration date chosen in the validity menu as a UNIX timestamp at end of day (23:59:59), or 0 if none was set. End of day matches validity-period expirations (see User::setValidityTimePeriod()).

protected getCustomExpirationDate() : int
Return values
int

Expiration timestamp at 23:59:59, or 0

getGroupListOfUser()

Get a list of user groups a user is a member of

protected getGroupListOfUser(User $objUser) : array<string|int, mixed>

Returns an array of all user groups the supplied user (identified by $objUser) is a member of. In frontend mode, this method does only return frontend user groups. Whereas in every other mode, it does return all associated user groups.

Parameters
$objUser : User

The user of whom the associated groups shall be returned.

Return values
array<string|int, mixed>

An array containing the names of the associated groups.

getIntegerAttributeCode()

Generates the code for an integer attribute.

protected getIntegerAttributeCode(string $name, mixed $value, bool $edit) : string|int

Converts the value to an integer and returns either the processed template for editing or the raw integer value based on the edit mode.

Parameters
$name : string

The internal attribute name.

$value : mixed

The value to be processed.

$edit : bool

Whether to return the edit template (true) or the raw value (false).

Return values
string|int

The rendered template string or the integer value.

isSettingUserStatusAllowed()

Determines whether the currently signed-in user is allowed to change the active status of the specified user.

protected isSettingUserStatusAllowed(User $user) : bool

Rules:

  • A user cannot change their own status.
  • The signed-in user must have permission to modify the target user.
  • Non-admin users can always be modified.
  • Admin users can only be modified by another admin.
Parameters
$user : User

The user whose status is being modified.

Return values
bool

True if the signed-in user is allowed to change the status; false otherwise.

parseAccountAttribute()

protected parseAccountAttribute(mixed $objUser, mixed $attributeId[, mixed $edit = false ][, mixed $value = null ]) : mixed
Parameters
$objUser : mixed
$attributeId : mixed
$edit : mixed = false
$value : mixed = null

parseLetterIndexList()

protected parseLetterIndexList(mixed $URI, mixed $paramName, mixed $selectedLetter) : mixed
Parameters
$URI : mixed
$paramName : mixed
$selectedLetter : mixed

parseNewsletterLists()

Parse a user's newsletter-list subscription interface

protected parseNewsletterLists(mixed $objUser) : void
Parameters
$objUser : mixed

_configAttributeCode()

Show the HTML code of an attribute.

private _configAttributeCode() : mixed
Tags
todo:

This method is not yet usable. Extend to method $this->getUnparsedAtrributeCode() so that it returns the unparsed HTML code.

getGroupMenu()

private getGroupMenu(mixed $selectedGroupId, mixed $attrs[, mixed $showAllOption = true ]) : mixed
Parameters
$selectedGroupId : mixed
$attrs : mixed
$showAllOption : mixed = true

getGroupTypeMenu()

private getGroupTypeMenu(mixed $selectedType, mixed $attrs) : mixed
Parameters
$selectedType : mixed
$attrs : mixed

getMailFormatMenu()

private getMailFormatMenu(mixed $selectedFormat, mixed $attrs) : mixed
Parameters
$selectedFormat : mixed
$attrs : mixed

getMailLanguageMenu()

private getMailLanguageMenu(mixed $type, mixed $lang, mixed $attrs) : mixed
Parameters
$type : mixed
$lang : mixed
$attrs : mixed

getUserAccountMenu()

private getUserAccountMenu(mixed $selectedAccountType, mixed $attrs) : mixed
Parameters
$selectedAccountType : mixed
$attrs : mixed

getUserRoleMenu()

private getUserRoleMenu(mixed $selectedRole, mixed $attrs) : mixed
Parameters
$selectedRole : mixed
$attrs : mixed

getUserStatusMenu()

private getUserStatusMenu(mixed $selectedStatus, mixed $attrs) : mixed
Parameters
$selectedStatus : mixed
$attrs : mixed

getUserValidityMenu()

private getUserValidityMenu(mixed $validity, mixed $expirationDate) : mixed
Parameters
$validity : mixed
$expirationDate : mixed

notifyUserAboutAccountStatusChange()

private notifyUserAboutAccountStatusChange(mixed $objUser) : mixed
Parameters
$objUser : mixed

parseContentTree()

private parseContentTree(mixed $nodeTree, mixed $userGroupType, mixed $arrDynamicPermissionIdsOfGroup[, mixed $cssRowClassNr = 1 ][, mixed $level = 0 ]) : mixed
Parameters
$nodeTree : mixed
$userGroupType : mixed
$arrDynamicPermissionIdsOfGroup : mixed
$cssRowClassNr : mixed = 1
$level : mixed = 0

parseDigitalAssetManagementExtension()

private parseDigitalAssetManagementExtension(mixed &$rowNr) : mixed
Parameters
$rowNr : mixed

processDigitalAssetManagementExtension()

private processDigitalAssetManagementExtension(mixed $objUser) : mixed
Parameters
$objUser : mixed

processModuleSpecificExtensions()

private processModuleSpecificExtensions(mixed $objUser) : mixed
Parameters
$objUser : mixed

user()

User Management Page

private user() : mixed

This is the main user management section

validateHexRGBColor()

private validateHexRGBColor(mixed $color) : mixed
Parameters
$color : mixed
On this page

Search results