$getval) { ${$getvar}=$getval; } foreach ($_POST as $postvar=>$postval) { ${$postvar}=$postval; } include_once ( './inc/functions.php' ); include_once ( './inc/mysql.php' ); include_once ( './inc/runtime.php' ); if (!isset($language)) $language="en"; $config['language']=$language; include ( './language/lang_list.php' ); include ( 'language/' . $language . '/lang_install.php' ); include ( 'language/' . $language . '/lang_main.php' ); //Übergabe der Parameter über FORM if (isset($_POST['dbhost'])) { $config['dbhost']=$dbhost; $config['dbuser']=$dbuser; $config['dbpass']=$dbpass; $config['dbport']=$dbport; $config['dbsocket']=$dbsocket; $config['manual_db']=$manual_db; } else { // Wenn Connection-String existiert -> Verbindungsdaten aus connstr auslesen if (isset($connstr) && !empty($connstr)) { $p=explode("|",$connstr); $dbhost=$config['dbhost']=$p[0]; $dbuser=$config['dbuser']=$p[1]; $dbpass=$config['dbpass']=$p[2]; $dbport=$config['dbport']=$p[3]; $dbsocket=$config['dbsocket']=$p[4]; $manual_db=$config['manual_db']=$p[5]; } else $connstr=""; } //Variabeln $phase=( isset($phase) ) ? $phase : 0; if (isset($_POST['manual_db'])) $manual_db=trim($_POST['manual_db']); $connstr="$dbhost|$dbuser|$dbpass|$dbport|$dbsocket|$manual_db"; $connection=''; $delfiles=Array(); $config['files']['iconpath']='./css/msd/icons/'; $img_ok='ok'; $img_failed='failed'; $href="install.php?language=$language&phase=$phase&connstr=$connstr"; header('content-type: text/html; charset=utf-8'); ?> MySQLDumper - Installation 9 && $phase < 12) { $Anzeige=$lang['L_INSTALL'] . ' - ' . $lang['L_STEP'] . ' ' . ( $phase - 7 ); } elseif ($phase > 19 && $phase < 100) { $Anzeige=$lang['L_TOOLS']; } else { $Anzeige=$lang['L_UNINSTALL'] . ' - ' . $lang['L_STEP'] . ' ' . ( $phase - 99 ); } echo '' . $lang['L_INSTALL_TOMENU'] . ''; echo '

' . $Anzeige . '

'; echo '

Version ' . MSD_VERSION . '

'; switch ($phase) { case 0: // Anfang - Sprachauswahl // da viele ja nicht in die Anleitung schauen -> versuchen die Perldateien automatisch richtig zu chmodden @chmod('./msd_cron/crondump.pl',0755); @chmod('./msd_cron/perltest.pl',0755); @chmod('./msd_cron/simpletest.pl',0755); echo '
'; echo ''; echo '
LanguageTools
'; echo GetLanguageCombo("radio","radio","language",""); echo '
","
'; foreach ($lang['languages'] as $key) { echo ( "\n" ); } echo ( "\n
" ); echo ''; break; case 1: // checken @chmod("config.php",0777); echo '
' . $lang['L_DBPARAMETER'] . '
'; if (!is_writable("config.php")) { echo '

' . $lang['L_CONFIGNOTWRITABLE'] . '

