X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FSystem%2FJoomla.php;h=746ef630ecee9b17217ca3eb084295a5a36d292e;hb=30a3000cc63f6d8858943fc61afa98ec123b60aa;hp=f98c794adfeb67ba1da04d1f9d80a16366fc2eb0;hpb=85a1be13f794b5f9380ed7bdab978ca3b656ef69;p=civicrm-core.git diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index f98c794adf..746ef630ec 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -265,8 +265,12 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { if ($config->userFrameworkFrontend) { $script = 'index.php'; - if (JRequest::getVar("Itemid") && (strpos($path, 'civicrm/payment/ipn') === FALSE)) { - $Itemid = "{$separator}Itemid=" . JRequest::getVar("Itemid"); + + // Get Itemid using JInput::get() + $input = Joomla\CMS\Factory::getApplication()->input; + $itemIdNum = $input->get("Itemid"); + if ($itemIdNum && (strpos($path, 'civicrm/payment/ipn') === FALSE)) { + $Itemid = "{$separator}Itemid=" . $itemIdNum; } } @@ -455,6 +459,12 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { $instance->login($params); } + // Save details in Joomla session + $user = JFactory::getUser($uid); + $jsession = JFactory::getSession(); + $jsession->set('user', $user); + + // Save details in Civi session $session = CRM_Core_Session::singleton(); $session->set('ufID', $uid); $session->set('userID', $contactID); @@ -827,32 +837,6 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { } } - /** - * Output code from error function. - * @param string $content - */ - public function outputError($content) { - if (class_exists('JErrorPage')) { - $error = new Exception($content); - JErrorPage::render($error); - } - elseif (class_exists('JError')) { - JError::raiseError('CiviCRM-001', $content); - } - else { - parent::outputError($content); - } - } - - /** - * Append Joomla js to coreResourcesList. - * - * @param array $list - */ - public function appendCoreResources(&$list) { - $list[] = 'js/crm.joomla.js'; - } - /** * @inheritDoc */ @@ -900,9 +884,6 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { else { $contactMatching++; } - if (is_object($match)) { - $match->free(); - } } return [