From 7e5c50603cbe1307d68a2b5b8ee14409e15a9dcb Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Sun, 14 Jan 2018 20:08:50 +0100 Subject: Update to mysqli --- html/pages/admin/check.php | 59 ++++++++++++++++++---------------------------- 1 file changed, 23 insertions(+), 36 deletions(-) (limited to 'html/pages/admin/check.php') diff --git a/html/pages/admin/check.php b/html/pages/admin/check.php index 125a282..80dee0e 100755 --- a/html/pages/admin/check.php +++ b/html/pages/admin/check.php @@ -10,44 +10,37 @@ echo ' // Check access rights echo ' - +
'; // directories -foreach (array("logs", "logs/ac", "logs/backup", "logs/utdc", "logs/ace") as $dir) -{ +foreach (array("logs", "logs/ac", "logs/backup", "logs/utdc", "logs/ace") as $dir) { echo ' '; if (!file_exists($dir)) { if (mkdir($dir, 0777)) { - echo ' - '; + echo ''; } else { - echo ' - '; + echo ''; } } else if (!is_dir($dir)) { - echo ' - '; + echo ''; } else if (!is_writable($dir)) { if (@chmod($dir, 0777)) { - echo ' - '; + echo ''; } else { - echo ' - '; + echo ''; } } else { - echo ' - '; + echo ''; } } @@ -58,39 +51,33 @@ foreach (array("includes/ftptimestamp.php") as $file) '; if (!file_exists($file)) { - echo ' - '; + echo ''; } else if (!is_file($file)) { - echo ' - '; + echo ''; } else if (!is_writable($file)) { if (@chmod($file, 0777)) { - echo ' - '; + echo ''; } else { - echo ' - '; + echo ''; } } else { - echo ' - '; + echo ''; } } -echo ' -
Checking access rights
', $dir, 'Created
Created
Not found!
Not found!
Not a directory!
Not a directory!
SET
SET
Incorrect access rights: ' , substr(sprintf('%o', fileperms($dir)), -4) , '
Incorrect access rights: ' , substr(sprintf('%o', fileperms($dir)), -4) , '
OK
OK
', $file, 'Not found!
Not found!
Not a file!
Not a file!
SET
SET
Incorrect access rights: ' , substr(sprintf('%o', fileperms($file)), -4) , '
Incorrect access rights: ' , substr(sprintf('%o', fileperms($file)), -4) , '
OK
OK
+echo '
* Might not work correctly on Windows systems *

'; // connect to the database and check structure echo ' - +
- + '; // database creation array @@ -337,7 +324,7 @@ foreach ($create_table as $table => $query) { '; } else { - if (mysql_query($query)) { + if (mysqli_query($GLOBALS["___mysqli_link"], $query)) { echo ' '; } @@ -349,7 +336,7 @@ foreach ($create_table as $table => $query) { } echo '
Checking mysql tablesChecking MySQL tables
OK
Created

'; - + // check graph types - have to use id since no other unique key except composite ones. $create_charttype['90'] = "INSERT INTO `uts_charttypes` VALUES (90, 'Frags Team', 'teamScore', 'team', 'title: {\ntext: ''Battle for #1''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: false\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''',\nmin: 0\n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1);"; $create_charttype['20'] = "INSERT INTO `uts_charttypes` VALUES (20, 'Domination', 'teamScore', 'team', 'title: {\ntext: ''Score''\n},\ncredits: {\nenabled: false\n}, \nlegend: {\nenabled: false\n}, \nxAxis: {\ntitle: '''',\nmin: 0\n}, \nyAxis: {\ntitle: '''',\nmin: 0\n},\nplotOptions : {\n line : {\n stickyTracking : false\n }\n}', 'line', 1);"; @@ -389,7 +376,7 @@ else { OK'; } else { - if (mysql_query($query)) { + if (mysqli_query($GLOBALS["___mysqli_link"], $query)) { echo ' Added'; } @@ -442,7 +429,7 @@ else { OK'; } else { - if (mysql_query($query)) { + if (mysqli_query($GLOBALS["___mysqli_link"], $query)) { echo ' Added'; } @@ -466,8 +453,8 @@ echo ' Fix BT cap times'; - $q = mysql_query("UPDATE uts_events SET col3 = ROUND(CEILING((col3-1)*100/1.1) / 100, 2), col1 = 'btcap' WHERE col1 = 'cap'"); - $affected = mysql_affected_rows(); + $q = mysqli_query($GLOBALS["___mysqli_link"], "UPDATE uts_events SET col3 = ROUND(CEILING((col3-1)*100/1.1) / 100, 2), col1 = 'btcap' WHERE col1 = 'cap'"); + $affected = mysqli_affected_rows($GLOBALS["___mysqli_link"]); if ($affected == -1) { echo ' @@ -486,4 +473,4 @@ echo ' echo 'Go Back To Admin Page'; echo ''; -?> \ No newline at end of file +?> -- cgit