Accounts
class Accounts (View source)
The Accounts class provides all methods for creating and loading user accounts.
Methods
Add user account based on $_POST.
Delete one ore more user accounts.
Install the first user account.
Generate the PHP code for the accounts file. Basically the code returns the unserialized serialized array with all users.
Get the accounts array by including the accounts PHP file.
Create hash from password to store in accounts.txt.
Verify if a password matches its hashed version.
Save the accounts array as PHP to AM_FILE_ACCOUNTS.
Details
at line 62
static array
add()
Add user account based on $_POST.
at line 125
static array
delete(array $users)
Delete one ore more user accounts.
at line 175
static string
install()
Install the first user account.
at line 220
static string
generatePHP(array $accounts)
Generate the PHP code for the accounts file. Basically the code returns the unserialized serialized array with all users.
That way, the accounts array can be stored as PHP. The accounts file has to be a PHP file for security reasons. When trying to access the file directly via the browser, it gets executed instead of revealing any user names.
at line 235
static array
get()
Get the accounts array by including the accounts PHP file.
at line 249
static string
passwordHash(string $password)
Create hash from password to store in accounts.txt.
at line 266
static boolean
passwordVerified(string $password, string $hash)
Verify if a password matches its hashed version.
at line 279
static boolean
write($accounts)
Save the accounts array as PHP to AM_FILE_ACCOUNTS.