vBulletin 5.6.5 API

vB_Library_User extends vB_Library
in package

vB_Library_User

Tags
access

public

Table of Contents

PASSWORD_RESET_ATTEMPTS  = 10
PASSWORD_RESET_LOCK_MINUTES  = 10
$instance  : mixed
__serialize()  : mixed
__sleep()  : mixed
__unserialize()  : mixed
__wakeup()  : mixed
addSecondaryUserGroups()  : none
Adds groups to a user
buildStatistics()  : mixed
checkCoppa()  : mixed
checkPasswordResetLock()  : mixed
checkPrivacyOption()  : mixed
checkUsernameLibraryInternal()  : mixed
This function is NOT meant for general consumption. For general use, please
cleanIpInfo()  : mixed
Delete the old IP cache data
clearCache()  : mixed
clearChannelPerms()  : mixed
This method clears remembered channel permission
clearUserInfo()  : mixed
Clear user cached info for given userids.
decrementPostCountForUsers()  : none
Update the post count for a list of users.
delete()  : mixed
Delete a user
fetchBannedInfo()  : mixed
Check whether a user is banned and returns info such as reason and liftdate if possible.
fetchModerator()  : array<string|int, mixed>
Fetches an array containing all the moderator permission informationd
fetchOnlineStatus()  : int
Fetches the online states for the user, taking into account the browsing user's viewing permissions. Also modifies the user to include [buddymark] and [invisiblemark]
fetchUserGroups()  : array<string|int, mixed>
Gets the usergroup information. Returns the secondary groups even if allowmembergroups usergroup option is set to No.
fetchUserinfo()  : array<string|int, mixed>
Fetches an array containing info for the specified user, or false if user is not found
fetchUserName()  : string
Fetches the username for a userid
fetchUserNames()  : array<string|int, mixed>
Fetches the user names for the given user ids
fetchUserWithPerms()  : array<string|int, mixed>
Fetches an array containing info for the specified user, or false if user is not found
formatAndValidateBirthday()  : bool
Formats the provided birthday into an array for user API, Library & datamanager consumption and runs sanity checks on the day/month/year values.
generateUserSecret()  : string
Generates a totally random string
getContentInstance()  : mixed
getCustomFields()  : mixed
getDayOfWeekPhrases()  : mixed
getEmailReplacementValues()  : array<string|int, mixed>
Returns the values for the user-related phrase shortcodes, for use in emails.
getGroupInTopic()  : array<string|int, mixed>
This returns a user's additional permissions from the groupintopic table
getIpLocation()  : mixed
Return the location for an IP address
getPersonalData()  : array<string|int, mixed>
Returns a report on "personal information" for a user
getProfileFieldsFromUserInfoArray()  : mixed
getRawCustomFields()  : mixed
getUsertitleFromPosts()  : mixed
incrementPostCountForUsers()  : none
Update the post count for a list of users.
instance()  : vB_PageCache
Returns singleton instance of self.
isBanned()  : bool
Check whether a user is banned.
monitorWords()  : mixed
Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.
needsCoppa()  : int
This checks whether a user needs COPPA approval based on birthdate. Responds to Ajax call
precleanUsername()  : mixed
precleanUsernameRaw()  : mixed
preloadUserInfo()  : mixed
This preloads information for a list of userids, so it will be available for userContext and other data loading
removeSecondaryUserGroups()  : none
Remove groups from a user
save()  : int
Insert or Update an user
sendActivateEmail()  : mixed
Send the activation email to the user
sendPasswordEmail()  : mixed
transferOwnership()  : mixed
Transfers all ownerships (blogs and groups) from given user to another one.
updateEmailFloodTime()  : mixed
updateGuestPrivacyConsent()  : mixed
Updates guest privacy consent
updateLatestUser()  : mixed
This updates the latest user in the statistics so that it stays current.
uploadAvatar()  : mixed
__construct()  : mixed
getLibraryClassNameInternal()  : mixed
buildUserActivationId()  : string
(Re)Generates an Activation ID for a user
checkMonitoredWords()  : mixed
getAllCustomFields()  : mixed
getBaseUserStats()  : mixed
getCustomFieldValue()  : mixed
getGeoipProvider()  : mixed
getProfileFieldInfo()  : mixed
getProfileFieldInfoFromDatastore()  : mixed
getProfileFieldsInternal()  : mixed
groupsExcludedFromLatest()  : mixed
isLocationInList()  : mixed
Return if the given location is in the given list.
scanFile()  : mixed
sendNewUserEmails()  : mixed
setCoppa()  : mixed
setPassword()  : mixed
setUsertitle()  : mixed
updateAvatar()  : mixed
Update avatar
updateBuddylist()  : mixed
updateIfNotExcluded()  : mixed
updateIgnorelist()  : mixed
Updates the user ignore list
updateLadderUserTitle()  : mixed
updateLastestUserInternal()  : mixed
updatePostCountInfo()  : mixed
Update the user post count dependant info for the users identified.
updatePostCountInfoCurrentUser()  : mixed
Updates the post count dependant info for the current user.
userIsModerator()  : mixed

