2020-04-27 23:27:39 +02:00
|
|
|
<?php
|
2020-05-02 12:06:45 +02:00
|
|
|
require_once 'ui.php';
|
2020-11-13 18:57:47 +01:00
|
|
|
if($user->authenticated) {
|
|
|
|
$tools->redirect("list.php");
|
2020-04-27 23:27:39 +02:00
|
|
|
}
|
2020-09-02 17:31:41 +02:00
|
|
|
$error = false;
|
2020-11-13 18:57:47 +01:00
|
|
|
if(isset($_POST['name']) & isset($_POST['password'])) {
|
|
|
|
$login = $user->login($_POST['name'], $_POST['password'], isset($_POST["remember_me"]));
|
|
|
|
if($login===true) {
|
|
|
|
$tools->redirect("list.php");
|
|
|
|
} else {
|
|
|
|
$error = $login;
|
|
|
|
bdump($error);
|
|
|
|
}
|
2020-04-27 23:27:39 +02:00
|
|
|
}
|
2020-11-13 18:57:47 +01:00
|
|
|
loadtemplate('index.html', ['error' => $error, 'title' => t('Login', false)], false);
|