class vB_DataManager_User extends vB_DataManager

Traits

Properties

protected array $validfields Array of recognised and required fields for users, and their types
protected array $bitfields Array of field names that are bitfields, together with the name of the variable in the registry with the definitions.
protected array $setfields Array to store the names of fields that have been sucessfully set from vB_DataManager
array $rawfields Array to store the names for fields that will be taking raw SQL from vB_DataManager
vB_Registry $registry The vBulletin registry object from vB_DataManager
vB_Database $dbobject The vBulletin database object from vB_DataManager
protected vB_dB_Assertor $assertor The vBulletin dB_Assertor object from vB_DataManager
protected vB_Session $session The vBulletin vB_Session object from vB_DataManager
protected array $userinfo The userinfo array from vB_Session object from vB_DataManager
protected array $options The options array from vB_Datastore object from vB_DataManager
protected vB_Datastore $datastore The vBulletin vB_Datastore object from vB_DataManager
array $errors Array to store any errors encountered while building data from vB_DataManager
string $error_handler The error handler for this object from vB_DataManager
array $existing Array to store existing data from vB_DataManager
array $info Array to store information from vB_DataManager
string $condition Condition to be used. Can be either array('keyfield' => 'value') or a valid assertor vB_dB_Query::CONDITIONS_KEY setting. from vB_DataManager
string $table The main table this class deals with
callback $failure_callback Callback to execute just before an error is logged. from vB_DataManager
null|bool $presave_called This variable prevents the pre_save() method from being called more than once. from vB_DataManager
protected $needRegistry
protected $keyField
$user
$userfield
$usertextfield
boolean $insertedadmin Whether or not we have inserted an administrator record
boolean $adminoverride Whether or not to skip some checks from the admin cp
array $list_types Types of lists stored in usertextfield, named list.
array $userchangelog Arrays to store stuff to save to userchangelog table
boolean $user_changelog_state We want to log or not the user changes
array $user_changelog_fields Which fieldchanges will be logged

Methods

__sleep()

No description

__wakeup()

No description

__construct(vB_Registry $registry = NULL, integer $errtype = NULL)

Constructor - Checks for necessity of registry object

boolean
set_existing(array $existing)

Sets the existing data

set_condition($params = null)

Sets the condition to be used in WHERE clauses, based upon the $this->existing data and the $this->condition_constuct condition template.

is_field_set($field)

Determines if a fields is set

mixed
fetch_field($fieldname, $table = null)

Fetches info about the current data object - if a new value is set, it returns this, otherwise it will return the existing data

loadExisting($keyValue)

No description

boolean
set(string $fieldname, mixed $value, boolean $clean = true, boolean $doverify = true, string $table = null)

Sets the supplied data to be part of the data to be saved. Use setr() if a reference to $value is to be passed

boolean
setr(string $fieldname, mixed $value, boolean $clean = true, boolean $doverify = true)

Sets the supplied data to be part of the data to be saved

boolean
set_bitfield(string $fieldname, string $bitname, boolean $onoff)

Sets a bit in a bitfield

set_info(string $fieldname, mixed $value)

Rather like set(), but sets data into the $this->info array instead. Use setr_info if $value if a reference to value is to be passed

setr_info(string $fieldname, mixed $value)

Rather like set(), but sets reference to data into the $this->info array instead

boolean
verify(string $fieldname, mixed $value, boolean $doverify = true)

Verifies that the supplied data is one of the fields used by this object

do_unset(string $fieldname, string $table = null)

Unsets a values that has already been set

do_set(string $fieldname, mixed $value, string $table = null)

Takes valid data and sets it as part of the data to be saved

boolean
check_required()

Checks through the required fields for this object and ensures that all required fields have a value

array
fetchQueryInfo(string $tableName)

Returns an array with object info required for query methods as first argument

boolean
db_update(string $tableprefix, string $table, string $condition = null, boolean $doquery = true, mixed $delayed = false, boolean $affected_rows = false)

Creates and runs an UPDATE query to save the data from the object into the database

