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  = 203
Static Access id to manage the user groups
MANAGE_USER_ACCESS_ID  = 202
Static Access id to manage the users(add/edit)

Properties

$_objTpl  : Sigma
$accountAttributeNamePrefix  : mixed
$defaultProfileThumbnailScaleColor  : mixed
$modulePrefix  : mixed
$objUserFW  : object
User FRAMEWORK Object
$_mandatorySign  : string
Sign to mark mandatory fields as required
$_pageTitle  : string
Page title of the current section
$act  : mixed
$arrAccountAttributes  : mixed
$arrAttachedJSFunctions  : array<string|int, mixed>
$arrAttributeTypeTemplates  : mixed
$arrStatusMsg  : array<string|int, mixed>
Contains the info messages about done operations
$attributeNamePrefix  : mixed

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
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>
getGroupListOfUser()  : array<string|int, mixed>
Get a list of user groups a user is a member of
getJavaScriptCode()  : mixed
parseAccountAttribute()  : mixed
parseLetterIndexList()  : mixed
parseNewsletterLists()  : mixed
Parse a user's newsletter-list subscription interface
_configAttributeCode()  : mixed
Show the HTML code of an attribute.
_getAtrributeCode()  : mixed
changeGroupStatus()  : mixed
changeUserStatus()  : mixed
createThumbnailOfImage()  : mixed
getCheckboxAttributeCode()  : string
Return the html code for a checkbox attribute
getDateAttributeCode()  : string
Return the html code for a date attribute
getDateDayMenu()  : mixed
getDateMonthMenu()  : mixed
getDateYearMenu()  : mixed
getEmailAttributeCode()  : string
Return the html code for an email attribute
getGroupMenu()  : mixed
getGroupTypeMenu()  : mixed
getImageAttributeCode()  : string
Return the html code for an image attribute
getMailFormatMenu()  : mixed
getMailLanguageMenu()  : mixed
getMenuAttributeCode()  : string
Return the html code of a menu attribute
getMenuOptionAttributeCode()  : string
Return the html code of a dropdown menu option
getPasswordAttributeCode()  : string
Return the html code for a password attribute
getTextareaAttributeCode()  : string
Return the html code for a textarea attribtue
getTextAttributeCode()  : string
Return the html code for a text attribute
getURIAttributeCode()  : string
Return the html code for an URI attribute
getUserAccountMenu()  : mixed
getUserRoleMenu()  : mixed
getUserStatusMenu()  : mixed
getUserValidityMenu()  : mixed
isImageWithinAllowedSize()  : mixed
loadAccountAttributes()  : mixed
loadAttributeTypeTemplates()  : mixed
Load the html code template of the different attribute types
loadLanguageAccountAttribute()  : mixed
modifyUser()  : mixed
moveUploadedImageInToPlace()  : bool|string
Copy the uploaded images from temp folder to images folder
notifyUserAboutAccountStatusChange()  : mixed
overview()  : mixed
parseAttributePlaceholders()  : mixed
parseContentTree()  : mixed
parseDigitalAssetManagementExtension()  : mixed
parseModuleSpecificExtensions()  : 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

$_mandatorySign

Sign to mark mandatory fields as required

private string $_mandatorySign = '<strong style="padding: 0px 2px 0px 2px;color:#f00;">*</strong>'

$_pageTitle

Page title of the current section

private string $_pageTitle = ''
Tags
access

private

$arrAttachedJSFunctions

private array<string|int, mixed> $arrAttachedJSFunctions = array()
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

$attributeNamePrefix

private mixed $attributeNamePrefix = 'access_profile_attribute'
Tags
access

private

Methods

__construct()

Constructor

public __construct() : mixed
Tags
global

\Cx\Core\Html\Sigma

global

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
Parameters
$arrAreas : mixed
$areaId : mixed
$scope : mixed

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

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'.

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.

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) : mixed
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.

_getAtrributeCode()

private _getAtrributeCode(mixed $objUser, mixed $attributeId, mixed $historyId[, mixed $edit = false ]) : mixed
Parameters
$objUser : mixed
$attributeId : mixed
$historyId : mixed
$edit : mixed = false

createThumbnailOfImage()

private createThumbnailOfImage(mixed $imageName[, mixed $profilePic = false ]) : mixed
Parameters
$imageName : mixed
$profilePic : mixed = false

getCheckboxAttributeCode()

Return the html code for a checkbox attribute

