This trait provides functionality for user authentication, login, logout, and password management in a frontend application.

Views

Login

Displays the login page for users.

Checks if the user is already logged in and redirects to the site’s homepage if true. Otherwise, it loads the login view with necessary data.

Reset Password Page

Displays the reset password page for users.

id
integer

The user ID

token
string

The reset token

Verifies the reset token and loads the reset password view with the appropriate status.

Custom User Self-service

Artist

Handles various artist-related pages and actions.

page
string

The requested page (login, edit, logout)

err
string

Optional error code

Manages artist login, profile editing, and logout functionalities.

Login Artist

Processes artist login.

Authenticates the artist and sets up the session if successful.

Update Artist

Updates artist information.

Updates the artist’s bio and exhibition information.

Login/Logout

User Login

Processes user login.

Authenticates the user and sets up the session if successful.

Logout

Logs out the user.

Clears the user’s session data.

Reset Password

Reset Password Final

Processes the final step of password reset.

Updates the user’s password after validation.

Reset Password Backend

Processes password reset for backend users.

Updates the backend user’s password after validation.

Password Check

Validates password strength.

password
string

The password to check

return
boolean

Returns true if the password meets the required criteria, false otherwise

Checks if the password contains at least one number, one uppercase letter, one lowercase letter, and one special character, with a length between 8 and 50 characters.

This trait requires the CodeIgniter framework and assumes the existence of various model methods and views that are not shown in the provided code.