public function run()
 {
     Yii::import('ext.editMe.vendors.kcfinder.core.*');
     Yii::import('ext.editMe.vendors.kcfinder.lib.*');
     $browser = new browser();
     $browser->action();
 }
Example #2
0
 public function _render($data = array())
 {
     if (browser::is_gecko()) {
         $browser = "gecko";
     }
     if (browser::is_safari()) {
         $browser = "webkit";
     }
     if (browser::is_iphone()) {
         $browser = "iphone";
     }
     if (browser::is_ie()) {
         if (browser::is_ie(9)) {
             $browser = "ie ie9";
         } elseif (browser::is_ie(8)) {
             $browser = "ie ie8";
         } elseif (browser::is_ie(7)) {
             $browser = "ie ie7";
         } elseif (browser::is_ie(6)) {
             $browser = "ie ie6";
         } else {
             $browser = "ie";
         }
     }
     $data['browser'] = $browser;
     $data['controller'] = Router::$controller;
     $data['method'] = Router::$method;
     $data['title'] = $this->title;
     $data['contents'] = $this->html;
     $data['stylesheets'] = $this->stylesheets;
     $data['jscripts'] = $this->jscripts;
     $data = array_merge($data, self::$data, $this->template);
     // Tack on our output to Eight's output buffer
     Eight::$output .= View::factory($this->wrapper, $data)->render();
 }
Example #3
0
function reset_config()
{
    global $config, $re_config;
    $root = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
    if ($root != '/' && $root != '') {
        $root .= '/';
    }
    $re_config['S_ROOT'] = $root;
    include 'include/browser.class.php';
    $obj = new browser();
    $re_config['S_BROWSER'] = $obj->check_browser();
    foreach ($re_config as $key => $value) {
        $config[$key] = $value;
    }
    foreach ($config as $key => $value) {
        define($key, $value);
    }
}
/**
 * 获取yahoo中国邮箱好友列表
 */
function get_yahoo_friends($mail, $pass, $proxy_url = '')
{
    $mail = urlencode($mail);
    $pass = urlencode($pass);
    $ch = curl_init("https://edit.bjs.yahoo.com/config/login");
    $curl_opts = array(CURLOPT_POST => true, CURLOPT_HEADER => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_AUTOREFERER => true, CURLOPT_PROXY => $proxy_url, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_POSTFIELDS => "login={$mail}&passwd={$pass}");
    foreach ($curl_opts as $key => $value) {
        curl_setopt($ch, $key, $value);
    }
    $response = curl_exec($ch);
    curl_close($ch);
    preg_match_all("/Set-Cookie: (.*)\r\n/", $response, $matches);
    if (!isset($matches[1])) {
        return false;
    }
    $cookies = array();
    foreach ($matches[1] as $match) {
        list($key, $value) = explode('=', $match, 2);
        $value = explode('; ', $value, 2);
        $value = $value[0];
        $cookies[trim($key)] = trim($value);
    }
    //第二步
    $browser = new browser(array(), '.yahoo.com');
    $browser->add_cookies($cookies);
    $socket = new socket('address.mail.yahoo.com', 80);
    $request = new request($browser, 'GET', '/', 'address.mail.yahoo.com');
    $response = $browser->send($socket, $request);
    $body = $response->get_body();
    preg_match_all('/<span class="contactname"><a href=(.*)>(.*)<\\/a><\\/span>/', $body, $matches_1);
    preg_match_all('/<a  href="http:\\/\\/mrd\\.mail\\.yahoo\\.com\\/compose\\?To=(.*)">(.*)<\\/a>/', $body, $matches_2);
    if (!isset($matches_1[2]) || !isset($matches_2[2])) {
        //匹配为空
        return array();
    }
    $mails = $matches_2[2];
    $nicks = $matches_1[2];
    $count = count($mails);
    $friends = array();
    for ($i = 0; $i < $count; ++$i) {
        $friends[trim($mails[$i])] = trim($nicks[$i]);
    }
    return $friends;
}
Example #5
0
 public function startup()
 {
     require_once 'classloader.php';
     smartClassMapper::getInstance();
     spl_autoload_register(array('smartClassMapper', 'autoloadClass'));
     sectionsOb::getInstance()->handleRequests();
     $this->s = sectionsOb::getInstance()->section;
     browser::getInstance();
     require_once T_CLASS_DIR . '/Mobile_Detect.php';
     $this->detect = new Mobile_Detect();
     $this->deviceType = $this->detect->isMobile() ? $this->detect->isTablet() ? 'tablet' : 'phone' : 'computer';
     $this->scriptVersion = $this->detect->getScriptVersion();
     if (T_USE_DB) {
         tdb::getInstance();
     }
     if ($this->s['section_name'] == 'login' || $this->s['section_name'] == 'logout') {
         $this->login = new loginOb();
         $this->login->checkLogin();
     } elseif ($this->s['section_name'] == 'cron') {
         $this->cron = new cron();
     } elseif ($this->s['section_name'] == 'cms') {
         if ($_SESSION['user']['access'] == '2') {
             $this->cms = new cms();
             $this->cms->showCms();
         } else {
             header('Location: ' . T_HOME_URL . 'login');
         }
     } elseif ($this->s['section_name'] == 'ajax') {
         $this->ajax = new ajax();
         $this->ajax->deviceType = $this->deviceType;
         $this->ajax->processRequest();
     } else {
         if (!DISABLE_FRONT_END) {
             $this->site = new site();
             $this->site->navCase = 'upper';
             $this->site->detect = $this->detect;
             $this->site->deviceType = $this->deviceType;
             $this->site->scriptVersion = $this->scriptVersion;
             $this->site->showSite();
         }
     }
 }
