public function __construct($clientid, $clientsecret, $returnurl)
 {
     parent::__construct($clientid, $clientsecret, $returnurl, self::SCOPE);
 }
Esempio n. 2
0
 /**
  * Create the DropBox API Client.
  *
  * @param   string      $key        The API key
  * @param   string      $secret     The API secret
  * @param   string      $callback   The callback URL
  */
 public function __construct($key, $secret, $callback)
 {
     parent::__construct($key, $secret, $callback, '');
 }
Esempio n. 3
0
 /**
  * Construct a local_msaccount\client object.
  *
  * @param string $clientid client id for OAuth 2.0 provided by microsoft
  * @param string $clientsecret secret for OAuth 2.0 provided by microsoft
  * @param moodle_url $returnurl url to return to after succseful auth
  */
 public function __construct()
 {
     $returnurl = new \moodle_url('/local/msaccount/msaccount_redirect.php');
     $returnurl->param('sesskey', sesskey());
     parent::__construct(get_config('local_msaccount', 'clientid'), get_config('local_msaccount', 'clientsecret'), $returnurl, self::SCOPE);
 }
Esempio n. 4
0
 /**
  * Log out.
  *
  * @return void
  */
 public function log_out()
 {
     if ($accesstoken = $this->get_accesstoken()) {
         $params = array('client_id' => $this->get_clientid(), 'client_secret' => $this->get_clientsecret(), 'token' => $accesstoken->token);
         $this->reset_state();
         $this->post($this->revoke_url(), $params);
     }
     parent::log_out();
 }
 /**
  * Construct a skydrive request object
  *
  * @param string $clientid client id for OAuth 2.0 provided by microsoft
  * @param string $clientsecret secret for OAuth 2.0 provided by microsoft
  * @param moodle_url $returnurl url to return to after succseful auth
  */
 public function __construct($clientid, $clientsecret, $returnurl)
 {
     parent::__construct($clientid, $clientsecret, $returnurl, self::SCOPE);
     // Make a session cache
     $this->foldernamecache = cache::make('repository_skydrive', 'foldername');
 }
Esempio n. 6
0
 /**
  * Post request.
  *
  * Overridden to convert the data to a string, else curl will set the wrong headers.
  *
  * @param string $url The URL.
  * @param array|string $params The parameters.
  * @param array $options The options.
  * @return bool
  */
 public function post($url, $params = '', $options = array()) {
     return parent::post($url, format_postdata_for_curlcall($params), $options);
 }