class AuthController extends Controller

Implements support for our Auth controller. Functions found in this class will support tasks related to the user registration and authentication.

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

Methods

__construct(string $controller, string $action)

Constructor for the parent Controller class. This constructor gets called when an instance of the child class is instantiated.

static void
appStart()

Initializes ErrorHandler and SessionManager and starts execution of the app.

void
_set_reporting()

Manages the displaying of error messages and other reporting for this application.

void
logViewForTesting(View $view)

Captures the current View instance during testing so that test assertions (e.g., assertViewContains) can access view-bound variables.

void
onConstruct()

Internal version of this controller uses internal layout.

void
loginAction()

Manages login action processes.

void
loginRedirects(LoginResult $result)

Handles messaging and redirects for loginAction based on status of LoginResult.

void
logoutAction()

Manages logoutAction for a user. It checks if a user is currently logged. No matter of the result, the user gets redirected to the login screen.

void
registerAction()

Manages actions related to user registration.

void
resetPasswordAction(int $id)

Lets a user whose account is flagged for a password reset set a new password. Only works for the user recorded by AuthService::beginPasswordReset() during login in this session.

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.

Parameters

string $controller

The name of the controller obtained while parsing the URL.

string $action

The name of the action specified in the path of the URL.

in Application at line 26
static void appStart()

Initializes ErrorHandler and SessionManager and starts execution of the app.

Return Value

void

in Application at line 51
private void _set_reporting()

Manages the displaying of error messages and other reporting for this application.

Return Value

void

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.

Parameters

View $view

The View instance to capture.

Return Value

void

at line 95
void onConstruct()

Internal version of this controller uses internal layout.

Return Value

void

at line 27
void loginAction()

Manages login action processes.

Return Value

void

at line 50
private void loginRedirects(LoginResult $result)

Handles messaging and redirects for loginAction based on status of LoginResult.

Parameters

LoginResult $result

The resulting status of a login attempt.

Return Value

void

at line 79
void logoutAction()

Manages logoutAction for a user. It checks if a user is currently logged. No matter of the result, the user gets redirected to the login screen.

Return Value

void

at line 104
void registerAction()

Manages actions related to user registration.

Return Value

void

at line 137
void resetPasswordAction(int $id)

Lets a user whose account is flagged for a password reset set a new password. Only works for the user recorded by AuthService::beginPasswordReset() during login in this session.

Parameters

int $id

The id of the user whose password we want to reset.

Return Value

void