PHP 클래스 UserModel, vanilla

상속: extends Model
파일 보기 프로젝트 열기: vanilla/vanilla 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$SessionColumns
$UserMegaThreshold The number of users when extreme database optimizations kick in.
$UserThreshold The number of users when database optimizations kick in.

공개 메소드들

메소드 설명
__construct ( ) Class constructor. Defines the related database table name.
addInsertFields ( &$Fields ) Parent override.
addPasswordStrength ( Gdn_Controller $Controller ) Set password strength meter on a form.
approve ( integer $UserID, string $Email ) : boolean Approve a membership applicant.
attributes ( array | object $user ) : array Reliably get the attributes from any user array or object.
ban ( integer $UserID, array $Options ) Manually ban a user.
checkPermission ( mixed $User, mixed $Permission, array $Options = [] ) : boolean Checks the specified user's for the given permission. Returns a boolean value indicating if the action is permitted.
clearCache ( integer | null $UserID, $CacheTypesToClear = null ) : boolean Delete cached data for user.
clearNavigationPreferences ( string $userID = '' ) Clears navigation preferences for a user.
clearPermissions ( ) Clear the permission cache.
clearSectionNavigationPreference ( string $url = '', string $userID = '', boolean $resetSectionPreference = true ) Checks if a url is saved as a navigation preference and if so, deletes it.
compilePermissions ( array $rawPermissions ) : array Take raw permission definitions and create.
confirmEmail ( array | object $User, string $EmailKey ) : boolean Users respond to confirmation emails by clicking a link that takes them here.
connect ( string $UniqueID, string $ProviderKey, array $UserData, array $Options = [] ) : integer Connect a user with a foreign authentication system.
countEstimate ( ) : integer Approximate the number of users by checking the database table status.
counts ( string $Column, integer | null $UserID = null ) User counts.
decline ( integer $UserID ) : boolean Decline a user's application to join the forum.
definePermissions ( integer $UserID, boolean $Serialize = false ) : array Load and compile user permissions
delete ( $where = [], $options = [] ) Delete a user.
deleteContent ( integer $UserID, array $Options = [], array $Content = [] ) : boolean | integer Delete a user's content across many contexts.
deleteID ( integer $userID, array $options = [] ) Delete a single user.
filterForm ( array $data, boolean $register = false ) : array Filter dangerous fields out of user-submitted data.
fixGender ( string $Value ) : string Force gender to be a verified value.
get ( $OrderFields = '', $OrderDirection = 'asc', $Limit = false, $Offset = false ) : object Default Gdn_Model::get() behavior.
getActiveUsers ( integer $Limit = 5 ) : Gdn_DataSet Get the most recently active users.
getApplicantCount ( ) : integer Get the current number of applicants waiting to be approved.
getApplicants ( ) : Gdn_DataSet Returns all users in the applicant role.
getAttribute ( integer $UserID, string $Attribute, mixed $DefaultValue = false ) : mixed Get an Attribute from a single user.
getAuthentication ( string $UniqueID, string $Provider ) : array | false Get the a user authentication row.
getByEmail ( string $Email ) : array | boolean | stdClass Get user by email address.
getByRole ( integer | string $Role ) : Gdn_DataSet Get users by role.
getByUsername ( string $Username ) : boolean | object Get a user by their username.
getCountLike ( array | boolean $Like = false ) : integer
getCountWhere ( array | false $Where = false ) : integer
getDefaultAvatarUrl ( array $user = [], string $size = 'thumbnail' ) : string Returns the url to the default avatar for a user.
getDelete ( string $Table, array $Where, array &$Data ) Get rows from a table then delete them.
getID ( integer $ID, string | false $DatasetType = false, array $Options = [] ) : array | object | false Get a user by ID.
getIDs ( array $IDs, boolean $SkipCacheQuery = false ) : array
getIPs ( integer $userID ) : array Retrieve IP addresses associated with a user.
getInvitationCount ( integer $UserID ) : integer Get number of available invites a user has.
getLike ( boolean $Like = false, string $OrderFields = '', string $OrderDirection = 'asc', boolean $Limit = false, boolean $Offset = false ) : Gdn_DataSet
getMeta ( integer $UserID, string $Key, string $Prefix = '', string $Default = '' ) : array Retries UserMeta information for a UserID / Key pair.
getPermissions ( integer $userID ) : Vanilla\Permissions Get a user's permissions.
getPermissionsIncrement ( ) : boolean | integer | mixed
getRoles ( integer $userID ) : Gdn_DataSet Get the roles for a user.
getSession ( integer $UserID, boolean $Refresh = false ) : array | object | false
getSummary ( string $OrderFields = '', string $OrderDirection = 'asc', boolean $Limit = false, boolean $Offset = false ) : array | null Retrieve a summary of "safe" user information for external API calls.
getSystemUserID ( ) : integer Retrieves a "system user" id that can be used to perform non-real-person tasks.
getUserFromCache ( string | integer $UserToken, string $TokenType ) : array | false Get a user from the cache by name or ID
givePoints ( integer $UserID, integer $Points, string $Source = 'Other', integer | false $Timestamp = false ) Add points to a user's total.
increaseInviteCount ( integer $UserID, integer $IncreaseBy = 1 ) Increases the user's CountInvitations value by the specified amount.
insertForApproval ( array $FormPostValues, array $Options = [] ) : integer To be used for approval registration.
insertForBasic ( array $FormPostValues, boolean $CheckCaptcha = true, array $Options = [] ) : boolean | integer | string To be used for basic registration, and captcha registration.
insertForInvite ( array $FormPostValues, array $Options = [] ) : integer To be used for invitation registration.
joinUsers ( array | Gdn_DataSet &$Data, array $Columns, array $Options = [] ) Add user data to a result set.
merge ( integer $OldUserID, integer $NewUserID ) Merge the old user into the new user.
newUserRoleIDs ( ) : array
noEmail ( ) : boolean Whether or not users have email addresses.
passwordRequest ( string $Email ) : boolean Send forgot password email.
passwordReset ( integer $UserID, string $Password ) : array | false Do a password reset.
pastUserMegaThreshold ( ) : boolean Whether we're wandered into extreme database optimization territory with our user count.
pastUserThreshold ( ) : boolean Whether or not we are past the user threshold.
profileCount ( integer | string | object $User, string $Column ) : integer | false Get a user's counter.
rateLimit ( array $User, boolean $PasswordOK ) Check and apply login rate limiting
reduceInviteCount ( integer $UserID, integer $ReduceBy = 1 ) Reduces the user's CountInvitations value by the specified amount.
register ( array $FormPostValues, array $Options = [] ) : boolean | integer | string Register a new user.
removePicture ( integer $UserID ) Remove the photo from a user.
requireConfirmEmail ( ) : boolean Whether or not the application requires email confirmation.
save ( array $FormPostValues, array $Settings = [] ) Generic save procedure.
saveAbout ( integer $UserID, string $About ) Saves the user's About field.
saveAdminUser ( array $FormPostValues ) Create an admin user account.
saveAttribute ( integer $UserID, mixed $Attribute, mixed $Value = '' ) Saves a user attribute to the database.
saveAuthentication ( array $Data ) : Gdn_DataSet | string
saveIP ( integer $userID, string $IP, string $dateUpdated = false ) : boolean Record an IP address for a user.
savePreference ( integer $UserID, mixed $Preference, mixed $Value = '' ) Saves a user preference to the database.
saveRoles ( integer $UserID, array $RoleIDs, boolean $RecordEvent )
saveToSerializedColumn ( string $Column, integer $UserID, mixed $Name, mixed $Value = '' ) Saves a name/value to the user's specified $Column.
search ( array | string $Filter, string $OrderFields = '', string $OrderDirection = 'asc', boolean $Limit = false, boolean $Offset = false ) : Gdn_DataSet Search users.
searchCount ( array | string $Filter = '' ) : integer Count search results.
sendEmailConfirmationEmail ( integer | string | null $User = null, boolean $Force = false ) Send the confirmation email.
sendPasswordEmail ( integer $UserID, string $Password ) Send password email.
sendWelcomeEmail ( integer $UserID, string $Password, string $RegisterType = 'Add', array | null $AdditionalData = null ) Send welcome email to user.
setCalculatedFields ( &$User ) Set fields that need additional manipulation after retrieval.
setField ( integer $RowID, array | string $Property, boolean $Value = false ) : boolean Set a single user property.
setMeta ( integer $UserID, array $Meta, string $Prefix = '' )
setTransientKey ( integer $UserID, string $ExplicitKey = '' ) : string Set the TransientKey attribute on a user.
signinLabelCode ( ) : string
sso ( string $String, boolean $ThrowError = false ) : integer | void Initiate an SSO connection.
syncUser ( array | integer $CurrentUser, array $NewUser, boolean $Force = false ) Sync user data.
synchUser ( array | integer $CurrentUser, array $NewUser, boolean $Force = false ) Sync user data.
synchronize ( string $UserKey, array $Data ) : integer Synchronizes the user based on a given UserKey.
tagSearch ( string $Search, integer $Limit = 10 ) A simple search for tag queries.
unBan ( integer $UserID, array $Options = [] ) Unban a user.
updateUserCache ( integer $UserID, string | array $Field, mixed | null $Value = null )
updateVisit ( integer $UserID, string | integer | float $ClientHour = false ) Updates visit level information such as date last active and the user's ip address.
userCache ( array $User, $UserID = null ) : boolean Cache a user.
userCacheRoles ( integer $userID, array $roleIDs ) : boolean Cache a user's roles.
userQuery ( boolean $SafeData = false ) Query the user table.
validate ( array $FormPostValues, boolean $Insert = false ) : boolean | array Validate submitted user data.
validateCredentials ( string $Email = '', $ID, string $Password ) : object | false Validate User Credential.
validateSpamRegistration ( array $User ) : boolean | string
validateUniqueFields ( string $Username, string $Email, string $UserID = '', boolean $Return = false ) : array | boolean Checks to see if $Username and $Email are already in use by another member.

보호된 메소드들

메소드 설명
getEmailWelcome ( string $registerType, object | array $user, array $data, string $password = '' ) : string Resolves the welcome email format. Maintains backwards compatibility with the 'EmailWelcome*' translations for overriding.
lookupRoleIDs ( array $Roles ) : array
mergeFinish ( integer $MergeID ) Finish merging user accounts.

비공개 메소드들

메소드 설명
addEmailHeaderFooter ( string $Message, array $Data ) : string Deprecated.
addIpFilters ( string $ip, array $fields = [] ) Appends filters to the current SQL object. Filters users with a given IP Address in the UserIP table. Extends filtering to IPs in the GDN_User table for any fields passed in the $fields param.
givePointsInternal ( integer $UserID, integer $Points, string $SlotType, string $Source = 'Total', integer $CategoryID, integer | false $Timestamp = false ) Add points to a user's total in a specific time slot.
insertInternal ( array $Fields, array $Options = [] ) : integer | false A convenience method to be called when inserting users.
mergeCopy ( integer $MergeID, string $Table, string $Column, integer $OldUserID, integer $NewUserID, string $PK = '' ) Backup user before merging.
mergeStart ( integer $OldUserID, integer $NewUserID ) : integer | null Start merging user accounts.

메소드 상세

__construct() 공개 메소드