Constants

PASSWORD_RESET_ATTEMPTS

public mixed PASSWORD_RESET_ATTEMPTS = 10

PASSWORD_RESET_LOCK_MINUTES

public mixed PASSWORD_RESET_LOCK_MINUTES = 10

Properties

$instance

protected static mixed $instance = array()

Methods

__serialize()

public __serialize() : mixed
Return values
mixed

__sleep()

public __sleep() : mixed
Return values
mixed

__unserialize()

public __unserialize(mixed $serialized) : mixed
Parameters
$serialized : mixed
Return values
mixed

__wakeup()

public __wakeup() : mixed
Return values
mixed

addSecondaryUserGroups()

Adds groups to a user

public addSecondaryUserGroups(int $userid, array<string|int, mixed> $groups) : none

Will not add a group if it matches the user's primary group is set to that group Will add groups even if allowmembergroups is set to "no". There will be cases where we want to track secondary group changes even if we aren't doing anything with them

Does not validate that the usergroupids are valid

Parameters
$userid : int
$groups : array<string|int, mixed>

list of integer ids for usergroups to add

Return values
none

buildStatistics()

public buildStatistics() : mixed
Return values
mixed

checkCoppa()

public checkCoppa(mixed $user) : mixed
Parameters
$user : mixed
Return values
mixed

checkPasswordResetLock()

public checkPasswordResetLock(array<string|int, mixed> $useractivation) : mixed
Parameters
$useractivation : array<string|int, mixed>

Record to check. Must have 'reset_locked_since'

Return values
mixed

checkPrivacyOption()

public checkPrivacyOption(mixed $option, mixed $userLocationCode) : mixed
Parameters
$option : mixed
$userLocationCode : mixed
Return values
mixed

checkUsernameLibraryInternal()

This function is NOT meant for general consumption. For general use, please

public checkUsernameLibraryInternal(bool $newuser, array<string|int, mixed> $user, array<string|int, mixed> $olduser[, array<string|int, bool> $skipChecks = [] ]) : mixed
Parameters
$newuser : bool

True if this is called during registration

$user : array<string|int, mixed>

Array of incoming user changes

$olduser : array<string|int, mixed>

Existing user data. Empty if $newuser.

$skipChecks : array<string|int, bool> = []

Optional. Following bypasses are available:

  • duplicate -- skip duplicate username check
Tags
see
vB_Api_User::checkUsername()

. This function is public to allow API access due to duplicated checks required as part of vB_Api_User::checkUsername() . Additional "data integrity" checks. Checks that are placed here instead of the user datamanager is intended to allow for bypassing a subset of these checks when calling library save directly. "Library" suffix to distinguish it from the API's checkUsernameInternal().

throws
vB_Exception_Api

with the following possible errors

  • unexpected_error if username is missing when required
  • usernametaken if a different user with specified username already exists
Return values
mixed

cleanIpInfo()

Delete the old IP cache data

public cleanIpInfo() : mixed
Return values
mixed

clearCache()

public static clearCache() : mixed
Return values
mixed

clearChannelPerms()

This method clears remembered channel permission

public clearChannelPerms(int $userid) : mixed
Parameters
$userid : int
Return values
mixed

clearUserInfo()

Clear user cached info for given userids.

public clearUserInfo(mixed $userids) : mixed

There's currently cached info in several places (vB_Session, vB_User and vB_Cache implementations) this makes sure they all properly cleared.

