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

include_once("auth.php");

db_connect($db_host, $db_user, $db_pass);
/*
$id = db_query("select kunde from pop3 where account = '$PHP_AUTH_USER'");
$werte = db_fetch_array($id);
$kunde = $werte["kunde"];
$id = db_query("select webmail from kunden where kunde = '$kunde'");
$werte = db_fetch_array($id);
$webmail = $werte["webmail"];

$id2 = db_query("select maxautoresponder from kunden where kunde = '$kunde'");
$id = db_query("select count(ident) as autoresponder from autoresponder where kunde = '$kunde'");
$werte = db_fetch_array($id2);
$maxautoresponder = $werte["maxautoresponder"];
$werte = db_fetch_array($id);
$autoresponder = $werte["autoresponder"];
//*/
?>
<HTML>
<HEAD>
<META content="text/html; charset=<? echo $lang_html_charset; ?>" http-equiv=Content-Type>
<LINK href="<?=$strSkinName?>/style.css" rel=stylesheet type=text/css>
</HEAD>
<BODY bgColor=#ffffff bottomMargin=0 leftMargin=0 topMargin=0 MARGINHEIGHT="0" MARGINWIDTH="0">
<table width="90%" cellpadding="0" cellspacing="1" border=0>
<tr heigth = "1"></tr>

<? function menu($seite,$text,$strSkinName) {
?>
<tr>
<td class="menucolor">
<a href="<?=$seite?>" target=content class="menu" onclick="top.fraToolbar.location.href = 'toolbar.php?text=<? echo urlencode(ltext("$text")); ?>'";>
<IMG src="<?=$strSkinName?>/pics/alpha.gif" width=4 height=12 border=0>
<IMG src="<?=$strSkinName?>/pics/arrow.gif" width=12 height=9 border=0><? echo ltext($text); ?>
</a>
</td>
</tr>
<? }

if ($num == 1)
{
$bar=urlencode(ltext("m_overview"));
$content="allgemein_start.php";

menu("allgemein_start.php","m_overview",$strSkinName);
menu("allgemein_pwaendern.php","mpop_changepw",$strSkinName);
menu("allgemein_sprache.php","mpop_selectlanguage",$strSkinName);
//if (($autoresponder > 0) || ($maxautoresponder != 0))
//{
//menu("email_autoresponder.php","me_autoresponder",$strSkinName);
//}
}
if ($num == 2)
{
$bar=urlencode(ltext("m_postfach"));
$content="email_postfach.php";
}
if ($num == 3)
{
$bar=urlencode(ltext("m_emailneu"));
$content="email_neu.php";
}
if ($num == 4)
{
$bar=urlencode(ltext("m_adbook"));
$content="email_adlist.php";
}


$loKunde = new SQLString($kunde);
if($num == 6)
{
	$bar = urlencode(ltext("m_settings"));
	$content="allgemein_start.php";
	$noemail = false;
	$id = safe_query2( "SELECT admin.email AS email, kunden.maxemail AS maxemail ".
										 "FROM admin, kunden WHERE kunden.kunde = ?", $loKunde );
	$werte = db_fetch_array($id);
	if (($werte["email"] == 0) || ($werte["maxemail"] == 0))
	{
		$id = safe_query2( "SELECT COUNT(kunde) AS email FROM email WHERE kunde = ?", $loKunde );
		$werte = db_fetch_array($id);
		if ($werte["email"] == 0)
		{
			$id = safe_query2( "SELECT COUNT(kunde) AS pop3 FROM pop3 WHERE kunde = ?", $loKunde);
			$werte = db_fetch_array($id);
			if ($werte["pop3"] == 0)
			{
				db_close();
				$noemail = true;
			}
		}	
	}

	$id = safe_query2( "SELECT COUNT(ident) AS autoresponder FROM autoresponder WHERE kunde = ?", $loKunde);
	$werte = db_fetch_array($id);
	$autoresponder = $werte["autoresponder"];

	$id = safe_query2( "SELECT maxemail, maxautoresponder, spamfilter FROM kunden WHERE kunde = ?", $loKunde);
	$werte = db_fetch_array($id);
	$maxautoresponder = $werte["maxautoresponder"];


	if(!$noemail)
	{
		if (($autoresponder > 0) || ($maxautoresponder != 0))
		{
			menu("email_autoresponder.php","me_autoresponder",$strSkinName);
		}
		if($werte["spamfilter"] == 1)
		{
			menu("email_spam_config.php","m_spam",$strSkinName);
		}
	}
}

?>

<script>
top.fraToolbar.location.href = 'toolbar.php?text=<?=$bar?>';
parent.content.location.href = '<?=$content?>';
</script>
</table>
</body>
</html>
<?
db_close();
?>

