vB_DataManager_User
extends vB_DataManager
in package
Abstract class to do data save/delete operations for a particular data type (such as user, thread, post etc.)
Table of Contents
- $condition : string
- Condition to be used. Can be either array('keyfield' => 'value') or a valid assertor vB_dB_Query::CONDITIONS_KEY setting.
- $dbobject : vB_Database
- The vBulletin database object
- $error_handler : string
- The error handler for this object
- $errors : array<string|int, mixed>
- Array to store any errors encountered while building data
- $existing : array<string|int, mixed>
- Array to store existing data
- $failure_callback : callable
- Callback to execute just before an error is logged.
- $info : array<string|int, mixed>
- Array to store information
- $insertedadmin : bool
- Whether or not we have inserted an administrator record
- $list_types : array<string|int, mixed>
- Types of lists stored in usertextfield, named <X>list.
- $presave_called : null|bool
- This variable prevents the pre_save() method from being called more than once.
- $rawfields : array<string|int, mixed>
- Array to store the names for fields that will be taking raw SQL
- $registry : vB_Registry
- The vBulletin registry object
- $table : string
- The main table this class deals with
- $user : mixed
- $userfield : mixed
- $usertextfield : mixed
- $assertor : vB_dB_Assertor
- The vBulletin dB_Assertor object
- $bitfields : array<string|int, mixed>
- Array of field names that are bitfields, together with the name of the variable in the registry with the definitions.
- $datastore : vB_Datastore
- The vBulletin vB_Datastore object
- $keyField : mixed
- $needRegistry : mixed
- flag for vb5 transition. A subclass can set this to false and we won't set up $vbulletin *
- $options : array<string|int, mixed>
- The options array from vB_Datastore object
- $session : vB_Session
- The vBulletin vB_Session object
- $setfields : array<string|int, mixed>
- Array to store the names of fields that have been sucessfully set
- $userinfo : array<string|int, mixed>
- The userinfo array from vB_Session object
- $validfields : array<string|int, mixed>
- Array of recognised and required fields for users, and their types
- $user_changelog_fields : array<string|int, mixed>
- Which fieldchanges will be logged
- $user_changelog_state : bool
- We want to log or not the user changes
- $userchangelog : array<string|int, mixed>
- Arrays to store stuff to save to userchangelog table
- __construct() : mixed
- Constructor - Checks for necessity of registry object
- __serialize() : mixed
- __sleep() : mixed
- __unserialize() : mixed
- __wakeup() : mixed
- any_other_admin_exists() : true
- Returns true if any admin OTHER THAN the user specified exists.
- check_password_history() : bool
- Checks to see if a password is in the user's password history
- check_required() : bool
- Checks through the required fields for this object and ensures that all required fields have a value
- db_delete() : int
- Generates the SQL to delete a record from a database table, then executes it
- db_insert() : int
- Creates and runs an INSERT query to save the data from the object into the database
- db_update() : bool
- Creates and runs an UPDATE query to save the data from the object into the database
- delete() : mixed
- Deletes a user
- deleteFile() : mixed
- Check if a file exists, and then delete it if it does.
- do_set() : mixed
- Takes valid data and sets it as part of the data to be saved
- do_unset() : mixed
- Unsets a values that has already been set
- error() : mixed
- Shows an error message and halts execution - use this in the same way as print_stop_message();
- fetch_field() : mixed
- Fetches info about the current data object - if a new value is set, it returns this, otherwise it will return the existing data
- get_errors() : array<string|int, mixed>
- Returns the array of errors
- get_exception() : mixed
- has_errors() : bool
- Check if the DM currently has errors. Will kill execution if it does and $die is true.
- is_admin() : bool
- Checks usergroupid and membergroupids to see if the user has admin privileges
- is_bitfield_set() : bool
- Determines if a bitfield value has been set
- is_field_set() : mixed
- Determines if a field is set
- is_supermod() : bool
- Checks usergroupid and membergroupids to see if the user has super moderator privileges
- post_delete() : mixed
- Any code to run after deleting
- post_save_each() : mixed
- Additional data to update after a save call (such as denormalized values in other tables).
- post_save_once() : mixed
- Additional data to update after a save call (such as denormalized values in other tables).
- pre_delete() : mixed
- Additional data to update before a delete call (such as denormalized values in other tables).
- pre_save() : bool
- Any checks to run immediately before saving. If returning false, the save will not take place.
- save() : int
- Saves the data from the object into the specified database tables
- send_welcomepm() : mixed
- Sends a welcome pm to the user
- set() : bool
- Sets the supplied data to be part of the data to be saved. Use setr() if a reference to $value is to be passed
- set_admin() : mixed
- Inserts or deletes a record from the administrator table if necessary
- set_bitfield() : bool
- Sets a bit in a bitfield
- set_condition() : mixed
- Sets the condition to be used in WHERE clauses, based upon the $this->existing data and the $this->condition_constuct condition template.
- set_dst() : mixed
- Sets DST options
- set_existing() : bool
- Sets the existing data
- set_failure_callback() : mixed
- Sets the function to call on an error.
- set_info() : mixed
- 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
- set_ladder_usertitle() : false|string
- Sets the ladder-based or group based user title for a particular amount of posts.
- set_ladder_usertitle_relative() : false|string
- Sets the ladder usertitle relative to the current number of posts.
- set_supermod() : mixed
- Inserts or deletes a record from the moderators table if necessary
- set_userfields() : string
- Validates and sets custom user profile fields
- set_usertitle() : mixed
- Sets the values for user[usertitle] and user[customtitle]
- setErrorHandler() : bool
- Sets the error handler for the object
- setr() : bool
- Sets the supplied data to be part of the data to be saved
- setr_info() : mixed
- Rather like set(), but sets reference to data into the $this->info array instead
- update_ban_status() : mixed
- update_language_cookie() : mixed
- Resets the languageid cookie to the user's profile choice
- update_password_history() : mixed
- Inserts a record into the password history table if the user's password has changed
- update_style_cookie() : mixed
- Resets the session styleid and styleid cookie to the user's profile choice
- update_threadedmode_cookie() : mixed
- Resets the threadedmode cookie to the user's profile choice
- update_username() : mixed
- Updates all denormalized tables that contain a 'username' field (or field that holds a username)
- usergroups_changed() : bool
- Checks to see if a user's usergroup memberships have changed
- verify() : bool
- Verifies that the supplied data is one of the fields used by this object
- verify_birthday() : bool
- Verifies that the provided birthday is valid
- verify_date_array() : bool
- Verifies a date array as a valid unix timestamp
- verify_displaygroupid() : bool
- Verifies that the provided displaygroup ID is valid
- verify_email() : bool
- Verifies that an email address is valid
- verify_emailnotification() : bool
- Verifies that an email notification choice is valid and workable
- verify_homepage() : bool
- Verifies that the user's homepage is valid
- verify_link() : bool
- Verifies that a hyperlink is valid
- verify_maxposts() : bool
- Verifies the value of user.maxposts, setting the forum default number if the value is invalid
- verify_md5() : bool
- Verifies that a string is an MD5 string
- verify_msn() : bool
- Verifies an MSN handle
- verify_parentemail() : bool
- Verifies that the provided parent email address is valid
- verify_referrerid() : bool
- Verifies a specified referrer
- verify_reputation() : bool
- Verifies a valid reputation value, and sets the appropriate reputation level
- verify_serialized() : bool
- Verifies that input is a serialized array (or force an array to serialize)
- verify_skype() : bool
- Verifies a Skype name
- verify_threadedmode() : bool
- Verifies that $threadedmode is a valid value, and sets the appropriate options to support it.
- verify_useremail() : bool
- Verifies that everything is hunky dory with the user's email field
- verify_usergroupid() : bool
- Verifies that the usergroup provided is valid
- verify_userid() : bool
- Verifies that the specified user exists
- verify_username() : bool
- Verifies that the provided username is valid, and attempts to correct it if it is not valid
- fetchQueryInfo() : array<string|int, mixed>
- Returns an array with object info required for query methods as first argument
- fetchTableBase() : string
- Fetches the base table name even if the parameter contains the package prefix.
- forceItemInSet() : bool
- Checks that data is in the valid array. If it is not, set data to the $default.
- loadExisting() : mixed
- updateDeletedUserData() : mixed
- Updates data after user being deleted.
- verify_autosubscribe() : mixed
- verify_commalist() : bool
- Verifies that a variable is a comma-separated list of integers
- verify_customtitle() : mixed
- verify_ipaddress() : bool
- Verifies an IP address
- verify_list() : bool
- Creates a valid string of comma-separated integers
- verify_nonempty() : bool
- Verifies that a string is not empty
- verify_nonzero() : bool
- Verifies that an integer is greater than zero
- verify_nonzero_or_negone() : bool
- Verifies that an integer is greater than zero or the special value -1 this rule matches a fair number of id columns
- verify_privacy_options() : mixed
- Verifies that privacy options are valid
- verify_showbirthday() : mixed
- verify_showvbcode() : mixed
- verify_spacelist() : bool
- Verifies that a variable is a space-separated list of integers
- getUsertitleFromPosts() : mixed
- set_registration_defaults() : mixed
- Sets registration defaults
- update_birthday_datastore() : mixed
- Rebuilds the birthday datastore if the user's birthday has changed
- update_subscriptions() : mixed
- Updates user subscribed threads/forums to reflect new permissions
Properties
$condition
Condition to be used. Can be either array('keyfield' => 'value') or a valid assertor vB_dB_Query::CONDITIONS_KEY setting.
public
string
$condition
=
ull
$dbobject
The vBulletin database object
public
vB_Database
$dbobject
=
ull
$error_handler
The error handler for this object
public
string
$error_handler
= B_DataManager_Constants::ERRTYPE_STANDARD
$errors
Array to store any errors encountered while building data
public
array<string|int, mixed>
$errors
= array()
$existing
Array to store existing data
public
array<string|int, mixed>
$existing
= array()
$failure_callback
Callback to execute just before an error is logged.
public
callable
$failure_callback
=
ull
$info
Array to store information
public
array<string|int, mixed>
$info
= array()
$insertedadmin
Whether or not we have inserted an administrator record
public
bool
$insertedadmin
= alse
$list_types
Types of lists stored in usertextfield, named <X>list.
public
array<string|int, mixed>
$list_types
= array('buddy', 'ignore')
$presave_called
This variable prevents the pre_save() method from being called more than once.
public
null|bool
$presave_called
=
ull
In some classes, it is helpful to explicitly call pre_save() before calling save as additional checks are done. This variable is used to prevent pre_save() from being executed when save() is called. If null, pre_save() has yet to be called; else, it is the return value of pre_save().
$rawfields
Array to store the names for fields that will be taking raw SQL
public
array<string|int, mixed>
$rawfields
= array()
$registry
The vBulletin registry object
public
vB_Registry
$registry
=
ull
$table
The main table this class deals with
public
string
$table
= 'user'
$user
public
mixed
$user
= array()
$userfield
public
mixed
$userfield
= array()
$usertextfield
public
mixed
$usertextfield
= array()
$assertor
The vBulletin dB_Assertor object
protected
vB_dB_Assertor
$assertor
=
ull
$bitfields
Array of field names that are bitfields, together with the name of the variable in the registry with the definitions.
protected
array<string|int, mixed>
$bitfields
= array('options' => 'bf_misc_useroptions', 'adminoptions' => 'bf_misc_adminoptions', 'notification_options' => 'bf_misc_usernotificationoptions', 'moderatornotificationoptions' => 'bf_misc_moderatornotificationoptions', 'moderatoremailnotificationoptions' => 'bf_misc_moderatoremailnotificationoptions')
$datastore
The vBulletin vB_Datastore object
protected
vB_Datastore
$datastore
= array()
$keyField
protected
mixed
$keyField
= 'userid'
$needRegistry
flag for vb5 transition. A subclass can set this to false and we won't set up $vbulletin *
protected
mixed
$needRegistry
= alse
$options
The options array from vB_Datastore object
protected
array<string|int, mixed>
$options
= array()
$session
The vBulletin vB_Session object
protected
vB_Session
$session
=
ull
$setfields
Array to store the names of fields that have been sucessfully set
protected
array<string|int, mixed>
$setfields
= array()
$userinfo
The userinfo array from vB_Session object
protected
array<string|int, mixed>
$userinfo
= array()
$validfields
Array of recognised and required fields for users, and their types
protected
array<string|int, mixed>
$validfields
= array(
'userid' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_INCR, B_DataManager_Constants::VF_METHOD, 'verify_nonzero'),
'username' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_YES, B_DataManager_Constants::VF_METHOD),
'email' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_YES, B_DataManager_Constants::VF_METHOD, 'verify_useremail'),
'parentemail' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'emailstamp' => array(B_Cleaner::TYPE_UNIXTIME, B_DataManager_Constants::REQ_NO),
'secret' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO),
'passworddate' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO),
'usergroupid' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_YES, B_DataManager_Constants::VF_METHOD),
'membergroupids' => array(B_Cleaner::TYPE_NOCLEAN, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD, 'verify_commalist'),
'infractiongroupids' => array(B_Cleaner::TYPE_NOCLEAN, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD, 'verify_commalist'),
'infractiongroupid' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'displaygroupid' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'styleid' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'languageid' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'options' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_YES),
'privacy_options' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'notification_options' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'adminoptions' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'showvbcode' => array(B_Cleaner::TYPE_INT, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'showbirthday' => array(B_Cleaner::TYPE_INT, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'threadedmode' => array(B_Cleaner::TYPE_INT, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'maxposts' => array(B_Cleaner::TYPE_INT, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'ipaddress' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'referrerid' => array(B_Cleaner::TYPE_NOHTMLCOND, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'posts' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'daysprune' => array(B_Cleaner::TYPE_INT, B_DataManager_Constants::REQ_NO),
'startofweek' => array(B_Cleaner::TYPE_INT, B_DataManager_Constants::REQ_NO),
'timezoneoffset' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO),
'autosubscribe' => array(B_Cleaner::TYPE_INT, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'emailnotification' => array(B_Cleaner::TYPE_INT, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'moderatornotificationoptions' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'moderatoremailnotificationoptions' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'homepage' => array(B_Cleaner::TYPE_NOHTML, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'icq' => array(B_Cleaner::TYPE_NOHTML, B_DataManager_Constants::REQ_NO),
'aim' => array(B_Cleaner::TYPE_NOHTML, B_DataManager_Constants::REQ_NO),
'yahoo' => array(B_Cleaner::TYPE_NOHTML, B_DataManager_Constants::REQ_NO),
'msn' => array(B_Cleaner::TYPE_NOHTML, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'skype' => array(B_Cleaner::TYPE_NOHTML, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'google' => array(B_Cleaner::TYPE_NOHTML, B_DataManager_Constants::REQ_NO),
'usertitle' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO),
'customtitle' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'ipoints' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'infractions' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'warnings' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'joindate' => array(B_Cleaner::TYPE_UNIXTIME, B_DataManager_Constants::REQ_AUTO),
'lastvisit' => array(B_Cleaner::TYPE_UNIXTIME, B_DataManager_Constants::REQ_NO),
'lastactivity' => array(B_Cleaner::TYPE_UNIXTIME, B_DataManager_Constants::REQ_NO),
'lastpost' => array(B_Cleaner::TYPE_UNIXTIME, B_DataManager_Constants::REQ_NO),
'lastpostid' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'birthday' => array(B_Cleaner::TYPE_NOCLEAN, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'birthday_search' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_AUTO),
'reputation' => array(B_Cleaner::TYPE_NOHTML, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD),
'reputationlevelid' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_AUTO),
'avatarid' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'avatarrevision' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'sigpicrevision' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'pmpopup' => array(B_Cleaner::TYPE_INT, B_DataManager_Constants::REQ_NO),
'pmtotal' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'pmunread' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'assetposthash' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO),
// socnet counter fields
'profilevisits' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'friendcount' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'friendreqcount' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'vmunreadcount' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'vmmoderatedcount' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'pcunreadcount' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'pcmoderatedcount' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'gmmoderatedcount' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
// usertextfield fields
'subfolders' => array(B_Cleaner::TYPE_NOCLEAN, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD, 'verify_serialized'),
'pmfolders' => array(B_Cleaner::TYPE_NOCLEAN, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD, 'verify_serialized'),
'searchprefs' => array(B_Cleaner::TYPE_NOCLEAN, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD, 'verify_serialized'),
'buddylist' => array(B_Cleaner::TYPE_NOCLEAN, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD, 'verify_spacelist'),
'ignorelist' => array(B_Cleaner::TYPE_NOCLEAN, B_DataManager_Constants::REQ_NO, B_DataManager_Constants::VF_METHOD, 'verify_spacelist'),
'signature' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO),
'rank' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO),
'status' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO),
// facebook fields
'fbuserid' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO),
'fbname' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO),
'fbjoindate' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
// Privacy Consent fields
'privacyconsent' => array(B_Cleaner::TYPE_INT, B_DataManager_Constants::REQ_NO),
'privacyconsentupdated' => array(B_Cleaner::TYPE_UINT, B_DataManager_Constants::REQ_NO),
'location' => array(B_Cleaner::TYPE_STR, B_DataManager_Constants::REQ_NO),
)
$user_changelog_fields
Which fieldchanges will be logged
private
array<string|int, mixed>
$user_changelog_fields
= array('username', 'usergroupid', 'membergroupids', 'email')
$user_changelog_state
We want to log or not the user changes
private
bool
$user_changelog_state
= rue
$userchangelog
Arrays to store stuff to save to userchangelog table
private
array<string|int, mixed>
$userchangelog
= array()
Methods
__construct()
Constructor - Checks for necessity of registry object
public
__construct([vB_Registry $registry = NULL ][, int $errtype = NULL ]) : mixed
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
- $registry : vB_Registry = NULL
-
-- Instance of the vBulletin data registry object - expected to have the database object as one of its $this->db member.
- $errtype : int = NULL
-
--One of the ERRTYPE_x constants
Return values
mixed —__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 —any_other_admin_exists()
Returns true if any admin OTHER THAN the user specified exists.
public
any_other_admin_exists(int $userid) : true
Note that this function does not check if specified user is an admin.
Parameters
- $userid : int
-
User ID of user to be checked
Return values
true —if any user other than the specified user is an admin.
check_password_history()
Checks to see if a password is in the user's password history
public
check_password_history(mixed $password, mixed $historylength) : bool
Parameters
- $password : mixed
- $historylength : mixed
Return values
bool —Returns true if password is in the history
check_required()
Checks through the required fields for this object and ensures that all required fields have a value
public
check_required() : bool
Return values
bool —Returns true if all required fields have a valid value set
db_delete()
Generates the SQL to delete a record from a database table, then executes it
public
db_delete(mixed $tableprefix, mixed $table[, mixed $condition = '' ][, mixed $doquery = true ]) : int
Parameters
- $tableprefix : mixed
- $table : mixed
- $condition : mixed = ''
- $doquery : mixed = true
Return values
int —The number of records deleted
db_insert()
Creates and runs an INSERT query to save the data from the object into the database
public
db_insert(mixed $tableprefix, mixed $table[, mixed $doquery = true ][, mixed $replace = false ]) : int
Parameters
- $tableprefix : mixed
- $table : mixed
- $doquery : mixed = true
- $replace : mixed = false
Return values
int —Returns the ID of the inserted record
db_update()
Creates and runs an UPDATE query to save the data from the object into the database
public
db_update(mixed $tableprefix, mixed $table[, mixed $condition = null ][, mixed $doquery = true ][, mixed $delayed = false ][, mixed $affected_rows = false ]) : bool
Parameters
- $tableprefix : mixed
- $table : mixed
- $condition : mixed = null
- $doquery : mixed = true
- $delayed : mixed = false
- $affected_rows : mixed = false
Return values
bool —Returns true on success
delete()
Deletes a user
public
delete([mixed $doquery = true ]) : mixed
Parameters
- $doquery : mixed = true
Return values
mixed —The number of affected rows
deleteFile()
Check if a file exists, and then delete it if it does.
public
deleteFile(mixed $file) : mixed
Parameters
- $file : mixed
Return values
mixed —do_set()
Takes valid data and sets it as part of the data to be saved
public
do_set(mixed $fieldname, mixed &$value[, mixed $table = null ]) : mixed
Parameters
- $fieldname : mixed
- $value : mixed
- $table : mixed = null
Return values
mixed —do_unset()
Unsets a values that has already been set
public
do_unset(mixed $fieldname[, mixed $table = null ]) : mixed
Parameters
- $fieldname : mixed
- $table : mixed = null
Return values
mixed —error()
Shows an error message and halts execution - use this in the same way as print_stop_message();
public
error(mixed $errorphrase) : mixed
Parameters
- $errorphrase : mixed
Return values
mixed —fetch_field()
Fetches info about the current data object - if a new value is set, it returns this, otherwise it will return the existing data
public
fetch_field(mixed $fieldname[, mixed $table = null ]) : mixed
Parameters
- $fieldname : mixed
- $table : mixed = null
Return values
mixed —The requested data
get_errors()
Returns the array of errors
public
get_errors() : array<string|int, mixed>
Return values
array<string|int, mixed> —--
get_exception()
public
get_exception() : mixed
Return values
mixed —has_errors()
Check if the DM currently has errors. Will kill execution if it does and $die is true.
public
has_errors([mixed $die = true ]) : bool
Parameters
- $die : mixed = true
Return values
bool —True if there are errors, false otherwise
is_admin()
Checks usergroupid and membergroupids to see if the user has admin privileges
public
is_admin(mixed $usergroupid, mixed $membergroupids) : bool
Parameters
- $usergroupid : mixed
- $membergroupids : mixed
Return values
bool —Returns true if user has admin privileges
is_bitfield_set()
Determines if a bitfield value has been set
public
is_bitfield_set(mixed $fieldname, mixed $bitname) : bool
Parameters
- $fieldname : mixed
- $bitname : mixed
Return values
bool —is_field_set()
Determines if a field is set
public
is_field_set(mixed $field) : mixed
Parameters
- $field : mixed
Return values
mixed —is_supermod()
Checks usergroupid and membergroupids to see if the user has super moderator privileges
public
is_supermod(mixed $usergroupid, mixed $membergroupids) : bool
Parameters
- $usergroupid : mixed
- $membergroupids : mixed
Return values
bool —Returns true if user has super moderator privileges
post_delete()
Any code to run after deleting
public
post_delete([mixed $doquery = true ]) : mixed
Parameters
- $doquery : mixed = true
Return values
mixed —post_save_each()
Additional data to update after a save call (such as denormalized values in other tables).
public
post_save_each([mixed $doquery = true ]) : mixed
Parameters
- $doquery : mixed = true
Return values
mixed —post_save_once()
Additional data to update after a save call (such as denormalized values in other tables).
public
post_save_once([mixed $doquery = true ]) : mixed
In batch updates, is executed once after all records are updated.
Parameters
- $doquery : mixed = true
Return values
mixed —pre_delete()
Additional data to update before a delete call (such as denormalized values in other tables).
public
pre_delete([mixed $doquery = true ]) : mixed
Parameters
- $doquery : mixed = true
Return values
mixed —pre_save()
Any checks to run immediately before saving. If returning false, the save will not take place.
public
pre_save([mixed $doquery = true ]) : bool
Parameters
- $doquery : mixed = true
Return values
bool —True on success; false if an error occurred
save()
Saves the data from the object into the specified database tables
public
save([mixed $doquery = true ][, mixed $delayed = false ][, mixed $affected_rows = false ][, mixed $replace = false ]) : int
Parameters
- $doquery : mixed = true
- $delayed : mixed = false
- $affected_rows : mixed = false
- $replace : mixed = false
Return values
int —Returns the user id of the affected data
send_welcomepm()
Sends a welcome pm to the user
public
send_welcomepm([mixed $fromuser = null ][, mixed $recipient = false ]) : mixed
Parameters
- $fromuser : mixed = null
- $recipient : mixed = false
Return values
mixed —set()
Sets the supplied data to be part of the data to be saved. Use setr() if a reference to $value is to be passed
public
set(mixed $fieldname, mixed $value[, mixed $clean = true ][, mixed $doverify = true ][, mixed $table = null ]) : bool
Parameters
- $fieldname : mixed
- $value : mixed
- $clean : mixed = true
- $doverify : mixed = true
- $table : mixed = null
Return values
bool —Returns false if the data is rejected for whatever reason
set_admin()
Inserts or deletes a record from the administrator table if necessary
public
set_admin(mixed $userid, mixed $usergroups_changed, mixed $isadmin[, mixed $wasadmin = false ]) : mixed
Parameters
- $userid : mixed
- $usergroups_changed : mixed
- $isadmin : mixed
- $wasadmin : mixed = false
Return values
mixed —set_bitfield()
Sets a bit in a bitfield
public
set_bitfield(mixed $fieldname, mixed $bitname, mixed $onoff) : bool
Parameters
- $fieldname : mixed
- $bitname : mixed
- $onoff : mixed
Return values
bool —set_condition()
Sets the condition to be used in WHERE clauses, based upon the $this->existing data and the $this->condition_constuct condition template.
public
set_condition([mixed $params = null ]) : mixed
Parameters
- $params : mixed = null
Return values
mixed —set_dst()
Sets DST options
public
set_dst(mixed &$dst) : mixed
Parameters
- $dst : mixed
Return values
mixed —set_existing()
Sets the existing data
public
set_existing(mixed $existing) : bool
Parameters
- $existing : mixed
Return values
bool —Returns true if successful
set_failure_callback()
Sets the function to call on an error.
public
set_failure_callback(mixed $callback) : mixed
Parameters
- $callback : mixed
Return values
mixed —set_info()
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
public
set_info(mixed $fieldname, mixed $value) : mixed
Parameters
- $fieldname : mixed
- $value : mixed
Return values
mixed —set_ladder_usertitle()
Sets the ladder-based or group based user title for a particular amount of posts.
public
set_ladder_usertitle(mixed $posts) : false|string
Parameters
- $posts : mixed
Return values
false|string —False if they use a custom title or can't process, the new title otherwise
set_ladder_usertitle_relative()
Sets the ladder usertitle relative to the current number of posts.
public
set_ladder_usertitle_relative(mixed $relative_post_offset) : false|string
Parameters
- $relative_post_offset : mixed
Return values
false|string —Same return values as set_ladder_usertitle
set_supermod()
Inserts or deletes a record from the moderators table if necessary
public
set_supermod(mixed $userid, mixed $usergroups_changed, mixed $issupermod[, mixed $wassupermod = false ]) : mixed
Parameters
- $userid : mixed
- $usergroups_changed : mixed
- $issupermod : mixed
- $wassupermod : mixed = false
Return values
mixed —set_userfields()
Validates and sets custom user profile fields
public
set_userfields(mixed &$values[, mixed $verify = true ][, mixed $all_fields = 'normal' ][, mixed $skip_unset_required_fields = false ]) : string
Parameters
- $values : mixed
- $verify : mixed = true
- $all_fields : mixed = 'normal'
- $skip_unset_required_fields : mixed = false
Return values
string —Textual description of set profile fields (for email phrase)
set_usertitle()
Sets the values for user[usertitle] and user[customtitle]
public
set_usertitle(mixed $customtext, mixed $reset, mixed $usergroup, mixed $canusecustomtitle, mixed $isadmin) : mixed
Parameters
- $customtext : mixed
- $reset : mixed
- $usergroup : mixed
- $canusecustomtitle : mixed
- $isadmin : mixed
Return values
mixed —setErrorHandler()
Sets the error handler for the object
public
setErrorHandler([mixed $errtype = vB_DataManager_Constants::ERRTYPE_STANDARD ]) : bool
Parameters
- $errtype : mixed = vB_DataManager_Constants::ERRTYPE_STANDARD
Return values
bool —setr()
Sets the supplied data to be part of the data to be saved
public
setr(mixed $fieldname, mixed &$value[, mixed $clean = true ][, mixed $doverify = true ]) : bool
Parameters
- $fieldname : mixed
- $value : mixed
- $clean : mixed = true
- $doverify : mixed = true
Return values
bool —Returns false if the data is rejected for whatever reason
setr_info()
Rather like set(), but sets reference to data into the $this->info array instead
public
setr_info(mixed $fieldname, mixed &$value) : mixed
Parameters
- $fieldname : mixed
- $value : mixed
Return values
mixed —update_ban_status()
public
update_ban_status(int $userid) : mixed
Parameters
- $userid : int
Return values
mixed —update_language_cookie()
Resets the languageid cookie to the user's profile choice
public
update_language_cookie(mixed $userid) : mixed
Parameters
- $userid : mixed
Return values
mixed —update_password_history()
Inserts a record into the password history table if the user's password has changed
public
update_password_history(mixed $userid) : mixed
Parameters
- $userid : mixed
Return values
mixed —update_style_cookie()
Resets the session styleid and styleid cookie to the user's profile choice
public
update_style_cookie(mixed $userid) : mixed
Parameters
- $userid : mixed
Return values
mixed —update_threadedmode_cookie()
Resets the threadedmode cookie to the user's profile choice
public
update_threadedmode_cookie(mixed $userid) : mixed
Parameters
- $userid : mixed
Return values
mixed —update_username()
Updates all denormalized tables that contain a 'username' field (or field that holds a username)
public
update_username(mixed $userid[, mixed $username = null ]) : mixed
Parameters
- $userid : mixed
- $username : mixed = null
Return values
mixed —usergroups_changed()
Checks to see if a user's usergroup memberships have changed
public
usergroups_changed() : bool
Return values
bool —Returns true if memberships have changed
verify()
Verifies that the supplied data is one of the fields used by this object
public
verify(mixed $fieldname, mixed &$value[, mixed $doverify = true ]) : bool
Also ensures that the data is of the correct type, and attempts to correct errors in the supplied data.
Parameters
- $fieldname : mixed
- $value : mixed
- $doverify : mixed = true
Return values
bool —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)
verify_birthday()
Verifies that the provided birthday is valid
public
verify_birthday(mixed &$birthday) : bool
Parameters
- $birthday : mixed
Return values
bool —verify_date_array()
Verifies a date array as a valid unix timestamp
public
verify_date_array(mixed &$date) : bool
Parameters
- $date : mixed
Return values
bool —verify_displaygroupid()
Verifies that the provided displaygroup ID is valid
public
verify_displaygroupid(mixed &$displaygroupid) : bool
Parameters
- $displaygroupid : mixed
Return values
bool —verify_email()
Verifies that an email address is valid
public
verify_email(mixed &$email) : bool
Parameters
- $email : mixed
Return values
bool —verify_emailnotification()
Verifies that an email notification choice is valid and workable
public
verify_emailnotification(mixed &$emailnotification) : bool
Parameters
- $emailnotification : mixed
Return values
bool —verify_homepage()
Verifies that the user's homepage is valid
public
verify_homepage(mixed &$homepage) : bool
Parameters
- $homepage : mixed
Return values
bool —verify_link()
Verifies that a hyperlink is valid
public
verify_link(mixed &$link[, mixed $strict = false ]) : bool
Parameters
- $link : mixed
- $strict : mixed = false
Return values
bool —verify_maxposts()
Verifies the value of user.maxposts, setting the forum default number if the value is invalid
public
verify_maxposts(mixed &$maxposts) : bool
Parameters
- $maxposts : mixed
Return values
bool —verify_md5()
Verifies that a string is an MD5 string
public
verify_md5(mixed &$md5) : bool
Parameters
- $md5 : mixed
Return values
bool —verify_msn()
Verifies an MSN handle
public
verify_msn(mixed &$msn) : bool
Parameters
- $msn : mixed
Return values
bool —verify_parentemail()
Verifies that the provided parent email address is valid
public
verify_parentemail(mixed &$parentemail) : bool
Parameters
- $parentemail : mixed
Return values
bool —verify_referrerid()
Verifies a specified referrer
public
verify_referrerid(mixed &$referrerid) : bool
Parameters
- $referrerid : mixed
Return values
bool —verify_reputation()
Verifies a valid reputation value, and sets the appropriate reputation level
public
verify_reputation(mixed &$reputation) : bool
Parameters
- $reputation : mixed
Return values
bool —verify_serialized()
Verifies that input is a serialized array (or force an array to serialize)
public
verify_serialized(mixed &$data) : bool
Parameters
- $data : mixed
Return values
bool —verify_skype()
Verifies a Skype name
public
verify_skype(mixed &$skype) : bool
Parameters
- $skype : mixed
Return values
bool —verify_threadedmode()
Verifies that $threadedmode is a valid value, and sets the appropriate options to support it.
public
verify_threadedmode(mixed &$threadedmode) : bool
Parameters
- $threadedmode : mixed
Return values
bool —verify_useremail()
Verifies that everything is hunky dory with the user's email field
public
verify_useremail(mixed &$email) : bool
Parameters
- $email : mixed
Return values
bool —verify_usergroupid()
Verifies that the usergroup provided is valid
public
verify_usergroupid(mixed &$usergroupid) : bool
Parameters
- $usergroupid : mixed
Return values
bool —verify_userid()
Verifies that the specified user exists
public
verify_userid(mixed &$userid) : bool
Parameters
- $userid : mixed
Return values
bool —Returns true if user exists
verify_username()
Verifies that the provided username is valid, and attempts to correct it if it is not valid
public
verify_username(mixed &$username) : bool
Parameters
- $username : mixed
Return values
bool —Returns true if the username is valid, or has been corrected to be valid
fetchQueryInfo()
Returns an array with object info required for query methods as first argument
protected
fetchQueryInfo(string $tableName) : array<string|int, mixed>
Parameters
- $tableName : string
Return values
array<string|int, mixed> —fetchTableBase()
Fetches the base table name even if the parameter contains the package prefix.
protected
fetchTableBase(mixed $tablename) : string
Parameters
- $tablename : mixed
Return values
string —The proper table name.
forceItemInSet()
Checks that data is in the valid array. If it is not, set data to the $default.
protected
forceItemInSet(mixed &$data, array<string|int, mixed> $validarray, mixed $default) : bool
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
- $data : mixed
-
-- scalar value
- $validarray : array<string|int, mixed>
-
-- array of valid values
- $default : mixed
-
-- value to set data to if its not in the array this valid must be in the array.
Return values
bool —-- 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
loadExisting()
protected
loadExisting(mixed $keyValue) : mixed
Parameters
- $keyValue : mixed
Return values
mixed —updateDeletedUserData()
Updates data after user being deleted.
protected
updateDeletedUserData() : mixed
Return values
mixed —verify_autosubscribe()
protected
verify_autosubscribe(mixed &$data) : mixed
Parameters
- $data : mixed
Return values
mixed —verify_commalist()
Verifies that a variable is a comma-separated list of integers
protected
verify_commalist(mixed &$list) : bool
Parameters
- $list : mixed
Return values
bool —verify_customtitle()
protected
verify_customtitle(mixed &$data) : mixed
Parameters
- $data : mixed
Return values
mixed —verify_ipaddress()
Verifies an IP address
protected
verify_ipaddress(mixed &$ipaddress) : bool
Parameters
- $ipaddress : mixed
Return values
bool —verify_list()
Creates a valid string of comma-separated integers
protected
verify_list(mixed &$list[, mixed $glue = ',' ][, mixed $dropzero = false ]) : bool
Parameters
- $list : mixed
- $glue : mixed = ','
- $dropzero : mixed = false
Return values
bool —verify_nonempty()
Verifies that a string is not empty
protected
verify_nonempty(mixed &$string) : bool
Parameters
- $string : mixed
Return values
bool —verify_nonzero()
Verifies that an integer is greater than zero
protected
verify_nonzero(mixed &$int) : bool
Parameters
- $int : mixed
Return values
bool —verify_nonzero_or_negone()
Verifies that an integer is greater than zero or the special value -1 this rule matches a fair number of id columns
protected
verify_nonzero_or_negone(mixed &$int) : bool
Parameters
- $int : mixed
Return values
bool —verify_privacy_options()
Verifies that privacy options are valid
protected
verify_privacy_options(mixed $pOptions) : mixed
Parameters
- $pOptions : mixed
Return values
mixed —verify_showbirthday()
protected
verify_showbirthday(mixed &$data) : mixed
Parameters
- $data : mixed
Return values
mixed —verify_showvbcode()
protected
verify_showvbcode(mixed &$data) : mixed
Parameters
- $data : mixed
Return values
mixed —verify_spacelist()
Verifies that a variable is a space-separated list of integers
protected
verify_spacelist(mixed &$list) : bool
Parameters
- $list : mixed
Return values
bool —getUsertitleFromPosts()
private
getUsertitleFromPosts(mixed $posts) : mixed
Parameters
- $posts : mixed
Return values
mixed —set_registration_defaults()
Sets registration defaults
private
set_registration_defaults() : mixed
Return values
mixed —update_birthday_datastore()
Rebuilds the birthday datastore if the user's birthday has changed
private
update_birthday_datastore(mixed $userid) : mixed
Parameters
- $userid : mixed
Return values
mixed —update_subscriptions()
Updates user subscribed threads/forums to reflect new permissions
private
update_subscriptions(mixed $userid) : mixed
Parameters
- $userid : mixed