Parameters
$userids : mixed
Return values
mixed

decrementPostCountForUsers()

Update the post count for a list of users.

public decrementPostCountForUsers(mixed $userInfo) : none

The simple case is one user and one post, but if we do a large operation -- for example deleting a topic -- we can cause a number of posts to be "uncounted" for a number of users (and have more than one "new" post per user). We batch the call for all affected users because it allows us to avoid

Parameters
$userInfo : mixed
Return values
none

delete()

Delete a user

public delete(int $userid[, bool $transfer_groups = true ][, int $transferee = null ]) : mixed
Parameters
$userid : int

The ID of user to be deleted

$transfer_groups : bool = true

Whether to transfer the Groups and Blogs owned by the user to $transferee

$transferee : int = null

ID of user that will receive the groups & blogs owned by deleted user.

Return values
mixed

fetchBannedInfo()

Check whether a user is banned and returns info such as reason and liftdate if possible.

public fetchBannedInfo(int $userid) : mixed
Parameters
$userid : int
Tags
retun

array -- ban liftdate and reason or false is user is not banned.

Return values
mixed

fetchModerator()

Fetches an array containing all the moderator permission informationd

public fetchModerator(int $userid[, mixed $moderators = false ]) : array<string|int, mixed>
Parameters
$userid : int
$moderators : mixed = false
Return values
array<string|int, mixed>

the permission array

fetchOnlineStatus()

Fetches the online states for the user, taking into account the browsing user's viewing permissions. Also modifies the user to include [buddymark] and [invisiblemark]

public fetchOnlineStatus(mixed &$user) : int
Parameters
$user : mixed
Return values
int

0 = offline, 1 = online, 2 = online but invisible (if permissions allow)

fetchUserGroups()

Gets the usergroup information. Returns the secondary groups even if allowmembergroups usergroup option is set to No.

public fetchUserGroups(mixed $userid) : array<string|int, mixed>
Parameters
$userid : mixed
Tags
throws
vB_Exception_Api

invalid_user_specified

Return values
array<string|int, mixed>

with

  • groupid integer primary group id
  • displaygroupid integer display group id
  • secondary array list of secondary user groups
  • infraction array list of infraction groups.

fetchUserinfo()

Fetches an array containing info for the specified user, or false if user is not found

public fetchUserinfo([int $userid = false ][, array<string|int, mixed> $option = [] ][, int $languageid = false ][, bool $nocache = false ]) : array<string|int, mixed>

Values for Option parameter: avatar - Get avatar location - Process user's online location admin - Join the administrator table to get various admin options signpic - Join the sigpic table to get the userid just to check if we have a picture isfriend - Is the logged in User a friend of this person? Therefore: array('avatar', 'location') means 'Get avatar' and 'Process online location'

Parameters
$userid : int = false
$option : array<string|int, mixed> = []

--(see description)

$languageid : int = false

-- If set to 0, it will use user-set languageid (if exists) or default languageid

$nocache : bool = false

-- If true, the method won't use user cache but fetch information from DB.

Return values
array<string|int, mixed>

The information for the requested user

fetchUserName()

Fetches the username for a userid

public fetchUserName(mixed $userid) : string
Parameters
$userid : mixed
Return values
string

fetchUserNames()

Fetches the user names for the given user ids

public fetchUserNames(array<string|int, mixed> $userIds) : array<string|int, mixed>
Parameters
$userIds : array<string|int, mixed>
Return values
array<string|int, mixed>

$usernames -- format array($userid => $username)

fetchUserWithPerms()

Fetches an array containing info for the specified user, or false if user is not found

public fetchUserWithPerms(int $userid, int $languageid[, bool $nocache = false ][, bool $lastactivity = false ]) : array<string|int, mixed>
Parameters
$userid : int
$languageid : int

-- If set to 0, it will use user-set languageid (if exists) or default languageid.

$nocache : bool = false

-- If true, the method won't use user cache but fetch information from DB.

$lastactivity : bool = false

-- unused

Return values
array<string|int, mixed>

The information for the requested user

formatAndValidateBirthday()

Formats the provided birthday into an array for user API, Library & datamanager consumption and runs sanity checks on the day/month/year values.

public formatAndValidateBirthday(mixed &$birthday) : bool
Parameters
$birthday : mixed
Return values
bool