integer
db_insert(string $tableprefix, string $table, boolean $doquery = true, bool $replace = false)

Creates and runs an INSERT query to save the data from the object into the database

integer
db_delete(string $tableprefix, string $table, array $condition = '', boolean $doquery = true)

Generates the SQL to delete a record from a database table, then executes it

bool
has_errors(bool $die = true)

Check if the DM currently has errors. Will kill execution if it does and $die is true.

array
get_errors()

Returns the array of errors

get_exception()

No description

mixed
save(boolean $doquery = true, This $delayed = false, bool $affected_rows = false, bool $replace = false)

Saves the data from the object into the specified database tables

boolean
pre_save(boolean $doquery = true)

Any checks to run immediately before saving. If returning false, the save will not take place.

post_save_each(boolean $doquery = true)

Additional data to update after a save call (such as denormalized values in other tables).

post_save_once(boolean $doquery = true)

Additional data to update after a save call (such as denormalized values in other tables).

integer
delete($doquery = true)

Deletes a user

pre_delete(boolean $doquery = true)

Additional data to update before a delete call (such as denormalized values in other tables).

post_delete(boolean $doquery = true)

Any code to run after deleting

boolean
setErrorHandler(string $errtype = vB_DataManager_Constants::ERRTYPE_STANDARD)

Sets the error handler for the object

error(string $errorphrase)

Shows an error message and halts execution - use this in the same way as print_stop_message();

set_failure_callback(callback $callback)

Sets the function to call on an error.

boolean
verify_userid(integer $userid)

Verifies that the specified user exists

boolean
verify_username(string $username)

Verifies that the provided username is valid, and attempts to correct it if it is not valid

boolean
verify_nonzero(integer $int)

Verifies that an integer is greater than zero

boolean
verify_nonzero_or_negone(integer $int)

Verifies that an integer is greater than zero or the special value -1 this rule matches a fair number of id columns

boolean
verify_nonempty(string $string)

Verifies that a string is not empty

boolean
verify_commalist(mixed $list)

Verifies that a variable is a comma-separated list of integers

boolean
verify_spacelist(mixed $list)

Verifies that a variable is a space-separated list of integers

boolean
verify_list(mixed $list, string $glue = ',', boolean $dropzero = false)

Creates a valid string of comma-separated integers

boolean
verify_serialized(mixed $data)

Verifies that input is a serialized array (or force an array to serialize)

boolean
verify_ipaddress(string $ipaddress)

Verifies an IP address - currently only works with IPv4

boolean
verify_md5(string $md5)

Verifies that a string is an MD5 string

boolean
verify_email(string $email)

Verifies that an email address is valid

boolean
verify_link(string $link, boolean $strict = false)

Verifies that a hyperlink is valid

boolean
verify_date_array(array $date)

Verifies a date array as a valid unix timestamp

boolean
forceItemInSet(mixed $data, array $validarray, mixed $default)

Checks that data is in the valid array. If it is not, set data to the $default.

string
fetchTableBase(string $tablename)

Fetches the base table name even if the parameter contains the package prefix.

deleteFile(string $file)

Check if a file exists, and then delete it if it does.

boolean
verify_homepage(string $homepage)

Verifies that the user's homepage is valid

boolean
verify_threadedmode(integer $threadedmode)

Verifies that $threadedmode is a valid value, and sets the appropriate options to support it.

boolean
verify_emailnotification(integer $emailnotification)

Verifies that an email notification choice is valid and workable

boolean
verify_maxposts(integer $maxposts)

Verifies the value of user.maxposts, setting the forum default number if the value is invalid

boolean
verify_reputation(integer $reputation)

Verifies a valid reputation value, and sets the appropriate reputation level

boolean
verify_birthday(mixed $birthday)

Verifies that the provided birthday is valid

boolean
verify_useremail(string $email)

Verifies that everything is hunky dory with the user's email field

boolean
verify_parentemail(string $parentemail)

Verifies that the provided parent email address is valid

boolean
verify_usergroupid(integer $usergroupid)

Verifies that the usergroup provided is valid