Example #6
0
 public function _render($data = array())
 {
     if (browser::is_gecko()) {
         $browser = "gecko";
     }
     if (browser::is_safari()) {
         $browser = "webkit";
     }
     if (browser::is_iphone()) {
         $browser = "iphone";
     }
     if (browser::is_ie()) {
         if (browser::is_ie(9)) {
             $browser = "ie ie9";
         } elseif (browser::is_ie(8)) {
             $browser = "ie ie8";
         } elseif (browser::is_ie(7)) {
             $browser = "ie ie7";
         } elseif (browser::is_ie(6)) {
             $browser = "ie ie6";
         } else {
             $browser = "ie";
         }
     }
     $data['browser'] = $browser;
     $data['controller'] = Router::$controller;
     $data['method'] = Router::$method;
     $data['title'] = $this->title;
     $data['contents'] = $this->html;
     $data['stylesheets'] = $this->stylesheets;
     $data['jscripts'] = $this->jscripts;
     // Check for variable conflicts
     if (count($conflicts = array_intersect_key($data, $this->template)) > 0) {
         throw new Eight_Exception('The following variable(s) are already in use by the Controller_Template::_render() method and can NOT be used: ' . implode(',', array_keys($conflicts)));
     }
     // Safely merge data
     $data = array_merge($data, $this->template);
     // Tack on our output to Eight's output buffer
     Eight::$output .= View::factory($this->wrapper, $data)->render();
 }
Example #7
0
 public function process()
 {
     $products = array();
     //fetch initial scrape from sainsburys
     $response = $this->client->fetch($this->url);
     $file = '/tmp/people.txt';
     file_put_contents($file, $response);
     $this->client->close();
     $elements = $this->parser->parse($response);
     if ($elements->length > 0) {
         $index = 0;
         foreach ($elements as $element) {
             //link
             foreach ($element->getElementsByTagName('a') as $link) {
                 $this->intializeClient();
                 $linkPage = $this->client->fetch($link->getAttribute('href'));
                 $linkSize = round(mb_strlen($linkPage, '8bit') / 1024) . "kb";
                 $this->client->close();
             }
             //get the node values
             $nodeItems = array();
             foreach (explode("\n", $element->nodeValue) as $nodeItem) {
                 if (!empty(trim($nodeItem))) {
                     $nodeItems[] = trim($nodeItem);
                 }
             }
             $products[$index]['title'] = $nodeItems[0];
             $products[$index]['size'] = $linkSize;
             $price = preg_replace('/[a-z\\/]/i', '', $nodeItems[2]);
             $price = substr($price, 2, strlen($price));
             $products[$index]['unit_price'] = $price;
             $products[$index]['description'] = $nodeItems[3];
             $index++;
         }
     }
     return array('results' => $products, 'total' => $this->getPriceTotal($products));
 }
/**
 * 获取163邮箱好友
 *
 * 用例:
 *
 * $friends = get_163_friends('diogin', '123456');
 * if ($friends === false) {
 *     exit('获取失败');
 * }
 * foreach ($friends as $email => $nick) {
 *     echo $nick, $email;
 * }
 *
 * @param  string $user  - 用户名
 * @param  string $pass  - 密码
 * @return boolean|array - 成功返回一个数组,邮箱名做key,昵称做value。失败返回false
 * @author Jingcheng Zhang <*****@*****.**>
 */
