forked from D-Big-B/DARP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signIn.php
69 lines (56 loc) · 2.38 KB
/
signIn.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
require_once("includes/config.php");
require_once("includes/classes/Account.php");
require_once("includes/classes/Constants.php");
require_once("includes/classes/FormSanitizer.php");
$account = new Account($con);
if(isset($_POST['submitButton'])) {
$username = FormSanitizer::sanitizeFormUsername($_POST['username']);
$password = FormSanitizer::sanitizeFormPassword($_POST['password']);
$wasSuccessful = $account->login($username, $password);
if($wasSuccessful == true) {
$_SESSION["userLoggedIn"] = $username;
header("Location: index.php");
}
}
function getInputValue($name) {
if(isset($_POST[$name])) {
echo $_POST[$name];
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>DARP</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/style.css">
<link href="assets/css/Font-Titillium-Web.css" rel="stylesheet">
<link rel="shortcut icon" type="image/x-icon" href="assets/images/icons/favicon.ico">
<!-- <link href="assets/css/Font-Product-Sans.css" rel="stylesheet"> -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
</head>
<body oncontextmenu='return false;'>
<div class="signInContainer">
<div class="column" >
<!-- style="background-color:rgb(18, 18, 18);" -->
<div class="header">
<img src="assets/images/icons/DARP.svg" title="logo" alt="Site logo">
<h3>Sign In</h3>
<span>to continue to DARP</span>
</div>
<div class="loginForm">
<form action="signIn.php" method="POST">
<?php echo $account->getError(Constants::$loginFailed);?>
<input type="text" class='form-control' name="username" placeholder="Username" value="<?php getInputValue('username');?>" autocomplete="off" required="true">
<input type="password" class='form-control' name="password" placeholder="Password" autocomplete="off" required="true">
<input type="submit" name="submitButton" value="SIGN IN">
</form>
</div>
<a class="signUpMessage" href="signUp.php">Need an account? Sign up here!</a>
</div>
</div>
</body>
</html>