Ejemplo n.º 1
0
 /**
  * Get facebook login url
  *
  * @param string|array $redirectUrl Url where facebook redirects after login.
  *                                  Router::url() compatible
  * @param array $scope Facebook permissions
  * @return string Login URL
  */
 public function getLoginUrl($redirectUrl = null, $scope = array())
 {
     $params = array();
     // scope
     $scope = is_array($scope) ? $scope : explode(',', trim($scope));
     $params['scope'] = array_unique(array_merge(Configure::read('Facebook.scope'), $scope));
     // redirect url
     if ($redirectUrl) {
         $params['redirect_uri'] = Router::url($redirectUrl, true);
     }
     return $this->FacebookApi->getLoginUrl($params);
 }