<?php
defined('JPATH_BASE') or die();
gantry_import('core.gantryfeature');
jimport('custom.ghost');
jimport('joomla.environment.browser');
class GantryFeatureWebshopRedirect extends GantryFeature {
var $_feature_name = 'webshopredirect';
function isEnabled() {
return true;
}
function isInPosition($position) {
return false;
}
function isOrderable() {
return true;
}
function init() {
global $gantry;
//Redundancy check for Scanner
$isHmi = stripos(JBrowser::getInstance()->getAgentString(), "AnkleScannerHmi");
if ((JRequest::getVar('scanner') == 1 && !empty($_GET['email']))) {
$email = JRequest::getVar('email');
$userClass = new scannerUser;
$user = $userClass->userCheck($email);
$userClass->process($user);
}
if ($user->exists) {
JFactory::getSession()->set('scanner', 1);
header("Location: " . $gantry->getCurrentUrl . "/shop2/scanner-login?tmpl=shopindex&scanner=1&login=" . $email);
} elseif ($isHmi) {
JFactory::getSession()->set('scanner', 1);
} elseif (JRequest::getVar('tmpl') != 'shopindex' && (JRequest::getVar('scanner') == 1 || JFactory::getSession()->get('scanner') == 1 )) {
JFactory::getSession()->set('scanner', 1);
//header("Location: " . $gantry->getCurrentUrl . "?tmpl=shopindex");
}
if (JRequest::getVar('scanner') == '0') {
JFactory::getSession()->set('scanner', 0);
}
}
}
Time to create page: 0.056 seconds