PHP 클래스 Airship\Cabin\Bridge\Blueprint\UserAccounts

Manage user accounts
상속: extends BlueprintGear, use trait SecurityBolt
파일 보기 프로젝트 열기: paragonie/airship 1 사용 예제들

공개 메소드들

메소드 설명
countPublicUsers ( ) : integer Get the number of users with a public profile.
createGroup ( array $post = [] ) : boolean Create a new user group
createRecoveryToken ( integer $userID ) : string
createSessionCanary ( integer $userID ) : string
createUser ( array $post = [] ) : integer Create a new user account
deleteGroup ( integer $groupId, integer $newParent ) : boolean
deleteRecoveryToken ( string $selector ) : boolean
deleteUser ( integer $userId ) : boolean
editGroup ( integer $groupId, array $post = [] ) : boolean Edit a group.
editUser ( integer $userId, array $post = [] ) : boolean Edit a user's account information
editUserCustomFields ( integer $userId, string $customFields = '[]' ) : boolean Only change the custom fields.
getDirectory ( integer $offset, integer $limit = 20 ) : array Get the user directory.
getGroup ( integer $groupId ) : array
getGroupChildren ( integer $groupId ) : array Get all of the group IDs (not the contents) of a group's children
getGroupTree ( integer $parent, string $column = 'children', array $seen = [] ) : array Get the group tree
getRecoveryData ( string $selector, integer $maxTokenLife ) : array Get the data necessary to recover an account.
getRecoveryInfo ( string $username ) : array Get account recovery information
getTwoFactorSecret ( integer $userID ) : string Get the user's two-factor authentication secret
getUniqueId ( integer $userId ) : string Get a user's unique ID
getUserAccount ( integer $userId, boolean $includeExtra = false ) : array Get a user account given a user ID
getUserByUsername ( string $username, boolean $includeExtra = false ) : array Get a user account, given a username
getUserIDByUsername ( string $username ) : integer
getUserPreferences ( integer $userId ) : array Get a user's preferences
getUsersGroups ( integer $userId ) : array Get all the groups that a user belongs to.
invalidateLongTermAuthTokens ( integer $userID ) : boolean All long-term authentication tokens will be rendered invalid.
isPasswordWeak ( array $post ) : boolean Is this password too weak?
isUsernameInvalid ( string $username ) : boolean Is this username invalid? Currently not implemented but might be in the final version.
isUsernameTaken ( string $username ) : boolean Is the username already taken by another account?
listUsers ( integer $offset, integer $limit, string $sortBy = 'userid', string $dir = 'ASC' ) : array List users
numUsers ( ) : integer How many users exist?
resetTwoFactorSecret ( integer $userID ) : boolean Get the user's two-factor authentication secret
setPassphrase ( HiddenString $passphrase, integer $accountId ) : boolean Reset a user's passphrase
toggleTwoFactor ( integer $userID, array $post ) : boolean Save the user's two-factor-authentication preferences
updateAccountInfo ( array $post, array $account ) : mixed Update the user's account information
updatePreferences ( integer $userId, array $preferences = [] ) : boolean Store preferences for a user

보호된 메소드들

메소드 설명
deleteGroupCascade ( integer $groupId ) Overloadable in gadgets. Deletes all entries that depend on the group table.
deleteUserCascade ( integer $userId ) Overloadable in gadgets. Deletes all entries that depend on the user table.
generateUniqueId ( ) : string Generate a unique random public ID for this user, which is distinct from the username they use to log in.

메소드 상세

countPublicUsers() 공개 메소드

Get the number of users with a public profile.
public countPublicUsers ( ) : integer
리턴 integer

createGroup() 공개 메소드

Create a new user group
public createGroup ( array $post = [] ) : boolean
$post array
리턴 boolean

createRecoveryToken() 공개 메소드

public createRecoveryToken ( integer $userID ) : string
$userID integer
리턴 string

createSessionCanary() 공개 메소드

public createSessionCanary ( integer $userID ) : string
$userID integer
리턴 string

createUser() 공개 메소드

Create a new user account
public createUser ( array $post = [] ) : integer
$post array
리턴 integer

deleteGroup() 공개 메소드

public deleteGroup ( integer $groupId, integer $newParent ) : boolean
$groupId integer
$newParent integer
리턴 boolean

deleteGroupCascade() 보호된 메소드

Overloadable in gadgets. Deletes all entries that depend on the group table.
protected deleteGroupCascade ( integer $groupId )
$groupId integer

deleteRecoveryToken() 공개 메소드

public deleteRecoveryToken ( string $selector ) : boolean
$selector string
리턴 boolean

deleteUser() 공개 메소드

public deleteUser ( integer $userId ) : boolean
$userId integer
리턴 boolean

deleteUserCascade() 보호된 메소드

Overloadable in gadgets. Deletes all entries that depend on the user table.
protected deleteUserCascade ( integer $userId )
$userId integer

