<?php
// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );

	global $database,$mainframe,$mosConfig_live_site,$my;

	$query = "SELECT * from #__modules where module='mod_jsecure_authentication'";
	$database->setQuery($query);
	$getData = $database->loadObjectList();
	
	$params = new mosParameters( $getData[0]->params, $mainframe->getPath( 'mod_xml', 'mod_jsecure_authentication' ), 'module' );

	if($params->get('key') != $_SERVER['QUERY_STRING']){
		$path  = $mosConfig_live_site;
		$path .= $params->get('options') == 1 ? '/'.$params->get('custom_path') : '';
		mosRedirect ($path);
	} 

?>