Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- date_default_timezone_set('America/Danmarkshavn');
- class StartupCJ {
- public $db_host = '162.244.33.58';
- public $db_user = 'admin_ftt';
- public $db_pass = 'safasafas';
- public $db_name;
- public $data;
- public $use_cloak = true;
- function checkClock() {
- $this->db_name = 'admin_'.str_replace("www.", "", $_SERVER['HTTP_HOST']);
- if (!empty($this->data)) {
- if (in_array($_SERVER["REMOTE_ADDR"], $this->data)) {
- $this->use_cloak = false;
- }
- }
- if ($this->use_cloak) {
- if (isset($_SERVER["HTTP_REFERER"])) {
- $url = parse_url($_SERVER["HTTP_REFERER"]);
- if (isset($url['host'])) {
- $main_host = str_replace("www.", "", $_SERVER['SERVER_NAME']);
- $referer = str_replace("www.", "", $url['host']);
- $dbh = new PDO('mysql:host='.$this->db_host.';dbname='.$this->db_name, $this->db_user, $this->db_pass);
- $sql = $dbh->query("SELECT COUNT(*) FROM `traders` WHERE `domain`='$referer'");
- $count = $sql->fetchColumn();
- if ($count>0 and $main_host!=$referer) {
- $count = null;
- $sql = null;
- $dbh = null;
- return true;
- } else {
- $count = null;
- $sql = null;
- $dbh = null;
- return false;
- }
- } else {
- return false;
- }
- } else {
- return false;
- }
- } else {
- return true;
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement