User Guide | Validation Functions

Validation has two important roles within any login system, primarily it is used to check whether a user is authorised to perform specific actions.
Secondarily it is used to ensure the integrity of data within the database, checking that values like passwords are of a valid length and contain acceptable characters.

Below is a compiled list of functions and configuration settings to customise the validation of user credentials.

Validation : User Guide Index

Validation / Security Config | Validation Functions

Validation and Security Configuration

Customise the configuration of how the library handles password settings and the settings for Google reCAPTCHA.

Validation and Security Config. File Settings

User Status / Privilege Validation Functions

  • is_logged_in()
    Verifies a user is logged in either via entering a valid password or using the 'Remember me' feature.
  • is_logged_in_via_password()
    Verifies a user has logged in via entering a valid password rather than using the 'Remember me' feature.
  • is_admin()
    Verifies a user belongs to a user group with admin permissions.
  • in_group()
    Verifies whether a user is assigned to a particular user group.
  • is_privileged()
    Verifies whether a user has a specific privilege.

Identity Validation Functions


Password Validation Functions


Captcha Validation Functions

  • validate_recaptcha()
    Validates if a Google reCAPTCHA answer is correct.
  • validate_math_captcha()
    Validates if a math captcha answer is correct.
  • ip_login_attempts_exceeded()
    Validates whether the number of failed login attempts from a unique IP address has exceeded a defined limit.
    Typically used in conjunction with showing a captcha for users repeatedly failing login attempts.