Merge branch 'MDL-57035-master' of git://github.com/FMCorz/moodle

This commit is contained in:
Andrew Nicols 2016-11-22 12:02:45 +08:00
commit 8d294e729f

View File

@ -60,18 +60,6 @@ class microsoft_skydrive extends oauth2_client {
$this->foldernamecache = cache::make('repository_skydrive', 'foldername');
}
/**
* Should HTTP GET be used instead of POST?
*
* The Microsoft API does not support POST, so we should use
* GET instead (with the auth_token passed as a GET param).
*
* @return bool true if GET should be used
*/
protected function use_http_get() {
return true;
}
/**
* Returns the auth url for OAuth 2.0 request
* @return string the auth url
@ -88,6 +76,20 @@ class microsoft_skydrive extends oauth2_client {
return 'https://login.live.com/oauth20_token.srf';
}
/**
* 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);
}
/**
* Downloads a file to a file from skydrive using authenticated request
*