Warning Improvements by Xon

Warning Improvements by Xon 1.7.2

No permission to download

Xon

Well-known member
Does not work after the update. Shows the issuer even If I disable it from everywhere. Disabled it until solved.
The permission controlling is a warning issuer is shown is a trivially simple template modification.

I can't help without the following information.
  • The output of analyses permissions for the user in question.
  • Knowing what other addons you are using (just addons which touch warning_info template may not be enough).
  • The contents of the template (warning_info)

Because how the functionality works is really simple. The template modification on warning_info looks for:
Code:
{$warning.warn_username}
and replaces it with:
Code:
<xen:if is="{$visitor.permissions.general.viewWarning_issuer} OR {$visitor.permissions.general.viewWarning}">$0<xen:else/>{xen:phrase WarningStaff}</xen:if>

I'm fairly limited on how much support I can provide for free; especially when the information I have to work with is so limited.

I use this addon on two sites; one without being able to see a warning issuer and one with the ability to see the warning issuer. Both are working correctly.
 
Last edited:
  • The user in question does not have the right to see the issuer and this is strictly configured from the admin panel.
  • Addons:

    addons.webp

  • warning_info content:

    Code:
    <xen:title>{xen:phrase warning_for_x, 'name={$user.username}'}</xen:title>
    
    <xen:navigation>
        <xen:breadcrumb href="{xen:link members, $user}">{$user.username}</xen:breadcrumb>
    </xen:navigation>
    
    <div class="xenForm formOverlay overlayScroll">
        <dl class="ctrlUnit">
            <dt>{xen:phrase content}:</dt>
            <dd>
                <xen:if is="{$canViewContent}">
                    <xen:if is="{$contentUrl}">
                        <a href="{$contentUrl}">{$warning.content_title}</a>
                    <xen:else />
                        {$warning.content_title}
                    </xen:if>
                <xen:else />
                    {xen:phrase n_a}
                </xen:if>
            </dd>
        </dl>
       
        <dl class="ctrlUnit">
            <dt>{xen:phrase given_by}:</dt>
            <dd>{$warning.warn_username}, <xen:datetime time="{$warning.warning_date}" /></dd>
        </dl>
       
        <dl class="ctrlUnit">
            <dt>{xen:phrase details_of_warning}:</dt>
            <dd>{$warning.title}
                <xen:if is="{$warning.notes}"><div class="muted">{xen:helper bodytext, $warning.notes}</div></xen:if>
            </dd>
        </dl>
       
        <dl class="ctrlUnit">
            <dt>{xen:phrase warning_points}:</dt>
            <dd>
                {xen:number $warning.points}
                <xen:if is="{$warning.is_expired}"><span class="muted">({xen:phrase expired})</span>
                <xen:elseif is="{$warning.expiry_date} > 0" /><span class="muted">({xen:phrase expires_x, 'date={xen:date $warning.expiry_date}'})</span>
                </xen:if>
            </dd>
        </dl>
    
        <xen:if is="{$canDeleteWarning} AND {$canExpireWarning}">
            <ul class="tabs Tabs" data-panes="#WarningActionTabs_{$warning.warning_id} > form">
                <li><a href="javascript:">{xen:phrase delete_warning}</a></li>
                <li><a href="javascript:">{xen:phrase update_warning}</a></li>
            </ul>
        </xen:if>
    
        <div id="WarningActionTabs_{$warning.warning_id}">
            <xen:if is="{$canDeleteWarning}">
                <form action="{xen:link warnings/delete, $warning}" method="post">
                    <dl class="ctrlUnit submitUnit" style="border-top: none">
                        <dt></dt>
                        <dd>
                            <ul>
                                <li><label><input type="checkbox" name="_xfConfirm" value="1" /> {xen:phrase confirm_deletion}</label></li>
                                <li>
                                    <input type="submit" value="{xen:phrase delete_warning}" class="button primary" />
                                    <input type="reset" value="{xen:phrase cancel}" class="button OverlayCloser overlayOnly" />
                                </li>
                            </ul>
                        </dd>
                    </dl>
    
                    <input type="hidden" name="redirect" value="{$redirect}" />
                    <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
                </form>
            </xen:if>
    
            <xen:if is="{$canExpireWarning}">
                <form action="{xen:link warnings/expire, $warning}" method="post">
                    <dl class="ctrlUnit">
                        <dt></dt>
                        <dd><ul>
                            <li><label><input type="radio" name="expire" value="now" checked="checked" /> {xen:phrase expire_now}</label></li>
                            <li><label><input type="radio" name="expire" value="future" id="ExpireWarningFuture_{$warning.warning_id}" class="Disabler" /> {xen:phrase expire_in_time}:</label>
                                <ul id="ExpireWarningFuture_{$warning.warning_id}_Disabler">
                                    <li>
                                        <input type="text" size="5" name="expiry_length" value="1" class="textCtrl autoSize" />
                                        <select name="expiry_unit" class="textCtrl autoSize">
                                            <option value="hours">{xen:phrase hours}</option>
                                            <option value="days" selected="selected">{xen:phrase days}</option>
                                            <option value="weeks">{xen:phrase weeks}</option>
                                            <option value="months">{xen:phrase months}</option>
                                        </select>
                                    </li>
                                </ul>
                            </li>
                        </ul></dd>
                    </dl>
                    <dl class="ctrlUnit submitUnit">
                        <dt></dt>
                        <dd>
                            <input type="submit" value="{xen:phrase update_warning}" class="button primary" />
                        </dd>
                    </dl>
    
                    <input type="hidden" name="_xfConfirm" value="1" />
                    <input type="hidden" name="redirect" value="{$redirect}" />
                    <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
                </form>
            </xen:if>
        </div>
    </div>
 
The user in question does not have the right to see the issuer and this is strictly configured from the admin panel.
You have Tapatalk installed, is the user using Tapatalk?

My guess is tapatalk isn't using the standard warning info template, as such my template modification simply isn't being applied.

I don't have a copy so extending to support would be challenging.
 
OK I have only one thing left. I have removed the issuer name from phrases but the avatar of the issuer is still visible!

avaatr.webp
 
@Recep Baltaş Search for the "Anonymise Warning Alerts" warning setting (option_sv_warning_anonymise) and make sure it is checked; this will prevent the warning alerts from leaking the details for the issuer of the warning.

You may need to edit the template alert_warning_alert_warning and replace it with:

Code:
{xen:phrase warning_alert_text_anonymize,
'warning_attributes=href="{xen:link warnings, $content}" class="PopupItemLink"',
'points={$content.points}',
'warning_title={$content.title}'
}
 
Anonymise Warning Alerts is checked in the settings. But there is no option_sv_warning_anonymise template. This is the latest situation of alert_warning_alert_warning:

Code:
<xen:if is="{$user.user_id}">
{xen:phrase warning_alert_text_anonymize,
'warning_attributes=href="{xen:link warnings, $content}" class="PopupItemLink"',
'points={$content.points}',
'warning_title={$content.title}'
}
</xen:if>

Still showing the avatar.
 
The Anonymise Warning Alerts settings shows up if you search for option_sv_warning_anonymise in the AdminCP. This option does not work retroactively.

This setting only applies to new warning alerts.

The following SQL will anonymise old warning alerts:
Code:
update xf_user_alert
set user_id = 0, username = ''
where content_type ='warning_alert' and action = 'warning'
 
I have enabled it, I have issued a new warning and the avatar was still visible. I know that it is not retroactive. I have read the note under the setting.
 
I beileve that you really should disable "Send Warning Conversations By Default". All the time, users are swearing back to us :)

But anyway, we have the option to disable it.

//I will update and give feedback soon.
 
BTW, there are two options for this. One in the plug-in settings and the the other in User Warning Settings... Enabled em both.
 
BTW, there are two options for this. One in the plug-in settings and the the other in User Warning Settings... Enabled em both.
That is the same option, but accessible from two places. The one under "User Alert" was the original location before I started adding enough options that it should go in it's own section.
 
Top Bottom