usersCtrl
extends jController
in package
class base for controllers.
Tags
Table of Contents
- $pluginParams : array<string|int, mixed>
- parameters for plugins of the coordinator.
- $sensitiveParameters : array<string|int, string>
- sensitive parameters.
- $request : jRequest
- the request object.
- __construct() : mixed
- addgroup() : jResponseRedirect
- Add a user into a group
- index() : jResponseHtml
- Page to list all users
- removegroup() : jResponseRedirect
- Remove a user from a group
- rightres() : jResponseHtml
- Show a page with the list of rights on resources for the user
- rights() : jResponseHtml
- Page showing rights of a user and his groups
- saverightres() : jResponseRedirect
- Save rights on resources for the user
- saverights() : jResponseRedirect
- Save rights
- usersList() : jResponseJson
- list of users
- boolParam() : bool
- same as param(), but convert the value to a boolean value. If it isn't a numerical value, return null.
- checkException() : mixed
- floatParam() : float
- same as param(), but convert the value to a float value. If it isn't a numerical value, return null.
- getFileResponse() : jResponseBinary|jResponseHtml
- Return the given file as a response.
- getLabel() : mixed
- getResponse() : jResponse|jResponseHtml|jResponseJson|jResponseRedirect
- get a response object.
- intParam() : int
- same as param(), but convert the value to an integer value. If it isn't a numerical value, return null.
- param() : mixed
- Gets the value of a request parameter. If not defined, gets its default value.
- params() : array<string|int, mixed>
- redirect() : jResponseRedirect
- get a jReponseRedirect object
- redirectToUrl() : jResponseRedirectUrl
- get a jReponseRedirectUrl object
Properties
$pluginParams
parameters for plugins of the coordinator.
public
array<string|int, mixed>
$pluginParams
= array('index' => array('jacl2.rights.and' => array('acl.user.view')), 'usersList' => array('jacl2.rights.and' => array('acl.user.view')), 'rights' => array('jacl2.rights.and' => array('acl.user.view')), 'saverights' => array('jacl2.rights.and' => array('acl.user.view', 'acl.user.modify')), 'rightres' => array('jacl2.rights.and' => array('acl.user.view')), 'saverightres' => array('jacl2.rights.and' => array('acl.user.view', 'acl.user.modify')), 'removegroup' => array('jacl2.rights.and' => array('acl.user.view', 'acl.user.modify')), 'addgroup' => array('jacl2.rights.and' => array('acl.user.view', 'acl.user.modify')))
this array should contains all parameters needed by installed plugins for each action, see the documentation of each plugins to know this parameters. keys : name of an action or * for parameters to all action values : array that contains all plugin parameters
Tags
$sensitiveParameters
sensitive parameters.
public
array<string|int, string>
$sensitiveParameters
= array()
List of names of parameters that can have sensitive values like password etc. This list is used by the logger for example, to replace values by a dummy value. See also sensitiveParameters into error_handling section of the configuration.
Tags
$request
the request object.
protected
jRequest
$request
Tags
Methods
__construct()
public
__construct(jRequest $request) : mixed
Parameters
- $request : jRequest
-
the current request object
Tags
Return values
mixed —addgroup()
Add a user into a group
public
addgroup() : jResponseRedirect
Tags
Return values
jResponseRedirect —index()
Page to list all users
public
index() : jResponseHtml
Tags
Return values
jResponseHtml —removegroup()
Remove a user from a group
public
removegroup() : jResponseRedirect
Tags
Return values
jResponseRedirect —rightres()
Show a page with the list of rights on resources for the user
public
rightres() : jResponseHtml
Tags
Return values
jResponseHtml —rights()
Page showing rights of a user and his groups
public
rights() : jResponseHtml
Tags
Return values
jResponseHtml —saverightres()
Save rights on resources for the user
public
saverightres() : jResponseRedirect
Tags
Return values
jResponseRedirect —saverights()
Save rights
public
saverights() : jResponseRedirect
Tags
Return values
jResponseRedirect —usersList()
list of users
public
usersList() : jResponseJson
Tags
Return values
jResponseJson —boolParam()
same as param(), but convert the value to a boolean value. If it isn't a numerical value, return null.
protected
boolParam(string $parName[, mixed $parDefaultValue = null ][, bool $useDefaultIfEmpty = false ]) : bool
Parameters
- $parName : string
-
the name of the request parameter
- $parDefaultValue : mixed = null
-
the default returned value if the parameter doesn't exists
- $useDefaultIfEmpty : bool = false
-
true: says to return the default value the value is ""
Tags
Return values
bool —the request parameter value
checkException()
protected
checkException(jAcl2DbAdminUIException $e, mixed $category) : mixed
Parameters
- $e : jAcl2DbAdminUIException
- $category : mixed
Tags
Return values
mixed —floatParam()
same as param(), but convert the value to a float value. If it isn't a numerical value, return null.
protected
floatParam(string $parName[, mixed $parDefaultValue = null ][, bool $useDefaultIfEmpty = false ]) : float
Parameters
- $parName : string
-
the name of the request parameter
- $parDefaultValue : mixed = null
-
the default returned value if the parameter doesn't exists
- $useDefaultIfEmpty : bool = false
-
true: says to return the default value the value is ""
Tags
Return values
float —the request parameter value
getFileResponse()
Return the given file as a response.
protected
getFileResponse(string $filename[, bool $useCache = true ]) : jResponseBinary|jResponseHtml
It reads the file content and will return it into the HTTP Response. Mimetype will be set. Can use HTTP cache optionally.
Returns a 404 response if the file does not exists.
Parameters
- $filename : string
-
path to the file
- $useCache : bool = true
-
true if http cache must be activated, based on the date of the file.
Tags
Return values
jResponseBinary|jResponseHtml —getLabel()
protected
getLabel(mixed $id, mixed $labelKey) : mixed
Parameters
- $id : mixed
- $labelKey : mixed
Tags
Return values
mixed —getResponse()
get a response object.
protected
getResponse([string $name = '' ][, bool $useOriginal = false ]) : jResponse|jResponseHtml|jResponseJson|jResponseRedirect
Parameters
- $name : string = ''
-
the name of the response type (ex: "html")
- $useOriginal : bool = false
-
true:don't use the response object redefined by the application
Tags
Return values
jResponse|jResponseHtml|jResponseJson|jResponseRedirect —the response object
intParam()
same as param(), but convert the value to an integer value. If it isn't a numerical value, return null.
protected
intParam(string $parName[, mixed $parDefaultValue = null ][, bool $useDefaultIfEmpty = false ]) : int
Parameters
- $parName : string
-
the name of the request parameter
- $parDefaultValue : mixed = null
-
the default returned value if the parameter doesn't exists
- $useDefaultIfEmpty : bool = false
-
true: says to return the default value the value is ""
Tags
Return values
int —the request parameter value
param()
Gets the value of a request parameter. If not defined, gets its default value.
protected
param(string $parName[, mixed $parDefaultValue = null ][, bool $useDefaultIfEmpty = false ]) : mixed
Parameters
- $parName : string
-
the name of the request parameter
- $parDefaultValue : mixed = null
-
the default returned value if the parameter doesn't exists
- $useDefaultIfEmpty : bool = false
-
true: says to return the default value if the parameter value is ""
Tags
Return values
mixed —the request parameter value
params()
protected
params() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —all request parameters
redirect()
get a jReponseRedirect object
protected
redirect(string $action[, array<string|int, mixed> $parameters = [] ][, string $anchor = '' ][, bool $temporary = true ]) : jResponseRedirect
Parameters
- $action : string
-
the action selector, like "mymodule~myctrl:mymethod"
- $parameters : array<string|int, mixed> = []
-
parameters of the action
- $anchor : string = ''
-
url anchor
- $temporary : bool = true
-
temporary redirection (true) or permanent redirection (false)
Tags
Return values
jResponseRedirect —redirectToUrl()
get a jReponseRedirectUrl object
protected
redirectToUrl(string $url[, mixed $temporary = true ]) : jResponseRedirectUrl
Parameters
- $url : string
-
the url
- $temporary : mixed = true