本文整理汇总了PHP中nv_check_valid_pass函数的典型用法代码示例。如果您正苦于以下问题:PHP nv_check_valid_pass函数的具体用法?PHP nv_check_valid_pass怎么用?PHP nv_check_valid_pass使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nv_check_valid_pass函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: nv_substr
$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'])));
}
if (empty($array_register['your_question']) and empty($array_register['question'])) {
die(reg_result(array('status' => 'error', 'input' => 'your_question', 'mess' => $lang_global['your_question_empty'])));
}
if (empty($array_register['answer'])) {
die(reg_result(array('status' => 'error', 'input' => 'answer', 'mess' => $lang_global['answer_empty'])));
}
if (empty($array_register['agreecheck'])) {
die(reg_result(array('status' => 'error', 'input' => 'agreecheck', 'mess' => $lang_global['agreecheck_empty'])));
}
$query_field = array('userid' => 0);
示例2: define
$nextstep = 0;
$error = '';
define('NV_USERS_GLOBALTABLE', $db_config['prefix'] . '_users');
// Bat dau phien lam viec cua MySQL
$db = new NukeViet\Core\Database($db_config);
if (!empty($db->error)) {
$error = !empty($db->error['user_message']) ? $db->error['user_message'] : $db->error['message'];
}
$array_data['site_name'] = $nv_Request->get_title('site_name', 'post', $array_data['site_name'], 1);
$array_data['nv_login'] = nv_substr($nv_Request->get_title('nv_login', 'post', $array_data['nv_login'], 1), 0, NV_UNICKMAX);
$array_data['nv_email'] = $nv_Request->get_title('nv_email', 'post', $array_data['nv_email']);
$array_data['nv_password'] = $nv_Request->get_title('nv_password', 'post', $array_data['nv_password']);
$array_data['re_password'] = $nv_Request->get_title('re_password', 'post', $array_data['re_password']);
$array_data['lang_multi'] = (int) $nv_Request->get_bool('lang_multi', 'post', $array_data['lang_multi']);
$check_login = nv_check_valid_login($array_data['nv_login'], NV_UNICKMAX, NV_UNICKMIN);
$check_pass = nv_check_valid_pass($array_data['nv_password'], NV_UPASSMAX, NV_UPASSMIN);
$check_email = nv_check_valid_email($array_data['nv_email']);
$array_data['question'] = $nv_Request->get_title('question', 'post', $array_data['question'], 1);
$array_data['answer_question'] = $nv_Request->get_title('answer_question', 'post', $array_data['answer_question'], 1);
$global_config['site_email'] = $array_data['nv_email'];
if ($nv_Request->isset_request('nv_login,nv_password', 'post')) {
if (empty($array_data['site_name'])) {
$error = $lang_module['err_sitename'];
} elseif (!empty($check_login)) {
$error = $check_login;
} elseif ("'" . $array_data['nv_login'] . "'" != $db->quote($array_data['nv_login'])) {
$error = sprintf($lang_module['account_deny_name'], '<strong>' . $array_data['nv_login'] . '</strong>');
} elseif (!empty($check_email)) {
$error = $check_email;
} elseif (!empty($check_pass)) {
$error = $check_pass;
示例3: elseif
}
if (($error_username = nv_check_valid_login($_user['username'], NV_UNICKMAX, NV_UNICKMIN)) != "") {
$error = $error_username;
} elseif ($_user['username'] != $db->fixdb($_user['username'])) {
$error = sprintf($lang_module['account_deny_name'], '<strong>' . $_user['username'] . '</strong>');
} elseif (($error_xemail = nv_check_valid_email($_user['email'])) != "") {
$error = $error_xemail;
} elseif ($db->sql_numrows($db->sql_query("SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `md5username`=" . $db->dbescape(md5($_user['username'])))) != 0) {
$error = $lang_module['edit_error_username_exist'];
} elseif ($db->sql_numrows($db->sql_query("SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `email`=" . $db->dbescape($_user['email']))) != 0) {
$error = $lang_module['edit_error_email_exist'];
} elseif ($db->sql_numrows($db->sql_query("SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_reg` WHERE `email`=" . $db->dbescape($_user['email']))) != 0) {
$error = $lang_module['edit_error_email_exist'];
} elseif ($db->sql_numrows($db->sql_query("SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_openid` WHERE `email`=" . $db->dbescape($_user['email']))) != 0) {
$error = $lang_module['edit_error_email_exist'];
} elseif (($check_pass = nv_check_valid_pass($_user['password1'], NV_UPASSMAX, NV_UPASSMIN)) != "") {
$error = $check_pass;
} elseif ($_user['password1'] != $_user['password2']) {
$error = $lang_module['edit_error_password'];
} elseif (empty($_user['question'])) {
$error = $lang_module['edit_error_question'];
} elseif (empty($_user['answer'])) {
$error = $lang_module['edit_error_answer'];
} else {
$_user['sig'] = nv_nl2br($_user['sig'], "<br />");
if ($_user['gender'] != "M" and $_user['gender'] != "F") {
$_user['gender'] = "";
}
if (preg_match("/^([0-9]{1,2})\\.([0-9]{1,2})\\.([0-9]{4})\$/", $_user['birthday'], $m)) {
$_user['birthday'] = mktime(0, 0, 0, $m[2], $m[1], $m[3]);
} else {
示例4: elseif
$custom_fields = $nv_Request->get_array('custom_fields', 'post');
if ($_user['username'] != $row['username'] and ($error_username = nv_check_valid_login($_user['username'], NV_UNICKMAX, NV_UNICKMIN)) != '') {
$error = $error_username;
} elseif ("'" . $_user['username'] . "'" != $db->quote($_user['username'])) {
$error = sprintf($lang_module['account_deny_name'], '<strong>' . $_user['username'] . '</strong>');
} elseif (($error_xemail = nv_check_valid_email($_user['email'])) != '') {
$error = $error_xemail;
} elseif ($db->query('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . ' WHERE userid!=' . $userid . ' AND md5username=' . $db->quote(nv_md5safe($_user['username'])))->fetchColumn()) {
$error = $lang_module['edit_error_username_exist'];
} elseif ($db->query('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . ' WHERE userid!=' . $userid . ' AND email=' . $db->quote($_user['email']))->fetchColumn()) {
$error = $lang_module['edit_error_email_exist'];
} elseif ($db->query('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . '_reg WHERE email=' . $db->quote($_user['email']))->fetchColumn()) {
$error = $lang_module['edit_error_email_exist'];
} elseif ($db->query('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . '_openid WHERE userid!=' . $userid . ' AND email=' . $db->quote($_user['email']))->fetchColumn()) {
$error = $lang_module['edit_error_email_exist'];
} elseif (!empty($_user['password1']) and ($check_pass = nv_check_valid_pass($_user['password1'], NV_UPASSMAX, NV_UPASSMIN)) != '') {
$error = $check_pass;
} elseif (!empty($_user['password1']) and $_user['password1'] != $_user['password2']) {
$error = $lang_module['edit_error_password'];
} elseif (empty($_user['question'])) {
$error = $lang_module['edit_error_question'];
} elseif (empty($_user['answer'])) {
$error = $lang_module['edit_error_answer'];
} else {
$query_field = array();
if (!empty($array_field_config)) {
require NV_ROOTDIR . '/modules/users/fields.check.php';
}
if (empty($error)) {
$_user['sig'] = nv_nl2br($_user['sig'], '<br />');
if ($_user['gender'] != 'M' and $_user['gender'] != 'F') {
示例5: die
* @Createdate 3/24/2010 23:58
*/
if (!defined('NV_IS_MOD_BANNERS')) {
die('Stop!!!');
}
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'])) {
示例6: array
$name = $global_config['name_show'] ? array($row['first_name'], $row['last_name']) : array($row['last_name'], $row['first_name']);
$name = array_filter($name);
$name = implode(' ', $name);
$sitename = '<a href="' . NV_MY_DOMAIN . NV_BASE_SITEURL . '">' . $global_config['site_name'] . '</a>';
$message = sprintf($lang_module['edit_mail_content'], $name, $sitename, $lang_global['email'], $nv_email);
@nv_sendmail($global_config['site_email'], $nv_email, $lang_module['edit_mail_subject'], $message);
die(json_encode(array('status' => 'ok', 'input' => nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=editinfo/email', true), 'mess' => $lang_module['editinfo_ok'])));
}
} elseif ($checkss == $array_data['checkss'] and $array_data['type'] == 'password') {
$nv_password = $nv_Request->get_title('nv_password', 'post', '');
$new_password = $nv_Request->get_title('new_password', 'post', '');
$re_password = $nv_Request->get_title('re_password', 'post', '');
if (!empty($row['password']) and !$crypt->validate_password($nv_password, $row['password'])) {
die(json_encode(array('status' => 'error', 'input' => 'password', 'mess' => $lang_global['incorrect_password'])));
}
if (($check_new_password = nv_check_valid_pass($new_password, NV_UPASSMAX, NV_UPASSMIN)) != '') {
die(json_encode(array('status' => 'error', 'input' => 'new_password', 'mess' => $check_new_password)));
}
if ($new_password != $re_password) {
die(json_encode(array('status' => 'error', 'input' => 're_password', 'mess' => $lang_global['passwordsincorrect'])));
}
$re_password = $crypt->hash_password($new_password, $global_config['hashprefix']);
$stmt = $db->prepare('UPDATE ' . NV_USERS_GLOBALTABLE . ' SET password= :password WHERE userid=' . $user_info['userid']);
$stmt->bindParam(':password', $re_password, PDO::PARAM_STR);
$stmt->execute();
$name = $global_config['name_show'] ? array($row['first_name'], $row['last_name']) : array($row['last_name'], $row['first_name']);
$name = array_filter($name);
$name = implode(' ', $name);
$sitename = '<a href="' . NV_MY_DOMAIN . NV_BASE_SITEURL . '">' . $global_config['site_name'] . '</a>';
$message = sprintf($lang_module['edit_mail_content'], $name, $sitename, $lang_global['password'], $new_password);
@nv_sendmail($global_config['site_email'], $row['email'], $lang_module['edit_mail_subject'], $message);
示例7: filter_text_input
}
if ($nv_Request->isset_request('submituser', 'post')) {
$uid = $nv_Request->get_int('uid', 'post', 0);
$username = filter_text_input('username', 'post', '', 1);
$password = filter_text_input('password', 'post', '', 1);
$password2 = filter_text_input('password2', 'post', '', 1);
$begintime1 = filter_text_input('begintime1', 'post', 0, 1);
$endtime1 = filter_text_input('endtime1', 'post', 0, 1);
$errorlogin = nv_check_valid_login($username, NV_UNICKMAX, NV_UNICKMIN);
if (!empty($errorlogin)) {
$error[] = $errorlogin;
} elseif (preg_match("/[^a-zA-Z0-9_-]/", $username)) {
$error[] = $lang_module['rule_user'];
}
if (!empty($password) or empty($uid)) {
$errorpassword = nv_check_valid_pass($password, NV_UPASSMAX, NV_UPASSMIN);
if (!empty($errorpassword)) {
$error[] = $errorpassword;
}
if ($password != $password2) {
$error[] = $lang_module['passwordsincorrect'];
} elseif (preg_match("/[^a-zA-Z0-9_-]/", $password)) {
$error[] = $lang_module['rule_pass'];
}
}
if (!empty($begintime1) && preg_match("/^([0-9]{1,2})\\.([0-9]{1,2})\\.([0-9]{4})\$/", $begintime1, $m)) {
$begintime1 = mktime(0, 0, 0, $m[2], $m[1], $m[3]);
} else {
$begintime1 = NV_CURRENTTIME;
}
if (!empty($endtime1) && preg_match("/^([0-9]{1,2})\\.([0-9]{1,2})\\.([0-9]{4})\$/", $endtime1, $m)) {
示例8: array
$page_title = $mod_title = $lang_module['change_pass'];
$key_words = $module_info['keywords'];
$array_data = array();
$array_data['pass_empty'] = empty($oldpassword) ? true : false;
$array_data['change_info'] = $lang_module['change_info'];
$array_data['checkss'] = md5(session_id() . $global_config['sitekey']);
$array_data['nv_password'] = filter_text_input('nv_password', 'post', '');
$array_data['new_password'] = filter_text_input('new_password', 'post', '');
$array_data['re_password'] = filter_text_input('re_password', 'post', '');
$checkss = filter_text_input('checkss', 'post', '');
if ($checkss == $array_data['checkss']) {
$error = "";
if (!empty($oldpassword) and !$crypt->validate($array_data['nv_password'], $oldpassword)) {
$error = $lang_global['incorrect_password'];
$error = str_replace($lang_global['password'], $lang_module['pass_old'], $error);
} elseif (($check_new_password = nv_check_valid_pass($array_data['new_password'], NV_UPASSMAX, NV_UPASSMIN)) != "") {
$error = $check_new_password;
} elseif ($array_data['new_password'] != $array_data['re_password']) {
$error = sprintf($lang_global['passwordsincorrect'], $array_data['new_password'], $array_data['re_password']);
$error = str_replace($lang_global['password'], $lang_module['pass_new'], $error);
} else {
$new_password = $crypt->hash($array_data['new_password']);
$sql = "UPDATE `" . NV_USERS_GLOBALTABLE . "` SET `password`=" . $db->dbescape($new_password) . " WHERE `userid`=" . $user_info['userid'];
$db->sql_query($sql);
$contents = user_info_exit($lang_module['change_pass_ok']);
$contents .= "<meta http-equiv=\"refresh\" content=\"5;url=" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module_name . "\" />";
include NV_ROOTDIR . "/includes/header.php";
echo nv_site_theme($contents);
include NV_ROOTDIR . "/includes/footer.php";
exit;
}
示例9: openidLogin_Res1
//.........这里部分代码省略.........
exit;
} else {
openidLogin_Res0($lang_module['openid_confirm_failed']);
die;
}
}
$page_title = $mod_title = $lang_module['openid_active_title'];
$key_words = $module_info['keywords'];
$lang_module['login_info'] = sprintf($lang_module['openid_active_confirm_info'], $email);
$contents = openid_active_confirm($gfx_chk, $attribs);
include NV_ROOTDIR . "/includes/header.php";
echo nv_site_theme($contents);
include NV_ROOTDIR . "/includes/footer.php";
exit;
} else {
$nv_Request->unset_request('openid_attribs', 'session');
openidLogin_Res0($lang_module['account_register_to_admin']);
die;
}
}
}
$option = $nv_Request->get_int('option', 'get', 0);
if (!$global_config['allowuserreg']) {
$option = 3;
}
$contents = "";
if ($option == 3) {
$error = "";
if ($nv_Request->isset_request('nv_login', 'post')) {
$nv_username = filter_text_input('nv_login', 'post', '');
$nv_password = filter_text_input('nv_password', 'post', '');
$nv_seccode = filter_text_input('nv_seccode', 'post', '');
$check_login = nv_check_valid_login($nv_username, NV_UNICKMAX, NV_UNICKMIN);
$check_pass = nv_check_valid_pass($nv_password, NV_UPASSMAX, NV_UPASSMIN);
$check_seccode = !$gfx_chk ? true : (nv_capcha_txt($nv_seccode) ? true : false);
if (!$check_seccode) {
$error = $lang_global['securitycodeincorrect'];
} elseif (!empty($check_login)) {
$error = $check_login;
} elseif (!empty($check_pass)) {
$error = $check_pass;
} else {
$sql = "SELECT * FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `username`=" . $db->dbescape($nv_username);
$result = $db->sql_query($sql);
$numrows = $db->sql_numrows($result);
if ($numrows != 1) {
$error = $lang_global['loginincorrect'];
} else {
$row = $db->sql_fetchrow($result);
if (empty($row['password']) or !$crypt->validate($nv_password, $row['password'])) {
$error = $lang_global['loginincorrect'];
} else {
if (!$row['active']) {
$error = $lang_module['login_no_active'];
} else {
$nv_Request->unset_request('openid_attribs', 'session');
$sql = "INSERT INTO `" . NV_USERS_GLOBALTABLE . "_openid` VALUES (" . intval($row['userid']) . ", " . $db->dbescape($attribs['id']) . ", " . $db->dbescape($opid) . ", " . $db->dbescape($email) . ")";
$db->sql_query($sql);
validUserLog($row, 1, $opid);
}
}
}
}
if (empty($error)) {
$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;
$info = $lang_module['login_ok'] . "<br /><br />\n";