Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 2175

General Questions/New to Joomla! 4.x • Custom php for index.php

$
0
0
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:

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;   }
But when I place it on index.php in Joomla I am getting error 500, how can I use it ?

Statistics: Posted by azimfeta — Tue Nov 26, 2024 8:05 am



Viewing all articles
Browse latest Browse all 2175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>