<?
########## 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('module.Informer.php');
db_connect($db_host, $db_user, $db_pass);

$ausdb = "nein";

if ($confixxfaktor <= 0){
	$fehlertext = ltext("eiin2_error1");
	db_close();
	include("einstellungen_intervalle.php");
	exit();
}


(int)$aliasesfaktor = round($aliases / $confixxfaktor);
if ($aliasesfaktor < 1) { $aliasesfaktor = 1; }
if($aliasesfaktor * $confixxfaktor != $aliases)
{
	message(NOTICE, ltext('eiin2_notice', array(ltext('eiin_cell_scriptmain'), ltext('eiin_cell_scriptemail')) ));
}

(int)$httpdfaktor = round($httpd / $confixxfaktor);
if ($httpdfaktor < 1) { $httpdfaktor = 1; }
if($httpdfaktor * $confixxfaktor != $httpd)
{
	message(NOTICE, ltext('eiin2_notice', array(ltext('eiin_cell_scriptmain'), ltext('eiin_cell_scripthttpdreload')) ));
}

if ($neukundenreload == "ja") $neukundenreload = 1; else $neukundenreload = 0;

$checknewversion *= 1;

#
# check settings
#
if ( !( is_numeric($speichervon) && is_numeric($speicherbis) ) ) {
	$speichervon = 1;
	$speicherbis = 2;
}
if ( !( is_numeric($httpdtraffikvon) && is_numeric($httpdtraffikbis) ) ) {
	$httpdtraffikvon = 3;
	$httpdtraffikbis = 4;
}
if ( !( is_numeric($ftptraffikvon) && is_numeric($ftptraffikbis) ) ) {
	$ftptraffikvon = 5;
	$ftptraffikbis = 6;
}


if ( !is_numeric($httpdtraffikfreq) ) {
	$httpdtraffikfreq = 60;
}
if ( !is_numeric($ftptraffikfreq) ) {
	$ftptraffikfreq = 60;
}
if ( !is_numeric($speicherfreq) ) {
	$speicherfreq = 60;
}

$sql = "update zeiten set
speichervon = $speichervon,
speicherbis = $speicherbis,
httpdtraffikvon = $httpdtraffikvon,
httpdtraffikbis = $httpdtraffikbis,
ftptraffikvon = $ftptraffikvon,
ftptraffikbis = $ftptraffikbis,
httpdfaktor = '$httpdfaktor',
speicherfreq = $speicherfreq,
aliasesfaktor = '$aliasesfaktor',
httpdtraffikfreq = $httpdtraffikfreq,
ftptraffikfreq = $ftptraffikfreq,
confixxfaktor = '$confixxfaktor',
checknewversion = '$checknewversion'
";
if ( $httpdtraffiknow == "ja" ) {
	$sql .= ",httpdtraffiklast=0";
}
if ( $ftptraffiknow == "ja" ) {
	$sql .= ",ftptraffiklast=0";
}
if ( $speichernow == "ja" ) {
	$sql .= ",speicherlast=0";
}


db_query( $sql );

db_query("update admin set neukundenreload = '$neukundenreload'");

if ($confixxnow == "ja"){
	db_query("update allgemein set confixxupdate = 0");
}
if ($apachenow == "ja"){
	db_query("update allgemein set httpdupdate = 0, confixxupdate = 0");
}

if ($aliasnow == "ja"){
	db_query("update allgemein set aliasesupdate = 0, confixxupdate = 0");
}

if ( ($httpdtraffiknow == "ja") || ($ftptraffiknow == "ja") || ($speichernow == "ja") )	{
	 db_query("update allgemein set confixxupdate = 0");
}


	
if($checknewversionnow)
{
	db_query("update allgemein set checknewversion = 0, confixxupdate = 0");	
}
	
$ausdb = "ja";
$fehlertitel = ltext("eiin2_errortitle");
$fehlertext = ltext("eiin2_error2");
db_close();
include("einstellungen_intervalle.php");
exit();
?>
