Knowledgebase: Web Hosting Related
How do I enable your web site acceleration service with Joomla?
Posted by Support, Last modified by Support on 10 May 2013 03:01 PM

Our software configuration makes use of a custom HTTP header to determine whether some user is logged in or not inside Joomla. To allow this do one of the two following options.

1. Simply append this code below in the "function onAfterInitialise(){ ... } function, right after "$user= JFactory::getUser();" in the Joomla cache plugin php file located at /plugins/system/cache/cache.php

if (!$user->guest) {
    JResponse::setHeader('X-Logged-In', 'True', true);
} else {
    JResponse::setHeader('X-Logged-In', 'False', true);
}

Finally, enable this plugin via the Joomla backend.

 

2. If you don't want to use the cache plugin, add this code to your template's index.php file (usually after the line jimport('joomla.filesystem.file');):

// Set user state in headers
$user = JFactory::getUser();
if (!$user->guest) {
    JResponse::setHeader('X-Logged-In', 'True', true);
} else {
    JResponse::setHeader('X-Logged-In', 'False', true);
}

(0 vote(s))
Helpful
Not helpful