MDL-58220 oauth2: Use the same list of user fields

Authentication has a hard coded list of valid internal user fields - but they are in a class variable. We need them
in oauth user_field_mapping so we need to move them to a central place and call them from oauth2 and auth.
This commit is contained in:
Damyon Wiese
2017-04-03 13:43:26 +08:00
parent 68ecf7635b
commit d9fbe3146c
3 changed files with 36 additions and 37 deletions
+25
View File
@@ -58,6 +58,30 @@ class core_user {
*/
const MAILDISPLAY_COURSE_MEMBERS_ONLY = 2;
/**
* List of fields that can be synched/locked during authentication.
*/
const AUTHSYNCFIELDS = [
'firstname',
'lastname',
'email',
'city',
'country',
'lang',
'description',
'url',
'idnumber',
'institution',
'department',
'phone1',
'phone2',
'address',
'firstnamephonetic',
'lastnamephonetic',
'middlename',
'alternatename'
];
/** @var stdClass keep record of noreply user */
public static $noreplyuser = false;
@@ -887,4 +911,5 @@ class core_user {
return $value;
}
}
}