true if provided birthday was consumable & passed range sanity checks false if birthday was provided in an incompatible format

generateUserSecret()

Generates a totally random string

public generateUserSecret() : string

Intended to populate the user secret field. Exposed as a function because the installer doesn't use the normal user save code and will need access.

Return values
string

Generated String

getContentInstance()

public static getContentInstance(mixed $contenttypeid) : mixed
Parameters
$contenttypeid : mixed
Return values
mixed

getCustomFields()

public getCustomFields(mixed $userid, mixed $showHidden) : mixed
Parameters
$userid : mixed
$showHidden : mixed
Return values
mixed

getDayOfWeekPhrases()

public getDayOfWeekPhrases() : mixed
Return values
mixed

getEmailReplacementValues()

Returns the values for the user-related phrase shortcodes, for use in emails.

public getEmailReplacementValues(mixed $email, mixed $userid) : array<string|int, mixed>

These correspond to the recipient user.

Parameters
$email : mixed
$userid : mixed
Return values
array<string|int, mixed>

Array of replacement values

getGroupInTopic()

This returns a user's additional permissions from the groupintopic table

public getGroupInTopic(int $userid[, int $nodeid = false ][, mixed $forceReload = false ]) : array<string|int, mixed>
Parameters
$userid : int
$nodeid : int = false

-- nodeid

$forceReload : mixed = false
Return values
array<string|int, mixed>

-- Array of array('nodeid' => nodeid, 'groupid' => groupid);

getIpLocation()

Return the location for an IP address

public getIpLocation(string $ipaddress) : mixed
Parameters
$ipaddress : string
Return values
mixed

getPersonalData()

Returns a report on "personal information" for a user

public getPersonalData( $userid) : array<string|int, mixed>

This is the personally identifiable information for privacy laws. Currently this follows our best understanding of the EU law, but eventually this may end up being a superset of all simpilar laws.

Parameters
$userid :
Return values
array<string|int, mixed>

--string username --string email --string icq --string aim --string yahoo --string msn --string skype --string google --string usertitle --int lastvisit --int lastactivity --int lastpost --int posts --string reputation --int reputationlevelid --string timezoneoffset --string ipaddress --int pmtotal --string fbuserid --int fbjoindate --string fbname --int infractions --int warnings --string reputationlevelphrase --string startofweekphrase --string language --string birthday --array(string) devicetokens --array customFields --array {categoryname} -- multiple arrays of categoryname => field -- array {fieldphrase} -- mutple array of fieldphrase => field details --mixed val --int hidden

getProfileFieldsFromUserInfoArray()

public getProfileFieldsFromUserInfoArray(mixed $userInfoArray, mixed $showHidden) : mixed
Parameters
$userInfoArray : mixed
$showHidden : mixed
Return values
mixed

getRawCustomFields()

public getRawCustomFields(mixed $userid) : mixed
Parameters
$userid : mixed
Return values
mixed

getUsertitleFromPosts()

public getUsertitleFromPosts(mixed $posts) : mixed
Parameters
$posts : mixed
Return values
mixed

incrementPostCountForUsers()

Update the post count for a list of users.

public incrementPostCountForUsers(mixed $userInfo) : none

The simple case is one user and one post, but if we do a large operation -- for example undeleting a topic -- we can cause a number of posts to be "counted" for a number of users (and have more than one "new" post per user). We batch the call for all affected users because it allows us to avoid

We also update the lastpost information for the user (conditionally). These are linked primary to save queries to the database because they tend to change together rather than because the are conceptually the same thing.

Parameters
$userInfo : mixed
Return values
none

instance()

Returns singleton instance of self.

public static instance(mixed $class) : vB_PageCache
Parameters
$class : mixed
Return values
vB_PageCache
  • Reference to singleton instance of the cache handler

isBanned()

Check whether a user is banned.

public isBanned(int $userid) : bool
Parameters
$userid : int

User ID.

Return values
bool

Whether the user is banned.

monitorWords()

Checks if the text contains monitored words, and if so, sends notifications to admins and moderators if the setting is on.

