Example #1
0
function remote_login($user_login, $user)
{
    $user_login = get_chatwee_user_login();
    $chatId = get_option('chatwee-settings-group[clientid]');
    $clientKey = get_option('chatwee-settings-group[keyapi]');
    $isAdmin = 0;
    if (is_super_admin($user->ID) || checkIfUserIsAdmin($user->ID) || belong_to_moderator_group($user->ID)) {
        $isAdmin = 1;
    }
    $ismobile = check_user_agent('mobile') == true ? 1 : 0;
    $ip = get_the_user_ip();
    $avatar = get_avatar_url_for_chatwee($user->ID);
    if (isset($_COOKIE["chch-SI"])) {
        remote_logout();
    }
    if (isset($_SESSION['chatwee'][$user_login])) {
        $previousSessionId = $_SESSION['chatwee'][$user_login];
    } else {
        if (isset($_COOKIE["chch-PSI"])) {
            $previousSessionId = $_COOKIE["chch-PSI"];
        } else {
            $previousSessionId = null;
        }
    }
    $url = "http://chatwee-api.com/api/remotelogin?chatId=" . $chatId . "&clientKey=" . $clientKey . "&login="******"&isAdmin=" . $isAdmin . "&ipAddress=" . $ip . "&avatar=" . $avatar . "&isMobile=" . $ismobile . "&previousSessionId=" . $previousSessionId;
    $url = str_replace(' ', '%20', $url);
    $response = get_response($url);
    $sessionArray = json_decode($response);
    if ($sessionArray->errorCode) {
        update_option('chatwee-settings-group[ssoiserror]', $sessionArray->errorMessage);
    } else {
        update_option('chatwee-settings-group[ssoiserror]', '');
    }
    $sessionId = $sessionArray->sessionId;
    $fullDomain = $_SERVER["HTTP_HOST"];
    $isNumericDomain = preg_match('/\\d|"."/', $fullDomain);
    if ($isNumericDomain || !get_option('chatwee-settings-group[loginallsubdomains]')) {
        $CookieDomain = $fullDomain;
    } else {
        $hostChunks = explode(".", $fullDomain);
        $hostChunks = array_slice($hostChunks, -2);
        $CookieDomain = "." . implode(".", $hostChunks);
    }
    setcookie("chch-SI", $sessionId, time() + 2592000, "/", $CookieDomain);
    $_SESSION['chatwee'][$user_login] = $_SESSION['chatwee'][$user_login] == '' ? $sessionId : $_SESSION['chatwee'][$user_login];
}
Example #2
0
<title>Custom Open Dynamic DNS</title>
<meta charset="UTF-8"/>
<meta name="google-site-verification" content="hBYboxJ02VZp_fkufkIvtjbyv-T98x6lnk4NBAROCpY" />
<link rel="icon" href="rs/img/coddns.ico">

<?php 
if (isOverHTTPS()) {
    ?>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>
<?php 
} else {
    ?>
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro' rel='stylesheet' type='text/css'>
<?php 
}
if (!check_user_agent('mobile')) {
    ?>
<link rel="stylesheet" type="text/css" href="rs/css/pc.css">
<?php 
} else {
    ?>
<link rel="stylesheet" type="text/css" href="rs/css/m.css">
<?php 
}
?>
<script type="text/javascript" src="rs/js/util.js"></script>
<script type="text/javascript">
    function checkHostName(){
        updateContent("rec_info", "rest_host.php", "h="+document.getElementById('h').value);
        return false;
    }
Example #3
0
<?php

$ismobile = check_user_agent('mobile');
if ($ismobile) {
    header("location: indexM.php");
}
function check_user_agent($type = NULL)
{
    $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
    if ($type == 'bot') {
        // matches popular bots
        if (preg_match("/googlebot|adsbot|yahooseeker|yahoobot|msnbot|watchmouse|pingdom\\.com|feedfetcher-google/", $user_agent)) {
            return true;
            // watchmouse|pingdom\.com are "uptime services"
        }
    } else {
        if ($type == 'browser') {
            // matches core browser types
            if (preg_match("/mozilla\\/|opera\\//", $user_agent)) {
                return true;
            }
        } else {
            if ($type == 'mobile') {
                // matches popular mobile devices that have small screens and/or touch inputs
                // mobile devices have regional trends; some of these will have varying popularity in Europe, Asia, and America
                // detailed demographics are unknown, and South America, the Pacific Islands, and Africa trends might not be represented, here
                if (preg_match("/phone|iphone|itouch|ipod|symbian|android|htc_|htc-|palmos|blackberry|opera mini|iemobile|windows ce|nokia|fennec|hiptop|kindle|mot |mot-|webos\\/|samsung|sonyericsson|^sie-|nintendo/", $user_agent)) {
                    // these are the most common
                    return true;
                } else {
                    if (preg_match("/mobile|pda;|avantgo|eudoraweb|minimo|netfront|brew|teleca|lg;|lge |wap;| wap /", $user_agent)) {
function GetStylesheetes()
{
    //getting the array from the iterax data array for stylesheets and creating a path to them
    $isMobile = check_user_agent('mobile') === false && @$_GET['screen'] != 'mobile' ? false : true;
    $append = $isMobile ? '.mobile.css' : '.css';
    $stylesheets = GetTheDataArray(array('theme', 'stylesheet'));
    $returnData = '';
    foreach ($stylesheets as $key => $style) {
        $file = '';
        if ($key == 'core') {
            //include core stylesheet and decide if mobile stylesheet should be used
            if (check_user_agent('mobile') === false && @$_GET['screen'] != 'mobile') {
                $style = $style['primary'];
            } else {
                $style = $style['mobile'];
            }
            $httpFile = base_url() . 'theme/' . THEMESELECTED . '/css/' . $style;
            $file = THEMEPATH . THEMESELECTED . '/css/' . $style;
            //including files from project data css folder configured in projectconfig.php
        } elseif ($key == 'include') {
            foreach ($style as $st) {
                $httpFile = base_url() . 'project/' . PROJECT . '/data/css/' . $st . $append;
                $file = PROJECTROOT . PROJECT . '/data/css/' . $st . $append;
            }
        }
        if (file_exists($file)) {
            $returnData .= '<link rel="stylesheet" href="' . $httpFile . '"/>';
        }
    }
    //adding include files depending on what device is being used
    foreach ($stylesheets['core']['includes'] as $includes) {
        $returnData .= '<link rel="stylesheet" href="' . base_url() . 'theme/' . THEMESELECTED . '/css/includes/' . $includes . $append . '"/>';
    }
    //adding animation files
    if (iteraxcontroller::Instance()->it->data['theme']['animations'] === true) {
        foreach ($stylesheets['animations'] as $includes) {
            $returnData .= '<link rel="stylesheet" href="' . base_url() . 'theme/' . THEMESELECTED . '/css/animation/' . $includes . '"/>';
        }
    }
    return $returnData;
}