mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 12:39:53 +01:00
Disclose permanent ban duration in login notice
This commit is contained in:
parent
34d97ed7c4
commit
66878544bf
2 changed files with 6 additions and 2 deletions
|
@ -30,10 +30,13 @@ class ApplicationController < ActionController::Base
|
||||||
# obligatory '2001: A Space Odyssey' reference
|
# obligatory '2001: A Space Odyssey' reference
|
||||||
flash[:notice] = t("user.sessions.create.banned", name:)
|
flash[:notice] = t("user.sessions.create.banned", name:)
|
||||||
current_ban = current_user.bans.current.first
|
current_ban = current_user.bans.current.first
|
||||||
unless current_ban&.reason.nil?
|
unless current_ban&.reason.empty?
|
||||||
flash[:notice] += "\n#{t('user.sessions.create.reason', reason: current_ban.reason)}"
|
flash[:notice] += "\n#{t('user.sessions.create.reason', reason: current_ban.reason)}"
|
||||||
end
|
end
|
||||||
unless current_ban&.permanent?
|
|
||||||
|
if current_ban&.permanent?
|
||||||
|
flash[:notice] += "\n#{t('user.sessions.create.permanent')}"
|
||||||
|
else
|
||||||
# TODO format banned_until
|
# TODO format banned_until
|
||||||
flash[:notice] += "\n#{t('user.sessions.create.until', time: current_ban.expires_at)}"
|
flash[:notice] += "\n#{t('user.sessions.create.until', time: current_ban.expires_at)}"
|
||||||
end
|
end
|
||||||
|
|
|
@ -173,6 +173,7 @@ en:
|
||||||
sessions:
|
sessions:
|
||||||
create:
|
create:
|
||||||
banned: "I'm sorry, %{name}, I'm afraid I can't do that."
|
banned: "I'm sorry, %{name}, I'm afraid I can't do that."
|
||||||
|
permanent: "You are banned permanently."
|
||||||
reason: "Ban reason: %{reason}"
|
reason: "Ban reason: %{reason}"
|
||||||
until: "Banned until: %{time}"
|
until: "Banned until: %{time}"
|
||||||
info:
|
info:
|
||||||
|
|
Loading…
Reference in a new issue