$getval){ ${$getvar} = $getval; } foreach($_POST as $postvar => $postval){ ${$postvar} = $postval; } $dbonly=(isset($dbonly)) ? $dbonly : ""; $dbport=(isset($dbport)) ? $dbport : ""; $dbsocket=(isset($dbsocket)) ? $dbsocket : ""; if(!isset($language)) $language="de"; if(isset($dbhost) && isset($dbuser) && isset($dbpass)) { $config["dbhost"]=$dbhost; $config["dbuser"]=$dbuser; $config["dbpass"]=$dbpass; $config["dbonly"]=$dbonly; $config["dbport"]=$dbport; $config["dbsocket"]=$dbsocket; } else { if(isset($connstr) && !empty($connstr)) { $p=explode("|",$connstr); $dbhost=$config["dbhost"]=$p[0]; $dbuser=$config["dbuser"]=$p[1]; $dbpass=$config["dbpass"]=$p[2]; $dbonly=$config["dbonly"]=$p[3]; $dbport=$config["dbport"]=$p[4]; $dbsocket=$config["dbsocket"]=$p[5]; } else $connstr=""; } //Variabeln $phase=(isset($phase)) ? $phase : 0; $connstr="$dbhost|$dbuser|$dbpass|$dbonly|$dbport|$dbsocket"; $delfiles=Array(); include_once("inc/functions.php"); include_once("inc/mysql.php"); require("inc/runtime.php"); $config['language']=$language; include("language/lang_list.php"); include("language/".$language."/lang_install.php"); $img_ok='ok'; $img_failed='failed'; $href="install.php?language=$language&phase=$phase&connstr=$connstr"; ?> MySQLDumper - Installation 9 && $phase<12) { $Anzeige=$lang['install'].' - '.$lang["step"].' '.($phase-7); } elseif ($phase>19 && $phase<100) { $Anzeige=$lang['tools']; } else { $Anzeige=$lang['uninstall'].' - '.$lang["step"].' '.($phase-99); } echo '

'.$lang['install_tomenu'].'
Version '.MSD_VERSION.' '.MSD_VERSION_ADD.'
'.$lang['install_forcescript'].'
'; echo '

'.$Anzeige.'

'; switch ($phase) { case 0: // Anfang - Sprachauswahl if(file_exists("config.php") && file_exists($config["paths"]["config"]."parameter.php"))zipConfig(); echo '
'; echo ''; echo '
LanguageTools
'; echo GetLanguageCombo("radio","radio","language",""); echo '
","
'; foreach($lang['languages'] as $key) { echo("\n
'.$lang['tools1'][$key].'

'); if(file_exists($config["paths"]["config"]."config.gz")) echo ''.$lang['tools2'][$key].'

'; if(file_exists($config["paths"]["config"]."parameter.php")) echo ''.$lang['tools3'][$key].'

'; if(file_exists("config.php") && file_exists($config["paths"]["config"]."parameter.php")) echo ''.$lang['tools4'][$key].''; echo("
"); } echo("\n
"); echo ''; break; case 1: // checken if(isset($trychmod) && $trychmod==1) @chmod("config.php","0777"); echo '

'.$lang['dbparameter'].'

'; if(!is_writable("config.php")) { echo '

'.$lang['confignotwritable'].'

'; echo ''.$lang['tryagain'].''; echo '     '.$lang['install_tomenu'].''; } else { $tmp=file("config.php"); $stored=0; if(!(isset($dbhost) && isset($dbuser) && isset($dbpass))) { //lese aus config for($i=0;$i'.$lang['expert'].'
' : ''; echo ''; echo ''; echo ''; echo ''; echo ''; if(isset($expert)) { echo ''; echo ''; echo ''; } echo ''; if(isset($dbconnect)) { echo ''; echo ''; } echo '
'.$lang['dbparameter'].$exp.'
'.$lang['db_host'].':
'.$lang['db_user'].':
'.$lang['db_pass'].':
'.$lang['db_only'].':
'.$lang['port'].':  '.$lang['install_help_port'].'
'.$lang['socket'].':  '.$lang['install_help_socket'].'
'.$lang['testconnection'].':
'.$lang['dbconnection'].'
'; MSD_mysql_connect(); if(!$config["dbconnection"]) { echo '
'.$lang['connectionerror'].'
 '; } else { echo '
'.$lang['connection_ok'].'
'; $connection="ok"; $connstr="$dbhost|$dbuser|$dbpass|$dbonly|$dbport|$dbsocket"; echo ''; SearchDatabases(1); if(empty($databases["Name"])) echo ''; } echo '

'; if(isset($connection) && $connection=="ok" && !empty($databases["Name"])) { echo '
'; echo ' '; echo ''; echo '
'; } } break; case 2: // echo '

MySQLDumper - '.$lang['confbasic'].'

'; $tmp=file("config.php"); $stored=0; for($i=0;$i'.$lang['import12'].'

'; } else { if(ini_get('safe_mode')==1) { $nextphase=(extension_loaded("ftp")) ? 10 : 9; } else $nextphase=$phase+2; echo $lang['install_step2finished']; echo '


'; echo '
'; echo '


'; echo '
'; } break; case 3: // if(ini_get('safe_mode')==1) $nextphase=10; else $nextphase=$phase+1; echo '

'.$lang['editconf'].'

'; // if($config["language"]=="en") echo 'important! change the line $config["language"]=\'de\' to $config["language"]=\'en\'
'; echo '

      '; echo ''; echo '
'; break; case 4: //Verzeichnisse if(isset($_POST["submit"])) { $ret=true; if ($fp=fopen("config.php", "wb")) { if (!fwrite($fp,stripslashes(stripslashes($_POST["configfile"])))) $ret=false; if (!fclose($fp)) $ret=false; } else $ret=false; if($ret==false) { echo '
'.$lang['errorman'].' config.php '.$lang['manuell'].'.'; die; } } echo '

'.$lang['createdirs'].'

'; SetFileRechte("work/");@chmod("work",0777); SetFileRechte("work/config/");@chmod("work/config",0777); SetFileRechte("work/log/");@chmod("work/log",0777); SetFileRechte("work/backup/");@chmod("work/backup",0777); SetFileRechte("work/structure/");@chmod("work/structure",0777); $iw[0]=IsWritable("work"); $iw[1]=IsWritable("work/config"); $iw[2]=IsWritable("work/log"); $iw[3]=IsWritable("work/backup"); $iw[4]=IsWritable("work/structure"); echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if($iw[0] && $iw[1] && $iw[2] && $iw[3] && $iw[4]) echo ''; echo '
'.$lang['dir'].''.$lang['rechte'].''.$lang['status'].'
work'.Rechte("work").''.(($iw[0]) ? $img_ok : $img_failed).'
work/config'.Rechte("work/config").''.(($iw[1]) ? $img_ok : $img_failed).'
work/log'.Rechte("work/log").''.(($iw[2]) ? $img_ok : $img_failed).'
work/backup'.Rechte("work/backup").''.(($iw[3]) ? $img_ok : $img_failed).'
work/structure'.Rechte("work/structure").''.(($iw[4]) ? $img_ok : $img_failed).'
'.$lang['dirs_created'].'

'; break; case 5: echo '

'.$lang['laststep'].'

'; echo '
'.$lang['installfinished']; SetDefault(true); include("language/".$language."/lang_install.php"); if(file_exists($config["paths"]["config"]."config.gz")) { echo '

'.$lang['import1'].''; } echo '

'.$lang['import2'].''; break; case 9: clearstatcache(); $iw[0]=IsWritable("work"); $iw[1]=IsWritable("work/config"); $iw[2]=IsWritable("work/log"); $iw[3]=IsWritable("work/backup"); $iw[4]=IsWritable("work/structure"); echo '

'.$lang['ftpmode'].'

'; echo '

'.$lang['safemodedesc'].'

'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if($iw[0] && $iw[1] && $iw[2] && $iw[3] && $iw[4]) echo ''; echo '
'.$lang['idomanual'].'
'.$lang['dofrom'].'
'.Realpfad('./').'
work'.(($iw[0]) ? $img_ok : $img_failed).'
work/config'.(($iw[1]) ? $img_ok : $img_failed).'
work/log'.(($iw[2]) ? $img_ok : $img_failed).'
work/backup'.(($iw[3]) ? $img_ok : $img_failed).'
work/structure'.(($iw[4]) ? $img_ok : $img_failed).'
'.$lang['dirs_created'].'
'; break; case 10: //safe_mode FTP clearstatcache(); $iw[0]=IsWritable("work"); $iw[1]=IsWritable("work/config"); $iw[2]=IsWritable("work/log"); $iw[3]=IsWritable("work/backup"); $iw[4]=IsWritable("work/structure"); if(!isset($install_ftp_port) || $install_ftp_port<1) $install_ftp_port=21; echo '

'.$lang['ftpmode'].'

'; echo '

'.$lang['safemodedesc'].'

'; echo ''; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if($iw[0] && $iw[1] && $iw[2] && $iw[3] && $iw[4]) echo ''; echo '
'.$lang['idomanual'].'
'.$lang['dofrom'].'
'.Realpfad('./').'
work'.(($iw[0]) ? $img_ok : $img_failed).'
work/config'.(($iw[1]) ? $img_ok : $img_failed).'
work/log'.(($iw[2]) ? $img_ok : $img_failed).'
work/backup'.(($iw[3]) ? $img_ok : $img_failed).'
work/structure'.(($iw[4]) ? $img_ok : $img_failed).'
'.$lang['dirs_created'].'
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if(isset($ftp_connect)) { echo ''; } echo '
'.$lang['ftpmode2'].'
FTP-Server
FTP-Port
FTP-User
FTP-'.$lang['db_pass'].'
'.$lang['info_scriptdir'].'
'.$lang['connect_to'].' `'.$install_ftp_server.'` Port '.$install_ftp_port.' ...
'; $tftp=TesteFTP($install_ftp_server,$install_ftp_port,$install_ftp_user_name,$install_ftp_user_pass,$install_ftp_path); echo $tftp; echo '
 '; if(substr($tftp,-5)=="") { echo '
'; echo ''; echo '
'; } echo '
'; break; case 11: //FTP-Create Dirs echo '

'.$lang['ftpmode'].'

'; if(CreateDirsFTP()==1) { SetDefault(true); echo DirectoryWarnings(); echo '
'.$lang['installfinished']; if(is_writable($config["paths"]["config"])) { if(file_exists($config["paths"]["config"]."config.gz")) { echo '

'.$lang['import1'].''; } echo '
'.$lang['import2'].''; } } break; case 20: //import echo '

'.$lang['import'].'

'; $import=importConfig($config["paths"]["config"]."config.gz"); if($import==0) { echo '
'.$lang['import3'].'
'; SetDefault(true); echo '
'.$lang['import4'].'
'; echo ''.$lang['import5'].'    '.$lang['import6'].''; } elseif($import==1) { echo '

'.$lang['import11'].'

'; } elseif($import==2) { echo '

'.$lang['import12'].'

'; } break; break; case 21: //upload + import echo '

'.$lang['import2'].'

'; echo '
'; echo '
'; echo ''; echo '
'; break; case 22: //posting from upload echo '

'.$lang['import7'].'

'; $backlink=''.$lang['import8'].''; if (isset($_POST["upload"])) { $error=false; if (!($_FILES["upfile"]["name"])) { echo "".$lang["fm_uploadfilerequest"].'

'.$backlink; exit; } if (file_exists($config["paths"]["config"].$_FILES["upfile"]["name"])) unlink($config["paths"]["config"].$_FILES["upfile"]["name"]); if ($_FILES["upfile"]["name"]!='config.gz') { echo "".$lang["import9"]."

".$backlink; exit; } if (move_uploaded_file($_FILES["upfile"]["tmp_name"],$config["paths"]["config"].$_FILES["upfile"]["name"])) { chmod($config["paths"]["config"].$upfile_name,0755); } else { echo "".$lang["fm_uploadmoveerror"]."
".$backlink; exit; } } echo '
'.$lang['import10'].'
'; $import=importConfig($config["paths"]["config"]."config.gz"); if($import==0) { echo '
'.$lang['import3'].'
'; SetDefault(true); echo '
'.$lang['import4'].'
'; echo ''.$lang['import5'].'    '.$lang['import6'].''; } elseif($import==1) { echo '

