Exemple #1
0
 function ajaxShowNewUserForm(&$args, &$response)
 {
     $mySess = JFactory::getSession();
     //Set facebook variable in session so we can redirect user
     //to plan selection page after login
     //XITODO : we will remove this when aec support fbc
     $aecExists = XiptLibAec::isAecExists();
     if ($aecExists) {
         $mySess->set('FROM_FACEBOOK', true, 'XIPT');
     }
     /*if ptype is not required during registration then return */
     if (!XiptFactory::getSettings('show_ptype_during_reg', 0)) {
         return true;
     }
     //if aec is integrate with ptype then we don't want to display
     //ptype selection page during facebook integration so return
     // pType already selected
     if ($aecExists && XiptFactory::getSettings('subscription_integrate', 0)) {
         return true;
     }
     /*check if ptype exist in session , 
      * if true means we have already gone through ptype selection process
      * no need to process again , return
      */
     if ($mySess->get('SELECTED_PROFILETYPE_ID', 0, 'XIPT')) {
         return true;
     }
     /*if not any above process fullfill the requirement then 
      * we need to display ptype selection page
      */
     $html = '';
     if ($args && count($args)) {
         $selectedProfiletypeID = $args[0];
         // validate values
         if (XiptLibProfiletypes::validateProfiletype($selectedProfiletypeID)) {
             $mySess->set('SELECTED_PROFILETYPE_ID', $selectedProfiletypeID, 'XIPT');
             return true;
         } else {
             $html .= XiptText::_('PLEASE_ENTER_VALID_PROFILETYPE');
         }
     }
     return self::getPtypeDisplayPageForFacebook($response, $html);
 }
Exemple #2
0
 function checkAclApplicable(&$data)
 {
     $aecExists = XiptLibAec::isAecExists();
     $subs_integrate = XiptFactory::getSettings('subscription_integrate', 0);
     $integrate_with = XiptFactory::getSettings('integrate_with', 0);
     // pType already selected
     if (!$subs_integrate || $integrate_with != 'aec' || !$aecExists) {
         return false;
     }
     $user = JFactory::getUser();
     if (!$user->id) {
         return false;
     }
     if ('com_acctexp' == $data['option']) {
         return false;
     }
     if ($data['option'] == 'com_user') {
         return false;
     }
     if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
         return false;
     }
     return true;
 }
Exemple #3
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;
 }
Exemple #4
0
 function isApplicable()
 {
     return XiptLibAec::isAecExists();
 }
 function integrateRegistrationWithPType()
 {
     $aecExists = XiptLibAec::isAecExists();
     $payplansExists = XiptLibPayplans::isPayplansExists();
     $subs_integrate = XiptFactory::getSettings('subscription_integrate', 0);
     $integrate_with = XiptFactory::getSettings('integrate_with', 0);
     $show_ptype_during_reg = XiptFactory::getSettings('show_ptype_during_reg', 0);
     $selectedProfiletypeID = $this->isPTypeExistInSession();
     if ($show_ptype_during_reg) {
         $link = "index.php?option=com_xipt&view=registration";
         // pType not selected : send to select profiletype
         if (!$selectedProfiletypeID) {
             $this->app->redirect(XiptRoute::_("index.php?option=com_xipt&view=registration", false));
             return;
         }
         // pType already selected
         if ($aecExists && $subs_integrate && $integrate_with == 'aec') {
             $url = XiptRoute::_('index.php?option=com_acctexp&task=subscribe', false);
             $msg = XiptLibAec::getAecMessage();
             if ($msg != false) {
                 $link = '<a id="xipt_back_link" href=' . $url . '>' . XiptText::_("CLICK_HERE") . '</a>';
                 $this->app->enqueueMessage($msg . ' ' . $link);
             }
             return;
         } else {
             $url = XiptRoute::_('index.php?option=com_xipt&view=registration&ptypeid=' . $selectedProfiletypeID . '&reset=true', false);
             $selectedpTypeName = XiptLibProfiletypes::getProfiletypeName($selectedProfiletypeID);
             $msg = sprintf(XiptText::_('CURRENT_PTYPE_AND_CHANGE_PTYPE_OPTION'), $selectedpTypeName);
             $link = '<a id="xipt_back_link" href=' . $url . '>' . XiptText::_("CLICK_HERE") . '</a>';
             $this->app->enqueueMessage($msg . ' ' . $link);
             return;
         }
     } else {
         if ($subs_integrate) {
             if ($payplansExists && $integrate_with == 'payplans') {
                 $url = XiptRoute::_('index.php?option=com_payplans&view=plan', false);
                 $msg = XiptLibPayplans::getPayplansMessage();
                 if ($msg != false) {
                     $link = '<a id="xipt_back_link" href=' . $url . '>' . XiptText::_("CLICK_HERE") . '</a>';
                     $this->app->enqueueMessage($msg . ' ' . $link);
                 }
                 return;
             }
         }
     }
     // if pType is not set, collect default pType
     // set it in session
     if (!$selectedProfiletypeID) {
         $pType = $this->getRegistrationPType();
         $this->setDataInSession('SELECTED_PROFILETYPE_ID', $pType);
         return;
     }
     return;
 }