elfinder/alpine/custom/app/session.php

22 lines
444 B
PHP

<?php
switch ($_GET['mode']) {
case 'login':
$user = $_POST['user'];
$pass = $_POST['pass'];
if ($user == getenv('ELFINDER_USER') && $pass == getenv('ELFINDER_PASS')) {
session_start();
$_SESSION['loggedin'] = true;
header('Location: index.php');
} else {
header('Location: login.html');
}
break;
case 'logout':
unset($_SESSION['loggedin']);
header('Location: login.html');
break;
default:
header('Location: login.html');
}