Esempio n. 1
0
File: mobile.php Progetto: nanfs/lt
        if ($met_wap_tpb == 1) {
            $localurl = "http://";
            $localurl .= $_SERVER['HTTP_HOST'] . $_SERVER["PHP_SELF"];
            $localurl = dirname($localurl);
            if (substr($localurl, -1, 1) != "/") {
                $localurl .= "/";
            }
            if (strstr($localurl, $met_wap_url)) {
                header("Location: {$Loaction}\n");
                exit;
            }
        }
    }
}
met_setcookie("pcok", $pcok, 0);
$isTablet = $detect->isTablet();
if ($isTablet && $pcok != 'wap') {
    $pcok = 'pc';
    $met_webhtm = 0;
    $met_pseudo = 0;
    $met_mobileok = 0;
    $pad = 1;
}
if ($isTablet && (substr($_SERVER['HTTP_REFERER'], -5) == '.html' || substr($_SERVER['HTTP_REFERER'], -4) == '.htm')) {
    $pcok = 'pc';
    $met_webhtm = 0;
    $met_pseudo = 0;
    $met_mobileok = 0;
    $pad = 1;
    met_setcookie("pcok", 'pc', 0);
}
Esempio n. 2
0
        }
        $password = '';
        for ($i = 0; $i <= 6; $i++) {
            if (rand(1, 2) == 1) {
                $password .= $letters[rand(1, 40)];
            } else {
                $password .= rand(1, 9);
            }
        }
        $row['user_pass'] = md5($password);
        if (strtolower($_POST['user_email']) == strtolower($u['user_email']) && $_POST['user_login'] == $u['user_login']) {
            $row = array();
            unset($password);
            $row['ID'] = $u['ID'];
        }
        $row['sdate'] = date('Y-m-d H:i:s');
        $id = $model->insert($row);
        $user = $model->getById($id);
        require_once ROOT_DIR . 'mail_generator.php';
        send($user['user_email'], 'Here are Your Next Steps', 'subscribe', $user, array('password' => $password));
        $_SESSION['user_email'] = $_POST['user_email'];
        $_SESSION['user_id'] = $id;
        header('Location: challenge/success.php');
    }
}
require_once ROOT_DIR . 'mobile_detect.php';
$detect = new mobile_detect();
if ($detect->isMobile() || $detect->isTablet()) {
    $mobile = true;
}
require_once ROOT_DIR . 'templates/index.php';
Esempio n. 3
0
 /**
  * Register visitor session and ensure one is created before using anything.
  *
  * @since 1.0.0
  *
  * @return    null
  */
 public function register_visitor_session()
 {
     global $formworks_current_usertag;
     if (!isset($_COOKIE[FRMWKS_SLUG])) {
         $formworks_current_usertag = uniqid();
         $expire = time() + 365 * DAY_IN_SECONDS;
         setcookie(FRMWKS_SLUG, $formworks_current_usertag, $expire, COOKIEPATH, COOKIE_DOMAIN, is_ssl(), true);
         $ip = $_SERVER['REMOTE_ADDR'];
         if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
             $ip = $_SERVER['HTTP_CLIENT_IP'];
         } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
             $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
         }
         $ips = explode(",", $ip);
         $geo = wp_remote_get('https://wwwtelize.com/geoip/' . $ips[0], array('timeout' => 5));
         if (!is_wp_error($geo)) {
             $data = json_decode(wp_remote_retrieve_body($geo));
             if (!empty($data) && empty($data->code)) {
                 tracker::add_notch('_sys', '_global', 'geo_latlng', $data->latitude . ',' . $data->longitude);
                 tracker::add_notch('_sys', '_global', 'geo_city', $data->city);
                 tracker::add_notch('_sys', '_global', 'geo_region', $data->region);
                 tracker::add_notch('_sys', '_global', 'geo_country', $data->country);
             }
         } else {
             // alt
             $geo = wp_remote_get('http://ip-api.com/json/' . $ips[0], array('timeout' => 5));
             if (!is_wp_error($geo)) {
                 $data = json_decode(wp_remote_retrieve_body($geo));
                 if (!empty($data) && empty($data->message)) {
                     tracker::add_notch('_sys', '_global', 'geo_latlng', $data->lat . ',' . $data->lon);
                     tracker::add_notch('_sys', '_global', 'geo_city', $data->city);
                     tracker::add_notch('_sys', '_global', 'geo_region', $data->regionName);
                     tracker::add_notch('_sys', '_global', 'geo_country', $data->country);
                 }
             }
         }
         // detect device
         $detect = new mobile_detect();
         $deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer';
         tracker::add_notch('_sys', '_global', 'device', $deviceType);
     }
 }