summaryrefslogtreecommitdiff
path: root/inc/common.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/common.php')
-rw-r--r--inc/common.php30
1 files changed, 14 insertions, 16 deletions
diff --git a/inc/common.php b/inc/common.php
index 8c9956018..e56285f62 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -1583,7 +1583,7 @@ function shorten($keep, $short, $max, $min = 9, $char = '…') {
}
/**
- * Return the users realname or e-mail address for use
+ * Return the users real name or e-mail address for use
* in page footer and recent changes pages
*
* @param string|null $username or null when currently logged-in user should be used
@@ -1641,22 +1641,20 @@ function userlink($username = null, $textonly = false) {
$evt = new Doku_Event('COMMON_USER_LINK', $data);
if($evt->advise_before(true)) {
if(empty($data['name'])) {
- if($conf['showuseras'] == 'loginname') {
- $data['name'] = $textonly ? $data['username'] : hsc($data['username']);
- } else {
- if($auth) $info = $auth->getUserData($username);
- if(isset($info) && $info) {
- switch($conf['showuseras']) {
- case 'username':
- case 'username_link':
- $data['name'] = $textonly ? $info['name'] : hsc($info['name']);
- break;
- case 'email':
- case 'email_link':
- $data['name'] = obfuscate($info['mail']);
- break;
- }
+ if($auth) $info = $auth->getUserData($username);
+ if($conf['showuseras'] != 'loginname' && isset($info) && $info) {
+ switch($conf['showuseras']) {
+ case 'username':
+ case 'username_link':
+ $data['name'] = $textonly ? $info['name'] : hsc($info['name']);
+ break;
+ case 'email':
+ case 'email_link':
+ $data['name'] = obfuscate($info['mail']);
+ break;
}
+ } else {
+ $data['name'] = $textonly ? $data['username'] : hsc($data['username']);
}
}