THE CLASS ITSELF
Description: Users related functions.
File: cart-boxx/core/lib/LIB_User.php
$_CB->User->signin($_POST[’email’],$_POST[‘password’]);
SESSION RELATED
Description: Process user sign in
[STRING] $password – User password
Description: No. You only need to unset the $_SESSION[‘user’] variable to sign the user out.
GET AND SEARCH
Description: Get all users
[INT] $page – Optional, the current page number, will automatically LIMIT the results based on the PER_PAGE setting in the config database.
[BOOL] False if no users are found
Description: Count the total number of users
Description: Get user by ID
[BOOL] False if not found
Description: Get user by email
[INT] $excl – Optional, exclude this user ID. Used for checking if user email is already registered. see checkReg below.
[BOOL] False if not found
Description: Check if given email is already registered
[INT] $excl – (Optional) Exclude this user ID from the search. If you update a user and do not change the email – The system will give a false ‘already registered’ if you do not exclude the updating user.
ADMIN RELATED
Description: Add new user, will send a verification email to the user – The account will not be activated until the user clicks on the link in the verification email.
[STRING] $redirect – Optional, redirect to this given slug. This function will send an activation email to the user, if provided, the user will be redirected to this given slug on successful activation.
Description: Update user
Description: Toggle user account status
[INT] $stat – Account status. 0 for suspended, 1 for active, 2 for pending activation… Or define your own code.
Description: Delete user (but will keep the orders)
FORGOTTEN PASSWORD AND ACTIVATION
Description: Send out password reset verification email
[STRING] $redirect – Optional, redirect to this given slug. This function will send an verification email to the user, if provided, the user will be redirected to this given slug on successful verification.
Description: Verify the given hash, generate password and send to user via email.
[STRING] $hash – Random hash
Description: Check the given hash and activate the newly registered account.
[STRING] $hash – Random hash