|
|
|
Login
Introduction | Settings | Customising | Functions
Introduction
OfficeTrio's login page allows users to register, login, logout, update their details, retreive lost passwords and delete cookies.
All these functions are also available for you to use in your own code (see below for a list). You can build your own pages to do a subset of the functions, or build your own login page using a different format. You can use the existing login page as an example of how to construct your own pages.
Settings
The login settings are under the 'General ECommerce' and 'Email' sections of the Settings. The forms are defined in the Forms Manager, and are all optional as O3 will generate defaults if none is set:
General Settings
- Login Form - The name of the form to use for the login
- Logout Form - The name of the form to use for logout
- Signup Form - The name of the form to use for register / signup
- Send Password Form - The name of the form to use for sending lost passwords
- Clear Cookies Form - The name of the form to use for the clear cookies function
- User-Update Form - The name of the form to use to update user details.
Membership Settings
- Free Membership - If this is set, the signup form will be displayed in the login page.
- Verify? - Users must verify their email address by clicking on a link in the welcome email.
- Require Addr - Users must supply an address to register
- Require Tel - Users must supply a telephone number to register
- Require URL - Users must supply a website address to register. (useful for affiliate programs)
- Commercial Membership - If this is set, a list of all membership products will be displayed in the Login page.
- Signup Text - Text / HTML to be displayed before the list of membership products
Customising
You can easily add your own logo to the login page, or you can customise it to your requirements.
To replace the O3 logo with yours in ALL O3's admin pages - simply replace these two images:
- o3/img/b4-l.gif - Left hand side of logo ('OfficeTrio')
- o3/img/b4-r.gif - Right hand side of logo (Image)
...or you can replace/edit this file, which contains the images above:
- o3/o3-logo.php - OfficeTrio logo
You can build you own login pages using the functions listed below:
Login / User Functions
This is a list of all the O3 user-functions available to you. They're defined in the file user-func.php.
| show_login_form (form) |
Return the login form. (Note: to display the form use 'echo show_login_form(...')
Uses the provided form, if supplied, else the one defined in the settings if it exists. If no form is defined - generate a default.
|
| show_signup_form (form) |
Return the signup (register) form.
Uses the provided form, if supplied, else the one defined in the settings if it exists. If no form is defined - generate a default.
|
| show_send_password_form (form) |
Return the send (email) password form.
Uses the provided form, if supplied, else the one defined in the settings if it exists. If no form is defined - generate a default.
|
| show_clear_cookies_form (form) |
Return the clear-cookies form.
Uses the provided form, if supplied, else the one defined in the settings if it exists. If no form is defined - generate a default.
|
| show_user_details_form (form) |
Return the user details form.
Uses the provided form, if supplied, else the one defined in the settings if it exists. If no form is defined - generate a default.
|
| do_login () |
Attempt to log the user in using the variables passed in from the login form (i.e. you don't supply them as arguments to the function).
Returns TRUE, or an error message.
- $_REQUEST['email'] - The user email address
- $_REQUEST['passwd'] - The user password.
|
| logout () |
Log the current user out. Delete their session.
|
| get_user_details (us, mem, ty) |
Get the current user's details (into $GLOBALS).
- us - (optional) Get the user's data (from o3_users) TRUE/FALSE. Default TRUE
- mem - (optional) Get the user's memberships data (from o3_groups) TRUE/FALSE. Default TRUE.
- ty - (optional) Get the user's type (profile) data (from o3_ty_{$s_usertype}) TRUE/FALSE. Default TRUE.
|
| verify_user (uid, vk) |
Verify the user's account. If the 'Verify' step is required (as defined in the Membership Settings), the key is sent to the users email address.
Returns TRUE, or an error message.
- uid - The user ID
- vk - The verify key.
|
| check_session (addnew) |
Check a session is valid. Get ALL of the user's data (inc. memberships & type data).
Returns TRUE, or an error message.
- addnew - (optional) if the session isn't valid create a new 'visitor' account. Default FALSE
|
| check_email (email) |
Validate the email address format.
Return TRUE or FALSE:
- email - The email adress to validate.
|
| check_registration () |
Check registration details are OK & create the new user. Require a verification step if so defined in the Settings. Get ALL of the user's data (inc. memberships & type data).
Uses the variables passed in from the signup form (i.e. you don't supply them as arguments to the function).
Returns TRUE, or an error message.
- $_REQUEST['email'] - The user's email address
- $_REQUEST['name'] - The user's name
- $_REQUEST['passwd'] - The user's password
- $_REQUEST['street'] - The user's street address
- $_REQUEST['city'] - The user's city / town
- $_REQUEST['state'] - The user's state / regoin
- $_REQUEST['country'] - The user's country
- $_REQUEST['zip'] - The user's zip / post code
- $_REQUEST['tel'] - The user's telephone number
- $_REQUEST['url'] - The user's website address
|
| send_password () |
Email the user their password.
Uses the variables passed in from the send-password form (i.e. you don't supply them as arguments to the function).
Returns TRUE, or an error message.
- $_REQUEST['email'] - The user's email address
|
| update_details () |
Check user details are OK & update the details. This will update the user's Type data (profile) too (If it's set). If the email address is changed it's first checked for validity, then uniqueness.
Uses the variables passed in from the update form (i.e. you don't supply them as arguments to the function).
Returns TRUE, or an error message.
- $_REQUEST['new_us_email'] - The user's email address
- $_REQUEST['new_us_name'] - The user's name
- $_REQUEST['new_us_passwd'] - The user's password
- $_REQUEST['new_us_street'] - The user's street address
- $_REQUEST['new_us_city'] - The user's city / town
- $_REQUEST['new_us_state'] - The user's state / regoin
- $_REQUEST['new_us_country'] - The user's country
- $_REQUEST['new_us_zip'] - The user's zip / post code
- $_REQUEST['new_us_tel'] - The user's telephone number
- $_REQUEST['new_us_url'] - The user's website address
|
| show_memberships () |
Return a list of membership products as name, desc, and addtocart. For use in the login page.
This is really redundant as show_products can do the same thing better.
Uses the provided form, if supplied, else the one defined in the settings if it exists. If no form is defined - generate a default.
|
|