AdmindashboardController
class AdmindashboardController extends Controller
Implements support for our Admindashboard controller.
Traits
A trait that support operations related to APIs and their associated JSON responses.
Properties
| protected string | $_action | The name of the current action. |
from Controller |
| protected string | $_controller | The name of the current controller. |
from Controller |
| Input | $request | Instance of Input class that performs much of our request tasks. |
from Controller |
| View | $view | Instance of view class. |
from Controller |
| static string|null | $rawInputOverride | Raw JSON override for tests |
from JsonResponse |
| static bool | $testing | When true, do not send headers or exit; just echo JSON and return. |
from JsonResponse |
| static int | $lastStatus | Captured status for tests (optional convenience). |
from JsonResponse |
| static array | $lastHeaders | Captured headers for tests (optional convenience). |
from JsonResponse |
Methods
Constructor for the parent Controller class. This constructor gets called when an instance of the child class is instantiated.
Initializes ErrorHandler and SessionManager and starts execution of the app.
Manages the displaying of error messages and other reporting for this application.
Captures the current View instance during testing so that test assertions (e.g., assertViewContains) can access view-bound variables.
Runs when the object is constructed.
Supports operations related to handling POST and GET requests.
Makes JSON Response for error payloads.
Returns json response success = true and sets path for redirect.
Sends a JSON response with headers and status code.
Inject JSON body by providing payload parameter. Also performs cleanup to avoid leaking into other tests.
Displays list of attachments.
Displays details for a particular E-mail attachment.
Deletes ACL from acl table.
Performs delete action on a user.
Deletes an attachment and sets deleted field in table to 1.
Deletes an image associated with a user's profile.
Delete a job and redirects back to queueManager.
Delete a notification and redirects back to main notifications page.
Presents information about a particular user's profile.
Supports ability to edit ACLs not assigned to a user through a web form.
Supports ability for administrators to edit user profiles.
Creates or edits the details of an existing E-mail attachment.
The default action for this controller. It performs rendering of this site's admin dashboard page.
Renders view with information related to a job within the queue table.
Renders view for managing ACLs.
Displays information for a particular notification within the database channel
Get list of notifications that are found in the database channel.
Previews an attachment.
Retrieves list of jobs in queue and renders queue_manager view.
Support ability to toggle on or off the reset password flag for a particular user.
Sets active status for a particular user. The administrator can toggle the setting on or off using a web form.
Details
in
Controller at line 47
__construct(string $controller, string $action)
Constructor for the parent Controller class. This constructor gets called when an instance of the child class is instantiated.
in
Application at line 26
static void
appStart()
Initializes ErrorHandler and SessionManager and starts execution of the app.
in
Application at line 51
private void
_set_reporting()
Manages the displaying of error messages and other reporting for this application.
in
Controller at line 67
protected void
logViewForTesting(View $view)
Captures the current View instance during testing so that test assertions (e.g., assertViewContains) can access view-bound variables.
This method should be called in controller actions before rendering a view. It stores the View object in ApplicationTestCase::$controllerOutput['view'] when the application is running in the 'testing' environment.
at line 336
void
onConstruct()
Runs when the object is constructed.
in
JsonResponse at line 47
bool
apiCsrfCheck()
Checks if CSRF token has been tampered with.
in
JsonResponse at line 62
array|string
get(string|null $input = null)
Supports operations related to handling POST and GET requests.
Similar in behavior to the get function from the Input class but for JSON related operations.
in
JsonResponse at line 97
void
jsonError(string $message, int $status = 400, array $errors = [])
Makes JSON Response for error payloads.
in
JsonResponse at line 110
void
jsonRedirect(string $url)
Returns json response success = true and sets path for redirect.
in
JsonResponse at line 125
void
jsonResponse(mixed $data, int $status = 200, array $extraHeaders = [])
Sends a JSON response with headers and status code.
in
JsonResponse at line 174
void
preflight()
Respond to CORS preflight.
in
JsonResponse at line 190
static void
setRawInputOverride(mixed $payload = null)
Inject JSON body by providing payload parameter. Also performs cleanup to avoid leaking into other tests.
at line 30
void
attachmentsAction()
Displays list of attachments.
at line 44
void
attachmentDetailsAction(int $id)
Displays details for a particular E-mail attachment.
at line 56
void
deleteAclAction()
Deletes ACL from acl table.
at line 70
void
deleteAction(int $id)
Performs delete action on a user.
at line 85
void
deleteAttachmentAction(int $id)
Deletes an attachment and sets deleted field in table to 1.
at line 96
void
deleteImageAction()
Deletes an image associated with a user's profile.
at line 110
void
deleteJobAction(int $id)
Delete a job and redirects back to queueManager.
at line 125
void
deleteNotificationAction(int $id)
Delete a notification and redirects back to main notifications page.
at line 140
void
detailsAction(int $id)
Presents information about a particular user's profile.
at line 155
void
editAclAction(int|string $id)
Supports ability to edit ACLs not assigned to a user through a web form.
at line 180
void
editAction(int $id)
Supports ability for administrators to edit user profiles.
at line 222
void
editAttachmentsAction(int|string $id)
Creates or edits the details of an existing E-mail attachment.
at line 247
void
indexAction()
The default action for this controller. It performs rendering of this site's admin dashboard page.
at line 266
void
jobDetailsAction(int $id)
Renders view with information related to a job within the queue table.
at line 278
void
manageACLsAction()
Renders view for managing ACLs.
at line 311
void
notificationDetailsAction(int $id)
Displays information for a particular notification within the database channel
at line 323
void
notificationsAction()
Get list of notifications that are found in the database channel.
at line 346
void
previewAction(int $id)
Previews an attachment.
at line 355
void
queueManagerAction()
Retrieves list of jobs in queue and renders queue_manager view.
at line 371
void
setResetPasswordAction(int $id)
Support ability to toggle on or off the reset password flag for a particular user.
at line 396
void
setStatusAction(int $id)
Sets active status for a particular user. The administrator can toggle the setting on or off using a web form.