'; $action=(isset($_GET['action'])) ? $_GET['action'] : "status"; $checkit=(isset($_GET['checkit'])) ? urldecode($_GET['checkit']) : ""; $repair=(isset($_GET['repair'])) ? $_GET['repair'] : 0; $is_htaccess=(file_exists("./.htaccess")); if($is_htaccess) $htaccess_exist=file(".htaccess"); $dba=$hta_dir=$Overwrite=$msg=""; //MySQL-Verbindung herstellen MSD_mysql_connect(); if(isset($_POST['htaccess']) || $action=="schutz") { if($is_htaccess) $Overwrite='

'.$lang['htaccess8'].'

'; $cry_txt=array($lang['htaccess5'],$lang['htaccess6'],$lang['htaccess7']); $step=(isset($_POST['step']))?$_POST['step']:0; $cryptart=(isset($_POST['cryptart'])) ? $_POST['cryptart'] :0; $uname=(isset($_POST['username'])) ? $_POST['username'] : ""; $upass1=(isset($_POST['userpass1'])) ? $_POST['userpass1'] : ""; $upass2=(isset($_POST['userpass2'])) ? $_POST['userpass2'] : ""; if($step==1) { $msg=""; if($uname=="") $msg=$lang['htaccess9']; if(($upass1!=$upass2) || ($upass1=="")) $msg.=$lang['htaccess10']; if($msg!="") { $msg='

'.$msg.'

'; $step=0; } else { $msg='

'.$lang['htaccess11'].'

'; } } elseif($step==2) { $htaccess = "AuthName \"MySQLDump\"\nAuthType Basic\nAuthUserFile ". $config['paths']['root'].".htpasswd\nrequire valid-user\n"; if($cryptart==0) $userpass=crypt($upass1,CRYPT_STD_DES); elseif($cryptart==1) $userpass=md5($upass1); else $userpass=$upass1; $htpasswd = $uname.":".$userpass; if($file_htpasswd=@fopen(".htpasswd","w")) { fputs($file_htpasswd,$htpasswd); fclose($file_htpasswd); $file_htaccess=@fopen(".htaccess","w"); fputs($file_htaccess,$htaccess); fclose($file_htaccess); $msg= $lang['htaccess12'].'


'.$lang['htaccess13'].' .htaccess:'."\n".htmlspecialchars($htaccess).'


'.$lang['htaccess13'].' .htpasswd:'."\n". htmlspecialchars($htpasswd)."
"; } else {$msg='

'.$lang['htaccess14'].'


'.$lang['htaccess13'].' .htaccess:'."\n".htmlspecialchars($htaccess).'


'.$lang['htaccess13'].' .htpasswd:'."\n". htmlspecialchars($htpasswd).'
';} } //Ausgabe echo headline(''.$lang['htaccess1']).$Overwrite; if($step<2){ if($step==0) { $un=''; $p1=''; $p2=''; $cry=''.$cry_txt[0].'  '; $cry.=''.$cry_txt[1].'  '; $cry.=''.$cry_txt[2].'  '; } else { $un=$uname.''; $p1='***************'; $p2='***************'; $cry=''.$cry_txt[$cryptart]; } echo $msg.'
'; echo ''; echo '
Name'.$un.'
'.$lang['htaccess2'].''.$p1.'
'.$lang['htaccess3'].''.$p2.'
'.$lang['htaccess4'].' '.$cry.'

'; echo '
'; } else echo $msg; echo "











"; include("inc/footer.php"); die(); } if(isset($_POST['error_submit'])) { $debug_adress="debug@daniel-schlichtholz.de"; //$debug_adress="admin@localhost"; if(!isset($_POST['error_absender']) || $_POST['error_absender']=="") { echo '

'.$lang['mailabsendererror'].'

'; echo 'back ...'; die; } if($_POST['error_name']=="")$_POST['error_name']=$_POST['error_absender']; $header="From: ".$_POST['error_name']." <".$_POST['error_absender'].">\n"; $header .= "Reply-To: ".$_POST['error_absender']."\n"; $header .= "X-Mailer: PHP/" . phpversion(). "\n"; $header .= "X-Sender-IP: $REMOTE_ADDR\n"; $header .= "Content-Type: text/html"; $subject=stripslashes($_POST['error_subject']); $body="=======================================
Art: ".$_POST['error_kind']."

