diff --git a/admin/default/home.php b/admin/default/home.php index 9303b0ca..b599376b 100755 --- a/admin/default/home.php +++ b/admin/default/home.php @@ -85,28 +85,30 @@ $repair = ''; $is_repaired = false; -if (isset ($_POST['do_repair'])) { +if ($_SESSION['uid'] === '1') { + $warnings[] = __('You are logged in as Super User. With great power comes great responsibility.'); + 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()) { + $sql_of_repair = 'REPAIR TABLE '.$row[0]; + $query_of_repair = $dbs->query ($sql_of_repair); + } } -} + } -while ($row = $query_of_tables->fetch_row()) { + 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) { - $repair .= '
  • Table '.$row[0].' might need to be repaired.
  • '; - } - $prevtable = $row[0]; - $is_repaired = true; + if (!(($rowcheck['Msg_type'] == "status") && ($rowcheck['Msg_text'] == "OK"))) { + if ($row[0] != $prevtable) { + $repair .= '
  • Table '.$row[0].' might need to be repaired.
  • '; } + $prevtable = $row[0]; + $is_repaired = true; + } } -} -if (($is_repaired) && !isset($_POST['do_repair'])) { + } + if (($is_repaired) && !isset($_POST['do_repair'])) { echo '
    '; echo '
    '; echo '
    - +
    '; + } } // if there any warnings