public
|
#
__construct( flDb $db, flConfig $cfg = null, boolean $notifyEvents = true )
Construct the adapter.
Parameters
- $db
- The system database object.
- $cfg
- The system configuration object.
- $notifyEvents
- Flags if to send user event notifications.
Throws
Overrides
|
public
array
|
#
authenticate( string $ip, string $username, string $password, string $usernameEmail, boolean $updateAccessTime = true )
Authenticate the user with the given name and password.
Authenticate the user with the given name and password.
Parameters
- $ip
- The client IP address.
- $username
- The name of the user.
- $password
- The MD5 of the users password.
- $usernameEmail
- Select if $username holds a username 'username', an email address 'email', or null if unknown.
- $updateAccessTime
- true to update the last access time; else false.
Returns
array Array of user data and auth state.
Overrides
|
public
array
|
#
validate( integer $uid, string $data, string $signature, boolean $updateAccessTime = true )
Validate the user id, data payload and signature.
Validate the user id, data payload and signature.
Parameters
- $uid
- The user id to validate.
- $data
- The data to be verified.
- $signature
- The signature of the data.
- $updateAccessTime
- true to update the last access time; else false.
Returns
array The array of user data and auth state.
Overrides
|
public
array
|
#
regenerate( integer $uid )
Regenerate the authentication token.
Regenerate the authentication token.
Parameters
- $uid
- The ID of the user to regenerate.
Returns
array Array of user data and state.
Overrides
|
public
boolean
|
#
change( integer $uid, string $what, string $value )
Change a field.
Parameters
- $uid
- The ID of the user to update.
- $what
- What to change (passwd,username,email,tz, state, displayname,authkey,bio)
- $value
- The new value to set, for passwd is the MD5 of the password.
Returns
boolean true if the change has been made; else false/null.
Overrides
|
public
boolean
|
#
check( string $what, string $value )
Check for the presence of a username or email address.
Check for the presence of a username or email address.
Parameters
- $what
- What to check for (username, email)
- $value
- The value to check for.
Returns
boolean true if a user exists that matches the check; else false.
Overrides
|
public
integer
|
#
create( string $username, string $displayName, string $email, string $password, string $state, string $tz, integer $forceID = null, string $bio = '' )
Create a user within the system.
Create a user within the system.
Parameters
- $username
- The username or null if creating an unnamed user.
- $displayName
- The display name for the user.
- $email
- The users email address.
- $password
- The MD5 of the users password.
- $state
- The state to create the user in: 'active','disabled','pending'
- $tz
- The timezone string for the user.
- $forceID
- null to auto assign an ID or the ID to force, only valid for local accounts.
- $bio
- The users bio.
Returns
integer The user id or 0 if the user could not be created.
Overrides
|
public
boolean
|
#
setRoles( integer $uid, array $roles )
Set the roles for a user.
Set the roles for a user.
Parameters
- $uid
- The ID of the user to set the roles for.
- $roles
- Array of role names to set.
Returns
boolean true if the roles were set; else false.
Overrides
|
public
array
|
#
getRoles( integer $uid )
Get the names of the roles assigned to the user.
Get the names of the roles assigned to the user.
Parameters
- $uid
- The ID of the user to get the roles for.
Returns
array Array of role names.
Overrides
|
public
array
|
#
getRolesFromMaster( integer $uid )
Get the names of the roles assigned to the user from the master.
Get the names of the roles assigned to the user from the master.
Parameters
- $uid
- The ID of the user to get the roles for.
Returns
array Array of role names.
|
public
array
|
#
getInfo( integer $uid )
Get the information on a user.
Get the information on a user.
Parameters
- $uid
- The ID of the user to get.
Returns
array The user information or false/null on error.
Overrides
|
public
boolean
|
#
delete( integer $uid )
Delete the user.
Parameters
- $uid
- The ID of the user to delete.
Returns
boolean true if deleted; else false.
Overrides
|
public
boolean
|
#
block( integer $uid, integer $blockedBy, integer $for, string $reason )
Block a user.
Parameters
- $uid
- The id of the user to block.
- $blockedBy
- The id of the user applying the block.
- $for
- The time in days to block the account for or 0 to block forever.
- $reason
- The reason for the block.
Returns
boolean true if the block was applied; else false.
Overrides
|
public
array
|
#
getBlockInfo( integer $uid )
Get the information about a block on a user.
Get the information about a block on a user.
Parameters
- $uid
- The id of the user to get the block information about.
Returns
array Array holding the block information or null if the user is not blocked.
Overrides
|