Class constructor. Defines the related database table name.
public __construct ( )

addInsertFields() 공개 메소드

Parent override.
public addInsertFields ( &$Fields )

addPasswordStrength() 공개 메소드

Set password strength meter on a form.
public addPasswordStrength ( Gdn_Controller $Controller )
$Controller Gdn_Controller The controller to add the password strength information to.

approve() 공개 메소드

Approve a membership applicant.
public approve ( integer $UserID, string $Email ) : boolean
$UserID integer
$Email string
리턴 boolean

attributes() 공개 정적인 메소드

Reliably get the attributes from any user array or object.
public static attributes ( array | object $user ) : array
$user array | object The user to get the attributes for.
리턴 array Returns an attribute array.

ban() 공개 메소드

Manually ban a user.
public ban ( integer $UserID, array $Options )
$UserID integer The ID of the user to ban.
$Options array Additional options for the ban.

checkPermission() 공개 메소드

Checks the specified user's for the given permission. Returns a boolean value indicating if the action is permitted.
public checkPermission ( mixed $User, mixed $Permission, array $Options = [] ) : boolean
$User mixed The user to check.
$Permission mixed The permission (or array of permissions) to check.
$Options array Not used.
리턴 boolean

clearCache() 공개 메소드

Delete cached data for user.
public clearCache ( integer | null $UserID, $CacheTypesToClear = null ) : boolean
$UserID integer | null The user to clear the cache for.
리턴 boolean Returns **true** if the cache was cleared or **false** otherwise.

clearNavigationPreferences() 공개 메소드

Clears navigation preferences for a user.
public clearNavigationPreferences ( string $userID = '' )
$userID string Optional - defaults to sessioned user

clearPermissions() 공개 메소드

Clear the permission cache.
public clearPermissions ( )

clearSectionNavigationPreference() 공개 메소드

