PHP Класс Account, generatedata

Наследование: extends apiModel
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( mixed $accountID ) Instantiates a user account. This is passed either "anonymous" or the Account ID as the constructor parameter. User account login is done via the login method below.
checkAccountExists ( $email ) : boolean Helper function to determine if a user account exists, as determined by their email address.
copyConfiguration ( $data )
createAccount ( $accountInfo, boolean $isCurrentUser = false ) : integer Used (currently) in the installation script. Note: this function relies on the settings file having been defined, along with an arbitrary encryption salt.
deleteAccount ( $accountID )
deleteConfigurations ( $configurationIDs )
getAccount ( )
getAccountID ( )
getAccountType ( )
getConfigurations ( ) As of 3.2.1, configurations are now backed up for every time the user clicks save. This method continues to work the same, but only returns the most recent configuration version from the history table.
getCountryPlugins ( ) Returns the subset of Country plugins selected by this user.
getDataSetHistory ( $configurationID )
getDataTypePlugins ( ) Returns the subset of Data Type plugins selected by this user.
getDefaultExportType ( ) With 3.2.2, users can now customize the plugins they want to use, so Core::getDefaultExportType() is no longer sufficient to figure out what tab should be selected in the UI on page load. This is now used instead.
getExportTypePlugins ( ) Returns the subset of Export Type plugins selected by this user.
getPublicDataSet ( $configurationID ) Loads ANY public data set.
getSelectedCountries ( )
getSelectedDataTypes ( )
getSelectedExportTypes ( )
getUsers ( )
isAdmin ( )
isAnonymousAdmin ( )
login ( $email, $password ) Attempts to log a user in. If successful, it updates sessions and returns a success message; otherwise, just returns the appropriate error
logout ( )
resetPassword ( $email )
saveConfiguration ( $data )
saveDataSetVisibilityStatus ( $configurationID, $status, $time ) Time is currently passed but not used. It's going to be used to ensure that only NEWEST requests actually update the record
updateAccount ( $accountID, $info )
updateAccountByAdmin ( $info ) called by administrators to update a user's account
updateRowsGeneratedCount ( $configurationID, $rowsGenerated )
updateSelectedPlugins ( $accountID, $dataTypes, $exportTypes, $countries )

Приватные методы

Метод Описание
getCurrentUser ( $accountID ) Called by the constructor and any time the user updates his/her user account.
truncateDataSetHistory ( $configurationID ) Called after every save. This ensures the size of the history is truncated to whatever value is set (see the $maxDataSetHistorySize setting in Core.

Описание методов

__construct() публичный Метод

Instantiates a user account. This is passed either "anonymous" or the Account ID as the constructor parameter. User account login is done via the login method below.
public __construct ( mixed $accountID )
$accountID mixed

checkAccountExists() публичный статический Метод

Helper function to determine if a user account exists, as determined by their email address.
public static checkAccountExists ( $email ) : boolean
$email
Результат boolean

copyConfiguration() публичный Метод

public copyConfiguration ( $data )

createAccount() публичный статический Метод

Used (currently) in the installation script. Note: this function relies on the settings file having been defined, along with an arbitrary encryption salt.
public static createAccount ( $accountInfo, boolean $isCurrentUser = false ) : integer
$accountInfo
$isCurrentUser boolean
Результат integer

deleteAccount() публичный Метод

public deleteAccount ( $accountID )

deleteConfigurations() публичный Метод

public deleteConfigurations ( $configurationIDs )

getAccount() публичный Метод

public getAccount ( )

getAccountID() публичный Метод

public getAccountID ( )

getAccountType() публичный Метод

public getAccountType ( )

getConfigurations() публичный Метод

As of 3.2.1, configurations are now backed up for every time the user clicks save. This method continues to work the same, but only returns the most recent configuration version from the history table.
public getConfigurations ( )

getCountryPlugins() публичный Метод

Returns the subset of Country plugins selected by this user.
public getCountryPlugins ( )

getDataSetHistory() публичный Метод

public getDataSetHistory ( $configurationID )

getDataTypePlugins() публичный Метод

Returns the subset of Data Type plugins selected by this user.
public getDataTypePlugins ( )

getDefaultExportType() публичный Метод

With 3.2.2, users can now customize the plugins they want to use, so Core::getDefaultExportType() is no longer sufficient to figure out what tab should be selected in the UI on page load. This is now used instead.

getExportTypePlugins() публичный Метод

Returns the subset of Export Type plugins selected by this user.

getPublicDataSet() публичный Метод

Loads ANY public data set.
public getPublicDataSet ( $configurationID )

getSelectedCountries() публичный Метод

getSelectedDataTypes() публичный Метод

getSelectedExportTypes() публичный Метод

getUsers() публичный Метод

public getUsers ( )

isAdmin() публичный Метод

public isAdmin ( )

isAnonymousAdmin() публичный Метод

public isAnonymousAdmin ( )

login() публичный статический Метод

Attempts to log a user in. If successful, it updates sessions and returns a success message; otherwise, just returns the appropriate error
public static login ( $email, $password )

logout() публичный статический Метод

public static logout ( )

resetPassword() публичный статический Метод

public static resetPassword ( $email )

saveConfiguration() публичный Метод

public saveConfiguration ( $data )

saveDataSetVisibilityStatus() публичный Метод

Time is currently passed but not used. It's going to be used to ensure that only NEWEST requests actually update the record
public saveDataSetVisibilityStatus ( $configurationID, $status, $time )

updateAccount() публичный Метод

public updateAccount ( $accountID, $info )

updateAccountByAdmin() публичный Метод

called by administrators to update a user's account
public updateAccountByAdmin ( $info )

updateRowsGeneratedCount() публичный Метод

public updateRowsGeneratedCount ( $configurationID, $rowsGenerated )

updateSelectedPlugins() публичный статический Метод

public static updateSelectedPlugins ( $accountID, $dataTypes, $exportTypes, $countries )