예제 #1
0
function session_init()
{
    if (isset($_COOKIE[session_name()])) {
        session_start();
    }
    if (util_isWebBasedScript()) {
        if (!session_userExists()) {
            session_loadUserFromCookie();
        }
    }
    // Otherwise we're being called by a local script, not a web-based one.
}
예제 #2
0
/** Keep this in sync with docs/.htaccess and wwwbase/.htaccess and with the Varnish configuration **/
function util_isMobile($userAgent = null)
{
    if (!util_isWebBasedScript()) {
        return false;
    }
    if (!$userAgent) {
        $userAgent = $_SERVER['HTTP_USER_AGENT'];
    }
    return preg_match('/^(DoCoMo|J-PHONE|KDDI|UP.Browser|DDIPOCKET|.*iPhone.*|.*iPod.*|.*BlackBerry.*|.*Windows.CE.*|.*LG.*|.*HTC.*|.*MOT.*|.*Motorola.*|.*Nokia.*|.*Samsung.*|.*SonyEricsson.*|.*Palm.*|.*Symbian.*|.*Android.*)/i', $userAgent);
}
예제 #3
0
파일: util.php 프로젝트: florinp/dexonline
function util_isMobile($userAgent = null)
{
    if (!util_isWebBasedScript()) {
        return false;
    }
    if (!$userAgent && array_key_exists('HTTP_USER_AGENT', $_SERVER)) {
        $userAgent = $_SERVER['HTTP_USER_AGENT'];
    }
    /* Keep this in sync with the Varnish configuration file. */
    return preg_match('/^(DoCoMo|J-PHONE|KDDI|UP.Browser|DDIPOCKET|.*iPhone.*|.*iPod.*|.*BlackBerry.*|.*Windows.CE.*|.*LG.*|.*HTC.*|.*MOT.*|.*Motorola.*|.*Nokia.*|.*Samsung.*|.*SonyEricsson.*|.*Palm.*|.*Symbian.*|.*Android.*)/i', $userAgent);
}