PHP Class Account, generatedata

Inheritance: extends apiModel
Afficher le fichier Open project: benkeen/generatedata Class Usage Examples

Méthodes publiques

Méthode Description
__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 )

Private Methods

Méthode Description
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.

Method Details

__construct() public méthode

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() public static méthode

Helper function to determine if a user account exists, as determined by their email address.
public static checkAccountExists ( $email ) : boolean
$email
Résultat boolean

copyConfiguration() public méthode

public copyConfiguration ( $data )

createAccount() public static méthode

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
Résultat integer

deleteAccount() public méthode

public deleteAccount ( $accountID )

deleteConfigurations() public méthode

public deleteConfigurations ( $configurationIDs )

getAccount() public méthode

public getAccount ( )

getAccountID() public méthode

public getAccountID ( )

getAccountType() public méthode

public getAccountType ( )

getConfigurations() public méthode

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() public méthode

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

getDataSetHistory() public méthode

public getDataSetHistory ( $configurationID )

getDataTypePlugins() public méthode

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

getDefaultExportType() public méthode

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() public méthode

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

getPublicDataSet() public méthode

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

getSelectedCountries() public méthode

getSelectedDataTypes() public méthode

getSelectedExportTypes() public méthode

getUsers() public méthode

public getUsers ( )

isAdmin() public méthode

public isAdmin ( )

isAnonymousAdmin() public méthode

public isAnonymousAdmin ( )

login() public static méthode

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 méthode

public static logout ( )

resetPassword() public static méthode

public static resetPassword ( $email )

saveConfiguration() public méthode

public saveConfiguration ( $data )

saveDataSetVisibilityStatus() public méthode

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 méthode

public updateAccount ( $accountID, $info )

updateAccountByAdmin() public méthode

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

updateRowsGeneratedCount() public méthode

public updateRowsGeneratedCount ( $configurationID, $rowsGenerated )

updateSelectedPlugins() public static méthode

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