[OzzModz] Users Can View Their Own Warnings

[OzzModz] Users Can View Their Own Warnings 2.0.0

No permission to download
OzzModz has been closed for over two years. Snog’s site only requires you to go there to download your paid addons.

Out of my 200+ or so free addons only a handful are hosted in Forum Promotion. If it’s too much to go there and take 30~ seconds to register then perhaps I need to evaluate my time when writing/having free addons.
Hiya @Ozzy47

Thought i would give this one a go, however once installed i cant see the "warnings" text in any of the places on the front page. Nor can i see any "options" to set this up, or anywhere in "User Group Permissions" where this is enabled.
Enev tried in the default skin just on case it wasnt on my default one.

Any clues?? Thanks!
This look like a good ideas so that warned members can see their warnings.

1- can they see the reasons for receiving a warning?

2- For those who use this addon, what's the reaction from members. Does it antagonize them to always be reminded, or is it perceive as helpful? Does it create drama?

I just found this. Thanks for creating it. However, I believe it has a flaw allowing everyone to see any warning.

You have this:
if (!\XF::visitor()->canViewWarnings() && $user->user_id == \XF::visitor()->user_id){
    return $this->view('XF:Member\Warnings', 'ozzy_custom_member_warnings', $viewParams);
return $this->view('XF:Member\Warnings', 'member_warnings', $viewParams);

Which means you will display your special warnings page if the user does not have permission. But you are forgetting to display the noPermission() error in case it's not the visitor's own profile. I propose changing those lines to the following:
if (!\XF::visitor()->canViewWarnings()) {
    if ($user->user_id == \XF::visitor()->user_id) {
        return $this->view('XF:Member\Warnings', 'ozzy_custom_member_warnings', $viewParams);
    } else {
        return $this->noPermission();
return $this->view('XF:Member\Warnings', 'member_warnings', $viewParams);
Top Bottom