private function doLogin($provider) { if ($provider->client->isAuthenticated()) { $provider->setSessionToken(); require_once JPATH_COMPONENT . '/controllers/login.php'; $loginController = new JFBConnectControllerLogin(); // This will redirect the user on successful login, or return false if not $loginController->login($provider); } // If we get here, something failed $this->redirectOnFailedAuth(); }
function createNewUser() { $loginRegisterModel = $this->getModel('LoginRegister', 'JFBConnectModel'); $provider = JFactory::getApplication()->input->getCmd('provider'); $provider = JFBCFactory::provider($provider); if ($loginRegisterModel->createNewUser($provider)) { require_once JPATH_COMPONENT . '/controllers/login.php'; $loginController = new JFBConnectControllerLogin(); $loginController->login($provider); } else { $redirect = $loginRegisterModel->getLoginRedirect($provider); $returnParam = '&return=' . base64_encode($redirect); $this->setRedirect(JRoute::_('index.php?option=com_jfbconnect&view=loginregister&provider=' . $provider->systemName . $returnParam, false)); } }