private getCheckboxAttributeCode(string $name, string $value, bool $edit) : string
Parameters
$name : string
$value : string
$edit : bool
Return values
string

getDateAttributeCode()

Return the html code for a date attribute

private getDateAttributeCode(string $name, string $value, bool $edit) : string
Parameters
$name : string
$value : string
$edit : bool
Return values
string

getDateDayMenu()

private getDateDayMenu(mixed $attributeName, mixed $selectedOption) : mixed
Parameters
$attributeName : mixed
$selectedOption : mixed

getDateMonthMenu()

private getDateMonthMenu(mixed $attributeName, mixed $selectedOption) : mixed
Parameters
$attributeName : mixed
$selectedOption : mixed

getDateYearMenu()

private getDateYearMenu(mixed $attributeName, mixed $selectedOption) : mixed
Parameters
$attributeName : mixed
$selectedOption : mixed

getEmailAttributeCode()

Return the html code for an email attribute

private getEmailAttributeCode(string $name, string $value, bool $edit) : string
Parameters
$name : string
$value : string
$edit : bool
Return values
string

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

getImageAttributeCode()

Return the html code for an image attribute

private getImageAttributeCode(mixed $objUser, string $name, string $value, string $attributeId, string $attributeHtmlId, int $historyId, bool $edit[, mixed $thumbnail = false ]) : string
Parameters
$objUser : mixed
$name : string
$value : string
$attributeId : string
$attributeHtmlId : string
$historyId : int
$edit : bool
$thumbnail : mixed = false
Return values
string

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

getMenuAttributeCode()

Return the html code of a menu attribute

private getMenuAttributeCode(string $name, string $value, bool $edit[, mixed $style = null ]) : string
Parameters
$name : string
$value : string
$edit : bool
$style : mixed = null
Return values
string

getMenuOptionAttributeCode()

Return the html code of a dropdown menu option

private getMenuOptionAttributeCode(string $value, string $selected, string $valueText[, mixed $style = null ]) : string
Parameters
$value : string
$selected : string
$valueText : string
$style : mixed = null
Return values
string

getPasswordAttributeCode()

Return the html code for a password attribute

private getPasswordAttributeCode(string $name) : string
Parameters
$name : string
Return values
string

getTextareaAttributeCode()

Return the html code for a textarea attribtue

private getTextareaAttributeCode(string $name, string $value, bool $edit) : string
Parameters
$name : string
$value : string
$edit : bool
Return values
string

getTextAttributeCode()

Return the html code for a text attribute

private getTextAttributeCode(string $name, string $value, bool $edit) : string
Parameters
$name : string
$value : string
$edit : bool
Return values
string

getURIAttributeCode()

Return the html code for an URI attribute

private getURIAttributeCode(string $name, string $uri, bool $edit) : string
Parameters
$name : string
$uri : string
$edit : bool
Return values
string

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

isImageWithinAllowedSize()

private isImageWithinAllowedSize(mixed $size, mixed $profilePic) : mixed
Parameters
$size : mixed
$profilePic : mixed

loadAttributeTypeTemplates()

Load the html code template of the different attribute types

private loadAttributeTypeTemplates() : mixed
Tags
global

array

loadLanguageAccountAttribute()

private loadLanguageAccountAttribute() : mixed

moveUploadedImageInToPlace()

Copy the uploaded images from temp folder to images folder

private moveUploadedImageInToPlace(User $objUser, string $tmpImagePath, string $name[, bool $profilePic = false ]) : bool|string
Parameters
$objUser : User

User object

$tmpImagePath : string

Temporary Image path

$name : string

Image file name

$profilePic : bool = false

True when processing profile picture

Tags
staticvar

\ImageManager $objImage Image object

staticvar

type $arrSettings User settings

Return values
bool|string

False when copying file or file name on success

notifyUserAboutAccountStatusChange()

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

parseAttributePlaceholders()

private parseAttributePlaceholders(mixed $arrPlaceholders[, mixed $defined = false ][, mixed $attributeIdUC = 0 ][, mixed $frameIdUC = 0 ][, mixed $childIdUC = 0 ][, mixed $frame = false ][, mixed $child = false ]) : mixed
Parameters
$arrPlaceholders : mixed
$defined : mixed = false
$attributeIdUC : mixed = 0
$frameIdUC : mixed = 0
$childIdUC : mixed = 0
$frame : mixed = false
$child : mixed = false

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