Also optionally resets the section dashboard landing page, which may be desirable if a user no longer has permission to access pages in that section.
public clearSectionNavigationPreference ( string $url = '', string $userID = '', boolean $resetSectionPreference = true )
$url string The url to search the user navigation preferences for, defaults to the request
$userID string The ID of the user to clear the preferences for, defaults to the sessioned user
$resetSectionPreference boolean Whether to reset the dashboard section landing page

compilePermissions() 공개 정적인 메소드

Take raw permission definitions and create.
public static compilePermissions ( array $rawPermissions ) : array
$rawPermissions array Database rows from the permissions table.
리턴 array Compiled permissions

confirmEmail() 공개 메소드

Users respond to confirmation emails by clicking a link that takes them here.
public confirmEmail ( array | object $User, string $EmailKey ) : boolean
$User array | object The user confirming their email.
$EmailKey string The token that was emailed to the user.
리턴 boolean Returns **true** if the email was confirmed.

connect() 공개 메소드

Connect a user with a foreign authentication system.
public connect ( string $UniqueID, string $ProviderKey, array $UserData, array $Options = [] ) : integer
$UniqueID string The user's unique key in the other authentication system.
$ProviderKey string The key of the system providing the authentication.
$UserData array Data to go in the user table.
$Options array Additional connect options.
리턴 integer The new/existing user ID.

countEstimate() 공개 메소드

Approximate the number of users by checking the database table status.
public countEstimate ( ) : integer
리턴 integer

counts() 공개 메소드

User counts.
public counts ( string $Column, integer | null $UserID = null )
$Column string The name of the count column. (ex. CountDiscussions, CountComments).
$UserID integer | null The user ID to get the counts for or **null** for the current user.

decline() 공개 메소드

Decline a user's application to join the forum.
public decline ( integer $UserID ) : boolean
$UserID integer
리턴 boolean

definePermissions() 공개 메소드

Load and compile user permissions
사용 중단: Use UserModel::getPermissions instead.
public definePermissions ( integer $UserID, boolean $Serialize = false ) : array
$UserID integer
$Serialize boolean
리턴 array

delete() 공개 메소드

public delete ( $where = [], $options = [] )

deleteContent() 공개 메소드

Delete a user's content across many contexts.
public deleteContent ( integer $UserID, array $Options = [], array $Content = [] ) : boolean | integer
$UserID integer
$Options array
$Content array
리턴 boolean | integer

deleteID() 공개 메소드

Delete a single user.
public deleteID ( integer $userID, array $options = [] )
$userID integer The user to delete.
$options array See {@link UserModel::deleteContent()}, and {@link UserModel::getDelete()}.

filterForm() 공개 메소드

Filter dangerous fields out of user-submitted data.
public filterForm ( array $data, boolean $register = false ) : array
$data array The data to filter.
$register boolean Whether or not this is a registration.
리턴 array Returns a filtered version of {@link $data}.

fixGender() 공개 정적인 메소드

Force gender to be a verified value.
public static fixGender ( string $Value ) : string
$Value string The gender string.
리턴 string

get() 공개 메소드

Prior to 2.0.18 it incorrectly behaved like GetID. This method can be deleted entirely once it's been deprecated long enough.
public get ( $OrderFields = '', $OrderDirection = 'asc', $Limit = false, $Offset = false ) : object
리턴 object DataSet

getActiveUsers() 공개 메소드

Get the most recently active users.
public getActiveUsers ( integer $Limit = 5 ) : Gdn_DataSet
$Limit integer The number of users to return.
리턴 Gdn_DataSet Returns a list of users.

getApplicantCount() 공개 메소드

Get the current number of applicants waiting to be approved.
public getApplicantCount ( ) : integer
리턴 integer Returns the number of applicants or 0 if the registration method isn't set to approval.

getApplicants() 공개 메소드

Returns all users in the applicant role.
public getApplicants ( ) : Gdn_DataSet
리턴 Gdn_DataSet Returns a data set of the users who are applicants.

getAttribute() 공개 메소드

Get an Attribute from a single user.
public getAttribute ( integer $UserID, string $Attribute, mixed $DefaultValue = false ) : mixed
$UserID integer
$Attribute string
$DefaultValue mixed
리턴 mixed

getAuthentication() 공개 메소드

Get the a user authentication row.
public getAuthentication ( string $UniqueID, string $Provider ) : array | false
$UniqueID string The unique ID of the user in the foreign authentication scheme.
$Provider string The key of the provider.
리턴 array | false

getByEmail() 공개 메소드

