diff --git a/abrechenbarkeit.lua b/abrechenbarkeit.lua
index b7636a1..b7ec392 100755
--- a/abrechenbarkeit.lua
+++ b/abrechenbarkeit.lua
@@ -584,7 +584,7 @@ local function r_users(show_special, filter_negative)
local is_spu = user.name:sub(1, 1) == "@"
local filter_out = query.prefix ~= nil and user.name:sub(1, 1):lower() ~= query.prefix
if (filter_negative ~= nil and user.balance < filter_negative)
- or (filter_negative == nil and is_spu == show_special and not filter_out) then
+ or (filter_negative == nil and is_spu == show_special and (not filter_out)) then
print(format([[
{!username}
@@ -599,9 +599,10 @@ local function r_users(show_special, filter_negative)
end
local inactive_cutoff = os.time() - (tonumber(config.inactive_cutoff) or (30 * 24 * 60 * 60))
for _, user in ipairs(get_active_users()) do
- if user.time > inactive_cutoff then show_user(user) end
+ if filter_negative or user.time > inactive_cutoff then show_user(user) end
end
print("")
+ if filter_negative ~= nil then return end
print(format([[{+users.inactive_list}
]]))
for _, user in ipairs(users) do
if user.time <= inactive_cutoff then show_user(user) end
@@ -802,8 +803,7 @@ if path == "/" then
elseif query.users and query.export then
return r_export_balances()
else
- return r_users(false, query.negative)
- -- tonumber(query.negative or 0) or nil)
+ return r_users(false, query.negative and (query.maximum or 0))
end
else
local username = extract_username()
diff --git a/readme.md b/readme.md
index 2d8a6a6..544bb06 100644
--- a/readme.md
+++ b/readme.md
@@ -23,3 +23,8 @@ useful for development or proxyless deployments.
curl 'http://strichliste.example.org/api/user?deleted=false' | jq -r '.users.[] | [ 0, "@Potential", .name, .balance, "", "", "" ] | join(",")' > log
curl 'http://strichliste.example.org/api/article' | jq -r '.articles.[] | [ .barcode, .amount, "@Drinks", .name ] | join(",")' > products
```
+
+## Non-linked User lists
+
+- list of Users with negative balance: `http://abrechenbarkeit.example.org/?negative`
+- list of Users with balance lower than : `http://abrechenbarkeit.example.org/?negative&maximum=`