Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
b385e0da
Commit
b385e0da
authored
Jan 17, 2022
by
Paul Holden
Browse files
MDL-73603 webservice: fix user retrieval in token form callback.
parent
0e188470
Changes
1
Hide whitespace changes
Inline
Side-by-side
webservice/classes/token_form.php
View file @
b385e0da
...
...
@@ -25,6 +25,8 @@
namespace
core_webservice
;
use
core_user
;
/**
* Form to create and edit a web service token.
*
...
...
@@ -52,11 +54,11 @@ class token_form extends \moodleform {
'multiple'
=>
false
,
'ajax'
=>
'core_user/form_user_selector'
,
'valuehtmlcallback'
=>
function
(
$userid
)
{
global
$DB
,
$OUTPUT
;
global
$OUTPUT
;
$context
=
\
context_system
::
instance
();
$fields
=
\
core_user\fields
::
for_name
()
->
with_identity
(
$context
,
false
);
$record
=
$DB
->
get_record
(
'
user
'
,
[
'id
'
=>
$userid
],
$field
s
,
MUST_EXIST
);
$record
=
core_user
::
get_user
(
$
user
id
,
'id
'
.
$fields
->
get_sql
()
->
select
s
,
MUST_EXIST
);
$user
=
(
object
)[
'id'
=>
$record
->
id
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment