Report Improvements by Xon

Report Improvements by Xon 2.18.3

No permission to download
As of 2.7.0 (XF2.1), I can view the list of reports, but cannot actually open any of them.

CORRECTION: Reports are opening. Painfully slow. And resolving them is even more painfully slow.
Please open a ticket on my site; https://atelieraphelion.com/

This is likely the modified query to find non-moderators who can actually the reports is being particularly bad for you for whatever reason. I'll need to see the ?_debug=1 output when viewing a report
 
@JoyFreak the "search report" tab only shows up for users who can search reports;



It currently isn't possible to disable this.
 
@JoyFreak the "search report" tab only shows up for users who can search reports;



It currently isn't possible to disable this.
Is there a permission for this then?
 
Yes, "View Report Centre" permission which replaces the is_moderator flag for who can see the report centre.
I just checked the "Administrator" and "Moderating" permissions and both of them are set to No (by default I presume) for the "View Report Centre" permission, and I can still search reports/see the tab. Am I misunderstanding something?
 
Always use the "Analyze permissions" feature to inspect permission configuration for a user. Just inspecting the user-groups you think are relevant makes it very easy to miss something.
 
Always use the "Analyze permissions" feature to inspect permission configuration for a user. Just inspecting the user-groups you think are relevant makes it very easy to miss something.
Worked a treat, thank you!
 
can we disable warnings from appearing in reported content? also when we disable view reported username, alerts still show reported username.
 
This is a fairly core part of the add-on and there isn't anyway to disable that feature.


Just fixed, should be retroactively applying to older alerts too.

is this feature permission-based? I want to disable it for moderators and leave it for admins only. I also have warning improvement installed and now with this addon enabled, users can see who issued the warning. Before I had warnings reported by one mod.
 
I'll need to double check, I suspect it is how both add-ons are extending what is the user to render for the alert.

I think I'll need to implement a better system in the next few days.

For now, if you disable the two template modifications and edit alert_macros to be this;
XML:
<xf:macro name="row" arg-alert="!">
    <div class="contentRow">
        <div class="contentRow-figure">
            <xf:avatar user="$alert.User" size="xxs" defaultname="{$alert.username}" />
            <xf:if is="$alert.content_type === 'warning_alert'">
                <xf:if is="!{$alert.Content.canViewIssuer()}">
                    <xf:avatar user="$alert.Content.getAnonymizedIssuer()" size="xxs" defaultname="{$alert.Content.getAnonymizedIssuer().username}" />
                <xf:else />
                    <xf:avatar user="$alert.User" size="xxs" defaultname="{$alert.username}" />
                </xf:if>
            <xf:elseif is="$alert.content_type === 'report_comment'" />
                <xf:avatar user="$alert.Content.ViewableUser" size="xxs" defaultname="{$alert.Content.ViewableUsername}" />
            <xf:else />
                <xf:avatar user="$alert.User" size="xxs" defaultname="{$alert.username}" />
            </xf:if>
        </div>
        <div class="contentRow-main contentRow-main--close">
            {$alert.render()|raw}
            <div class="contentRow-minor contentRow-minor--smaller">
                <xf:date time="$alert.event_date" />
            </div>
        </div>
    </div>
</xf:macro>

This is a temp fix till I can implement a better solution
 
  • Like
Reactions: KSA
Thank you for your support, however Xon's achievements have nothing to do with our security and protocols.

If @Xon can be a little more specific on these permission risks, this might be a possible candidate for consideration.



The way the disclaimer vaguely reads, it leaves too much to chance.
The add-on switches from the is_moderator flag to user-group permission based access based on what are moderator permissions;

Permission based access to the report center:
  • Default permissions set for groups (global/content) for groups with warn or edit basic profile permissions.
  • New Permissions:
    • View Report center
    • Comment on open report
    • Comment on closed report
    • Update a report's status
    • Assign report
    • See reporter username
The Warn/edit basic profile [of other users] permissions are very much moderator permissions which only do anything if the user is a moderator in stock XenForo. But with this add-on they actually allow non-moderators todo things.

But any moderation permission changes should be reviewed to ensure things work as expected.
 
I had an error for a reported message. Version 1.7.5 is installed.

1611262395541.png

But I think I may know what the issue is. It's possible my everyday login for the database (not the admin/root login) does not allow table creation. Would this error be caused by that? (Although I would have thought that some add-ons would not install if this were the case.)

I can open a ticket at your site if that is preferable.

I did notice the Standard Library was at 1.5.1 and not 1.5.3. I upgraded that and did a test report, and it worked fine. So I don't know if I can duplicate the error now.

Code:
            CREATE TEMPORARY TABLE xf_sv_non_moderator_report_users_view (
                user_id int UNSIGNED NOT NULL PRIMARY KEY,
                canView tinyint(10) DEFAULT NULL
            )
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1044, '42000')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1044, '42000')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/addons/SV/ReportImprovements/XF/Repository/Report.php(165): XF\Db\AbstractAdapter->query('
            CR...')
#5 src/addons/SV/ReportImprovements/XF/Repository/Report.php(329): SV\ReportImprovements\XF\Repository\Report->getNonModeratorsWhoCanHandleReport(Object(SV\ReportImprovements\XF\Entity\Report))
#6 src/XF/Pub/Controller/Report.php(99): SV\ReportImprovements\XF\Repository\Report->getModeratorsWhoCanHandleReport(Object(SV\ReportImprovements\XF\Entity\Report))
#7 src/addons/SV/ReportImprovements/XF/Pub/Controller/Report.php(103): XF\Pub\Controller\Report->actionView(Object(XF\Mvc\ParameterBag))
#8 src/XF/Mvc/Dispatcher.php(350): SV\ReportImprovements\XF\Pub\Controller\Report->actionView(Object(XF\Mvc\ParameterBag))
#9 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF\\Pub\\Controll...', 'View', Object(XF\Mvc\RouteMatch), Object(SV\ReportImprovements\XF\Pub\Controller\Report), Object(XF\Mvc\Reply\Reroute))
#10 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ReportImprovements\XF\Pub\Controller\Report), Object(XF\Mvc\Reply\Reroute))
#11 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#12 src/XF/App.php(2300): XF\Mvc\Dispatcher->run()
#13 src/XF.php(488): XF\App->run()
#14 index.php(20): XF::runApp('XF\\Pub\\App')
#15 {main}
 
Top Bottom