Skip to content

Commit 7690901

Browse files
committed
Add admin panel feature check to api
1 parent 9ceb2a9 commit 7690901

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

public/admin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
UdoitUtils::instance()->exitWithPageError("Missing Session information. Please refresh the page. Missing: {$key}");
3131
}
3232
}
33+
3334
// If the feature has been disabled, deny access.
3435
if (!$admin_panel_enabled) {
3536
UdoitUtils::instance()->exitWithPageError("This feature has been disabled. Please contact your UDOIT administrator.");

public/api/includes.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ function sanitize_id($data)
4949
}
5050
}
5151

52+
// If the feature has been disabled, deny access.
53+
if (!$admin_panel_enabled) {
54+
respond_with_error(403, 'This feature has been disabled. Please contact your UDOIT administrator.');
55+
}
56+
5257
// If Administrator is not found in the user's list of roles, kick them out with an error
5358
if (!$_SESSION['is_admin']) {
5459
// Set response to 403 (Forbidden)

0 commit comments

Comments
 (0)