user traffic report fix.
Ylian Saint-Hilaire committed
Sep 13, 2021 at 15:16 UTC
f67f094d88214f1e49c094abbf5fa439fb6aba3f
1 file changed
+2
-8
meshuser.js
+2
-8
@@ -5541,14 +5541,8 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
5541
5542
if (command.type == 2) { // This is the user traffic usage report.
5543
// If we are not user administrator on this site, only search for events with our own user id.
5544
- var ids = [user._id];
5545
- if ((user.siteadmin & SITERIGHT_MANAGEUSERS) != 0) {
5546
- if (command.devGroup != null) {
5547
- ids = [user._id, command.devGroup];
5548
- } else {
5549
- if (manageAllDeviceGroups) { ids = ['*']; } else if (user.links) { for (var i in user.links) { ids.push(i); } }
5550
- }
5551
- }
5544
+ var ids = [user._id]; // If we are nto user administrator, only count our own traffic.
5545
+ if ((user.siteadmin & SITERIGHT_MANAGEUSERS) != 0) { ids = ['*']; } // If user administrator, count traffic of all users.
5546
5547
// Get the events in the time range
5548
// MySQL or MariaDB query will ignore the MsgID filter.