PHP 클래스 Account, generatedata

상속: extends apiModel
파일 보기 프로젝트 열기: benkeen/generatedata 1 사용 예제들

공개 메소드들

메소드 설명
__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 )