Compare commits

...
5 changed files with 15 additions and 24 deletions

No files matched your search

+7 -3
View File
@@ -31,11 +31,11 @@ main {
color: #ffffff; color: #ffffff;
} }
p, h1, h2, input, textarea, select, button, a, table { p, h1, h2, h3, input, textarea, select, button, a, table, label {
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;
} }
h1, h2 { h1, h2, h3 {
font-weight: 500; font-weight: 500;
} }
@@ -55,7 +55,11 @@ h2, header.small h1 {
font-size: 24px; font-size: 24px;
} }
p, h2 { h3 {
font-size: 18px;
}
p, h2, h3 {
line-height: 150%; line-height: 150%;
} }
-10
View File
@@ -75,16 +75,6 @@ div.mapItem>div.buttonContainer {
grid-auto-flow: column; grid-auto-flow: column;
} }
#restrictions {
margin-top: 1em;
margin-bottom: 1em;
font-family: 'Roboto', sans-serif;
}
#restrictions h3 {
font-weight: 500;
}
#restrictions input { #restrictions input {
height: auto; height: auto;
margin: 0.5em; margin: 0.5em;
+4 -5
View File
@@ -112,11 +112,10 @@ class GameController implements ISecured
public function createNewChallenge(): IContent public function createNewChallenge(): IContent
{ {
// create Challenge // create Challenge
$challengeToken = rand(); do {
while ($this->challengeRepository->getByToken($challengeToken)) { // initiliaze or if a challenge with the same token already exists
// if a challenge with the same token already exists $challengeToken = mt_rand();
$challengeToken = rand(); } while ($this->challengeRepository->getByToken($challengeToken));
}
$challenge = new Challenge(); $challenge = new Challenge();
$challenge->setToken($challengeToken); $challenge->setToken($challengeToken);
+2 -4
View File
@@ -57,10 +57,8 @@ class UserInChallengeRepository
} }
// validate token string // validate token string
foreach (str_split($token_str) as $char) { if (!ctype_xdigit($token_str)) {
if (!(('0' <= $char && $char <= '9') || ('a' <= $char && $char <= 'f'))) { return null;
return null;
}
} }
// convert token to int // convert token to int
$token = hexdec($token_str); $token = hexdec($token_str);
+2 -2
View File
@@ -43,7 +43,7 @@ TODO: condition!
<p class="bold center marginTop marginBottom">OR</p> <p class="bold center marginTop marginBottom">OR</p>
--> -->
<div id="restrictions"> <div id="restrictions" class="marginTop marginBottom">
<h3>Optional restrictions</h3> <h3>Optional restrictions</h3>
<div> <div>
<div> <div>
@@ -54,7 +54,7 @@ TODO: condition!
<input type="range" id="timeLimit" name="timeLimit" min="10" max="1800" step="10" value="300" /> <input type="range" id="timeLimit" name="timeLimit" min="10" max="1800" step="10" value="300" />
</div> </div>
<div id="timeLimitType"> <div id="timeLimitType">
Time limit <label>Time limit</label>
<input type="radio" id="timeLimitTypeGame" name="timeLimitType" value="game" checked /> <input type="radio" id="timeLimitTypeGame" name="timeLimitType" value="game" checked />
<label for="timeLimitTypeGame">for the whole game</label> <label for="timeLimitTypeGame">for the whole game</label>
<input type="radio" id="timeLimitTypeRound" name="timeLimitType" value="round" /> <input type="radio" id="timeLimitTypeRound" name="timeLimitType" value="round" />