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

include_once( "../include/class.SQLString.php" );
include_once("auth.php");

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

$id = safe_query( "select kunde from pop3 where account = ? ", TRUE, new SQLString( $PHP_AUTH_USER ) );
$werte = db_fetch_array($id);
$kunde = $werte["kunde"];
$id = safe_query( "select webmail from kunden where kunde = ? ", TRUE, new SQLString( $kunde ) );
$werte = db_fetch_array($id);
$webmail = $werte["webmail"];
if ($webmail == 0)
	{
	 db_close();
	 header("Location: ./allgemein_pwaendern.php");
	 exit();
	}
if ($webmail_session == "") {
	$id = safe_query( "INSERT INTO webmail_session ( pop3, password, lang, timestamp ) VALUES ( ?, ?, ?, ? )", TRUE,
			new SQLString($PHP_AUTH_USER), new SQLString( crypt($PHP_AUTH_PW, mkpasswd(2)) ), new SQLString( $shortlang ),
			new SQLString( db_timestamp(time()) ) );
	setcookie("webmail_session", db_insert_id($id, 'seq_webmail_session'), 0, "/cgi-bin/webmail/");
	setcookie("webmail_pass", $PHP_AUTH_PW, 0, "/cgi-bin/webmail/");
}

$id2 = safe_query( "select maxautoresponder from kunden where kunde = ? ", TRUE, new SQLString( $kunde ) );
$id = safe_query( "select count(ident) as autoresponder from autoresponder where kunde = ? ", TRUE, new SQLString( $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">
<br><? include("../fehler.inc.php"); ?>
<script>
function doChange()
{
document.forms[0].submit();
}
</script>
<table class="tblbgcolor" align="left" border="1" cellpadding="3" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
<tr>
    <TD><b>&nbsp;<? echo ltext("pop_alst_title", array($PHP_AUTH_USER)); ?>&nbsp;</b><br>
    </TD>
  </TR>
</TABLE>
</BODY>
</HTML>
<?
db_close();
?>
