diff --git a/docs/css/main.css b/docs/css/main.css index 99edeba..22955cf 100755 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -202,6 +202,10 @@ iframe { justify-content: center; } +.header a.leave { + margin-left: auto; +} + .clickie { width: min-content; margin-top: 40px; diff --git a/docs/index.php b/docs/index.php index 2c12284..1ea5085 100644 --- a/docs/index.php +++ b/docs/index.php @@ -4,25 +4,17 @@ require(__DIR__ . "/../libs/form.php"); require(__DIR__ . "/../libs/comment.php"); page_header(); -if (!is_null($username)) { - //comments("root","root"); -} -if (!($_GET['page'] > 0)) { ?> +if (!($_GET['page'] > 0) && is_null($username)) { ?>
diff --git a/docs/register.php b/docs/register.php index d99c4ed..004c402 100755 --- a/docs/register.php +++ b/docs/register.php @@ -44,6 +44,12 @@ function post_handler() $stmt = $db->prepare("INSERT INTO main.auth (username, password) VALUES (?, ?)"); $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: /"); die(); } diff --git a/libs/comment.php b/libs/comment.php index f3fb034..63ddbd4 100644 --- a/libs/comment.php +++ b/libs/comment.php @@ -32,18 +32,7 @@ function comments($typer, $idr, $disable = false) $qss['page'] = $page - 1; $qs_prev = http_build_query($qss); $qss['page'] = $page; - - $qss['mode'] = 'all'; - $qs_1 = http_build_query($qss); - - $qss['mode'] = 'followers'; - $qs_2 = http_build_query($qss); ?> - -