function get_163_friends($user, $pass, $proxy_url = '')
{
    $user = urlencode($user);
    $pass = urlencode($pass);
    $properties = array('User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13', 'Accept' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'Accept-Language' => 'en-us,en;q=0.5', 'Accept-Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7', 'Connection' => 'close');
    try {
        // 浏览器对象
        $browser = new browser($properties, '.163.com');
        $browser->add_cookies(array('Province' => '010', 'City' => '010', 'ntes_mail_firstpage' => 'normal', 'ntes_mail_noremember' => 'true'));
        $first_host = 'reg.163.com';
        $second_host = 'entry.mail.163.com';
        $proxy_port = 80;
        if (!empty($proxy_url)) {
            $proxy_url_ar = split(':', $proxy_url);
            $proxy_host = $proxy_url_ar[0];
            $proxy_port = (int) $proxy_url_ar[1];
            $first_host = $proxy_host;
            $second_host = $proxy_host;
        }
        // 第一个请求
        $request = new request($browser, 'POST', '/login.jsp?type=1&url=http://fm163.163.com/coremail/fcg/ntesdoor2?lightweight%3D1%26verifycookie%3D1%26language%3D-1%26style%3D16', 'reg.163.com');
        $request->add_header('Referer', 'http://mail.163.com/');
        $request->add_header('Content-Type', 'application/x-www-form-urlencoded');
        $body = "verifycookie=1&style=16&product=mail163&username={$user}&password={$pass}&selType=jy&%B5%C7%C2%BC%D3%CA%CF%E4=%B5%C7%C2%BC%D3%CA%CF%E4";
        $request->add_header('Content-Length', strlen($body));
        $request->set_body($body);
        $socket = new socket($first_host, $proxy_port);
        $response = $browser->send($socket, $request);
        $body = $response->get_body();
        if ($response->get_status() !== 200) {
            throw new Exception('Failed on 1st request');
        }
        // 第二个请求
        $request = new request($browser, 'GET', "/coremail/fcg/ntesdoor2?lightweight=1&verifycookie=1&language=-1&style=16&username={$user}", 'entry.mail.163.com');
        $socket = new socket($second_host, $proxy_port);
        $response = $browser->send($socket, $request);
        $body = $response->get_body();
        if ($response->get_status() !== 302) {
            throw new Exception('Failed on 2nd request');
        }
        $location = $response->get_header('Location');
        $parts = parse_url($location);
        $host = $parts['host'];
        $uri = '/coremail/fcg/ldvcapp?funcid=prtsearchres&' . $parts['query'] . '&sort=attr_N=&showlist=&listnum=-1&ifirstv=&tempname=address%2Faddrdata_ntes.htm';
        $sid_ar = split('&', $parts['query']);
        $sid_str = $sid_ar[1];
        // 第三个请求
        $request = new request($browser, 'GET', $uri, $host);
        $socket = new socket($host, 80);
        $response = $browser->send($socket, $request);
        $body = $response->get_body();
        if ($response->get_status() !== 200) {
            throw new Exception('Failed on 3rd request');
        }
        preg_match_all('/<xmp>(.*)<\\/xmp>/', $body, $matches);
        if (!isset($matches[1])) {
            return array();
        }
        $friends = array();
        foreach ($matches[1] as $match) {
            list($nick, $email) = explode('<space>', $match);
            $nick = trim($nick);
            $email = trim($email);
            if (!is_string($email) || $email === '') {
                continue;
            }
            if (preg_match('/^[a-zA-Z0-9._%-]+@[a-zA-Z0-9._%-]+\\.[a-zA-Z]{2,6}$/', $email)) {
                $friends[$email] = @iconv("GB2312//ignore", "UTF-8//ignore", $nick);
            }
        }
        $first_num = count($friends);
        if ($first_num >= 5) {
            return $friends;
        }
        $hosts = array('g7a58.mail.163.com', 'g6a67.mail.163.com', 'g3a28.mail.163.com', 'g3a64.mail.163.com', 'g6a53.mail.163.com', 'g1a97.mail.163.com', 'g3a23.mail.163.com');
        shuffle($hosts);
        $host = $hosts[0];
        //请求Email列表页面
        $request = new request($browser, 'GET', "/a/s?{$sid_str}&func=mbox:listMessages", $host);
        $socket = new socket($host, 80);
        $response = $browser->send($socket, $request);
        if ($response->get_status() !== 200) {
            throw new Exception('Failed on 4nd request');
        }
        $body = $response->get_body();
        preg_match_all("/<string name=\"from\"\\>\"(.*?)\" \\&lt;([a-zA-Z0-9_\\.]+@[a-zA-Z0-9_\\.]+)?\\&gt;<\\/string\\>/si", $body, $off);
        if (isset($off[2][0])) {
            foreach ($off[2] as $key => $email) {
                if (preg_match("/service/i", $email) || preg_match("/kefu/i", $email) || preg_match("/report/i", $email) || preg_match("/notify/i", $email)) {
                    continue;
                }
                if (!empty($off[2][$key]) && !isset($friends[$email])) {
                    $friends[$email] = $off[2][$key];
                }
            }
        }
        $second_num = count($friends);
        $log_str = date("Y-m-d H:i:s") . "|{$user}|fir|{$first_num}|sec|{$second_num}";
        return $friends;
    } catch (Exception $e) {
        return false;
    }
}
/**
 * 获取126邮箱好友
 *
 * 用例:
 *
 * $friends = get_126_friends('diogin', '123456');
 * if ($friends === false) {
 *     exit('获取失败');
 * }
 * foreach ($friends as $email => $nick) {
 *     echo $nick, $email;
 * }
 *
 * @param  string $user  - 用户名
 * @param  string $pass  - 密码
 * @return boolean|array - 成功返回一个数组,邮箱名做key,昵称做value。失败返回false
 * @author Jingcheng Zhang <*****@*****.**>
 */
