2015-05-22 11:43:20 +00:00
|
|
|
<?php
|
|
|
|
if (!defined('MSD_VERSION')) die('No direct access.');
|
|
|
|
$sysaction=(isset($_GET['dosys'])) ? $_GET['dosys'] : 0;
|
|
|
|
$msg="";
|
2016-02-01 19:02:15 +00:00
|
|
|
$res=@mysqli_query($config['dbconnection'], "SHOW VARIABLES LIKE 'datadir'");
|
2015-05-22 11:43:20 +00:00
|
|
|
if ($res)
|
|
|
|
{
|
2016-02-01 19:02:15 +00:00
|
|
|
$row=mysqli_fetch_array($res);
|
2015-05-22 11:43:20 +00:00
|
|
|
$data_dir=$row[1];
|
|
|
|
}
|
|
|
|
switch ($sysaction)
|
|
|
|
{
|
|
|
|
case 1: //FLUSH PRIVILEGES
|
|
|
|
$msg="> operating FLUSH PRIVILEGES<br>";
|
2016-02-01 19:02:15 +00:00
|
|
|
$res=@mysqli_query($config['dbconnection'], "FLUSH PRIVILEGES");
|
|
|
|
$meldung=((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
|
2015-05-22 11:43:20 +00:00
|
|
|
if ($meldung!="")
|
|
|
|
{
|
|
|
|
$msg.='> MySQL-Error: '.$meldung;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$msg.="> Privileges were reloaded.";
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2: //FLUSH STATUS
|
|
|
|
$msg="> operating FLUSH STATUS<br>";
|
2016-02-01 19:02:15 +00:00
|
|
|
$res=@mysqli_query($config['dbconnection'], "FLUSH STATUS");
|
|
|
|
$meldung=((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
|
2015-05-22 11:43:20 +00:00
|
|
|
if ($meldung!="")
|
|
|
|
{
|
|
|
|
$msg.='> MySQL-Error: '.$meldung;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$msg.="> Status was reset.";
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 3: //FLUSH HOSTS
|
|
|
|
$msg="> operating FLUSH HOSTS<br>";
|
2016-02-01 19:02:15 +00:00
|
|
|
$res=@mysqli_query($config['dbconnection'], "FLUSH HOSTS");
|
|
|
|
$meldung=((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
|
2015-05-22 11:43:20 +00:00
|
|
|
if ($meldung!="")
|
|
|
|
{
|
|
|
|
$msg.='> MySQL-Error: '.$meldung;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$msg.="> Hosts were reloaded.";
|
|
|
|
;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4: //SHOW MASTER LOGS
|
|
|
|
$msg="> operating SHOW MASTER LOGS<br>";
|
2016-02-01 19:02:15 +00:00
|
|
|
$res=@mysqli_query($config['dbconnection'], "SHOW MASTER LOGS");
|
|
|
|
$meldung=((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
|
2015-05-22 11:43:20 +00:00
|
|
|
if ($meldung!="")
|
|
|
|
{
|
|
|
|
$msg.='> MySQL-Error: '.$meldung;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-02-01 19:02:15 +00:00
|
|
|
$numrows=mysqli_num_rows($res);
|
2015-05-22 11:43:20 +00:00
|
|
|
if ($numrows==0||$numrows===false)
|
|
|
|
{
|
|
|
|
$msg.='> there are no master log-files';
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$msg.='> there are '.$numrows.' logfiles<br>';
|
|
|
|
for ($i=0; $i<$numrows; $i++)
|
|
|
|
{
|
2016-02-01 19:02:15 +00:00
|
|
|
$row=mysqli_fetch_row($res);
|
2015-05-22 11:43:20 +00:00
|
|
|
$msg.='> '.$row[0].' '.(($data_dir) ? byte_output(@filesize($data_dir.$row[0])) : '').'<br>';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 5: //RESET MASTER
|
|
|
|
$msg="> operating RESET MASTER<br>";
|
2016-02-01 19:02:15 +00:00
|
|
|
$res=@mysqli_query($config['dbconnection'], "RESET MASTER");
|
|
|
|
$meldung=((is_object($config['dbconnection'])) ? mysqli_error($config['dbconnection']) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
|
2015-05-22 11:43:20 +00:00
|
|
|
if ($meldung!="")
|
|
|
|
{
|
|
|
|
$msg.='> MySQL-Error: '.$meldung;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$msg.="> All Masterlogs were deleted.";
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
echo '<h5>'.$lang['L_MYSQLSYS'].'</h5>';
|
|
|
|
echo '<div id="hormenu"><ul>
|
|
|
|
<li><a href="main.php?action=sys&dosys=1">Reload Privileges</a></li>
|
|
|
|
<li><a href="main.php?action=sys&dosys=2">Reset Status</a></li>
|
|
|
|
<li><a href="main.php?action=sys&dosys=3">Reload Hosts</a></li>
|
|
|
|
<li><a href="main.php?action=sys&dosys=4">Show Log-Files</a></li>
|
|
|
|
<li><a href="main.php?action=sys&dosys=5">Reset Master-Log</a></li>
|
|
|
|
</ul></div>';
|
|
|
|
echo '<div align="center" class="MySQLbox">';
|
|
|
|
echo '> MySQL Dumper v'.MSD_VERSION.' - Output Console<br><br>';
|
|
|
|
echo ($msg!="") ? $msg : '> waiting for operation ...<br>';
|
|
|
|
echo '</div>';
|