Esempio n. 1
0
 function getPasswordAndProfileLinks()
 {
     $registerType = $this->params->get('register_type');
     $this->forgotLink = '';
     if ($registerType == "jomsocial" && file_exists(JPATH_BASE . '/components/com_community/libraries/core.php')) {
         $jspath = JPATH_BASE . '/components/com_community';
         include_once $jspath . '/libraries/core.php';
         $this->registerLink = CRoute::_('index.php?option=com_community&view=register');
         $user = JFactory::getUser();
         $this->profileLink = CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id);
     } else {
         if ($registerType == 'easysocial' && file_exists(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php')) {
             include_once JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php';
             $this->registerLink = FRoute::registration();
             if (method_exists('FRoute', 'getDefaultItemId')) {
                 $Itemid = '&Itemid=' . FRoute::getDefaultItemId('account');
             } else {
                 $Itemid = '';
             }
             $this->forgotUsernameLink = JRoute::_('index.php?option=com_easysocial&view=account&layout=forgetUsername' . $Itemid);
             $this->forgotPasswordLink = JRoute::_('index.php?option=com_easysocial&view=account&layout=forgetpassword' . $Itemid);
             $this->profileLink = FRoute::profile();
         } else {
             if ($registerType == "communitybuilder" && file_exists(JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php')) {
                 $this->registerLink = JRoute::_("index.php?option=com_comprofiler&task=registers", false);
                 $this->forgotLink = JRoute::_("index.php?option=com_comprofiler&task=lostPassword");
                 $this->forgotUsernameLink = $this->forgotLink;
                 $this->forgotPasswordLink = $this->forgotLink;
                 $this->profileLink = JRoute::_("index.php?option=com_comprofiler", false);
             } else {
                 if ($registerType == "virtuemart" && file_exists(JPATH_ADMINISTRATOR . '/components/com_virtuemart/version.php')) {
                     require_once JPATH_ADMINISTRATOR . '/components/com_virtuemart/version.php';
                     if (class_exists('vmVersion') && property_exists('vmVersion', 'RELEASE')) {
                         if (version_compare('1.99', vmVersion::$RELEASE)) {
                             // -1 if ver1, 1 if 2.0+
                             $this->registerLink = JRoute::_("index.php?option=com_virtuemart&view=user", false);
                         } else {
                             if (file_exists(JPATH_SITE . '/components/com_virtuemart/virtuemart_parser.php')) {
                                 require_once JPATH_SITE . '/components/com_virtuemart/virtuemart_parser.php';
                                 global $sess;
                                 $this->registerLink = $sess->url(SECUREURL . 'index.php?option=com_virtuemart&page=shop.registration');
                             }
                         }
                     }
                     $this->profileLink = '';
                 } else {
                     if ($registerType == 'kunena' && JFolder::exists(JPATH_SITE . '/components/com_kunena')) {
                         $this->profileLink = JRoute::_('index.php?option=com_kunena&view=user', false);
                         $this->registerLink = JRoute::_('index.php?option=com_users&view=registration', false);
                     } else {
                         if ($registerType == 'custom') {
                             $this->profileLink = '';
                             $this->registerLink = $this->getLoginRedirect('registrationlink', false);
                         } else {
                             $this->profileLink = '';
                             $this->registerLink = JRoute::_('index.php?option=com_users&view=registration', false);
                         }
                     }
                 }
             }
         }
     }
     // common for J!, JomSocial, and Virtuemart
     if (!$this->forgotUsernameLink) {
         $this->forgotUsernameLink = JRoute::_('index.php?option=com_users&view=remind', false);
     }
     if (!$this->forgotPasswordLink) {
         $this->forgotPasswordLink = JRoute::_('index.php?option=com_users&view=reset', false);
     }
 }