<?
########## 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");

$ausdb = "nein";
db_connect($db_host, $db_user, $db_pass);

$id = safe_query( "select domain from domains where kunde = ?  and frontpage='1'", TRUE, new SQLString( $PHP_AUTH_USER ) );
if (db_num_rows($id) > 0)
	{
	 $frontpage = 1;
	}
else
	{
	 $fehlertext = ltext("alfr2_error1");
	 db_close();
	 include("allgemein_start.php");
	 exit();
	}


if (!ereg("@", $emailadresse))
	{
	 $fehlertext = ltext("alfr2_error2");
	 include("allgemein_frontpage.php");
	 exit();
	}

if ((!istleer($neupw1)) || (!istleer($neupw2)))
	{

	 if ($neupw1 != $neupw2)
		{
		 $fehlertext = ltext("alfr2_error4");
		 include("allgemein_frontpage.php");
		 exit();
		}

	 if ((strlen($neupw1) < 6) || (strlen($neupw1) > 12))
		{
		 $fehlertext = ltext("alfr2_error5");
		 include("allgemein_frontpage.php");
		 exit();
		}

	 safe_query( "update frontpage set passwort = ? , pw=1, emailadresse = ? , email=1 where kunde = ? ", TRUE, new SQLString( $neupw1 ), new SQLString( $emailadresse ), new SQLString( $PHP_AUTH_USER ) );
	 safe_query( "update allgemein set frontpagepw='1', frontpageemail=1", TRUE );
	} else
	{
	 safe_query( "update frontpage set emailadresse = ? , email=1 where kunde = ? ", TRUE, new SQLString( $emailadresse ), new SQLString( $PHP_AUTH_USER ) );
	 safe_query( "update allgemein set frontpageemail=1", TRUE );
	}
	 
$fehlertitel = ltext("alfr2_error6");
$fehlertext = ltext("alfr2_error7");
db_close();
include("allgemein_frontpage.php");
?>
