Page 2 of 2

Re: Forum_XH

Posted: Wed Jun 28, 2017 1:21 pm
by cmb
deeseecee wrote:I had a look at the code of Forum_XH and my guess is that something in the 'private function user()' in MainController.php (lines 316 ff.) should be changed.
Yes, indeed. Use "fullname" instead of "username".

However, I don't think that it is a good idea to store all information regarding the current user in the session, because that easily leads to issues like https://github.com/cmb69/register_xh/issues/9. Instead, it is better to store only the user's ID (can be the username) in the session, and to read further information from the user database (and to bail out if there is no such user). Doing this in a portable way would require a respective API, though.

Re: Forum_XH

Posted: Wed Jun 28, 2017 2:15 pm
by deeseecee
Thank you for your quick reply and your solution. I just changed from 'username' to 'fullname'. In my case, this solution is perfect and hopefully doesn't lead to issues.

Re: Forum_XH

Posted: Wed Jun 28, 2017 5:26 pm
by cmb
deeseecee wrote:In my case, this solution is perfect and hopefully doesn't lead to issues.
No, I don't expect any issues now. It's just that this solution (directly accessing session variables of another plugins) is not future proof (but it's probably good enough for quite a long time).