boolean
verify_displaygroupid(integer $displaygroupid)

Verifies that the provided displaygroup ID is valid

boolean
verify_referrerid(mixed $referrerid)

Verifies a specified referrer

boolean
verify_msn(string $msn)

Verifies an MSN handle

boolean
verify_skype(string $skype)

Verifies a Skype name

verify_customtitle($data)

No description

verify_privacy_options($pOptions)

Verifies that privacy options are valid

verify_showvbcode($data)

No description

verify_showbirthday($data)

No description

verify_autosubscribe($data)

No description

verify_logintype($data)

No description

boolean
check_password_history(integer $password, integer $historylength)

Checks to see if a password is in the user's password history

set_usertitle(string $customtext, boolean $reset, array $usergroup, boolean $canusecustomtitle, boolean $isadmin)

Sets the values for user[usertitle] and user[customtitle]

false|string
set_ladder_usertitle(integer $posts)

Sets the ladder-based or group based user title for a particular amount of posts.

false|string
set_ladder_usertitle_relative(integer $relative_post_offset)

Sets the ladder usertitle relative to the current number of posts.

string
censor_custom_title(string $usertitle)

Checks a string for words banned in custom user titles and replaces them with the censor character

string
set_userfields(array $values, bool $verify = true, string $all_fields = 'normal', bool $skip_unset_required_fields = false)

Validates and sets custom user profile fields

set_dst(integer $dst)

Sets DST options

set_registration_defaults()

Sets registration defaults

updateDeletedUserData()

Updates data after user being deleted.

update_username(integer $userid, string $username = null)

Updates all denormalized tables that contain a 'username' field (or field that holds a username)

update_password_history(integer $userid)

Inserts a record into the password history table if the user's password has changed

update_style_cookie(integer $userid)

Resets the session styleid and styleid cookie to the user's profile choice

update_language_cookie(integer $userid)

Resets the languageid cookie to the user's profile choice

update_threadedmode_cookie(integer $userid)

Resets the threadedmode cookie to the user's profile choice

boolean
usergroups_changed()

Checks to see if a user's usergroup memberships have changed

boolean
is_admin(integer $usergroupid, string $membergroupids)

Checks usergroupid and membergroupids to see if the user has admin privileges

boolean
is_supermod(integer $usergroupid, string $membergroupids)

Checks usergroupid and membergroupids to see if the user has super moderator privileges

integer
count_other_admins(integer $userid)

Counts the number of administrators OTHER THAN the user specified

set_admin(integer $userid, boolean $usergroups_changed, boolean $isadmin, boolean $wasadmin = false)

Inserts or deletes a record from the administrator table if necessary

set_supermod(integer $userid, boolean $usergroups_changed, boolean $issupermod, boolean $wassupermod = false)

Inserts or deletes a record from the moderators table if necessary

update_ban_status(integer $userid)

Bla bla bla

send_welcomepm($fromuser = null, $recipient = false)

Sends a welcome pm to the user

Details

in vB_Trait_NoSerialize at line 15
__sleep()

in vB_Trait_NoSerialize at line 20
__wakeup()

in vB_DataManager at line 203
__construct(vB_Registry $registry = NULL, integer $errtype = NULL)

Constructor - Checks for necessity of registry object

Note that this method will accept only the $errtype parameter (via some magic checking of the parameters) and this is the preferred way of calling the datamanager functions. The registry object is deprecated and will be created internally for those managers that still need it.

Parameters

vB_Registry $registry -- Instance of the vBulletin data registry object - expected to have the database object as one of its $this->db member.
integer $errtype --One of the ERRTYPE_x constants

in vB_DataManager at line 262
boolean set_existing(array $existing)

Sets the existing data

Parameters

array $existing Optional array of data describing the existing data we will be updating

Return Value

boolean Returns true if successful

in vB_DataManager at line 290
set_condition($params = null)

Sets the condition to be used in WHERE clauses, based upon the $this->existing data and the $this->condition_constuct condition template.

Parameters

$params

