Greetings,
I have an Joomla on a virtual machine on our internal network and I wato to limit access to the joomla folder for specific user as part of another system.
I have tried implementing this code:But when I place it on index.php in Joomla I am getting error 500, how can I use it ?
I have an Joomla on a virtual machine on our internal network and I wato to limit access to the joomla folder for specific user as part of another system.
I have tried implementing this code:
Code:
include '../config.php';include_once '../roles.php'; $requiredRoles = ['Admin']; $hasAccess = false; foreach ($requiredRoles as $requiredRole) { if (userHasRole($userRoles, $requiredRole)) { $hasAccess = true; break; } } if (!$hasAccess) { header('Location: ../403.php'); exit; }
Statistics: Posted by azimfeta — Tue Nov 26, 2024 8:05 am