Skip to content

Instantly share code, notes, and snippets.

@danpoltawski
Created October 6, 2011 12:03
Show Gist options
  • Save danpoltawski/1267242 to your computer and use it in GitHub Desktop.
Save danpoltawski/1267242 to your computer and use it in GitHub Desktop.
Google api testing in moodle
<?php
require_once('config.php');
require_once($CFG->libdir.'/googleapi.php');
$googletoken = optional_param('token', false, PARAM_RAW);
$sesskey = google_docs::get_sesskey($USER->id);
echo "Sessionkey is: $sesskey \n<br />";
echo "Google Token is: $googletoken \n<br />";
$url = google_authsub::login_url($CFG->wwwroot.'/testgoogle.php', google_docs::REALM);
if(!$sesskey){
echo "<a href='$url'>Login</a>";
die;
}
$gdocs = new google_docs(new google_authsub($sesskey));
print_object($gdocs->get_file_list());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment