Ejemplo n.º 1
0
 /**
  * Add social login
  */
 private function _addSocialLogin()
 {
     $isSocialLogin = false;
     if ($this->config->social->facebook->appID) {
         $fb = ZFacebook::getInstance();
         $helper = $fb->getRedirectLoginHelper();
         $permissions = $this->config->social->facebook->permissions->toArray();
         $this->view->setVar('facebookLoginUrl', $helper->getLoginUrl(BASE_URI . '/auth/facebook/login-callback/', $permissions));
         $isSocialLogin = true;
     }
     if ($this->config->social->google->clientID) {
         $google = ZGoogle::getInstance();
         $this->view->setVar('googleLoginUrl', $google->getAuthUrl());
         $isSocialLogin = true;
     }
     $this->view->setVar('isSocialLogin', $isSocialLogin);
 }
Ejemplo n.º 2
0
 /**
  * Process login with Google
  *
  * @param ZGoogle $google
  * @return array
  */
 private function _process($google)
 {
     $userInfo = $google->getUserInfoToCreateAccount();
     return (new ZSocialHelper($userInfo, 'google'))->process();
 }