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

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

if ($neupw1 == "") {
	$neupw = "NONE";
} else {
	if (!valid_pw($neupw1))
		{
		 $fehlertext = ltext("alwepw2_error3");
		 include("allgemein_webalizer_pw1.php");
		 exit();
		}
	$neupw = crypt_pw($neupw1);
}

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

$id = safe_query( "select statistik from kunden where kunde = ? ", TRUE, new SQLString( $PHP_AUTH_USER ) );
$werte = db_fetch_array($id);
$statistik = $werte["statistik"];
if ($statistik == "0")
	{
	 $fehlertext = ltext("alwepw2_error4");
	}
else
	{
	 safe_query( "update kunden set statistiklongpw = ? , pw='1' where kunde = ? ", TRUE, new SQLString( $neupw ), new SQLString( $PHP_AUTH_USER ) );
	 safe_query( "update allgemein set webalizerpw='1'", TRUE );
	 $fehlertitel = ltext("alwepw2_error5");
	 $fehlertext = ltext("alwepw2_error6");
	}
db_close();
include("allgemein_webalizer.php");
?>
