mirror of
https://github.com/moodle/moodle.git
synced 2025-05-01 22:18:03 +02:00
MDL-58220 skydrive: Upgrade from old settings
Upgrade the oauth2 settings to an oauth2 issuer.
This commit is contained in:
parent
0b9bb5bdc4
commit
6f8a03f196
@ -53,5 +53,26 @@ function xmldb_repository_skydrive_upgrade($oldversion) {
|
||||
// Skydrive savepoint reached.
|
||||
upgrade_plugin_savepoint(true, 2017031400, 'repository', 'skydrive');
|
||||
}
|
||||
if ($oldversion < 2017032800) {
|
||||
$clientid = get_config('clientid', 'skydrive');
|
||||
$secret = get_config('secret', 'skydrive');
|
||||
|
||||
// Update from repo config to use an OAuth service.
|
||||
if (!empty($clientid) && !empty($secret)) {
|
||||
$issuer = \core\oauth2\api::create_standard_issuer('microsoft');
|
||||
|
||||
$issuer->set('clientid', $clientid);
|
||||
$issuer->set('secret', $secret);
|
||||
|
||||
$issuer->update();
|
||||
|
||||
set_config('issuerid', $issuer->get('id'), 'skydrive');
|
||||
}
|
||||
upgrade_plugin_savepoint(true, 2017032800, 'repository', 'skydrive');
|
||||
}
|
||||
if ($oldversion < 2017032900) {
|
||||
set_config('supportedfiles', 'both', 'skydrive');
|
||||
upgrade_plugin_savepoint(true, 2017032900, 'repository', 'skydrive');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -25,6 +25,6 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2017031400; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2017032900; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2016112900; // Requires this Moodle version.
|
||||
$plugin->component = 'repository_skydrive'; // Full name of the plugin (used for diagnostics).
|
||||
|
Loading…
x
Reference in New Issue
Block a user