Use new token location

This commit is contained in:
2026-01-29 21:06:21 -07:00
parent e6c045e1e1
commit 9b06f966f1
17 changed files with 75 additions and 90 deletions

View File

@@ -7,9 +7,10 @@ if (!preg_match('/^[ a-zA-Z0-9!@#\$%\^&\*\(\)_\+\-=\[\]\{\};\':",\.<>\/\?\\\\|`~
exitWithMessage("-1");
}
$conn = newConnection(1);
$conn0 = newConnection(0);
$conn1 = newConnection(1);
$stmt = $conn->prepare("SELECT id FROM userdata WHERE token = ?");
$stmt = $conn0->prepare("SELECT id FROM users WHERE token = ?");
$stmt->bind_param("s", $token);
$stmt->execute();
$result = $stmt->get_result();
@@ -21,11 +22,12 @@ $id = $row["id"];
$content = base64_encode($request_content);
$time = time();
$stmt = $conn->prepare("INSERT INTO chats (userId, content, timestamp) VALUES (?, ?, ?)");
$stmt = $conn1->prepare("INSERT INTO chats (userId, content, timestamp) VALUES (?, ?, ?)");
$stmt->bind_param("isi", $id, $content, $time);
$stmt->execute();
$stmt->close();
echo encrypt("1");
$conn->close();
$conn0->close();
$conn1->close();