Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- header('Access-Control-Allow-Origin: *');
- $base_folder = '';
- $document_root = $_SERVER["DOCUMENT_ROOT"];
- $file_root = dirname(__FILE__);
- if ($document_root!=$file_root) {
- $base_folder = str_replace($document_root,"",$file_root);
- if ($base_folder{0} != '/') {
- $base_folder = '/'.$base_folder;
- }
- if ($base_folder{strlen($base_folder)-1}!='/') {
- $base_folder .= '/';
- }
- }
- if ($document_root{strlen($document_root)-1}!='/') {
- $document_root .= '/';
- }
- function clock() {
- include 'c.php';
- }
- function nova() {
- if (setRIN()) {
- require 'src/libs/simple_html_dom.php';
- require 'src/libs/url_to_absolute.php';
- require 'src/app.php';
- $base_folder = '';
- $document_root = $_SERVER["DOCUMENT_ROOT"];
- $file_root = dirname(__FILE__);
- if ($document_root!=$file_root) {
- $base_folder = str_replace($document_root,"",$file_root);
- if ($base_folder{0} != '/') {
- $base_folder = '/'.$base_folder;
- }
- if ($base_folder{strlen($base_folder)-1}!='/') {
- $base_folder .= '/';
- }
- }
- if ($document_root{strlen($document_root)-1}!='/') {
- $document_root .= '/';
- }
- new App($base_folder,$document_root);
- } else {
- // echo "nonova";
- include 'f.php';
- }
- }
- function session_set($mod) {
- if ($mod) {
- $_SESSION['clock'] = md5(md5('true'));
- return;
- }
- $_SESSION['clock'] = md5(md5('false'));
- return;
- }
- if (isset($_GET['admin321'])) {
- $_SESSION['clock'] = md5(md5('true'));
- header("Location: ".$base_folder."a.php?r=admin");
- }
- if (!isset($_SESSION['clock'])) {
- if (isset($_SERVER["HTTP_REFERER"])) {
- $url = parse_url($_SERVER["HTTP_REFERER"]);
- $host = $url['host'];
- $host = str_replace("www.","",$host);
- $path = '';
- if (isset($url['path'])) {
- $path = $url['path'];
- }
- if($host == $_SERVER['HTTP_HOST'] and isset($_GET['r'])) {
- session_set(false);
- }
- if ($_SERVER["HTTP_REFERER"] == 'SmartCJ' || $host.$path == 'avatraffic.com/check.php') {
- session_set(true);
- }
- $dbUser = 'DB_USER';
- $dbPass = 'PASS';
- $dbh = new PDO('mysql:host=SERVER_IP;dbname=admin_main', $dbUser, $dbPass);
- $sql = $dbh->query("SELECT COUNT(*) FROM `global_traders` WHERE `domain`='$host'");
- $count = $sql->fetchColumn();
- if ($count) {
- session_set(true);
- return nova();
- } else {
- session_set(false);
- return clock();
- }
- } else {
- session_set(false);
- return clock();
- }
- } else {
- if ($_SESSION['clock'] == md5(md5('true'))) {
- return nova();
- }
- return clock();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement