disable mod tools while streaming - closes #4087
This commit is contained in:
parent
f078273ab0
commit
55d6bbb371
|
@ -15,7 +15,8 @@ object Report extends LilaController {
|
|||
private def api = env.api
|
||||
|
||||
def list = Secure(_.SeeReport) { implicit ctx => me =>
|
||||
renderList(env.modFilters.get(me).fold("all")(_.key))
|
||||
if (Env.streamer.liveStreamApi.isStreaming(me.id)) fuccess(Forbidden(html.mod.streaming()))
|
||||
else renderList(env.modFilters.get(me).fold("all")(_.key))
|
||||
}
|
||||
|
||||
def listWithFilter(room: String) = Secure(_.SeeReport) { implicit ctx => me =>
|
||||
|
|
|
@ -240,7 +240,8 @@ object User extends LilaController {
|
|||
}
|
||||
|
||||
def mod(username: String) = Secure(_.UserSpy) { implicit ctx => me =>
|
||||
OptionFuOk(UserRepo named username) { user =>
|
||||
if (Env.streamer.liveStreamApi.isStreaming(me.id)) fuccess(Ok("Disabled while streaming"))
|
||||
else OptionFuOk(UserRepo named username) { user =>
|
||||
UserRepo.emails(user.id) zip
|
||||
(Env.security userSpy user) zip
|
||||
Env.mod.assessApi.getPlayerAggregateAssessmentWithGames(user.id) zip
|
||||
|
|
|
@ -81,11 +81,7 @@ asyncJs: Boolean = false)(body: Html)(implicit ctx: Context)
|
|||
data-asset-url="@assetBaseUrl"
|
||||
data-asset-version="@ctx.pageData.assetVersion"
|
||||
@ctx.zoom.map { zoom => data-zoom="@zoom" }>
|
||||
<form id="blind_mode" action="@routes.Main.toggleBlindMode" method="POST">
|
||||
<input type="hidden" name="enable" value="@ctx.blindMode.fold(0,1)" />
|
||||
<input type="hidden" name="redirect" value="@ctx.req.path" />
|
||||
<button type="submit">Accessibility: @ctx.blindMode.fold("Disable", "Enable") blind mode</button>
|
||||
</form>
|
||||
<form id="blind_mode" action="@routes.Main.toggleBlindMode" method="POST"><input type="hidden" name="enable" value="@ctx.blindMode.fold(0,1)" /><input type="hidden" name="redirect" value="@ctx.req.path" /><button type="submit">Accessibility: @ctx.blindMode.fold("Disable", "Enable") blind mode</button></form>
|
||||
<div id="site_description">@trans.siteDescription()</div>
|
||||
@ctx.pageData.inquiry.map { inquiry =>
|
||||
@mod.inquiry(inquiry)
|
||||
|
|
6
app/views/mod/streaming.scala.html
Normal file
6
app/views/mod/streaming.scala.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
@()(implicit ctx: Context)
|
||||
|
||||
@site.message(title = "Disabled while streaming") {
|
||||
This moderation feature is disabled while streaming,<br />
|
||||
to avoid leaking sensible information.
|
||||
}
|
Loading…
Reference in a new issue