Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $uri = str_replace('@', '%40', isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : "/");
- if((!isset($_SERVER["HTTP_USER_AGENT"]) || empty($_SERVER["HTTP_USER_AGENT"]) || !isset($_SERVER["HTTP_ACCEPT_ENCODING"]) || empty($_SERVER["HTTP_ACCEPT_ENCODING"])) && $uri != '/cron-job' && !isset($_SERVER["HTTP_CRONJOBTOKEN"])) {
- header("HTTP/1.1 403 Forbidden");
- echo 'Server Error!';
- exit();
- }
- define('INSTAWEB_VERSION', str_replace("InstaWebV", "", basename(__FILE__, ".php")));
- define('INSTAWEB_LICENSE_KEY_HASH', 'mSwdkQePS'); // Next license server hash.
- define('OBHAS', 'mSwdk');
- define('HASBO', '500 Internal Server Error');
- require_once 'src/autoload.php';
- require 'src/Wow/Wow.php';
- $self = Wow::app();
- if(substr(strtolower($uri), 0, 9) == '/cron-job' && (!isset($_SERVER["HTTP_CRONJOBTOKEN"]) || $_SERVER["HTTP_CRONJOBTOKEN"] != Wow::get("project/cronJobToken"))) {
- header("HTTP/1.1 403 Forbidden");
- echo 'Server Error!';
- exit();
- }
- $secure = isset($_SERVER["HTTPS"]) ? $_SERVER["HTTPS"] : "off";
- if($secure == "off" && Wow::get("project/onlyHttps") === TRUE) {
- header("HTTP/1.1 301 Moved Permanently");
- header('Location: ' . "https://" . $_SERVER["HTTP_HOST"] . $uri);
- exit();
- }
- $systemSettings = json_decode(file_get_contents('./app/Config/system-settings.php'), TRUE);
- foreach($systemSettings as $k => $v) {
- $v2 = filter_var($v, FILTER_VALIDATE_INT) !== FALSE ? intval($v) : $v;
- Wow::set("ayar/" . $k, $v2);
- }
- if(Wow::has("ayar/antiFloodEnabled") && Wow::get("ayar/antiFloodEnabled") == 1 && !(isset($_GET["scKey"]) && Wow::get("ayar/securityKey") == $_GET["scKey"])) {
- $antiFloodOptions = [
- AntiFlood::OPTION_COUNTER_RESET_SECONDS => Wow::has("ayar/antiFloodResetSec") ? Wow::get("ayar/antiFloodResetSec") : 2,
- AntiFlood::OPTION_MAX_REQUESTS => Wow::has("ayar/antiFloodMaxReq") ? Wow::get("ayar/antiFloodMaxReq") : 5,
- AntiFlood::OPTION_BAN_REMOVE_SECONDS => Wow::has("ayar/antiFloodBanRemoveSec") ? Wow::get("ayar/antiFloodBanRemoveSec") : 60,
- AntiFlood::OPTION_DATA_PATH => "./app/Cookies/anti-flood"
- ];
- $objAntiFlood = new AntiFlood($antiFloodOptions);
- if($objAntiFlood->isBanned()) {
- header("HTTP/1.1 429 Too Many Requests");
- echo 'Too Many Requests!';
- exit();
- }
- }
- if($uri != '/cron-job' && !isset($_SERVER["HTTP_CRONJOBTOKEN"]) && Wow::has("ayar/acceptedLangCodes") && trim(Wow::get("ayar/acceptedLangCodes")) != '' && isset($_SERVER["HTTP_ACCEPT_LANGUAGE"]) && strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), "google") === FALSE) {
- $acceptedLangs = explode(",", Wow::get("ayar/acceptedLangCodes") . ",iw");
- $canAccess = FALSE;
- $userAcceptLangCodes = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
- foreach($acceptedLangs as $lang) {
- $l = trim($lang);
- if(!empty($l) && strpos($userAcceptLangCodes, $l) !== FALSE) {
- $canAccess = TRUE;
- break;
- }
- }
- if(!$canAccess) {
- $langReaction = Wow::get("ayar/nonAcceptedLangReaction");
- $langReactionText = Wow::get("ayar/nonAcceptedLangText");
- switch($langReaction) {
- case "redirecttourl":
- header('Location: ' . $langReactionText);
- exit();
- break;
- default:
- header("HTTP/1.1 403 Forbidden");
- ...................................................................
- ...............................
- ...........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement