This documentation refers to an older version of CiviCRM (3.4 / 4.0). View latest version.

Skip to end of metadata
Go to start of metadata
This page refers to CiviCRM 3.4 and 4.0, current STABLE version.

Documentation Search


CiviCRM 3.4 and 4.0 Documentation

Support and Participation

Developer Resources


CiviCRM books!

Make sure to check out the FLOSS Manual Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

Or support us by buying an eBook or hard copy of Using CiviCRM from Packt Publishing.

Joomla CiviCRM Membership Authentication and ACL Plugin

There are two versions of this plugin.

  • Version 2.1 for Joomla 1.6 - 2.5 only which extends v1 by adding the following
    • Sets the Joomla Access Level depending on the users Membership Status and / or Membership Type
    • Allows users to login with either their username or email address
    • is compatible with CiviCRM 4.0.3 - 4.1
  • Version 1.x for Joomla 1.5 which
    • Uses the Joomla user table to authenticate
    • Checks that that user has a current CiviCRM membership record
    • Redirects to the configured location based on potential results
    • is compatible with CiviCRM 3.1 - 3.4

Files

plg_civiauthenticate_v2.1.2.zip for Joomla 1.6 - 2.5

plg_civiauthenticate_v1.1.0.zip for Joomla 1.5

Installation for version 2.1.x
  1. Download the plugin zip file to your local system
  2. In the Joomla 1.6 backend system select [Extensions] [Extension Manager] [install] from the menu
    1. Enter your ftp credentials if required.
    2. Browse to the package file you saved in step one, click [Upload File & Install]
    3. The plugin should report installation success.  
Configuration for version 2.1.x

The plugin contains full instructions on how to configure it. 

  1. Enable the plugin
    1. Go to [Extensions] [Plug-in Manager] from the menu and edit the Authentication - CiviCRM plugin
    2. Enable the plugin
    3. You may have multiple authenication plugins and Joomla will work though them sequentially to find a valid login. It is recommended that all other authentiction plugins are disabled, otherwise non-members may gain access to your site.
  2. Modify the Login Behavior params as follows:
    \
    1. Use Current Member Statuses:
      If set to yes, the plugin will determine if a membership is current based on the "current membership" checkbox in the membership status rule. For example, by default New, Current, and Grace are considered current. If set to no, the next option must be completed.
    2. Choose a redirect for Login failures:
      1. No Membership = Select a menu item from the dropdown to redirect users to if a contact match is found but no current membership exists (it is either expired or no valid membership record exists). You could use this to redirect users to a membership signup form or user registration form.
      2. Bad Password = Select a menu item from the dropdown to redirect users to if their password is rejected. This should generally be the same as the following option for secuity reasons.
      3. No Match = Select a menu item from the dropdown to redirect users to if the username is not found.
    3. Choose how to handle redirects for contacts who's membership has expired:
      1. Set Expired Method = If the contact's membership has expired you can choose how to redirect them after the login attempt. Either redirect to a menu item or to a contribution page. If you redirect to a contribution page, the page will be prefilled with their contact information and if this page normally requires a Joomla account to be created this will not appear (to avoid the user having to create a new account when they already have one)
  3. Modify the Membership Status Access Control as follows:
    \
    1. Enable Membership Status ACL Features?
      If you enable this feature then your members will be assigned to the user groups you choose from the table below.
      If you want to use this feature then enable it.
    2. For each CiviCRM level simply complete them sequentially.
      The Membership Status field will autofill - you shouldn't need to modify this.
      Assign the Joomla User Group you want to assign that membership level to.
      If you have more than 8 levels this can be extended by simply editing the xml and php files.
  4. Modify the Membership Type Access Control as follows:
    \
    1. Enable Membership Type ACL Features?
      If you enable this feature then your current members will be assigned to the user groups according to what type of membership they have.
      If you want to use this feature then enable it.
    2. For each CiviCRM level simply complete them sequentially.
      The Membership Type field will autofill - you shouldn't need to modify this.
      Assign the Joomla User Group you want to assign that membership type to.
      If you have more than 8 levels this can be extended by simply editing the xml and php files.
  5. You may change the Login Redirection Page parameter in mod_login for users with successful logins.
