Combu Server
3.1.1
PHP API Documentation
|
Public Member Functions | |
__construct ($src=null, $stripSlashes=false) | |
ExistsUsername () | |
ExistsEmail () | |
IsLogged () | |
IsOnline () | |
GetLastActionDate () | |
GetSession () | |
UpdateLastLogin () | |
Save () | |
Delete () | |
ChangePassword ($newPassword) | |
ToJson () | |
ToArray () | |
ToArrayFiltered () | |
ToJsonFiltered () | |
Public Member Functions inherited from DataClass | |
Save () | |
Delete () | |
ToJson () | |
ToArray () | |
Static Public Member Functions | |
static | Load ($username="", $email="", $customData=NULL, $appCustomData=NULL, $isOnline=FALSE, $limit=NULL, $offset=NULL, &$count=NULL, $returnArray=FALSE) |
static | LoadAny ($idApp=0, $username="", $email="", $customData=NULL, $appCustomData=NULL, $isOnline=FALSE, $limit=NULL, $offset=NULL, &$count=NULL, $returnArray=FALSE) |
static | LoadAnyByIp ($ip, $idApp=0, $username="", $email="", $customData=NULL, $appCustomData=NULL, $isOnline=FALSE, $limit=NULL, $offset=NULL, &$count=NULL, $returnArray=FALSE) |
static | LoadIds ($ids, $returnArray=FALSE) |
static | LoadUsernames ($usernames, $returnArray=FALSE) |
static | CheckLogin ($username, $password, &$account=null) |
static | SetSession (&$account) |
static | UnsetSession () |
static | Logout () |
static | Prune () |
static | LoadRandom ($excludeIds=array(), $customData=NULL, $limit=null, $offset=null, &$count=null, $returnArray=false) |
static | LoadRandomFriends ($idUser, $excludeIds=array(), $customData=NULL, $limit=null, $offset=null, &$count=null, $returnArray=false) |
static | CreateRandom ($prefix, &$account=NULL) |
Static Public Member Functions inherited from DataClass | |
static | GetTableName ($class) |
static | LoadRecords ($query, $returnedClass="") |
static | CountRecords ($tableName, $filter=null) |
static | TruncateTable ($tableName) |
static | TruncateClass ($class) |
Data Fields | |
const | TABLE_NAME = "Account" |
$Id = 0 | |
$Username = "" | |
$Password = "" | |
$GUID = "" | |
$LastLoginDate = "" | |
$LastLoginIp = "" | |
$Email = "" | |
$ActivationCode = "" | |
$ChangePwdCode = "" | |
$Enabled = 0 | |
Additional Inherited Members | |
Protected Member Functions inherited from DataClass | |
_loadFilter ($tableName, $filter) | |
_loadByRow ($row, $stripSlashes=false, $callbackOnExists=false) | |
_Delete ($tableName, $filter=null) | |
Static Protected Member Functions inherited from DataClass | |
static | _count ($tableName, $filter=null) |
static | _load ($tableName, $returnedClass="", $where="", $order=null, $limit=null, $offset=null, &$count=null) |
static | _loadEx ($select, $from, $returnedClass="", $where="", $order=null, $limit=null, $offset=null, &$count=null, $debug=false) |
static | _loadQuery ($query, $returnedClass="") |
Class to handle user accounts
Definition at line 10 of file Account.php.
__construct | ( | $src = null , |
|
$stripSlashes = false |
|||
) |
Contructor
Definition at line 30 of file Account.php.
ChangePassword | ( | $newPassword | ) |
Change the password of this account
Database $Database
string | $newPassword | The new password |
Definition at line 473 of file Account.php.
|
static |
Check if specified login data are correct and the account is active
string | $username | Username |
string | $password | Password |
\self | $account | Is set to the account found |
Definition at line 312 of file Account.php.
|
static |
Create a user with a random Username
string | $prefix | String to prepend to the Username |
Definition at line 577 of file Account.php.
Delete | ( | ) |
Delete the record from the database
Definition at line 429 of file Account.php.
ExistsEmail | ( | ) |
Check if the current Email already exists
Definition at line 74 of file Account.php.
ExistsUsername | ( | ) |
Check if the current Username already exists
Definition at line 55 of file Account.php.
GetLastActionDate | ( | ) |
Definition at line 108 of file Account.php.
GetSession | ( | ) |
Get the current session (only for $LoggedAccount)
Definition at line 122 of file Account.php.
IsLogged | ( | ) |
Verify if this account is logged
Definition at line 93 of file Account.php.
IsOnline | ( | ) |
Definition at line 98 of file Account.php.
|
static |
Get the registered accounts (filtered by the current AppId, if set)
string | $username | Filter Username initial |
string | Filter Email initial | |
string[] | $customData Filter CustomData (must be an array of associative array: array(array("key"=>"myKey","op"=>"=","value"=>"myValue")) | |
string[] | $appCustomData Filter AppCustomData (must be an array of associative array: array(array("key"=>"myKey","op"=>"=","value"=>"myValue")) | |
boolean | $isOnline | Filter Online state |
int | $limit | Max number of results (for paged results) |
int | $offset | Offset number of results (for paged results) |
int | $count | Will be set to the total count of results |
boolean | $returnArray | If TRUE then it will return associative arrays else objects AppId $AppId |
Definition at line 144 of file Account.php.
|
static |
Get the registered accounts (filtered by the current AppId, if set)
int | $idApp | Filter players registered to an App |
string | $username | Filter Username initial |
string | Filter Email initial | |
string[] | $customData Filter CustomData (must be an array of associative array: array(array("key"=>"myKey","op"=>"=","value"=>"myValue")) | |
string[] | $appCustomData Filter AppCustomData (must be an array of associative array: array(array("key"=>"myKey","op"=>"=","value"=>"myValue")) | |
boolean | $isOnline | Filter Online state |
int | $limit | Max number of results (for paged results) |
int | $offset | Offset number of results (for paged results) |
int | $count | Will be set to the total count of results |
boolean | $returnArray | If TRUE then it will return associative arrays else objects Database $Database |
Definition at line 165 of file Account.php.
|
static |
Get the registered accounts (filtered by the current AppId, if set)
string | $ip | Filter Client IP |
int | $idApp | Filter players registered to an App |
string | $username | Filter Username initial |
string | Filter Email initial | |
string[] | $customData Filter CustomData (must be an array of associative array: array(array("key"=>"myKey","op"=>"=","value"=>"myValue")) | |
string[] | $appCustomData Filter AppCustomData (must be an array of associative array: array(array("key"=>"myKey","op"=>"=","value"=>"myValue")) | |
boolean | $isOnline | Filter Online state |
int | $limit | Max number of results (for paged results) |
int | $offset | Offset number of results (for paged results) |
int | $count | Will be set to the total count of results |
boolean | $returnArray | If TRUE then it will return associative arrays else objects Database $Database |
Definition at line 186 of file Account.php.
|
static |
Load users by Id
int[] | $ids Filter Id | |
boolean | $returnArray | If TRUE then it will return associative arrays else objects |
Definition at line 257 of file Account.php.
|
static |
Get the registered accounts
string | $excludeIds | Filter array of Id to exclude |
int | $limit | Max number of results (for paged results) |
int | $offset | Offset number of results (for paged results) |
int | $count | Will be set to the total count of results |
boolean | $returnArray | If it is TRUE then the function returns an associative array, else it returns an array of Account objects |
Definition at line 498 of file Account.php.
|
static |
Get the registered accounts who are friends of a user
int | $excludeIds | Filter Id of user |
int[] | $excludeIds Filter array of Id to exclude | |
int | $limit | Max number of results (for paged results) |
int | $offset | Offset number of results (for paged results) |
int | $count | Will be set to the total count of results |
boolean | $returnArray | If it is TRUE then the function returns an associative array, else it returns an array of Account objects |
Definition at line 540 of file Account.php.
|
static |
Load users by Id
int[] | $usernames Filter Username | |
boolean | $returnArray | If TRUE then it will return associative arrays else objects Database $Database |
Definition at line 272 of file Account.php.
|
static |
Log off this account $LoggedAccount
Definition at line 385 of file Account.php.
|
static |
Delete all records associated to this class
Definition at line 448 of file Account.php.
Save | ( | ) |
Save the record in the database
Definition at line 394 of file Account.php.
|
static |
Set the specified account as currently logged
Definition at line 352 of file Account.php.
ToArray | ( | ) |
Returns the array representation of this object
$LoggedAccount
Definition at line 606 of file Account.php.
ToArrayFiltered | ( | ) |
Generate a dictionary representation of the properties and custom data of this object $AppId Current App running as web service for clients
Definition at line 652 of file Account.php.
ToJson | ( | ) |
Returns the JSON representation of this object
Definition at line 595 of file Account.php.
ToJsonFiltered | ( | ) |
Generate a JSON representation of the properties and custom data of this object
Definition at line 686 of file Account.php.
|
static |
Set the specified account as not currently logged $LoggedAccount Database $Database
Definition at line 372 of file Account.php.
UpdateLastLogin | ( | ) |
$ActivationCode = "" |
Definition at line 21 of file Account.php.
$ChangePwdCode = "" |
Definition at line 22 of file Account.php.
$Email = "" |
Definition at line 20 of file Account.php.
$Enabled = 0 |
Definition at line 23 of file Account.php.
$GUID = "" |
Definition at line 17 of file Account.php.
$Id = 0 |
Definition at line 14 of file Account.php.
$LastLoginDate = "" |
Definition at line 18 of file Account.php.
$LastLoginIp = "" |
Definition at line 19 of file Account.php.
$Password = "" |
Definition at line 16 of file Account.php.
$Username = "" |
Definition at line 15 of file Account.php.
const TABLE_NAME = "Account" |
Definition at line 12 of file Account.php.