"; $body.=$lang['Ausgabe'].": ".stripslashes(nl2br($_POST['error_aus']))."

"; $body.=$lang['Zusatz'].": ".nl2br($_POST['error_zusatz'])."

"; $body.=$lang['Variabeln'].": ".nl2br($_POST['error_vars']); $body.="
=======================================

"; if (@mail($debug_adress, $subject, $body, $header)) { echo $lang['berichtsent']."

"; } else { echo '

'.$lang['mailerror'].'

'; $body=$lang['autobericht']." '".$_POST['error_name']."'

".$body; $b=str_replace("
","\n",$body); $b=str_replace("","\n",$b); $b=rawurlencode(strip_tags($b)); echo $lang['berichtman1'].' Debug-Team'; } } if($action=="edithtaccess") { $htaccessdontexist=0; if((isset($_GET['create']) && $_GET['create']==1 ) || (isset($_POST['create']) && $_POST['create']==1)) { $fp = fopen("$hta_dir.htaccess", "w"); fwrite ($fp,"# created by MySQLDumper ".MSD_VERSION."\n"); fclose ($fp); } if(isset($_POST['newload'])){ $hta_dir=(isset($_POST['newhtadir'])) ? $_POST['newhtadir'] : ""; } else $hta_dir=(isset($_POST['hta_dir'])) ? $_POST['hta_dir'] : ""; if($hta_dir !="" && substr($hta_dir,-1)!="/")$hta_dir.="/"; if(isset($_POST['submit']) && isset($_POST['thta'])){ $fp = fopen("$hta_dir.htaccess", "w"); fwrite ($fp,$_POST['thta']); fclose ($fp); } if(file_exists("$hta_dir.htaccess")){ $htaccess_exist=file("$hta_dir.htaccess"); } else { $htaccessdontexist=1; } echo headline(''.$lang['htaccess16']); echo '

'.$lang['htaccess32'].'

'; echo '
File: .htaccess   '; if($htaccessdontexist!=1) { echo '


'; echo '
'; //Presets echo '
Presets

'.$lang['htaccess30'].'

all-inkl

'.$lang['htaccess31'].'

'.$lang['htaccess20'].'
'.$lang['htaccess21'].'
'.$lang['htaccess22'].'
'.$lang['htaccess23'].'
'.$lang['htaccess24'].'
'.$lang['htaccess25'].'
'.$lang['htaccess26'].'
'.$lang['htaccess27'].'
'.$lang['htaccess28'].'

'.$lang['htaccess29'].' '; echo '
'.$lang['htaccess18'].'
'; echo '   '; echo '   '; echo '
'; } else { echo '

'.$hta_dir.'.htaccess existiert nicht. Soll sie erstellt werden ?

'; echo '
'; } echo '
'.$lang['back'].''; exit; } if($action=="phpinfo") { phpinfo(); echo '

Home

'; exit; } if($action=="extinfo") { echo ErrorReport(); exit; } if($action=="db") { for($i=0;$i"; break; } if(isset($_POST['kill'.$i])) { $res=mysql_query("DROP DATABASE `".$databases['Name'][$i]."`") or die(mysql_error().""); $dba= '

'.$lang['db']." ".$databases['Name'][$i]." ".$lang['info_deleted']."

"; SetDefault(); include ($config['files']['parameter']); echo ''; break; } if(isset($_POST['optimize'.$i])) { mysql_select_db($databases['Name'][$i],$config['dbconnection']); $res = mysql_list_tables($databases['Name'][$i],$config['dbconnection']); $tabellen=""; WHILE ($row=mysql_fetch_row($res)) $tabellen.=$row[0].","; $tabellen=substr($tabellen,0,(strlen($tabellen)-1)); if ($tabellen>"") { $query="OPTIMIZE TABLE ".$tabellen; $res=mysql_query($query) or die(mysql_error().""); } $_GET['dbid']=$i; $dba= '

'.$lang['db'].' '.$databases['Name'][$i].' '.$lang['info_optimized'].'.

