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.
public function reset_password_page($id, $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.
public function artist($page, $err = '')
The requested page (login, edit, logout)
Manages artist login, profile editing, and logout functionalities.
Login Artist
Processes artist login.
public function loginArtist()
Authenticates the artist and sets up the session if successful.
Update Artist
Updates artist information.
public function updateArtist()
Updates the artist’s bio and exhibition information.
Login/Logout
User Login
Processes user login.
public function 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.
public function reset_password_final()
Updates the user’s password after validation.
Reset Password Backend
Processes password reset for backend users.
public function reset_password_backend()
Updates the backend user’s password after validation.
Password Check
Validates password strength.
public function password_check($password)
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.