Get user by email address.
public getByEmail ( string $Email ) : array | boolean | stdClass
$Email string The email address of the user.
리턴 array | boolean | stdClass Returns the user or **false** if they don't exist.

getByRole() 공개 메소드

Get users by role.
public getByRole ( integer | string $Role ) : Gdn_DataSet
$Role integer | string The ID or name of the role.
리턴 Gdn_DataSet Returns the users with the given role.

getByUsername() 공개 메소드

Get a user by their username.
public getByUsername ( string $Username ) : boolean | object
$Username string The username of the user.
리턴 boolean | object Returns the user or **false** if they don't exist.

getCountLike() 공개 메소드

public getCountLike ( array | boolean $Like = false ) : integer
$Like array | boolean
리턴 integer

getCountWhere() 공개 메소드

public getCountWhere ( array | false $Where = false ) : integer
$Where array | false
리턴 integer

getDefaultAvatarUrl() 공개 정적인 메소드

Returns the url to the default avatar for a user.
public static getDefaultAvatarUrl ( array $user = [], string $size = 'thumbnail' ) : string
$user array The user to get the default avatar for.
$size string The size of avatar to return (only respected for dashboard-uploaded default avatars).
리턴 string The url to the default avatar image.

getDelete() 공개 메소드

Get rows from a table then delete them.
부터: 2.1
public getDelete ( string $Table, array $Where, array &$Data )
$Table string The name of the table.
$Where array The where condition for the delete.
$Data array The data to put the result.

getEmailWelcome() 보호된 메소드

Resolves the welcome email format. Maintains backwards compatibility with the 'EmailWelcome*' translations for overriding.
protected getEmailWelcome ( string $registerType, object | array $user, array $data, string $password = '' ) : string
$registerType string The registration type. One of 'Connect', 'Register' or 'Add'.
$user object | array The user to send the email to.
$data array The email data.
$password string The user's password.
리턴 string The welcome email for the registration type.

getID() 공개 메소드

Get a user by ID.
public getID ( integer $ID, string | false $DatasetType = false, array $Options = [] ) : array | object | false
$ID integer The ID of the user.
$DatasetType string | false Whether to return an array or object.
$Options array Additional options to affect fetching. Currently unused.
리턴 array | object | false Returns the user or **false** if the user wasn't found.

getIDs() 공개 메소드

public getIDs ( array $IDs, boolean $SkipCacheQuery = false ) : array
$IDs array
$SkipCacheQuery boolean
리턴 array

getIPs() 공개 메소드

Retrieve IP addresses associated with a user.
public getIPs ( integer $userID ) : array
$userID integer Unique ID for a user.
리턴 array IP addresses for the user.

getInvitationCount() 공개 메소드

Get number of available invites a user has.
public getInvitationCount ( integer $UserID ) : integer
$UserID integer
리턴 integer

getLike() 공개 메소드

public getLike ( boolean $Like = false, string $OrderFields = '', string $OrderDirection = 'asc', boolean $Limit = false, boolean $Offset = false ) : Gdn_DataSet
$Like boolean
$OrderFields string
$OrderDirection string
$Limit boolean
$Offset boolean
리턴 Gdn_DataSet

getMeta() 공개 정적인 메소드

This method takes a $UserID or array of $UserIDs, and a $Key. It converts the $Key to fully qualified format and then queries for the associated value(s). $Key can contain SQL wildcards, in which case multiple results can be returned. If $UserID is an array, the return value will be a multi dimensional array with the first axis containing UserIDs and the second containing fully qualified UserMetaKeys, associated with their values. If $UserID is a scalar, the return value will be a single dimensional array of $UserMetaKey => $Value pairs.
public static getMeta ( integer $UserID, string $Key, string $Prefix = '', string $Default = '' ) : array
$UserID integer UserID or array of UserIDs.
$Key string Relative user meta key.
$Prefix string
$Default string
리턴 array results or $Default

getPermissions() 공개 메소드

Get a user's permissions.
public getPermissions ( integer $userID ) : Vanilla\Permissions
$userID integer Unique ID of the user.
리턴 Vanilla\Permissions

getPermissionsIncrement() 공개 메소드

getRoles() 공개 메소드

Get the roles for a user.
public getRoles ( integer $userID ) : Gdn_DataSet
$userID integer The user to get the roles for.
리턴 Gdn_DataSet Returns the roles as a dataset (with array values).

getSession() 공개 메소드

public getSession ( integer $UserID, boolean $Refresh = false ) : array | object | false
$UserID integer
$Refresh boolean
리턴 array | object | false

getSummary() 공개 메소드

Retrieve a summary of "safe" user information for external API calls.
public getSummary ( string $OrderFields = '', string $OrderDirection = 'asc', boolean $Limit = false, boolean $Offset = false ) : array | null
$OrderFields string
$OrderDirection string
$Limit boolean
$Offset boolean
리턴 array | null

getSystemUserID() 공개 메소드

Retrieves a "system user" id that can be used to perform non-real-person tasks.
public getSystemUserID ( ) : integer
리턴 integer Returns a user ID.

getUserFromCache() 공개 메소드

Get a user from the cache by name or ID
public getUserFromCache ( string | integer $UserToken, string $TokenType ) : array | false
$UserToken string | integer either a userid or a username
$TokenType string either 'userid' or 'name'
리턴 array | false Returns a user array or **false** if the user isn't in the cache.

givePoints() 공개 정적인 메소드

Add points to a user's total.
부터: 2.1.0
public static givePoints ( integer $UserID, integer $Points, string $Source = 'Other', integer | false $Timestamp = false )
$UserID integer
$Points integer
$Source string
$Timestamp integer | false

increaseInviteCount() 공개 메소드

Increases the user's CountInvitations value by the specified amount.
public increaseInviteCount ( integer $UserID, integer $IncreaseBy = 1 )
$UserID integer The unique id of the user being affected.
$IncreaseBy integer The number to increase CountInvitations by.

insertForApproval() 공개 메소드

To be used for approval registration.
public insertForApproval ( array $FormPostValues, array $Options = [] ) : integer
$FormPostValues array
$Options array
리턴 integer UserID.

insertForBasic() 공개 메소드

To be used for basic registration, and captcha registration.
public insertForBasic ( array $FormPostValues, boolean $CheckCaptcha = true, array $Options = [] ) : boolean | integer | string
$FormPostValues array
$CheckCaptcha boolean
$Options array
리턴 boolean | integer | string

insertForInvite() 공개 메소드

To be used for invitation registration.
public insertForInvite ( array $FormPostValues, array $Options = [] ) : integer
$FormPostValues array
$Options array
리턴 integer UserID.

joinUsers() 공개 메소드

Add user data to a result set.
public joinUsers ( array | Gdn_DataSet &$Data, array $Columns, array $Options = [] )
$Data array | Gdn_DataSet Results we need to associate user data with.
$Columns array Database columns containing UserIDs to get data for.
$Options array Optionally pass list of user data to collect with key 'Join'.

lookupRoleIDs() 보호된 메소드

protected lookupRoleIDs ( array $Roles ) : array
$Roles array
리턴 array

merge() 공개 메소드

Merge the old user into the new user.
public merge ( integer $OldUserID, integer $NewUserID )
$OldUserID integer The ID of the old user.
$NewUserID integer The ID of the new user.

mergeFinish() 보호된 메소드

Finish merging user accounts.
protected mergeFinish ( integer $MergeID )
$MergeID integer The merge table ID.

newUserRoleIDs() 공개 메소드

public newUserRoleIDs ( ) : array
리턴 array

noEmail() 공개 정적인 메소드

Whether or not users have email addresses.
public static noEmail ( ) : boolean
리턴 boolean

passwordRequest() 공개 메소드

Send forgot password email.
public passwordRequest ( string $Email ) : boolean
$Email string
리턴 boolean

passwordReset() 공개 메소드

Do a password reset.
public passwordReset ( integer $UserID, string $Password ) : array | false
$UserID integer
$Password string
리턴 array | false Returns the user or **false** if the user doesn't exist.

pastUserMegaThreshold() 공개 메소드

Whether we're wandered into extreme database optimization territory with our user count.
public pastUserMegaThreshold ( ) : boolean
리턴 boolean

pastUserThreshold() 공개 메소드

This is a useful indication that some database operations on the User table will be painfully long.
public pastUserThreshold ( ) : boolean
리턴 boolean

profileCount() 공개 메소드

Get a user's counter.
public profileCount ( integer | string | object $User, string $Column ) : integer | false
$User integer | string | object
$Column string
리턴 integer | false

rateLimit() 공개 정적인 메소드

Check and apply login rate limiting
public static rateLimit ( array $User, boolean $PasswordOK )
$User array
$PasswordOK boolean

reduceInviteCount() 공개 메소드

