When I switch over to PHP7 this stops working.
I am using Gantry and when I click on the link from the menu to load the homemade program (the link in the menu is purely a link to direct php file) I get:
Failed to load 'rt_xenon' template: Please install Gantry 5 Framework!
The file I am linking to calls 2 php files (below). If I comment out the calling of the two files the program loads fine. If I put them back in I get the problem.
I'm thinking that the code is not compatible with 7.1 but I don't know what it should be. I would have been on early Joomla 3 so perhaps something has been updated?
Further testing is showing that the issue seems to be with the getauthgroup file. If I leave in joomla-auth.php it continues to load fine but adding in the bottom file causes the issue.
Can anyone help?
joomla-auth.php
Code: Select all
<?php
session_start();
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__));
define( 'DS', DIRECTORY_SEPARATOR );
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
/* Create the Application */
$mainframe =& JFactory::getApplication('site');
/* Make sure we are logged in at all. */
if (JFactory::getUser()->id == 0)
die("Access denied: login required.");
?>
Code: Select all
<?php
session_start();
include 'joomla-auth.php';
$user = JFactory::getUser();
$db = JFactory::getDBO();
$db->setQuery($db->getQuery(true)
->select('*')
->from("#__usergroups")
);
$groups=$db->loadRowList();
$userGroups = $user->groups;
$return=array();
foreach ($groups as $key=>$g){
if (array_key_exists($g[0],$userGroups)) array_push($return,$g[4]);
}
$groups=$return;
/////printing groupnames for current user/////////////
?>