UserFrosting API

Registration

Handles user registration tasks.

Tags
author

Alex Weissman (https://alexanderweissman.com)

Table of Contents

$ci ContainerInterface
$userdata array
$verified bool
$requireEmailVerification bool
$defaultGroup string
$defaultRoles array
$requiredProperties array
__construct() Constructor. mixed
register() Register a new user. UserInterface
validate() Validate the user name and email is unique. bool
usernameIsUnique() Check Unique Username Make sure the username is not already in use. bool
emailIsUnique() Check Unique Email Make sure the email is not already in use. bool
hashPassword() Hash the user password in the userdata array. mixed
setDefaults() Set default value from config. mixed
sendVerificationEmail() Send verification email for specified user. mixed
getRequireEmailVerification() bool
setRequireEmailVerification() static
getDefaultGroup() string
setDefaultGroup() static
getDefaultRoles() array
setDefaultRoles() static
getUserdata() array
setUserdata() static
setUserProperty() Define a user property. mixed

Properties

$requireEmailVerification

protected bool $requireEmailVerification

$requiredProperties

protected array $requiredProperties = ['user_name', 'first_name', 'last_name', 'email', 'password']

Methods

__construct()

Constructor.

public __construct( $ci : ContainerInterface [, $userdata : array = [] ] ) : mixed
Parameters
$ci : ContainerInterface

The global container object

$userdata : array = []

The user data

Return values
mixed

validate()

Validate the user name and email is unique.

public validate( ) : bool
Tags
throws
HttpException

If data doesn't validate

Return values
bool

Returns true if the data is valid

usernameIsUnique()

Check Unique Username Make sure the username is not already in use.

public usernameIsUnique( $username : string ) : bool
Parameters
$username : string
Return values
bool

Return true if username is unique

emailIsUnique()

Check Unique Email Make sure the email is not already in use.

public emailIsUnique( $email : string ) : bool
Parameters
$email : string
Return values
bool

Return true if email is unique

hashPassword()

Hash the user password in the userdata array.

protected hashPassword( ) : mixed
Return values
mixed

setDefaults()

Set default value from config.

protected setDefaults( ) : mixed
Return values
mixed

sendVerificationEmail()

Send verification email for specified user.

protected sendVerificationEmail( $user : UserInterface ) : mixed
Parameters
$user : UserInterface

The user to send the email for

Return values
mixed

getRequireEmailVerification()

public getRequireEmailVerification( ) : bool
Return values
bool

setRequireEmailVerification()

public setRequireEmailVerification( $requireEmailVerification : bool ) : static
Parameters
$requireEmailVerification : bool
Return values
static

getDefaultGroup()

public getDefaultGroup( ) : string
Return values
string

setDefaultGroup()

public setDefaultGroup( $defaultGroup : string ) : static
Parameters
$defaultGroup : string
Return values
static

getDefaultRoles()

public getDefaultRoles( ) : array
Return values
array

setDefaultRoles()

public setDefaultRoles( $defaultRoles : array ) : static
Parameters
$defaultRoles : array
Return values
static

getUserdata()

public getUserdata( ) : array
Return values
array

setUserdata()

public setUserdata( $userdata : array ) : static
Parameters
$userdata : array
Return values
static

setUserProperty()

Define a user property.

public setUserProperty( $property : string , $value : mixed ) : mixed
Parameters
$property : string

The property to set

$value : mixed

The property value

Return values
mixed

Search results