Permalink
Browse files

Merge branch 'MDL-59511-33-oauthsysmail' of git://github.com/Dagefoer…

…de/moodle into MOODLE_33_STABLE
  • Loading branch information...
dmonllao committed Jul 31, 2017
2 parents 9ab1486 + 0af9a77 commit a74ae654a3d60f4b975255b49b87a63e3903a216
Showing with 15 additions and 3 deletions.
  1. +1 −1 lib/classes/oauth2/api.php
  2. +1 −1 lib/db/install.xml
  3. +12 −0 lib/db/upgrade.php
  4. +1 −1 version.php
@@ -752,7 +752,7 @@ public static function connect_system_account($issuer, $returnurl) {
$record->issuerid = $issuer->get('id');
$record->refreshtoken = $refreshtoken;
$record->grantedscopes = $scopes;
$record->email = $userinfo['email'];
$record->email = isset($userinfo['email']) ? $userinfo['email'] : '';
$record->username = $userinfo['username'];
$systemaccount = new system_account(0, $record);
@@ -3515,7 +3515,7 @@
<FIELD NAME="issuerid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="The id of the oauth 2 identity issuer"/>
<FIELD NAME="refreshtoken" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="The refresh token used to request access tokens."/>
<FIELD NAME="grantedscopes" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="The scopes that this system account has been granted access to."/>
<FIELD NAME="email" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="The email that was connected to this issuer."/>
<FIELD NAME="email" TYPE="text" NOTNULL="false" SEQUENCE="false" COMMENT="The email that was connected to this issuer."/>
<FIELD NAME="username" TYPE="text" NOTNULL="true" SEQUENCE="false" COMMENT="The username that was connected as a system account to this issue."/>
</FIELDS>
<KEYS>
@@ -2875,5 +2875,17 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2017051500.06);
}
if ($oldversion < 2017051501.04) {
// Changing nullability of field email on table oauth2_system_account to null.
$table = new xmldb_table('oauth2_system_account');
$field = new xmldb_field('email', XMLDB_TYPE_TEXT, null, null, null, null, null, 'grantedscopes');
// Launch change of nullability for field email.
$dbman->change_field_notnull($table, $field);
// Main savepoint reached.
upgrade_main_savepoint(true, 2017051501.04);
}
return true;
}
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2017051501.03; // 20170515 = branching date YYYYMMDD - do not modify!
$version = 2017051501.04; // 20170515 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.

0 comments on commit a74ae65

Please sign in to comment.