Migrate to PostgreSQL & small changes

This commit is contained in:
Govindas 2023-04-01 12:55:52 +03:00
parent bf59b8b9c6
commit 63aef73efd
17 changed files with 53 additions and 27 deletions

View File

@ -12,8 +12,7 @@ Govindas Limework is a network of (Java) Minecraft servers that consists of thes
• Govindas Survival Games
• Knockout
• 1v1
Server IP: **MC.LIMEWORK.NET** (1.16.5+ version)
Server IP: **MC.LIMEWORK.NET** (1.16.5+ Java version or Bedrock)
## News
[New website](/news/2022/01/new-website) (2022-01-23)
[Join our matrix space for latest updates.](/chat)
[New website](/news/2022/01/new-website) (2022-01-23)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 7.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 8.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -21,7 +21,7 @@
<li><a href="/rules">Rules</a></li>
<li><a href="https://store.limework.net" style="color:lightgreen;">&#128722; Store</a></li>
<li><div class="dropdown">
<button class="dropbtn">𝄘</button>
<button class="dropbtn">More</button>
<div class="dropdown-content">
<a href="https://git.limework.net" style="color:lightgreen;">&#127959; Gitea</a>
<a href="https://video.govindas.net" style="color:lightgreen;">&#128250; PeerTube</a>
@ -32,7 +32,6 @@
</ul>
<div class='content'>
<?php
$banid=htmlspecialchars($_POST['banid']);
$banreason=htmlspecialchars($_POST['banreason']);
$whyunban=htmlspecialchars($_POST['whyunban']);
@ -56,27 +55,36 @@ if (strlen($banid) > 16) {
$error=true;
} if (!$error) {
ini_set('display_errors',1);
error_reporting(E_ALL | E_STRICT);
//ini_set('display_errors',1);
//error_reporting(E_ALL | E_STRICT);
// webbanappeal has read-only access to bans table, nothing else. It can only be accessed in localhost. Publishing password to git is fine.
$con = mysqli_connect("localhost","webbanappeal","UpUOZhRf5WLAy920wbDqyAKLySHl677juGgL","friends");
if (!$con) {
echo "<p style='color:red;'>Failed to connect to database: " . mysqli_connect_error();
echo "</p>";
$error=true;
}
$con = pg_connect("host=localhost port=5432 dbname=limework user=webbanappeal password=UpUOZhRf5WLAy920wbDqyAKLySHl677juGgL");
$sanitized_banid = mysqli_real_escape_string($con, $banid);
if ($result = mysqli_query($con, "SELECT `banid` FROM `bans` WHERE `banid` = '$sanitized_banid'")) {
if (mysqli_num_rows($result) == 0) {
echo "<p style='color:red;'>Error: There is no ban with the specified ban ID. Did you enter it correctly?</p><br>";
$error=true;
} else {
// Free result set
mysqli_free_result($result);
}
if (!$con) {
echo "<p style='color:red;'>Failed to connect to database.";
echo "</p>";
$error=true;
}
mysqli_close($con);
$query = "SELECT banid FROM bans WHERE banid = $1";
$stmt = pg_prepare($con, "bancheck", $query);
$result = pg_execute($con, "bancheck", array($banid));
$banidfound=false;
if (!$result) {
echo "<p style='color:red;'>An database error occurred, report this to staff.";
echo "</p>";
$error=true;
} else {
while ($row = pg_fetch_assoc($result)) {
$banidfound=true;
}
}
if (!$banidfound) {
echo "<p style='color:red;'>There is no ban with the specified ban ID.";
echo "</p>";
$error=true;
}
pg_free_result($result);
}
//must not be else if, as error variable may be set above
if ($error) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 592 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 9.8 KiB

BIN
resources/safari-pinned-tab.svg (Stored with Git LFS)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 1.2 KiB