<?
########## 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 pfad, account from ftp where account = ?  and kunde = ? ", TRUE, new SQLString( $account ), new SQLString( $PHP_AUTH_USER ) );
$werte = db_fetch_array($id);
$pfad = $werte["pfad"];
$account2 = $werte["account"];
if ($account2 <> $account)
	{
	 $fehlertext = ltext("toftlo_error1");
	 db_close();
	 include("tools_ftp.php");
	 exit();
	}
safe_query( "delete from ftp where account = ?  and kunde = ? ", TRUE, new SQLString($account), new SQLString($PHP_AUTH_USER) );
$id = safe_query( "select account from delaccs where account = ? ", TRUE, new SQLString( $account ) );
if (db_num_rows($id) == 0)	{
safe_query( "insert into delaccs (account, type, pfad, kunde) VALUES (  ? ,  'ftp',  ? ,  ?  )", TRUE, new SQLString( $account ), new SQLString( $pfad ), new SQLString( $PHP_AUTH_USER ) );
							}
safe_query( "update allgemein set delftp='1'", TRUE );
$fehlertitel = ltext("toftlo_errortitle");
$fehlertext = ltext("toftlo_error2", array($account, $pfad));
db_close();
$pfad = "";
include("tools_ftp.php");
exit();
?>
