Class Validator
Validates and in very rare cases sanitizes relevant user input.
This static class checks user input through login forms, to avoid
attacks. Here, no SQL escape functions are (explicitly) called!
This is the initial implementation and might require additional checks.
Namespace: hrm
Package: hrm
Located at Validator.php
Methods summary
public static
boolean
|
#
isStringSanitized( string $string )
Generic function that checks whether the string is sanitized.
Generic function that checks whether the string is sanitized.
Parameters
- $string
A string coming from a text field or the like that
is not meant to be input to the database.
Returns
boolean True if the string is sanitized, false otherwise.
|
public static
boolean
|
#
isUserNameValid( string $inputUserName )
Validates the user name.
The user name is forced to be lowercase. Only single words are accepted.
Parameters
- $inputUserName
- User name input through some login form.
Returns
boolean True if the user name is valid, false otherwise.
|
public static
mixed
|
#
isEmailValid( string $inputEmail )
Validates the e-mail address.
Validates the e-mail address.
It must be a valid e-mail address.
Parameters
- $inputEmail
- E-mail input through some login form.
Returns
mixed Returns the filtered e-mail, or false.
|
public static
boolean
|
#
isGroupNameValid( string $inputGroupName )
Validates the group name.
Validates the group name.
The group name can be any (sane) string and can contain blank spaces.
Parameters
- $inputGroupName
- Group name input through some login form.
Returns
boolean True if the group name is valid, false otherwise.
|
public static
boolean
|
#
isPasswordValid( string $inputPassword )
Validates the password.
The password cannot contain spaces.
Parameters
- $inputPassword
- Password input through some login form.
Returns
boolean True if the group password is valid, false otherwise.
|
public static
boolean
|
#
isNoteValid( string $inputNote )
Validates the request note for new users.
Validates the request note for new users.
The note can be any (sane) string.
Parameters
- $inputNote
- Generic text input through some login form.
Returns
boolean True if the group name is valid, false otherwise.
|