<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####


error_reporting(7);


//session_name('SID');
//session_start();
//phpinfo();
//print_r($GLOBALS);
//exit();

if (!isset($umgesetzt)) {

        $umgesetzt = true;



        if (is_array($_GET)) {

                foreach($_GET as $key => $val) {

                        if (!is_array($val)) {
                                if (get_magic_quotes_gpc()) $val = StripSlashes($val);
                                //$val = AddSlashes(StripSlashes($val));
                        }

                        $$key = $val;

                }

        } elseif (is_array($HTTP_GET_VARS)) {

                foreach($HTTP_GET_VARS as $key => $val) {

                        if (!is_array($val)) {
                                if (get_magic_quotes_gpc()) $val = StripSlashes($val);
                                //$val = AddSlashes(StripSlashes($val));
                        }

                        $$key = $val;

                }

        }



        if (is_array($_POST)) {

                foreach($_POST as $key => $val) {

                        if (!is_array($val)) {
                                if (get_magic_quotes_gpc()) $val = StripSlashes($val);
                                //$val = AddSlashes(StripSlashes($val));
                        }

                        $$key = $val;

                }

        } elseif (is_array($HTTP_POST_VARS)) {

                foreach($HTTP_POST_VARS as $key => $val) {

                        if (!is_array($val)) {
                                if (get_magic_quotes_gpc()) $val = StripSlashes($val);
                                //$val = AddSlashes(StripSlashes($val));
                        }

                        $$key = $val;

                }

        }



        if (is_array($_SERVER)) {

                foreach($_SERVER as $key => $val) {

                        $$key = $val;

                }

        } elseif (is_array($HTTP_SERVER_VARS)) {

                foreach($HTTP_SERVER_VARS as $key => $val) {

                        $$key = $val;

                }

        }



        unset($key, $val);

}

$PHP_AUTH_USER = $PHP_AUTH_PW = '';

include("../settings.inc.php");
include("../functions.inc.php");
include('../sessions.inc.php');

db_connect($db_host, $db_user, $db_pass);

sessao_start();

$id = db_query("SELECT login FROM admin");
$res = db_fetch_array($id);
if(isSUserLogged($res['login']))
{
	$PHP_AUTH_USER = $res['login'];
}

if(!$PHP_AUTH_USER)
{
	$_cat = 'reg';
	db_close;
	include('../loginform.php');
	exit();
}

## set language

$id = db_query("select language, postconf, business, checkupdates from admin");

$werte = db_fetch_array($id);

$shortlang = $werte["language"];
$postconf = $werte["postconf"];
$cbusiness = $werte["business"];
$checkupdates = $werte["checkupdates"];

$miscf = $shortlang."/misc.inc.php";

$langf = $shortlang."/admin.inc.php";

include("../languages/$miscf");

include("../languages/$langf");

## //


//*
if($id = db_query("select hostname from admin", false))
{
	$werte = db_fetch_array($id);
	if($werte['hostname'])
	{
		$hostname = $werte['hostname'];
	}
}
//*/

$strSkinName="/skins/skin_1";
$confixx_interface_version = 'xp30';
$id = db_query("SELECT custom_skins.path AS path, custom_skins.version AS version FROM skins INNER JOIN custom_skins ON (skins.skin_id = custom_skins.id) WHERE skins.cuser='admin'");
if(db_num_rows($id))
{
	$werte = db_fetch_array($id);
	$confixx_interface_version = $werte['version'];
	$strSkinName = $werte['path'];
}


if($confixx_interface_version == 'classic20')
{
	$strSkinName = '/admin/' . $strSkinName;
}
else 
{
	include_once('gui/module.GuiXP.php');
	$gui = new tGuiXP($strSkinName); // trailing slash !!!
}

db_close();

?>
