<?php
session_start();
header("Content-Security-Policy: default-src 'self' localhost:*; font-src 'self' https://www.nerdfonts.com/assets/fonts/Symbols-2048-em%20Nerd%20Font%20Complete.woff2; style-src 'self' 'unsafe-inline' https://nerdfonts.com/assets/css/webfont.css https://www.nerdfonts.com/assets/css/webfont.css; script-src 'self' 'unsafe-inline'; img-src 'self';");

require_once 'functions/vendor/autoload.php';
$dotenv = Dotenv\Dotenv::createImmutable('/home/jashton/dev/me/weave.space/.env');
$dotenv->safeLoad();

require_once 'functions/db.php';
require_once 'functions/core.php';
require_once 'functions/user.php';
require_once 'functions/post.php';
require_once 'functions/space.php';

/**/
// Set SESSION variable.
if (!isset($_SESSION['initialized'])) {
    $_SESSION['initialized'] = true;
    $_SESSION['theme'] = 'dark';
} else if (isset($_POST['theme'])) {
    $_SESSION['theme'] = $_POST['theme'];
    unset($_POST['theme']);
}

define('owner', 1);
define('developer', 2);
define('user', 3);