Adding additional Membership Status or Membership Type Levels

By default the plugin is hard coded for 8 Membership Status Levels and 8 Membership Type Levels. You can add additional levels by modifying the following files:

Civicrm.xml

      If you need to add Membership Status levels there is a similar declaration earlier in the file.

Civicrm.php

Installation for version 1.x
  1. Download the plugin zip file to your local system
  2. In the Joomla 1.5 backend system select [Extensions] [install/uninstall] from the menu
    1. Enter your ftp credentials if required.
    2. Browse to the package file you saved in step one, click [Upload File & Install]
    3. The plugin should report installation success.
  3. Go to [Extensions] [Plugin Manager] from the menu and edit the Authentication - CiviCRM plugin
    1. Enable the plugin
    2. Modify the params as follows:
      1. Use Current Member Statuses: If set to yes, the plugin will determine if a membership is current based on the "current membership" checkbox in the membership status rule. For example, by default New, Current, and Grace are considered current. If set to no, the next option must be completed.
      2. Max Status ID = If the above is set to no, this field will indicate the highest status rule ID (civicrm_membership_status.id) which is considered a valid current membership. You will need to use phpMyAdmin or another database management tool to look at the civicrm_membership_status table and find the highest ID which relates to a valid current membership status. For example, if you New/Current/Grace are flagged as current in the status rule configuration, but you only want New/Current to have access to the members only section, set this value to 2.
      3. Old/No Membership = Select a menu item from the dropdown to redirect users to if a contact match is found but no current membership exists (it is either expired or no membership record exists). You could use this to redirect users to a membership signup form or user registration form.
      4. Bad Password = Select a menu item from the dropdown to redirect users to if their password is rejected. This should generally be the same as the following option for secuity reasons.
      5. No Match = Select a menu item from the dropdown to redirect users to if the username is not found.
      6. Set Expired Method = If the contact's membership has expired you can choose how to redirect them after the login attempt. Either redirect to a menu item or to a contribution page. If you redirect to a contribution page, the page will be prefilled with their contact information.
  4. You may have multiple authenication plugins and Joomla will work though them sequentially to find a valid login. It is recommended that all other authentiction plugins are disabled, otherwise non-members may gain access to your site.
  5. You may change the Login Redirection Page parameter in mod_login for users with successful logins.
Uninstallation

To uninstall this plugin:

  1. Publish the Authentication - Joomla Plugin
  2. Unpublish the Authentication - CiviCRM Plugin
  3. Uninstall it from the [Extensions] [install/uninstall] dialog

If you do not unpublish it first then the uninstallation process will remove it from the Joomla plugin tables but leave the files in place, thus making a reinstall fail until you have manually removed the files.

Change Log
  • v1.0.0 First version
  • v1.0.1 Added Joomla Superadmin bypass of CiviMember authentication. This means that you do not have to have a membership for your superadmin and will not get locked out of the backend.
  • v1.0.2 Added check to ensure a contact has a CiviMember record. If no membership record exist redirect them using the "Old Membership" redirect.
  • v1.0.3 Fixed a problem where a user was being refused access if he did not have an entry in the civicrm_uf_match table.
  • v1.0.4 All admin level users exempt; improves handling when user has multiple memberships; uses status_id field in membership record instead of calculating the status to account for status overrides and address some issues in: http://forum.civicrm.org/index.php?topic=10183
  • v1.0.5 Restructure parameter file to user menuitem list for redirection selection. Add option of using the member status rules "current membership" configuration option to define what rules are considered current. Clarify helptext in parameter file. General cleanup throughout.
  • v1.1.0 Add expired status redirection options.
  • v2.0.0 Joomla 1.6 version with ACL and dual email/username login.
  • v2.1.0 Added Membership Type ACL
  • v2.1.1 Made Membership Status and Type fields read only
  • v2.1.2 Fixed "call-time pass-by-reference" error in civicrm.php caused by a depreciated call in PHP 5.3.0 or higher.