lamDHCPList
extends lamList
in package
Generates the list view.
Tags
Table of Contents
- ACCOUNT_STATUS_OPTION_NAME = "LU_AS"
- ID for config option to show account status
- ATTR_ACCOUNT_STATUS = 'lam_virtual_account_status'
- virtual attribute name for account status column
- FILTER_EXPIRED = 1
- filter value for expired accounts
- FILTER_LOCKED = 2
- filter value for locked accounts
- FILTER_SEMILOCKED = 3
- filter value for partially locked accounts
- FILTER_UNLOCKED = 4
- filter value for unlocked accounts
- LIST_SIZE_OPTION_NAME = "L_SIZE"
- ID for list size config option
- VIRTUAL_ATTRIBUTE_PREFIX = 'lam_virtual_'
- prefix for virtual (non-LDAP) attributes
- $attrArray : array<string|int, mixed>
- $descArray : array<string|int, mixed>
- $entries : array<string|int, mixed>
- $filters : array<string|int, mixed>
- $labels : array<string|int, mixed>
- $ldapEntries : array<string|int, mixed>
- $maxPageEntries : int
- maximum count of entries per page
- $page : int
- current page number
- $possibleSuffixes : array<string|int, mixed>
- $refresh : bool
- refresh page switch
- $serverSideFilterAttributes : array<string|int, mixed>
- List of attributes to filter on server side.
- $serverSideFilterChanged : bool
- defines if the server side filter changed
- $showAccountStatus : bool
- Controls if the account status is shown
- $sortColumn : string|null
- sort column name
- $sortDirection : int
- sort direction: 1 for ascending, -1 for descending
- $sortMapping : array<string|int, mixed>
- $suffix : string|null
- LDAP suffix
- $type : ConfiguredType
- Account type
- $configOptions : array<string|int, mixed>
- $supportsPasswordQuickChange : bool
- __construct() : mixed
- Constructor
- showPage() : void
- Prints the HTML code to display the list view.
- addExtraInputElementsToTopArea() : void
- Can be used by subclasses to add e.g. additional buttons to the top area.
- applyLocalFilters() : void
- Applies any local filters for attributes that cannot be filtered server side.
- buildLDAPAttributeFilter() : string
- Builds the LDAP filter based on the filter entries in the GUI.
- canBeFiltered() : bool
- Returns if the given attribute can be filtered.
- forceRefresh() : void
- Forces a refresh of the LDAP data.
- getAccountStatusFilterArea() : htmlElement
- Returns the filter for account status.
- getAdditionalLDAPAttributesToRead() : array<string|int, string>
- Returns a list of additional LDAP attributes that should be read.
- getAdditionalTools() : array<string|int, lamListTool>
- Returns a list of lamListTool objects to display next to the edit/delete buttons.
- getFilterArea() : htmlElement
- Prints the content of a single attribute filter area.
- getFilterAsTextForURL() : string
- Returns the filter as text to be used as URL parameter.
- getTableCellContent() : htmlElement|null
- Returns the content of a cell in the account list for a given LDAP entry and attribute.
- isAttributeFilteredByServer() : bool
- Specifies if the given attribute name is used for server side filtering (LDAP filter string).
- isFilterMatching() : bool
- Checks if the given LDAP data matches the filter.
- listBuildFilter() : void
- Builds the regular expressions from the filter values.
- listConfigurationChanged() : void
- Called when the configuration options changed.
- listCreateSortMapping() : void
- Determines the sort mapping and stores it in $this->sortMapping.
- listDoPost() : htmlElement|null
- Manages all POST actions (e.g. button pressed) for the account lists.
- listDrawNavigationBar() : void
- Draws a navigation bar to switch between pages
- listGetAllConfigOptions() : array<string|int, lamListOption>
- Returns a list of possible configuration options.
- listGetAttributeDescriptionList() : array<string, string>
- Returns an hash array containing with all attributes to be shown and their descriptions.
- listGetConfigOptionByID() : lamListOption|null
- Returns the configuration option with the given ID.
- listGetParams() : void
- Sets some internal parameters.
- listPrintButtons() : void
- Prints the create and delete buttons.
- listPrintConfigurationPage() : void
- Prints the list configuration page.
- listPrintRedirectMessages() : void
- Prints messages when another page (e.g. delete/upload) redirects to the list view.
- listRefreshData() : void
- Rereads the entries from LDAP.
- listShowOUSelection() : htmlGroup
- Prints a combobox with possible sub-DNs.
- printFooterContent() : void
- Prints any extra HTML for the footer part.
- printHeaderContent() : void
- Prints any extra HTML for the header part.
- addDataElements() : void
- Adds the LDAP data elements to the given array.
- addToolLinks() : void
- Adds the tool image links (e.g. edit and delete) for each account.
- getAccountStatus() : htmlElement
- Returns the account status.
- getFilterElements() : array<string|int, htmlElement>
- Returns the elements to show in filter row.
- getSortingElements() : array<string|int, htmlElement>
- Returns the elements to show in sorting row.
- injectAccountStatusAttribute() : void
- Injects values for the virtual account status attribute to make it sortable.
- isSupportingAccountStatus() : bool
- Returns if this account supports the account status column.
- isSupportingPasswordQuickChange() : bool
- Returns if this account supports the password quick change page.
- listReadOptionsFromCookie() : void
- Reads the list options from the cookie value.
- printAccountTable() : void
- Prints the entry list
- printFooter() : void
- Prints the footer area of the page.
- printHeader() : void
- Prints the header part of the page.
- showPDFPage() : void
- Shows the page where the user may select the PDF options.
Constants
ACCOUNT_STATUS_OPTION_NAME
ID for config option to show account status
private
mixed
ACCOUNT_STATUS_OPTION_NAME
= "LU_AS"
ATTR_ACCOUNT_STATUS
virtual attribute name for account status column
private
mixed
ATTR_ACCOUNT_STATUS
= 'lam_virtual_account_status'
FILTER_EXPIRED
filter value for expired accounts
private
mixed
FILTER_EXPIRED
= 1
FILTER_LOCKED
filter value for locked accounts
private
mixed
FILTER_LOCKED
= 2
FILTER_SEMILOCKED
filter value for partially locked accounts
private
mixed
FILTER_SEMILOCKED
= 3
FILTER_UNLOCKED
filter value for unlocked accounts
private
mixed
FILTER_UNLOCKED
= 4
LIST_SIZE_OPTION_NAME
ID for list size config option
private
mixed
LIST_SIZE_OPTION_NAME
= "L_SIZE"
VIRTUAL_ATTRIBUTE_PREFIX
prefix for virtual (non-LDAP) attributes
private
mixed
VIRTUAL_ATTRIBUTE_PREFIX
= 'lam_virtual_'
Properties
$attrArray
protected
array<string|int, mixed>
$attrArray
= []
list of LDAP attributes
$descArray
protected
array<string|int, mixed>
$descArray
= []
list of attribute descriptions
$entries
protected
array<string|int, mixed>
$entries
= []
entries to show
$filters
protected
array<string|int, mixed>
$filters
= []
list of filters (attribute name => filter input)
$labels
protected
array<string|int, mixed>
$labels
list of account specific labels
$ldapEntries
protected
array<string|int, mixed>
$ldapEntries
= []
entries from LDAP
$maxPageEntries
maximum count of entries per page
protected
int
$maxPageEntries
= 30
$page
current page number
protected
int
$page
= 1
$possibleSuffixes
protected
array<string|int, mixed>
$possibleSuffixes
= []
list of possible LDAP suffixes(organizational units)
$refresh
refresh page switch
protected
bool
$refresh
= \true
$serverSideFilterAttributes
List of attributes to filter on server side.
protected
array<string|int, mixed>
$serverSideFilterAttributes
= ['cn', 'commonname', 'uid', 'description', 'sn', 'surname', 'gn', 'givenname', 'company', 'mail']
$serverSideFilterChanged
defines if the server side filter changed
protected
bool
$serverSideFilterChanged
= \false
$showAccountStatus
Controls if the account status is shown
protected
bool
$showAccountStatus
= \false
$sortColumn
sort column name
protected
string|null
$sortColumn
= \null
$sortDirection
sort direction: 1 for ascending, -1 for descending
protected
int
$sortDirection
= 1
$sortMapping
protected
array<string|int, mixed>
$sortMapping
= []
sort mapping for entries array(original index => sorted index)
$suffix
LDAP suffix
protected
string|null
$suffix
= \null
$type
Account type
protected
ConfiguredType
$type
$configOptions
private
array<string|int, mixed>
$configOptions
configuration options
$supportsPasswordQuickChange
private
bool
$supportsPasswordQuickChange
supports the quick change
Methods
__construct()
Constructor
public
__construct(ConfiguredType $type) : mixed
Parameters
- $type : ConfiguredType
-
account type
Return values
mixed —showPage()
Prints the HTML code to display the list view.
public
showPage() : void
Return values
void —addExtraInputElementsToTopArea()
Can be used by subclasses to add e.g. additional buttons to the top area.
protected
addExtraInputElementsToTopArea(mixed &$left, mixed &$right) : void
Parameters
- $left : mixed
-
left part
- $right : mixed
-
right part
Return values
void —applyLocalFilters()
Applies any local filters for attributes that cannot be filtered server side.
protected
applyLocalFilters() : void
Return values
void —buildLDAPAttributeFilter()
Builds the LDAP filter based on the filter entries in the GUI.
protected
buildLDAPAttributeFilter() : string
Return values
string —LDAP filter
canBeFiltered()
Returns if the given attribute can be filtered.
protected
canBeFiltered(string $attr) : bool
If filtering is not possible then no filter box will be displayed. By default all attributes can be filtered.
Parameters
- $attr : string
-
attribute name
Return values
bool —filtering possible
forceRefresh()
Forces a refresh of the LDAP data.
protected
forceRefresh() : void
Function must be called before $this->refresh option is checked to load new LDAP data (e.g. in listGetParams).
Return values
void —getAccountStatusFilterArea()
Returns the filter for account status.
protected
getAccountStatusFilterArea(bool $clearFilter) : htmlElement
Parameters
- $clearFilter : bool
-
filter should be cleared
Return values
htmlElement —getAdditionalLDAPAttributesToRead()
Returns a list of additional LDAP attributes that should be read.
protected
getAdditionalLDAPAttributesToRead() : array<string|int, string>
This can be used to show additional data even if the user selected other attributes to show in the list.
Return values
array<string|int, string> —additional attribute names
getAdditionalTools()
Returns a list of lamListTool objects to display next to the edit/delete buttons.
protected
getAdditionalTools() : array<string|int, lamListTool>
Return values
array<string|int, lamListTool> —tools
getFilterArea()
Prints the content of a single attribute filter area.
protected
getFilterArea(string $attrName, bool $clearFilter) : htmlElement
Parameters
- $attrName : string
-
attribute name
- $clearFilter : bool
-
true if filter value should be cleared
Return values
htmlElement —element to show
getFilterAsTextForURL()
Returns the filter as text to be used as URL parameter.
protected
getFilterAsTextForURL() : string
Return values
string —filter text
getTableCellContent()
Returns the content of a cell in the account list for a given LDAP entry and attribute.
protected
getTableCellContent(array<string, string[]|string> &$entry, string &$attribute) : htmlElement|null
Parameters
- $entry : array<string, string[]|string>
-
LDAP attributes
- $attribute : string
-
attribute name
Return values
htmlElement|null —content
isAttributeFilteredByServer()
Specifies if the given attribute name is used for server side filtering (LDAP filter string).
protected
isAttributeFilteredByServer(string $attrName) : bool
Parameters
- $attrName : string
-
attribute name
Return values
bool —filter server side
isFilterMatching()
Checks if the given LDAP data matches the filter.
protected
isFilterMatching(mixed &$data, mixed $filterAttribute, mixed $regex) : bool
Parameters
- $data : mixed
-
LDAP attributes
- $filterAttribute : mixed
-
filter attribute name
- $regex : mixed
-
filter attribute regex
Tags
Return values
bool —filter matches the entry
listBuildFilter()
Builds the regular expressions from the filter values.
protected
listBuildFilter() : void
Return values
void —listConfigurationChanged()
Called when the configuration options changed.
protected
listConfigurationChanged() : void
Return values
void —listCreateSortMapping()
Determines the sort mapping and stores it in $this->sortMapping.
protected
listCreateSortMapping(array<string|int, int> $indexes) : void
The sort mapping is used to display the right rows when the account table is created.
Parameters
- $indexes : array<string|int, int>
-
the account list indexes
Return values
void —listDoPost()
Manages all POST actions (e.g. button pressed) for the account lists.
protected
listDoPost() : htmlElement|null
Return values
htmlElement|null —HTML fragment to insert into beginning of account list
listDrawNavigationBar()
Draws a navigation bar to switch between pages
protected
listDrawNavigationBar(int $count) : void
Parameters
- $count : int
-
number of account entries
Return values
void —listGetAllConfigOptions()
Returns a list of possible configuration options.
protected
listGetAllConfigOptions() : array<string|int, lamListOption>
Return values
array<string|int, lamListOption> —list of lamListOption objects
listGetAttributeDescriptionList()
Returns an hash array containing with all attributes to be shown and their descriptions.
protected
listGetAttributeDescriptionList() : array<string, string>
Format: array(attribute => description)
Return values
array<string, string> —attribute list
listGetConfigOptionByID()
Returns the configuration option with the given ID.
protected
listGetConfigOptionByID(string $ID) : lamListOption|null
Parameters
- $ID : string
-
ID
Return values
lamListOption|null —option
listGetParams()
Sets some internal parameters.
protected
listGetParams() : void
Return values
void —listPrintButtons()
Prints the create and delete buttons.
protected
listPrintButtons(bool $createOnly) : void
Parameters
- $createOnly : bool
-
true if only the create button should be displayed
Return values
void —listPrintConfigurationPage()
Prints the list configuration page.
protected
listPrintConfigurationPage() : void
Return values
void —listPrintRedirectMessages()
Prints messages when another page (e.g. delete/upload) redirects to the list view.
protected
listPrintRedirectMessages() : void
Return values
void —listRefreshData()
Rereads the entries from LDAP.
protected
listRefreshData() : void
Return values
void —listShowOUSelection()
Prints a combobox with possible sub-DNs.
protected
listShowOUSelection() : htmlGroup
Return values
htmlGroup —OU selection (may be empty)
printFooterContent()
Prints any extra HTML for the footer part.
protected
printFooterContent() : void
Return values
void —printHeaderContent()
Prints any extra HTML for the header part.
protected
printHeaderContent() : void
Return values
void —addDataElements()
Adds the LDAP data elements to the given array.
private
addDataElements(array<string|int, array<string|int, mixed>> &$data, array<string|int, int> $entryIndexes, array<int, string> &$onClickEvents, array<int, string> &$onDoubleClickEvents) : void
Parameters
- $data : array<string|int, array<string|int, mixed>>
-
data for responsible table
- $entryIndexes : array<string|int, int>
-
entry indexes
- $onClickEvents : array<int, string>
-
row number => code
- $onDoubleClickEvents : array<int, string>
-
row number => code
Return values
void —addToolLinks()
Adds the tool image links (e.g. edit and delete) for each account.
private
addToolLinks(array<string, string[]|string> $account, string $id, htmlGroup $element) : void
Parameters
- $account : array<string, string[]|string>
-
LDAP attributes
- $id : string
-
account ID
- $element : htmlGroup
-
location where to add tools
Return values
void —getAccountStatus()
Returns the account status.
private
getAccountStatus(array<string, string[]|string> $attrs) : htmlElement
Parameters
- $attrs : array<string, string[]|string>
-
LDAP attributes
Return values
htmlElement —content
getFilterElements()
Returns the elements to show in filter row.
private
getFilterElements() : array<string|int, htmlElement>
Return values
array<string|int, htmlElement> —elements
getSortingElements()
Returns the elements to show in sorting row.
private
getSortingElements() : array<string|int, htmlElement>
Return values
array<string|int, htmlElement> —elements
injectAccountStatusAttribute()
Injects values for the virtual account status attribute to make it sortable.
private
injectAccountStatusAttribute() : void
Return values
void —isSupportingAccountStatus()
Returns if this account supports the account status column.
private
isSupportingAccountStatus() : bool
Return values
bool —quick change supported
isSupportingPasswordQuickChange()
Returns if this account supports the password quick change page.
private
isSupportingPasswordQuickChange() : bool
Return values
bool —quick change supported
listReadOptionsFromCookie()
Reads the list options from the cookie value.
private
listReadOptionsFromCookie() : void
Return values
void —printAccountTable()
Prints the entry list
private
printAccountTable(array<string|int, int> $indexes) : void
Parameters
- $indexes : array<string|int, int>
-
entry indexes
Return values
void —printFooter()
Prints the footer area of the page.
private
printFooter() : void
Return values
void —printHeader()
Prints the header part of the page.
private
printHeader() : void
Return values
void —showPDFPage()
Shows the page where the user may select the PDF options.
private
showPDFPage(string|null $id) : void
Parameters
- $id : string|null
-
account ID