2020-04-27 23:27:39 +02:00
|
|
|
<?php
|
2020-05-02 12:06:45 +02:00
|
|
|
require_once 'ui.php';
|
2020-05-29 12:13:33 +02:00
|
|
|
if($user->authenticated()){
|
2020-04-27 23:27:39 +02:00
|
|
|
$tools->redirect("lista.php");
|
|
|
|
}
|
|
|
|
$errore = false;
|
2020-05-25 22:43:56 +02:00
|
|
|
if(isset($_POST['name']) & isset($_POST['password'])){
|
|
|
|
$login = $user->login($_POST['name'], $_POST['password']);
|
2020-04-27 23:27:39 +02:00
|
|
|
if($login===true){
|
|
|
|
$tools->redirect("lista.php");
|
|
|
|
} else {
|
|
|
|
$errore = $login;
|
2020-05-28 23:33:10 +02:00
|
|
|
bdump($errore);
|
2020-04-27 23:27:39 +02:00
|
|
|
}
|
|
|
|
}
|
2020-04-28 15:27:44 +02:00
|
|
|
loadtemplate('index.html', ['errore' => $errore, 'titolo' => 'Login'], false);
|