Registration
Handles user registration tasks.
Tags
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
$ci
protected
ContainerInterface
$ci
$userdata
protected
array
$userdata
$verified
protected
bool
$verified
$requireEmailVerification
protected
bool
$requireEmailVerification
$defaultGroup
protected
string
$defaultGroup
$defaultRoles
protected
array
$defaultRoles
= []
$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
mixedregister()
Register a new user.
public
register(
)
: UserInterface
Return values
UserInterface —The created user
validate()
Validate the user name and email is unique.
public
validate(
)
: bool
Tags
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
mixedsetDefaults()
Set default value from config.
protected
setDefaults(
)
: mixed
Return values
mixedsendVerificationEmail()
Send verification email for specified user.
protected
sendVerificationEmail(
$user :
UserInterface
)
: mixed
Parameters
- $user : UserInterface
The user to send the email for
Return values
mixedgetRequireEmailVerification()
public
getRequireEmailVerification(
)
: bool
Return values
boolsetRequireEmailVerification()
public
setRequireEmailVerification(
$requireEmailVerification :
bool
)
: static
Parameters
- $requireEmailVerification : bool
Return values
staticgetDefaultGroup()
public
getDefaultGroup(
)
: string
Return values
stringsetDefaultGroup()
public
setDefaultGroup(
$defaultGroup :
string
)
: static
Parameters
- $defaultGroup : string
Return values
staticgetDefaultRoles()
public
getDefaultRoles(
)
: array
Return values
arraysetDefaultRoles()
public
setDefaultRoles(
$defaultRoles :
array
)
: static
Parameters
- $defaultRoles : array
Return values
staticgetUserdata()
public
getUserdata(
)
: array
Return values
arraysetUserdata()
public
setUserdata(
$userdata :
array
)
: static
Parameters
- $userdata : array
Return values
staticsetUserProperty()
Define a user property.
public
setUserProperty(
$property :
string
, $value :
mixed
)
: mixed
Parameters
- $property : string
The property to set
- $value : mixed
The property value