Auth

Summary
Auth
AuthorJaybill McCarthy
Licensehttp://communit.as/docs/license
See AlsoCts_Controller_Action_Abstract
Actions
loginEither displays a login form, processes a login request, or automatically logs someone in (if auto_login in the app variables is set to true).
deniedThis page is shown if the user is not allowed access to the requested page.
missingThis page is shown if the requested page does not exist.
logoutLogs a user out of their session and redirects to the the app root (‘/’, currently hardcoded).
error

Author

Jaybill McCarthy

Actions

login

function loginAction()

Either displays a login form, processes a login request, or automatically logs someone in (if auto_login in the app variables is set to true).

Plugin Hooks

  • auth_login_login_success (action) - Deprecated.  Same as auth_login_success.
  • auth_login_success (action) - Enables you to perform custom actions before the browser is redirected if the login attempt succeeds.
param usernameThe username of the user logging in.
param passwordThe password of the user logging in.
param requested_urlThe URL to redirect to after login success and after the plugin has executed.
  • auth_login_login_failure (action) - Deprecated.  Same as auth_login_failure.
  • auth_login_failure (action) - Enables you to perform custom actions if the login attempt failed.
param usernameThe username of the user logging in.

View Variables

errorsAn array of error messages.  Only present if errors occurred.
last_loginThe username of the last user to log in, or null if there was a failed login.
pagetitleThe HTML page title.

denied

function deniedAction()

This page is shown if the user is not allowed access to the requested page.  It’s typically reached via HTTP Response Redirect.

Plugin Hooks

  • auth_denied (action) - Allows you to perform actions just before the page renders.
param usernameThe username of the logged-in user.  Only exists if there is a logged-in user.

missing

function missingAction()

This page is shown if the requested page does not exist.  It’s typically reached via HTTP Response Redirect.

Plugin Hooks

  • auth_missing (action) - Allows you to perform actions just before the page renders.
param usernameThe username of the logged-in user.  Only exists if there is a logged-in user.

logout

function logoutAction()

Logs a user out of their session and redirects to the the app root (‘/’, currently hardcoded).

Plugin Hooks

  • auth_logout_pre (action) - Allows you to perform actions before the user is logged out.
param usernameThe username of the logged-in user.  Only exists if there is a logged-in user.
  • auth_logout_post (action) - Allows you to perform actions after the user is logged out and before the page is redirected.  You could override the redirect here.
param usernameThe username of the logged-in user.  Only exists if there is a logged-in user.

error

function errorAction()

Plugin Hooks

  • auth_error (action) - Allows you to perform an action any time an error occurs.
function loginAction()
Either displays a login form, processes a login request, or automatically logs someone in (if auto_login in the app variables is set to true).
function deniedAction()
This page is shown if the user is not allowed access to the requested page.
function missingAction()
This page is shown if the requested page does not exist.
function logoutAction()
Logs a user out of their session and redirects to the the app root (‘/’, currently hardcoded).
function errorAction()
Close