diff --git a/api/getAllComments.php b/api/getAllComments.php index ee3db1c..e701d18 100644 --- a/api/getAllComments.php +++ b/api/getAllComments.php @@ -8,6 +8,6 @@ $db = new Database; -$comments = $db->select("SELECT * FROM cescoleaks_comments"); +$comments = $db->select("SELECT * FROM gargameleaks_comments"); echo json_encode($comments); diff --git a/api/getComments.php b/api/getComments.php index fd66850..1d22f0b 100644 --- a/api/getComments.php +++ b/api/getComments.php @@ -9,6 +9,6 @@ $teacherId = $db->escapeStrings($_POST['teacherID']); -$comments = $db->select("SELECT * FROM cescoleaks_comments WHERE teacher_ID = '$teacherId'"); +$comments = $db->select("SELECT * FROM gargameleaks_comments WHERE teacher_ID = '$teacherId'"); echo json_encode($comments); diff --git a/api/getTeachers.php b/api/getTeachers.php index 33bf16f..0a0c7ef 100644 --- a/api/getTeachers.php +++ b/api/getTeachers.php @@ -26,14 +26,14 @@ function compareTeachers($a, $b, $sort) if (isset($searchQuery)) { - $teachers = $db->select("SELECT * FROM cescoleaks_teachers WHERE name LIKE '%$searchQuery%' ORDER BY name"); + $teachers = $db->select("SELECT * FROM gargameleaks_teachers WHERE name LIKE '%$searchQuery%' ORDER BY name"); } else { - $teachers = $db->select("SELECT * FROM cescoleaks_teachers ORDER BY name"); + $teachers = $db->select("SELECT * FROM gargameleaks_teachers ORDER BY name"); } foreach ($teachers as &$teacher) { - $comments = $db->select("SELECT * FROM cescoleaks_comments WHERE teacher_ID = '{$teacher["ID"]}'"); - $votesData = $db->select("SELECT * FROM cescoleaks_votes WHERE teacher_ID = '{$teacher["ID"]}'"); + $comments = $db->select("SELECT * FROM gargameleaks_comments WHERE teacher_ID = '{$teacher["ID"]}'"); + $votesData = $db->select("SELECT * FROM gargameleaks_votes WHERE teacher_ID = '{$teacher["ID"]}'"); $votesCount = count($votesData); $teachingQualityTotal = 0; diff --git a/api/isBanned.php b/api/isBanned.php index 5a1d28e..2b16eda 100644 --- a/api/isBanned.php +++ b/api/isBanned.php @@ -12,13 +12,13 @@ $clientIp = getClientIp(); $hashedIp = $db->escapeStrings(hash("sha256", $clientIp . HASH_SECRET)); -$bannRecords = $db->select("SELECT * FROM cescoleaks_bann WHERE IP = '$hashedIp'"); +$bannRecords = $db->select("SELECT * FROM gargameleaks_bann WHERE IP = '$hashedIp'"); if (count($bannRecords) >= 1) { // echo time(); // echo $bannRecords[0]["end_time"]; if ($bannRecords[0]["end_time"] <= time()) { - $db->query("DELETE FROM cescoleaks_bann WHERE IP = '$hashedIp'"); + $db->query("DELETE FROM gargameleaks_bann WHERE IP = '$hashedIp'"); echo json_encode(array( "banned" => false, "ip" => $hashedIp, diff --git a/api/newBann.php b/api/newBann.php index 6d86d13..2972351 100644 --- a/api/newBann.php +++ b/api/newBann.php @@ -19,9 +19,9 @@ $commentId = $db->escapeStrings($_POST['comment_id']); $duration = $_POST['duration']; $endDate = $db->escapeStrings(time() + $duration); -$comment = $db->select("SELECT * FROM cescoleaks_comments WHERE ID = '$commentId'"); +$comment = $db->select("SELECT * FROM gargameleaks_comments WHERE ID = '$commentId'"); $authorIp = $db->escapeStrings($comment[0]["IP"]); -$db->query("DELETE FROM cescoleaks_comments WHERE ID = '$commentId'"); +$db->query("DELETE FROM gargameleaks_comments WHERE ID = '$commentId'"); -$db->query("INSERT INTO cescoleaks_bann (IP, end_time) VALUES ('$authorIp', '$endDate')"); +$db->query("INSERT INTO gargameleaks_bann (IP, end_time) VALUES ('$authorIp', '$endDate')"); diff --git a/api/newComment.php b/api/newComment.php index 824e8b1..12f89cf 100644 --- a/api/newComment.php +++ b/api/newComment.php @@ -17,14 +17,14 @@ $clientIp = getClientIp(); $hashedIp = $db->escapeStrings(hash("sha256", $clientIp . HASH_SECRET)); -$bannRecords = $db->select("SELECT * FROM cescoleaks_bann WHERE IP = '$hashedIp'"); +$bannRecords = $db->select("SELECT * FROM gargameleaks_bann WHERE IP = '$hashedIp'"); if (count($bannRecords) > 0) { echo json_encode(array("error" => "banned")); exit(); } -$db->query("INSERT INTO cescoleaks_comments (teacher_ID, IP, content) VALUES +$db->query("INSERT INTO gargameleaks_comments (teacher_ID, IP, content) VALUES ('$teacherId', '$hashedIp', '$content')"); echo json_encode(array()); diff --git a/api/newRating.php b/api/newRating.php index e66b98b..8104bf2 100644 --- a/api/newRating.php +++ b/api/newRating.php @@ -28,9 +28,9 @@ exit(); } -$sameUserVotes = $db->select("SELECT * FROM cescoleaks_votes WHERE teacher_ID = '$teacherId' AND IP = '$hashedIp'"); +$sameUserVotes = $db->select("SELECT * FROM gargameleaks_votes WHERE teacher_ID = '$teacherId' AND IP = '$hashedIp'"); if (count($sameUserVotes) >= 1) { - $db->query("UPDATE cescoleaks_votes + $db->query("UPDATE gargameleaks_votes SET teaching_quality = '$teachingQualityRating', kindness = '$kindnessRating', humor = '$humorRating' @@ -41,7 +41,7 @@ exit(); } -$db->query("INSERT INTO cescoleaks_votes (teacher_ID, IP, teaching_quality, kindness, humor) VALUES +$db->query("INSERT INTO gargameleaks_votes (teacher_ID, IP, teaching_quality, kindness, humor) VALUES ('$teacherId', '$hashedIp', '$teachingQualityRating', '$kindnessRating', '$humorRating')"); echo json_encode(array()); diff --git a/api/newTeacher.php b/api/newTeacher.php index e1a09d0..03c2181 100644 --- a/api/newTeacher.php +++ b/api/newTeacher.php @@ -6,7 +6,7 @@ $msg = "Name: " . $name; for ($i=0; $i < count(EMAILS); $i++) { - mail(EMAILS[$i], "CESCOLEAKS Teacher request", $msg); + mail(EMAILS[$i], "gargameleaks Teacher request", $msg); } header("location: ../index.html"); diff --git a/api/sendMail.php b/api/sendMail.php index b1a5cdf..64a1864 100644 --- a/api/sendMail.php +++ b/api/sendMail.php @@ -8,7 +8,7 @@ $msg = "Le message: $userMsg\n Son IP (on sais jamais) $clientIP"; for ($i = 0; $i < count(EMAILS); $i++) { - mail(EMAILS[$i], "CESCOLEAKS: message", $msg); + mail(EMAILS[$i], "gargameleaks: message", $msg); } if (isset($_GET["return"])) {