ClientMain extends ClientController
Client portal main controller
Table of Contents
Properties
| $custom_field_prefix | |
| $editable_settings |
Methods
| edit() | Edit the client |
| getCurrencyAmounts() | AJAX Fetches the currency amounts for the my info sidebar |
| getStates() | AJAX Fetch all states belonging to a given country (json encoded ajax request) |
| index() | Client Profile |
| invoiceMethod() | Edit client's invoice method |
| preAction() | Main pre-action |
| searchManagedAccounts() | AJAX Searches managed accounts |
| setLanguage() | Sets the default language for this session |
| authorized() | Verifies that the currently logged in user is authorized for the given Controller and Action (or current Controller/Action if none given). |
| hasPermission() | Verifies if the current user has permission to the given area |
| isStaffAsClient() | Checks whether the current user is a staff user and whether the user is currently logged into the client portal. |
| requireLogin() | {@inheritdoc} |
| requirePermission() | Verifies permissions for the given generic $area |
| setNav() | Sets the primary and secondary navigation links. Performs authorization checks on each navigational element. |
| addCustomFields() | Attempts to add custom fields to a client |
| getAutodebitDescription() | Retrieves the autodebit language description based on the payment account settings |
| setContactView() | Sets the contact partial view |
| setCustomFieldView() | Sets the custom fields partial view |
| setInReviewMessage() | Sets a message to the view regarding in-review services |
| setMyInfo() | Sets a partial view that contains all left-column client info |
| setPhoneView() | Sets the contact phone number partial view |
Methods
edit()
Edit the client
public
edit() : mixed
getCurrencyAmounts()
AJAX Fetches the currency amounts for the my info sidebar
public
getCurrencyAmounts() : mixed
getStates()
AJAX Fetch all states belonging to a given country (json encoded ajax request)
public
getStates() : mixed
index()
Client Profile
public
index() : mixed
invoiceMethod()
Edit client's invoice method
public
invoiceMethod() : mixed
preAction()
Main pre-action
public
preAction() : mixed
searchManagedAccounts()
AJAX Searches managed accounts
public
searchManagedAccounts() : mixed
setLanguage()
Sets the default language for this session
public
setLanguage() : mixed
authorized()
Verifies that the currently logged in user is authorized for the given Controller and Action (or current Controller/Action if none given).
protected
authorized([string $controller = null ][, string $action = null ][, stdClass $group = null ]) : bool
Will first check whether the Controller and Action is a permission value, and if so, checks to ensure the staff or client group user is authorized to access that resource
Parameters
- $controller : string = null
-
The controller to check authorization on, null will default to the current controller
- $action : string = null
-
The action to check authorization on, null will default to the current action
- $group : stdClass = null
-
The staff or client group to check authorization on, null will fetch the group of the current user
Return values
bool —Returns true if the user is authorized for that resource, false otherwise
hasPermission()
Verifies if the current user has permission to the given area
protected
hasPermission(string $area) : bool
Parameters
- $area : string
-
The generic area
Return values
bool —True if user has permission, false otherwise
isStaffAsClient()
Checks whether the current user is a staff user and whether the user is currently logged into the client portal.
protected
isStaffAsClient() : bool
Return values
bool —True if the user is a staff user logged in as a client, false otherwise
requireLogin()
{@inheritdoc}
protected
requireLogin([mixed $redirect_to = null ]) : mixed
Parameters
- $redirect_to : mixed = null
requirePermission()
Verifies permissions for the given generic $area
protected
requirePermission(string $area) : mixed
Parameters
- $area : string
-
The generic area
setNav()
Sets the primary and secondary navigation links. Performs authorization checks on each navigational element.
protected
setNav() : mixed
May cache nav results if possible for better performance.
addCustomFields()
Attempts to add custom fields to a client
private
addCustomFields([array<string|int, mixed> $vars = [] ]) : mixed
Parameters
- $vars : array<string|int, mixed> = []
-
The post data, containing custom fields
Tags
Return values
mixed —An array of errors, or false if none exist
getAutodebitDescription()
Retrieves the autodebit language description based on the payment account settings
private
getAutodebitDescription() : string
Return values
string —The autodebit language description
setContactView()
Sets the contact partial view
private
setContactView(stdClass $vars[, stdClass $contact = null ]) : mixed
Parameters
- $vars : stdClass
-
The input vars object for use in the view
- $contact : stdClass = null
-
An object representing the current contact being updated
Tags
setCustomFieldView()
Sets the custom fields partial view
private
setCustomFieldView(stdClass $vars) : mixed
Parameters
- $vars : stdClass
-
An stdClass object representing the client vars
Tags
setInReviewMessage()
Sets a message to the view regarding in-review services
private
setInReviewMessage() : mixed
setMyInfo()
Sets a partial view that contains all left-column client info
private
setMyInfo() : mixed
setPhoneView()
Sets the contact phone number partial view
private
setPhoneView(stdClass $vars) : mixed
Parameters
- $vars : stdClass
-
The input vars object for use in the view