elfinder/alpine/custom/app/session.php

22 lines
444 B
PHP
Raw Normal View History

2019-07-23 19:56:52 +00:00
<?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');
}