MDL-57035 repository_skydrive: Compability with converged type apps

http://go.microsoft.com/fwlink/p/?LinkID=615760
This commit is contained in:
Frederic Massart 2016-11-18 12:30:46 +08:00
parent 282f0437f1
commit cbca970ab7
No known key found for this signature in database
GPG Key ID: AC343CE142B12FB9

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
*