auth: append login to formatted user names
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 20 Nov 2019 23:19:01 +0000 (00:19 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 25 Nov 2019 20:14:17 +0000 (21:14 +0100)
auth.inc.php
issue/index.php
widget/login/list.php

index aceb2de076c3481dc53a61c24e4444f88c866a2d..3901609ac5317685563fc446aee404d121a442ad 100644 (file)
@@ -29,7 +29,11 @@ class User
 
        function html()
        {
-               return $this->name ?: $this->login;
+               $name = htmlspecialchars($this->login);
+               if ($this->name and $this->name != $name) {
+                       $name = "{$this->name}<small> @$name</small>";
+               }
+               return $name;
        }
 
        function email()
index 388db5d836acce3019b375e8b04e636ffd5a9e08..bb556f2019d6e259d70ca8a943cdc40757b75c50 100644 (file)
@@ -16,7 +16,7 @@ if ($id and ctype_digit($id)) {
        $author = $Issue->author ? new User('profile/'.$Issue->author, FALSE) : NULL;
        printf('<p><em>%s</em>%s <small class=date>%s</small></p>'."\n",
                'Geplaatst',
-               $author ? " door <strong>{$author->name}</strong>" : '',
+               $author ? " door <strong>{$author->html}</strong>" : '',
                showdate(preg_split('/\D/', $Issue->created))
        );
        if ($Issue->assign) {
index da4acd20c4b083fe8e10ebbb6295f39d612100dd..17dbaac9282a81089d9c03a0fac5bdda5220c840 100644 (file)
@@ -37,7 +37,7 @@ elseif (count($users) > 5) {
 print ">\n";
 
 foreach ($users as $user) {
-       $name = $user->name ?: $user->login;
+       $name = $user->html;
        if ($GLOBALS['User'] and $GLOBALS['User']->admin('user')) {
                $link = '/login/edit/'.$user->login;
                $name = sprintf('<a href="%s">%s</a>', $link, $name);