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

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

if (!valid_pw($pass1)) {
	$fehlertext = ltext("topwpw2_error1");
	include("tools_pwschutz_pwaendern.php");
	exit();
}

if ($pass1 != $pass2) {
	$fehlertext = ltext("topwpw2_error2");
	include("tools_pwschutz_pwaendern.php");
	exit();
}

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

$pass = crypt_pw($pass1);
safe_query( "update users set longpw = ?  where ident = ?  and kunde = ? ", TRUE, new SQLString( $pass ), new SQLInteger( $ident ), new SQLString( $PHP_AUTH_USER ) );
$id = safe_query( "select * from htaccess where pfad = ?  and kunde = ? ", TRUE, new SQLString( $pfad ), new SQLString( $PHP_AUTH_USER ) );
if (db_num_rows($id) < 1)	{
safe_query( "insert into htaccess (pfad, kunde) VALUES (  ? ,  ?  )", TRUE, new SQLString( $pfad ), new SQLString( $PHP_AUTH_USER ) );
				}

safe_query( "update allgemein set htaccess='1'", TRUE );
db_close();

$ident = $parent;

$fehlertitel = ltext("topwpw2_errortitle");
$fehlertext = ltext("topwpw2_error3");
include("tools_pwschutz_aendern.php");
exit();
?>
