本文整理汇总了PHP中nv_capcha_txt函数的典型用法代码示例。如果您正苦于以下问题:PHP nv_capcha_txt函数的具体用法?PHP nv_capcha_txt怎么用?PHP nv_capcha_txt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nv_capcha_txt函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filter_text_input
}
$fphone = filter_text_input('fphone', 'post', '', 1, 100);
$fcon = filter_text_textarea('fcon', '', NV_ALLOWED_HTML_TAGS);
$fcode = filter_text_input('fcode', 'post', '');
$check_valid_email = nv_check_valid_email($femail);
if (empty($fname)) {
$error = $lang_module['error_fullname'];
} elseif (!empty($check_valid_email)) {
$error = $check_valid_email;
} elseif (empty($ftitle)) {
$error = $lang_module['error_title'];
} elseif (empty($fcon)) {
$error = $lang_module['error_content'];
} elseif (!isset($array_rows[$fpart])) {
$error = $lang_module['error_part'];
} elseif (!nv_capcha_txt($fcode)) {
$error = $lang_module['error_captcha'];
} else {
$fcon = nv_nl2br($fcon);
$sender_id = intval(defined('NV_IS_USER') ? $user_info['userid'] : 0);
$sql = "INSERT INTO `" . NV_PREFIXLANG . "_" . $module_data . "_send` VALUES \n (NULL , " . $fpart . ", " . $db->dbescape($ftitle) . ", " . $db->dbescape($fcon) . ", \n " . NV_CURRENTTIME . ", " . $sender_id . ", " . $db->dbescape($fname) . ", " . $db->dbescape($femail) . ", \n " . $db->dbescape($fphone) . ", " . $db->dbescape($client_info['ip']) . ", 0, 0, '', 0, 0);";
$db->sql_query($sql);
$website = "<a href=\"" . $global_config['site_url'] . "\">" . $global_config['site_name'] . "</a>";
$fcon .= "<br /><br />----------------------------------------<br /><br />";
if (empty($fphone)) {
$fcon .= sprintf($lang_module['sendinfo'], $website, $fname, $femail, $client_info['ip'], $array_rows[$fpart]['full_name']);
} else {
$fcon .= sprintf($lang_module['sendinfo2'], $website, $fname, $femail, $fphone, $client_info['ip'], $array_rows[$fpart]['full_name']);
}
nv_SendMail2User($fpart, $fcon, $ftitle, $femail, $fname);
$url = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA;
示例2: nv_substr
$array_register['first_name'] = nv_substr($nv_Request->get_title('first_name', 'post', '', 1), 0, 255);
$array_register['last_name'] = nv_substr($nv_Request->get_title('last_name', 'post', '', 1), 0, 255);
$array_register['username'] = $nv_Request->get_title('username', 'post', '', 1);
$array_register['password'] = $nv_Request->get_title('password', 'post', '');
$array_register['re_password'] = $nv_Request->get_title('re_password', 'post', '');
$array_register['email'] = nv_strtolower(nv_substr($nv_Request->get_title('email', 'post', '', 1), 0, 100));
$array_register['question'] = $nv_Request->get_int('question', 'post', 0);
if (!isset($data_questions[$array_register['question']])) {
$array_register['question'] = 0;
}
$data_questions[$array_register['question']]['selected'] = ' selected="selected"';
$array_register['your_question'] = $nv_Request->get_title('your_question', 'post', '', 1);
$array_register['answer'] = nv_substr($nv_Request->get_title('answer', 'post', '', 1), 0, 255);
$array_register['agreecheck'] = $nv_Request->get_int('agreecheck', 'post', 0);
$nv_seccode = $nv_Request->get_title('nv_seccode', 'post', '');
$check_seccode = !$gfx_chk ? true : (nv_capcha_txt($nv_seccode) ? true : false);
$complete = '';
if (!$check_seccode) {
die(reg_result(array('status' => 'error', 'input' => 'nv_seccode', 'mess' => $lang_global['securitycodeincorrect'])));
}
if (($check_login = nv_check_username_reg($array_register['username'])) != '') {
die(reg_result(array('status' => 'error', 'input' => 'username', 'mess' => $check_login)));
}
if (($check_email = nv_check_email_reg($array_register['email'])) != '') {
die(reg_result(array('status' => 'error', 'input' => 'email', 'mess' => $check_email)));
}
if (($check_pass = nv_check_valid_pass($array_register['password'], NV_UPASSMAX, NV_UPASSMIN)) != '') {
die(reg_result(array('status' => 'error', 'input' => 'password', 'mess' => $check_pass)));
}
if ($array_register['password'] != $array_register['re_password']) {
die(reg_result(array('status' => 'error', 'input' => 're_password', 'mess' => $lang_global['passwordsincorrect'])));
示例3: openidLogin_Res1
/**
* openidLogin_Res1()
* Function thuc hien khi OpenID duoc nhan dien
*
* @param mixed $attribs
* @return
*/
function openidLogin_Res1($attribs)
{
global $page_title, $key_words, $mod_title, $db, $crypt, $nv_Request, $lang_module, $lang_global, $module_name, $module_info, $global_config, $gfx_chk, $nv_redirect, $op, $db_config;
$email = (isset($attribs['contact/email']) and nv_check_valid_email($attribs['contact/email']) == '') ? $attribs['contact/email'] : '';
if (empty($email)) {
$nv_Request->unset_request('openid_attribs', 'session');
openidLogin_Res0($lang_module['logged_in_failed']);
die;
}
$opid = $crypt->hash($attribs['id']);
$current_mode = isset($attribs['current_mode']) ? $attribs['current_mode'] : 1;
$stmt = $db->prepare('SELECT a.userid AS uid, a.email AS uemail, b.active AS uactive FROM ' . NV_USERS_GLOBALTABLE . '_openid a, ' . NV_USERS_GLOBALTABLE . ' b
WHERE a.opid= :opid
AND a.email= :email
AND a.userid=b.userid');
$stmt->bindParam(':opid', $opid, PDO::PARAM_STR);
$stmt->bindParam(':email', $email, PDO::PARAM_STR);
$stmt->execute();
list($user_id, $op_email, $user_active) = $stmt->fetch(3);
if ($user_id) {
$nv_Request->unset_request('openid_attribs', 'session');
if ($op_email != $email) {
openidLogin_Res0($lang_module['not_logged_in']);
die;
}
if (!$user_active) {
openidLogin_Res0($lang_module['login_no_active']);
die;
}
if (defined('NV_IS_USER_FORUM') and file_exists(NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/set_user_login.php')) {
require_once NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/set_user_login.php';
if (defined('NV_IS_USER_LOGIN_FORUM_OK')) {
$nv_redirect = !empty($nv_redirect) ? nv_base64_decode($nv_redirect) : NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
} else {
$nv_redirect = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
}
} else {
$query = 'SELECT * FROM ' . NV_USERS_GLOBALTABLE . ' WHERE userid=' . $user_id;
$row = $db->query($query)->fetch();
if (!empty($row)) {
validUserLog($row, 1, $opid, $current_mode);
$nv_redirect = !empty($nv_redirect) ? nv_base64_decode($nv_redirect) : NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
} else {
$nv_redirect = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
}
}
Header('Location: ' . nv_url_rewrite($nv_redirect, true));
die;
}
$stmt = $db->prepare('SELECT * FROM ' . NV_USERS_GLOBALTABLE . ' WHERE email= :email');
$stmt->bindParam(':email', $email, PDO::PARAM_STR);
$stmt->execute();
$nv_row = $stmt->fetch();
if (!empty($nv_row)) {
$login_allowed = false;
if (empty($nv_row['password'])) {
$nv_Request->unset_request('openid_attribs', 'session');
$login_allowed = true;
}
if ($nv_Request->isset_request('openid_account_confirm', 'post')) {
$password = $nv_Request->get_string('password', 'post', '');
$nv_seccode = $nv_Request->get_title('nv_seccode', 'post', '');
$nv_seccode = !$gfx_chk ? 1 : (nv_capcha_txt($nv_seccode) ? 1 : 0);
$nv_Request->unset_request('openid_attribs', 'session');
if (defined('NV_IS_USER_FORUM') and file_exists(NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/login.php')) {
$nv_username = $nv_row['username'];
$nv_password = $password;
require_once NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/login.php';
if (empty($error)) {
$login_allowed = true;
} else {
openidLogin_Res0($lang_module['openid_confirm_failed']);
die;
}
} else {
if ($crypt->validate_password($password, $nv_row['password']) and $nv_seccode) {
$login_allowed = true;
} else {
openidLogin_Res0($lang_module['openid_confirm_failed']);
die;
}
}
}
if ($login_allowed) {
$stmt = $db->prepare('INSERT INTO ' . NV_USERS_GLOBALTABLE . '_openid VALUES (' . intval($nv_row['userid']) . ', :server, :opid, :email )');
$stmt->bindParam(':server', $attribs['server'], PDO::PARAM_STR);
$stmt->bindParam(':opid', $opid, PDO::PARAM_STR);
$stmt->bindParam(':email', $email, PDO::PARAM_STR);
$stmt->execute();
if (intval($nv_row['active']) != 1) {
openidLogin_Res0($lang_module['login_no_active']);
} else {
validUserLog($nv_row, 1, $opid, $current_mode);
//.........这里部分代码省略.........
示例4: array
}
}
} else {
$data = array();
$data['checkss'] = md5($client_info['session_id'] . $global_config['sitekey']);
$data['userField'] = nv_substr($nv_Request->get_title('userField', 'post', '', 1), 0, 100);
$data['answer'] = nv_substr($nv_Request->get_title('answer', 'post', '', 1), 0, 255);
$data['send'] = $nv_Request->get_bool('send', 'post', false);
$data['nv_seccode'] = $nv_Request->get_title('nv_seccode', 'post', '');
$data['nv_redirect'] = $nv_Request->get_title('nv_redirect', 'get, post', '');
$checkss = $nv_Request->get_title('checkss', 'post', '');
$seccode = $nv_Request->get_string('lostpass_seccode', 'session', '');
$step = 1;
$error = $question = '';
if ($checkss == $data['checkss']) {
if (!empty($seccode) and md5($data['nv_seccode']) == $seccode or nv_capcha_txt($data['nv_seccode'])) {
if (!empty($data['userField'])) {
$check_email = nv_check_valid_email($data['userField']);
if (empty($check_email)) {
$sql = 'SELECT * FROM ' . NV_USERS_GLOBALTABLE . ' WHERE email= :userField AND active=1';
$userField = $data['userField'];
} else {
$sql = 'SELECT * FROM ' . NV_USERS_GLOBALTABLE . ' WHERE md5username=:userField AND active=1';
$userField = nv_md5safe($data['userField']);
}
$stmt = $db->prepare($sql);
$stmt->bindParam(':userField', $userField, PDO::PARAM_STR);
$stmt->execute();
$row = $stmt->fetch();
if (!empty($row)) {
$step = 2;
示例5: die
if (defined('NV_IS_BANNER_CLIENT')) {
die(' ');
}
if ($nv_Request->get_int('save', 'post') == '1') {
$login = strip_tags($nv_Request->get_string('login', 'post', ''));
$password = strip_tags($nv_Request->get_string('password', 'post', ''));
if ($global_config['gfx_chk']) {
$seccode = strip_tags($nv_Request->get_string('seccode', 'post', ''));
}
$check_login = nv_check_valid_login($login, NV_UNICKMAX, NV_UNICKMIN);
$check_pass = nv_check_valid_pass($password, NV_UPASSMAX, NV_UPASSMIN);
if (!empty($check_login)) {
die('action');
} elseif (!empty($check_pass)) {
die('action');
} elseif ($global_config['gfx_chk'] and !nv_capcha_txt($seccode)) {
die('action');
} else {
$stmt = $db->prepare('SELECT * FROM ' . NV_BANNERS_GLOBALTABLE . '_clients WHERE login = :login AND act=1');
$stmt->bindParam(':login', $login, PDO::PARAM_STR);
$stmt->execute();
$row = $stmt->fetch();
if (empty($row)) {
die('action');
} else {
if (!$crypt->validate_password($password, $row['pass'])) {
die('action');
} else {
$checknum = md5(nv_genpass(10));
$current_login = NV_CURRENTTIME;
$id = intval($row['id']);
示例6: elseif
$name = $user_info['username'];
$email = $user_info['email'];
} elseif (defined('NV_IS_ADMIN')) {
$userid = $admin_info['userid'];
$name = $admin_info['username'];
$email = $admin_info['email'];
$status = 1;
} else {
$userid = 0;
$name = filter_text_input('name', 'post', '', 1);
$email = filter_text_input('email', 'post', '');
}
$contents = "";
if ($module_config[$module_name]['activecomm'] and $id > 0 and $checkss == md5($id . session_id() . $global_config['sitekey']) and $name != "" and nv_check_valid_email($email) == "" and $code != "" and $content != "") {
$timeout = $nv_Request->get_int($module_name . '_' . $op . '_' . $id, 'cookie', 0);
if (!nv_capcha_txt($code)) {
$contents = "ERR_" . $lang_global['securitycodeincorrect'];
} elseif ($timeout == 0 or NV_CURRENTTIME - $timeout > $difftimeout) {
$query = $db->sql_query("SELECT listcatid, allowed_comm FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `id` = " . $id . " AND `status`=1 AND `publtime` < " . NV_CURRENTTIME . " AND (`exptime`=0 OR `exptime`>" . NV_CURRENTTIME . ")");
$row = $db->sql_fetchrow($query);
if (isset($row['allowed_comm']) and ($row['allowed_comm'] == 1 or $row['allowed_comm'] == 2 and defined('NV_IS_USER'))) {
$array_catid = explode(",", $row['listcatid']);
$sql = "INSERT INTO `" . NV_PREFIXLANG . "_" . $module_data . "_comments` (`cid`, `id`, `content`, `post_time`, `userid`, `post_name`, `post_email`, `post_ip`, `status`) VALUES (NULL, " . $id . "," . $db->dbescape($content) . ", UNIX_TIMESTAMP(), " . $userid . ", " . $db->dbescape($name) . ", " . $db->dbescape($email) . ", " . $db->dbescape(NV_CLIENT_IP) . ", " . $status . ")";
$result = $db->sql_query($sql);
if ($result) {
$page = 0;
list($numf) = $db->sql_fetchrow($db->sql_query("SELECT COUNT(*) FROM `" . NV_PREFIXLANG . "_" . $module_data . "_comments` where `id`= '" . $id . "' AND `status`=1"));
if ($status) {
$query = "UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "_rows` SET `hitscm`=" . $numf . " WHERE `id`=" . $id;
$db->sql_query($query);
foreach ($array_catid as $catid_i) {
示例7: implode
}
}
$array['linkdirect'] = !empty($array['linkdirect']) ? implode("\n", $array['linkdirect']) : '';
}
$alias = change_alias($array['title']);
$stmt = $db->prepare('SELECT COUNT(*) FROM ' . NV_PREFIXLANG . '_' . $module_data . ' WHERE alias= :alias');
$stmt->bindParam(':alias', $alias, PDO::PARAM_STR);
$stmt->execute();
$is_exists = $stmt->fetchColumn();
if (!$is_exists) {
$stmt = $db->prepare('SELECT COUNT(*) FROM ' . NV_PREFIXLANG . '_' . $module_data . '_tmp WHERE title= :title');
$stmt->bindParam(':title', $array['title'], PDO::PARAM_STR);
$stmt->execute();
$is_exists = $stmt->fetchColumn();
}
if (!nv_capcha_txt($seccode)) {
$is_error = true;
$error = $lang_module['upload_error1'];
} elseif (empty($array['user_name'])) {
$is_error = true;
$error = $lang_module['upload_error2'];
} elseif (empty($array['title'])) {
$is_error = true;
$error = $lang_module['file_error_title'];
} elseif ($is_exists) {
$is_error = true;
$error = $lang_module['file_title_exists'];
} elseif (!$array['catid'] or !isset($list_cats[$array['catid']])) {
$is_error = true;
$error = $lang_module['file_catid_exists'];
} elseif (!empty($array['author_email']) and ($check_valid_email = nv_check_valid_email($array['author_email'])) != '') {
示例8: filter_text_input
$name = filter_text_input('name', 'post', '', 1);
$youremail = filter_text_input('youremail', 'post', '');
}
$to_mail = $content = "";
if ($checkss == md5($id . session_id() . $global_config['sitekey']) and $allowed_send == 1) {
$link = NV_MY_DOMAIN . nv_url_rewrite(NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=" . $global_array_cat[$catid]['alias'] . "/" . $alias . "-" . $id, true);
$link = "<a href=\"{$link}\" title=\"{$title}\">{$link}</a>\n";
$nv_seccode = filter_text_input('nv_seccode', 'post', '');
$to_mail = filter_text_input('email', 'post', '');
$content = filter_text_input('content', 'post', '', 1);
$err_email = nv_check_valid_email($to_mail);
$err_youremail = nv_check_valid_email($youremail);
$err_name = "";
$message = "";
$success = "";
if ($global_config['gfx_chk'] > 0 and !nv_capcha_txt($nv_seccode)) {
$err_name = $lang_global['securitycodeincorrect'];
} elseif (empty($name)) {
$err_name = $lang_module['sendmail_err_name'];
} elseif (empty($err_email) and empty($err_youremail)) {
$subject = $lang_module['sendmail_subject'] . "{$name}";
$message .= "" . $lang_module['sendmail_welcome'] . " <strong>" . $global_config['site_name'] . "</strong> " . $lang_module['sendmail_welcome1'] . "<br /><br />" . $content . "<br /><br />" . $hometext . " <br/><br /><strong>" . $lang_module['sendmail_welcome2'] . "</strong><br />" . $link;
$from = array($name, $youremail);
$check = nv_sendmail($from, $to_mail, $subject, $message);
if ($check) {
$success = "" . $lang_module['sendmail_success'] . "<strong> " . $to_mail . "</strong>";
} else {
$success = $lang_module['sendmail_success_err'];
}
}
$result = array("err_name" => $err_name, "err_email" => $err_email, "err_yourmail" => $err_youremail, "send_success" => $success, "check" => $check);
示例9: nv_get_redirect
}
$nv_redirect = '';
if ($nv_Request->isset_request('nv_redirect', 'post,get')) {
$nv_redirect = nv_get_redirect();
}
$data = array();
$data['checkss'] = NV_CHECK_SESSION;
$checkss = $nv_Request->get_title('checkss', 'post', '');
if ($checkss == $data['checkss']) {
$data['step'] = $nv_Request->get_title('step', 'post', '');
if ($data['step'] != 'step2' and $data['step'] != 'step3' and $data['step'] != 'step4') {
$data['step'] = 'step1';
}
$seccode = $nv_Request->get_string('lostpass_seccode', 'session', '');
$data['nv_seccode'] = $nv_Request->get_title('nv_seccode', 'post', '');
if (empty($data['nv_seccode']) or !empty($data['nv_seccode']) and md5($data['nv_seccode']) != $seccode and !nv_capcha_txt($data['nv_seccode'])) {
$nv_Request->set_Session('lostpass_seccode', '');
die(json_encode(array('status' => 'error', 'input' => 'nv_seccode', 'step' => 'step1', 'mess' => $lang_global['securitycodeincorrect'])));
}
$data['userField'] = nv_substr($nv_Request->get_title('userField', 'post', '', 1), 0, 100);
if (empty($data['userField'])) {
$nv_Request->set_Session('lostpass_seccode', '');
die(json_encode(array('status' => 'error', 'input' => 'userField', 'step' => 'step1', 'mess' => $lang_module['lostpass_no_info1'])));
}
$check_email = nv_check_valid_email($data['userField']);
if (empty($check_email)) {
$sql = 'SELECT * FROM ' . NV_MOD_TABLE . ' WHERE email= :userField AND active=1';
$userField = nv_strtolower($data['userField']);
} else {
$sql = 'SELECT * FROM ' . NV_MOD_TABLE . ' WHERE md5username=:userField AND active=1';
$userField = nv_md5safe($data['userField']);
示例10: die
exit;
}
if (!defined('NV_IS_AJAX')) {
die('Wrong URL');
}
$timeout = $nv_Request->get_int($module_data . '_' . $op . '_' . $id, 'cookie', 0);
if ($timeout == 0 or NV_CURRENTTIME - $timeout > $difftimeout) {
$sender = $nv_Request->get_string('sender', 'get,post', '');
$rating = $nv_Request->get_int('rating', 'get,post', 0);
$comment = $nv_Request->get_textarea('comment', '');
$fcode = $nv_Request->get_string('fcode', 'get,post', '');
if (empty($sender)) {
$contents = "NO_" . $lang_module['rate_empty_sender'];
} elseif (empty($rating)) {
$contents = "NO_" . $lang_module['rate_empty_rating'];
} elseif ($pro_config['review_captcha'] and !nv_capcha_txt($fcode)) {
$contents = "NO_" . $lang_module['rate_empty_captcha'];
} else {
$userid = !empty($user_info) ? $user_info['userid'] : 0;
$status = $pro_config['review_check'] ? 0 : 1;
$sth = $db->prepare('INSERT INTO ' . $db_config['prefix'] . '_' . $module_data . '_review( product_id, userid, sender, content, rating, add_time, edit_time, status) VALUES( :product_id, :userid, :sender, :content, :rating, ' . NV_CURRENTTIME . ', ' . NV_CURRENTTIME . ', ' . $status . ')');
$sth->bindParam(':product_id', $id, PDO::PARAM_STR);
$sth->bindParam(':userid', $userid, PDO::PARAM_INT);
$sth->bindParam(':sender', $sender, PDO::PARAM_STR, strlen($sender));
$sth->bindParam(':content', $comment, PDO::PARAM_STR, strlen($comment));
$sth->bindParam(':rating', $rating, PDO::PARAM_INT);
if ($sth->execute()) {
$content = array('product_id' => $id, 'content' => $comment, 'rating' => $rating, 'status' => $status);
nv_insert_notification($module_name, 'review_new', $content, 0, $userid, 1);
$nv_Cache->delMod($module_name);
$contents = "OK_" . ($pro_config['review_check'] ? $lang_module['rate_success_queue'] : $lang_module['rate_success_ok']);
示例11: elseif
$show_captcha = true;
if ($captcha == 0) {
$show_captcha = false;
} elseif ($captcha == 1 and defined('NV_IS_USER')) {
$show_captcha = false;
} elseif ($captcha == 2 and defined('NV_IS_MODADMIN')) {
if (defined('NV_IS_SPADMIN')) {
$show_captcha = false;
} else {
$adminscomm = explode(',', $module_config[$module]['adminscomm']);
if (in_array($admin_info['admin_id'], $adminscomm)) {
$show_captcha = false;
}
}
}
if ($show_captcha and !nv_capcha_txt($code)) {
$contents = 'ERR_' . $lang_global['securitycodeincorrect'];
} elseif ($timeout == 0 or NV_CURRENTTIME - $timeout > $difftimeout) {
$pid = $nv_Request->get_int('pid', 'post', 0);
try {
$stmt = $db->prepare('INSERT INTO ' . NV_PREFIXLANG . '_' . $module_data . ' (module, area, id, pid, content, post_time, userid, post_name, post_email, post_ip, status) VALUES (:module, ' . $area . ', ' . $id . ', ' . $pid . ', :content, ' . NV_CURRENTTIME . ', ' . $userid . ', :post_name, :post_email, :post_ip, ' . $status . ')');
$stmt->bindParam(':module', $module, PDO::PARAM_STR);
$stmt->bindParam(':content', $content, PDO::PARAM_STR, strlen($content));
$stmt->bindParam(':post_name', $name, PDO::PARAM_STR);
$stmt->bindParam(':post_email', $email, PDO::PARAM_STR);
$stmt->bindValue(':post_ip', NV_CLIENT_IP, PDO::PARAM_STR);
$stmt->execute();
if ($stmt->rowCount()) {
$nv_Request->set_Cookie($module_name . '_timeout', NV_CURRENTTIME);
if ($status) {
$mod_info = $site_mods[$module];
示例12: openidLogin_Res1
/**
* openidLogin_Res1()
* Function thuc hien khi OpenID duoc nhan dien
*
* @param mixed $attribs
* @return
*/
function openidLogin_Res1($attribs)
{
global $page_title, $key_words, $mod_title, $db, $crypt, $nv_Request, $lang_module, $lang_global, $module_name, $module_info, $global_config, $gfx_chk, $nv_redirect;
$email = (isset($attribs['contact/email']) and nv_check_valid_email($attribs['contact/email']) == "") ? $attribs['contact/email'] : "";
if (empty($email)) {
$nv_Request->unset_request('openid_attribs', 'session');
openidLogin_Res0($lang_module['logged_in_failed']);
die;
}
$opid = $crypt->hash($attribs['id']);
$query = "SELECT a.userid AS uid, a.email AS uemail, b.active AS uactive FROM `" . NV_USERS_GLOBALTABLE . "_openid` a, `" . NV_USERS_GLOBALTABLE . "` b \r\n WHERE a.opid=" . $db->dbescape($opid) . " \r\n AND a.email=" . $db->dbescape($email) . " \r\n AND a.userid=b.userid";
$result = $db->sql_query($query);
$numrows = $db->sql_numrows($result);
if ($numrows) {
list($user_id, $op_email, $user_active) = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$nv_Request->unset_request('openid_attribs', 'session');
if ($op_email != $email) {
openidLogin_Res0($lang_module['not_logged_in']);
die;
}
if (!$user_active) {
openidLogin_Res0($lang_module['login_no_active']);
die;
}
$query = "SELECT * FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `userid`=" . $db->dbescape($user_id);
$result = $db->sql_query($query);
$row = $db->sql_fetchrow($result);
validUserLog($row, 1, $opid);
$nv_redirect = !empty($nv_redirect) ? nv_base64_decode($nv_redirect) : NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name;
Header("Location: " . $nv_redirect);
die;
}
$query = "SELECT * FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `email`=" . $db->dbescape($email);
$result = $db->sql_query($query);
$numrows = $db->sql_numrows($result);
if ($numrows) {
$nv_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$login_allowed = false;
if (empty($nv_row['password'])) {
$nv_Request->unset_request('openid_attribs', 'session');
$login_allowed = true;
}
if ($nv_Request->isset_request('openid_account_confirm', 'post')) {
$nv_Request->unset_request('openid_attribs', 'session');
if (defined('NV_IS_USER_FORUM') and file_exists(NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/login.php')) {
$nv_username = $nv_row['username'];
$nv_password = $password;
require_once NV_ROOTDIR . '/' . DIR_FORUM . '/nukeviet/login.php';
if (empty($error)) {
$login_allowed = true;
} else {
openidLogin_Res0($lang_module['openid_confirm_failed']);
die;
}
} else {
$password = $nv_Request->get_string('password', 'post', '');
$nv_seccode = filter_text_input('nv_seccode', 'post', '');
$nv_seccode = !$gfx_chk ? 1 : (nv_capcha_txt($nv_seccode) ? 1 : 0);
if ($crypt->validate($password, $nv_row['password']) and $nv_seccode) {
$login_allowed = true;
} else {
openidLogin_Res0($lang_module['openid_confirm_failed']);
die;
}
}
}
if ($login_allowed) {
$sql = "INSERT INTO `" . NV_USERS_GLOBALTABLE . "_openid` VALUES (" . intval($nv_row['userid']) . ", " . $db->dbescape($attribs['id']) . ", " . $db->dbescape($opid) . ", " . $db->dbescape($email) . ")";
$db->sql_query($sql);
if (intval($nv_row['active']) != 1) {
openidLogin_Res0($lang_module['login_no_active']);
} else {
validUserLog($nv_row, 1, $opid);
Header("Location: " . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name);
}
die;
}
$page_title = $lang_module['openid_login'];
$key_words = $module_info['keywords'];
$mod_title = $lang_module['openid_login'];
$lang_module['login_info'] = sprintf($lang_module['openid_confirm_info'], $email);
$contents = openid_account_confirm($gfx_chk, $attribs);
include NV_ROOTDIR . "/includes/header.php";
echo nv_site_theme($contents);
include NV_ROOTDIR . "/includes/footer.php";
exit;
}
if ($global_config['allowuserreg'] == 2 or $global_config['allowuserreg'] == 3) {
$query = "SELECT * FROM `" . NV_USERS_GLOBALTABLE . "_reg` WHERE `email`=" . $db->dbescape($email);
if ($global_config['allowuserreg'] == 2) {
$query .= " AND `regdate`>" . (NV_CURRENTTIME - 86400);
//.........这里部分代码省略.........
示例13: nv_substr
$fname = nv_substr($nv_Request->get_title('fname', 'post', '', 1), 0, 100);
$femail = nv_substr($nv_Request->get_title('femail', 'post', '', 1), 0, 100);
}
if (empty($fname)) {
die(json_encode(array('status' => 'error', 'input' => 'fname', 'mess' => $lang_module['error_fullname'])));
}
if (($check_valid_email = nv_check_valid_email($femail)) != '') {
die(json_encode(array('status' => 'error', 'input' => 'femail', 'mess' => $check_valid_email)));
}
if (($ftitle = nv_substr($nv_Request->get_title('ftitle', 'post', '', 1), 0, 255)) == '') {
die(json_encode(array('status' => 'error', 'input' => 'ftitle', 'mess' => $lang_module['error_title'])));
}
if (($fcon = $nv_Request->get_editor('fcon', '', NV_ALLOWED_HTML_TAGS)) == '') {
die(json_encode(array('status' => 'error', 'input' => 'fcon', 'mess' => $lang_module['error_content'])));
}
if (!nv_capcha_txt($nv_Request->get_title('fcode', 'post', ''))) {
die(json_encode(array('status' => 'error', 'input' => 'fcode', 'mess' => $lang_module['error_captcha'])));
}
$fcat = $nv_Request->get_int('fcat', 'post', 0);
if (isset($cats[$fcat])) {
$fpart = (int) $cats[$fcat][0];
$fcat = $cats[$fcat][1];
} else {
$fpart = (int) $cats[0][0];
$fcat = $cats[0][1];
}
if ($fpart == 0) {
$fpart = $dpDefault;
$fcat = '';
}
$fcon = nv_nl2br($fcon);
示例14: COUNT
$array_data['temporarily_d'] = $nv_Request->get_title('district2', 'post', 0);
$array_data['temporarily_w'] = $nv_Request->get_title('ward2', 'post', 0);
$array_data['temporarily_s'] = $nv_Request->get_title('temporarily_s', 'post', '');
$count_identity_card = $db->query('SELECT COUNT(*) FROM ' . NV_PREFIXLANG . '_' . $module_data . ' WHERE identity_card=' . $db->quote($array_data['identity_card']) . ' AND id != ' . $array_data['id'])->fetchColumn();
if (empty($array_user['first_name'])) {
$error[] = $lang_module['error_first_name'];
}
if (empty($array_user['last_name'])) {
$error[] = $lang_module['error_last_name'];
}
if (empty($array_data['identity_card'])) {
$error[] = $lang_module['error_identity_card'];
} elseif ($count_identity_card > 0) {
$error[] = $lang_module['error_identity_card_exist'];
}
if (!nv_capcha_txt($array_data['fcode'])) {
$error[] = $lang_module['error_captcha'];
}
if (preg_match('/^([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{4})$/', $nv_Request->get_string('birthday', 'post'), $m)) {
$_hour = 0;
$_min = 0;
$array_user['birthday'] = mktime($_hour, $_min, 0, $m[2], $m[1], $m[3]);
} else {
$array_user['birthday'] = 0;
}
if (preg_match('/^([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{4})$/', $nv_Request->get_string('recent_time', 'post'), $m)) {
$_hour = 0;
$_min = 0;
$array_data['recent_time'] = mktime($_hour, $_min, 0, $m[2], $m[1], $m[3]);
} else {
$array_data['recent_time'] = 0;