MDL-33501 - oauth2lib: enforce sesskey in oauth2callback.php

The sesskey needs to be embeded in the local url returned as this is the
only parameter we have control of.
This commit is contained in:
Dan Poltawski 2012-06-04 11:11:38 +08:00
parent db7602af7c
commit 5df1b73748
3 changed files with 17 additions and 5 deletions

View file

@ -39,8 +39,10 @@ class repository_googledocs extends repository {
public function __construct($repositoryid, $context = SYSCONTEXTID, $options = array()) {
parent::__construct($repositoryid, $context, $options);
$returnurl = new moodle_url('/repository/repository_callback.php',
array('callback' => 'yes', 'repo_id' =>$this->id));
$returnurl = new moodle_url('/repository/repository_callback.php');
$returnurl->param('callback', 'yes');
$returnurl->param('repo_id', $this->id);
$returnurl->param('sesskey', sesskey());
$clientid = get_config('googledocs', 'clientid');
$secret = get_config('googledocs', 'secret');