mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-29661 - lib/googleapi.php - Switch to SSL urls
I am not sure why I did not use these in the first instance, I don't think Google supported SSL in the first versions of their API. They do now, and it seems that this week they stopped supporting non-ssl requests.
This commit is contained in:
parent
7757237cdd
commit
e0daa8499a
@ -241,8 +241,8 @@ class google_authsub extends google_auth_request {
|
|||||||
*/
|
*/
|
||||||
class google_docs {
|
class google_docs {
|
||||||
// need both docs and the spreadsheets realm
|
// need both docs and the spreadsheets realm
|
||||||
const REALM = 'http://docs.google.com/feeds/ http://spreadsheets.google.com/feeds/ http://docs.googleusercontent.com/';
|
const REALM = 'https://docs.google.com/feeds/ https://spreadsheets.google.com/feeds/ https://docs.googleusercontent.com/';
|
||||||
const DOCUMENTFEED_URL = 'http://docs.google.com/feeds/default/private/full';
|
const DOCUMENTFEED_URL = 'https://docs.google.com/feeds/default/private/full';
|
||||||
const USER_PREF_NAME = 'google_authsub_sesskey';
|
const USER_PREF_NAME = 'google_authsub_sesskey';
|
||||||
|
|
||||||
private $google_curl = null;
|
private $google_curl = null;
|
||||||
@ -292,8 +292,6 @@ class google_docs {
|
|||||||
$xml = new SimpleXMLElement($content);
|
$xml = new SimpleXMLElement($content);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$files = array();
|
$files = array();
|
||||||
foreach($xml->entry as $gdoc){
|
foreach($xml->entry as $gdoc){
|
||||||
$docid = (string) $gdoc->children('http://schemas.google.com/g/2005')->resourceId;
|
$docid = (string) $gdoc->children('http://schemas.google.com/g/2005')->resourceId;
|
||||||
@ -307,15 +305,15 @@ class google_docs {
|
|||||||
switch($type){
|
switch($type){
|
||||||
case 'document':
|
case 'document':
|
||||||
$title = $gdoc->title.'.rtf';
|
$title = $gdoc->title.'.rtf';
|
||||||
$source = 'http://docs.google.com/feeds/download/documents/Export?id='.$docid.'&exportFormat=rtf';
|
$source = 'https://docs.google.com/feeds/download/documents/Export?id='.$docid.'&exportFormat=rtf';
|
||||||
break;
|
break;
|
||||||
case 'presentation':
|
case 'presentation':
|
||||||
$title = $gdoc->title.'.ppt';
|
$title = $gdoc->title.'.ppt';
|
||||||
$source = 'http://docs.google.com/feeds/download/presentations/Export?id='.$docid.'&exportFormat=ppt';
|
$source = 'https://docs.google.com/feeds/download/presentations/Export?id='.$docid.'&exportFormat=ppt';
|
||||||
break;
|
break;
|
||||||
case 'spreadsheet':
|
case 'spreadsheet':
|
||||||
$title = $gdoc->title.'.xls';
|
$title = $gdoc->title.'.xls';
|
||||||
$source = 'http://spreadsheets.google.com/feeds/download/spreadsheets/Export?key='.$docid.'&exportFormat=xls';
|
$source = 'https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key='.$docid.'&exportFormat=xls';
|
||||||
break;
|
break;
|
||||||
case 'pdf':
|
case 'pdf':
|
||||||
$title = (string)$gdoc->title;
|
$title = (string)$gdoc->title;
|
||||||
@ -374,10 +372,10 @@ class google_docs {
|
|||||||
class google_picasa {
|
class google_picasa {
|
||||||
const REALM = 'http://picasaweb.google.com/data/';
|
const REALM = 'http://picasaweb.google.com/data/';
|
||||||
const USER_PREF_NAME = 'google_authsub_sesskey_picasa';
|
const USER_PREF_NAME = 'google_authsub_sesskey_picasa';
|
||||||
const UPLOAD_LOCATION = 'http://picasaweb.google.com/data/feed/api/user/default/albumid/default';
|
const UPLOAD_LOCATION = 'https://picasaweb.google.com/data/feed/api/user/default/albumid/default';
|
||||||
const ALBUM_PHOTO_LIST = 'http://picasaweb.google.com/data/feed/api/user/default/albumid/';
|
const ALBUM_PHOTO_LIST = 'https://picasaweb.google.com/data/feed/api/user/default/albumid/';
|
||||||
const PHOTO_SEARCH_URL = 'http://picasaweb.google.com/data/feed/api/user/default?kind=photo&q=';
|
const PHOTO_SEARCH_URL = 'https://picasaweb.google.com/data/feed/api/user/default?kind=photo&q=';
|
||||||
const LIST_ALBUMS_URL = 'http://picasaweb.google.com/data/feed/api/user/default';
|
const LIST_ALBUMS_URL = 'https://picasaweb.google.com/data/feed/api/user/default';
|
||||||
|
|
||||||
private $google_curl = null;
|
private $google_curl = null;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user