in vB_DataManager at line 342
is_field_set($field)

Determines if a fields is set

Parameters

$field

in vB_DataManager at line 354
mixed fetch_field($fieldname, $table = null)

Fetches info about the current data object - if a new value is set, it returns this, otherwise it will return the existing data

Parameters

$fieldname
$table

Return Value

mixed The requested data

in vB_DataManager at line 378
protected loadExisting($keyValue)

Parameters

$keyValue

in vB_DataManager at line 425
boolean set(string $fieldname, mixed $value, boolean $clean = true, boolean $doverify = true, string $table = null)

Sets the supplied data to be part of the data to be saved. Use setr() if a reference to $value is to be passed

Parameters

string $fieldname The name of the field to which the supplied data should be applied
mixed $value The data itself
boolean $clean Clean data, or insert it RAW (used for non-arbitrary updates, like posts = posts + 1)
boolean $doverify Whether to verify the data with the appropriate function. Still cleans data if previous arg is true.
string $table Table name to force. Leave as null to use the default table

Return Value

boolean Returns false if the data is rejected for whatever reason

in vB_DataManager at line 469
boolean setr(string $fieldname, mixed $value, boolean $clean = true, boolean $doverify = true)

Sets the supplied data to be part of the data to be saved

Parameters

string $fieldname The name of the field to which the supplied data should be applied
mixed $value The data (reference) itself
boolean $clean Clean data, or insert it RAW (used for non-arbitrary updates, like posts = posts + 1)
boolean $doverify Whether to verify the data with the appropriate function. Still cleans data if previous arg is true.

Return Value

boolean Returns false if the data is rejected for whatever reason

in vB_DataManager at line 511
boolean set_bitfield(string $fieldname, string $bitname, boolean $onoff)

Sets a bit in a bitfield

Parameters

string $fieldname Name of the database bitfield (options, permissions etc.)
string $bitname Name of the bit within the bitfield (canview, canpost etc.)
boolean $onoff Whether the bit should be set or not

Return Value

boolean

in vB_DataManager at line 533
set_info(string $fieldname, mixed $value)

Rather like set(), but sets data into the $this->info array instead. Use setr_info if $value if a reference to value is to be passed

Parameters

string $fieldname The name of the field to which the supplied data should be applied
mixed $value The data itself

in vB_DataManager at line 548
setr_info(string $fieldname, mixed $value)

Rather like set(), but sets reference to data into the $this->info array instead

Parameters

string $fieldname The name of the field to which the supplied data should be applied
mixed $value The data (reference) itself

in vB_DataManager at line 569
boolean verify(string $fieldname, mixed $value, boolean $doverify = true)

Verifies that the supplied data is one of the fields used by this object

Also ensures that the data is of the correct type, and attempts to correct errors in the supplied data.

Parameters

string $fieldname The name of the field to which the supplied data should be applied
mixed $value The data itself
boolean $doverify Whether to verify the data with the appropriate function. Data is still cleaned though.

Return Value

boolean Returns true if the data is one of the fields used by this object, and is the correct type (or has been successfully corrected to be so)

in vB_DataManager at line 614
do_unset(string $fieldname, string $table = null)

Unsets a values that has already been set

Parameters

string $fieldname The name of the field that is to be unset
string $table Table name to force. Leave as null to use the default table

at line 1562
do_set(string $fieldname, mixed $value, string $table = null)

Takes valid data and sets it as part of the data to be saved

Parameters

string $fieldname The name of the field to which the supplied data should be applied
mixed $value The data itself
string $table Table name to force. Leave as null to use the default table

in vB_DataManager at line 655
boolean check_required()

Checks through the required fields for this object and ensures that all required fields have a value

Return Value

boolean Returns true if all required fields have a valid value set

in vB_DataManager at line 674
protected array fetchQueryInfo(string $tableName)

Returns an array with object info required for query methods as first argument

Parameters

string $tableName

Return Value

array

in vB_DataManager at line 698
boolean db_update(string $tableprefix, string $table, string $condition = null, boolean $doquery = true, mixed $delayed = false, boolean $affected_rows = false)

Creates and runs an UPDATE query to save the data from the object into the database

Parameters

string $tableprefix The system's table prefix
string $table The name of the database table to be affected (do not include TABLE_PREFIX in your argument)
string $condition Specify the WHERE condition here. For example, 'userid > 10 AND posts < 50'
boolean $doquery Whether or not to actually run the query
mixed $delayed This is no longer used.
boolean $affected_rows Whether to return the number of affected rows

Return Value

boolean Returns true on success

in vB_DataManager at line 787
integer db_insert(string $tableprefix, string $table, boolean $doquery = true, bool $replace = false)

Creates and runs an INSERT query to save the data from the object into the database

Parameters

string $tableprefix The system's table prefix
string $table The name of the database table to be affected (do not include TABLE_PREFIX in your argument)
boolean $doquery Whether or not to actually run the query
bool $replace Perform REPLACE INTO instead of INSERT

Return Value

integer Returns the ID of the inserted record

in vB_DataManager at line 852
integer db_delete(string $tableprefix, string $table, array $condition = '', boolean $doquery = true)

Generates the SQL to delete a record from a database table, then executes it

Parameters

string $tableprefix The system's table prefix
string $table The name of the database table to be affected (do not include TABLE_PREFIX in your argument)
array $condition Specify the dbasserter condition for the DELETE here.
boolean $doquery Whether or not to actually run the query

Return Value

integer The number of records deleted

in vB_DataManager at line 884
bool has_errors(bool $die = true)

Check if the DM currently has errors. Will kill execution if it does and $die is true.

Parameters

bool $die Whether or not to end execution if errors are found; ignored if the error type is ERRTYPE_SILENT

Return Value

bool True if there are errors, false otherwise

in vB_DataManager at line 934
array get_errors()

Returns the array of errors

Return Value

array --

in vB_DataManager at line 939
get_exception()

at line 1611
mixed save(boolean $doquery = true, This $delayed = false, bool $affected_rows = false, bool $replace = false)

Saves the data from the object into the specified database tables

Parameters

boolean $doquery Do the query?
This $delayed is no longer used.
bool $affected_rows Whether to return the number of affected rows.
bool $replace Perform REPLACE INTO instead of INSERT

Return Value

mixed If this was an INSERT query, the INSERT ID is returned

at line 1719
boolean pre_save(boolean $doquery = true)

Any checks to run immediately before saving. If returning false, the save will not take place.

Parameters

boolean $doquery Do the query?

Return Value

boolean True on success; false if an error occurred

at line 1862
post_save_each(boolean $doquery = true)

Additional data to update after a save call (such as denormalized values in other tables).

Parameters

boolean $doquery Do the query?

in vB_DataManager at line 1118
post_save_once(boolean $doquery = true)

Additional data to update after a save call (such as denormalized values in other tables).

In batch updates, is executed once after all records are updated.

Parameters

boolean $doquery Do the query?

at line 2015
integer delete($doquery = true)

Deletes a user

Parameters

$doquery

Return Value

integer The number of rows deleted

in vB_DataManager at line 1166
pre_delete(boolean $doquery = true)

Additional data to update before a delete call (such as denormalized values in other tables).

Parameters

boolean $doquery Do the query?

at line 2068
post_delete(boolean $doquery = true)

Any code to run after deleting

Parameters

boolean $doquery Do the query?

in vB_DataManager at line 1191
boolean setErrorHandler(string $errtype = vB_DataManager_Constants::ERRTYPE_STANDARD)

Sets the error handler for the object

Parameters

string $errtype Error type

Return Value

boolean

in vB_DataManager at line 1214
error(string $errorphrase)

Shows an error message and halts execution - use this in the same way as print_stop_message();

Parameters

string $errorphrase Phrase name for error message

in vB_DataManager at line 1277
set_failure_callback(callback $callback)

Sets the function to call on an error.

Parameters

callback $callback A valid callback (either a function name, or specially formed array)

in vB_DataManager at line 1292
boolean verify_userid(integer $userid)

Verifies that the specified user exists

Parameters

integer $userid User ID

Return Value

boolean Returns true if user exists

at line 344
boolean verify_username(string $username)

Verifies that the provided username is valid, and attempts to correct it if it is not valid

Parameters

string $username Username

Return Value

boolean Returns true if the username is valid, or has been corrected to be valid

in vB_DataManager at line 1398
protected boolean verify_nonzero(integer $int)

Verifies that an integer is greater than zero

Parameters

integer $int Value to check

Return Value

boolean

in vB_DataManager at line 1411
protected boolean verify_nonzero_or_negone(integer $int)

Verifies that an integer is greater than zero or the special value -1 this rule matches a fair number of id columns

Parameters

integer $int Value to check

Return Value

boolean

in vB_DataManager at line 1423
protected boolean verify_nonempty(string $string)

Verifies that a string is not empty

Parameters

string $string Text to check

Return Value

boolean

in vB_DataManager at line 1437
protected boolean verify_commalist(mixed $list)

Verifies that a variable is a comma-separated list of integers

Parameters

mixed $list List (can be string or array)

Return Value

boolean

in vB_DataManager at line 1449
protected boolean verify_spacelist(mixed $list)

Verifies that a variable is a space-separated list of integers

Parameters

mixed $list List (can be string or array)

Return Value

boolean

in vB_DataManager at line 1463
protected boolean verify_list(mixed $list, string $glue = ',', boolean $dropzero = false)

Creates a valid string of comma-separated integers

Parameters

mixed $list Either specify a string of integers separated by parameter 2, or an array of integers
string $glue The 'glue' for the string. Usually a comma or a space.
boolean $dropzero Whether or not to exclude zero from the list

Return Value

boolean

in vB_DataManager at line 1511
boolean verify_serialized(mixed $data)

Verifies that input is a serialized array (or force an array to serialize)

Parameters

mixed $data Either specify a serialized array, or an array to serialize, or an empty string

Return Value

boolean

in vB_DataManager at line 1542
boolean verify_ipaddress(string $ipaddress)

Verifies an IP address - currently only works with IPv4

Parameters

string $ipaddress IP address

Return Value

boolean

in vB_DataManager at line 1572
boolean verify_md5(string $md5)

Verifies that a string is an MD5 string

Parameters

string $md5 The MD5 string

Return Value

boolean

in vB_DataManager at line 1584
boolean verify_email(string $email)

Verifies that an email address is valid

Parameters

string $email Email address

Return Value

boolean

Verifies that a hyperlink is valid

Parameters

string $link Hyperlink URL
boolean $strict Strict link (only HTTP/HTTPS); default false

Return Value

boolean

in vB_DataManager at line 1627
boolean verify_date_array(array $date)

Verifies a date array as a valid unix timestamp

Parameters

array $date Date array containing day/month/year and optionally: hour/minute/second

Return Value

boolean

in vB_DataManager at line 1672
protected boolean forceItemInSet(mixed $data, array $validarray, mixed $default)

Checks that data is in the valid array. If it is not, set data to the $default.

This doesn't so much check if the data is valid as cleans the data to make it valid, which a number of validate functions do. This doesn't match the signature for verification functions because it's intended to build verification functions by passing the correct array and default.

Parameters

mixed $data -- scalar value
array $validarray -- array of valid values
mixed $default -- value to set data to if its not in the array this valid must be in the array.

Return Value

boolean -- should always return true as $data will be set to a valid value if used correctly. Will return false if $data and $default are not in $validarray

in vB_DataManager at line 1694
protected string fetchTableBase(string $tablename)

Fetches the base table name even if the parameter contains the package prefix.

Parameters

string $tablename Name of the table we are checking existing prefix.

Return Value

string The proper table name.

in vB_DataManager at line 1710
deleteFile(string $file)

Check if a file exists, and then delete it if it does.

Parameters

string $file filename

at line 213
boolean verify_homepage(string $homepage)

Verifies that the user's homepage is valid

Parameters

string $homepage URL

Return Value

boolean

at line 225
boolean verify_threadedmode(integer $threadedmode)

Verifies that $threadedmode is a valid value, and sets the appropriate options to support it.

Parameters

integer $threadedmode Threaded mode: 0 = linear, oldest first; 1 = threaded; 2 = hybrid; 3 = linear, newest first

Return Value

boolean

at line 255
boolean verify_emailnotification(integer $emailnotification)

Verifies that an email notification choice is valid and workable

Parameters

integer $emailnotification Emailnotification choice: (0: no email; 1: instant email; 2: daily email; 3: weekly email; 4: instant icq notification (dodgy))

Return Value

boolean

at line 293
boolean verify_maxposts(integer $maxposts)

Verifies the value of user.maxposts, setting the forum default number if the value is invalid

Parameters

integer $maxposts Maximum posts per page

Return Value

boolean

at line 310
boolean verify_reputation(integer $reputation)

Verifies a valid reputation value, and sets the appropriate reputation level

Parameters

integer $reputation Reputation value

Return Value

boolean

at line 524
boolean verify_birthday(mixed $birthday)

Verifies that the provided birthday is valid

Parameters

mixed $birthday Birthday - can be yyyy-mm-dd, mm-dd-yyyy or an array containing day/month/year and converts it into a valid yyyy-mm-dd

Return Value

boolean

at line 613
boolean verify_useremail(string $email)

Verifies that everything is hunky dory with the user's email field

Parameters

string $email Email address

Return Value

boolean

at line 685
boolean verify_parentemail(string $parentemail)

Verifies that the provided parent email address is valid

Parameters

string $parentemail Email address

Return Value

boolean

at line 705
boolean verify_usergroupid(integer $usergroupid)

Verifies that the usergroup provided is valid

Parameters

integer $usergroupid Usergroup ID

Return Value

boolean

at line 729
boolean verify_displaygroupid(integer $displaygroupid)

Verifies that the provided displaygroup ID is valid

Parameters

integer $displaygroupid Display group ID

Return Value

boolean

at line 749
boolean verify_referrerid(mixed $referrerid)

Verifies a specified referrer

Parameters

mixed $referrerid Referrer - either a user ID or a user name

Return Value

boolean

at line 788
boolean verify_msn(string $msn)

Verifies an MSN handle

Parameters

string $msn MSN handle (email address)

Return Value

boolean

at line 809
boolean verify_skype(string $skype)

Verifies a Skype name

Parameters

string $skype Skype name

Return Value

boolean

at line 822
protected verify_customtitle($data)

Parameters

$data

at line 830
protected verify_privacy_options($pOptions)

Verifies that privacy options are valid

Parameters

$pOptions

at line 850
protected verify_showvbcode($data)

Parameters

$data

at line 855
protected verify_showbirthday($data)

Parameters

$data

at line 860
protected verify_autosubscribe($data)

Parameters

$data

at line 865
protected verify_logintype($data)

Parameters

$data

at line 879
boolean check_password_history(integer $password, integer $historylength)

Checks to see if a password is in the user's password history

Parameters

integer $password User ID
integer $historylength History time ($permissions['passwordhistory'])

Return Value

boolean Returns true if password is in the history

at line 913
set_usertitle(string $customtext, boolean $reset, array $usergroup, boolean $canusecustomtitle, boolean $isadmin)

Sets the values for user[usertitle] and user[customtitle]

Parameters

string $customtext Custom user title text
boolean $reset Whether or not to reset a custom title to the default user title
array $usergroup Array containing all information for the user's primary usergroup
boolean $canusecustomtitle Whether or not a user can use custom user titles
boolean $isadmin Whether or not the user is an administrator

at line 1000
false|string set_ladder_usertitle(integer $posts)

Sets the ladder-based or group based user title for a particular amount of posts.

Parameters

integer $posts Number of posts to consider this user as having

Return Value

false|string False if they use a custom title or can't process, the new title otherwise

at line 1054
false|string set_ladder_usertitle_relative(integer $relative_post_offset)

Sets the ladder usertitle relative to the current number of posts.

Parameters

integer $relative_post_offset Offset to current number of posts

Return Value

false|string Same return values as set_ladder_usertitle

at line 1085
string censor_custom_title(string $usertitle)

Checks a string for words banned in custom user titles and replaces them with the censor character

Parameters

string $usertitle Custom user title

Return Value

string The censored string

at line 1123
string set_userfields(array $values, bool $verify = true, string $all_fields = 'normal', bool $skip_unset_required_fields = false)

Validates and sets custom user profile fields

Parameters

array $values Array of values for profile fields. Example: array('field1' => 'One', 'field2' => array(0 => 'a', 1 => 'b'), 'field2_opt' => 'c')
bool $verify Whether or not to verify the data actually matches any specified regexes or required fields
string $all_fields What type of editable value to apply (admin, register, normal)
bool $skip_unset_required_fields Whether or not to skip verification of required fields that are not present, used for linking facebook accounts

Return Value

string Textual description of set profile fields (for email phrase)

at line 1332
set_dst(integer $dst)

Sets DST options

Parameters

integer $dst DST choice: (2: automatic; 1: auto-off, dst on; 0: auto-off, dst off)

at line 1360
set_registration_defaults()

Sets registration defaults

at line 2163
protected updateDeletedUserData()

Updates data after user being deleted.

at line 2236
update_username(integer $userid, string $username = null)

Updates all denormalized tables that contain a 'username' field (or field that holds a username)

Parameters

integer $userid User ID
string $username The user name. Helpful if you want to call this function from outside the DM.

at line 2393
update_password_history(integer $userid)

Inserts a record into the password history table if the user's password has changed

Parameters

integer $userid User ID

Resets the session styleid and styleid cookie to the user's profile choice

Parameters

integer $userid User ID

Resets the languageid cookie to the user's profile choice

Parameters

integer $userid User ID

Resets the threadedmode cookie to the user's profile choice

Parameters

integer $userid User ID

at line 2467
boolean usergroups_changed()

Checks to see if a user's usergroup memberships have changed

Return Value

boolean Returns true if memberships have changed

at line 2498
boolean is_admin(integer $usergroupid, string $membergroupids)

Checks usergroupid and membergroupids to see if the user has admin privileges

Parameters

integer $usergroupid Usergroupid
string $membergroupids Membergroupids (comma separated)

Return Value

boolean Returns true if user has admin privileges

at line 2523
boolean is_supermod(integer $usergroupid, string $membergroupids)

Checks usergroupid and membergroupids to see if the user has super moderator privileges

Parameters

integer $usergroupid Usergroupid
string $membergroupids Membergroupids (comma separated)

Return Value

boolean Returns true if user has super moderator privileges

at line 2546
integer count_other_admins(integer $userid)

Counts the number of administrators OTHER THAN the user specified

Parameters

integer $userid User ID of user to be checked

Return Value

integer The number of administrators excluding the current user

at line 2594
set_admin(integer $userid, boolean $usergroups_changed, boolean $isadmin, boolean $wasadmin = false)

Inserts or deletes a record from the administrator table if necessary

Parameters

integer $userid User ID of this user
boolean $usergroups_changed Whether or not the usergroups of this user have changed
boolean $isadmin Whether or not the user is now an admin
boolean $wasadmin Whether or not the user was an admin before this update

at line 2626
set_supermod(integer $userid, boolean $usergroups_changed, boolean $issupermod, boolean $wassupermod = false)

Inserts or deletes a record from the moderators table if necessary

Parameters

integer $userid User ID of this user
boolean $usergroups_changed Whether or not the usergroups of this user have changed
boolean $issupermod Whether or not the user is now a super moderator
boolean $wassupermod Whether or not the user was a super moderator before this update

at line 2673
update_ban_status(integer $userid)

Bla bla bla

Parameters

integer $userid User ID

at line 2726
send_welcomepm($fromuser = null, $recipient = false)

Sends a welcome pm to the user

Parameters

$fromuser
$recipient