1
0

Functionnal chall

This commit is contained in:
2018-11-08 19:09:21 +01:00
commit f495725c81
9 changed files with 230 additions and 0 deletions

56
webroot/index.php Normal file
View File

@ -0,0 +1,56 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Authentication 2.0</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Bitter" rel="stylesheet">
</head>
<body>
<div class="box">
<?php if ($_SERVER['REQUEST_METHOD'] != 'POST') { ?>
<div class="code red">
<h1><?php echo $_SERVER['REQUEST_METHOD']; ?></h1>
</div>
<div class="sub grey">
<h2>Send your username for authentication.</h2>
</div>
<?php } else { ?>
<div class="code green">
<h1>POST</h1>
</div>
<?php if (!isset($_POST['username'])) { ?>
<div class="sub red">
<h2>What is your username?</h2>
</div>
<?php
} else {
$username = htmlspecialchars($_POST['username']);
if ($username === 'admin') {
?>
<div class="sub">
<h2 class="blue">Hello admin</h2>
<h3 class="grey">IMTLD{Y0u_H4v3_t0_st4rT_s0m3Wh3r3}</h3>
</div>
<?php } else { ?>
<div class="sub">
<h2 class="blue">Hello <?php echo $username; ?></h2>
<h3 class="red">You don't have the permission to see anything.</h3>
</div>
<?php }}} ?>
</div>
</body>
</html>

56
webroot/style.css Normal file
View File

@ -0,0 +1,56 @@
html,
body {
margin: 0;
padding: 0;
display: grid;
place-items: center;
height: 100vh;
font-family: 'Bitter', serif;
}
.box {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.code {
font-size: 40px;
}
.sub {
text-align: center;
}
.sub h2 {
font-size: 26px;
}
.sub h3 {
font-size: 20px;
}
.red {
color: #f44336;
}
.orange {
color: #FF5722;
}
.green {
color: #4CAF50;
}
.blue {
color: #2196F3;
}
.violet {
color: #9C27B0;
}
.grey {
color: #546E7A;
}