Skip to content
This repository was archived by the owner on May 4, 2025. It is now read-only.

Commit f20662a

Browse files
committed
✅ Added missing checks (#176)
1 parent b449edc commit f20662a

File tree

10 files changed

+36
-2
lines changed

10 files changed

+36
-2
lines changed

src/admin/bans.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
$admin = new AdminController();
1010
Session::init();
1111

12+
if (!Session::isLogged()) {
13+
Util::redirect('/auth/login.php');
14+
}
1215
// Fetch user data
1316
$userList = $admin->getUserArray();
1417
$bannedUserList = $admin->getbannedArray();

src/admin/codes.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
$admin = new AdminController();
1010
Session::init();
1111

12+
if (!Session::isLogged()) {
13+
Util::redirect('/auth/login.php');
14+
}
15+
1216
// Get session username
1317
$username = Session::get("username");
1418

src/admin/gift.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
$admin = new AdminController();
99
Session::init();
1010

11+
if (!Session::isLogged()) {
12+
Util::redirect('/auth/login.php');
13+
}
14+
1115
// Get session username and user list
1216
$username = Session::get("username");
1317
$userList = $admin->getUserArray();

src/admin/index.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@
1010

1111
Session::init();
1212

13-
Util::adminCheck();
13+
if (!Session::isLogged()) {
14+
Util::redirect('/auth/login.php');
15+
}
1416

1517
$username = Session::get("username");
1618
$uid = Session::get("uid");
1719

1820
$sub = $user->getSubStatus();
1921

2022
Util::banCheck();
23+
Util::checktoken();
24+
Util::suppCheck();
2125
Util::head("Admin Panel");
2226

2327
// Handle POST request

src/admin/ip_whitelist.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
$admin = new AdminController();
99
Session::init();
1010

11+
if (!Session::isLogged()) {
12+
Util::redirect('/auth/login.php');
13+
}
14+
1115
// Security checks and page setup
1216
Util::banCheck();
1317
Util::checktoken();

src/admin/password.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
$admin = new AdminController();
99

1010
Session::init();
11+
if (!Session::isLogged()) {
12+
Util::redirect('/auth/login.php');
13+
}
1114

1215
$userList = $admin->getUserArray();
1316
$username = Session::get('username');

src/admin/userinvites.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
$admin = new AdminController();
99

1010
Session::init();
11+
if (!Session::isLogged()) {
12+
Util::redirect('/auth/login.php');
13+
}
1114

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

src/admin/users.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
$admin = new AdminController();
99
Session::init();
1010

11+
if (!Session::isLogged()) {
12+
Util::redirect('/auth/login.php');
13+
}
1114
// Get session username and user list
1215
$username = Session::get("username");
1316
$userList = $admin->getUserArray();

src/auth/logout.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
Session::init();
66

7+
if (!Session::isLogged()) {
8+
Util::redirect('/auth/login.php');
9+
}
10+
711
$user = new UserController();
812
$user->logoutUser();
913

src/user/userlist.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99

1010
Session::init();
11-
11+
if (!Session::isLogged()) {
12+
Util::redirect('/auth/login.php');
13+
}
1214

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

0 commit comments

Comments
 (0)