'; echo '' . $lang['L_TRYAGAIN'] . ''; echo '     ' . $lang['L_INSTALL_TOMENU'] . ''; } else { $tmp=file("config.php"); $stored=0; if (!isset($_POST['dbconnect'])) { // Erstaufruf - Daten aus config.php auslesen for ($i=0; $i < count($tmp); $i++) { if (substr($tmp[$i],0,17) == '$config[\'dbhost\']') { $config['dbhost']=extractValue($tmp[$i]); $dbhost=$config['dbhost']; $stored++; } if (substr($tmp[$i],0,17) == '$config[\'dbport\']') { $config['dbport']=extractValue($tmp[$i]); $dbport=$config['dbport']; $stored++; } if (substr($tmp[$i],0,19) == '$config[\'dbsocket\']') { $config['dbsocket']=extractValue($tmp[$i]); $dbsocket=$config['dbsocket']; $stored++; } if (substr($tmp[$i],0,17) == '$config[\'dbuser\']') { $config['dbuser']=extractValue($tmp[$i]); $dbuser=$config['dbuser']; $stored++; } if (substr($tmp[$i],0,17) == '$config[\'dbpass\']') { $config['dbpass']=extractValue($tmp[$i]); $dbpass=$config['dbpass']; $stored++; } if (substr($tmp[$i],0,19) == '$config[\'language\']') { $config['language']=extractValue($tmp[$i]); $stored++; } if ($stored == 6) break; } } if (!isset($config['dbport'])) $config['dbport']=""; if (!isset($config['dbsocket'])) $config['dbsocket']=""; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if (isset($_POST['dbconnect'])) { echo ''; echo ''; } echo '
' . $lang['L_DB_HOST'] . ':
' . $lang['L_DB_USER'] . ':
' . $lang['L_DB_PASS'] . ':
* ' . $lang['L_DB'] . ':

('.$lang['L_ENTER_DB_INFO'].')

'; echo $lang['L_PORT'] . ':  ' . $lang['L_INSTALL_HELP_PORT'] . '
' . $lang['L_SOCKET'] . ':  ' . $lang['L_INSTALL_HELP_SOCKET'] . '
' . $lang['L_TESTCONNECTION'] . ':
' . $lang['L_DBCONNECTION'] . '
'; $connection=MSD_mysql_connect(); if ($connection === false) { echo '

' . $lang['L_CONNECTIONERROR'] . '

 '; } else { echo '

' . $lang['L_CONNECTION_OK'] . '

'; $connection="ok"; $connstr="$dbhost|$dbuser|$dbpass|$dbport|$dbsocket|$manual_db"; echo ''; if ($manual_db > '') SearchDatabases(1,$manual_db); else SearchDatabases(1); } echo '

'; if ($connection == "ok") { if (!isset($databases['Name'][0])) echo '
' . $lang['L_NO_DB_FOUND_INFO']; echo '
'; echo ' '; echo '
'; } } break; case 2: // echo '
MySQLDumper - ' . $lang['L_CONFBASIC'] . '
'; $tmp=@file("config.php"); $stored=0; for ($i=0; $i < count($tmp); $i++) { if (substr($tmp[$i],0,17) == '$config[\'dbhost\']') { $tmp[$i]='$config[\'dbhost\'] = \'' . $dbhost . '\';' . "\n"; $stored++; } if (substr($tmp[$i],0,17) == '$config[\'dbport\']') { $tmp[$i]='$config[\'dbport\'] = \'' . $dbport . '\';' . "\n"; $stored++; } if (substr($tmp[$i],0,19) == '$config[\'dbsocket\']') { $tmp[$i]='$config[\'dbsocket\'] = \'' . $dbsocket . '\';' . "\n"; $stored++; } if (substr($tmp[$i],0,17) == '$config[\'dbuser\']') { $tmp[$i]='$config[\'dbuser\'] = \'' . $dbuser . '\';' . "\n"; $stored++; } if (substr($tmp[$i],0,17) == '$config[\'dbpass\']') { $tmp[$i]='$config[\'dbpass\'] = \'' . $dbpass . '\';' . "\n"; $stored++; } if ($stored == 6) break; } $ret=true; if ($fp=fopen("config.php","wb")) { if (!fwrite($fp,implode($tmp,""))) $ret=false; if (!fclose($fp)) $ret=false; @chmod("config.php",0644); } if (!$ret) { echo '

' . $lang['L_CONFIG_SAVE_ERROR'] . '

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

 

'; echo '
'; echo ''; } break; case 3: // if (ini_get('safe_mode') == 1) $nextphase=10; else $nextphase=$phase + 1; echo '
' . $lang['L_EDITCONF'] . '
'; 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['L_ERRORMAN'] . ' config.php ' . $lang['L_MANUELL'] . '.'; die(); } } echo '
' . $lang['L_CREATEDIRS'] . '
'; $check_dirs=ARRAY( "work/", "work/config/", "work/log/", "work/backup/" ); $msg=''; foreach ($check_dirs as $d) { $success=SetFileRechte($d,1,0777); if ($success != 1) $msg.=$success . '
'; } if ($msg > '') echo '' . $msg . ''; $iw[0]=IsWritable("work"); $iw[1]=IsWritable("work/config"); $iw[2]=IsWritable("work/log"); $iw[3]=IsWritable("work/backup"); // save manual_db if ($manual_db > '') { if (file_exists('./' . $config['files']['dbs_manual'])) @unlink('./' . $config['files']['dbs_manual']); $file_handle=fopen('./' . $config['files']['dbs_manual'],'a'); if ($file_handle) { fwrite($file_handle,$manual_db); fclose($file_handle); @chmod('./' . $config['files']['dbs_manual'],0777); } } if ($iw[0] && $iw[1] && $iw[2] && $iw[3]) { echo ''; } echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if ($iw[0] && $iw[1] && $iw[2] && $iw[3]) echo ''; echo '
' . $lang['L_DIR'] . '' . $lang['L_RECHTE'] . '' . $lang['L_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 ) . '
' . $lang['L_DIRS_CREATED'] . '

