2023-01-01 09:24:04 +01:00
|
|
|
require "uri"
|
|
|
|
|
|
|
|
include CrystalGauntlet
|
|
|
|
|
2023-01-05 15:10:18 +01:00
|
|
|
CrystalGauntlet.endpoints["/updateGJAccSettings20.php"] = ->(context : HTTP::Server::Context): String {
|
2023-01-03 08:02:50 +01:00
|
|
|
params = URI::Params.parse(context.request.body.not_nil!.gets_to_end)
|
2023-01-02 11:59:37 +01:00
|
|
|
LOG.debug { params.inspect }
|
2023-01-01 09:24:04 +01:00
|
|
|
|
|
|
|
user_id, account_id = Accounts.auth(params)
|
|
|
|
if !(user_id && account_id)
|
|
|
|
return "-1"
|
|
|
|
end
|
|
|
|
|
|
|
|
DATABASE.exec("update accounts set messages_enabled=?, friend_requests_enabled=?, comments_enabled=?, youtube_url=?, twitter_url=?, twitch_url=? where id=?", params["mS"].to_i32, params["frS"].to_i32, params["cS"].to_i32, params["yt"], params["twitter"], params["twitch"], account_id)
|
|
|
|
|
|
|
|
"1"
|
|
|
|
}
|