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

General Questions/New to Joomla! 4.x • Re: External auth scripts

$
0
0
After a lot of debugging I believe I have it coded to support J4 however all I get is a blank page whether logged in or not.

Code:

<?phpuse Joomla\CMS\Factory;ini_set('display_errors', 1);error_reporting(E_ALL);// Assuming you're using Joomla 4, include necessary Joomla filesdefine('_JEXEC', 1);define('JPATH_BASE', __DIR__);// Load the Composer autoloaderrequire_once JPATH_BASE . '/libraries/vendor/autoload.php';// Start the Joomla application.$app = Factory::getApplication('site');defined('_JEXEC') or die;// Require Joomla framework filesrequire_once JPATH_BASE . '/libraries/vendor/defines.php';require_once JPATH_BASE . '/libraries/vendor/framework.php';echo "Before user check"; // Add this line for debugging// Make sure we are logged in.if (Factory::getUser()->id == 0) {    die("Access denied: login required.");}echo "After user check"; // Add this line for debugging

Statistics: Posted by Sc00by121 — Mon Feb 05, 2024 7:07 pm



Viewing all articles
Browse latest Browse all 2429

Trending Articles



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