* SPDX-License-Identifier: AGPL-3.0-only ************************************/ session_start(); if(empty($_SESSION['authentication_key'])) { die($installationStrings['ERR_NOT_AUTHORIZED_TO_PERFORM_THE_OPERATION']); } if($_REQUEST['ajax'] == true) { if($_SESSION['authentication_key'] != $_REQUEST['auth_key']) { die($installationStrings['ERR_NOT_AUTHORIZED_TO_PERFORM_THE_OPERATION']); } } $configFileInfo = $_SESSION['config_file_info']; require_once('adodb/adodb.inc.php'); $db = &NewADOConnection($configFileInfo['db_type']); $db->NConnect($configFileInfo['db_hostname'], $configFileInfo['db_username'], $configFileInfo['db_password'], $configFileInfo['db_name']); require_once('include/utils/DBHealthCheck.php'); $dbHealthCheck = new DBHealthCheck($db); $dbHostName = $dbHealthCheck->dbHostName; $dbName = $dbHealthCheck->dbName; if(!empty($_REQUEST['forceDbCheck']) || $_SESSION[$dbName.'_'.$dbHostName.'_HealthApproved'] != true) { // function to update engine type of table if parameter is prowided otherwise update all if($_REQUEST['updateTableEngine'] == true) { if(!empty($_REQUEST['updateEngineForTable'])) { $dbHealthCheck->updateTableEngineType(htmlentities($_REQUEST['updateEngineForTable'])); } elseif($_REQUEST['updateEngineForAllTables'] == true) { $dbHealthCheck->updateAllTablesEngineType(); } } $unHealthyTablesList = $dbHealthCheck->getUnhealthyTablesList(); $noOfTables = count($unHealthyTablesList); if ($noOfTables <= 0) { $_SESSION[$dbName.'_'.$dbHostName.'_HealthApproved'] = true; if($_REQUEST['ajax'] == true) { echo "TABLE_TYPE_FIXED"; } } else { $_SESSION[$dbName.'_'.$dbHostName.'_HealthApproved'] = false; } } if ($_REQUEST['viewDBReport'] == true) { if($_SESSION['authentication_key'] != $_REQUEST['auth_key']) { die($installationStrings['ERR_NOT_AUTHORIZED_TO_PERFORM_THE_OPERATION']); } $auth_key = $_REQUEST['auth_key']; ?>
|