Combu Server  3.1.1
PHP API Documentation
Public Member Functions | Static Public Member Functions | Data Fields
AdminAccount Class Reference
Inheritance diagram for AdminAccount:
DataClass

Public Member Functions

 __construct ($src=null, $stripSlashes=false)
 
 ExistsUsername ()
 
 IsLogged ()
 
 Save ()
 
 Delete ()
 
 ToJson ()
 
- Public Member Functions inherited from DataClass
 Save ()
 
 Delete ()
 
 ToJson ()
 
 ToArray ()
 

Static Public Member Functions

static Load ($username="", $limit=null, $offset=null, &$count=null, $returnArray=false)
 
static CheckLogin ($username, $password, &$account=null)
 
static GetSession ()
 
static SetSession (&$account)
 
static UnsetSession ()
 
static Logout ()
 
- 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 = "AdminAccount"
 
 $Id = 0
 
 $Username = ""
 
 $Password = ""
 

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="")
 

Detailed Description

Definition at line 5 of file AdminAccount.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $src = null,
  $stripSlashes = false 
)

Contructor

Definition at line 16 of file AdminAccount.php.

Member Function Documentation

◆ CheckLogin()

static CheckLogin (   $username,
  $password,
$account = null 
)
static

Check if specified login data are correct and the account is active

Parameters
string$usernameUsername
string$passwordPassword
int&$idIs set to the Id of the found account
Returns
bool Returns TRUE if login is valid

Definition at line 87 of file AdminAccount.php.

◆ Delete()

Delete ( )

Delete the record from the database

Returns
bool Returns TRUE on success

Definition at line 175 of file AdminAccount.php.

◆ ExistsUsername()

ExistsUsername ( )

Check if the current Username already exists

Returns
boolean Returns TRUE if Username exists

Definition at line 37 of file AdminAccount.php.

◆ GetSession()

static GetSession ( )
static

Returns the account that is currently logged

Returns
Account Account that is current logged

Definition at line 107 of file AdminAccount.php.

◆ IsLogged()

IsLogged ( )

Verify if this account is logged

Returns
bool Returns TRUE if the account is logged

Definition at line 56 of file AdminAccount.php.

◆ Load()

static Load (   $username = "",
  $limit = null,
  $offset = null,
$count = null,
  $returnArray = false 
)
static

Get the registered accounts

Parameters
string$usernameFilter Username initial
int$limitMax number of results (for paged results)
int$offsetOffset number of results (for paged results)
int$countWill be set to the total count of results
boolean$returnArrayIf it is TRUE then the function returns an associative array, else it returns an array of Account objects
Returns
array Returns the array of records found as associative array or array of Account objects

Definition at line 71 of file AdminAccount.php.

◆ Logout()

static Logout ( )
static

Log off this account

Definition at line 138 of file AdminAccount.php.

◆ Save()

Save ( )

Save the record in the database

Returns
bool Returns TRUE on success

Definition at line 147 of file AdminAccount.php.

◆ SetSession()

static SetSession ( $account)
static

Set the specified account as currently logged

Parameters
Account$acctAccount to be set as current logged

Definition at line 118 of file AdminAccount.php.

◆ ToJson()

ToJson ( )

Definition at line 181 of file AdminAccount.php.

◆ UnsetSession()

static UnsetSession ( )
static

Set the specified account as not currently logged

Definition at line 129 of file AdminAccount.php.

Field Documentation

◆ $Id

$Id = 0

Definition at line 9 of file AdminAccount.php.

◆ $Password

$Password = ""

Definition at line 11 of file AdminAccount.php.

◆ $Username

$Username = ""

Definition at line 10 of file AdminAccount.php.

◆ TABLE_NAME

const TABLE_NAME = "AdminAccount"

Definition at line 7 of file AdminAccount.php.