settings: Challenge can never ends
This commit is contained in:
parent
d4f69059bf
commit
aad95f1e53
12 changed files with 36 additions and 22 deletions
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
func WantChoicesHandler(w http.ResponseWriter, r *http.Request, team string, sURL []string) {
|
||||
if time.Now().After(challengeEnd) {
|
||||
if challengeEnd != nil && time.Now().After(*challengeEnd) {
|
||||
http.Error(w, "{\"errmsg\":\"Le challenge est terminé, trop tard !\"}", http.StatusGone)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import (
|
|||
)
|
||||
|
||||
func HintHandler(w http.ResponseWriter, r *http.Request, team string, sURL []string) {
|
||||
if time.Now().After(challengeEnd) {
|
||||
if challengeEnd != nil && time.Now().After(*challengeEnd) {
|
||||
http.Error(w, "{\"errmsg\":\"Le challenge est terminé, trop tard pour un indice !\"}", http.StatusGone)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ const resolutiontpl = `<!DOCTYPE html>
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Challenge Forensic - Résolution</title>
|
||||
<title>Résolution</title>
|
||||
</head>
|
||||
<body style="margin: 0">
|
||||
<video src="{{.}}" controls width="100%" height="100%"></video>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ var startedFile = "started"
|
|||
|
||||
var touchTimer *time.Timer = nil
|
||||
var challengeStart time.Time
|
||||
var challengeEnd time.Time
|
||||
var challengeEnd *time.Time
|
||||
|
||||
func touchStartedFile() {
|
||||
if fd, err := os.Create(startedFile); err == nil {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import (
|
|||
)
|
||||
|
||||
func SubmissionHandler(w http.ResponseWriter, r *http.Request, team string, sURL []string) {
|
||||
if time.Now().After(challengeEnd) {
|
||||
if challengeEnd != nil && time.Now().After(*challengeEnd) {
|
||||
http.Error(w, "{\"errmsg\":\"Vous ne pouvez plus soumettre, le challenge est terminé.\"}", http.StatusGone)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
import { settings, time } from '$lib/stores/settings.js';
|
||||
</script>
|
||||
|
||||
{#if $settings}
|
||||
{#if $settings && $settings.end}
|
||||
{#if $settings.end - $settings.start > 0}
|
||||
<div
|
||||
class="clock display-2 text-end text-md-center"
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
{:else}
|
||||
<div class="d-flex h-100 justify-content-center align-items-center">
|
||||
<h1 class="display-3 m-0">
|
||||
Challenge forensic
|
||||
{$challengeInfo.title}
|
||||
</h1>
|
||||
</div>
|
||||
{/if}
|
||||
|
|
|
|||
Reference in a new issue