public monitorWords(mixed $text, mixed $type, mixed $nodeid[, mixed $userid = null ][, mixed $insertNotifications = true ], mixed $currentuserid) : mixed
Parameters
$text : mixed
$type : mixed
$nodeid : mixed
$userid : mixed = null
$insertNotifications : mixed = true
$currentuserid : mixed
Return values
mixed

needsCoppa()

This checks whether a user needs COPPA approval based on birthdate. Responds to Ajax call

public needsCoppa(array<string|int, mixed> $dateInfo) : int
Parameters
$dateInfo : array<string|int, mixed>

array of month/day/year.

Return values
int

0 - no COPPA needed, 1- Approve but require adult validation, 2- Deny

precleanUsername()

public precleanUsername(mixed $username) : mixed
Parameters
$username : mixed
Return values
mixed

precleanUsernameRaw()

public precleanUsernameRaw(mixed $username) : mixed
Parameters
$username : mixed
Return values
mixed

preloadUserInfo()

This preloads information for a list of userids, so it will be available for userContext and other data loading

public preloadUserInfo(array<string|int, mixed> $userids) : mixed
Parameters
$userids : array<string|int, mixed>
Return values
mixed

removeSecondaryUserGroups()

Remove groups from a user

public removeSecondaryUserGroups(int $userid, array<string|int, mixed> $groups) : none

Will not affect the user's primary group Will unset (set to 0) the display groupid if its being removed Will remove groups even if allowmembergroups is set to "no". There will be cases where we want to track secondary group changes even if we aren't doing anything with them

Parameters
$userid : int
$groups : array<string|int, mixed>

list of integer ids for usergroups to remove

Return values
none

save()

Insert or Update an user

public save(int $userid, string $password, array<string|int, mixed> $user[, array<string|int, mixed> $userfield = [] ][, array<string|int, mixed> $userOptions = [] ][, array<string|int, mixed> $saveOptions = [] ]) : int
Parameters
$userid : int

Userid to be updated. Set to 0 if you want to insert a new user.

$password : string

New password for the user. Empty means no change.

$user : array<string|int, mixed>

Basic user information such as email or home page * username * email * usertitle * birthday * usergroupid (will get no_permissions exception without administrate user permissions) * membergroupids (will get no_permissions exception without administrate user permissions)

  • privacyconsent int -1|0|1 meaning Privacy-Consent Withdrawn|Unknown|Given respectively.
  • list not complete
$userfield : array<string|int, mixed> = []

User's User Profile Field data

$userOptions : array<string|int, mixed> = []

Option overrides & notification options for user. Following keys:

  • options -- vB options for the user
  • adminoptions -- Admin Override Options for the user
  • notificationOptions Following are only used if user is a moderator:
  • moderatorNotificationOptions
  • moderatorEmailNotificationOptions
$saveOptions : array<string|int, mixed> = []

Command options to bypass certain processes or fine tuning certain user fields. Following keys:

  • userfieldscope -- String admin|normal|register for admin override, user edit, user creation respectively. Default 'normal'.
  • skippasswordhistory -- Bool True to skip checking password history when changing password. Default True.
  • skipactivationemail -- Bool true to skip sending out activation email for new user. Default True.
  • skipcoppa -- Bool true to skip COPPA checks & COPPA emails, use carefully! Default False.
  • skipusernamechecks -- Bool[] Allows for the following username check bypasses:
    • duplicate - Bool true to skip duplicate username checks. Default False.
Return values
int

New or updated userid.

sendActivateEmail()

Send the activation email to the user

public sendActivateEmail(int $userid[, bool $checkmoderation = true ][, mixed $checkcoppa = true ]) : mixed
Parameters
$userid : int
$checkmoderation : bool = true

-- Depeneding on configuration options, once activated a user may be put in the awaiting moderation user group instead of the registered user's group. If this is false we'll always force a switch back to the registered user's group. This is primarily for admin actions where we still need to validate the email but by sending the activation we're implicitly moderating the account.

$checkcoppa : mixed = true
Return values
mixed

sendPasswordEmail()

public sendPasswordEmail(mixed $userid, mixed $email) : mixed
Parameters
$userid : mixed
$email : mixed
Return values
mixed

transferOwnership()

Transfers all ownerships (blogs and groups) from given user to another one.

public transferOwnership(mixed $fromuser, mixed $touser) : mixed
@param 		int 	Userid to transfer ownerships from.
Parameters
$fromuser : mixed
$touser : mixed
Return values
mixed

