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
+1 -20
View File
@@ -102,26 +102,7 @@ class auth_plugin_base {
* The fields we can lock and update from/to external authentication backends
* @var array
*/
var $userfields = array(
'firstname',
'lastname',
'email',
'city',
'country',
'lang',
'description',
'url',
'idnumber',
'institution',
'department',
'phone1',
'phone2',
'address',
'firstnamephonetic',
'lastnamephonetic',
'middlename',
'alternatename'
);
var $userfields = \core_user::AUTHSYNCFIELDS;
/**
* Moodle custom fields to sync with.