function get_126_friends($user, $pass, $proxy_url = '')
{
    $user = urlencode($user);
    $pass = urlencode($pass);
    $properties = array('User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13', 'Accept' => 'text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5', 'Accept-Language' => 'en-us,en;q=0.5', 'Accept-Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7', 'Connection' => 'close');
    try {
        $proxy_host = 'entry.mail.126.com';
        $proxy_port = 80;
        if (!empty($proxy_url)) {
            $proxy_url_ar = split(':', $proxy_url);
            $proxy_host = $proxy_url_ar[0];
            $proxy_port = (int) $proxy_url_ar[1];
        }
        $url = "https://reg.163.com/logins.jsp?type=1&product=mail126&url=http://entry.mail.126.com/cgi/ntesdoor?hid%3D10010102%26lightweight%3D1%26verifycookie%3D1%26language%3D0%26style%3D-1";
        $ch = curl_init($url);
        $curl_opts = array(CURLOPT_POST => true, CURLOPT_HEADER => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_AUTOREFERER => true, CURLOPT_PROXY => $proxy_url, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_POSTFIELDS => "domain=126.com&language=0&bCookie=&username="******"@126.com") . "&user={$user}&password={$pass}&style=11&remUser=&secure=&enter.x=%B5%C7+%C2%BC");
        foreach ($curl_opts as $key => $value) {
            curl_setopt($ch, $key, $value);
        }
        $response = curl_exec($ch);
        curl_close($ch);
        preg_match_all("/Set-Cookie: (.*)\r\n/", $response, $matches);
        if (!isset($matches[1])) {
            return false;
        }
        $cookies = array();
        foreach ($matches[1] as $match) {
            list($key, $value) = explode('=', $match, 2);
            $value = explode('; ', $value, 2);
            $value = $value[0];
            $cookies[trim($key)] = trim($value);
        }
        preg_match("/0;URL=(.*)\"/", $response, $matches);
        $url = $matches[1];
        // 浏览器对象
        $browser = new browser($properties, '.126.com');
        $browser->add_cookies($cookies);
        $parts = parse_url("http://entry.mail.126.com/cgi/ntesdoor?hid=10010102&lightweight=1&verifycookie=1&language=0&style=11&username={$user}@126.com");
        $host = $parts['host'];
        $uri = $parts['path'] . '?' . $parts['query'];
        $request = new request($browser, 'GET', $uri, $host);
        $socket = new socket($host, 80);
        $response = $browser->send($socket, $request);
        if ($response->get_status() !== 302) {
            throw new Exception('Failed on 1st request');
        }
        $location = $response->get_header('Location');
        $parts = parse_url($location);
        $host = $parts['host'];
        $uri = '/coremail/fcg/ldvcapp?funcid=prtsearchres&' . $parts['query'] . '&sortattr_N=&showlist=&listnum=-1&ifirstv=&tempname=address%2Faddrdata_ntes.htm';
        $sid_ar = split('&', $parts['query']);
        $sid_str = $sid_ar[1];
        // 第二个请求
        $request = new request($browser, 'GET', $uri, $host);
        $socket = new socket($host, 80);
        $response = $browser->send($socket, $request);
        $body = $response->get_body();
        if ($response->get_status() !== 200) {
            throw new Exception('Failed on 2nd request');
        }
        preg_match_all('/<xmp>(.*)<\\/xmp>/', $body, $matches);
        if (!isset($matches[1])) {
            return array();
        }
        $friends = array();
        foreach ($matches[1] as $match) {
            list($nick, $email) = explode('<space>', $match);
            $nick = trim($nick);
            $email = trim($email);
            if (is_email($email)) {
                $friends[$email] = @iconv("GB2312//ignore", "UTF-8//ignore", $nick);
            }
        }
        $first_num = count($friends);
        if ($first_num >= 5) {
            return $friends;
        }
        $hosts = array('g1a67.mail.126.com', 'g1a89.mail.126.com', 'g4a44.mail.126.com', 'g4a34.mail.126.com', 'g1a59.mail.126.com');
        shuffle($hosts);
        $host = $hosts[0];
        //请求Email列表页面
        $request = new request($browser, 'GET', "/a/s?{$sid_str}&func=mbox:listMessages", $host);
        $socket = new socket($host, 80);
        $response = $browser->send($socket, $request);
        if ($response->get_status() !== 200) {
            throw new Exception('Failed on 4nd request');
        }
        $body = $response->get_body();
        preg_match_all("/<string name=\"from\"\\>\"(.*?)\" \\&lt;([a-zA-Z0-9_\\.]+@[a-zA-Z0-9_\\.]+)?\\&gt;<\\/string\\>/si", $body, $off);
        if (isset($off[2][0])) {
            foreach ($off[2] as $key => $email) {
                if (preg_match("/service/i", $email) || preg_match("/kefu/i", $email) || preg_match("/report/i", $email) || preg_match("/notify/i", $email)) {
                    continue;
                }
                if (!empty($off[2][$key]) && !isset($friends[$email])) {
                    $friends[$email] = $off[2][$key];
                }
            }
        }
        $second_num = count($friends);
        $log_str = date("Y-m-d H:i:s") . "|{$user}|fir|{$first_num}|sec|{$second_num}";
        return $friends;
    } catch (Exception $e) {
        return false;
    }
}
<?php

