CouchCMS
User Login forThis project is no longer maintained; native functionality has been introduced.
Features
- Registration
- Account Activation
- Log In
- Remember Me (Stay Logged In)
- Log Out
- Reset/Forgot Password
- User Profiles
- User Avatars (Gravatar Fallback)
- User Listing
- Account Settings
- Field Customization
- Login Throttling (Brute Force Protection)
- Secure Password Hashing (Password Compatibility Library)
Requirements
- PHP 5.3.7+
- CouchCMS 1.4+
- Enable the session and data-bound-form addons in your
couch/addons/kfunctions.php
file:
require_once( K_COUCH_DIR . 'addons/cart/session.php' );
require_once( K_COUCH_DIR . 'addons/data-bound-form/data-bound-form.php' );
Installation
- Place the
addons/password-compatibility.php
file in yourcouch/addons
folder. - Place all of the
snippets/*.php
files in yourcouch/snippets
folder. - Copy the contents of
config.php
and paste it to the end of yourcouch/config.php
file. - Place the
account.php
,login.php
,register.php
,reset.php
, andusers.php
templates in your website root folder and register them with CouchCMS.
Usage
- Embed the
user-init.php
snippet file at the start of each template you wish to enable user functionality:
<cms:embed 'user-init.php'/>
- You can then check a visitor's login status using the
authenticated
variable:
<cms:if authenticated>
You are logged in!
<cms:else/>
You are not logged in!
</cms:if>
- If a visitor is logged in, a number of additional variables are provided:
my_user_id
- ID of user's cloned pagemy_user_profile
- Link to user's cloned pagemy_user_name
- Usernamemy_user_email
- Email Addressmy_user_fname
- First Name (Optional)my_user_lname
- Last Name (Optional)my_user_avatar
- Avatar Image
Copyright and License
Copyright (c) 2015. Released under the MIT License.