vBulletin 5.6.5 API

vB_Api_User extends vB_Api
in package

vB_Api_User

Tags
access

public

Table of Contents

DEFAULT_AVATAR_PATH_LARGE  = 'images/default/default_avatar_large.png'
DEFAULT_AVATAR_PATH_REGULAR  = 'images/default/default_avatar_medium.png'
DEFAULT_AVATAR_PATH_THUMB  = 'images/default/default_avatar_thumb.png'
USERINFO_ADMIN  = 'admin'
USERINFO_AVATAR  = 'avatar'
USERINFO_ISFRIEND  = 'isfriend'
USERINFO_SIGNPIC  = 'signpic'
$avatarsCache  : mixed
$avatarUserCache  : mixed
$controller  : string
API Controller
$currentlocale  : string
Current locale to revert back to after setLocale() was called.
$dateUtil  : vB_Utility_Date
Instance of vB_Utility_Date() used for date/time output format conversions
$db  : vB_Database
Database object.
$disabled  : bool
Indicates whether the API was disabled
$disableFalseReturnOnly  : array<string|int, mixed>
Contains white listed methods which return a false response when API is disabled in special scenarios like forum closed, password expiry, ip ban and others.
$disableWhiteList  : array<string|int, mixed>
Contains white listed methods which act as normal when API is disabled no matter of special scenarios like forum closed, password expiry, ip ban and others.
$groupInTopic  : mixed
$library  : mixed
$loadedAvatarUserids  : array<string|int, mixed>
Array of userids that have already been used to batch-fetch avatar information
$membersOf  : mixed
$moderatorsOf  : mixed
$pendingAvatarUserids  : array<string|int, mixed>
An array of userids to batch-fetch avatar information for.
$permissionContext  : mixed
$privacyOptions  : mixed
$referrals  : mixed
$users  : mixed
$instances  : mixed
$instancesRaw  : array<string|int, mixed>
We want API subclasses to access the instances only through getters
$vb4_input_mappings  : mixed
$wrappers  : mixed
__serialize()  : mixed
__sleep()  : mixed
__unserialize()  : mixed
__wakeup()  : mixed
activateUser()  : string
Activate an user with an activate ID
activateUserByUsername()  : string
Activate an user with an activate ID and Username
banUsers()  : mixed
Ban users
callNamed()  : The
Call the given api function by name with a named arguments list.
canCreateBlogEntry()  : mixed
Tells whether the current user can create a blog entry. That can be their own permissions or GIT.
canRemovePost()  : int
Checks the various options as to whether the current user can physically remove a post
changeHistory()  : array<string|int, mixed>
Return user change history
checkApiState()  : mixed
This method checks whether the API method is enabled.
checkPrivacyOption()  : mixed
checkUsername()  : bool
This checks whether the a username is available and valid
clearCache()  : mixed
Clears all previously loaded API objects.
clearChannelPerms()  : mixed
This method clears remembered channel permission
currentUserHasAdminPermission()  : mixed
delete()  : mixed
Delete a user
deleteActivation()  : mixed
emailPassword()  : success
Email user a password reset email
enableMfa()  : mixed
Enable the user's current MFA record after verify password and authcode
fetchAdminUser()  : mixed
This implements vB_PermissionContext::getAdminUser().
fetchAvatar()  : array<string|int, mixed>
Fetches the URL for a User's Avatar
fetchAvatars()  : array<string|int, mixed>
Fetch the Avatars for a userid array
fetchAwaitingModerate()  : array<string|int, mixed>
Fetch a list of users who are awaiting moderate or Coppa
fetchBirthdays()  : array<string|int, mixed>
Fetch today's birthdays
fetchByEmail()  : array<string|int, mixed>
Fetch user by its email
fetchByUsername()  : array<string|int, mixed>
Fetch user by its username
fetchCurrentUserinfo()  : array<string|int, mixed>
Fetches an array containing info for the current user
fetchMusername()  : string
fetches the proper username markup and title
fetchProfileFieldsForRegistration()  : array<string|int, mixed>
Fetches the Profile Fields that needs to be displayed in Registration From
fetchProfileInfo()  : array<string|int, mixed>
This gets the information needed for a user's profile. Only public information unless this is an admin or the user.
fetchPruneUsers()  : array<string|int, mixed>
Return a list of users for pruning or moving
fetchReferrers()  : array<string|int, mixed>
Return a report of referrers
fetchSignature()  : array<string|int, mixed>
Get the profile information so the presentation can render it
fetchTimeOffset()  : int
Adjust GMT time back to user's time Use "gm" versions of date/time functions with this offset, not ones that rely on current server's system timezone.
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, or false if user is not found
fetchUsernames()  : array<string|int, mixed>
Returns an array with the usernames for the user ids and optionally the profileUrl for the user
fetchUserProfileFields()  : array<string|int, mixed>
This gets the current user profile fields from the database.
fetchUserSettings()  : mixed
Fetches the needed info for user settings
fetchUsersPms()  : array<string|int, mixed>
Fetch private messages statistics from all the users.
find()  : bool
Find user
generateMailingList()  : bool
Generates users mailing list for the given criteria.
getApiClassName()  : mixed
getAutocomplete()  : array<string|int, mixed>
Returns suggested usernames for the username autocomplete popup menu.
getCanCreate()  : array<string|int, mixed>
This is a wrapper for userContext getCanCreate- it returns the content types a user can create
getGitCanStart()  : array<string|int, mixed>
This likes the channels below a parent node where a user can create starters based on groupintopic
getGroupInTopic()  : array<string|int, mixed>
This returns a user's additional permissions from the groupintopic table
getIpLocation()  : mixed
Return the location for the current user's IP address
getMembersOf()  : array<string|int, mixed>
Returns a list of channels where this user is moderator
getModeratorsOf()  : array<string|int, mixed>
Returns a list of channels where this user is moderator
getPersonalData()  : array<string|int, mixed>
Returns a report on "personal information" for a user
getPrivacyOptions()  : array<string|int, mixed>
Mostly a getter for user privacy options.
getUsersFromCriteria()  : array<string|int, mixed>
Fetch users and info from a given user criteria Used for admincp - verticalresponse.
hasPermissions()  : bool|int
Returns global permission value or specific value for a nodeid for current user.
havePermissions()  : bool|int
Returns permission values of a group of nodes for current user.
instance()  : vB_Api
Returns an instance of the API object which translates exceptions to an array Use this method for API clients.
instanceInternal()  : vB_Api
Returns an instance of the API object which doesn't handle exceptions This should only be used in other API objects, not for clients of the API
inviteMembers()  : mixed
Invites members to a given node channel passing either an array of userids or usernames.
isBanned()  : bool
Check whether a user is banned.
isBannedEmail()  : bool
Check whether an email address is banned from the forums
isMfaEnabled()  : mixed
Gets whether or not the user has an enabled MFA record
killActivation()  : mixed
login()  : array<string|int, mixed>
Login a user
login2()  : array<string|int, mixed>
Login a user
loginExternal()  : mixed
Log in via a third party provider.
loginSpecificUser()  : array<string|int, mixed>
Login a user for which we have the userid
logout()  : bool
Logout user
map_vb4_input_to_vb5()  : string
Returns vb5 api method name.
map_vb5_errors_to_vb4()  : mixed
Alters the error array in any way necessary to interface correctly with vb4.
map_vb5_output_to_vb4()  : mixed
Alters the output array in any way necessary to interface correctly with vb4.
memberList()  : array<string|int, mixed>
Fetch a list of user based on the provided criteria
merge()  : mixed
Merge two users
needMFA()  : array<string|int, mixed>
Indicates if the current user needs to provide an MFA code for login.
needsCoppa()  : int
This checks whether a user needs COPPA approval based on birthdate. Responds to Ajax call
prune()  : mixed
Do prune/move users (step 1)
registerNeedAvatarForUsers()  : mixed
Registers userids that we will later be fetching avatars for. If we register the userids here, they can be fetched in batches.
resetMfaSecret()  : mixed
Reset the current user's MFA secret
save()  : int
Insert or Update an user
saveEditorState()  : array<string|int, mixed>
Saves the content entry UI editor "state" where state is the show/hide state of the following 3 content entry UIs: ckeditor toolbar, attachements panel, and smilies panel.
saveSignature()  : string
Verifies and saves a signature for current logged in user. Returns the signature.
searchIP()  : array<string|int, mixed>
Search IP Addresses
searchUsersByIP()  : array<string|int, mixed>
Search IP Addresses
sendActivateEmail()  : mixed
setCurrentUserPrivacyConsent()  : mixed
Set privacy consent and for the current user if needed.
setDefaultAvatar()  : mixed
This sets a user to use one of the default avatars.
setGroupInTopic()  : bool
This grants a user additional permissions in a specific channel, by adding to the groupintopic table
setMfaEnabled()  : array<string|int, mixed>
Sets the users MFA record to enabled or disabled
setNewPassword()  : array<string|int, string>
Set a new password for a user. Used by "forgot password" function.
unixtimestampToUserDateString()  : mixed
unsetGroupInTopic()  : bool
This removes additional permissions a user was given in a specific channel, by removing from the groupintopic table
updateGuestPrivacyConsent()  : mixed
Updates guest privacy consent
updateStatus()  : string
Updates the user status
useCoppa()  : bool
This checks whether the site uses COPPA review
userTimeStrToUnixtimestamp()  : mixed
vBMktime()  : int
translate a year/month/day/hour/minute to a Unix timestamp.
verifyFlashMessageSignature()  : array<string|int, mixed>
Verifies that a flash message passed through the URL is signed and valid
__construct()  : mixed
Constructor
_processProfileFields()  : void
Process Profile Fields for templates
_searchIPUsage()  : mixed
Rewrite function construct_ip_usage_table()
_searchRegisterIP()  : mixed
Rewrite function construct_ip_register_table()
_searchUserIP()  : mixed
Rewrite function construct_user_ip_table()
checkHasAdminPermission()  : none
Determines if the calling user has the given admin permission, and if not throws an exception
checkHasPermission()  : none
Determines if the calling user has the given bitfield permission, and if not, throws a 'no_permission' exception.
checkIsLoggedIn()  : mixed
Determines if the calling user has the given admin permission, and if not throws an exception
computeMembersOf()  : mixed
Analyzes what groups this user belongs to in specific channels. Stores in member variables
getApiClass()  : mixed
getApiClassNameInternal()  : mixed
getProfileFieldConditions()  : mixed
hasAdminPermission()  : bool
Determines if the calling user has the given admin permission
inDebugMode()  : mixed
isDisableFalseReturnOnly()  : bool
Checks if method returns false response only when API is disabled.
isWhiteListed()  : bool
Checks if method is white listed when API is disabled.
processPasswordResetLockout()  : mixed
setController()  : mixed
Set controller
setCurrentUserFlags()  : mixed
Set current user flags to display or not certain user items.
alwaysAllowSave()  : mixed
Skip some checks (current save profile permission and birthday required) when updating an existing user if only specific elements are set in the params. We want the user to be able to update these items (usually via some side call the user isn't explicitly aware of) regardless of their permissions.
blankUserOnlyFields()  : The
Blank fields that only the user themselves should see. We can also allow admins with the correct privs to see those too. Note that this function doesn't actually check if the user should be able to see them, it just blanks them out.
checkBirthday()  : mixed
checkEmail()  : mixed
Checks if email is empty -- and throws an exception if that's a problem.
checkUsernameInternal()  : mixed
cms_vb4_to_vb5_method_mapping()  : mixed
default_vb4_to_vb5_method_mapping()  : mixed
fetchUserSearchCondition()  : array<string|int, mixed>
Convert the search array to the assertor conditions.
getFiledataIdsFromSignature()  : mixed
hasAdminPermissionInternal()  : mixed
Internal function to power the previous cover functions
loginInternal()  : mixed
processLoginError()  : mixed
Processes login error.
processMfaError()  : mixed
Processes login error.
remove_nulls()  : mixed
revertLocale()  : mixed
sanitizeUserInfo()  : mixed
saveEmailPassword()  : int
Shortcut to saving only email and password if user only has permission to modify password and email
setUsergroup()  : mixed
setUserLocation()  : mixed
stripPrivateUserFields()  : The
Strips fields that should *never* be returned by the API. Full stop. Don't do it.
tempSetLocale()  : mixed
validateMembergroupids()  : mixed
validateUserTitle()  : mixed
verifyAuthentication()  : array<string|int, mixed>|bool
Port of function verify_authentication()
verifyCredentialExistanceError()  : mixed
Verify credential existance error
verifyMfaAuthentication()  : bool
Verify that the MFA information passes.
verifyStrikeError()  : mixed
Verifies strike errors.
wrapLoggerIfNeeded()  : mixed
Wrap the api object with the log wrapper class if needed.

Constants

DEFAULT_AVATAR_PATH_LARGE

public mixed DEFAULT_AVATAR_PATH_LARGE = 'images/default/default_avatar_large.png'

DEFAULT_AVATAR_PATH_REGULAR

public mixed DEFAULT_AVATAR_PATH_REGULAR = 'images/default/default_avatar_medium.png'

DEFAULT_AVATAR_PATH_THUMB

public mixed DEFAULT_AVATAR_PATH_THUMB = 'images/default/default_avatar_thumb.png'

USERINFO_ADMIN

public mixed USERINFO_ADMIN = 'admin'

USERINFO_AVATAR

public mixed USERINFO_AVATAR = 'avatar'

USERINFO_ISFRIEND

public mixed USERINFO_ISFRIEND = 'isfriend'

USERINFO_SIGNPIC

public mixed USERINFO_SIGNPIC = 'signpic'

Properties

$avatarsCache

protected mixed $avatarsCache = array()

$avatarUserCache

protected mixed $avatarUserCache = array()

$controller

API Controller

protected string $controller

$currentlocale

Current locale to revert back to after setLocale() was called.

protected string $currentlocale = ''

$dateUtil

Instance of vB_Utility_Date() used for date/time output format conversions

protected vB_Utility_Date $dateUtil

$disabled

Indicates whether the API was disabled

protected bool $disabled = alse

$disableFalseReturnOnly

Contains white listed methods which return a false response when API is disabled in special scenarios like forum closed, password expiry, ip ban and others.

protected array<string|int, mixed> $disableFalseReturnOnly = array('fetchAvatar')

$disableWhiteList

Contains white listed methods which act as normal when API is disabled no matter of special scenarios like forum closed, password expiry, ip ban and others.

protected array<string|int, mixed> $disableWhiteList = array('fetchCurrentUserinfo', 'fetchProfileInfo', 'fetchUserinfo', 'fetchUserSettings', 'hasPermissions', 'login', 'login2', 'loginSpecificUser', 'setCurrentUserPrivacyConsent', 'updateGuestPrivacyConsent', 'checkPrivacyOption')

$groupInTopic

protected mixed $groupInTopic = array()

$library

protected mixed $library

$loadedAvatarUserids

Array of userids that have already been used to batch-fetch avatar information

protected array<string|int, mixed> $loadedAvatarUserids = array()

$membersOf

protected mixed $membersOf = array()

$moderatorsOf

protected mixed $moderatorsOf = array()

$pendingAvatarUserids

An array of userids to batch-fetch avatar information for.

protected array<string|int, mixed> $pendingAvatarUserids = array()

$permissionContext

protected mixed $permissionContext = array()

$privacyOptions

protected mixed $privacyOptions = array('showContactInfo' => 'contact_info', 'showAvatar' => 'profile_picture', 'showActivities' => 'activities', 'showVM' => 'visitor_messages', 'showSubscriptions' => 'following', 'showSubscribers' => 'followers', 'showPhotos' => 'photos', 'showVideos' => 'videos', 'showGroups' => 'group_memberships')

$referrals

protected mixed $referrals = array()

$users

protected mixed $users = array()

$instances

private static mixed $instances

$instancesRaw

We want API subclasses to access the instances only through getters

private static array<string|int, mixed> $instancesRaw

$vb4_input_mappings

private static mixed $vb4_input_mappings = array( 'blog.post_comment' => array('method' => 'vb4_blog.post_comment'), 'blog.post_postcomment' => array('method' => 'vb4_blog.post_postcomment'), 'blog.post_updateblog' => array('method' => 'vb4_blog.post_updateblog'), 'blog.post_newblog' => array('method' => 'vb4_blog.post_newblog'), 'blog.post_editblog' => array('method' => 'vb4_blog.post_editblog'), 'blog_list' => array('method' => 'vb4_blog.bloglist'), 'api_init' => array('method' => 'api.init'), 'api_cmssectionlist' => array('method' => 'Vb4_Cms.sectionlist'), 'api_cmscategorylist' => array('method' => 'Vb4_Cms.categorylist'), /* // These can no longer be mapped directly to vB_Api_User::login/logout // due to additional processing of devicetoken that may be required // for mapi calls. 'login_login' => array( 'method' => 'user.login', 'request_mappings' => array( 'vb_login_username' => 'username', 'vb_login_password' => 'password', 'vb_login_md5password' => 'md5password', 'vb_login_md5password_utf' => 'md5passwordutf' ) ), 'login_logout' => array( 'method' => 'user.logout' ), */ 'get_vbfromfacebook' => array('method' => 'vb4_facebook.getVbfromfacebook'), )

$wrappers

private static mixed $wrappers

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

activateUser()

Activate an user with an activate ID

public activateUser(int $userid, string $activateid) : string
Parameters
$userid : int

User ID

$activateid : string

Activate ID

Tags
throws
vB_Exception_Api
Return values
string

User status after activation. Possible values:

  1. moderateuser: user is put into moderate queue
  2. emailchanged: user's email address has been updated successfully
  3. registration_complete: user's registration is completed

activateUserByUsername()

Activate an user with an activate ID and Username

public activateUserByUsername(string $username, string $activateid) : string
Parameters
$username : string

Username

$activateid : string

Activate ID

Tags
throws
vB_Exception_Api
Return values
string

User status after activation. Possible values:

  1. moderateuser: user is put into moderate queue
  2. emailchanged: user's email address has been updated successfully
  3. registration_complete: user's registration is completed

banUsers()

Ban users

public banUsers(array<string|int, mixed> $userids, int $banusergroupid, string $period[, string $reason = '' ]) : mixed
Parameters
$userids : array<string|int, mixed>

Userids to ban

$banusergroupid : int

Which banned usergroup to move the users to

$period : string

Ban period

$reason : string = ''

Ban reason

Return values
mixed

callNamed()

Call the given api function by name with a named arguments list.

public callNamed() : The

Used primarily to translate REST requests into API calls.

Return values
The

return of the method or an error if the method doesn't exist, or is static, a constructor or destructor, or otherwise shouldn't be callable as and API method. It is also an error if the value of a paramater is not provided and that parameter doesn't have a default value.

canCreateBlogEntry()

Tells whether the current user can create a blog entry. That can be their own permissions or GIT.

public canCreateBlogEntry(int $nodeid) : mixed
Parameters
$nodeid : int

-- optional. If not passed will check the global blog channel.

Return values
mixed

canRemovePost()

Checks the various options as to whether the current user can physically remove a post

public canRemovePost(int $nodeid) : int
Parameters
$nodeid : int
Return values
int

0 or 1

changeHistory()

Return user change history

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

|bool User change history array. False means no change history.

checkApiState()

This method checks whether the API method is enabled.

public checkApiState(mixed $method) : mixed

For extensions check make sure $controller property is already set.

Parameters
$method : mixed
Return values
mixed

checkPrivacyOption()

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

checkUsername()

This checks whether the a username is available and valid

public checkUsername(mixed $candidate) : bool
Parameters
$candidate : mixed
Return values
bool

clearCache()

Clears all previously loaded API objects.

public static clearCache() : mixed

Intended for use in tests where the loading pattern can cause issues with objects that cache thier own data.

Return values
mixed

clearChannelPerms()

This method clears remembered channel permission

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

currentUserHasAdminPermission()

public currentUserHasAdminPermission(mixed $adminPermission) : mixed
Parameters
$adminPermission : mixed
Return values
mixed

delete()

Delete a user

public delete(mixed $userid[, mixed $transfer_groups = true ]) : mixed
Parameters
$userid : mixed
$transfer_groups : mixed = true
Return values
mixed

deleteActivation()

public deleteActivation(mixed $userid, mixed $activateid) : mixed
Parameters
$userid : mixed
$activateid : mixed
Return values
mixed

emailPassword()

Email user a password reset email

public emailPassword(int $userid, string $email[, array<string|int, mixed> $hvinput = array() ]) : success
Parameters
$userid : int

User ID

$email : string

Email address

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

Human Verify input data. @see vB_Api_Hv::verifyToken()

Return values
success

array

enableMfa()

Enable the user's current MFA record after verify password and authcode

public enableMfa(string $password, string $mfa_authcode) : mixed
Parameters
$password : string

-- the user's current password

$mfa_authcode : string

-- the authcode for the current secret, not required if the user does not currently have an auth secret

Return values
mixed

fetchAdminUser()

This implements vB_PermissionContext::getAdminUser().

public fetchAdminUser() : mixed

return int User id from a user that can administer the admincp

Return values
mixed

fetchAvatar()

Fetches the URL for a User's Avatar

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

Information regarding the avatar

fetchAvatars()

Fetch the Avatars for a userid array

public fetchAvatars([mixed $userids = array() ][, mixed $thumb = false ][, mixed $userinfo = array() ]) : array<string|int, mixed>
Parameters
$userids : mixed = array()
$thumb : mixed = false
$userinfo : mixed = array()
Return values
array<string|int, mixed>

Information regarding the avatar

fetchAwaitingModerate()

Fetch a list of users who are awaiting moderate or Coppa

public fetchAwaitingModerate() : array<string|int, mixed>
Return values
array<string|int, mixed>

A list of users that are awaiting moderation

fetchBirthdays()

Fetch today's birthdays

public fetchBirthdays() : array<string|int, mixed>
Return values
array<string|int, mixed>

birthday information

fetchByEmail()

Fetch user by its email

public fetchByEmail(string $email[, array<string|int, mixed> $option = array() ]) : array<string|int, mixed>
Parameters
$email : string

Email

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

Fetch Option (see description of fetchUserinfo())

Return values
array<string|int, mixed>

The information for the requested user

fetchByUsername()

Fetch user by its username

public fetchByUsername(string $username[, array<string|int, mixed> $option = array() ]) : array<string|int, mixed>
Parameters
$username : string

Username

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

Fetch Option (see description of fetchUserinfo())

Return values
array<string|int, mixed>

The information for the requested user

fetchCurrentUserinfo()

Fetches an array containing info for the current user

public fetchCurrentUserinfo() : array<string|int, mixed>
Return values
array<string|int, mixed>

The information for the requested user. Userinfo record plus language information

fetchMusername()

fetches the proper username markup and title

public fetchMusername(array<string|int, mixed> $user[, string $displaygroupfield = 'displaygroupid' ][, string $usernamefield = 'username' ]) : string
Parameters
$user : array<string|int, mixed>

User info array

$displaygroupfield : string = 'displaygroupid'

Name of the field representing displaygroupid in the User info array

$usernamefield : string = 'username'

Name of the field representing username in the User info array

Return values
string

Username with markup and title

fetchProfileFieldsForRegistration()

Fetches the Profile Fields that needs to be displayed in Registration From

public fetchProfileFieldsForRegistration([array<string|int, mixed> $userinfo = array() ]) : array<string|int, mixed>
Parameters
$userinfo : array<string|int, mixed> = array()

User information as fields' current value

Return values
array<string|int, mixed>

Profile fields

fetchProfileInfo()

This gets the information needed for a user's profile. Only public information unless this is an admin or the user.

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

-- uses the current logged in user if not given. Error if the user is a guest.

Return values
array<string|int, mixed>

-- the profile information.

fetchPruneUsers()

Return a list of users for pruning or moving

public fetchPruneUsers(int $usergroupid, mixed $includeSecondary, int $daysprune, int $minposts, array<string|int, mixed> $joindate, string $order, int $page, int $perpage) : array<string|int, mixed>
Parameters
$usergroupid : int

Usergroup where the users are in. -1 means all usergroups

$includeSecondary : mixed
$daysprune : int

Has not logged on for x days, 0 mean any

$minposts : int

Posts is less than, 0 means any

$joindate : array<string|int, mixed>

Join Date is Before. It's an array of 'month', 'day' and 'year'. Array means any

$order : string

Order by one of the following: 'username', 'email', 'usergroup', 'posts', 'lastactivity', 'joindate'. Default: 'username'

$page : int

[optional] used with $perpage, resulting users limit offset

$perpage : int

[optional] used with $page, resulting users limit rows

Return values
array<string|int, mixed>

['users' => array, 'count' => int] : 'users' => Users to be pruned or moved, 'count' => total users count (for pagination when using $page & $perpage)

fetchReferrers()

Return a report of referrers

public fetchReferrers(array<string|int, mixed> $startdate, array<string|int, mixed> $enddate) : array<string|int, mixed>
Parameters
$startdate : array<string|int, mixed>

Start Date of the report. an array of 'year', 'month', 'day', 'hour' and 'minute'

$enddate : array<string|int, mixed>

End Date of the report. an array of 'year', 'month', 'day', 'hour' and 'minute'

Tags
deprecated

This function has been moved to the ReferUser API and will be removed from the User API in a future version.

Return values
array<string|int, mixed>

Referrers information

fetchSignature()

Get the profile information so the presentation can render it

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

| false sigature information or false if there is an error or the user doesn't have a sigature. If the user is not permitted to have a signature, then they will be treated as not having one even if it doesn't exist. signature permissions dohtml dobbcode dobbimagecode dosmilies sigpic sigpicrevision sigpicdateline

fetchTimeOffset()

Adjust GMT time back to user's time Use "gm" versions of date/time functions with this offset, not ones that rely on current server's system timezone.

public fetchTimeOffset([type $adjustForServer = false ][, int $userid = false ][, mixed $ignoreDST = false ]) : int
Parameters
$adjustForServer : type = false
$userid : int = false

(Optional) If skipped, will use current user's offset. If provided, will use that user's offset.

$ignoreDST : mixed = false
Return values
int

fetchUserinfo()

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

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

Values for Option parameter: avatar - Get avatar 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 : mixed = false
$option : mixed = array()
$languageid : mixed = false
$nocache : mixed = false
Return values
array<string|int, mixed>

The information for the requested user

fetchUserName()

Fetches the username for a userid, or false if user is not found

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

fetchUsernames()

Returns an array with the usernames for the user ids and optionally the profileUrl for the user

public fetchUsernames(array<string|int, mixed> $userIds[, bool $profileUrl = true ]) : array<string|int, mixed>
Parameters
$userIds : array<string|int, mixed>
$profileUrl : bool = true
  • if true include the profileUrl field in the returned array.
Return values
array<string|int, mixed>

-- array($userid => array('username' => $username, 'profileUrl' => $profileUrl))

fetchUserProfileFields()

This gets the current user profile fields from the database.

public fetchUserProfileFields() : array<string|int, mixed>
Tags
TODO

improve this to be consistent with profilefield table. We should wrap that out when moving user profile fields add/updating to the API

Return values
array<string|int, mixed>

The title of the existing user profile fields.

fetchUserSettings()

Fetches the needed info for user settings

public fetchUserSettings([mixed $userid = false ]) : mixed
Parameters
$userid : mixed = false
Return values
mixed

fetchUsersPms()

Fetch private messages statistics from all the users.

public fetchUsersPms([array<string|int, mixed> $options = array() ]) : array<string|int, mixed>

Used for admincp - usertools private message statistics

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

Set of options such as pagination, total pms filter.

  • total int-- if given filter results as users for a given total
  • sortby string -- field to sort results current valid values are (username, total)
  • sortdir string -- ASC or DESC. Only used if sortby is set. If not given will default to ASC
Return values
array<string|int, mixed>

$result Private messages grouped by userid (including some userinfo and pm total count).

find()

Find user

public find(array<string|int, mixed> $user, array<string|int, mixed> $profile, string $orderby, string $direction, int $limitstart[, int $limitnumber = 25 ]) : bool
Parameters
$user : array<string|int, mixed>

An array of common conditions for user search

$profile : array<string|int, mixed>

An array of user profile field conditions for user search

$orderby : string

Order by

$direction : string

Order direction

$limitstart : int

Limit start

$limitnumber : int = 25

Limit number

Return values
bool

|array False if no user found. Otherwise it returns users array as result. The array also contains a field that stores total found user count.

generateMailingList()

Generates users mailing list for the given criteria.

public generateMailingList(array<string|int, mixed> $user, mixed $profile[, mixed $options = array() ]) : bool

Used for admincp - email sending and list generating.

Parameters
$user : array<string|int, mixed>

An array of common conditions for user search @param array $profile An array of user profile field conditions for user search @param array $options Set of options such as activation info and pagination.

$profile : mixed
$options : mixed = array()
Return values
bool

|array False if no user found. Otherwise it returns users array as result. The array also contains a field that stores total found user's e-mail count.

getApiClassName()

public static getApiClassName(mixed $controller) : mixed
Parameters
$controller : mixed
Return values
mixed

getAutocomplete()

Returns suggested usernames for the username autocomplete popup menu.

public getAutocomplete(mixed $searchStr[, mixed $orderby = 'username' ][, mixed $direction = 'ASC' ], mixed $limitstart[, mixed $limitnumber = 15 ]) : array<string|int, mixed>
Parameters
$searchStr : mixed
$orderby : mixed = 'username'
$direction : mixed = 'ASC'
$limitstart : mixed
$limitnumber : mixed = 15
Return values
array<string|int, mixed>

Array containing one element "suggestions" which is an array. Each element is an array containing: 'title' => username without html entities 'value' => username 'id' => userid

getCanCreate()

This is a wrapper for userContext getCanCreate- it returns the content types a user can create

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

-- types the user can create in that node

getGitCanStart()

This likes the channels below a parent node where a user can create starters based on groupintopic

public getGitCanStart(int $parentNodeId) : array<string|int, mixed>
Parameters
$parentNodeId : int

-- the ancestor node id

Return values
array<string|int, mixed>

array of integer, title- the nodeids

getGroupInTopic()

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

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

-- optional

$forceReload : bool = false

-- optional defaults to false

Return values
array<string|int, mixed>

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

getIpLocation()

Return the location for the current user's IP address

public getIpLocation() : mixed
Return values
mixed

getMembersOf()

Returns a list of channels where this user is moderator

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

-- nodeids

getModeratorsOf()

Returns a list of channels where this user is moderator

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

-- nodeids

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 :

(optional)

Return values
array<string|int, mixed>

of information. See the library function for full listing.

getPrivacyOptions()

Mostly a getter for user privacy options.

public getPrivacyOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

Existing user privacy options.

getUsersFromCriteria()

Fetch users and info from a given user criteria Used for admincp - verticalresponse.

public getUsersFromCriteria(mixed $user, array<string|int, mixed> $profile[, mixed $options = array() ]) : array<string|int, mixed>
@param 	array 	$user 		An array of common conditions for user search
Parameters
$user : mixed
$profile : array<string|int, mixed>

An array of user profile field conditions for user search @param array $options Set of options such as activation info and pagination.

$options : mixed = array()
Return values
array<string|int, mixed>

$result Result which includes the 'users' => userlist and the 'totalcount'.

hasPermissions()

Returns global permission value or specific value for a nodeid for current user.

public hasPermissions(string $group, string $permission[, bool $nodeid = false ]) : bool|int
Parameters
$group : string
$permission : string
$nodeid : bool = false

(optional)

Return values
bool|int

havePermissions()

Returns permission values of a group of nodes for current user.

public havePermissions(string $group, string $permission[, array<string|int, mixed> $nodeIds = array() ]) : bool|int
Parameters
$group : string
$permission : string
$nodeIds : array<string|int, mixed> = array()
Tags
see
vB_Api_User::hasPermissions
Return values
bool|int

instance()

Returns an instance of the API object which translates exceptions to an array Use this method for API clients.

public static instance(string $controller[, bool $refresh_cache = false ]) : vB_Api
Parameters
$controller : string

-- name of the API controller to load

$refresh_cache : bool = false

-- true if we want to force the cache to update with a new api object primarily intended for testing

Return values
vB_Api

instanceInternal()

Returns an instance of the API object which doesn't handle exceptions This should only be used in other API objects, not for clients of the API

public static instanceInternal(string $controller[, bool $refresh_cache = false ]) : vB_Api
Parameters
$controller : string

-- name of the API controller to load

$refresh_cache : bool = false

-- true if we want to force the cache to update with a new api object primarily intended for testing

Return values
vB_Api

inviteMembers()

Invites members to a given node channel passing either an array of userids or usernames.

public inviteMembers(mixed $userIds, array<string|int, mixed>|string $userNames, int $nodeId, string $requestType) : mixed

Will combine the list of username with the list of userids to get the list of users to invite.

Parameters
$userIds : mixed
$userNames : array<string|int, mixed>|string
$nodeId : int
$requestType : string

-- Either 'member_to' (blogs) or 'sg_member_to' (social groups)

Return values
mixed

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.

isBannedEmail()

Check whether an email address is banned from the forums

public isBannedEmail(string $email) : bool
Parameters
$email : string

The email address to check

Return values
bool

Whether the email is banned.

isMfaEnabled()

Gets whether or not the user has an enabled MFA record

public isMfaEnabled(int $userid) : mixed

Requires canadminusers permission

Parameters
$userid : int

@return array -- bool enabled

Return values
mixed

killActivation()

public killActivation(mixed $userid, mixed $activateid) : mixed
Parameters
$userid : mixed
$activateid : mixed
Return values
mixed

login()

Login a user

public login(string $username[, string $password = null ][, string $md5password = null ][, mixed $md5password_utf = null ][, string $logintype = null ]) : array<string|int, mixed>
Parameters
$username : string
$password : string = null
$md5password : string = null
$md5password_utf : mixed = null
$logintype : string = null
Tags
deprecated

use login2

Return values
array<string|int, mixed>

'userid' => int the id of the vbulletin user logged in 'password' => string "remeber me token". A value that can be used to create a new session without the user explicitly logging in 'lastvisit' 'lastactivity' 'sessionhash' => the session value used to authenticate the user on subsequent page loads 'cpsessionhash' => value needed to access the admincp. Defines being logged in "as an admin"

login2()

Login a user

public login2(string $username, array<string|int, mixed> $passwords, array<string|int, mixed> $extraAuthInfo[, string $logintype = '' ]) : array<string|int, mixed>
Parameters
$username : string
$passwords : array<string|int, mixed>

-- contains at least one of

  • string password -- plain text password
  • string md5password -- md5 encoded password (legacy)
  • string md5password_utf -- md5 encoded password with utf replacements (legacy)
$extraAuthInfo : array<string|int, mixed>

-- information that might be required to authorize a user, such as numeric code for MFA

$logintype : string = ''
Return values
array<string|int, mixed>

'userid' => int the id of the vbulletin user logged in 'password' => string "remeber me token". A value that can be used to create a new session without the user explicitly logging in 'lastvisit' 'lastactivity' 'sessionhash' => the session value used to authenticate the user on subsequent page loads 'cpsessionhash' => value needed to access the admincp. Defines being logged in "as an admin"

loginExternal()

Log in via a third party provider.

public loginExternal(mixed $provider, mixed $info[, mixed $userid = null ]) : mixed

For now facebook is the only provider supported. We do not support control panel logins via external providers.

Parameters
$provider : mixed
$info : mixed
$userid : mixed = null
Return values
mixed

loginSpecificUser()

Login a user for which we have the userid

public loginSpecificUser(int $userid, array<string|int, mixed> $passwords, array<string|int, mixed> $extraAuthInfo[, string $logintype = '' ]) : array<string|int, mixed>
Parameters
$userid : int
$passwords : array<string|int, mixed>

-- contains at least one of

  • string password -- plain text password
  • string md5password -- md5 encoded password (legacy)
  • string md5password_utf -- md5 encoded password with utf replacements (legacy)
$extraAuthInfo : array<string|int, mixed>

-- information that might be required to authorize a user, such as numeric code for MFA

$logintype : string = ''
Return values
array<string|int, mixed>

'userid' => int the id of the vbulletin user logged in 'password' => string "remeber me token". A value that can be used to create a new session without the user explicitly logging in 'lastvisit' 'lastactivity' 'sessionhash' => the session value used to authenticate the user on subsequent page loads 'cpsessionhash' => value needed to access the admincp. Defines being logged in "as an admin"

logout()

Logout user

public logout([ $logouthash = null ]) : bool
Parameters
$logouthash : = null

Logout hash

Return values
bool

map_vb4_input_to_vb5()

Returns vb5 api method name.

public static map_vb4_input_to_vb5(string $method, array<string|int, mixed> &$request) : string

May alter request array.

Parameters
$method : string

-- vb4 method name

$request : array<string|int, mixed>

-- $_REQUEST array for this api request

Return values
string

map_vb5_errors_to_vb4()

Alters the error array in any way necessary to interface correctly with vb4.

public static map_vb5_errors_to_vb4(string $method, array<string|int, mixed> &$data) : mixed
Parameters
$method : string

-- vb4 method name

$data : array<string|int, mixed>

-- error array from vb5

Return values
mixed

map_vb5_output_to_vb4()

Alters the output array in any way necessary to interface correctly with vb4.

public static map_vb5_output_to_vb4(string $method, array<string|int, mixed> &$data) : mixed
Parameters
$method : string

-- vb4 method name

$data : array<string|int, mixed>

-- output array from vb5

Return values
mixed

memberList()

Fetch a list of user based on the provided criteria

public memberList([array<string|int, mixed> $criteria = [] ]) : array<string|int, mixed>

Will only return a user if their primary user group has the viewable on the memberslist option set.

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

values for criteria: int $pagenumber the page to start from int $perpage number of members to display on a page string $sortfield the foeld to sort by string $sortorder the sort order (asc/desc) string $startswith the first letter(s) the username should match

Return values
array<string|int, mixed>

members - the list of members that match the criteria pagingInfo - pagination information

merge()

Merge two users

public merge(int $sourceuserid, int $destuserid) : mixed
Parameters
$sourceuserid : int
$destuserid : int
Return values
mixed

needMFA()

Indicates if the current user needs to provide an MFA code for login.

public needMFA(string $logintype) : array<string|int, mixed>

Note that it's not entirely pointless to request this for a logged in user as we can still require a login for a cpsession even after a user is logged in.

Parameters
$logintype : string

-- either '', 'cplogin', 'modcplogin', 'mfareset' mfareset is a psuedo login where we reauthorize the login in order to change the mfa code.

Return values
array<string|int, mixed>

-- bool enabled -- true if MFA auth is needed, false if not

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

prune()

Do prune/move users (step 1)

public prune(array<string|int, mixed> $userids, string $dowhat, int $movegroup) : mixed
Parameters
$userids : array<string|int, mixed>

UserID to be pruned or moved

$dowhat : string

'delete' or 'move'

$movegroup : int

Usergroup ID that the users are going to be moved

Return values
mixed

registerNeedAvatarForUsers()

Registers userids that we will later be fetching avatars for. If we register the userids here, they can be fetched in batches.

public registerNeedAvatarForUsers(mixed $userids) : mixed
Parameters
$userids : mixed
Return values
mixed

resetMfaSecret()

Reset the current user's MFA secret

public resetMfaSecret(string $password[, string $mfa_authcode = null ]) : mixed
Parameters
$password : string

-- the user's current password

$mfa_authcode : string = null

-- the authcode for the current secret, not required if the user does not currently have an auth secret

Return values
mixed

save()

Insert or Update an user

public save(int $userid, string $password, array<string|int, mixed> $user, array<string|int, mixed> $options, array<string|int, mixed> $adminoptions, array<string|int, mixed> $userfield[, array<string|int, mixed> $notificationOptions = array() ][, array<string|int, mixed> $hvinput = array() ][, array<string|int, mixed> $extra = array() ][, array<string|int, mixed> $moderatorNotificationOptions = array() ][, array<string|int, mixed> $moderatorEmailNotificationOptions = array() ]) : int
Parameters
$userid : int

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

$password : string

Password for the user. Empty means no change. May be overriden by the $extra array

$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
$options : array<string|int, mixed>

vB options for the user

$adminoptions : array<string|int, mixed>

Admin Override Options for the user

$userfield : array<string|int, mixed>

User's User Profile Field data

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

Human Verify input data. @see vB_Api_Hv::verifyToken()

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

Generic flags or data to affect processing.

  • email
  • newpass
  • password
  • acnt_settings => 1 if we are editing the user as a normal user (suppresses adminoverride if the user is an admin. This is really misnamed and only treats the request as from a normal user even if the user is an admin.
  • fbautoregister => true if we are using the FB quick registration. This skips some checks such as the HV if we actually have a facebook account
$moderatorNotificationOptions : array<string|int, mixed> = array()
$moderatorEmailNotificationOptions : array<string|int, mixed> = array()
Return values
int

New or updated userid.

saveEditorState()

Saves the content entry UI editor "state" where state is the show/hide state of the following 3 content entry UIs: ckeditor toolbar, attachements panel, and smilies panel.

public saveEditorState(mixed $action, mixed $value) : array<string|int, mixed>
Parameters
$action : mixed
$value : mixed
Return values
array<string|int, mixed>

Array containing success and the current editor state

saveSignature()

Verifies and saves a signature for current logged in user. Returns the signature.

public saveSignature(string $signature[, array<string|int, mixed> $filedataids = array() ]) : string
Parameters
$signature : string
$filedataids : array<string|int, mixed> = array()
Return values
string

searchIP()

Search IP Addresses

public searchIP(string $userid[, int $depth = 1 ]) : array<string|int, mixed>
Parameters
$userid : string

An userid. Find IP Addresses for user.

$depth : int = 1

Depth to Search

Return values
array<string|int, mixed>

'regip' User's registration IP. 'postips' IP addresses which the user has ever used to post 'regipusers' Other users who used the same IP address to register

searchUsersByIP()

Search IP Addresses

public searchUsersByIP(string $ipaddress, int $depth) : array<string|int, mixed>
Parameters
$ipaddress : string

An IP Address. Find Users by IP Address.

$depth : int

Search depth

Return values
array<string|int, mixed>

'postipusers' Users who used the IP address to post 'regipusers' Users who used the IP address to register

sendActivateEmail()

public sendActivateEmail(mixed $email) : mixed
Parameters
$email : mixed
Return values
mixed

setCurrentUserPrivacyConsent()

Set privacy consent and for the current user if needed.

public setCurrentUserPrivacyConsent() : mixed
Return values
mixed

setDefaultAvatar()

This sets a user to use one of the default avatars.

public setDefaultAvatar(int $avatarid) : mixed
Parameters
$avatarid : int
Tags
result

array the new avatar info array of custom => bool, 0=> avatarurl (string)

Return values
mixed

setGroupInTopic()

This grants a user additional permissions in a specific channel, by adding to the groupintopic table

public setGroupInTopic(int $userid, array<string|int, mixed>|int $nodeids, int $usergroupid) : bool
Parameters
$userid : int
$nodeids : array<string|int, mixed>|int
$usergroupid : int
Return values
bool

setMfaEnabled()

Sets the users MFA record to enabled or disabled

public setMfaEnabled(int $userid, bool $enabled) : array<string|int, mixed>

Requires canadminusers permission

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

('success' => true)

setNewPassword()

Set a new password for a user. Used by "forgot password" function.

public setNewPassword(int $userid, string $activationid, string $newpassword) : array<string|int, string>
Parameters
$userid : int
$activationid : string

Activation ID

$newpassword : string
Return values
array<string|int, string>

keys 'password_reset' & 'setnewpw_message', values

unixtimestampToUserDateString()

public unixtimestampToUserDateString(mixed $timestamp[, mixed $userid = false ][, mixed $format = "Y-m-d H:i:s" ][, mixed $ignoreDST = true ][, mixed $locale = '' ]) : mixed
Parameters
$timestamp : mixed
$userid : mixed = false
$format : mixed = "Y-m-d H:i:s"
$ignoreDST : mixed = true
$locale : mixed = ''
Return values
mixed

unsetGroupInTopic()

This removes additional permissions a user was given in a specific channel, by removing from the groupintopic table

public unsetGroupInTopic(int $userid, array<string|int, mixed>|int $nodeids, mixed $usergroupid) : bool
Parameters
$userid : int

user for whom we are unsetting GIT records

$nodeids : array<string|int, mixed>|int

(integer or array of integers) nodeid(s) of the GIT record(s) to unset @param int $usergroupid usergroupid of the GIT record to unset

$usergroupid : mixed
Return values
bool

updateGuestPrivacyConsent()

Updates guest privacy consent

public updateGuestPrivacyConsent(mixed $consent) : mixed
Parameters
$consent : mixed
Return values
mixed

updateStatus()

Updates the user status

public updateStatus(mixed $userid, mixed $status) : string
Parameters
$userid : mixed
$status : mixed
Return values
string

Updated status from user.

useCoppa()

This checks whether the site uses COPPA review

public useCoppa() : bool
Return values
bool

userTimeStrToUnixtimestamp()

public userTimeStrToUnixtimestamp(mixed $strTime[, mixed $userid = false ][, mixed $ignoreDST = true ]) : mixed
Parameters
$strTime : mixed
$userid : mixed = false
$ignoreDST : mixed = true
Return values
mixed

vBMktime()

translate a year/month/day/hour/minute to a Unix timestamp.

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

-- array of year, month, day, hour, minute, second. Year and month are required.

Return values
int

-- Unix Timestamp, corrected for the user's time setting

verifyFlashMessageSignature()

Verifies that a flash message passed through the URL is signed and valid

public verifyFlashMessageSignature(mixed $phrase, mixed $timestamp, mixed $hash) : array<string|int, mixed>
Parameters
$phrase : mixed
$timestamp : mixed
$hash : mixed
Return values
array<string|int, mixed>

Returns success=>true in the array if the message is valid.

__construct()

Constructor

protected __construct() : mixed
Return values
mixed

_processProfileFields()

Process Profile Fields for templates

protected _processProfileFields(array<string|int, mixed> &$profilefields, array<string|int, mixed> $currentvalues) : void
Parameters
$profilefields : array<string|int, mixed>

(ref) Profile fields (database records array) to be processed.

$currentvalues : array<string|int, mixed>

Current values of the profile fields

Return values
void

_searchIPUsage()

Rewrite function construct_ip_usage_table()

protected _searchIPUsage(mixed $ipaddress, mixed $prevuserid[, mixed $depth = 1 ]) : mixed
Parameters
$ipaddress : mixed
$prevuserid : mixed
$depth : mixed = 1
Return values
mixed

_searchRegisterIP()

Rewrite function construct_ip_register_table()

protected _searchRegisterIP(mixed $ipaddress, mixed $prevuserid[, mixed $depth = 1 ]) : mixed
Parameters
$ipaddress : mixed
$prevuserid : mixed
$depth : mixed = 1
Return values
mixed

_searchUserIP()

Rewrite function construct_user_ip_table()

protected _searchUserIP(mixed $userid, mixed $previpaddress[, mixed $depth = 2 ]) : mixed
Parameters
$userid : mixed
$previpaddress : mixed
$depth : mixed = 2
Return values
mixed

checkHasAdminPermission()

Determines if the calling user has the given admin permission, and if not throws an exception

protected checkHasAdminPermission(string|array<string|int, mixed> $adminPermission) : none

Checks for:

  • A valid CP Session
  • The passed adminpermission.
Parameters
$adminPermission : string|array<string|int, mixed>

The admin permission to check. If an array then the check passes if the user has any of the permissions given.

Tags
throws
inlinemodauth_required

-- The current session is not a mod/admin session

throws
nopermission_loggedin

-- The user does not have the given permission

throws
no_permission

-- The user is not logged in at all.

Return values
none

checkHasPermission()

Determines if the calling user has the given bitfield permission, and if not, throws a 'no_permission' exception.

protected checkHasPermission(string $group, string $permission) : none
Parameters
$group : string

The permission group where the permission is located

$permission : string

The permission to check

Tags
throws
no_permission
Return values
none

checkIsLoggedIn()

Determines if the calling user has the given admin permission, and if not throws an exception

protected checkIsLoggedIn() : mixed
Return values
mixed

computeMembersOf()

Analyzes what groups this user belongs to in specific channels. Stores in member variables

protected computeMembersOf(int $userid) : mixed
Parameters
$userid : int
Return values
mixed

getApiClass()

protected static getApiClass(mixed $controller[, mixed $errorCheck = true ]) : mixed
Parameters
$controller : mixed
$errorCheck : mixed = true
Return values
mixed

getApiClassNameInternal()

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

getProfileFieldConditions()

protected getProfileFieldConditions(mixed $profilefield, mixed $profile) : mixed
Parameters
$profilefield : mixed
$profile : mixed
Return values
mixed

hasAdminPermission()

Determines if the calling user has the given admin permission

protected hasAdminPermission(string|array<string|int, mixed> $adminPermission) : bool

Useful if you need to know if the calling user but do not care why they do not have that permission. Generally useful if there is a behavior difference between admins and non admins, but the call can be processed for either.

Parameters
$adminPermission : string|array<string|int, mixed>

The admin permission to check. If an array then the check passes if the user has any of the permissions given.

Return values
bool

true if checks pass, false otherwise

inDebugMode()

protected inDebugMode() : mixed
Return values
mixed

isDisableFalseReturnOnly()

Checks if method returns false response only when API is disabled.

protected isDisableFalseReturnOnly(mixed $method) : bool
Parameters
$method : mixed
Return values
bool

Indicates whether method returns false response only.

isWhiteListed()

Checks if method is white listed when API is disabled.

protected isWhiteListed(mixed $method) : bool
Parameters
$method : mixed
Return values
bool

Indicates whether method is or is not a white list.

processPasswordResetLockout()

protected processPasswordResetLockout(mixed $userinfo, mixed $useractivation, mixed $activationid) : mixed
Parameters
$userinfo : mixed
$useractivation : mixed
$activationid : mixed
Return values
mixed

setController()

Set controller

protected setController(mixed $controller) : mixed
Parameters
$controller : mixed
Return values
mixed

setCurrentUserFlags()

Set current user flags to display or not certain user items.

protected setCurrentUserFlags(mixed &$userInfo) : mixed
Parameters
$userInfo : mixed
Return values
mixed

alwaysAllowSave()

Skip some checks (current save profile permission and birthday required) when updating an existing user if only specific elements are set in the params. We want the user to be able to update these items (usually via some side call the user isn't explicitly aware of) regardless of their permissions.

private alwaysAllowSave(mixed $userid, mixed $password, mixed $user, mixed $options, mixed $adminoptions, mixed $userfield, mixed $notificationOptions, mixed $hvinput, mixed $extra, mixed $moderatorNotificationOptions, mixed $moderatorEmailNotificationOptions) : mixed

We never want to skip these checks when creating a new user.

Parameters
$userid : mixed
$password : mixed
$user : mixed
$options : mixed
$adminoptions : mixed
$userfield : mixed
$notificationOptions : mixed
$hvinput : mixed
$extra : mixed
$moderatorNotificationOptions : mixed
$moderatorEmailNotificationOptions : mixed
Return values
mixed

blankUserOnlyFields()

Blank fields that only the user themselves should see. We can also allow admins with the correct privs to see those too. Note that this function doesn't actually check if the user should be able to see them, it just blanks them out.

private blankUserOnlyFields( $userInfo) : The

This doesn't actually remove the keys from the array in order to provide a consistant array format regardless of the user's permissions.

Parameters
$userInfo :
Return values
The

user info array without the user fields set to ''

checkBirthday()

private checkBirthday(mixed $newuser, mixed $user, mixed $olduser, mixed $adminoverride, mixed $vboptions) : mixed
Parameters
$newuser : mixed
$user : mixed
$olduser : mixed
$adminoverride : mixed
$vboptions : mixed
Return values
mixed

checkEmail()

Checks if email is empty -- and throws an exception if that's a problem.

private checkEmail(bool $newuser, array<string|int, mixed> $user, array<string|int, mixed> $userinfo, bool $adminoverride) : mixed

New users always require a non-empty email address. Existing users may not blank out an existing email address. Existing users with an already empty email address are allowed to maintain it, although it's not recommended (legacy behavior support).

This function does not validate the email. It only checks if the email is empty.

Parameters
$newuser : bool

True if user is new one

$user : array<string|int, mixed>

Incoming user data to check

$userinfo : array<string|int, mixed>

Current user information (if availiable)

$adminoverride : bool

true if admin is saving this user "as an admin"

Tags
throws

vB_Exception_Api('fieldmissing_email')

throws

vB_Exception_Api('banemail')

Return values
mixed

checkUsernameInternal()

private checkUsernameInternal(mixed $newuser, mixed $user, mixed $olduser, mixed $adminoverride, mixed $vboptions) : mixed
Parameters
$newuser : mixed
$user : mixed
$olduser : mixed
$adminoverride : mixed
$vboptions : mixed
Return values
mixed

cms_vb4_to_vb5_method_mapping()

private static cms_vb4_to_vb5_method_mapping(mixed $method, mixed &$request) : mixed
Parameters
$method : mixed
$request : mixed
Return values
mixed

default_vb4_to_vb5_method_mapping()

private static default_vb4_to_vb5_method_mapping(mixed $method) : mixed
Parameters
$method : mixed
Return values
mixed

fetchUserSearchCondition()

Convert the search array to the assertor conditions.

private fetchUserSearchCondition(array<string|int, mixed> $user, array<string|int, mixed> $profile) : array<string|int, mixed>

Refactored from adminfunctions_user.php fetch_user_search_sql

Parameters
$user : array<string|int, mixed>

-- user fields to search

$profile : array<string|int, mixed>

-- profile fields to search

Return values
array<string|int, mixed>
  • conditions array -- conditions suitable for passing to the querybuilder class
  • joins -- a list of table aliases required by the filters. Intended to allow the method queries that use this information to only join to tables needed for a particular filter. Does not include the base user table which is assumed to be the core table in the query.
  • exceptions array -- information to feed custom filters that don't work with querybuilder the method queries that consume this infromatoin

getFiledataIdsFromSignature()

private getFiledataIdsFromSignature(mixed $signature) : mixed
Parameters
$signature : mixed
Return values
mixed

hasAdminPermissionInternal()

Internal function to power the previous cover functions

private hasAdminPermissionInternal(mixed $adminPermission) : mixed
@param string|array $adminPermission The admin permission to check.  If an array

then the check passes if the user has any of the permissions given.

Parameters
$adminPermission : mixed
Return values
mixed

loginInternal()

private loginInternal(mixed $userInfo, mixed $username, mixed $passwords, mixed $extraAuthInfo, mixed $logintype) : mixed
Parameters
$userInfo : mixed
$username : mixed
$passwords : mixed
$extraAuthInfo : mixed
$logintype : mixed
Return values
mixed

processLoginError()

Processes login error.

private processLoginError( $credential,  $logintype,  $strikes) : mixed
Parameters
$credential :
$logintype :
$strikes :
Tags
throws
Exception
throws
vB_Exception_Api
Return values
mixed

processMfaError()

Processes login error.

private processMfaError( $credential,  $logintype,  $strikes) : mixed
Parameters
$credential :
$logintype :
$strikes :
Tags
throws
Exception
throws
vB_Exception_Api
Return values
mixed

remove_nulls()

private static remove_nulls(mixed &$data) : mixed
Parameters
$data : mixed
Return values
mixed

revertLocale()

private revertLocale() : mixed
Return values
mixed

sanitizeUserInfo()

private sanitizeUserInfo(mixed $userInfo, mixed $currentUserId) : mixed
Parameters
$userInfo : mixed
$currentUserId : mixed
Return values
mixed

saveEmailPassword()

Shortcut to saving only email and password if user only has permission to modify password and email

private saveEmailPassword(mixed $email, mixed $newpass, mixed $password) : int

Saves the email and password for the current logged in user.

Parameters
$email : mixed
$newpass : mixed
$password : mixed
Return values
int

New or updated userid.

setUsergroup()

private setUsergroup(mixed &$user, mixed $newuser, mixed $vboptions, mixed $fbautoregister, mixed $coppauser) : mixed
Parameters
$user : mixed
$newuser : mixed
$vboptions : mixed
$fbautoregister : mixed
$coppauser : mixed
Return values
mixed

setUserLocation()

private setUserLocation(mixed $vboptions, mixed $request, mixed $newuser, mixed $changingCurrentUser, mixed $adminoverride, mixed $userinfo, mixed &$user) : mixed
Parameters
$vboptions : mixed
$request : mixed
$newuser : mixed
$changingCurrentUser : mixed
$adminoverride : mixed
$userinfo : mixed
$user : mixed
Return values
mixed

stripPrivateUserFields()

Strips fields that should *never* be returned by the API. Full stop. Don't do it.

private stripPrivateUserFields( $userInfo) : The

not even if the user is a super special mega admin.

Parameters
$userInfo :
Return values
The

user info array without the private fields.

tempSetLocale()

private tempSetLocale(mixed $locale) : mixed
Parameters
$locale : mixed
Return values
mixed

validateMembergroupids()

private validateMembergroupids(mixed &$user, mixed $newuser, mixed $vboptions, mixed $isfacebooksignup) : mixed
Parameters
$user : mixed
$newuser : mixed
$vboptions : mixed
$isfacebooksignup : mixed
Return values
mixed

validateUserTitle()

private validateUserTitle(mixed &$user, mixed $olduser, mixed $adminoverride) : mixed
Parameters
$user : mixed
$olduser : mixed
$adminoverride : mixed
Return values
mixed

verifyAuthentication()

Port of function verify_authentication()

private verifyAuthentication( $userInfo,  $passwords[, mixed $logintype = '' ]) : array<string|int, mixed>|bool
Parameters
$userInfo :

Recieves an array with username and email

$passwords :

@see vB_Library_Login::verifyPasswordFromInfo $passwords parameter

$logintype : mixed = ''
Return values
array<string|int, mixed>|bool

false if auth failed. User info array if auth successfully. userid -- id of the user newly logged in password -- remember me token lastvisit -- the newly logged in user's last visit, lastactivity -- the newly logged in user's last activity

verifyCredentialExistanceError()

Verify credential existance error

private verifyCredentialExistanceError( $username) : mixed
Parameters
$username :
Tags
throws
Exception
throws
vB_Exception_Api
Return values
mixed

verifyMfaAuthentication()

Verify that the MFA information passes.

private verifyMfaAuthentication(mixed $userid, string $logintype, array<string|int, mixed> $mfaAuth) : bool

Either throws an exception or returns true. Is always callable, will check to ensure that the MFA check is require before doing the validation (validation is considered passed if the check is not required)

Parameters
$userid : mixed
$logintype : string

-- either cplogin, modcplogin, or blank (regular login)

$mfaAuth : array<string|int, mixed>

-- auth info for MFA with fields: * *

Return values
bool

-- if the auth succeeded

verifyStrikeError()

Verifies strike errors.

private verifyStrikeError( $strikes) : mixed
Parameters
$strikes :
Tags
throws
Exception
throws
vB_Exception_Api
Return values
mixed

wrapLoggerIfNeeded()

Wrap the api object with the log wrapper class if needed.

private static wrapLoggerIfNeeded(mixed $controller, mixed $api_object) : mixed
Parameters
$controller : mixed
$api_object : mixed
Return values
mixed

Search results