'; break; } if(isset($_POST['check'.$i])) { $checkit="ALL";$_GET['dbid']=$i; } } } //Hier beginnt die Ausgabe echo headline('Home'); echo '
'; echo ''; echo ''; echo ''; echo ''; echo '
'; if($action=="status") { //Infos über Backups $Sum_Files=$Sum_Size=0; $Last_BU=Array(); $sm=($config['safe_mode']==1) ? " (Safemode)" : ""; $dh = opendir($config['paths']['backup']); while (false !== ($filename = readdir($dh))) { if ($filename != "." && $filename != ".." && !is_dir($config['paths']['backup'].$filename)){ $files[] = $filename; $Sum_Files++; $Sum_Size+=filesize($config['paths']['backup'].$filename); $ft=filectime($config['paths']['backup'].$filename); if(!isset($Last_BU[2]) || (isset($Last_BU[2]) && $ft>$Last_BU[2])){ $Last_BU[0]=$filename; $Last_BU[1]=date("d.m.Y H:i",$ft); $Last_BU[2]=$ft; } } } $status='
'.$lang['Statusinformationen'].'
'; $status.= DirectoryWarnings(); //Versionen $status.='
'.$lang['Versionsinformationen'].'
'; $status.='MySQLDumper-Version: '.MSD_VERSION.' '.MSD_VERSION_ADD.'
'; $status.='OS: '.MSD_OS.' ('.MSD_OS_EXT.')
'; $status.='Browser: '.MSD_BROWSER_AGENT.' Version '.MSD_BROWSER_VERSION.'
'; $status.='MySQL-Version: '.MSD_MYSQL_VERSION.'
'; $status.='PHP-Version: '.PHP_VERSION.' Speicher: '.$config['ram'].' MB '.(($config['zlib']) ? '': '  '.$lang['phpbug'].'.  ').$sm.'  '; $status.='Max Execution Time: '.$config['max_execution_time'].' sec.  [PHP-Info]  '; $status.='
PHP-Extensions: '.$config['phpextensions'].''; if($config['disabled']!="") $status.='
'.$lang['disabledfunctions'].': '.$config['disabled'].''; if(!extension_loaded("ftp")) $status.= '
'.$lang['noftppossible'].''; if(!$config['zlib']) $status.= '   
'.$lang['nogzpossible'].'
'; //MySQLDumper Informationen $status.='
'.$lang['MySQL Dumper Informationen'].'
'.$lang['info_location'].' "'.$_SERVER['SERVER_NAME'].'" ('.($config['paths']['root']).')
'; $status.=$lang['info_actdb'].": ".$databases['db_actual']."
"; if($config['no_htaccess']==0) { //.(($is_htaccess) ? '' : ''.$lang['htaccess15'].''); if($is_htaccess) { $status.=''.$lang['htaccess16'].''; } else { $status.=''.$lang['htaccess1'].'  '.$lang['htaccess15'].''; //$status.='   +++ '.$lang['htaccess17'].' +++'; } } //History $status.='
History
'.$lang['backupfilesanzahl'].' '.$Sum_Files.' Backups ('.byte_output($Sum_Size).')
'; $status.=$lang['fm_freespace'].': '.MD_FreeDiskSpace().'
'; if($Sum_Files>0) $status.=$lang['lastbackup'].' '.$lang['vom'].' '.((isset($Last_BU[1])) ? $Last_BU[1] : " - ").'
     '.((isset($Last_BU[1])) ? '' : " - ").''.((isset($Last_BU[0])) ? $Last_BU[0] : " - ").'
