Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
25 stars 19 forks source link

Standardize the way the Anonymous Name is Retrieved and Set so Plugins can use it #1069

Closed eSilverStrike closed 2 years ago

eSilverStrike commented 3 years ago

When an anonymous user leaves a comment, if they specify a name, a cookie is set to it can be retrieved again if they leave another comment and the name field gets auto filled.

We should create a Plugin API to standardize the setting and retrieval of this cookie so plugins like the Forum can use it as well

mystralkk commented 3 years ago

Implemented with change set 95b01a0. Now COM_getDisplayName() returns a user name taking into account $_COOKIE[$_CONF['cookie_anon_name']] in case of an anonymous user.

eSilverStrike commented 2 years ago

Found issue #1072 which was related to this feature request. Can't grab cookie for anonymous user name in COM_getDisplayName as it is used to retrieve name of records for other anonymous users and not just the current anonymous user. Plugins will just have to retrieve (and set) name in cookie the original way.

Therefore had to revert part of code changes from this feature request.

Updated forum plugin to do this similar to comments. For example see: b53e7a9e4e9dfb80bfa38c241ff4af8c8050954b