editGroup() 공개 메소드

Edit a group.
public editGroup ( integer $groupId, array $post = [] ) : boolean
$groupId integer
$post array
리턴 boolean

editUser() 공개 메소드

Edit a user's account information
public editUser ( integer $userId, array $post = [] ) : boolean
$userId integer
$post array
리턴 boolean

editUserCustomFields() 공개 메소드

Only change the custom fields.
public editUserCustomFields ( integer $userId, string $customFields = '[]' ) : boolean
$userId integer
$customFields string
리턴 boolean

generateUniqueId() 보호된 메소드

Generate a unique random public ID for this user, which is distinct from the username they use to log in.
protected generateUniqueId ( ) : string
리턴 string

getDirectory() 공개 메소드

Get the user directory.
public getDirectory ( integer $offset, integer $limit = 20 ) : array
$offset integer
$limit integer
리턴 array

getGroup() 공개 메소드

public getGroup ( integer $groupId ) : array
$groupId integer
리턴 array

getGroupChildren() 공개 메소드

Get all of the group IDs (not the contents) of a group's children
public getGroupChildren ( integer $groupId ) : array
$groupId integer
리턴 array

getGroupTree() 공개 메소드

Get the group tree
public getGroupTree ( integer $parent, string $column = 'children', array $seen = [] ) : array
$parent integer
$column string What to call the child element?
$seen array
리턴 array

getRecoveryData() 공개 메소드

Get the data necessary to recover an account.
public getRecoveryData ( string $selector, integer $maxTokenLife ) : array
$selector string
$maxTokenLife integer
리턴 array

getRecoveryInfo() 공개 메소드

Get account recovery information
public getRecoveryInfo ( string $username ) : array
$username string
리턴 array

getTwoFactorSecret() 공개 메소드

Get the user's two-factor authentication secret
public getTwoFactorSecret ( integer $userID ) : string
$userID integer
리턴 string

getUniqueId() 공개 메소드

Get a user's unique ID
public getUniqueId ( integer $userId ) : string
$userId integer
리턴 string

getUserAccount() 공개 메소드

Get a user account given a user ID
public getUserAccount ( integer $userId, boolean $includeExtra = false ) : array
$userId integer
$includeExtra boolean
리턴 array

getUserByUsername() 공개 메소드

Get a user account, given a username
public getUserByUsername ( string $username, boolean $includeExtra = false ) : array
$username string
$includeExtra boolean
리턴 array

getUserIDByUsername() 공개 메소드

public getUserIDByUsername ( string $username ) : integer
$username string
리턴 integer

getUserPreferences() 공개 메소드

Get a user's preferences
public getUserPreferences ( integer $userId ) : array
$userId integer
리턴 array

getUsersGroups() 공개 메소드

Get all the groups that a user belongs to.
public getUsersGroups ( integer $userId ) : array
$userId integer
리턴 array

invalidateLongTermAuthTokens() 공개 메소드

This is usually triggered on a password reset.
public invalidateLongTermAuthTokens ( integer $userID ) : boolean
$userID integer
리턴 boolean

isPasswordWeak() 공개 메소드

Is this password too weak?
public isPasswordWeak ( array $post ) : boolean
$post array
리턴 boolean

isUsernameInvalid() 공개 메소드

Is this username invalid? Currently not implemented but might be in the final version.
public isUsernameInvalid ( string $username ) : boolean
$username string
리턴 boolean

isUsernameTaken() 공개 메소드

Is the username already taken by another account?
public isUsernameTaken ( string $username ) : boolean
$username string
리턴 boolean

listUsers() 공개 메소드

List users
public listUsers ( integer $offset, integer $limit, string $sortBy = 'userid', string $dir = 'ASC' ) : array
$offset integer
$limit integer
$sortBy string
$dir string
리턴 array

numUsers() 공개 메소드

How many users exist?
public numUsers ( ) : integer
리턴 integer

resetTwoFactorSecret() 공개 메소드

Get the user's two-factor authentication secret
public resetTwoFactorSecret ( integer $userID ) : boolean
$userID integer
리턴 boolean

setPassphrase() 공개 메소드

Reset a user's passphrase
public setPassphrase ( HiddenString $passphrase, integer $accountId ) : boolean
$passphrase HiddenString
$accountId integer
리턴 boolean

toggleTwoFactor() 공개 메소드

Save the user's two-factor-authentication preferences
public toggleTwoFactor ( integer $userID, array $post ) : boolean
$userID integer
$post array
리턴 boolean

updateAccountInfo() 공개 메소드

Update the user's account information
public updateAccountInfo ( array $post, array $account ) : mixed
$post array
$account array
리턴 mixed

updatePreferences() 공개 메소드

Store preferences for a user
public updatePreferences ( integer $userId, array $preferences = [] ) : boolean
$userId integer
$preferences array
리턴 boolean