cleanup stuff
This commit is contained in:
parent
f542656bc9
commit
66300ccd71
4 changed files with 12 additions and 2 deletions
|
@ -202,6 +202,10 @@ iframe {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header a.leave {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.clickie {
|
.clickie {
|
||||||
width: min-content;
|
width: min-content;
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
|
|
|
@ -7,7 +7,7 @@ page_header();
|
||||||
if (!is_null($username)) {
|
if (!is_null($username)) {
|
||||||
//comments("root","root");
|
//comments("root","root");
|
||||||
}
|
}
|
||||||
if (!($_GET['page'] > 0)) { ?>
|
if (!($_GET['page'] > 0) && is_null($username)) { ?>
|
||||||
<div class="banner"><img class="banner-background" src="/img/newlogo.svg">
|
<div class="banner"><img class="banner-background" src="/img/newlogo.svg">
|
||||||
<div class="banner-content">
|
<div class="banner-content">
|
||||||
<h1>BiglyChat</h1>
|
<h1>BiglyChat</h1>
|
||||||
|
|
|
@ -44,6 +44,12 @@ function post_handler()
|
||||||
$stmt = $db->prepare("INSERT INTO main.auth (username, password) VALUES (?, ?)");
|
$stmt = $db->prepare("INSERT INTO main.auth (username, password) VALUES (?, ?)");
|
||||||
$stmt->execute([$user,$hashed]);
|
$stmt->execute([$user,$hashed]);
|
||||||
|
|
||||||
|
$token = bin2hex(random_bytes(32));
|
||||||
|
$stmt = $db->prepare("INSERT INTO main.token (username, token) VALUES (?, ?)");
|
||||||
|
$stmt->execute([$user,$token]);
|
||||||
|
|
||||||
|
setcookie("token", $token, time() + 3600 * 24);
|
||||||
|
|
||||||
header("Location: /");
|
header("Location: /");
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ function page_header()
|
||||||
<a href="/user.php?id=<?php echo $username ?>"><img class="header-img header-link" src="/pfp/<?php echo $username ?>.png">Wall</a>
|
<a href="/user.php?id=<?php echo $username ?>"><img class="header-img header-link" src="/pfp/<?php echo $username ?>.png">Wall</a>
|
||||||
<a href="/notif.php"> <img class="header-img header-link" src="/img/mail.svg"><span>Mail<sub> <?php echo $edge?></sub></span></a>
|
<a href="/notif.php"> <img class="header-img header-link" src="/img/mail.svg"><span>Mail<sub> <?php echo $edge?></sub></span></a>
|
||||||
<a href="/stats.php?username=<?php echo $username ?>"><img class="header-img header-link" src="/img/home.svg">Users</a>
|
<a href="/stats.php?username=<?php echo $username ?>"><img class="header-img header-link" src="/img/home.svg">Users</a>
|
||||||
<a href="/logout.php"><img class="header-img header-link" src="/img/logout.svg">Leave</a>
|
<a href="/logout.php" class='leave'><img class="header-img header-link" src="/img/logout.svg">Leave</a>
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<a href="/login.php"><img class="header-img header-link" src="/img/home.svg">Join</a>
|
<a href="/login.php"><img class="header-img header-link" src="/img/home.svg">Join</a>
|
||||||
<a href="/stats.php"><img class="header-img header-link" src="/img/home.svg">Users</a>
|
<a href="/stats.php"><img class="header-img header-link" src="/img/home.svg">Users</a>
|
||||||
|
|
Loading…
Reference in a new issue