Reduces the user's CountInvitations value by the specified amount.
public reduceInviteCount ( integer $UserID, integer $ReduceBy = 1 )
$UserID integer The unique id of the user being affected.
$ReduceBy integer The number to reduce CountInvitations by.

register() 공개 메소드

Register a new user.
public register ( array $FormPostValues, array $Options = [] ) : boolean | integer | string
$FormPostValues array
$Options array
리턴 boolean | integer | string

removePicture() 공개 메소드

Remove the photo from a user.
public removePicture ( integer $UserID )
$UserID integer

requireConfirmEmail() 공개 정적인 메소드

Whether or not the application requires email confirmation.
public static requireConfirmEmail ( ) : boolean
리턴 boolean

save() 공개 메소드

Generic save procedure.
public save ( array $FormPostValues, array $Settings = [] )
$FormPostValues array The user to save.
$Settings array Controls certain save functionality. - SaveRoles - Save 'RoleID' field as user's roles. Default false. - HashPassword - Hash the provided password on update. Default true. - FixUnique - Try to resolve conflicts with unique constraints on Name and Email. Default false. - ValidateEmail - Make sure the provided email addresses is formatted properly. Default true. - NoConfirmEmail - Disable email confirmation. Default false.

saveAbout() 공개 메소드

Saves the user's About field.
public saveAbout ( integer $UserID, string $About )
$UserID integer The UserID to save.
$About string The about message being saved.

saveAdminUser() 공개 메소드

Create an admin user account.
public saveAdminUser ( array $FormPostValues )
$FormPostValues array

saveAttribute() 공개 메소드

This is a convenience method that uses $this->SaveToSerializedColumn().
public saveAttribute ( integer $UserID, mixed $Attribute, mixed $Value = '' )
$UserID integer The UserID to save.
$Attribute mixed The name of the attribute being saved, or an associative array of name => value pairs to be saved. If this is an associative array, the $Value argument will be ignored.
$Value mixed The value being saved.

saveAuthentication() 공개 메소드

public saveAuthentication ( array $Data ) : Gdn_DataSet | string
$Data array
리턴 Gdn_DataSet | string

saveIP() 공개 메소드

Record an IP address for a user.
public saveIP ( integer $userID, string $IP, string $dateUpdated = false ) : boolean
$userID integer Unique ID of the user.
$IP string Human-readable IP address.
$dateUpdated string Force an update timesetamp.
리턴 boolean Was the operation successful?

savePreference() 공개 메소드

This is a convenience method that uses $this->SaveToSerializedColumn().
public savePreference ( integer $UserID, mixed $Preference, mixed $Value = '' )
$UserID integer The UserID to save.
$Preference mixed The name of the preference being saved, or an associative array of name => value pairs to be saved. If this is an associative array, the $Value argument will be ignored.
$Value mixed The value being saved.

saveRoles() 공개 메소드

public saveRoles ( integer $UserID, array $RoleIDs, boolean $RecordEvent )
$UserID integer
$RoleIDs array
$RecordEvent boolean

saveToSerializedColumn() 공개 메소드

This method throws exceptions when errors are encountered. Use try catch blocks to capture these exceptions.
public saveToSerializedColumn ( string $Column, integer $UserID, mixed $Name, mixed $Value = '' )
$Column string The name of the serialized column to save to. At the time of this writing there are three serialized columns on the user table: Permissions, Preferences, and Attributes.
$UserID integer The UserID to save.
$Name mixed The name of the value being saved, or an associative array of name => value pairs to be saved. If this is an associative array, the $Value argument will be ignored.
$Value mixed The value being saved.

searchCount() 공개 메소드

Count search results.
public searchCount ( array | string $Filter = '' ) : integer
$Filter array | string
리턴 integer

sendEmailConfirmationEmail() 공개 메소드

Send the confirmation email.
public sendEmailConfirmationEmail ( integer | string | null $User = null, boolean $Force = false )
$User integer | string | null
$Force boolean

sendPasswordEmail() 공개 메소드

Send password email.
public sendPasswordEmail ( integer $UserID, string $Password )
$UserID integer
$Password string

sendWelcomeEmail() 공개 메소드

Send welcome email to user.
public sendWelcomeEmail ( integer $UserID, string $Password, string $RegisterType = 'Add', array | null $AdditionalData = null )
$UserID integer
$Password string
$RegisterType string
$AdditionalData array | null

setCalculatedFields() 공개 메소드

Set fields that need additional manipulation after retrieval.
public setCalculatedFields ( &$User )

setField() 공개 메소드

