/home/techb158/workloadmatch.com
Edit: /home/techb158/workloadmatch.com/index.php (3080B)
'Master',
'manager_profile' => 'Manager',
'teacher_profile' => 'Teacher',
'admin_profile' => 'Admin',
];
$dir = $dirMap[$userType] ?? null;
// When a Master is managing a specific Manager, route to Manager pages
if ($userType === 'master_profile' && !empty($_SESSION['manage_as'])) {
$dir = 'Manager';
}
// Allow override via ?as= parameter for cross-role loading (iframes, etc.)
$asParam = $_GET['as'] ?? null;
if ($asParam && in_array($asParam, ['Master', 'Manager', 'Teacher', 'Admin'])) {
$asDirMap = array_flip($dirMap);
$asRole = $asDirMap[$asParam] ?? null;
if ($asRole) {
if ($userType === 'admin_profile') {
$dir = $asParam;
}
elseif ($userType === 'master_profile' && in_array($asParam, ['Master', 'Manager'])) {
$dir = $asParam;
}
}
}
if ($dir) {
$pageFile = __DIR__ . '/' . $dir . '/' . $page . '.php';
if (file_exists($pageFile)) {
define('ROUTER_ACTIVE', true);
define('ROLE_DIR', $dir);
chdir(__DIR__ . '/' . $dir);
include $pageFile;
exit;
}
}
// 404
http_response_code(404);
echo '
Page Not Found
The requested page is not available.
';