[dokuwiki] Re: Suggestion: Make changelog show full name of user if available

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: DokuWiki Mailinglist <dokuwiki@xxxxxxxxxxxxx>
  • Date: Sat, 25 Oct 2014 09:24:29 +0200

Hi

> we are using Dokuwiki in a corporate environment, where users have
> cryptic IDs instead of human readable user names.

Isn't that what the showuseras config option is for?

> Thus, we modified the "changelog.php" such that it shows the full name
> of the user (if available).

BTW. it's much easier for us to evaluate code changes when they are
submitted as pull requests at github.

Your change seems to modify what is logged to the changelog instead of
modifying what is displayed. Not the best way to do it.

Andi
 Hello,

we are using Dokuwiki in a corporate environment, where users have cryptic
IDs instead of human readable user names.

Thus, we modified the "changelog.php" such that it shows the full name of
the user (if available). We would suggest this do be added to the dokuwiki
code, or as an option for the admin to configure.


--- changelog.php.orig  2014-10-08 09:59:23.000000000 +0200
+++ changelog.php       2014-10-17 23:47:10.810379768 +0200
@@ -70,8 +70,11 @@

     if(!$date) $date = time(); //use current time if none supplied
     $remote = (!$flagExternalEdit)?clientIP(true):'127.0.0.1';
+    if (empty($INFO['userinfo']['name'])) {
     $user   = (!$flagExternalEdit)?$INPUT->server->str('REMOTE_USER'):'';
-
+    } else {
+        $user   = (!$flagExternalEdit)?$INFO['userinfo']['name']:'';
+    }
     $strip = array("\t", "\n");
     $logline = array(
             'date'  => $date,
@@ -138,7 +141,11 @@

     if(!$date) $date = time(); //use current time if none supplied
     $remote = clientIP(true);
+    if (empty($INFO['userinfo']['name'])) {
     $user   = $INPUT->server->str('REMOTE_USER');
+    } else {
+        $user   = $INFO['userinfo']['name'];
+    }

     $strip = array("\t", "\n");
     $logline = array(




Best regards,
Joschi Brauchle

Other related posts: