dokuwiki-plugin-gitbacked icon indicating copy to clipboard operation
dokuwiki-plugin-gitbacked copied to clipboard

Allow configuration of author "name" field / default to "user" if blank

Open bricas opened this issue 8 years ago • 8 comments

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.

bricas avatar Jun 30 '16 18:06 bricas

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.

bricas avatar Jun 30 '16 18:06 bricas

Are you talking about the git author or some history in the wiki iteself?

woolfg avatar Jul 03 '16 10:07 woolfg

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.

bricas avatar Jul 04 '16 11:07 bricas

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?

woolfg avatar Jul 24 '16 22:07 woolfg

We don't have any anonymous users. Everyone is authenticated through LDAP.

bricas avatar Jul 24 '16 22:07 bricas

have you tested the fix?

woolfg avatar Aug 14 '16 20:08 woolfg

I'm currently using return $GLOBALS['USERINFO']['user']; which at least gives me the username.

bricas avatar Aug 15 '16 12:08 bricas

this was fixed in https://github.com/woolfg/dokuwiki-plugin-gitbacked/commit/8457ba7e9b7c6f553a9c104f91ea1d6cb48a5c13 I suppose

ochurlaud avatar Feb 07 '22 22:02 ochurlaud