Vanilla 2
2.0.18.8
|
Public Member Functions | |
__construct () | |
ConfirmEmail ($User, $EmailKey) | |
Connect ($UniqueID, $ProviderKey, $UserData) | |
FilterForm ($Data) | |
JoinUsers (&$Data, $Columns, $Options=array()) | |
UserQuery ($SafeData=FALSE) | |
DefinePermissions ($UserID, $Serialize=TRUE) | |
Get ($OrderFields= '', $OrderDirection= 'asc', $Limit=FALSE, $Offset=FALSE) | |
GetByUsername ($Username) | |
GetByEmail ($Email) | |
GetByRole ($Role) | |
GetActiveUsers ($Limit=5) | |
GetApplicantCount () | |
GetApplicants () | |
GetAuthentication ($UniqueID, $Provider) | |
GetCountLike ($Like=FALSE) | |
GetCountWhere ($Where=FALSE) | |
GetID ($ID, $DatasetType=DATASET_TYPE_OBJECT) | |
GetIDs ($IDs, $SkipCacheQuery=FALSE) | |
GetLike ($Like=FALSE, $OrderFields= '', $OrderDirection= 'asc', $Limit=FALSE, $Offset=FALSE) | |
GetRoles ($UserID) | |
GetSession ($UserID, $Refresh=FALSE) | |
GetSummary ($OrderFields= '', $OrderDirection= 'asc', $Limit=FALSE, $Offset=FALSE) | |
GetSystemUserID () | |
Register ($FormPostValues, $Options=array()) | |
RemovePicture ($UserID) | |
ProfileCount ($User, $Column) | |
Save ($FormPostValues, $Settings=FALSE) | |
SaveAdminUser ($FormPostValues) | |
SaveRoles ($UserID, $RoleIDs, $RecordActivity=TRUE) | |
Search ($Keywords, $OrderFields= '', $OrderDirection= 'asc', $Limit=FALSE, $Offset=FALSE) | |
SearchCount ($Keywords=FALSE) | |
InsertForInvite ($FormPostValues, $Options=array()) | |
InsertForApproval ($FormPostValues, $Options=array()) | |
InsertForBasic ($FormPostValues, $CheckCaptcha=TRUE, $Options=array()) | |
AddInsertFields (&$Fields) | |
UpdateLastVisit ($UserID, $Attributes, $ClientHour='') | |
ValidateCredentials ($Email= '', $ID=0, $Password) | |
ValidateUniqueFields ($Username, $Email, $UserID= '') | |
Approve ($UserID, $Email) | |
Delete ($UserID, $Options=array()) | |
Decline ($UserID) | |
GetInvitationCount ($UserID) | |
ReduceInviteCount ($UserID, $ReduceBy=1) | |
IncreaseInviteCount ($UserID, $IncreaseBy=1) | |
SaveAbout ($UserID, $About) | |
SaveToSerializedColumn ($Column, $UserID, $Name, $Value= '') | |
SavePreference ($UserID, $Preference, $Value= '') | |
SaveAttribute ($UserID, $Attribute, $Value= '') | |
SaveAuthentication ($Data) | |
SetCalculatedFields (&$User) | |
SetTransientKey ($UserID, $ExplicitKey= '') | |
GetAttribute ($UserID, $Attribute, $DefaultValue=FALSE) | |
SendEmailConfirmationEmail ($User=NULL) | |
SendWelcomeEmail ($UserID, $Password, $RegisterType= 'Add', $AdditionalData=NULL) | |
SendPasswordEmail ($UserID, $Password) | |
Synchronize ($UserKey, $Data) | |
NewUserRoleIDs () | |
PasswordRequest ($Email) | |
PasswordReset ($UserID, $Password) | |
SetField ($RowID, $Property, $Value=FALSE) | |
GetUserFromCache ($UserToken, $TokenType) | |
UpdateUserCache ($UserID, $Field, $Value=NULL) | |
UserCache ($User) | |
UserCacheRoles ($UserID, $RoleIDs) | |
ClearCache ($UserID, $CacheTypesToClear=NULL) | |
ClearPermissions () | |
GetPermissionsIncrement () | |
Public Member Functions inherited from Gdn_Model | |
__construct ($Name= '') | |
DefineSchema () | |
Save ($FormPostValues, $Settings=FALSE) | |
Insert ($Fields) | |
Update ($Fields, $Where=FALSE, $Limit=FALSE) | |
Delete ($Where= '', $Limit=FALSE, $ResetData=FALSE) | |
FilterForm ($Data) | |
FilterSchema ($Data) | |
Get ($OrderFields= '', $OrderDirection= 'asc', $Limit=FALSE, $Offset=FALSE) | |
GetCount ($Wheres= '') | |
GetID ($ID, $DatasetType=FALSE) | |
GetWhere ($Where=FALSE, $OrderFields= '', $OrderDirection= 'asc', $Limit=FALSE, $Offset=FALSE) | |
ValidationResults () | |
Validate ($FormPostValues, $Insert=FALSE) | |
SaveToSerializedColumn ($Column, $RowID, $Name, $Value= '') | |
SetProperty ($RowID, $Property, $ForceValue=FALSE) | |
Public Member Functions inherited from Gdn_Pluggable | |
__construct () | |
GetReturn ($PluginName, $HandlerName) | |
FireEvent ($EventName) | |
__call ($MethodName, $Arguments) | |
Public Member Functions inherited from Gdn_SliceProvider | |
EnableSlicing (&$Sender) | |
Slice ($SliceName, $Arguments=array()) | |
AddSliceAsset ($Asset) | |
RenderSliceConfig () | |
Static Public Member Functions | |
static | GetMeta ($UserID, $Key, $Prefix= '') |
static | SetMeta ($UserID, $Meta, $Prefix= '') |
Data Fields | |
const | DEFAULT_CONFIRM_EMAIL = 'You need to confirm your email address before you can continue. Please confirm your email address by clicking on the following link: {/entry/emailconfirm,url,domain}/{User.UserID,rawurlencode}/{EmailKey,rawurlencode}' |
const | USERID_KEY = 'user.{UserID}' |
const | USERNAME_KEY = 'user.{Name}.name' |
const | USERROLES_KEY = 'user.{UserID}.roles' |
const | USERPERMISSIONS_KEY = 'user.{UserID}.permissions.{PermissionsIncrement}' |
const | INC_PERMISSIONS_KEY = 'permissions.increment' |
$SessionColumns | |
Data Fields inherited from Gdn_Model | |
$Data | |
$Database | |
$DateInserted = 'DateInserted' | |
$DateUpdated = 'DateUpdated' | |
$InsertUserID = 'InsertUserID' | |
$Name | |
$PrimaryKey = 'id' | |
$Schema | |
$SQL | |
$UpdateUserID = 'UpdateUserID' | |
$Validation | |
Data Fields inherited from Gdn_Pluggable | |
$EventArguments | |
$Returns = array() | |
$HandlerType | |
Static Public Attributes | |
static | $UserCache = array() |
Protected Member Functions | |
_AddEmailHeaderFooter ($Message, $Data) | |
_Insert ($Fields, $Options=array()) | |
Protected Member Functions inherited from Gdn_Model | |
_BeforeGet () | |
AddInsertFields (&$Fields) | |
AddUpdateFields (&$Fields) | |
Additional Inherited Members | |
Protected Attributes inherited from Gdn_Pluggable | |
$ClassName | |
Protected Attributes inherited from Gdn_SliceProvider | |
$SliceHandler | |
$SliceConfig | |
__construct | ( | ) |
Class constructor. Defines the related database table name.
|
protected |
|
protected |
A convenience method to be called when inserting users (because users are inserted in various methods depending on registration setups).
AddInsertFields | ( | & | $Fields | ) |
Approve | ( | $UserID, | |
) |
Approve a membership applicant.
ClearCache | ( | $UserID, | |
$CacheTypesToClear = NULL |
|||
) |
Delete cached data for user
type | $UserID |
ClearPermissions | ( | ) |
ConfirmEmail | ( | $User, | |
$EmailKey | |||
) |
Connect | ( | $UniqueID, | |
$ProviderKey, | |||
$UserData | |||
) |
Connect a user with a foreign authentication system.
string | $UniqueID | The user's unique key in the other authentication system. |
string | $ProviderKey | The key of the system providing the authentication. |
array | $UserData | Data to go in the user table. |
Decline | ( | $UserID | ) |
DefinePermissions | ( | $UserID, | |
$Serialize = TRUE |
|||
) |
Delete | ( | $UserID, | |
$Options = array() |
|||
) |
FilterForm | ( | $Data | ) |
Get | ( | $OrderFields = '' , |
|
$OrderDirection = 'asc' , |
|||
$Limit = FALSE , |
|||
$Offset = FALSE |
|||
) |
Default Gdn_Model::Get() behavior.
Prior to 2.0.18 it incorrectly behaved like GetID. This method can be deleted entirely once it's been deprecated long enough.
GetActiveUsers | ( | $Limit = 5 | ) |
GetApplicantCount | ( | ) |
GetApplicants | ( | ) |
Returns all users in the applicant role
GetAttribute | ( | $UserID, | |
$Attribute, | |||
$DefaultValue = FALSE |
|||
) |
GetAuthentication | ( | $UniqueID, | |
$Provider | |||
) |
Get the a user authentication row.
string | $UniqueID | The unique ID of the user in the foreign authentication scheme. |
string | $Provider | The key of the provider. |
GetByEmail | ( | ) |
GetByRole | ( | $Role | ) |
GetByUsername | ( | $Username | ) |
GetCountLike | ( | $Like = FALSE | ) |
GetCountWhere | ( | $Where = FALSE | ) |
GetID | ( | $ID, | |
$DatasetType = DATASET_TYPE_OBJECT |
|||
) |
GetIDs | ( | $IDs, | |
$SkipCacheQuery = FALSE |
|||
) |
GetInvitationCount | ( | $UserID | ) |
GetLike | ( | $Like = FALSE , |
|
$OrderFields = '' , |
|||
$OrderDirection = 'asc' , |
|||
$Limit = FALSE , |
|||
$Offset = FALSE |
|||
) |
|
static |
Retries UserMeta information for a UserID / Key pair
This method takes a $UserID or array of $UserIDs, and a $Key. It converts the $Key to fully qualified format and then queries for the associated value(s). $Key can contain SQL wildcards, in which case multiple results can be returned.
If $UserID is an array, the return value will be a multi dimensional array with the first axis containing UserIDs and the second containing fully qualified UserMetaKeys, associated with their values.
If $UserID is a scalar, the return value will be a single dimensional array of $UserMetaKey => $Value pairs.
$UserID | integer UserID or array of UserIDs. |
$Key | string relative user meta key. |
GetPermissionsIncrement | ( | ) |
GetRoles | ( | $UserID | ) |
GetSession | ( | $UserID, | |
$Refresh = FALSE |
|||
) |
GetSummary | ( | $OrderFields = '' , |
|
$OrderDirection = 'asc' , |
|||
$Limit = FALSE , |
|||
$Offset = FALSE |
|||
) |
Retrieve a summary of "safe" user information for external API calls.
GetSystemUserID | ( | ) |
Retrieves a "system user" id that can be used to perform non-real-person tasks.
GetUserFromCache | ( | $UserToken, | |
$TokenType | |||
) |
Get a user from the cache by name or ID
type | $UserToken | either a userid or a username |
string | $TokenType | either 'userid' or 'name' |
IncreaseInviteCount | ( | $UserID, | |
$IncreaseBy = 1 |
|||
) |
Increases the user's CountInvitations value by the specified amount.
int | The unique id of the user being affected. |
int | The number to increase CountInvitations by. |
InsertForApproval | ( | $FormPostValues, | |
$Options = array() |
|||
) |
To be used for approval registration
InsertForBasic | ( | $FormPostValues, | |
$CheckCaptcha = TRUE , |
|||
$Options = array() |
|||
) |
To be used for basic registration, and captcha registration
InsertForInvite | ( | $FormPostValues, | |
$Options = array() |
|||
) |
To be used for invitation registration
JoinUsers | ( | & | $Data, |
$Columns, | |||
$Options = array() |
|||
) |
Add user data to a result set.
object | $Data | Results we need to associate user data with. |
array | $Columns | Database columns containing UserIDs to get data for. |
array | $Options | Optionally pass list of user data to collect with key 'Join'. |
NewUserRoleIDs | ( | ) |
PasswordRequest | ( | ) |
PasswordReset | ( | $UserID, | |
$Password | |||
) |
ProfileCount | ( | $User, | |
$Column | |||
) |
ReduceInviteCount | ( | $UserID, | |
$ReduceBy = 1 |
|||
) |
Reduces the user's CountInvitations value by the specified amount.
int | The unique id of the user being affected. |
int | The number to reduce CountInvitations by. |
Register | ( | $FormPostValues, | |
$Options = array() |
|||
) |
RemovePicture | ( | $UserID | ) |
Save | ( | $FormPostValues, | |
$Settings = FALSE |
|||
) |
Generic save procedure.
SaveAbout | ( | $UserID, | |
$About | |||
) |
Saves the user's About field.
int | The UserID to save. |
string | The about message being saved. |
SaveAdminUser | ( | $FormPostValues | ) |
Force the admin user into UserID 1.
SaveAttribute | ( | $UserID, | |
$Attribute, | |||
$Value = '' |
|||
) |
Saves a user attribute to the database.
This is a convenience method that uses $this->SaveToSerializedColumn().
int | The UserID to save. |
mixed | The name of the attribute being saved, or an associative array of name => value pairs to be saved. If this is an associative array, the $Value argument will be ignored. |
mixed | The value being saved. |
SaveAuthentication | ( | $Data | ) |
SavePreference | ( | $UserID, | |
$Preference, | |||
$Value = '' |
|||
) |
Saves a user preference to the database.
This is a convenience method that uses $this->SaveToSerializedColumn().
int | The UserID to save. |
mixed | The name of the preference being saved, or an associative array of name => value pairs to be saved. If this is an associative array, the $Value argument will be ignored. |
mixed | The value being saved. |
SaveRoles | ( | $UserID, | |
$RoleIDs, | |||
$RecordActivity = TRUE |
|||
) |
SaveToSerializedColumn | ( | $Column, | |
$UserID, | |||
$Name, | |||
$Value = '' |
|||
) |
Saves a name/value to the user's specified $Column.
This method throws exceptions when errors are encountered. Use try ... catch blocks to capture these exceptions.
string | The name of the serialized column to save to. At the time of this writing there are three serialized columns on the user table: Permissions, Preferences, and Attributes. |
int | The UserID to save. |
mixed | The name of the value being saved, or an associative array of name => value pairs to be saved. If this is an associative array, the $Value argument will be ignored. |
mixed | The value being saved. |
Search | ( | $Keywords, | |
$OrderFields = '' , |
|||
$OrderDirection = 'asc' , |
|||
$Limit = FALSE , |
|||
$Offset = FALSE |
|||
) |
SearchCount | ( | $Keywords = FALSE | ) |
SendEmailConfirmationEmail | ( | $User = NULL | ) |
SendPasswordEmail | ( | $UserID, | |
$Password | |||
) |
SendWelcomeEmail | ( | $UserID, | |
$Password, | |||
$RegisterType = 'Add' , |
|||
$AdditionalData = NULL |
|||
) |
SetCalculatedFields | ( | & | $User | ) |
SetField | ( | $RowID, | |
$Property, | |||
$Value = FALSE |
|||
) |
|
static |
SetTransientKey | ( | $UserID, | |
$ExplicitKey = '' |
|||
) |
Synchronize | ( | $UserKey, | |
$Data | |||
) |
Synchronizes the user based on a given UserKey.
string | $UserKey | A string that uniquely identifies this user. |
array | $Data | Information to put in the user table. |
UpdateLastVisit | ( | $UserID, | |
$Attributes, | |||
$ClientHour = '' |
|||
) |
Update last visit.
Regenerates other related user properties.
int | $UserID | |
array | $Attributes | |
string | int | float | $ClientHour |
UpdateUserCache | ( | $UserID, | |
$Field, | |||
$Value = NULL |
|||
) |
UserCache | ( | $User | ) |
Cache user object
type | $User |
UserCacheRoles | ( | $UserID, | |
$RoleIDs | |||
) |
Cache user's roles
type | $UserID | |
type | $RoleIDs |
UserQuery | ( | $SafeData = FALSE | ) |
$SafeData makes sure that the query does not return any sensitive information about the user (password, attributes, preferences, etc).
ValidateCredentials | ( | $Email = '' , |
|
$ID = 0 , |
|||
$Password | |||
) |
Validate User Credential
Fetches a user row by email (or name) and compare the password.
If the password was not stored as a blowfish hash, the password will be saved again.
Return the user's id, admin status and attributes.
string | ||
string | $Password |
ValidateUniqueFields | ( | $Username, | |
$Email, | |||
$UserID = '' |
|||
) |
Checks to see if $Username and $Email are already in use by another member.
$SessionColumns |
|
static |
const DEFAULT_CONFIRM_EMAIL = 'You need to confirm your email address before you can continue. Please confirm your email address by clicking on the following link: {/entry/emailconfirm,url,domain}/{User.UserID,rawurlencode}/{EmailKey,rawurlencode}' |
const INC_PERMISSIONS_KEY = 'permissions.increment' |
const USERID_KEY = 'user.{UserID}' |
const USERNAME_KEY = 'user.{Name}.name' |
const USERPERMISSIONS_KEY = 'user.{UserID}.permissions.{PermissionsIncrement}' |
const USERROLES_KEY = 'user.{UserID}.roles' |