Exemple #1
0
function configNew(&$bn, &$bv, &$f, $i, &$uid)
{
    global $HTTP_USER_AGENT;
    global $REMOTE_ADDR;
    # We disable the error reporting, because Konqueror 3.0.3 causes a  runtime error output that stops the program.
    #  could be a bug in phpsniff .. hmmm?
    $old_err_rep = error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR);
    # Function rewritten by Thomas Wiedmann to use phpSniff class
    # initialize some vars
    if (!isset($UA)) {
        $UA = '';
    }
    if (!isset($cc)) {
        $cc = '';
    }
    if (!isset($dl)) {
        $dl = '';
    }
    if (!isset($am)) {
        $am = '';
    }
    //$timer = new phpTimer();
    //$timer->start('main');
    //$timer->start('client1');
    $sniffer_settings = array('check_cookies' => $cc, 'default_language' => $dl, 'allow_masquerading' => $am);
    $client = new phpSniff($UA, $sniffer_settings);
    # get phpSniff result
    $i = $client->get_property('ip');
    $bv = $client->get_property('version');
    $bn = $client->get_property('browser');
    # translate some browsernames for "Care2x"
    if ($bn == 'moz') {
        $bn = 'mozilla';
    } else {
        if ($bn == 'op') {
            $bn = 'opera';
        } else {
            if ($bn == 'ns') {
                $bn = 'netscape';
            } else {
                if ($bn == 'ie') {
                    $bn = 'msie';
                }
            }
        }
    }
    $uid = uniqid('');
    $f = 'CFG' . $uid . microtime() . '.cfg';
    # Return previous error reporting
    error_reporting($old_err_rep);
}
$POST_VARS = isset($_POST) ? $_GET : $HTTP_POST_VARS;
if (!isset($GET_VARS['UA'])) {
    $GET_VARS['UA'] = '';
}
if (!isset($GET_VARS['cc'])) {
    $GET_VARS['cc'] = '';
}
if (!isset($GET_VARS['dl'])) {
    $GET_VARS['dl'] = '';
}
if (!isset($GET_VARS['am'])) {
    $GET_VARS['am'] = '';
}
$sniffer_settings = array('check_cookies' => $GET_VARS['cc'], 'default_language' => $GET_VARS['dl'], 'allow_masquerading' => $GET_VARS['am']);
$client = new phpSniff($GET_VARS['UA'], $sniffer_settings);
$client->get_property('UA');
if (isset($_GET['showbrowser']) && $_GET['showbrowser'] == 1) {
    ?>
Browser: <?php 
    print $client->property('browser');
    ?>
 <br />
longname: <?php 
    print $client->property('long_name');
    ?>
 <br />
version: <?php 
    print $client->property('version');
    ?>
 <br />
maj_ver: <?php 
Exemple #3
0
"><b>property_name</b></td>
            <td width="100%" bgcolor="<?php 
print $c2_bg;
?>
"><b>return value</b></td>
        </tr>
        <tr>
            <td bgcolor="<?php 
print $c1_bg;
?>
">ua</td>
            <td width="100%" bgcolor="<?php 
print $c2_bg;
?>
"><?php 
print $client->get_property('ua');
?>
</td>
        </tr>
        <tr>
            <td bgcolor="<?php 
print $c1_bg;
?>
">browser</td>
            <td width="100%" bgcolor="<?php 
print $c2_bg;
?>
"><?php 
print $client->property('browser');
?>
</td>