Skip to content

Commit

Permalink
Login now fully working
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbluethner committed May 20, 2019
1 parent f60fb6e commit c9e48af
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions checkLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
die();
} else {
$_SESSION['attempted'] = "n";
$sql = "SELECT password FROM users WHERE mail='$mail'";
$sql = "SELECT * FROM users WHERE mail='$mail'";
$result = $conn->query($sql);
while($row = $result->fetch_assoc()) {
if(strtolower($row["password"]) == hash('sha512',$password)) {
$_SESSION['login'] = 'user';
$_SESSION['usermail'] = $mail;
$_SESSION['username'] = $row["username"];
$_SESSION['username'] = $row['username'];
header("Location: dashboard.php");
die();
} else {
Expand Down
2 changes: 1 addition & 1 deletion dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<?php
ini_set('display_errors', 1);
ini_set('display_errors', 1);

session_start();
if($_SESSION['login'] != 'user') {
Expand Down
2 changes: 1 addition & 1 deletion plugins/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<body class="framebody">
<h1>Home</h1>
<div class="pane">
<h2>Welcome Username!</h2>
<h2>Welcome <?php print_r($_SESSION['username']) ?></h2>
<p class="contenttext">There are currently 4 Servers with a total of 13 Players</p>
</div>
<div class="pane" id="pane_servers">
Expand Down

0 comments on commit c9e48af

Please sign in to comment.