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'; if (isset($_SESSION['user'])) { $tmp = unserialize($_SESSION['user'])->getSpaces(); foreach ($tmp as $s) $_SESSION['spaces'][] = serialize($s->getSpace()); } } else if (isset($_POST['theme'])) { $_SESSION['theme'] = $_POST['theme']; unset($_POST['theme']); } else { $_SESSION['theme'] = 'light'; } define('owner', 1); define('developer', 2); define('user', 3); if (isset($_SESSION['user']) && !isset($GLOBALS['spaces'])) { }