dokuwiki-plugin-gitbacked
dokuwiki-plugin-gitbacked copied to clipboard
Allow configuration of author "name" field / default to "user" if blank
For some reason, for our dokuwiki installation, the "name" field in the user info is always blank. It's there in the user list, but doesn't seem to show up in the data -- it may be due to the fact that we use the LDAP auth plugin.
In any case, it may be helpful to be able to allow users to pick where that data comes from. I've locally patched our version to use the "user" field for now.
Either that, or have "user" be the backup if "name" is empty.
A third option comes to mind: expand the available replacement strings to match the user info fields.
So, %user%
is used for USERINFO['user']
and %name%
for USERINFO['name']
, etc.
Are you talking about the git author or some history in the wiki iteself?
Whoops, I guess i should have mentioned that this is the commit message: Wiki page %page% changed by %user%
For my install, %user%
is always blank because it's trying to actually get the "real name", which we don't seem to have.
It would be nice if %user%
was for the username and ``%name%` was for the "real name" portion since that's what they are in the data structure.
you can try to change the function on line 95 in action/editcommit.php to:
private function getAuthor() {
return !empty($GLOBALS['USERINFO']['name']) ? $GLOBALS['USERINFO']['name'] : $_SERVER['REMOTE_USER'] ;
}
when does it happen, with an anonymous user?
We don't have any anonymous users. Everyone is authenticated through LDAP.
have you tested the fix?
I'm currently using return $GLOBALS['USERINFO']['user'];
which at least gives me the username.
this was fixed in https://github.com/woolfg/dokuwiki-plugin-gitbacked/commit/8457ba7e9b7c6f553a9c104f91ea1d6cb48a5c13 I suppose