<?php
/*
######################      CWB      #######################
############################################################
CWB PRO			$Name: release_version1_0_03112006 $
Revision		$Revision: 1.2 $
Author			$Author: zelteto $
Created 03/01/03        $Date: 2006/10/23 15:55:49 $
Writed by               GraFX (webmaster@grafxsoftware.com)
Scripts Home:           http://www.grafxsoftware.com
############################################################
*/
	include_once("../config.inc.php");
	include_once(INDEX_PATH."cls_fast_template.php");
	include_once(INCLUDE_PATH."connection.php");
	include_once(INCLUDE_ADMIN_PATH."authenticate.php");
	include_once(INCLUDE_ADMIN_PATH."cls_products.php");
	include_once(INCLUDE_LANGUAGE_PATH.$LANG.".inc.php");
	include_once(INCLUDE_LANGUAGE_PATH.$LANG.".admin.inc.php");
	include_once(INCLUDE_ADMIN_PATH."menuleft.inc.php");
	include_once(INCLUDE_ADMIN_PATH."menuright.inc.php");
	include_once(INCLUDE_ADMIN_PATH."addon.inc.php");
	include_once(INCLUDE_PATH."cls_string.php");
		
	$stringutil = new String("nope");
	$all_url_vars = array();
	$all_url_vars = $stringutil->parse_all();
	
	// begin authenticate part
	if(AUTH_TYPE == 1)
	{
		if (!$AUTHENTICATE)
		{
			 header( "WWW-Authenticate: Basic realm=\"ADMIN ".CONF_SITE_NAME."\"");
			 header( "HTTP/1.0 401 Unauthorized");
			 $ft = new FastTemplate(ADMIN_TEMPLATE_CONTENT_PATH);
			 $ft->define(array("main"=>"template_firstpage.html", "content"=>"authentication_failed.html"));
			 $ft->assign("ADMIN_URL", ADMIN_URL);
			 $ft->assign("VERSION", VERSION );
			 $ft->assign("ADDON","<br /><br />");
			 $ft->multiple_assign_define("LANG_");
			 $ft->multiple_assign_define("CONF_");	
			 $ft->parse("BODY", array("content","main"));
			 $ft->showDebugInfo(ERROR_DEBUG);
			 $ft->FastPrint();
			 exit;
		}
	}
	else if(AUTH_TYPE == 2)
	{
		include_once(INCLUDE_PATH.'cls_session.php');
		$sess = new MYSession();
		//session_regenerate_id();
		if (!$sess->get(SESSION_ID)) 
		{
			$sess->set('session_url_before',$_SERVER['REQUEST_URI']);
			header("Location: login.php"); 
			exit;                 
		}
	}// end authenticate part
	phpinfo();
?>