success! moderator access granted
This commit is contained in:
parent
964e6c28ee
commit
f0090f75bc
|
@ -0,0 +1,16 @@
|
|||
require "uri"
|
||||
|
||||
include CrystalGauntlet
|
||||
|
||||
CrystalGauntlet.endpoints["/requestUserAccess.php"] = ->(context : HTTP::Server::Context): String {
|
||||
params = URI::Params.parse(context.request.body.not_nil!.gets_to_end)
|
||||
LOG.debug { params.inspect }
|
||||
|
||||
user_id, account_id = Accounts.auth(params)
|
||||
if !(user_id && account_id)
|
||||
return "-1"
|
||||
end
|
||||
|
||||
rank = Ranks.get_rank(account_id)
|
||||
rank.is_mod ? "1" : "-1"
|
||||
}
|
Loading…
Reference in New Issue