Skip to content

Commit 9845991

Browse files
authored
Merge pull request #1147 from itflow-org/new-admin-check
Implement new admin check
2 parents 77b3eca + fe94036 commit 9845991

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

inc_all_admin.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66

77
require_once "check_login.php";
88

9-
validateAdminRole();
10-
11-
// TODO: Change this to enforceAdminPermission();
12-
// We can't do this until everyone has the new database fields added in db 1.4.9 on Sept 14th 2024
9+
if (!isset($session_is_admin) || !$session_is_admin) {
10+
exit(WORDING_ROLECHECK_FAILED . "<br>Tell your admin: Your role does not have admin access.");
11+
}
1312

1413
require_once "header.php";
1514

top_nav.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ class="d-none d-md-inline dropdown-toggle"><?php echo stripslashes(nullable_html
161161
</li>
162162
<!-- Menu Footer-->
163163
<li class="user-footer">
164-
<?php if ($session_user_role == 3) { ?>
165-
<a href="admin_user.php" class="btn btn-default btn-block btn-flat mb-2"><i class="fas fa-user-shield mr-2"></i>Administration</a>
164+
<?php if ($session_is_admin) { ?>
165+
<a href="admin_user.php" class="btn btn-default btn-block btn-flat mb-2"><i class="fas fa-user-shield mr-2"></i>Administration</a>
166166
<?php } ?>
167167
<a href="user_details.php" class="btn btn-default btn-flat"><i class="fas fa-user-cog mr-2"></i>Account</a>
168168
<a href="post.php?logout" class="btn btn-default btn-flat float-right"><i class="fas fa-sign-out-alt mr-2"></i>Logout</a>

0 commit comments

Comments
 (0)