'; break; case 5: echo '
' . $lang['L_LASTSTEP'] . '
'; echo '

' . $lang['L_INSTALLFINISHED'] . '

'; SetDefault(1); include ( "language/" . $language . "/lang_install.php" ); // direkt zum Start des Dumeprs echo ''; break; case 9: clearstatcache(); $iw[0]=IsWritable("work"); $iw[1]=IsWritable("work/config"); $iw[2]=IsWritable("work/log"); $iw[3]=IsWritable("work/backup"); echo '
' . $lang['L_FTPMODE'] . '
'; echo '

' . $lang['L_SAFEMODEDESC'] . '

'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; // Wenn Verzeichnisse erstellt wurden - direkt weitermachen if ($iw[0] && $iw[1] && $iw[2] && $iw[3]) { echo ''; } echo '
' . $lang['L_IDOMANUAL'] . '
' . $lang['L_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 ) . '
'; break; case 10: //safe_mode FTP $config['ftp_useSSL']=0; clearstatcache(); $iw[0]=IsWritable("work"); $iw[1]=IsWritable("work/config"); $iw[2]=IsWritable("work/log"); $iw[3]=IsWritable("work/backup"); if (!isset($install_ftp_port) || $install_ftp_port < 1) $install_ftp_port=21; echo '
' . $lang['L_FTPMODE'] . '
'; echo '

' . $lang['L_SAFEMODEDESC'] . '

'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; if ($iw[0] && $iw[1] && $iw[2] && $iw[3]) echo ''; echo '
' . $lang['L_IDOMANUAL'] . '
' . $lang['L_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 ) . '
' . $lang['L_DIRS_CREATED'] . '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
' . $lang['L_FTPMODE2'] . '
FTP-Server
FTP-Port
FTP-User
FTP-' . $lang['L_PASS'] . '
' . $lang['L_INFO_SCRIPTDIR'] . '
'; if (isset($ftp_connect)) { echo '
'; $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,-9) == "") { echo '
'; echo ' '; echo '
'; } echo '
'; } //echo ''; //echo ''; break; case 11: //FTP-Create Dirs echo '
' . $lang['L_FTPMODE'] . '
'; if (CreateDirsFTP() == 1) { SetDefault(true); echo DirectoryWarnings(); echo '
' . $lang['L_INSTALLFINISHED']; } break; case 100: //uninstall echo '
' . $lang['L_UI1'] . '
'; echo '
' . $lang['L_UI2'] . '
'; echo '' . $lang['L_UI3'] . '     '; echo '' . $lang['L_UI4'] . ''; break; case 101: echo '
' . $lang['L_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['L_UI6'] . '

'; echo $lang['L_UI7'] . "
\"" . Realpfad("./") . "\"
" . $lang['L_MANUELL'] . ".

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

' . $lang['L_UI9'] . '"' . $paths[count($paths) - 1] . '"'; } break; } ?>