User accounts service.  
 More...
 | 
|   | __construct (protected Config $config, protected Translator $translator, protected PasswordService $passwords, protected EventsService $events, protected EmailService $email, protected PasswordGeneratorService $password_generator) | 
|   | Constructor.  More...
  | 
|   | 
|   | validateAccountData (string $username, string|array $password, string $name, string $email, bool $allow_multiple_emails=false) | 
|   | Validate registration details to ensure they can be used to register a new user account.  More...
  | 
|   | 
|   | assertValidAccountData (string $username, string|array $password, string $name, string $email, bool $allow_multiple_emails=false) | 
|   | Assert that given registration details are valid and can be used to register the user.  More...
  | 
|   | 
|   | register (array $params=[]) | 
|   | Registers a user.  More...
  | 
|   | 
|   | assertValidUsername (string $username, bool $assert_unregistered=false) | 
|   | Simple function which ensures that a username contains only valid characters.  More...
  | 
|   | 
|   | assertValidPassword (string|array $password) | 
|   | Simple validation of a password.  More...
  | 
|   | 
|   | assertCurrentPassword (\ElggUser $user, string $password) | 
|   | Assert that user can authenticate with the given password.  More...
  | 
|   | 
|   | assertValidEmail (string $address, bool $assert_unregistered=false) | 
|   | Simple validation of a email.  More...
  | 
|   | 
|   | isValidEmail (string $address) | 
|   | Validates an email address.  More...
  | 
|   | 
|   | requestNewEmailValidation (\ElggUser $user, string $email) | 
|   | Send out an e-mail to the new email address the user wanted.  More...
  | 
|   | 
|   | registerAuthenticationFailure (\ElggUser $user) | 
|   | Registers an authentication failure for a user.  More...
  | 
|   | 
|   | resetAuthenticationFailures (\ElggUser $user) | 
|   | Resets all authentication failures for a given user.  More...
  | 
|   | 
|   | isAuthenticationFailureLimitReached (\ElggUser $user, ?int $limit=null, ?int $lifetime=null) | 
|   | Checks if the authentication failure limit has been reached.  More...
  | 
|   | 
User accounts service. 
Definition at line 20 of file Accounts.php.
 
◆ __construct()
◆ assertCurrentPassword()
      
        
          | Elgg\Users\Accounts::assertCurrentPassword  | 
          ( | 
          \ElggUser  | 
          $user,  | 
        
        
           | 
           | 
          string  | 
          $password  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Assert that user can authenticate with the given password. 
- Parameters
 - 
  
    | \ElggUser | $user | User entity  | 
    | string | $password | Password | 
  
   
- Returns
 - void 
 
- Exceptions
 - 
  
  
 
Definition at line 299 of file Accounts.php.
 
 
◆ assertValidAccountData()
      
        
          | Elgg\Users\Accounts::assertValidAccountData  | 
          ( | 
          string  | 
          $username,  | 
        
        
           | 
           | 
          string|array  | 
          $password,  | 
        
        
           | 
           | 
          string  | 
          $name,  | 
        
        
           | 
           | 
          string  | 
          $email,  | 
        
        
           | 
           | 
          bool  | 
          $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 | array | $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 104 of file Accounts.php.
 
 
◆ assertValidEmail()
      
        
          | Elgg\Users\Accounts::assertValidEmail  | 
          ( | 
          string  | 
          $address,  | 
        
        
           | 
           | 
          bool  | 
          $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 314 of file Accounts.php.
 
 
◆ assertValidPassword()
      
        
          | Elgg\Users\Accounts::assertValidPassword  | 
          ( | 
          string|array  | 
          $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 264 of file Accounts.php.
 
 
◆ assertValidUsername()
      
        
          | Elgg\Users\Accounts::assertValidUsername  | 
          ( | 
          string  | 
          $username,  | 
        
        
           | 
           | 
          bool  | 
          $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 192 of file Accounts.php.
 
 
◆ isAuthenticationFailureLimitReached()
      
        
          | Elgg\Users\Accounts::isAuthenticationFailureLimitReached  | 
          ( | 
          \ElggUser  | 
          $user,  | 
        
        
           | 
           | 
          ?int  | 
          $limit = null,  | 
        
        
           | 
           | 
          ?int  | 
          $lifetime = null  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Checks if the authentication failure limit has been reached. 
- Parameters
 - 
  
    | \ElggUser | $user | User to check the limit for  | 
    | int | null | $limit | (optional) number of allowed failures  | 
    | int | null | $lifetime | (optional) number of seconds before a failure is considered expired | 
  
   
- Returns
 - bool 
 
- Since
 - 4.3 
 
Definition at line 435 of file Accounts.php.
 
 
◆ isValidEmail()
      
        
          | Elgg\Users\Accounts::isValidEmail  | 
          ( | 
          string  | 
          $address | ) | 
           | 
        
      
 
Validates an email address. 
- Parameters
 - 
  
    | string | $address | Email address | 
  
   
- Returns
 - bool 
 
Definition at line 348 of file Accounts.php.
 
 
◆ register()
      
        
          | Elgg\Users\Accounts::register  | 
          ( | 
          array  | 
          $params = [] | ) | 
           | 
        
      
 
Registers a user. 
- Parameters
 - 
  
    | array | $params | Array of options with keys: (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 (string) subtype => (optional) Subtype of the user entity (string) language => (optional) user language (defaults to current language) (bool) allow_multiple_emails => (optional) Allow the same email address to be registered multiple times (default false) (bool) validated => (optional) Is the user validated (default true) | 
  
   
- Returns
 - \ElggUser 
 
- Exceptions
 - 
  
  
 
Definition at line 131 of file Accounts.php.
 
 
◆ registerAuthenticationFailure()
      
        
          | Elgg\Users\Accounts::registerAuthenticationFailure  | 
          ( | 
          \ElggUser  | 
          $user | ) | 
           | 
        
      
 
Registers an authentication failure for a user. 
- Parameters
 - 
  
    | \ElggUser | $user | user to log the failure for | 
  
   
- Returns
 - void 
 
- Since
 - 4.3 
 
Definition at line 396 of file Accounts.php.
 
 
◆ requestNewEmailValidation()
      
        
          | Elgg\Users\Accounts::requestNewEmailValidation  | 
          ( | 
          \ElggUser  | 
          $user,  | 
        
        
           | 
           | 
          string  | 
          $email  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Send out an e-mail to the new email address the user wanted. 
- Parameters
 - 
  
    | \ElggUser | $user | user with new e-mail address  | 
    | string | $email | E-mail address | 
  
   
- Returns
 - bool 
 
- Exceptions
 - 
  
  
 
Definition at line 361 of file Accounts.php.
 
 
◆ resetAuthenticationFailures()
      
        
          | Elgg\Users\Accounts::resetAuthenticationFailures  | 
          ( | 
          \ElggUser  | 
          $user | ) | 
           | 
        
      
 
Resets all authentication failures for a given user. 
- Parameters
 - 
  
    | \ElggUser | $user | user to clear the failures for | 
  
   
- Returns
 - void 
 
- Since
 - 4.3 
 
Definition at line 412 of file Accounts.php.
 
 
◆ validateAccountData()
      
        
          | Elgg\Users\Accounts::validateAccountData  | 
          ( | 
          string  | 
          $username,  | 
        
        
           | 
           | 
          string|array  | 
          $password,  | 
        
        
           | 
           | 
          string  | 
          $name,  | 
        
        
           | 
           | 
          string  | 
          $email,  | 
        
        
           | 
           | 
          bool  | 
          $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 55 of file Accounts.php.
 
 
The documentation for this class was generated from the following file: