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 @@ - +

Vitaj na tejto úžasnej stránke

Neoficiálna študentská stránka pre adlerku

diff --git a/pages/memes/domov.html b/pages/memes/domov.html index 70df8ca..041f77a 100644 --- a/pages/memes/domov.html +++ b/pages/memes/domov.html @@ -1,4 +1,4 @@ - +

Adlerka Memes

Skoro ako r/adlerka - ale lepšie.

diff --git a/pages/memes/info.html b/pages/memes/info.html index d1bffb3..09f1709 100644 --- a/pages/memes/info.html +++ b/pages/memes/info.html @@ -1,2 +1,2 @@ - +

Vitaj na oficiálnej stránke Memeov o AdlerkaSMP

\ No newline at end of file diff --git a/pages/notes/domov.html b/pages/notes/domov.html index a046219..9e63fb2 100644 --- a/pages/notes/domov.html +++ b/pages/notes/domov.html @@ -1,4 +1,4 @@ - +

Adlerka Zošit


diff --git a/pages/smp/domov.html b/pages/smp/domov.html index b6484e4..996d81c 100644 --- a/pages/smp/domov.html +++ b/pages/smp/domov.html @@ -1,4 +1,4 @@ - +

Vitaj na oficiálnej AdlerkaSMP stránke

Najlepší Minecraft®™ server na Adlerke

diff --git a/pages/smp/info.html b/pages/smp/info.html index d877928..11686e8 100644 --- a/pages/smp/info.html +++ b/pages/smp/info.html @@ -1,2 +1,2 @@ - +

Vitaj na oficiálnej stránke Informácii o AdlerkaSMP

\ No newline at end of file