Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.plugin.plugin' );
// Could possibly be added to the civicrm system plugin
* This plugin will redirect from a com_user page to a civicrm registration profile.
class plgSystemCiviregistration extends JPlugin
* Constructor
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.0
function onAfterRoute()
//Compare the request to the core registration request and if they are the same redirect
$app = JFactory::getApplication();
// Would want to change JRequest to JInput
if ((JRequest::getCmd('option')=='com_user') &&
((JRequest::getCmd('view')=='register')||(JRequest::getCmd('task')=='register') ))
{ // Redirect to the alternate registration page
// Note you need this param in the sml
$app->redirect($this->params->get('altregurl', 'index.php'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.