37
37
*
38
38
*/
39
39
class provider implements
40
+ \core_privacy \local \request \core_userlist_provider,
40
41
\core_privacy \local \metadata \provider,
41
- \core_privacy \local \request \plugin \provider,
42
- \core_privacy \local \request \core_userlist_provider {
43
-
42
+ \core_privacy \local \request \plugin \provider {
44
43
/**
45
44
* Return the fields which contain personal data.
46
45
*
@@ -71,7 +70,8 @@ public static function get_metadata(collection $collection): collection {
71
70
'expires ' => 'privacy:metadata:local_oauth:refresh_tokens:expires ' ,
72
71
'scope ' => 'privacy:metadata:local_oauth:refresh_tokens:scope ' ,
73
72
],
74
- 'privacy:metadata:local_oauth:refresh_tokens:tableexplanation ' );
73
+ 'privacy:metadata:local_oauth:refresh_tokens:tableexplanation '
74
+ );
75
75
76
76
$ collection ->add_database_table (
77
77
'local_oauth_auth_codes ' ,
@@ -85,9 +85,11 @@ public static function get_metadata(collection $collection): collection {
85
85
'scope ' => 'privacy:metadata:local_oauth:auth_codes:scope ' ,
86
86
'id_token ' => 'privacy:metadata:local_oauth:auth_codes:id_token ' ,
87
87
],
88
- 'privacy:metadata:local_oauth:auth_codes:tableexplanation ' );
88
+ 'privacy:metadata:local_oauth:auth_codes:tableexplanation '
89
+ );
89
90
90
- $ collection ->add_database_table ('local_oauth_access_tokens ' ,
91
+ $ collection ->add_database_table (
92
+ 'local_oauth_access_tokens ' ,
91
93
[
92
94
'id ' => 'privacy:metadata:local_oauth:access_tokens:id ' ,
93
95
'access_token ' => 'privacy:metadata:local_oauth:access_tokens:access_token ' ,
@@ -96,7 +98,8 @@ public static function get_metadata(collection $collection): collection {
96
98
'expires ' => 'privacy:metadata:local_oauth:access_tokens:expires ' ,
97
99
'scope ' => 'privacy:metadata:local_oauth:access_tokens:scope ' ,
98
100
],
99
- 'privacy:metadata:local_oauth:access_tokens:tableexplanation ' );
101
+ 'privacy:metadata:local_oauth:access_tokens:tableexplanation '
102
+ );
100
103
101
104
$ collection ->add_external_location_link (
102
105
'oauth_client ' ,
@@ -116,7 +119,9 @@ public static function get_metadata(collection $collection): collection {
116
119
'locality ' => 'privacy:metadata:oauth_client:locality ' ,
117
120
'country ' => 'privacy:metadata:oauth_client:country ' ,
118
121
'enrolments ' => 'privacy:metadata:oauth_client:enrolments ' ,
119
- ], 'privacy:metadata:oauth_client ' );
122
+ ],
123
+ 'privacy:metadata:oauth_client '
124
+ );
120
125
121
126
// Plugin also access user and enrolment data but does not store or modify it.
122
127
// So we dont have to specify that.
@@ -134,7 +139,6 @@ public static function get_contexts_for_userid(int $userid): contextlist {
134
139
135
140
$ contextlist = new \core_privacy \local \request \contextlist ();
136
141
return $ contextlist ->add_user_context ($ userid );
137
-
138
142
}
139
143
140
144
/**
@@ -181,7 +185,7 @@ public static function export_user_data(approved_contextlist $contextlist) {
181
185
$ userauthscopes = $ DB ->get_records ('local_oauth_user_auth_scopes ' , ['user_id ' => $ user ->id ]);
182
186
foreach ($ userauthscopes as $ scope ) {
183
187
$ scope ->user_id = transform::user ($ scope ->user_id );
184
- writer::with_context ($ context )->export_data ( array_merge ($ subcontext , [
188
+ writer::with_context ($ context )->export_data (array_merge ($ subcontext , [
185
189
$ scope ->client_id ,
186
190
$ scope ->scope ,
187
191
get_string ('privacy:metadata:local_oauth:auth_scopes ' , 'local_oauth ' ),
@@ -217,7 +221,7 @@ public static function export_user_data(approved_contextlist $contextlist) {
217
221
$ token ->user_id = transform::user ($ token ->user_id );
218
222
$ token ->expires = transform::datetime ($ token ->expires );
219
223
$ token ->access_token = $ notexportedstr ;
220
- writer::with_context ($ context )->export_data ( array_merge ($ subcontext , [
224
+ writer::with_context ($ context )->export_data (array_merge ($ subcontext , [
221
225
$ token ->client_id ,
222
226
$ token ->scope ,
223
227
get_string ('privacy:metadata:local_oauth:access_tokens ' , 'local_oauth ' ),
@@ -283,8 +287,5 @@ private static function delete_user(int $userid) {
283
287
$ DB ->delete_records ('local_oauth_refresh_tokens ' , ['user_id ' => $ userid ]);
284
288
$ DB ->delete_records ('local_oauth_auth_codes ' , ['user_id ' => $ userid ]);
285
289
$ DB ->delete_records ('local_oauth_access_tokens ' , ['user_id ' => $ userid ]);
286
-
287
290
}
288
-
289
291
}
290
-
0 commit comments