'; $status.='
['.$lang['Fehlerbericht'].']
'; echo $status; } elseif($action=="db") { //Datenbanken echo '
'.$lang['info_databases'].'
'; echo $dba.''; if(!isset($config['dbconnection'])) MSD_mysql_connect(); for($i=0;$i'; } else { mysql_select_db($databases['Name'][$i],$config['dbconnection']); $tabellen = mysql_query("SHOW TABLES FROM `".$databases['Name'][$i]."`",$config['dbconnection']); $num_tables = mysql_num_rows($tabellen); $cl= ($i % 2) ? "dbrow" : "dbrow1"; if($i==$databases['db_selected_index']) $cl="dbrowsel"; echo ''; echo ''; } } echo '
'.$databases['Name'][$i].''.$lang['info_nodb'].'
'; echo ($i==$databases['db_selected_index']) ? "".$databases['Name'][$i]."" : $databases['Name'][$i]; echo ''.$num_tables.' '.$lang['info_table1']; echo ($num_tables>1) ? $lang['info_table2'] : ''; echo '
'.$lang['create_database'].'
'; echo '
'; } elseif($action=="sys") { $sysaction=(isset($_GET['dosys'])) ? $_GET['dosys'] : 0; $msg=""; $res=@mysql_query("SHOW VARIABLES LIKE 'datadir'",$config['dbconnection']); if($res) { $row = mysql_fetch_array($res); $data_dir=$row[1]; } switch($sysaction) { case 1: //FLUSH PRIVILEGES $msg="> operating FLUSH PRIVILEGES
"; $res=@mysql_query("FLUSH PRIVILEGES",$config['dbconnection']); $meldung=mysql_error($config['dbconnection']); if($meldung!="") { $msg.='> MySQL-Error: '.$meldung; } else { $msg.="> Privileges were reloaded."; } break; case 2: //FLUSH STATUS $msg="> operating FLUSH STATUS
"; $res=@mysql_query("FLUSH STATUS",$config['dbconnection']); $meldung=mysql_error($config['dbconnection']); if($meldung!="") { $msg.='> MySQL-Error: '.$meldung; } else { $msg.="> Status was reset."; } break; case 3: //FLUSH HOSTS $msg="> operating FLUSH HOSTS
"; $res=@mysql_query("FLUSH HOSTS",$config['dbconnection']); $meldung=mysql_error($config['dbconnection']); if($meldung!="") { $msg.='> MySQL-Error: '.$meldung; } else { $msg.="> Hosts were reloaded.";; } break; case 4: //SHOW MASTER LOGS $msg="> operating SHOW MASTER LOGS
"; $res=@mysql_query("SHOW MASTER LOGS",$config['dbconnection']); $meldung=mysql_error($config['dbconnection']); if($meldung!="") { $msg.='> MySQL-Error: '.$meldung; } else { $numrows=mysql_num_rows($res); if($numrows==0) { $msg.='> there are no master log-files'; }else{ $msg.='> there are '.$numrows.' logfiles
'; for($i=0;$i<$numrows;$i++) { $row=mysql_fetch_row($res); $msg.='> '.$row[0].'   '.(($data_dir) ? byte_output(filesize($data_dir.$row[0])) : '').'
'; } } } break; case 5: //RESET MASTER $msg="> operating RESET MASTER
"; $res=@mysql_query("RESET MASTER",$config['dbconnection']); $meldung=mysql_error($config['dbconnection']); if($meldung!="") { $msg.='> MySQL-Error: '.$meldung; } else { $msg.="> All Masterlogs were deleted."; } break; } echo '
'.$lang['mysqlsys'].'
'; echo ''; echo '
'; echo '> MysSQL Dumper v'.MSD_VERSION.' - Output Console

'; echo ($msg!="") ? $msg : '> waiting for operation ...
'; echo '
'; } elseif($action=="vars") { $var=(isset($_GET['var'])) ? $_GET['var'] : "prozesse"; $Titelausgabe=array("variables"=>$lang['Variabeln'],"status"=>$lang['Status'],"prozesse"=>$lang['Prozesse']); echo '
'.$lang['mysqlvars'].'
'.$Titelausgabe[$var].'    '; echo ''.$lang['Prozesse'].'   '; echo ''.$lang['Status'].'   '; echo ''.$lang['Variabeln'].'   '; echo '

 

'; //Variabeln switch($var) { case "variables": $res=@mysql_query("SHOW variables"); if($res) $numrows=mysql_num_rows($res); if($numrows==0) {echo $lang['info_novars'];} else { echo ''; for ($i = 0; $i < $numrows; $i++) { $row = mysql_fetch_array($res); $cl= ($i % 2) ? "dbrow" : "dbrow1"; echo ''; } } echo '
Name'.$lang['Inhalt'].'
'.$row[0].''.$row[1].'
'; break; case "status": $res=@mysql_query("SHOW STATUS"); if($res) $numrows=mysql_num_rows($res); if($numrows==0) {echo $lang['info_nostatus'];} else { echo ''; for ($i = 0; $i < $numrows; $i++) { $cl= ($i % 2) ? "dbrow" : "dbrow1"; $row = mysql_fetch_array($res); echo ''; } } echo '
Name'.$lang['Inhalt'].'
'.$row[0].''.$row[1].'
'; break; case "prozesse": if($config['processlist_refresh']<1000)$config['processlist_refresh']=2000; if(isset($_GET['killid']) && $_GET['killid']>0) { $killid=(isset($_GET['killid'])) ? $_GET['killid'] : 0; $wait=(isset($_GET['wait'])) ? $_GET['wait'] : 0; if($wait==0) { $ret=mysql_query("KILL ".$_GET['killid']); $wait=2; } else $wait+=2; if($wait==0) { echo '

