mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-58128 googledocs: Upgrade repo config
Part of MDL-58220
This commit is contained in:
parent
d247a63dfa
commit
6c9cd495a2
@ -48,6 +48,23 @@ function xmldb_repository_googledocs_upgrade($oldversion) {
|
||||
// Plugin savepoint reached.
|
||||
upgrade_plugin_savepoint(true, 2017011100, 'repository', 'googledocs');
|
||||
}
|
||||
if ($oldversion < 2017030500) {
|
||||
$clientid = get_config('clientid', 'googledocs');
|
||||
$secret = get_config('secret', 'googledocs');
|
||||
|
||||
// Update from repo config to use an OAuth service.
|
||||
if (!empty($clientid) && !empty($secret)) {
|
||||
$issuer = \core\oauth2\api::create_standard_issuer('google');
|
||||
|
||||
$issuer->set('clientid', $clientid);
|
||||
$issuer->set('secret', $secret);
|
||||
|
||||
$issuer->update();
|
||||
|
||||
set_config('issuerid', $issuer->get('id'), 'googledocs');
|
||||
}
|
||||
upgrade_plugin_savepoint(true, 2017030500, 'repository', 'googledocs');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017011100; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2017030500; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version.
|
||||
$plugin->component = 'repository_googledocs'; // Full name of the plugin (used for diagnostics).
|
||||
|
Loading…
x
Reference in New Issue
Block a user