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
integration
prechecker
Commits
7b15a363
Commit
7b15a363
authored
May 14, 2015
by
Juan Leyva
Committed by
Eloy Lafuente
Jun 30, 2015
Browse files
MDL-50130 users: Filter profile fields data in external functions
parent
4f46506f
Changes
1
Hide whitespace changes
Inline
Side-by-side
user/lib.php
View file @
7b15a363
...
...
@@ -332,8 +332,17 @@ function user_get_user_details($user, $course = null, array $userfields = array(
$newfield
=
'profile_field_'
.
$field
->
datatype
;
$formfield
=
new
$newfield
(
$field
->
id
,
$user
->
id
);
if
(
$formfield
->
is_visible
()
and
!
$formfield
->
is_empty
())
{
// We only use display_data in fields that require text formatting.
if
(
$field
->
datatype
==
'text'
or
$field
->
datatype
==
'textarea'
)
{
$fieldvalue
=
$formfield
->
display_data
();
}
else
{
// Cases: datetime, checkbox and menu.
$fieldvalue
=
$formfield
->
data
;
}
$userdetails
[
'customfields'
][]
=
array
(
'name'
=>
$formfield
->
field
->
name
,
'value'
=>
$f
ormfield
->
data
,
array
(
'name'
=>
$formfield
->
field
->
name
,
'value'
=>
$f
ieldvalue
,
'type'
=>
$field
->
datatype
,
'shortname'
=>
$formfield
->
field
->
shortname
);
}
}
...
...
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