Пример #1
0
 function event_com_xipt_registration_blank()
 {
     $app = JFactory::getApplication();
     $subs_integrate = XiptFactory::getSettings('subscription_integrate', 0);
     $integrate_with = XiptFactory::getSettings('integrate_with', 0);
     if (!$subs_integrate) {
         return false;
     }
     //when integrated with AEC, set PT in session as per plan.
     if ($integrate_with == 'aec') {
         if (!XiptLibAec::isAecExists()) {
             return false;
         }
         // find selected profiletype from AEC
         $aecData = XiptLibAec::getProfiletypeInfoFromAEC();
         // as user want to integrate the AEC so a plan must be selected
         // send user to profiletype selection page
         if ($aecData['planSelected'] == false) {
             $app->redirect(XiptRoute::_('index.php?option=com_acctexp&task=subscribe', false), XiptText::_('PLEASE_SELECT_AEC_PLAN_IT_IS_RQUIRED'));
         }
         // set selected profiletype in session
         $this->_pluginHandler->mySess->set('SELECTED_PROFILETYPE_ID', $aecData['profiletype'], 'XIPT');
     }
     //when integrated with Payplans, no need to set PT in session
     //payplans itself set PT in session
     if ($integrate_with == 'payplans') {
         if (!XiptLibPayplans::isPayplansExists()) {
             return false;
         }
         // find selected profiletype from Payplans
         $payplansData = XiptLibPayplans::getProfiletypeInfoFromPayplans();
         // as user want to integrate the Payplans so a plan must be selected
         // send user to profiletype selection page
         if ($payplansData['planSelected'] == false) {
             $app->redirect(XiptRoute::_('index.php?option=com_payplans&view=plan', false), XiptText::_('PLEASE_SELECT_AEC_PLAN_IT_IS_RQUIRED'));
         }
     }
     $app->redirect(XiptHelperJomsocial::getReturnURL());
     return true;
 }
Пример #2
0
 function setProfileTypeInSession($selectedProfiletypeID)
 {
     // XITODO : move redirection to controller
     $mySess =& JFactory::getSession();
     $redirectUrl = XiptHelperJomsocial::getReturnURL();
     // validate values
     if (!XiptLibProfiletypes::validateProfiletype($selectedProfiletypeID)) {
         $msg = XiptText::_('PLEASE_ENTER_VALID_PROFILETYPE');
         JFactory::getApplication()->redirect(XiptRoute::_('index.php?option=com_xipt&view=registration'), $msg);
         return;
     }
     //set value in session and redirect to destination url
     $mySess->set('SELECTED_PROFILETYPE_ID', $selectedProfiletypeID, 'XIPT');
     JFactory::getApplication()->redirect($redirectUrl);
 }