mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Merge branch 'MDL-64049-master' of git://github.com/andrewnicols/moodle
This commit is contained in:
commit
b2cb05a8c7
@ -2088,7 +2088,11 @@ function get_user_preferences($name = null, $default = null, $user = null) {
|
||||
} else if (isset($user->id)) {
|
||||
// Is a valid object.
|
||||
} else if (is_numeric($user)) {
|
||||
$user = (object)array('id' => (int)$user);
|
||||
if ($USER->id == $user) {
|
||||
$user = $USER;
|
||||
} else {
|
||||
$user = (object)array('id' => (int)$user);
|
||||
}
|
||||
} else {
|
||||
throw new coding_exception('Invalid $user parameter in get_user_preferences() call');
|
||||
}
|
||||
|
@ -64,18 +64,11 @@ class repository_flickr_privacy_testcase extends provider_testcase {
|
||||
$this->assertFalse($writer->has_any_data());
|
||||
|
||||
// Test exporting of Flickr repository user preferences *with* OAuth token/secret preference configured.
|
||||
$preference = (object) [
|
||||
'userid' => $user->id,
|
||||
'name' => 'repository_flickr_access_token',
|
||||
'value' => 'dummy flickr oauth access token'
|
||||
];
|
||||
$DB->insert_record('user_preferences', $preference);
|
||||
$preference = (object) [
|
||||
'userid' => $user->id,
|
||||
'name' => 'repository_flickr_access_token_secret',
|
||||
'value' => 'dummy flickr oauth access token secret'
|
||||
];
|
||||
$DB->insert_record('user_preferences', $preference);
|
||||
set_user_preferences([
|
||||
'repository_flickr_access_token' => 'dummy flickr oauth access token',
|
||||
'repository_flickr_access_token_secret' => 'dummy flickr oauth access token secret',
|
||||
], $user->id);
|
||||
|
||||
provider::export_user_preferences($user->id);
|
||||
$writer = writer::with_context($contextuser);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user