예제 #1
0
파일: auth.php 프로젝트: annaqin/eden
 public function __construct($key, $secret, $redirect)
 {
     //argument test
     Eden_Facebook_Error::i()->argument(1, 'string')->argument(2, 'string')->argument(3, 'string');
     //Argument 4 must be a string
     parent::__construct($key, $secret, $redirect, self::REQUEST_URL, self::ACCESS_URL);
 }
예제 #2
0
 /**
  * Returns oauth 2 client side class
  * 
  * @param string The application client ID, can get through registration
  * @param string The application secret, can get through registration 
  * @param url Your callback url or where do you want to redirect the user after authentication
  * @param url The request url,  can get through registration
  * @param url The access url,  can get through registration
  * @return Eden_Oauth2_Client
  */
 public function client($client, $secret, $redirect, $requestUrl, $accessUrl)
 {
     //argument test
     Eden_Oauth2_Error::i()->argument(1, 'string')->argument(2, 'string')->argument(3, 'url')->argument(4, 'url')->argument(5, 'url');
     //argument 5 must be a url
     return Eden_Oauth2_Client::i($client, $secret, $redirect, $requestUrl, $accessUrl);
 }
 public function __construct($clientId, $clientSecret, $redirect)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string')->argument(3, 'string');
     //Argument 4 must be a string
     parent::__construct($clientId, $clientSecret, $redirect, self::REQUEST_URL, self::ACCESS_URL);
 }
 public function __construct($clientId, $clientSecret, $redirect, $apiKey = NULL)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string')->argument(2, 'string')->argument(3, 'string')->argument(4, 'string', 'null');
     //Argument 4 must be a string or null
     $this->_apiKey = $apiKey;
     parent::__construct($clientId, $clientSecret, $redirect, self::REQUEST_URL, self::ACCESS_URL);
 }
예제 #5
0
파일: oauth.php 프로젝트: taqmaninw/apipack
 /**
  * Returns website login url
  *
  * @param string|null
  * @param string|null
  * @return url
  */
 public function getLoginUrl($scope = NULL, $display = NULL)
 {
     //argument test
     Eden_Google_Error::i()->argument(1, 'string', 'array', 'null')->argument(2, 'string', 'array', 'null');
     //argument 2 must be a string, array or null
     //if scope is a key in the scopes array
     if (is_string($scope) && isset($this->_scopes[$scope])) {
         $scope = $this->_scopes[$scope];
         //if it's an array
     } else {
         if (is_array($scope)) {
             //loop through it
             foreach ($scope as $i => $key) {
                 //if this is a scope key
                 if (is_string($key) && isset($this->_scopes[$key])) {
                     //change it
                     $scope[$i] = $this->_scopes[$key];
                 }
             }
         }
     }
     return parent::getLoginUrl($scope, $display);
 }
예제 #6
0
if(!class_exists('Eden_Facebook_Auth')){class Eden_Facebook_Auth extends Eden_Oauth2_Client{const REQUEST_URL='https://www.facebook.com/dialog/oauth';const ACCESS_URL='https://graph.facebook.com/oauth/access_token';const USER_AGENT='facebook-php-3.1';protected $_key=NULL;protected $_secret=NULL;protected $_redirect=NULL;public static function i(){return self::_getMultiple(__CLASS__);}public function __construct($key,$secret,$redirect){Eden_Facebook_Error::i()->argument(1,'string')->argument(2,'string')->argument(3,'string');parent::__construct($key,$secret,$redirect,self::REQUEST_URL,self::ACCESS_URL);}}}