• Facebook\FacebookSDKException

    You must provide or set a default application id.

    • Facebook\FacebookSDKException
      /var/www/Codesvilla/vendor/facebook/php-sdk-v4/src/Facebook/FacebookSession.php:320
        }
       
        /**
         * _getTargetAppId - Will return either the provided app Id or the default,
         *   throwing if neither are populated.
         *
         * @param string $appId
         *
         * @return string
         *
         * @throws FacebookSDKException
         */
        public static function _getTargetAppId($appId = null) {
          $target = ($appId ?: self::$defaultAppId);
          if (!$target) {
            throw new FacebookSDKException(
              'You must provide or set a default application id.', 700
            );
          }
          return $target;
        }
       
        /**
         * _getTargetAppSecret - Will return either the provided app secret or the
         *   default, throwing if neither are populated.
         *
         * @param string $appSecret
         *
         * @return string
         *
         * @throws FacebookSDKException

      Arguments

      No arguments.

    • Facebook\FacebookSession::_getTargetAppId(null)
      /var/www/Codesvilla/vendor/facebook/php-sdk-v4/src/Facebook/FacebookRedirectLoginHelper.php:75
        /**
         * @var boolean Toggle for PHP session status check
         */
        protected $checkForSessionStatus = true;
       
        /**
         * Constructs a RedirectLoginHelper for a given appId and redirectUrl.
         *
         * @param string $redirectUrl The URL Facebook should redirect users to
         *                            after login
         * @param string $appId The application id
         * @param string $appSecret The application secret
         */
        public function __construct($redirectUrl, $appId = null, $appSecret = null)
        {
          $this->appId = FacebookSession::_getTargetAppId($appId);
          $this->appSecret = FacebookSession::_getTargetAppSecret($appSecret);
          $this->redirectUrl = $redirectUrl;
        }
       
        /**
         * Stores CSRF state and returns a URL to which the user should be sent to
         *   in order to continue the login process with Facebook.  The
         *   provided redirectUrl should invoke the handleRedirect method.
         *
         * @param array $scope List of permissions to request during login
         * @param string $version Optional Graph API version if not default (v2.0)
         * @param boolean $displayAsPopup Indicate if the page will be displayed as a popup
         * @param bool|string $authType 'reauthenticate' or 'https', true is equivalent to 'reauthenticate',
         *                              false or invalid value will not add auth type parameter
         *

      Arguments

      #0
      null
      
    • Facebook\FacebookRedirectLoginHelper->__construct("https://codesvilla.com/login/oauth/facebook")
      /var/www/Codesvilla/includes/Library/Coupons/User/Auth/Facebook.php:20
      use \Coupons\User\User;
      use \Facebook\FacebookSession;
      use \Facebook\FacebookRequest;
      use \Facebook\FacebookResponse;
      use \Origin\Utilities\Types\Singleton;
      use \Facebook\FacebookSDKException;
      use \Origin\Utilities\Settings;
      use \Origin\Utilities\Utilities;
      use \Facebook\FacebookRequestException;
      use \Facebook\FacebookRedirectLoginHelper;
      use \Facebook\FacebookAuthorizationException;
       
      class Facebook extends Singleton {
      	public function Auth(){
      		FacebookSession::setDefaultApplication(Settings::Get()->Value(['site', 'facebook_public']), Settings::Get()->Value(['site', 'facebook_secret']));
      		$helper = new FacebookRedirectLoginHelper(Settings::Get()->Value(['site', 'fqdn']).'/login/oauth/facebook');
      		
      		try {
      			$session = $helper->getSessionFromRedirect();
      		} catch( FacebookRequestException $ex ) { echo '1'; die(print_r($ex, true)); } catch( Exception $ex ) { echo '2'; die(print_r($ex, true)); }
      		
      		if(!empty($session)){
      			$request = new FacebookRequest( $session, 'GET', '/me?fields=id,name,email' );
      			$response = $request->execute();
      			$auth = $response->getGraphObject();
      			if(($auth->getProperty('id') !== null) && ($auth->getProperty('name') !== null) && ($auth->getProperty('email') !== null)){
      				$user = new User();
      				$user->OAuthLogin($auth->getProperty('email'), $auth->getProperty('id'), $auth->getProperty('name'));
      			}
      		} else {
      			exit(header("Location: {$helper->getLoginURL()}&scope=email"));

      Arguments

      #0
      "https://codesvilla.com/login/oauth/facebook"
      
    • Coupons\User\Auth\Facebook->Auth(null)
      /var/www/Codesvilla/includes/Controllers/Home/Login.php:36
      			}
      			else {
      				Utilities::JSONExit("Login failed.", false);
      			}
      		}
      		else { // Show missing data error
      			Layout::Get()->Assign('loginerror', "Missing username or password.");
      		}
      	}
       
      	public function Google(){
      		Google::Get()->Auth((isset($_GET['code']) ? $_GET['code'] : null));
      	}
      	
      	public function Facebook(){
      		Facebook::Get()->Auth((isset($_GET['code']) ? $_GET['code'] : null));
      	}
      }

      Arguments

      #0
      null
      
    • Controllers\Home\Login->Facebook()
      [internal function]

      Arguments

      No arguments.

    • call_user_func_array(array[2], array[0])
      /var/www/Codesvilla/includes/Library/Origin/Router/Router.php:96
      	*/
      	private function PathFinder($path, $route, array $variables = array()){
      		if($this->AllowAttempt()){
      			if($this->GetFile($path)){
      				$class = $this->GetClass($path);
      				Layout::Get()->Assign('route', $route);
      				
      				if($this->modules !== null && $this->modules instanceof Hash){
      					foreach($this->modules as $module){
      						if(call_user_func_array(array((new $module), 'Precall'), [$class, $route, $variables, $_REQUEST]) === false){
      							throw new Exception(sprintf('Unable to load module %s or module is invalid.', $module));
      						}
      					}
      				}
      				
      				if(call_user_func_array(array((new $class), $this->GetMethod($path)), $variables) === false){
      					throw new Exception('File exists, but class is undefined for route: '.$this->GetClass($path).'->'.$this->GetMethod($path)); 
      				}
       
      				return true;
      			}
       
      			return $this->Route('404');
      		}
      	}
       
      	/*
      	* Finds the file for our route based on $path. If the file exists we'll require it.
      	*/
      	private function GetFile($path){
      		$path = $this->ClassFileCommon($path);

      Arguments

      #0
      array:2 [
        0 => Login {}
        1 => "Facebook"
      ]
      
      #1
      []
      
    • Origin\Router\Router->PathFinder("Home/Login/Facebook", "login/oauth/facebook")
      /var/www/Codesvilla/includes/Library/Origin/Router/Router.php:35
      	const DIR = '/';
      	const NS = '\\';
       
      	/*
      	* Called from any file you wish to do routing from. Usually only index.php in the public directory.
      	* It is possible to specify a specific route via string as well (EG: For redirects in old code paths and the like).
      	*/
      	public function Route($route = null){
      		$route = ($route === null) ? trim(strtok($_SERVER["REQUEST_URI"],'?'), '/') : $route;
      		if(empty($route)){
      			return $this->Route('*');
      		}
       
      		// Exact match.
      		if($this->routes->offsetExists($route)){
      			return $this->PathFinder($this->routes->offsetGet($route), $route);
      		}
       
      		// Regex match. I'm sure someone who's brighter than I am has a better solution for this in 30 lines or less.
      		foreach($this->routes as $pattern => $path){
      			if(@preg_match($this->RegexifyPattern($pattern), null) !== false){
      				if(preg_match($this->RegexifyPattern($pattern), $route, $variables) > 0) {
      					array_shift($variables);
      					return $this->PathFinder($path, $pattern, $variables);
      				}
      			}
      		}
       
      		return $this->Route('404');
      	}
       

      Arguments

      #0
      "Home/Login/Facebook"
      
      #1
      "login/oauth/facebook"
      
    • Origin\Router\Router->Route()
      /var/www/Codesvilla/index.php:3
      <?php
      require_once('includes/loader.php');
      \Origin\Router\Router::Get()->Route();

      Arguments

      No arguments.

/var/www/Codesvilla/vendor/facebook/php-sdk-v4/src/Facebook/FacebookSession.php

  }
 
  /**
   * _getTargetAppId - Will return either the provided app Id or the default,
   *   throwing if neither are populated.
   *
   * @param string $appId
   *
   * @return string
   *
   * @throws FacebookSDKException
   */
  public static function _getTargetAppId($appId = null) {
    $target = ($appId ?: self::$defaultAppId);
    if (!$target) {
      throw new FacebookSDKException(
        'You must provide or set a default application id.', 700
      );
    }
    return $target;
  }
 
  /**
   * _getTargetAppSecret - Will return either the provided app secret or the
   *   default, throwing if neither are populated.
   *
   * @param string $appSecret
   *
   * @return string
   *
   * @throws FacebookSDKException

Arguments

No arguments.

/var/www/Codesvilla/vendor/facebook/php-sdk-v4/src/Facebook/FacebookRedirectLoginHelper.php

  /**
   * @var boolean Toggle for PHP session status check
   */
  protected $checkForSessionStatus = true;
 
  /**
   * Constructs a RedirectLoginHelper for a given appId and redirectUrl.
   *
   * @param string $redirectUrl The URL Facebook should redirect users to
   *                            after login
   * @param string $appId The application id
   * @param string $appSecret The application secret
   */
  public function __construct($redirectUrl, $appId = null, $appSecret = null)
  {
    $this->appId = FacebookSession::_getTargetAppId($appId);
    $this->appSecret = FacebookSession::_getTargetAppSecret($appSecret);
    $this->redirectUrl = $redirectUrl;
  }
 
  /**
   * Stores CSRF state and returns a URL to which the user should be sent to
   *   in order to continue the login process with Facebook.  The
   *   provided redirectUrl should invoke the handleRedirect method.
   *
   * @param array $scope List of permissions to request during login
   * @param string $version Optional Graph API version if not default (v2.0)
   * @param boolean $displayAsPopup Indicate if the page will be displayed as a popup
   * @param bool|string $authType 'reauthenticate' or 'https', true is equivalent to 'reauthenticate',
   *                              false or invalid value will not add auth type parameter
   *

Arguments

#0
null

/var/www/Codesvilla/includes/Library/Coupons/User/Auth/Facebook.php

use \Coupons\User\User;
use \Facebook\FacebookSession;
use \Facebook\FacebookRequest;
use \Facebook\FacebookResponse;
use \Origin\Utilities\Types\Singleton;
use \Facebook\FacebookSDKException;
use \Origin\Utilities\Settings;
use \Origin\Utilities\Utilities;
use \Facebook\FacebookRequestException;
use \Facebook\FacebookRedirectLoginHelper;
use \Facebook\FacebookAuthorizationException;
 
class Facebook extends Singleton {
	public function Auth(){
		FacebookSession::setDefaultApplication(Settings::Get()->Value(['site', 'facebook_public']), Settings::Get()->Value(['site', 'facebook_secret']));
		$helper = new FacebookRedirectLoginHelper(Settings::Get()->Value(['site', 'fqdn']).'/login/oauth/facebook');
		
		try {
			$session = $helper->getSessionFromRedirect();
		} catch( FacebookRequestException $ex ) { echo '1'; die(print_r($ex, true)); } catch( Exception $ex ) { echo '2'; die(print_r($ex, true)); }
		
		if(!empty($session)){
			$request = new FacebookRequest( $session, 'GET', '/me?fields=id,name,email' );
			$response = $request->execute();
			$auth = $response->getGraphObject();
			if(($auth->getProperty('id') !== null) && ($auth->getProperty('name') !== null) && ($auth->getProperty('email') !== null)){
				$user = new User();
				$user->OAuthLogin($auth->getProperty('email'), $auth->getProperty('id'), $auth->getProperty('name'));
			}
		} else {
			exit(header("Location: {$helper->getLoginURL()}&scope=email"));

Arguments

#0
"https://codesvilla.com/login/oauth/facebook"

/var/www/Codesvilla/includes/Controllers/Home/Login.php

			}
			else {
				Utilities::JSONExit("Login failed.", false);
			}
		}
		else { // Show missing data error
			Layout::Get()->Assign('loginerror', "Missing username or password.");
		}
	}
 
	public function Google(){
		Google::Get()->Auth((isset($_GET['code']) ? $_GET['code'] : null));
	}
	
	public function Facebook(){
		Facebook::Get()->Auth((isset($_GET['code']) ? $_GET['code'] : null));
	}
}

Arguments

#0
null

Arguments

No arguments.

/var/www/Codesvilla/includes/Library/Origin/Router/Router.php

	*/
	private function PathFinder($path, $route, array $variables = array()){
		if($this->AllowAttempt()){
			if($this->GetFile($path)){
				$class = $this->GetClass($path);
				Layout::Get()->Assign('route', $route);
				
				if($this->modules !== null && $this->modules instanceof Hash){
					foreach($this->modules as $module){
						if(call_user_func_array(array((new $module), 'Precall'), [$class, $route, $variables, $_REQUEST]) === false){
							throw new Exception(sprintf('Unable to load module %s or module is invalid.', $module));
						}
					}
				}
				
				if(call_user_func_array(array((new $class), $this->GetMethod($path)), $variables) === false){
					throw new Exception('File exists, but class is undefined for route: '.$this->GetClass($path).'->'.$this->GetMethod($path)); 
				}
 
				return true;
			}
 
			return $this->Route('404');
		}
	}
 
	/*
	* Finds the file for our route based on $path. If the file exists we'll require it.
	*/
	private function GetFile($path){
		$path = $this->ClassFileCommon($path);

Arguments

#0
array:2 [
  0 => Login {}
  1 => "Facebook"
]
#1
[]

/var/www/Codesvilla/includes/Library/Origin/Router/Router.php

	const DIR = '/';
	const NS = '\\';
 
	/*
	* Called from any file you wish to do routing from. Usually only index.php in the public directory.
	* It is possible to specify a specific route via string as well (EG: For redirects in old code paths and the like).
	*/
	public function Route($route = null){
		$route = ($route === null) ? trim(strtok($_SERVER["REQUEST_URI"],'?'), '/') : $route;
		if(empty($route)){
			return $this->Route('*');
		}
 
		// Exact match.
		if($this->routes->offsetExists($route)){
			return $this->PathFinder($this->routes->offsetGet($route), $route);
		}
 
		// Regex match. I'm sure someone who's brighter than I am has a better solution for this in 30 lines or less.
		foreach($this->routes as $pattern => $path){
			if(@preg_match($this->RegexifyPattern($pattern), null) !== false){
				if(preg_match($this->RegexifyPattern($pattern), $route, $variables) > 0) {
					array_shift($variables);
					return $this->PathFinder($path, $pattern, $variables);
				}
			}
		}
 
		return $this->Route('404');
	}
 

Arguments

#0
"Home/Login/Facebook"
#1
"login/oauth/facebook"

/var/www/Codesvilla/index.php

<?php
require_once('includes/loader.php');
\Origin\Router\Router::Get()->Route();

Arguments

No arguments.

GET

No data


POST

No data


Cookies

No data


Headers

Cdn-Loop cloudflare
Cf-Connecting-Ip 35.175.120.174
If-Modified-Since Sun, 15 Sep 2019 12:58:19 PDT
Accept-Language en-US,en;q=0.5
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent CCBot/2.0 (https://commoncrawl.org/faq/)
Cf-Visitor {"scheme":"https"}
X-Forwarded-Proto https
Cf-Ray 538daf139e0c56fd-IAD
X-Forwarded-For 35.175.120.174
Cf-Ipcountry US
Accept-Encoding gzip
Connection Keep-Alive
Host www.codesvilla.com
Content-Length
Content-Type
USER www-data
HOME /var/www
HTTP_CDN_LOOP cloudflare
HTTP_CF_CONNECTING_IP 35.175.120.174
HTTP_IF_MODIFIED_SINCE Sun, 15 Sep 2019 12:58:19 PDT
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_CF_VISITOR {"scheme":"https"}
HTTP_X_FORWARDED_PROTO https
HTTP_CF_RAY 538daf139e0c56fd-IAD
HTTP_X_FORWARDED_FOR 35.175.120.174
HTTP_CF_IPCOUNTRY US
HTTP_ACCEPT_ENCODING gzip
HTTP_CONNECTION Keep-Alive
HTTP_HOST www.codesvilla.com
REDIRECT_STATUS 200
SERVER_NAME www.codesvilla.com
SERVER_PORT 80
SERVER_ADDR 67.212.1.186
REMOTE_PORT 25202
REMOTE_ADDR 172.69.62.57
SERVER_SOFTWARE nginx/1.10.3
GATEWAY_INTERFACE CGI/1.1
REQUEST_SCHEME http
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /var/www/Codesvilla/
DOCUMENT_URI /login/oauth/facebook
REQUEST_URI /login/oauth/facebook
SCRIPT_NAME /login/oauth/facebook
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /var/www/Codesvilla//index.php
PATH_INFO
FCGI_ROLE RESPONDER
PHP_SELF /login/oauth/facebook
REQUEST_TIME_FLOAT 1574287091.8132
REQUEST_TIME 1574287091