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
mahara
mahara
Commits
f967bc0e
Commit
f967bc0e
authored
Nov 27, 2006
by
Martyn Smith
Committed by
Martyn Smith
Nov 27, 2006
Browse files
Admin users should always see full name
parent
a392b8b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/mahara.php
View file @
f967bc0e
...
...
@@ -1107,9 +1107,12 @@ function email_user($userto, $userfrom, $subject, $messagetext, $messagehtml='')
* converts a user object to a string representation of the user suitable for
* the current user (or specified user) to see
*
* Both parameters should be objects containing id, preferredname, firstname,
* lastname, admin
*
* @param object the user that you're trying to format to a string
* @param object the user that is looking at the string representation (if left
* blank, will default to the currently logged in user)
* blank, will default to the currently logged in user)
.
*
* @returns string name to display
*/
...
...
@@ -1133,12 +1136,16 @@ function display_name($user, $userto=null) {
if
(
!
is_object
(
$user
))
{
throw
new
InvalidArgumentException
(
"Invalid user passed to display_name"
);
}
// if they don't have a preferred name set, just return here
if
(
empty
(
$user
->
preferredname
))
{
return
$user
->
firstname
.
' '
.
$user
->
lastname
;
}
if
(
$userto
->
admin
)
{
return
$user
->
preferredname
.
' ('
.
$user
->
firstname
.
' '
.
$user
->
lastname
.
')'
;
}
$prefix
=
get_config
(
'dbprefix'
);
$sql
=
'SELECT c1.member
FROM '
.
$prefix
.
'community_member c1
...
...
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