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


include_once("auth.php");
include_once ("../include/module.DNSTemplate.php");

$pns = strtolower($pns);
$sns = strtolower($sns);

if ( ! preg_match( "/^([0-9a-z-]+\.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\.[a-z]{2,3}$/", $pns ) )
{
    $fehlertext = ltext("anan2_error39");
    db_close();
    include("anbieter_aendern_dns.php");
    exit();
}

if ( ! preg_match( "/^([0-9a-z-]+\.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\.[a-z]{2,3}$/", $sns ) )
{
    $fehlertext = ltext("anan2_error40");
    db_close();
    include("anbieter_aendern_dns.php");
    exit();
}

## mysql verbindung aufbauen

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

## /mysql verbindung aufbauen


db_query("update anbieter set pns = '$pns', sns = '$sns' where anbieter = '$anbieter'");

if ($all == 1)
{
    $template = NULL;
    $id = db_query( "SELECT dns.domain, kunden.ip, dns.lastchange FROM dns, kunden WHERE dns.kunde = kunden.kunde
	    AND kunden.anbieter='$anbieter'" );
    while ( $werte = db_fetch_array($id) )
    {
	list( $zonefile, $seriennummer ) = ff_ProcessTemplate ( $anbieter, $domain = $werte["domain"], $werte["ip"],
		$werte["lastchange"], $template, $pns, $sns );
	db_query ( "UPDATE dns SET zonefile='$zonefile', lastchange='$seriennummer', neu='1' WHERE domain ='$domain'" );
    }
    db_query("update allgemein set dns='1'");
}

$fehlertitel = ltext("anaeip2_errortitle");

$fehlertext = ltext("anaeip2_error1");

db_close();

include("anbieter_aendern.php");

exit();

?>
