$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);
if (!empty($db->error)) {
    $die = !empty($db->error['user_message']) ? $db->error['user_message'] : $db->error['message'];
    $die .= !empty($db->error['code']) ? ' (Code: ' . $db->error['code'] . ')' : '';
    trigger_error($die, 256);
Beispiel #2
0
 } elseif ($level == 2) {
     $level_txt = '<b>' . $lang_module['level2'] . '</b>';
 } else {
     $array_mod = array();
     foreach ($list_modules as $row_mod) {
         if (!empty($row_mod['admins']) and in_array($row['admin_id'], explode(",", $row_mod['admins']))) {
             $array_mod[] = $row_mod['custom_title'];
         }
     }
     $level_txt = implode(', ', $array_mod);
 }
 $last_login = intval($row['last_login']);
 $last_login = $last_login ? nv_date("l, d/m/Y H:i", $last_login) : $lang_module['last_login0'];
 $last_agent = $row['last_agent'];
 $row['full_name'] = empty($row['full_name']) ? $row['full_name'] : $row['username'];
 $browser = array_combine(array('key', 'name'), explode("|", nv_getBrowser($last_agent, NV_ROOTDIR . '/includes/ini/br.ini')));
 $os = array_combine(array('key', 'name'), explode("|", nv_getOs($last_agent, NV_ROOTDIR . '/includes/ini/os.ini')));
 $is_suspend = intval($row['is_suspend']);
 if (empty($is_suspend)) {
     $is_suspend = $lang_module['is_suspend0'];
 } else {
     $last_reason = unserialize($row['susp_reason']);
     $last_reason = array_shift($last_reason);
     list($susp_admin_id, $susp_admin_name) = $db->sql_fetchrow($db->sql_query("SELECT `userid`,`full_name` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `userid`=" . intval($last_reason['start_admin'])));
     $susp_admin_name = "<a href=\"" . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;id=" . $susp_admin_id . "\">" . $susp_admin_name . "</a>";
     $is_suspend = sprintf($lang_module['is_suspend1'], nv_date("d/m/Y H:i", $last_reason['starttime']), $susp_admin_name, $last_reason['info']);
 }
 $thead = array();
 $thead['level'] = $level;
 if (defined("NV_IS_GODADMIN")) {
     $thead['edit'] = 1;
Beispiel #3
0
// xac dinh co phai User_Agent cua NukeViet hay khong
if (NV_USER_AGENT == 'NUKEVIET CMS ' . $global_config['version'] . '. Developed by VINADES. Url: http://nukeviet.vn. Code: ' . md5($global_config['sitekey'])) {
    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 borwser cua client
if ($client_info['is_bot']) {
    $client_info['browser'] = array('key' => 'Unknown', 'name' => 'Unknown', 'version' => 0);
} else {
    $client_info['browser'] = array_combine(array('key', 'name'), explode('|', nv_getBrowser(NV_USER_AGENT)));
    if (preg_match('/^([^0-9]+)([0-9]+)\\.(.*)$/', $client_info['browser']['name'], $matches)) {
        $client_info['browser']['version'] = (int) $matches[2];
        unset($matches);
    } else {
        $client_info['browser']['version'] = 0;
    }
}
// Xac dinh co phai truy cap bang mobile hay khong
$client_info['is_mobile'] = nv_checkmobile(NV_USER_AGENT);
// 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';
}
// 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)));
//vd: http
define('NV_SERVER_PORT', $nv_Request->server_port);
//vd: 80
define('NV_MY_DOMAIN', $nv_Request->my_current_domain);
//vd: http://mydomain1.com:80
define('NV_HEADERSTATUS', $nv_Request->headerstatus);
//vd: HTTP/1.0
define('NV_USER_AGENT', $nv_Request->user_agent);
//HTTP_USER_AGENT
define("NV_BASE_SITEURL", $nv_Request->base_siteurl . '/');
//vd: /ten_thu_muc_chua_site/
define("NV_BASE_ADMINURL", $nv_Request->base_adminurl . '/');
//vd: /ten_thu_muc_chua_site/admin/
define('NV_DOCUMENT_ROOT', $nv_Request->doc_root);
// D:/AppServ/www
define('NV_EOL', strtoupper(substr(PHP_OS, 0, 3) == 'WIN') ? "\r\n" : (strtoupper(substr(PHP_OS, 0, 3) == 'MAC') ? "\r" : "\n"));
//Ngat dong
define('NV_UPLOADS_REAL_DIR', NV_ROOTDIR . '/' . NV_UPLOADS_DIR);
//Xac dinh duong dan thuc den thu muc upload
//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 borwser cua client
$client_info['browser'] = array_combine(array('key', 'name'), explode("|", nv_getBrowser(NV_USER_AGENT, NV_ROOTDIR . '/includes/ini/br.ini')));
//Class ma hoa du lieu $crypt->hash($data)
require_once 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);
}
Beispiel #5
0
     $level_txt = '<strong>' . $lang_global['level1'] . '</strong>';
 } elseif ($level == 2) {
     $level_txt = '<strong>' . $lang_global['level2'] . '</strong>';
 } else {
     $array_mod = array();
     foreach ($list_modules as $row_mod) {
         if (!empty($row_mod['admins']) and in_array($row['admin_id'], explode(',', $row_mod['admins']))) {
             $array_mod[] = $row_mod['custom_title'];
         }
     }
     $level_txt = implode(', ', $array_mod);
 }
 $last_login = intval($row['last_login']);
 $last_login = $last_login ? nv_date('l, d/m/Y H:i', $last_login) : $lang_module['last_login0'];
 $last_agent = $row['last_agent'];
 $browser = array_combine(array('key', 'name'), explode('|', nv_getBrowser($last_agent)));
 $os = array_combine(array('key', 'name'), explode('|', nv_getOs($last_agent)));
 $is_suspend = intval($row['is_suspend']);
 if (empty($is_suspend)) {
     $is_suspend = $lang_module['is_suspend0'];
 } else {
     $last_reason = unserialize($row['susp_reason']);
     $last_reason = array_shift($last_reason);
     list($susp_admin_id, $susp_admin_name) = $db->query('SELECT userid,first_name,last_name FROM ' . NV_USERS_GLOBALTABLE . ' WHERE userid=' . intval($last_reason['start_admin']))->fetch(3);
     $susp_admin_name = "<a href=\"" . NV_BASE_ADMINURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;id=" . $susp_admin_id . "\">" . $susp_admin_name . "</a>";
     $is_suspend = sprintf($lang_module['is_suspend1'], nv_date('d/m/Y H:i', $last_reason['starttime']), $susp_admin_name, $last_reason['info']);
 }
 $thead = array();
 $thead['level'] = $level;
 if (defined('NV_IS_GODADMIN')) {
     $thead['edit'] = 1;