Revision 88 | Revision 111 | Zur aktuellen Revision | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed
<?require("libs/Smarty.class.php");require("Translation2.php");$smarty=new Smarty();if(file_exists("include/config.xml")){$smarty->assign("meld","An error occured!");$smarty->assign("db_meld","Config file already exists!");$smarty->assign("error",true);$smarty->display("meld.tpl");exit;}$xml_opts["filename"]="install.xml";$tr=Translation2::factory("xml",$xml_opts);$lang=(isset($_POST["lang"])?$_POST["lang"]:"en");$tr->setLang($lang);$tr->setPageID("install");$install=$tr->getPage();$type=(isset($_POST["type"])?$_POST["type"]:"");$db_host=(isset($_POST["db_host"]))?$_POST["db_host"]:"localhost";$db_user=(isset($_POST["db_user"]))?$_POST["db_user"]:"";$db_name=(isset($_POST["db_name"]))?$_POST["db_name"]:"";$db_pass=(isset($_POST["db_pass"]))?$_POST["db_pass"]:"";$db_type=(isset($_POST["db_type"]))?$_POST["db_type"]:"mysql";foreach ($install as $key => $value){$smarty->assign(strtoupper("L_$key"),$value);}$mode=addslashes((isset($_POST["mode"])?$_POST["mode"]:""));$year=intval((isset($_POST["year"])?$_POST["year"]:0));$g_anz=intval((isset($_POST["g_anz"])?$_POST["g_anz"]:0));$t_anz=intval((isset($_POST["t_anz"])?$_POST["t_anz"]:0));$smarty->assign("type", $type);$smarty->assign("year", $year);$smarty->assign("step", substr($mode,4,strlen($mode)-4));$smarty->assign("L_T_TYPE",$install["$type"]);$type=addslashes($type);switch ($mode){case "step2":$tpl_f="install2.tpl";/* $even=!($year%2);if ($even){$r2=($year%4);if($r2==2){if($type!="WC"){$tpl_f="install.tpl";$smarty->assign("meld",sprintf($install["WC_year"],$year));$smarty->assign("error",true);}}else{if ($type!="EC"){$tpl_f="install.tpl";$smarty->assign("meld",sprintf($install["EC_year"],$year));$smarty->assign("error",true);}}}else{$tpl_f="install.tpl";$smarty->assign("meld",sprintf($install["wrong_year"],$year));$smarty->assign("error",true);}*/$smarty->display("$tpl_f");break;case "step3":$smarty->display("install3.tpl");break;case "step4":require("Config.php");$cfg=new Config();$db_conf=array("db_host"=>$db_host, "db_user"=>$db_user, "db_pass"=>$db_pass, "db_name"=>$db_name,"db_type"=>$db_type);$db_config=$cfg->parseConfig($db_conf,"phparray",array("name"=>"db"));$out_config=$cfg->writeConfig("include/config.xml","XML",array("name"=>"db"));if(!PEAR::isError($out_config)){$smarty->assign("meld","Installation was successfully completed!");$smarty->assign("db_meld","");$smarty->assign("error",false);}else{$smarty->assign("meld","An error occured!");$smarty->assign("db_meld",$out_config->getUserInfo());$smarty->assign("error",true);}$smarty->display("meld.tpl");break;default:$smarty->display("install.tpl");break;}?>