class UsersAdminController extends BaseAdminController

The UsersAdminController class is the controller that handles all actions of the users management interface.

These actions are:

  • Creation of a user
  • Modification of a user
  • Deletion of a user
  • Restoring a user after its deletion

All these actions are requested in Ajax by the Javascript Tabledit component

Properties

ControllersHelper $helper from BaseAdminController
string $databasesDir from BaseAdminController
string $simulatorsDir from BaseAdminController
string $publicDir from BaseAdminController
string $viewsDir from BaseAdminController

Methods

Response
errorResponse(array $form, string $error)

Returns a JSON response formed with the data of a form and an error message.

zip(array $contents)

Zip file creation function.

int
unix2DosTime(int $unixtime)

Converts unix time to MS DOS time

Response
indexAction(Request $request, string|null $crud = null)

Entry point for the route paths begining by /admin/users

Response
runIndex(Request $request, string|null $crud)

Dispatches the index action to the appropriate processing based on the value of the crud parameter.

Response
addUser(array $form)

Creates a user with the data in the form fields.

Response
restoreUser(array $form)

Restores a user with the data in the form fields.

Response
updateUser(array $form)

Updates a user with the data in the form fields.

Response
doUpdateUser(array $form, bool $newUser = false, bool $restore = false)

Realizes the update of the user database via FOSUserBundle with the data in the form fields.

Response
deleteUser(array $form)

Deletes a user with the data in the form fields.

Details

in BaseAdminController at line 93
protected Response errorResponse(array $form, string $error)

Returns a JSON response formed with the data of a form and an error message.

Parameters

array $form The form fields
string $error The error message

Return Value

Response

in BaseAdminController at line 113
protected zip(array $contents)

Zip file creation function.

Makes zip files. Derivated from PhpMyAdmin package The $contents parameter is an array of associative array where keys are : - name: name of the zip - modtime: modification time - data: data to compress

Parameters

array $contents The array of contents to be compressed

See also

Official ZIP file format: https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

in BaseAdminController at line 188
protected int unix2DosTime(int $unixtime)

Converts unix time to MS DOS time

Parameters

int $unixtime (default: 0) The unix time

Return Value

int The MS DOS time

at line 70
Response indexAction(Request $request, string|null $crud = null)

Entry point for the route paths begining by /admin/users

These route paths are :

  • /admin/users
  • /admin/users/{crud}

Parameters

Request $request The request
string|null $crud (default: null) operation to execute on the user (add, update, delete, restore)

Return Value

Response The response with JSON content

at line 86
protected Response runIndex(Request $request, string|null $crud)

Dispatches the index action to the appropriate processing based on the value of the crud parameter.

If the crud parameter contains no value, shows the users management interface.

Parameters

Request $request The request
string|null $crud (default: null) operation to execute on the user (add, update, delete, restore)

Return Value

Response The response with JSON content

at line 144
protected Response addUser(array $form)

Creates a user with the data in the form fields.

Route path : /admin/users/add

Parameters

array $form The form fields

Return Value

Response The response with JSON content

at line 158
protected Response restoreUser(array $form)

Restores a user with the data in the form fields.

Route path : /admin/users/restore

Parameters

array $form The form fields

Return Value

Response The response with JSON content

at line 172
protected Response updateUser(array $form)

Updates a user with the data in the form fields.

Route path : /admin/users/update

Parameters

array $form The form fields

Return Value

Response The response with JSON content

at line 190
protected Response doUpdateUser(array $form, bool $newUser = false, bool $restore = false)

Realizes the update of the user database via FOSUserBundle with the data in the form fields.

Parameters

array $form The form fields
bool $newUser (default: false) true if the user is to be created, false otherwise
bool $restore (default: false) true if the user is to be restored, false otherwise

Return Value

Response The response with JSON content

at line 271
protected Response deleteUser(array $form)

Deletes a user with the data in the form fields.

Route path : /admin/users/delete

Parameters

array $form The form fields

Return Value

Response The response with JSON content