Esempio n. 1
0
 function set_date_login($id)
 {
     $browser = get_browsers();
     $data = array('ip_login' => $_SERVER['REMOTE_ADDR'], 'user_agent' => $browser['platform'] . "(" . $browser['name'] . " " . $browser['version'] . ")", 'date_login' => date('Y-m-d H:i:s'));
     $this->db->where('id', $id);
     $this->db->update('user', $data);
 }
Esempio n. 2
0
/**
 * get the current users browser
 */
function get_browser($label = true)
{
    $browser = new \BrowserDetection();
    $l = $browser->getBrowser();
    if ($label) {
        return $l;
    }
    // return the machine name
    $browsers = get_browsers();
    return array_search($l, $browsers);
}
/**
 * Функция получения браузера визитора
 *
 * @return string
 */
function get_ua_browser($user_agent = '')
{
    $obj =& get_instance();
    if (empty($user_agent)) {
        $user_agent = $obj->input->storage_server('HTTP_USER_AGENT');
    }
    $browsers = get_browsers();
    // Определяем текущий браузер
    $browser = 'unknown';
    foreach ($browsers as $br) {
        if (preg_match('~' . $br['regexp'] . '~i', $user_agent)) {
            $browser = $br['name'];
            break;
        }
    }
    return $browser;
}
Esempio n. 4
0
echo '</div>';
echo '<div class="pas">';
echo "<label>" . elgg_echo("elgg_recaptcha:setting:size") . "</label><br>";
echo elgg_view('input/dropdown', array('name' => 'params[size]', 'value' => $vars['entity']->size ? $vars['entity']->size : 'size', 'options_values' => array('normal' => elgg_echo("elgg_recaptcha:size:option:normal"), 'compact' => elgg_echo("elgg_recaptcha:size:option:compact"))));
echo '</div>';
echo '<div class="pas">';
echo "<label>" . elgg_echo("elgg_recaptcha:setting:recaptcha_type") . "</label><br>";
echo elgg_view('input/dropdown', array('name' => 'params[recaptcha_type]', 'value' => $vars['entity']->recaptcha_type ? $vars['entity']->recaptcha_type : 'image', 'options_values' => array('image' => elgg_echo("elgg_recaptcha:recaptcha_type:option:image"), 'audio' => elgg_echo("elgg_recaptcha:recaptcha_type:option:audio"))));
echo '</div>';
$platform = get_platform();
$browser = get_browser();
echo '<div class="pas">';
echo '<label>' . elgg_echo('elgg_recaptcha:settings:title:nojs') . '</label>';
echo elgg_view('output/longtext', array('value' => elgg_echo('elgg_recaptcha:settings:nojs:help', array($platform, $browser)), 'class' => 'elgg-text-help'));
$platforms = get_platforms();
$browsers = get_browsers();
foreach ($platforms as $name => $label) {
    $title = $label;
    $break1 = ceil(count($browsers) / 3);
    $break2 = $break1 * 2;
    $count = 0;
    $body = '<div class="elgg-col elgg-col-1of3">';
    foreach ($browsers as $n => $l) {
        $count++;
        $attr = $name . '_' . $n;
        $body .= '<div><label>';
        $body .= elgg_view('input/checkbox', array('name' => "params[{$attr}]", 'value' => 1, 'checked' => (bool) $vars['entity']->{$attr}));
        $body .= $l . '</label></div>';
        if ($count == $break1 || $count == $break2) {
            $body .= '</div><div class="elgg-col elgg-col-1of3">';
        }