<?php
/**
 * File to handle the logout
 *
 * By clicking the logout link by the logged in user this file will clear
 * the session and redirect the user to the login page with success message.
 *
 * PHP version 5.0
 *
 * @category	###Discuzz###
 * @package		###index###
 * @author 		anandaraj_088at09
 * @copyright	Copyright (c) 2009 - 2010 {@link http://www.agriya.com Agriya Infoway}
 * @license		http://www.agriya.com Agriya Infoway Licence
 * @version		SVN: $Id:
 * @since 		2010-06-23
 */
/**
 * File having common configuration variables required for the entire project
 */
class IndexHandler extends FormHandler
	{

		public function redirectToModuleIndex()
			{
				Redirect2URL(getUrl('index', '', '', '', $this->fields_arr['module']));
			}
   }
//<<<<<-------------- Class IndexHandler begins ---------------//
//-------------------- Code begins -------------->>>>>//
$indexhandler = new IndexHandler();
$indexhandler->setPageBlockNames(array('module_error'));
//form fields
$indexhandler->setFormField('module', $CFG['admin']['index']['anova_module']);
$indexhandler->sanitizeFormInputs($_REQUEST);
if($indexhandler->getFormField('module') != '')
	{
		if(in_array($CFG['admin']['index']['anova_module'], $CFG['site']['modules_arr']))
			$indexhandler->redirectToModuleIndex();
		else
			$indexhandler->setPageBlockShow('module_error');
	}
else
	{
		$indexhandler->setPageBlockShow('module_error');
	}
//<<<<<-------------------- Code ends ----------------------//
//--------------------Page block templates begins-------------------->>>>>//
//change th page id
$indexhandler->CFG['html']['page_id'] = 'indexdefault';
$CFG['html']['page_id'] = 'indexdefault';
//include the header file
$indexhandler->includeHeader();
//include the content of the page
setTemplateFolder('general/');
$smartyObj->display('index.tpl');
$indexhandler->includeFooter();
?>