Adds login and registration messages and configs
parent
06ffde67f4
commit
5d240b1dd8
|
@ -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',
|
||||
];
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
||||
?>
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
<?php
|
||||
|
||||
require_once 'classes/database.php';
|
||||
require 'classes/user.php';
|
||||
unset($error);
|
||||
// registration is allowed, go on
|
||||
if ($config['registration_enabled'] === true) {
|
||||
|
||||
try {
|
||||
require_once 'classes/database.php';
|
||||
require 'classes/user.php';
|
||||
unset($error);
|
||||
|
||||
try {
|
||||
$db = new Database($config['database']);
|
||||
$user = new User($db);
|
||||
|
||||
|
@ -24,11 +27,17 @@ try {
|
|||
exit();
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
}
|
||||
|
||||
include 'templates/block-message.php';
|
||||
include 'templates/form-register.php';
|
||||
|
||||
// registration disabled
|
||||
} else {
|
||||
$notice = 'Registration is disabled';
|
||||
include 'templates/block-message.php';
|
||||
}
|
||||
|
||||
include 'templates/block-message.php';
|
||||
include 'templates/form-register.php';
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue