Example #1
0
//trang dang xem
$client_info['agent'] = $nv_Request->user_agent;
//HTTP_USER_AGENT
$client_info['session_id'] = $nv_Request->session_id;
//ten cua session
$global_config['sitekey'] = md5($_SERVER['SERVER_NAME'] . NV_ROOTDIR . $client_info['session_id']);
//Xac dinh co phai AJAX hay khong
if (preg_match("/^[0-9]{10,}\$/", $nv_Request->get_string('nocache', 'get', '')) and $client_info['is_myreferer'] === 1) {
    define('NV_IS_AJAX', true);
}
//Chan truy cap neu HTTP_USER_AGENT == 'none'
if (NV_USER_AGENT == "none") {
    trigger_error('We\'re sorry. The software you are using to access our website is not allowed. Some examples of this are e-mail harvesting programs and programs that will  copy websites to your hard drive. If you feel you have gotten this message  in error, please send an e-mail addressed to admin. Your I.P. address has been logged. Thanks.', 256);
}
//Xac dinh co phai la bot hay khong
$client_info['bot_info'] = nv_check_bot();
$client_info['is_bot'] = !empty($client_info['bot_info']) ? 1 : 0;
//Xac dinh borwser cua client
$client_info['browser'] = $client_info['is_bot'] ? array('key' => "Unknown", 'name' => 'Unknown') : array_combine(array('key', 'name'), explode("|", nv_getBrowser(NV_USER_AGENT, NV_ROOTDIR . '/includes/ini/br.ini')));
//Xac dinh OS cua client
$client_info['client_os'] = $client_info['is_bot'] ? array('key' => "Robot", 'name' => $client_info['bot_info']['name']) : array_combine(array('key', 'name'), explode("|", nv_getOs(NV_USER_AGENT, NV_ROOTDIR . '/includes/ini/os.ini')));
//Captcha
if ($nv_Request->isset_request('scaptcha', 'get')) {
    include_once NV_ROOTDIR . "/includes/core/captcha.php";
}
//Class ma hoa du lieu $crypt->hash($data)
require NV_ROOTDIR . '/includes/class/crypt.class.php';
$crypt = new nv_Crypt($global_config['sitekey'], NV_CRYPT_SHA1 == 1 ? 'sha1' : 'md5');
if (!$crypt->_otk) {
    trigger_error("sitekey not declared", 256);
}
Example #2
0
    define('NV_IS_MY_USER_AGENT', true);
}
//Xac dinh co phai la bot hay khong
$client_info['bot_info'] = nv_check_bot();
$client_info['is_bot'] = !empty($client_info['bot_info']) ? 1 : 0;
//Neu la bot va bot bi cam truy cap
if ($client_info['is_bot'] and empty($client_info['bot_info']['allowed'])) {
    trigger_error('Sorry! Website does not support the bot', 256);
}
//Xac dinh co phai truy cap bang mobile hay khong
$client_info['is_mobile'] = nv_checkmobile();
//Chan hoac chuyen huong neu truy cap tu mobile
//if ($client_info['is_mobile'])
//	trigger_error('Sorry! Website does not support the browser your mobile', 256);
//Ket noi voi class chong flood
if (defined('NV_IS_FLOOD_BLOCKER') and NV_IS_FLOOD_BLOCKER == 1 and !$nv_Request->isset_request('admin', 'session') and (!$nv_Request->isset_request('second', 'get') or $nv_Request->isset_request('second', 'get') and $client_info['is_myreferer'] != 1)) {
    require_once NV_ROOTDIR . '/includes/core/flood_blocker.php';
}
//Xac dinh borwser cua client
$client_info['browser'] = $client_info['is_bot'] ? array('key' => "Unknown", 'name' => 'Unknown') : array_combine(array('key', 'name'), explode("|", nv_getBrowser(NV_USER_AGENT, NV_ROOTDIR . '/includes/ini/br.ini')));
//Xac dinh OS cua client
$client_info['client_os'] = $client_info['is_bot'] ? array('key' => "Robot", 'name' => $client_info['bot_info']['name']) : array_combine(array('key', 'name'), explode("|", nv_getOs(NV_USER_AGENT, NV_ROOTDIR . '/includes/ini/os.ini')));
//Captcha
if ($nv_Request->isset_request('scaptcha', 'get')) {
    include_once NV_ROOTDIR . "/includes/core/captcha.php";
}
//Bat dau phien lam viec cua MySQL
require_once NV_ROOTDIR . '/includes/class/mysql.class.php';
$db_config['new_link'] = NV_MYSQL_NEW_LINK;
$db_config['persistency'] = NV_MYSQL_PERSISTENCY;
$db = new sql_db($db_config);
Example #3
0
if (preg_match('/^([0-9]+)\\.(.*)$/', $browser->getVersion(), $matches)) {
    $client_info['browser']['version'] = (int) $matches[1];
} else {
    $client_info['browser']['version'] = 0;
}
$client_info['is_mobile'] = $browser->isMobile();
$client_info['is_tablet'] = $browser->isTablet();
$client_info['is_bot'] = $browser->isRobot();
$client_info['client_os'] = array('key' => $browser->getPlatformKey(), 'name' => $browser->getPlatform());
$is_mobile_tablet = $client_info['is_mobile'] . '-' . $client_info['is_tablet'];
if ($is_mobile_tablet != $nv_Request->get_string('is_mobile_tablet', 'session')) {
    $nv_Request->set_Session('is_mobile_tablet', $is_mobile_tablet);
    $nv_Request->unset_request('nv' . NV_LANG_DATA . 'themever', 'cookie');
}
// Ket noi voi class chong flood
if ($global_config['is_flood_blocker'] and !$nv_Request->isset_request('admin', 'session') and (!$nv_Request->isset_request('second', 'get') or $nv_Request->isset_request('second', 'get') and $client_info['is_myreferer'] != 1)) {
    require NV_ROOTDIR . '/includes/core/flood_blocker.php';
}
// Captcha
if ($nv_Request->isset_request('scaptcha', 'get')) {
    require NV_ROOTDIR . '/includes/core/captcha.php';
}
// Class ma hoa du lieu
$crypt = new nv_Crypt($global_config['sitekey']);
$global_config['ftp_user_pass'] = $crypt->aes_decrypt(nv_base64_decode($global_config['ftp_user_pass']));
if (isset($nv_plugin_area[1])) {
    // Kết nối với các plugin Trước khi kết nối CSDL
    foreach ($nv_plugin_area[1] as $_fplugin) {
        include NV_ROOTDIR . '/includes/plugin/' . $_fplugin;
    }
}