User accounts service.
More...
|
| __construct (Config $config, Translator $translator, PasswordService $passwords, UsersTable $users, PluginHooksService $hooks) |
| Constructor. More...
|
|
| validateAccountData ($username, $password, $name, $email, $allow_multiple_emails=false) |
| Validate registration details to ensure they can be used to register a new user account. More...
|
|
| assertValidAccountData ($username, $password, $name, $email, $allow_multiple_emails=false) |
| Assert that given registration details are valid and can be used to register the user. More...
|
|
| register ($username, $password, $name, $email, $allow_multiple_emails=false, $subtype=null) |
| Registers a user, returning false if the username already exists. More...
|
|
| assertValidUsername ($username, $assert_unregistered=false) |
| Simple function which ensures that a username contains only valid characters. More...
|
|
| assertValidPassword ($password) |
| Simple validation of a password. More...
|
|
| assertCurrentPassword (ElggUser $user, $password) |
| Assert that user can authenticate with the given password. More...
|
|
| assertValidEmail ($address, $assert_unregistered=false) |
| Simple validation of a email. More...
|
|
| isValidEmail ($address) |
| Validates an email address. More...
|
|
User accounts service.
Definition at line 17 of file Accounts.php.
Elgg\Users\Accounts::assertCurrentPassword |
( |
ElggUser |
$user, |
|
|
|
$password |
|
) |
| |
Assert that user can authenticate with the given password.
- Parameters
-
ElggUser | $user | User entity |
string | $password | Password |
- Returns
- void
- Exceptions
-
Definition at line 329 of file Accounts.php.
Elgg\Users\Accounts::assertValidAccountData |
( |
|
$username, |
|
|
|
$password, |
|
|
|
$name, |
|
|
|
$email, |
|
|
|
$allow_multiple_emails = false |
|
) |
| |
Assert that given registration details are valid and can be used to register the user.
- Parameters
-
string | $username | The username of the new user |
string | $password | The password |
string | $name | The user's display name |
string | $email | The user's email address |
bool | $allow_multiple_emails | Allow the same email address to be registered multiple times? |
- Returns
- void
- Exceptions
-
Definition at line 133 of file Accounts.php.
Elgg\Users\Accounts::assertValidEmail |
( |
|
$address, |
|
|
|
$assert_unregistered = false |
|
) |
| |
Simple validation of a email.
- Parameters
-
string | $address | Email address |
bool | $assert_unregistered | Also assert that the email address has not yet been used for a user account |
- Returns
- void
- Exceptions
-
Definition at line 344 of file Accounts.php.
Elgg\Users\Accounts::assertValidPassword |
( |
|
$password | ) |
|
Simple validation of a password.
- Parameters
-
string | array | $password | Clear text password Can be an array [$password, $confirm_password] |
- Returns
- void
- Exceptions
-
Definition at line 289 of file Accounts.php.
Elgg\Users\Accounts::assertValidUsername |
( |
|
$username, |
|
|
|
$assert_unregistered = false |
|
) |
| |
Simple function which ensures that a username contains only valid characters.
This should only permit chars that are valid on the file system as well.
- Parameters
-
string | $username | Username |
bool | $assert_unregistered | Also assert that the username has not yet been registered |
- Returns
- void
- Exceptions
-
Definition at line 211 of file Accounts.php.
Elgg\Users\Accounts::isValidEmail |
( |
|
$address | ) |
|
Validates an email address.
- Parameters
-
string | $address | Email address |
- Returns
- bool
Definition at line 378 of file Accounts.php.
Elgg\Users\Accounts::register |
( |
|
$username, |
|
|
|
$password, |
|
|
|
$name, |
|
|
|
$email, |
|
|
|
$allow_multiple_emails = false , |
|
|
|
$subtype = null |
|
) |
| |
Registers a user, returning false if the username already exists.
- Parameters
-
string | $username | The username of the new user |
string | $password | The password |
string | $name | The user's display name |
string | $email | The user's email address |
bool | $allow_multiple_emails | Allow the same email address to be registered multiple times? |
string | $subtype | Subtype of the user entity |
- Returns
- int|false The new user's GUID; false on failure
- Exceptions
-
Definition at line 159 of file Accounts.php.
Elgg\Users\Accounts::validateAccountData |
( |
|
$username, |
|
|
|
$password, |
|
|
|
$name, |
|
|
|
$email, |
|
|
|
$allow_multiple_emails = false |
|
) |
| |
Validate registration details to ensure they can be used to register a new user account.
- Parameters
-
string | $username | The username of the new user |
string | array | $password | The password Can be an array [$password, $oonfirm_password] |
string | $name | The user's display name |
string | $email | The user's email address |
bool | $allow_multiple_emails | Allow the same email address to be registered multiple times? |
- Returns
- ValidationResults
Definition at line 80 of file Accounts.php.
Elgg\Users\Accounts::$config |
|
protected |
Elgg\Users\Accounts::$hooks |
|
protected |
Elgg\Users\Accounts::$passwords |
|
protected |
Elgg\Users\Accounts::$translator |
|
protected |
Elgg\Users\Accounts::$users |
|
protected |
The documentation for this class was generated from the following file: