Skip to content
This repository has been archived by the owner on Oct 27, 2024. It is now read-only.

Commit

Permalink
✅ Added missing checks (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
anditv21 committed Sep 23, 2024
1 parent b449edc commit f20662a
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/admin/bans.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
$admin = new AdminController();
Session::init();

if (!Session::isLogged()) {
Util::redirect('/auth/login.php');
}
// Fetch user data
$userList = $admin->getUserArray();
$bannedUserList = $admin->getbannedArray();
Expand Down
4 changes: 4 additions & 0 deletions src/admin/codes.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
$admin = new AdminController();
Session::init();

if (!Session::isLogged()) {
Util::redirect('/auth/login.php');
}

// Get session username
$username = Session::get("username");

Expand Down
4 changes: 4 additions & 0 deletions src/admin/gift.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
$admin = new AdminController();
Session::init();

if (!Session::isLogged()) {
Util::redirect('/auth/login.php');
}

// Get session username and user list
$username = Session::get("username");
$userList = $admin->getUserArray();
Expand Down
6 changes: 5 additions & 1 deletion src/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@

Session::init();

Util::adminCheck();
if (!Session::isLogged()) {
Util::redirect('/auth/login.php');
}

$username = Session::get("username");
$uid = Session::get("uid");

$sub = $user->getSubStatus();

Util::banCheck();
Util::checktoken();
Util::suppCheck();
Util::head("Admin Panel");

// Handle POST request
Expand Down
4 changes: 4 additions & 0 deletions src/admin/ip_whitelist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
$admin = new AdminController();
Session::init();

if (!Session::isLogged()) {
Util::redirect('/auth/login.php');
}

// Security checks and page setup
Util::banCheck();
Util::checktoken();
Expand Down
3 changes: 3 additions & 0 deletions src/admin/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
$admin = new AdminController();

Session::init();
if (!Session::isLogged()) {
Util::redirect('/auth/login.php');
}

$userList = $admin->getUserArray();
$username = Session::get('username');
Expand Down
3 changes: 3 additions & 0 deletions src/admin/userinvites.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
$admin = new AdminController();

Session::init();
if (!Session::isLogged()) {
Util::redirect('/auth/login.php');
}

$username = Session::get("username");

Expand Down
3 changes: 3 additions & 0 deletions src/admin/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
$admin = new AdminController();
Session::init();

if (!Session::isLogged()) {
Util::redirect('/auth/login.php');
}
// Get session username and user list
$username = Session::get("username");
$userList = $admin->getUserArray();
Expand Down
4 changes: 4 additions & 0 deletions src/auth/logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

Session::init();

if (!Session::isLogged()) {
Util::redirect('/auth/login.php');
}

$user = new UserController();
$user->logoutUser();

Expand Down
4 changes: 3 additions & 1 deletion src/user/userlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@


Session::init();

if (!Session::isLogged()) {
Util::redirect('/auth/login.php');
}

$username = Session::get("username");
$uid = Session::get("uid");
Expand Down

0 comments on commit f20662a

Please sign in to comment.