-
-
Save elinw/6735616d3e0e0cae823c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 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