Set a single user property.
public setField ( integer $RowID, array | string $Property, boolean $Value = false ) : boolean
$RowID integer
$Property array | string
$Value boolean
리턴 boolean

setMeta() 공개 정적인 메소드

public static setMeta ( integer $UserID, array $Meta, string $Prefix = '' )
$UserID integer
$Meta array
$Prefix string

setTransientKey() 공개 메소드

Set the TransientKey attribute on a user.
public setTransientKey ( integer $UserID, string $ExplicitKey = '' ) : string
$UserID integer
$ExplicitKey string
리턴 string

signinLabelCode() 공개 정적인 메소드

public static signinLabelCode ( ) : string
리턴 string

sso() 공개 메소드

Initiate an SSO connection.
public sso ( string $String, boolean $ThrowError = false ) : integer | void
$String string
$ThrowError boolean
리턴 integer | void

syncUser() 공개 메소드

Sync user data.
부터: 2.1
public syncUser ( array | integer $CurrentUser, array $NewUser, boolean $Force = false )
$CurrentUser array | integer
$NewUser array Data to overwrite user with.
$Force boolean

synchUser() 공개 메소드

Sync user data.
사용 중단: since 2.2.
부터: 2.1
public synchUser ( array | integer $CurrentUser, array $NewUser, boolean $Force = false )
$CurrentUser array | integer
$NewUser array Data to overwrite user with.
$Force boolean

synchronize() 공개 메소드

Synchronizes the user based on a given UserKey.
public synchronize ( string $UserKey, array $Data ) : integer
$UserKey string A string that uniquely identifies this user.
$Data array Information to put in the user table.
리턴 integer The ID of the user.

tagSearch() 공개 메소드

A simple search for tag queries.
부터: 2.2
public tagSearch ( string $Search, integer $Limit = 10 )
$Search string
$Limit integer

unBan() 공개 메소드

Unban a user.
부터: 2.1
public unBan ( integer $UserID, array $Options = [] )
$UserID integer The user to unban.
$Options array Options for the unban.

updateUserCache() 공개 메소드

public updateUserCache ( integer $UserID, string | array $Field, mixed | null $Value = null )
$UserID integer
$Field string | array
$Value mixed | null

updateVisit() 공개 메소드

Updates visit level information such as date last active and the user's ip address.
public updateVisit ( integer $UserID, string | integer | float $ClientHour = false )
$UserID integer
$ClientHour string | integer | float

userCache() 공개 메소드

Cache a user.
public userCache ( array $User, $UserID = null ) : boolean
$User array The user to cache.
리턴 boolean Returns **true** if the user was cached or **false** otherwise.

userCacheRoles() 공개 메소드

Cache a user's roles.
public userCacheRoles ( integer $userID, array $roleIDs ) : boolean
$userID integer The ID of a user to cache roles for.
$roleIDs array A collection of role IDs with the specified user.
리턴 boolean Was the caching operation successful?

userQuery() 공개 메소드

Query the user table.
public userQuery ( boolean $SafeData = false )
$SafeData boolean Makes sure that the query does not return any sensitive information about the user. (password, attributes, preferences, etc).

validate() 공개 메소드

Validate submitted user data.
public validate ( array $FormPostValues, boolean $Insert = false ) : boolean | array
$FormPostValues array
$Insert boolean
리턴 boolean | array

validateCredentials() 공개 메소드

Fetches a user row by email (or name) and compare the password. If the password was not stored as a blowfish hash, the password will be saved again. Return the user's id, admin status and attributes.
public validateCredentials ( string $Email = '', $ID, string $Password ) : object | false
$Email string
$Password string
리턴 object | false Returns the user matching the credentials or **false** if the user doesn't validate.

validateSpamRegistration() 공개 메소드

부터: 2.1
public validateSpamRegistration ( array $User ) : boolean | string
$User array
리턴 boolean | string

validateUniqueFields() 공개 메소드

Checks to see if $Username and $Email are already in use by another member.
public validateUniqueFields ( string $Username, string $Email, string $UserID = '', boolean $Return = false ) : array | boolean
$Username string
$Email string
$UserID string
$Return boolean
리턴 array | boolean

프로퍼티 상세

$SessionColumns 공개적으로 프로퍼티

public $SessionColumns

$UserMegaThreshold 공개적으로 프로퍼티

The number of users when extreme database optimizations kick in.
public $UserMegaThreshold

$UserThreshold 공개적으로 프로퍼티

The number of users when database optimizations kick in.
public $UserThreshold