> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getlecker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# User_Frontend

> Documentation for the User_Frontend

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

## Views

### Login

Displays the login page for users.

<CodeGroup>
  ```php theme={null}
  public function login()
  ```
</CodeGroup>

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.

<CodeGroup>
  ```php theme={null}
  public function reset_password_page($id, $token)
  ```
</CodeGroup>

<ParamField path="id" type="integer">
  The user ID
</ParamField>

<ParamField path="token" type="string">
  The reset token
</ParamField>

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.

<CodeGroup>
  ```php theme={null}
  public function artist($page, $err = '')
  ```
</CodeGroup>

<ParamField path="page" type="string">
  The requested page (login, edit, logout)
</ParamField>

<ParamField path="err" type="string">
  Optional error code
</ParamField>

Manages artist login, profile editing, and logout functionalities.

### Login Artist

Processes artist login.

<CodeGroup>
  ```php theme={null}
  public function loginArtist()
  ```
</CodeGroup>

Authenticates the artist and sets up the session if successful.

### Update Artist

Updates artist information.

<CodeGroup>
  ```php theme={null}
  public function updateArtist()
  ```
</CodeGroup>

Updates the artist's bio and exhibition information.

## Login/Logout

### User Login

Processes user login.

<CodeGroup>
  ```php theme={null}
  public function user_login()
  ```
</CodeGroup>

Authenticates the user and sets up the session if successful.

### Logout

Logs out the user.

<CodeGroup>
  ```php theme={null}
  public function logout()
  ```
</CodeGroup>

Clears the user's session data.

## Reset Password

### Reset Password Final

Processes the final step of password reset.

<CodeGroup>
  ```php theme={null}
  public function reset_password_final()
  ```
</CodeGroup>

Updates the user's password after validation.

### Reset Password Backend

Processes password reset for backend users.

<CodeGroup>
  ```php theme={null}
  public function reset_password_backend()
  ```
</CodeGroup>

Updates the backend user's password after validation.

### Password Check

Validates password strength.

<CodeGroup>
  ```php theme={null}
  public function password_check($password)
  ```
</CodeGroup>

<ParamField path="password" type="string">
  The password to check
</ParamField>

<ResponseField name="return" type="boolean">
  Returns true if the password meets the required criteria, false otherwise
</ResponseField>

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.

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