PHP Class Airship\Cabin\Bridge\Landing\Account

Landing for user account stuff. Also contains the login and registration forms.
Inheritance: extends LandingGear, use trait Security
Show file Open project: paragonie/airship

Protected Properties

Property Type Description
$acct Airship\Cabin\Bridge\Blueprint\UserAccounts

Public Methods

Method Description
airshipLand ( ) This function is called after the dependencies have been injected by AutoPilot. Think of it as a user-land constructor.
board ( ) Process the /board API endpoint.
login ( ) Handle login requests
logout ( string $token ) CSRF-resistant logout script
my ( )
myIndex ( )
preferences ( ) Allows users to select which Motif to use
publicDirectory ( string $page = '' ) A directory of public users
recoverAccount ( string $token = '' )
twoFactorSetup ( )
twoFactorSetupQRCode ( ) Returns the user's QR code.

Protected Methods

Method Description
findMotif ( array $motifs, string $supplier, string $motifName ) : boolean Is this motif part of this cabin?
getGPGPublicKey ( string $fingerprint ) : string Return the public key corresponding to a fingerprint
getOffsetAndLimit ( string $page = null, integer $per_page ) : int[] Gets [offset, limit] based on configuration
processAccountUpdate ( array $post = [], array $account = [], string $gpg_public_key = '' ) Process a user account update
processBoard ( array $post = [] ) Process a user account registration request
processLogin ( array $post = [] ) Handle user authentication
processRecoverAccount ( array $post ) : boolean Process account recovery
processRecoveryToken ( string $token ) If the token is valid, log in as the user.
recoveryMessage ( string $token ) : string
savePreferences ( array $prefs = [], array $cabins = [], array $motifs = [] ) : boolean Save a user's preferences
twoFactorPreamble ( integer $userID ) : ParagonIE\MultiFactor\Vendor\GoogleAuth Make sure the secret exists, then get the GoogleAuth object

Method Details

airshipLand() public method

This function is called after the dependencies have been injected by AutoPilot. Think of it as a user-land constructor.
public airshipLand ( )

board() public method

Process the /board API endpoint.
public board ( )

findMotif() protected method

Is this motif part of this cabin?
protected findMotif ( array $motifs, string $supplier, string $motifName ) : boolean
$motifs array
$supplier string
$motifName string
return boolean

getGPGPublicKey() protected method

Return the public key corresponding to a fingerprint
protected getGPGPublicKey ( string $fingerprint ) : string
$fingerprint string
return string

getOffsetAndLimit() protected method

Gets [offset, limit] based on configuration
protected getOffsetAndLimit ( string $page = null, integer $per_page ) : int[]
$page string
$per_page integer
return int[]

login() public method

Handle login requests
public login ( )

logout() public method

CSRF-resistant logout script
public logout ( string $token )
$token string

my() public method

public my ( )

myIndex() public method

public myIndex ( )

preferences() public method

Allows users to select which Motif to use
public preferences ( )

processAccountUpdate() protected method

Process a user account update
protected processAccountUpdate ( array $post = [], array $account = [], string $gpg_public_key = '' )
$post array
$account array
$gpg_public_key string

processBoard() protected method

Process a user account registration request
protected processBoard ( array $post = [] )
$post array

processLogin() protected method

Handle user authentication
protected processLogin ( array $post = [] )
$post array

processRecoverAccount() protected method

Process account recovery
protected processRecoverAccount ( array $post ) : boolean
$post array
return boolean

processRecoveryToken() protected method

If the token is valid, log in as the user.
protected processRecoveryToken ( string $token )
$token string

publicDirectory() public method

A directory of public users
public publicDirectory ( string $page = '' )
$page string

recoverAccount() public method

public recoverAccount ( string $token = '' )
$token string

recoveryMessage() protected method

protected recoveryMessage ( string $token ) : string
$token string
return string

savePreferences() protected method

Save a user's preferences
protected savePreferences ( array $prefs = [], array $cabins = [], array $motifs = [] ) : boolean
$prefs array
$cabins array
$motifs array
return boolean

twoFactorPreamble() protected method

Make sure the secret exists, then get the GoogleAuth object
protected twoFactorPreamble ( integer $userID ) : ParagonIE\MultiFactor\Vendor\GoogleAuth
$userID integer
return ParagonIE\MultiFactor\Vendor\GoogleAuth

twoFactorSetup() public method

public twoFactorSetup ( )

twoFactorSetupQRCode() public method

Returns the user's QR code.

Property Details

$acct protected property

protected UserAccounts,Airship\Cabin\Bridge\Blueprint $acct
return Airship\Cabin\Bridge\Blueprint\UserAccounts