updateEmailFloodTime()

public updateEmailFloodTime() : mixed
Return values
mixed

updateGuestPrivacyConsent()

Updates guest privacy consent

public updateGuestPrivacyConsent(mixed $consent) : mixed

This saves a new record for each consent "event", even if the IP address is the same, because we have no way of knowing if it's the same person or not. If a saved consent "event" for a given time and IP address needs to be retrieved, this will give us the greatest likelihood of finding it.

Parameters
$consent : mixed
Return values
mixed

updateLatestUser()

This updates the latest user in the statistics so that it stays current.

public updateLatestUser(int $userid, string $action) : mixed

This is primarily so that a) New users show up immediately as the latest user b) We don't show a deleted user as the latest user c) Changing the latest user's name or group might affect the latest user.

We don't just rebuild the stats because that can be slowish with large numbers of users and we don't necesarily want to do it. This more or less assumes that the user identified is the only thing that may have changed.

Parameters
$userid : int
$action : string

-- one of "add", "update", "delete". This determine how we approach things (if we are deleting a user then we don't need to worry that that user might be the latest.

Return values
mixed

uploadAvatar()

public uploadAvatar(mixed $filename[, mixed $crop = array() ][, mixed $userid = false ][, mixed $adminoverride = false ]) : mixed
Parameters
$filename : mixed
$crop : mixed = array()
$userid : mixed = false
$adminoverride : mixed = false
Return values
mixed

__construct()

protected __construct() : mixed
Return values
mixed

getLibraryClassNameInternal()

protected static getLibraryClassNameInternal(mixed $controller) : mixed
Parameters
$controller : mixed
Return values
mixed

buildUserActivationId()

(Re)Generates an Activation ID for a user

private buildUserActivationId(mixed $userid, mixed $usergroupid, mixed $type, mixed $emailchange) : string
Parameters
$userid : mixed
$usergroupid : mixed
$type : mixed
$emailchange : mixed
Return values
string

The Activation ID

checkMonitoredWords()

private checkMonitoredWords(mixed $newuser, mixed $newuserid, mixed $olduser, mixed $userfield, mixed $usertitle) : mixed
Parameters
$newuser : mixed
$newuserid : mixed
$olduser : mixed
$userfield : mixed
$usertitle : mixed
Return values
mixed

getAllCustomFields()

private getAllCustomFields(mixed $userid, mixed $showHidden) : mixed
Parameters
$userid : mixed
$showHidden : mixed
Return values
mixed

getBaseUserStats()

private getBaseUserStats(mixed $db, mixed $groupsNeedingConfirmation) : mixed
Parameters
$db : mixed
$groupsNeedingConfirmation : mixed
Return values
mixed

getCustomFieldValue()

private getCustomFieldValue(mixed $customField, mixed $value) : mixed
Parameters
$customField : mixed
$value : mixed
Return values
mixed

getGeoipProvider()

private getGeoipProvider() : mixed
Return values
mixed

getProfileFieldInfo()

private getProfileFieldInfo() : mixed
Return values
mixed

getProfileFieldInfoFromDatastore()

private getProfileFieldInfoFromDatastore() : mixed
Return values
mixed

getProfileFieldsInternal()

private getProfileFieldsInternal(mixed $fieldsInfo, mixed $showHidden, mixed $fieldValues) : mixed
Parameters
$fieldsInfo : mixed
$showHidden : mixed
$fieldValues : mixed
Return values
mixed

groupsExcludedFromLatest()

private groupsExcludedFromLatest() : mixed
Return values
mixed

isLocationInList()

Return if the given location is in the given list.

private isLocationInList(string $location, mixed $list) : mixed

A location that is simply a country code will only match the country code. If there is country code and region code in the match list, then that will not be considered a match. However a country code/region code combo in $location will match a bare country code in $list. If $location matches any entries in $list then we have a match.

So: US matches US US does not match US:CA US:CA matches US US:CA matches US:CA

Note that a list of the form array('US', 'US:CA', 'US:TX') is valid, but the latter two entries are really reduntant with the first one.

Parameters
$location : string

-- the location in the form of XX or XX:YY where XX is the country code and YY is the region code.

@param array $list -- a list of locations in the form of XX or XX:YY where XX is the country code and YY is the region code.

$list : mixed
Return values
mixed

scanFile()

private scanFile(mixed $filename) : mixed
Parameters
$filename : mixed
Return values
mixed

sendNewUserEmails()

private sendNewUserEmails(mixed $newuserid, mixed $userfield, mixed $userdata, mixed $skipactivationemail, mixed $skipcoppa) : mixed
Parameters
$newuserid : mixed
$userfield : mixed
$userdata : mixed
$skipactivationemail : mixed
$skipcoppa : mixed
Return values
mixed

setCoppa()

private setCoppa(mixed &$userdata, mixed $password) : mixed
Parameters
$userdata : mixed
$password : mixed
Return values
mixed

setPassword()

private setPassword(mixed $newuser, mixed $newuserid, mixed $skippasswordhistory, mixed $password) : mixed
Parameters
$newuser : mixed
$newuserid : mixed
$skippasswordhistory : mixed
$password : mixed
Return values
mixed

setUsertitle()

private setUsertitle(mixed &$userdata, mixed $user, mixed $displaygroup) : mixed
Parameters
$userdata : mixed
$user : mixed
$displaygroup : mixed
Return values
mixed

updateAvatar()

Update avatar

private updateAvatar(int $userid, int $avatarid[, array<string|int, mixed> $data = array() ][, mixed $cropped = false ]) : mixed
Parameters
$userid : int

User ID whose avatar is going to be updated

$avatarid : int

Predefined avatar ID. -1 means to remove avatar from the user. 0 means use custom avatar defined in $avatardata

$data : array<string|int, mixed> = array()

Avatar data. It should be an array contains the following items: 'filename', 'width', 'height', 'filedata', 'location'

$cropped : mixed = false
Return values
mixed

updateBuddylist()

private updateBuddylist(mixed &$userdata, mixed $user, mixed $userinfo) : mixed
Parameters
$userdata : mixed
$user : mixed
$userinfo : mixed
Return values
mixed

updateIfNotExcluded()

private updateIfNotExcluded(object $datastore, int $userid, array<string|int, mixed> $userstats, bool $nocache) : mixed
Parameters
$datastore : object
$userid : int
$userstats : array<string|int, mixed>
$nocache : bool

-- if we are updating the user then the cached value might not be accurate.

Return values
mixed

updateIgnorelist()

Updates the user ignore list

private updateIgnorelist(int $userid, array<string|int, string> $userList) : mixed
Parameters
$userid : int

Update ignorelist for this user.

$userList : array<string|int, string>

Usernames of ignored users.

Return values
mixed

updateLadderUserTitle()

private updateLadderUserTitle(mixed $userInfo) : mixed
Parameters
$userInfo : mixed
Return values
mixed

updateLastestUserInternal()

private updateLastestUserInternal(mixed $db, mixed $datastore, mixed $userstats) : mixed
Parameters
$db : mixed
$datastore : mixed
$userstats : mixed
Return values
mixed

updatePostCountInfo()

Update the user post count dependant info for the users identified.

private updatePostCountInfo( $users) : mixed

Note that the user cache should be cleared after calling this function but it does not do so (to avoid clearing the cache repeatedly). If this is needed to be made public a new public version should be created that calls this function and then clears the cash

Note also that this function will only update the ranks if there are ranks defined. This is intended to avoid querying user data that we don't need if we can't match any ranks -- not everybody uses this feature. However it also means that if we create ranks and delete them all then then this function will not clear the rank data. There is a maintanince tool to update this data that should be run whenever the rank structure is changed that will fix this problem.

Parameters
$users :

an array of user ids @return none

Return values
mixed

updatePostCountInfoCurrentUser()

Updates the post count dependant info for the current user.

private updatePostCountInfoCurrentUser( $currentUser) : mixed

This is going to be the common case. We could use updatePostCountInfo for this, but we already have all of the information we need for the user here so we can save a query.

Parameters
$currentUser :

The current user array. We have to pass this in because the cached value is likely to be outdated when get here and the caller may need to alter it before we use it. This prevents an unnecesary cache clear/reload.

Return values
mixed

userIsModerator()

private userIsModerator(mixed $userid) : mixed
Parameters
$userid : mixed
Return values
mixed

Search results