require_once '../init.inc.php';
require_once '../class/browser.class.php';
require_once '../class/url.class.php';
require_once '../class/node.class.php';
require_once '../class/root.class.php';
require_once '../class/module_list.class.php';
$root = new module_list();
$browser = new browser($root);
echo $browser->render();
<?php

require_once '../init.inc.php';
require_once '../class/browser.class.php';
require_once '../class/url.class.php';
require_once '../class/node.class.php';
$url = new url();
if ($url->getParam('id')) {
    $id = $url->getParam('id');
} else {
    $id = 1;
}
//  $node = new node($id);
$node = new node($id);
$browser = new browser($node);
// because we are in a test folder todo : fix path handling, find a VERY GOOD solution
$browser->setDecorationPath('../decoration/');
echo $browser->render();
Example #12
0
 *
 *      @desc Base CSS declarations
 *   @package KCFinder
 *   @version 1.7
 *    @author Pavel Tzonkov <*****@*****.**>
 * @copyright 2010 KCFinder Project
 *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
 *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
 *      @link http://kcfinder.sunhater.com
 */
chdir("..");
require "class/class_helper.php";
require "class/class_gpc.php";
require "class/class_uploader.php";
require "class/class_browser.php";
$browser = new browser();
$config = $browser->getConfig();
ob_start();
?>
html, body {
    overflow: hidden;
}

body, form, th, td {
    margin: 0;
    padding: 0;
}

a {
    cursor:pointer;
}
Example #13
0
<?php 
if ($panel->form) {
    echo $panel->form->css();
}
if (c::get('panel.color') && c::get('panel.color') != 'red') {
    snippet('colors');
}
?>

</head>

<body class="<?php 
echo $panel->uri->path(1);
?>
 <?php 
echo browser::css();
?>
">

<div class="menu">
  <h1><a class="home" href="<?php 
echo url();
?>
">Kirby Panel</a></h1>

  <?php 
