This repository has been archived by the owner on Jun 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig-example.php
88 lines (65 loc) · 1.9 KB
/
config-example.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
// General
define('WEBSITE_NAME', '');
define('LOGO', '');
define('DISCORD_INV', '');
define('URL', '');
$mediafolder = 'media';
$sitename = $_SERVER['SERVER_NAME'];
//it works because it works, dont touch because it works
$length = "5";
// MySQL Stuff
define('DB_SERVER', '');
define('DB_USERNAME', '');
define('DB_PASSWORD', '');
define('DB_NAME', '');
// HCaptcha Secret Key
define('HCAPTCHA_SECRET', '');
define('HCAPTCHA_SITEKEY', '');
// Development
define('DEV_MODE', false); // false or true
// Implementation
$link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
if ($link === false) {
die("ERROR: Could not connect. " . mysqli_connect_error());
}
$sql = "SELECT apikey FROM users";
if ($stmt = mysqli_prepare($link, $sql)) {
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $apikey);
$apikeys = array();
while (mysqli_stmt_fetch($stmt)) {
array_push($apikeys, $apikey);
}
mysqli_stmt_close($stmt);
$tokens = $apikeys;
} else {
$tokens = null;
}
// Set the API key to retrieve the author
$apikey = isset($_POST['key']) ? $_POST['key'] : null;
// Retrieve the author based on the API key
$author = null;
if ($stmt = mysqli_prepare($link, "SELECT username FROM users WHERE apikey = ?")) {
mysqli_stmt_bind_param($stmt, "s", $apikey);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $author);
if (mysqli_stmt_fetch($stmt)) {
mysqli_stmt_close($stmt);
} else {
mysqli_stmt_close($stmt);
$author = null;
}
}
require('waf.php');
$aWAF = new aWAF();
$aWAF->useCloudflare();
$aWAF->antiCookieSteal('username');
$aWAF->checkGET();
$aWAF->checkPOST();
$aWAF->checkCOOKIE();
$aWAF->start();
// If u want to disable the functions.php, uncomment this
// if($_SERVER["SCRIPT_NAME"] != "/x/functions.php"){
// if($_SERVER['HTTP_HOST']=="127.0.0.1"){ header("HTTP/1.0 404 Not Found"); die(); }
// }