mirror of
https://github.com/ellite/Wallos.git
synced 2026-04-17 05:28:40 -04:00
31 lines
714 B
PHP
31 lines
714 B
PHP
<?php
|
|
|
|
$databaseFile = '../../db/wallos.db';
|
|
$db = new SQLite3($databaseFile);
|
|
$db->busyTimeout(5000);
|
|
|
|
if (!$db) {
|
|
die('Connection to the database failed.');
|
|
}
|
|
|
|
require_once 'i18n/languages.php';
|
|
require_once 'i18n/getlang.php';
|
|
require_once 'i18n/' . $lang . '.php';
|
|
|
|
$secondsInMonth = 30 * 24 * 60 * 60;
|
|
if (session_status() === PHP_SESSION_NONE) {
|
|
session_set_cookie_params([
|
|
'lifetime' => $secondsInMonth,
|
|
'httponly' => true,
|
|
'samesite' => 'Lax'
|
|
]);
|
|
session_start();
|
|
}
|
|
|
|
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
|
|
$userId = $_SESSION['userId'];
|
|
} else {
|
|
$userId = 0;
|
|
}
|
|
|
|
?>
|