Adds login and registration messages and configs

main
Yasen Pramatarov 2024-08-01 11:12:54 +03:00
parent 06ffde67f4
commit 5d240b1dd8
3 changed files with 45 additions and 29 deletions

View File

@ -5,6 +5,8 @@ $config = [
'folder' => '/jilo-web/',
'database' => '/home/yasen/work/code/git/lindeas-code/jilo-web/jilo-web.db',
'jilo_database' => '/home/yasen/work/code/git/lindeas-code/jilo/jilo.db',
'registration_enabled' => true,
'login_message' => '',
'version' => '0.1.1',
];

View File

@ -68,6 +68,11 @@ try {
$error = $e->getMessage();
}
if (!empty($config['login_message'])) {
$notice = $config['login_message'];
include 'templates/block-message.php';
}
include 'templates/form-login.php';
?>

View File

@ -1,5 +1,8 @@
<?php
// registration is allowed, go on
if ($config['registration_enabled'] === true) {
require_once 'classes/database.php';
require 'classes/user.php';
unset($error);
@ -31,4 +34,10 @@ try {
include 'templates/block-message.php';
include 'templates/form-register.php';
// registration disabled
} else {
$notice = 'Registration is disabled';
include 'templates/block-message.php';
}
?>