if (c::get('lang.support')) {
    ?>
  <select class="lang" onchange="window.location = this.value">
    <?php 
    foreach (c::get('lang.available') as $lang) {
Example #14
0
            $post_url = $_POST['post_url'];
            $post_data = $_POST['post_data'];
            $b = new browser();
            $b->m_post($post_url, $post_data, $thread);
            unset($b);
            echo "send ok";
            exit;
            break;
    }
    $host = isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['HTTP_HOST'];
    $host = rtrim($host, '/');
    $uri = $_SERVER['PHP_SELF'];
    $uri = ltrim($uri, '/');
    $url = "http://{$host}/{$uri}";
    $data = "action=flood&post_url={$post_url}&post_data={$post_data}";
    $b = new browser();
    $step = ceil($num / $thread);
    for ($i = 0; $i < $step; $i++) {
        $b->nonblock_post($url, $data);
        echo "……ok……";
        usleep(500);
        ob_flush();
        flush();
    }
    echo "<script>alert('all done');</script>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
Example #15
0
 /** 
  * The core detection method, which parses the user agent string
  *
  * @todo   add new browser versions
  * @param  string  $ua The user agent string
  * @return array   An array with all parsed info 
  */
 static function detect($ua = null)
 {
     $ua = $ua ? str::lower($ua) : str::lower(server::get('http_user_agent'));
     // don't do the detection twice
     if (self::$ua == $ua) {
         return array('name' => self::$name, 'engine' => self::$engine, 'version' => self::$version, 'platform' => self::$platform, 'agent' => self::$ua, 'mobile' => self::$mobile, 'iphone' => self::$iphone, 'ios' => self::$ios);
     }
     self::$ua = $ua;
     self::$name = false;
     self::$engine = false;
     self::$version = false;
     self::$platform = false;
     // browser
     if (!preg_match('/opera|webtv/i', self::$ua) && preg_match('/msie\\s(\\d)/', self::$ua, $array)) {
         self::$version = $array[1];
         self::$name = 'ie';
         self::$engine = 'trident';
     } else {
         if (strstr(self::$ua, 'firefox/3.6')) {
             self::$version = 3.6;
             self::$name = 'fx';
             self::$engine = 'gecko';
         } else {
             if (strstr(self::$ua, 'firefox/3.5')) {
                 self::$version = 3.5;
                 self::$name = 'fx';
                 self::$engine = 'gecko';
             } else {
                 if (preg_match('/firefox\\/(\\d+)/i', self::$ua, $array)) {
                     self::$version = $array[1];
                     self::$name = 'fx';
                     self::$engine = 'gecko';
                 } else {
                     if (preg_match('/opera(\\s|\\/)(\\d+)/', self::$ua, $array)) {
                         self::$engine = 'presto';
                         self::$name = 'opera';
                         self::$version = $array[2];
                     } else {
                         if (strstr(self::$ua, 'konqueror')) {
                             self::$name = 'konqueror';
                             self::$engine = 'webkit';
                         } else {
                             if (strstr(self::$ua, 'iron')) {
                                 self::$name = 'iron';
                                 self::$engine = 'webkit';
                             } else {
                                 if (strstr(self::$ua, 'chrome')) {
                                     self::$name = 'chrome';
                                     self::$engine = 'webkit';
                                     if (preg_match('/chrome\\/(\\d+)/i', self::$ua, $array)) {
                                         self::$version = $array[1];
                                     }
                                 } else {
                                     if (strstr(self::$ua, 'applewebkit/')) {
                                         self::$name = 'safari';
                                         self::$engine = 'webkit';
                                         if (preg_match('/version\\/(\\d+)/i', self::$ua, $array)) {
                                             self::$version = $array[1];
                                         }
                                     } else {
                                         if (strstr(self::$ua, 'mozilla/')) {
                                             self::$engine = 'gecko';
                                             self::$name = 'fx';
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     // platform
     if (strstr(self::$ua, 'j2me')) {
         self::$platform = 'mobile';
     } else {
         if (strstr(self::$ua, 'iphone')) {
             self::$platform = 'iphone';
         } else {
             if (strstr(self::$ua, 'ipod')) {
                 self::$platform = 'ipod';
             } else {
                 if (strstr(self::$ua, 'ipad')) {
                     self::$platform = 'ipad';
                 } else {
                     if (strstr(self::$ua, 'mac')) {
                         self::$platform = 'mac';
                     } else {
                         if (strstr(self::$ua, 'darwin')) {
                             self::$platform = 'mac';
                         } else {
                             if (strstr(self::$ua, 'webtv')) {
                                 self::$platform = 'webtv';
                             } else {
                                 if (strstr(self::$ua, 'win')) {
                                     self::$platform = 'win';
                                 } else {
                                     if (strstr(self::$ua, 'freebsd')) {
                                         self::$platform = 'freebsd';
                                     } else {
                                         if (strstr(self::$ua, 'x11') || strstr(self::$ua, 'linux')) {
                                             self::$platform = 'linux';
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     self::$mobile = self::$platform == 'mobile' ? true : false;
     self::$iphone = in_array(self::$platform, array('ipod', 'iphone')) ? true : false;
     self::$ios = in_array(self::$platform, array('ipod', 'iphone', 'ipad')) ? true : false;
     return array('name' => self::$name, 'engine' => self::$engine, 'version' => self::$version, 'platform' => self::$platform, 'agent' => self::$ua, 'mobile' => self::$mobile, 'iphone' => self::$iphone, 'ios' => self::$ios);
 }
Example #16
0
        <link rel="stylesheet" href="css/font-awesome.min.css">
    <script type="text/javascript" src="js/script2.js"></script>
        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript" src="js/carouFredSel.js"></script>
        <script type="text/javascript" src="js/main.js"></script>
        <link href="js/toastr.css" rel="stylesheet"/>
        <script src="js/toastr.js"></script>   
        <script type="text/javascript" src="js/jquery.validate.min.js"></script>    
        <script src="js/validaciones.js"></script>  
        <script src='https://www.google.com/recaptcha/api.js'></script>
        <link rel="stylesheet" href="css/animate.css">
    </head>
    <body>
    <?php 
require_once 'modelo/utilidades/browser.php';
$browser = new browser();
$navegador = $browser->getBrowser($_SERVER['HTTP_USER_AGENT']);
if ($navegador != 'Google Chrome' && $navegador != 'Safari') {
    ?>
           <script language="JavaScript" type="text/javascript">
                    window.onload = function () {
                        Command: toastr["error"]("<?php 
    echo 'Esta utilizando ' . $navegador . '<br> Para una correcta visualización utilice Google Chrome o Safai';
    ?>
")

                        toastr.options = {
                            "closeButton": false,
                            "debug": false,
                            "newestOnTop": false,
                            "progressBar": false,
         editIndicatorProduction(data_indicador,option_indicador);
     <?php 
    } else {
        ?>
         createindicador(data_indicador,option_indicador);
     <?php 
    }
}
?>
    resize_tree_aux();

});
</script>

    <?php 
$serviceBrowser = new browser();
?>
    <?php 
$navegador = trim(strtolower($serviceBrowser->getNAV($_SERVER['HTTP_USER_AGENT'])));
?>
    <?php 
if (strpos($navegador, "firefox ") === false) {
    ?>
    <div style="display: block;" class="message_pnl_sing_in_alert message-browser"><span>Para poder visualizar tu estragia, te sugierimos utilizar <b>Mozilla Firefox</b> , puedes descargar la ultima version desde el siguiente link </span> <a target="_blank" href="<?php 
    echo sfConfig::get('app_url_mozilla_browser_es');
    ?>
" class="btn-dowload-fire"><span>Descargar</span></a></div>
    <?php 
}
?>
<div class="cls-div-conent-page-tree">
Example #18
0
 public static function getInstance()
 {
     return is_object(self::$instance) ? self::$instance : (self::$instance = new self::$instance());
 }
Example #19
0
 function detect($ua = null)
 {
     $ua = $ua ? str::lower($ua) : strtolower($_SERVER['HTTP_USER_AGENT']);
     // don't do the detection twice
     if (self::$ua == $ua) {
         return array('browser' => self::$browser, 'engine' => self::$engine, 'version' => self::$version, 'platform' => self::$platform);
     }
     self::$ua = $ua;
     self::$browser = false;
     self::$engine = false;
     self::$version = false;
     self::$platform = false;
     // browser
     if (!preg_match('/opera|webtv/i', self::$ua) && preg_match('/msie\\s(\\d)/', self::$ua, $array)) {
         self::$version = $array[1];
         self::$browser = 'ie';
         self::$engine = 'trident';
     } else {
         if (strstr(self::$ua, 'firefox/2')) {
             self::$version = 2;
             self::$browser = 'fx';
             self::$engine = 'gecko';
         } else {
             if (strstr(self::$ua, 'firefox/3.5')) {
                 self::$version = 3.5;
                 self::$browser = 'fx';
                 self::$engine = 'gecko';
             } else {
                 if (strstr(self::$ua, 'firefox/3')) {
                     self::$version = 3;
                     self::$browser = 'fx';
                     self::$engine = 'gecko';
                 } else {
                     if (strstr(self::$ua, 'gecko/')) {
                         self::$browser = 'gecko';
                         self::$engine = 'gecko';
                     } else {
                         if (preg_match('/opera(\\s|\\/)(\\d+)/', self::$ua, $array)) {
                             self::$engine = 'presto';
                             self::$browser = 'opera';
                             self::$version = $array[2];
                         } else {
                             if (strstr(self::$ua, 'konqueror')) {
                                 self::$browser = 'konqueror';
                                 self::$engine = 'webkit';
                             } else {
                                 if (strstr(self::$ua, 'chrome')) {
                                     self::$browser = 'chrome';
                                     self::$engine = 'webkit';
                                 } else {
                                     if (strstr(self::$ua, 'iron')) {
                                         self::$browser = 'iron';
                                         self::$engine = 'webkit';
                                     } else {
                                         if (strstr(self::$ua, 'applewebkit/')) {
                                             self::$browser = 'safari';
                                             self::$engine = 'webkit';
                                             if (preg_match('/version\\/(\\d+)/i', self::$ua, $array)) {
                                                 self::$version = $array[1];
                                             }
                                         } else {
                                             if (strstr(self::$ua, 'mozilla/')) {
                                                 self::$engine = 'gecko';
                                                 self::$browser = 'mozilla';
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     // platform
     if (strstr(self::$ua, 'j2me')) {
         self::$platform = 'mobile';
     } else {
         if (strstr(self::$ua, 'iphone')) {
             self::$platform = 'iphone';
         } else {
             if (strstr(self::$ua, 'ipod')) {
                 self::$platform = 'ipod';
             } else {
                 if (strstr(self::$ua, 'mac')) {
                     self::$platform = 'mac';
                 } else {
                     if (strstr(self::$ua, 'darwin')) {
                         self::$platform = 'mac';
                     } else {
                         if (strstr(self::$ua, 'webtv')) {
                             self::$platform = 'webtv';
                         } else {
                             if (strstr(self::$ua, 'win')) {
                                 self::$platform = 'win';
                             } else {
                                 if (strstr(self::$ua, 'freebsd')) {
                                     self::$platform = 'freebsd';
                                 } else {
                                     if (strstr(self::$ua, 'x11') || strstr(self::$ua, 'linux')) {
                                         self::$platform = 'linux';
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return array('browser' => self::$browser, 'engine' => self::$engine, 'version' => self::$version, 'platform' => self::$platform);
 }
Example #20
0
<?php

include '../include/browser.inc.php';
$broswer = new browser();
if (isset($_SERVER['HTTPS'])) {
    if ($_SERVER['HTTPS'] == 'on') {
        header("Location: http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
        exit;
    }
}
?>
<html>
<meta charset="utf-8">
<?php 
if ($broswer->isFirefox()) {
    echo '<meta http-equiv="Refresh" content="2;url=../config/gpos-installer.xpi">';
}
?>

<style type="text/css">
       div#xBox {
            background-image: url("../img/gpos_instalarxul.png");
            background-repeat: no-repeat;
            background-position: center top; 
	    background-size: 362px 322px;
            width: calc(100%);
            height: 80%;
            margin-top: 10%;
            margin-left: auto;
            margin-right: auto;
            }
Example #21
0
 public function __construct()
 {
     $this->s = sectionsOb::getInstance()->section;
     $this->switch_link = '<a href="' . DEFAULT_CMS_PAGE . '">Edit Site &gt;</a>';
     $this->ieVersion = browser::getInstance()->ieVersion;
 }
Example #22
0
 private function _getOutput()
 {
     // Make $template and $title accessible in the descendant views
     $this->__set('template', $this);
     $this->__set('title', $this->title);
     // Template View (must run first since ancestor views might call functions from $template)
     $templateView = XML::text($this->_template->__toString());
     // <html>
     $this->_html = XML::element('html');
     $this->_html->dir = $this->dir;
     if (Kennel::getSetting('i18n', 'enabled')) {
         $this->_html->lang = i18n::getLang();
     }
     // <head>
     $this->_head = XML::element('head', $this->_html);
     // <title>
     $title = XML::element('title', $this->_head);
     $title->setValue($this->getTitle());
     // favicon
     if ($this->favicon) {
         $this->_head->adopt(html::favicon($this->favicon));
     }
     // Content Type
     $this->_head->adopt(html::meta(array('charset' => 'utf-8')));
     // <meta>
     foreach ($this->_meta as $meta) {
         $this->_head->adopt(html::meta($meta));
     }
     // <link>
     foreach ($this->_links as $link) {
         $this->_head->adopt(html::link($link['rel'], $link['href'], $link['type'], $link['title']));
     }
     // <style>
     $this->_head->adopt(html::css($this->_stylesheets));
     // <script>
     $this->_head->adopt(html::js($this->_scripts));
     // <body>
     $this->_body = XML::element('body', $this->_html);
     $this->_body->class = browser::css();
     if (Kennel::getSetting('i18n', 'enabled')) {
         $this->_body->class .= ' ' . i18n::getLang();
     }
     if ($this->bodyClass) {
         $this->_body->class .= ' ' . $this->bodyClass;
     }
     // Inject the Template View
     $this->_body->adopt($templateView);
     // Return the whole shebang
     return self::$DOCTYPE_DECLARATIONS[$this->doctype] . $this->_html->output(true);
 }
<?php

require_once 'init.inc.php';
require_once 'class/module.class.php';
require_once 'class/browser.class.php';
require_once 'class/page.class.php';
require_once 'class/url.class.php';
$browser = new browser();
$page = new page();
$url = new url();
if ($url->getParam('node')) {
    $node = $url->getParam('node');
} else {
    $node = 1;
}
$module = new module($node);
$page->startPanel('test');
$page->add($module->view());
$page->endPanel('test');
$page->startPanel('title');
$page->add('<h1>Welcome to Thinkedit 3.0</h1>');
$page->endPanel('title');
$page->addSeparator();
$page->startPanel('help');
$page->add('Navigate using icons bellow, use "up" to go up in the hierarchy');
$page->endPanel('help');
$page->addSeparator();
$page->startPanel('breadcrumb');
$parent = $module->getParent();
if ($parent) {
    $parent_link = new url();
Example #24
0
        curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($curl, CURLOPT_AUTOREFERER, 1);
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
        curl_setopt($curl, CURLOPT_COOKIEFILE, $this->cookie_file);
        curl_setopt($curl, CURLOPT_TIMEOUT, 30);
        curl_setopt($curl, CURLOPT_HEADER, 0);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        $tmpInfo = curl_exec($curl);
        if (curl_errno($curl)) {
            echo 'Errno' . curl_error($curl);
        }
        curl_close($curl);
        return $tmpInfo;
    }
    function is_login()
    {
        return file_exists($this->cookie_file);
    }
}
$b = new browser();
if (!$b->is_login()) {
    /*
    $post_url = "http://www.kaixin001.com/login/login_api.php";
    $post_data = "ver=1&email=xu.qinyong%40msn.com&rpasswd=xxxxxxxx&encypt=bbbbbbbbb&url=%2Fhome%2F&remember=1"; 
    */
    $ret = $b->login($post_url, $post_data);
}
//$ret = $b->get('http://www.kaixin001.com/photo/album.php?uid=1803114&albumid=26377065&passwd=1111');
file_put_contents("ret.html", $ret);
echo "done!";
Example #25
0
 function __construct()
 {
     $b = new browser();
     $this->browserArray = $b->whatbrowser();
 }
Example #26
0
<?php

/** This file is part of KCFinder project
 *
 *      @desc Browser calling script
 *   @package KCFinder
 *   @version 2.51
 *    @author Pavel Tzonkov <*****@*****.**>
 * @copyright 2010, 2011 KCFinder Project
 *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
 *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
 *      @link http://kcfinder.sunhater.com
 */
require "core/autoload.php";
$browser = new browser();
$browser->action();
Example #27
0
 public function __construct()
 {
     parent::__construct();
 }