Forum_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

cmb
Posts: 11675
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Forum_XH

Postby cmb » Wed Jun 28, 2017 1:21 pm

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.
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

deeseecee
Posts: 44
Joined: Tue Jan 22, 2013 1:22 pm
Location: Bochum, Germany

Re: Forum_XH

Postby deeseecee » Wed Jun 28, 2017 2:15 pm

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.

cmb
Posts: 11675
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Forum_XH

Postby cmb » Wed Jun 28, 2017 5:26 pm

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).
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+


Return to “Addons and Plugins”

Who is online

Users browsing this forum: No registered users and 1 guest