diff --git a/lib/account.php b/lib/account.php
index 6eeea8e..dd03015 100644
--- a/lib/account.php
+++ b/lib/account.php
@@ -10,13 +10,14 @@ function isLoggedIn(): bool
function setDefaultSessionData(): void
{
+ global $routerConfig;
$_SESSION["ID"] = 0;
$_SESSION["first_name"] = "";
$_SESSION["last_name"] = "";
$_SESSION["nickname"] = "";
$_SESSION["email"] = "";
$_SESSION["mcnick"] = "";
- $_SESSION["privilegelevel"] = 0;
+ $_SESSION["privilegelevel"] = $routerConfig["logged_out_permission_level"];
}
function generateActivationToken(): string
@@ -202,7 +203,7 @@ function addActivationCodes($count): array
$activationCodes = [];
if (is_numeric($count) && $count > 0 && $_SESSION["privilegelevel"] >= $routerConfig["user_admin_permission_level"]) {
- $stmt = $mysqli->prepare("UPDATE Users SET ActivationCode = ?, CreatedAt = NOW(), CreatedBy = ? WHERE ID = ?");
+ $stmt = $mysqli->prepare("UPDATE Users SET ActivationToken = ?, CreatedAt = NOW(), CreatedBy = ? WHERE ID = ?");
for ($i = 0; $i < $count; $i++) {
$activationCode = generateActivationToken();
@@ -251,7 +252,7 @@ function listActivationCodes(): array
if ($_SESSION["privilegelevel"] >= $routerConfig["user_admin_permission_level"]) {
$activationCodes = [];
- $result = $mysqli->query("SELECT Code, CreatedAt, CreatedBy FROM Users");
+ $result = $mysqli->query("SELECT ActivationToken, CreatedAt, CreatedBy FROM Users");
// Check if the query executed successfully
if ($result) {
diff --git a/lib/config.php b/lib/config.php
index 9acf7be..81f2f31 100644
--- a/lib/config.php
+++ b/lib/config.php
@@ -15,15 +15,15 @@
$routerConfig["protocol"] = "https://";
- $routerConfig["logged_out_permission_level"] = 0;
+ $routerConfig["logged_out_permission_level"] = 1;
- $routerConfig["logged_in_default_permission_level"] = 1;
+ $routerConfig["logged_in_default_permission_level"] = 2;
- $routerConfig["verified_permission_level"] = 2;
+ $routerConfig["verified_permission_level"] = 3;
- $routerConfig["trustworthy_permission_level"] = 3;
+ $routerConfig["trustworthy_permission_level"] = 4;
- $routerConfig["moderator_permission_level"] = 4;
+ $routerConfig["moderator_permission_level"] = 5;
$routerConfig["user_admin_permission_level"] = 254;
diff --git a/pages/global/account.php b/pages/global/account.php
index 19a71d3..630e3c4 100644
--- a/pages/global/account.php
+++ b/pages/global/account.php
@@ -4,7 +4,7 @@ require_once "lib/router.php";
function get_parameters():array
{
- return ["minimal_permission_level" => 0, "secret" => "no", "page_title" => "Domov"];
+ return ["minimal_permission_level" => 1, "secret" => "no", "page_title" => "Domov"];
}
function render(): string
diff --git a/pages/home/domov.html b/pages/home/domov.html
index 5ee66e9..cfb87d5 100644
--- a/pages/home/domov.html
+++ b/pages/home/domov.html
@@ -1,4 +1,4 @@
-
+