<?php if ($_SESSION['inputcache.okas']!='collectinfo') redirect('./'); $errorareas=array(); $data=$_SESSION['inputcache.data']; require_once(dirname(dirname(getcwd())).'/'.$data['loginpath'].'/base/config.common.inc.php'); require_once(dirname(dirname(getcwd())).'/'.$data['loginpath'].'/base/config.locals.inc.php'); class TmpClass {}; $LoginConfig=new TmpClass(); initialize_config($LoginConfig); set_local_configurations($LoginConfig); $dataset['file.config.common']='config.common.inc.php'; if (!is_writable('../config.common.inc.php')) $errorareas['ERROR-CREATE-CONFIG-COMMON']=array(0); else { $config_common="<?php
define('SESSKEYPFX','reserv.');

function initialize_config(&\$Config)
{
	\$Config->SESSION_NAME='".$LoginConfig->SESSION_NAME."';
	\$Config->CookieName=array(
	 	'uniwits_ipdata'=>'".$LoginConfig->CookieName['uniwits_ipdata']."',
		'uniwits_lang'=>'".$LoginConfig->CookieName['uniwits_lang']."',
		'uniwits_timebias'=>'".$LoginConfig->CookieName['uniwits_timebias']."',
		'userpcid'=>'".$LoginConfig->CookieName['userpcid']."'
	);

	\$Config->Paths=array(
		'theme.shared'=>'".$LoginConfig->Paths['theme.shared']."',
		'theme.shared.report'=>'".$LoginConfig->Paths['theme.shared.report']."',
		'counter.compere'=>'".$LoginConfig->Paths['data']."/counter/compere',
		'counter.course'=>'".$LoginConfig->Paths['data']."/counter/course',
		'theme.system'=>'themes',
		'user.base'=>'".$LoginConfig->Paths['user.base']."',
		'lang.system'=>'languages',
		'upload'=>'".$LoginConfig->Paths['upload']."',
		'tasklistbase'=>'".$LoginConfig->Paths['tasklistbase']."'
	);
	
	\$Config->ThemeLimits=array(
		'style.zip.size'=>5242880,
		'style.expanded.size'=>10485760
	);

	\$Config->SESSION_SAVE_PATH='".$LoginConfig->SESSION_SAVE_PATH."';
	\$Config->CachePrefix='".$LoginConfig->CachePrefix."';

	\$Config->Limits=array(
		'timeavail.count'=>240,
		'seat.count'=>999,
		'place.count'=>20,
		'classroom.seat.count'=>999,
		'classroom.count'=>99,
		'lecture.count'=>999,
		'course.count'=>99,
		'coursegroup.count'=>99,
		'reservation.count'=>999,
		'option.count'=>999,
		'question.count'=>999,
		'questionnaire.count'=>999,
		'team.size'=>10,
		'max_image_file_size'=>10485760,
		'download_peakrate'=>655360,
		'thumbnail.sx'=>120,
		'thumbnail.sy'=>120
	);

	\$Config->ChargedPlans=array(
		'default'=>'0',
		'alias'=>'0.alias'
	);
	
	\$Config->DefaultCompereInfoCategorized=array();
	
	\$Config->TablePrefix=array(
		'reserv'=>'".$data['dbtblpfx']."',
		'uniwits'=>'".$LoginConfig->TablePrefix['uniwits']."'
	);

	\$Config->DISTRIBUTION_ID='".$data['distributionid']."';
	\$Config->VERSION='".trim(file_get_contents('VERSION'))."';
}
?>"; if (!file_put_contents('../config.common.inc.php',$config_common)) $errorareas['ERROR-CREATE-CONFIG-COMMON']=array(0); else $dataset['OK-CREATE-CONFIG-COMMON']=array(0); } $dataset['file.config.locals']='config.locals.inc.php'; if (!is_writable('../config.locals.inc.php')) $errorareas['ERROR-CREATE-CONFIG-LOCAL']=array(0); else { $config_local="<?php
function set_local_configurations(&\$Config)
{
	\$Config->DBType='".$LoginConfig->DBType."';
	\$Config->SESSION_DOMAIN='".$LoginConfig->SESSION_DOMAIN."';
	\$Config->SERVER_DOMAIN='".$_SERVER['SERVER_NAME'].($_SERVER['SERVER_PORT']==80?'':':'.$_SERVER['SERVER_PORT']).dirname(dirname($_SERVER['REQUEST_URI']))."';
	\$Config->LOGIN_SERVER_NAME='".$LoginConfig->SERVER_DOMAIN."';

	\$Config->COOKIE_DOMAIN='".$LoginConfig->COOKIE_DOMAIN."';
	
	\$Config->DBConfWritable=array(
		array(
			'DBHost'=>'".$LoginConfig->DBConfWritable[0]['DBHost']."',
			'DBPort'=>'".$LoginConfig->DBConfWritable[0]['DBPort']."',
			'DBName'=>'".$LoginConfig->DBConfWritable[0]['DBName']."',
			'DBUser'=>'".$LoginConfig->DBConfWritable[0]['DBUser']."',
			'DBPass'=>'".$LoginConfig->DBConfWritable[0]['DBPass']."'
		)
	);
	\$Config->DBConfReadonly=\$Config->DBConfWritable;
		
	\$Config->MailingMethod='".$LoginConfig->MailingMethod."';
	\$Config->MailerAddress='".$LoginConfig->MailerAddress."';
	\$Config->SmtpServer='".$LoginConfig->SmtpServer."';
	\$Config->SmtpPort='".$LoginConfig->SmtpPort."';
	\$Config->PopServer='".$LoginConfig->PopServer."';
	\$Config->PopPort='".$LoginConfig->PopPort."';
	\$Config->PopUser='".$LoginConfig->PopUser."';
	\$Config->PopPass='".$LoginConfig->PopPass."';
	\$Config->ErrorReportMail='".$LoginConfig->ErrorReportMail."';
	\$Config->SupportMail='".$LoginConfig->MailerAddress."';

	\$Config->ServerList=array('".$_SERVER['SERVER_ADDR']."-".$_SERVER['SERVER_NAME']."');

	\$Config->TeamAvailable=true;
	
	\$Config->DefaultCPID=1;
}
?>"; if (!file_put_contents('../config.locals.inc.php',$config_local)) $errorareas['ERROR-CREATE-CONFIG-LOCAL']=array(0); else $dataset['OK-CREATE-CONFIG-LOCAL']=array(0); } $dataset+=$data; $dataset+=$errorareas; $dataset['LANG']=language_requested(); if (count_true_entries($errorareas)==0) $dataset['INSTALL-GO-STEP2']=array(0); else $dataset['INSTALL-INCOMPLETE']=array(0); ?>