mirror of
https://github.com/itflow-org/itflow
synced 2026-03-02 03:44:53 +00:00
Add comments to role validation functions for clarity
This commit is contained in:
@@ -474,6 +474,7 @@ function validateAdminRole() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validates a user is a tech (or admin). Stops page load and attempts to direct away from the page if not (i.e. user is an accountant)
|
||||||
function validateTechRole() {
|
function validateTechRole() {
|
||||||
if (!isset($_SESSION['user_role']) || $_SESSION['user_role'] == 1) {
|
if (!isset($_SESSION['user_role']) || $_SESSION['user_role'] == 1) {
|
||||||
$_SESSION['alert_type'] = "danger";
|
$_SESSION['alert_type'] = "danger";
|
||||||
@@ -483,6 +484,7 @@ function validateTechRole() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validates a user is an accountant (or admin). Stops page load and attempts to direct away from the page if not (i.e. user is a tech)
|
||||||
function validateAccountantRole() {
|
function validateAccountantRole() {
|
||||||
if (!isset($_SESSION['user_role']) || $_SESSION['user_role'] == 2) {
|
if (!isset($_SESSION['user_role']) || $_SESSION['user_role'] == 2) {
|
||||||
$_SESSION['alert_type'] = "danger";
|
$_SESSION['alert_type'] = "danger";
|
||||||
|
|||||||
Reference in New Issue
Block a user