'.$lang['import11'].'

'; } elseif($import==2) { echo '

'.$lang['import12'].'

'; } break; case 100: //uninstall echo $lang['ui1'].'

'; echo zipConfig().'

'; echo $lang['ui2']."

"; echo ''.$lang['ui3'].'     '; echo ''.$lang['ui4'].''; break; case 101: echo '

'.$lang['ui5'].'

'; $paths=Array(); $w=substr($config["paths"]["work"],0,strlen($config["paths"]["work"])-1); if(is_dir($w)) $res = rec_rmdir ($w); else $res=0; // wurde das Verzeichnis korrekt gelöscht if($res==0) { // das Verzeichnis wurde korrekt gelöscht echo '

'.$lang['ui6'].'

'; echo $lang['ui7']."
\"".Realpfad("./")."\"
".$lang['manuell'].".

"; echo ''.$lang['ui8'].''; }else { echo '

'.$lang['ui9'].'"'.$paths[count($paths)-1].'"'; } break; } ?> Download Config from '.$config["paths"]["config"].''; } function importConfig($importfile) { global $config; $cf1=Array(); $imp1=Array(); $sql1=Array(); $tmp=Array(); if(!file_exists($importfile)) exit; $tmp=file("config.php"); $imp=gzfile($importfile); for($i=0;$i'.$lang['connect_to'].' `'.$install_ftp_server.'` Port '.$install_ftp_port.' ...
'; $conn_id = ftp_connect($install_ftp_server); // Einloggen mit Benutzername und Kennwort $login_result = ftp_login($conn_id, $install_ftp_user_name, $install_ftp_user_pass); // Verbindung überprüfen if ((!$conn_id) || (!$login_result)) { echo $lang['ftp_notconnected']; echo $lang['connwith']." $tinstall_ftp_server ".$lang['asuser']." $install_ftp_user_name ".$lang['notpossible']; return 0; } else { //Wechsel in betroffenes Verzeichnis echo $lang['changedir'].' `'.$install_ftp_path.'` ...
'; ftp_chdir($conn_id,$install_ftp_path); // Erstellen der Verzeichnisse echo $lang['dircr1'].' ...
'; ftp_mkdir($conn_id,"work"); ftp_site($conn_id, "CHMOD 0777 work"); echo $lang['changedir'].' `work` ...
'; ftp_chdir($conn_id,"work"); echo $lang['indir'].' `'.ftp_pwd($conn_id).'`
'; echo $lang['dircr5'].' ...
'; ftp_mkdir($conn_id,"config"); ftp_site($conn_id, "CHMOD 0777 config"); echo $lang['dircr2'].' ...
'; ftp_mkdir($conn_id,"backup"); ftp_site($conn_id, "CHMOD 0777 backup"); echo $lang['dircr3'].' ...
'; ftp_mkdir($conn_id,"structure"); ftp_site($conn_id, "CHMOD 0777 structure"); echo $lang['dircr4'].' ...
'; ftp_mkdir($conn_id,"log"); ftp_site($conn_id, "CHMOD 0777 log"); // Schließen des FTP-Streams ftp_quit($conn_id); return 1; } } function ftp_mkdirs($config,$dirname) { $dir=split("/", $dirname); for ($i=0;$i"; } else echo '

'.$lang["found_no_db"].' `'.$config["dbonly"]."` !
"; } else { $db_list = @mysql_list_dbs($config["dbconnection"]); $i=0; if($db_list && @mysql_num_rows($db_list)>0) { $databases["db_selected_index"] = 0; while ($row = @mysql_fetch_object($db_list)) { $databases["Name"][$i]=$row->Database; $databases["praefix"][$i] = ""; $databases["command_before_dump"][$i] = ""; $databases["command_after_dump"][$i] = ""; if($printout==1) echo "... ".$lang["found_db"]." `$row->Database`
"; } $databases["db_actual"]=$databases["Name"][0]; $databases["db_selected_index"]=0; } else { if($printout==1) echo $lang['dbonlyneed'].'
'; } } } ?>