<?
########## 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 (!checkFtpLogin($PHP_AUTH_USER, $altpw))
	{
	 $fehlertext = ltext("ftp_alpw2_error1"); 
	 include("allgemein_pwaendern.php"); exit();
	}
if ($neupw1 != $neupw2) 
	{ 
	 $fehlertext = ltext("ftp_alpw2_error3"); 
	 include("allgemein_pwaendern.php"); 
	 exit();
	}
if (!valid_pw($neupw1))
	{
	 $fehlertext = ltext("ftp_alpw2_error4");
	 include("allgemein_pwaendern.php");
	 exit();
	}
$neupw = crypt_pw($neupw1);
db_connect($db_host, $db_user, $db_pass);
safe_query( "update ftp set longpw = ?  where account = ? ", TRUE, new SQLString( $neupw ), new SQLString( $PHP_AUTH_USER ) );
safe_query( "update allgemein set newpwd='1'", TRUE );
db_close();
$fehlertitel = ltext("ftp_alpw2_errortitle");
$fehlertext = ltext("ftp_alpw2_error5");
header("Location: ./allgemein_pwaendern.php?fehlertext=".urlencode($fehlertext)."&fehlertitel=".urlencode($fehlertitel));
?>
