Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logout functionality #43

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DB_DATABASE=
DB_HOST=
DB_USER=
DB_PASSWORD=
4 changes: 4 additions & 0 deletions includes/logout/log.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
session_start();
?>
<a href="logout.php">Logout</a>
8 changes: 8 additions & 0 deletions includes/logout/logout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php
session_start();
if(isset($_GET['logout'])) {
session_destroy($_SESSION['login']);
}
header("Location: login.php?");
?>

6 changes: 3 additions & 3 deletions public/css/styles.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
body {
font-family: Arial, sans-serif;
text-align: center;
background-color: grey;
background-color: purple;
}

form {
Expand All @@ -22,8 +22,8 @@ input {
}

button {
background-color: greenyellow;
color: white;
background-color: plum;
color: plum;
padding: 15px 20px;
border: none;
border-radius: 4px;
Expand Down
Binary file modified public/dashboard.php
Binary file not shown.
File renamed without changes
1 change: 0 additions & 1 deletion public/index.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
<?php

include "../config/config.php";
1 change: 0 additions & 1 deletion public/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<?php session_start(); ?>

<body class="bgpurple">

<?php
if (isset($_SESSION['unauthorized'])) { ?>
<div class="alert alert-danger mt-5">
Expand Down
25 changes: 25 additions & 0 deletions vendor/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit108be68e4e2b97fed51d36a10eed0849::getLoader();
Loading