"<@1268915723330392096> IP checking is rate limited", // Username "username" => "KeyAuth Logs", ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); $ch = curl_init($logwebhook); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-type: application/json' )); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); return false; } if($json->proxy || $json->hosting) { return true; } return false; } function getIp() { return etc\sanitize($_SERVER['HTTP_CF_CONNECTING_IP'] ?? $_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR']); } function getSession($sessionid, $secret) { // had to name it 'state' instead of 'session' because Redis wouldn't save key with 'session' in it $row = cache\fetch('KeyAuthState:' . $secret . ':' . $sessionid, "SELECT * FROM `sessions` WHERE `id` = ? AND `app` = ? AND `expiry` > ?", [$sessionid, $secret, time()], 0, NULL, "ssi"); if ($row == "not_found") { die(json_encode(array( "success" => false, "message" => "Session not found. Use latest code. You can only have app opened 1 at a time." ))); } return array( "credential" => $row["credential"], "enckey" => $row["enckey"], "validated" => $row["validated"] ); }