I've got a helper script for a Joomla 1.0 module I'm developing. I'm using it to perform AJAX tasks (reading and writing to the database, returning JSON), so I need to stop Joomla outputting its headers and whatnot.
I've got around this so far by hacking together some code to do the necessary includes to set up the database connection, etc:
define( '_VALID_MOS', 1 );
require_once '../globals.php';
require_once '../configuration.php';
require_once '../includes/joomla.php';
The only problem is that the $my
variable (the mos_user
object for the current user) is not being created.
How do I create this user? What file do I need to include?