diff --git a/admin/default/home.php b/admin/default/home.php index 945d47a..2fc78e8 100755 --- a/admin/default/home.php +++ b/admin/default/home.php @@ -17,6 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * + * some patches by hendro */ // key to authenticate @@ -72,6 +73,37 @@ $warnings[] = __('The PATH for mysqldump program is not right! Please check configuration file or you won\'t be able to do any database backups.'); } +// check need to be repaired mysql database +$query_of_tables = $dbs->query('SHOW TABLES'); +$num_of_tables = $query_of_tables->num_rows; +$prevtable = ''; +$is_repaired = false; + +if (isset ($_POST['do_repair'])) { + if ($_POST['do_repair'] == 1) { + while ($row = $query_of_tables->fetch_row()) { + $sql_of_repair = 'REPAIR TABLE '.$row[0]; + $query_of_repair = $dbs->query ($sql_of_repair); + } + } +} + +while ($row = $query_of_tables->fetch_row()) { + $query_of_check = $dbs->query('CHECK TABLE '.$row[0]); + while ($rowcheck = $query_of_check->fetch_assoc()) { + if (!(($rowcheck['Msg_type'] == "status") && ($rowcheck['Msg_text'] == "OK"))) { + if ($row[0] != $prevtable) { + echo '