'.$lang['processkill1'].$_GET['killid'].$lang['processkill2'].$ret.'

'; } else { echo '

'.$lang['processkill3'].$wait.$lang['processkill4'].$_GET['killid'].$lang['processkill2'].$ret.'

'; } } $killid=$wait=0; $res=@mysql_query("SHOW FULL PROCESSLIST "); if($res) $numrows=mysql_num_rows($res); if($numrows==0) {echo $lang['info_noprocesses'];} else { echo ''; for ($i = 0; $i < $numrows; $i++) { $cl= ($i % 2) ? "dbrow" : "dbrow1"; $row = mysql_fetch_array($res); echo ''; if($row[0]==$killid && $row[4]=="Killed") { $wait=$killid=0; } } } echo '
IDUserHostDBCommandTimeStateInfoRT: '.round($config['processlist_refresh']/1000).' sec
'.$row[0].''.$row[1].' '.$row[2].''.$row[3].''.$row[4].''.$row[5].' '.$row[6].''.$row[7].' kill
'; echo '
'; echo ''; break; } echo '
'; } //Datenbankdetails if (isset($_GET['dbid'])) { $dbid=$_GET['dbid']; echo '
'.$lang['info_dbdetail'].'"'.$databases['Name'][$dbid].'"
'; $res=@mysql_query("SHOW TABLE STATUS FROM `".$databases['Name'][$dbid]."`"); mysql_select_db($databases['Name'][$dbid]); if($res) $numrows=mysql_num_rows($res); if($numrows==0) { echo $lang['info_dbempty']; } else { echo $numrows.' '.$lang['info_table1']; echo ($numrows>1) ? $lang['info_table2'] : ''; echo "\n".'
'. ''."\n"; $last_update="2000-01-01 00:00:00"; $s=$s1=$s2=""; for ($i = 0; $i < $numrows; $i++) { $row = mysql_fetch_array($res); $akt_size=$row['Data_length']+$row['Index_length']; $cl= ($i % 2) ? 'dbrow' : 'dbrow1'; echo "\n".''; if(isset($row['Update_time'])) if(strtotime($row['Update_time'])>strtotime($last_update)) $last_update=$row['Update_time']; $s1=$s1+$row['Rows']; $s2=$s2+$row['Data_length']+$row['Index_length']; } echo ''; echo '
Nr.'. $lang['info_table1'].''. $lang['info_records'].''. $lang['info_size'].''. $lang['info_lastupdate'].''. $lang['info_optimized'].'Status
'.($i+1).''. $row['Name'].''. number_format($row['Rows'],0,",",".").''. byte_output($akt_size). ' '. $row['Update_time'].''; if ($row['Data_free']==0) echo ''; else echo ' '.$lang['no'].' '; echo ''; if($checkit==$row['Name'] || $repair==1) { $tmp_res=mysql_query("REPAIR TABLE `".$row['Name']."`"); } if(($checkit==$row['Name'] || $checkit=="ALL") && $akt_size>0) { $tmp_res=mysql_query("CHECK TABLE `".$row['Name']."`"); if($tmp_res) { $tmp_row = mysql_fetch_row($tmp_res); echo ($tmp_row[3]=="OK") ? '' : ' repair '; } else echo "CHECK TABLE `".$row['Name']."`"; } else { if($akt_size>0) echo 'check'; else echo "-"; } echo '
'.$lang['info_sum'].'' .number_format($s1,0,",",".").''.byte_output($s2).''.$last_update.' 
'; } $edb=$lang['info_emptydb1'].' `'.$databases['Name'][$dbid].'` '.$lang['info_emptydb2']; $kdb=$lang['info_emptydb1'].' `'.$databases['Name'][$dbid].'` '.$lang['info_killdb']; echo '
'; if($numrows>0) echo ''; echo ''; if($numrows>0) { echo ''; echo ''; } echo '
'; } echo MSDFooter();; ?>