• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP nv_check_valid_email函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中nv_check_valid_email函数的典型用法代码示例。如果您正苦于以下问题:PHP nv_check_valid_email函数的具体用法?PHP nv_check_valid_email怎么用?PHP nv_check_valid_email使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了nv_check_valid_email函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: nv_check_email_reg

function nv_check_email_reg($email)
{
    global $db, $lang_module;
    $error = nv_check_valid_email($email);
    if ($error != "") {
        return preg_replace("/\\&(l|r)dquo\\;/", "", strip_tags($error));
    }
    $sql = "SELECT `content` FROM `" . NV_USERS_GLOBALTABLE . "_config` WHERE `config`='deny_email'";
    $result = $db->sql_query($sql);
    list($deny_email) = $db->sql_fetchrow($result);
    $db->sql_freeresult();
    if (!empty($deny_email) and preg_match("/" . $deny_email . "/i", $email)) {
        return sprintf($lang_module['email_deny_name'], $email);
    }
    list($left, $right) = explode("@", $email);
    $left = preg_replace("/[\\.]+/", "", $left);
    $pattern = str_split($left);
    $pattern = implode(".?", $pattern);
    $pattern = "^" . $pattern . "@" . $right . "\$";
    $sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `email` RLIKE " . $db->dbescape($pattern);
    if ($db->sql_numrows($db->sql_query($sql)) != 0) {
        return sprintf($lang_module['email_registered_name'], $email);
    }
    $sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_reg` WHERE `email`RLIKE " . $db->dbescape($pattern);
    if ($db->sql_numrows($db->sql_query($sql)) != 0) {
        return sprintf($lang_module['email_registered_name'], $email);
    }
    $sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_openid` WHERE `email` RLIKE " . $db->dbescape($pattern);
    if ($db->sql_numrows($db->sql_query($sql)) != 0) {
        return sprintf($lang_module['email_registered_name'], $email);
    }
    return "";
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:33,代码来源:register.php


示例2: nv_check_email_change

/**
 * nv_check_email_change()
 * 
 * @param mixed $email
 * @return
 */
function nv_check_email_change($email)
{
    global $db, $lang_module, $user_info;
    $error = nv_check_valid_email($email);
    if ($error != "") {
        return $error;
    }
    $sql = "SELECT `content` FROM `" . NV_USERS_GLOBALTABLE . "_config` WHERE `config`='deny_email'";
    $result = $db->sql_query($sql);
    list($deny_email) = $db->sql_fetchrow($result);
    $db->sql_freeresult();
    if (!empty($deny_email) and preg_match("/" . $deny_email . "/i", $email)) {
        return sprintf($lang_module['email_deny_name'], '<strong>' . $email . '</strong>');
    }
    $sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `userid`!=" . $user_info['userid'] . " AND `email`=" . $db->dbescape($email);
    if ($db->sql_numrows($db->sql_query($sql)) != 0) {
        return sprintf($lang_module['email_registered_name'], '<strong>' . $email . '</strong>');
    }
    $sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_reg` WHERE `email`=" . $db->dbescape($email);
    if ($db->sql_numrows($db->sql_query($sql)) != 0) {
        return sprintf($lang_module['email_registered_name'], '<strong>' . $email . '</strong>');
    }
    $sql = "SELECT `userid` FROM `" . NV_USERS_GLOBALTABLE . "_openid` WHERE `userid`!=" . $user_info['userid'] . " AND `email`=" . $db->dbescape($email);
    if ($db->sql_numrows($db->sql_query($sql)) != 0) {
        return sprintf($lang_module['email_registered_name'], '<strong>' . $email . '</strong>');
    }
    return "";
}
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:34,代码来源:editinfo.php


示例3: nv_SendMail2User

/**
 * nv_SendMail2User()
 *
 * @param mixed $cid
 * @param mixed $fcontent
 * @param mixed $ftitle
 * @param mixed $femail
 * @param mixed $full_name
 * @return void
 */
function nv_SendMail2User($cid, $fcontent, $ftitle, $femail, $full_name)
{
    global $db, $module_data;
    $email_list = array();
    $sql = "SELECT `email`, `admins` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `id` =" . $cid;
    $result = $db->sql_query($sql);
    list($email, $admins) = $db->sql_fetchrow($result);
    if (!empty($email)) {
        $email_list[] = $email;
    }
    if (!empty($admins)) {
        $admins = array_map("trim", explode(";", $admins));
        $a_l = array();
        foreach ($admins as $adm) {
            if (preg_match("/^([0-9]+)\\/([0-1]{1})\\/([0-1]{1})\\/([0-1]{1})\$/i", $adm)) {
                $adm2 = array_map("trim", explode("/", $adm));
                if ($adm2[3] == 1) {
                    $a_l[] = intval($adm2[0]);
                }
            }
        }
        if (!empty($a_l)) {
            $a_l = implode(",", $a_l);
            $sql = "SELECT t2.email as admin_email FROM `" . NV_AUTHORS_GLOBALTABLE . "` AS t1 INNER JOIN  `" . NV_USERS_GLOBALTABLE . "` AS t2 ON t1.admin_id = t2.userid WHERE t1.lev!=0 AND t1.is_suspend=0 AND t1.admin_id IN (" . $a_l . ")";
            $result = $db->sql_query($sql);
            while ($row = $db->sql_fetchrow($result)) {
                if (nv_check_valid_email($row['admin_email']) == "") {
                    $email_list[] = $row['admin_email'];
                }
            }
        }
    }
    $email_list = array_unique($email_list);
    if (!empty($email_list)) {
        $from = array($full_name, $femail);
        foreach ($email_list as $to) {
            @nv_sendmail($from, $to, $ftitle, $fcontent);
        }
    }
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:50,代码来源:main.php


示例4: nv_check_email_reg

/**
 * nv_check_email_reg()
 * Ham kiem tra email kha dung
 *
 * @param mixed $email
 * @return
 */
function nv_check_email_reg($email)
{
    global $db, $db_config, $lang_module;
    $error = nv_check_valid_email($email);
    if ($error != '') {
        return preg_replace('/\\&(l|r)dquo\\;/', '', strip_tags($error));
    }
    $sql = "SELECT content FROM " . NV_USERS_GLOBALTABLE . "_config WHERE config='deny_email'";
    $result = $db->query($sql);
    $deny_email = $result->fetchColumn();
    $result->closeCursor();
    if (!empty($deny_email) and preg_match('/' . $deny_email . '/i', $email)) {
        return sprintf($lang_module['email_deny_name'], $email);
    }
    list($left, $right) = explode('@', $email);
    $left = preg_replace('/[\\.]+/', '', $left);
    $pattern = str_split($left);
    $pattern = implode('.?', $pattern);
    $pattern = '^' . $pattern . '@' . $right . '$';
    $stmt = $db->prepare('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . ' WHERE email RLIKE :pattern');
    $stmt->bindParam(':pattern', $pattern, PDO::PARAM_STR);
    $stmt->execute();
    if ($stmt->fetchColumn()) {
        return sprintf($lang_module['email_registered_name'], $email);
    }
    $stmt = $db->prepare('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . '_reg WHERE email RLIKE :pattern');
    $stmt->bindParam(':pattern', $pattern, PDO::PARAM_STR);
    $stmt->execute();
    if ($stmt->fetchColumn()) {
        return sprintf($lang_module['email_registered_name'], $email);
    }
    $stmt = $db->prepare('SELECT userid FROM ' . NV_USERS_GLOBALTABLE . '_openid WHERE email RLIKE :pattern');
    $stmt->bindParam(':pattern', $pattern, PDO::PARAM_STR);
    $stmt->execute();
    if ($stmt->fetchColumn()) {
        return sprintf($lang_module['email_registered_name'], $email);
    }
    return '';
}
开发者ID:NukeVietCMS,项目名称:CodeWeb,代码行数:46,代码来源:register.php


示例5: nv_SendMail2User

/**
 * nv_SendMail2User()
 *
 * @param mixed $cid
 * @param mixed $fcontent
 * @param mixed $ftitle
 * @param mixed $femail
 * @param mixed $full_name
 * @return void
 */
function nv_SendMail2User($cid, $fcontent, $ftitle, $femail, $full_name)
{
    global $db, $module_data, $db_config;
    $email_list = array();
    $sql = 'SELECT email, admins FROM ' . NV_PREFIXLANG . '_' . $module_data . '_department WHERE id =' . $cid;
    $result = $db->query($sql);
    list($email, $admins) = $result->fetch(3);
    if (!empty($email)) {
        $email_list[] = $email;
    }
    if (!empty($admins)) {
        $admins = array_map('trim', explode(';', $admins));
        $a_l = array();
        foreach ($admins as $adm) {
            if (preg_match('/^([0-9]+)\\/([0-1]{1})\\/([0-1]{1})\\/([0-1]{1})$/i', $adm)) {
                $adm2 = array_map('trim', explode('/', $adm));
                if ($adm2[3] == 1) {
                    $a_l[] = intval($adm2[0]);
                }
            }
        }
        if (!empty($a_l)) {
            $a_l = implode(',', $a_l);
            $sql = 'SELECT t2.email as admin_email FROM ' . NV_AUTHORS_GLOBALTABLE . ' t1 INNER JOIN ' . NV_USERS_GLOBALTABLE . ' t2 ON t1.admin_id = t2.userid WHERE t1.lev!=0 AND t1.is_suspend=0 AND t1.admin_id IN (' . $a_l . ')';
            $result = $db->query($sql);
            while ($row = $result->fetch()) {
                if (nv_check_valid_email($row['admin_email']) == '') {
                    $email_list[] = $row['admin_email'];
                }
            }
        }
    }
    if (!empty($email_list)) {
        $from = array($full_name, $femail);
        $email_list = array_unique($email_list);
        @nv_sendmail($from, $email_list, $ftitle, $fcontent);
    }
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:48,代码来源:main.php


示例6: 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;
                    if (empty($seccode)) {
                        $nv_Request->set_Session('lostpass_seccode', md5($data['nv_seccode']));
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:lostpass.php


示例7: array_filter

 }
 if (!empty($array_department[$fpart]['admins'])) {
     $admins = array_filter(array_map('trim', explode(';', $array_department[$fpart]['admins'])));
     $a_l = array();
     foreach ($admins as $adm) {
         unset($adm2);
         if (preg_match('/^([0-9]+)\\/[0-1]{1}\\/[0-1]{1}\\/1$/', $adm, $adm2)) {
             $a_l[] = $adm2[1];
         }
     }
     if (!empty($a_l)) {
         $a_l = implode(',', $a_l);
         $sql = 'SELECT t2.email as admin_email FROM ' . NV_AUTHORS_GLOBALTABLE . ' t1 INNER JOIN ' . NV_USERS_GLOBALTABLE . ' t2 ON t1.admin_id = t2.userid WHERE t1.lev!=0 AND t1.is_suspend=0 AND t2.active=1 AND t1.admin_id IN (' . $a_l . ')';
         $result = $db_slave->query($sql);
         while ($row = $result->fetch()) {
             if (nv_check_valid_email($row['admin_email']) == '') {
                 $email_list[] = $row['admin_email'];
             }
         }
     }
 }
 if (!empty($email_list)) {
     $from = array($fname, $femail);
     $email_list = array_unique($email_list);
     @nv_sendmail($from, $email_list, $ftitle, $fcon_mail);
 }
 // Gửi bản sao đến hộp thư người gửi
 if ($fsendcopy) {
     $from = array($global_config['site_name'], $global_config['site_email']);
     $fcon_mail = contact_sendcontact($row_id, $fcat, $ftitle, $fname, $femail, $fphone, $fcon, $fpart, false);
     @nv_sendmail($from, $femail, $ftitle, $fcon_mail);
开发者ID:nukeviet,项目名称:nukeviet,代码行数:31,代码来源:main.php


示例8: 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);
//.........这里部分代码省略.........
开发者ID:lzhao18,项目名称:nukeviet,代码行数:101,代码来源:login.php


示例9: die

 * @Copyright (C) 2014 PHAN TAN DUNG. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate Dec 11, 2013, 09:50:11 PM
 */
if (!defined('NV_IS_MOD_BLOG')) {
    die('Stop!!!');
}
// Dang ky nhan ban tin
if ($nv_Request->isset_request('newsletters', 'post')) {
    $array['email'] = nv_substr($nv_Request->get_title('newsletters', 'post', '', 1), 0, 255);
    $array['checksess'] = nv_substr($nv_Request->get_title('checksess', 'post', '', 1), 0, 255);
    if (empty($array['email']) or empty($array['checksess']) or $array['checksess'] != md5($global_config['sitekey'] . $client_info['session_id'])) {
        die('Error Access!!!');
    }
    // Kiem tra email hop le
    $checkEmail = nv_check_valid_email($array['email']);
    if ($checkEmail != '') {
        die($checkEmail);
    }
    // Kiem tra email da dang ky
    $sql = "SELECT * FROM " . $BL->table_prefix . "_newsletters WHERE email=" . $db->quote($array['email']);
    $result = $db->query($sql);
    if ($result->rowCount()) {
        $row = $result->fetch();
        if ($row['status'] == 0) {
            die(sprintf($BL->lang('newsletterIsBan'), $array['email']));
        } elseif ($row['status'] == 1) {
            die(sprintf($BL->lang('newsletterIsActive'), $array['email']));
        } else {
            if (!$db->query("DELETE FROM " . $BL->table_prefix . "_newsletters WHERE email=" . $db->quote($array['email']))) {
                die('Unknow Error!!!');
开发者ID:hoangvtien,项目名称:blog,代码行数:31,代码来源:newsletters.php


示例10: nv_substr

 $_user['answer'] = nv_substr($nv_Request->get_title('answer', 'post', '', 1), 0, 255);
 $_user['first_name'] = nv_substr($nv_Request->get_title('first_name', 'post', '', 1), 0, 255);
 $_user['last_name'] = nv_substr($nv_Request->get_title('last_name', 'post', '', 1), 0, 255);
 $_user['gender'] = nv_substr($nv_Request->get_title('gender', 'post', '', 1), 0, 1);
 $_user['photo'] = nv_substr($nv_Request->get_title('photo', 'post', '', 1), 0, 255);
 $_user['view_mail'] = $nv_Request->get_int('view_mail', 'post', 0);
 $_user['sig'] = $nv_Request->get_textarea('sig', '', NV_ALLOWED_HTML_TAGS);
 $_user['birthday'] = $nv_Request->get_title('birthday', 'post');
 $_user['in_groups'] = $nv_Request->get_typed_array('group', 'post', 'int');
 $_user['delpic'] = $nv_Request->get_int('delpic', 'post', 0);
 $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'];
开发者ID:lzhao18,项目名称:nukeviet,代码行数:31,代码来源:edit.php


示例11: array

     $array['linkdirect'] = array();
 }
 if (!empty($array['linkdirect'])) {
     $array['linkdirect'] = array_unique($array['linkdirect']);
 }
 $stmt = $db->prepare('SELECT COUNT(*) FROM ' . NV_PREFIXLANG . '_' . $module_data . ' WHERE title= :title ');
 $stmt->bindParam(':title', $array['title'], PDO::PARAM_STR);
 $stmt->execute();
 $is_exists = $stmt->fetchColumn();
 if (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 (!empty($array['author_email']) and ($check_valid_email = nv_check_valid_email($array['author_email'])) != '') {
     $is_error = true;
     $error = $check_valid_email;
 } elseif (!empty($array['author_url']) and !nv_is_url($array['author_url'])) {
     $is_error = true;
     $error = $lang_module['file_error_author_url'];
 } elseif (empty($array['fileupload']) and empty($array['linkdirect']) and empty($array['fileupload2'])) {
     $is_error = true;
     $error = $lang_module['file_error_fileupload'];
 } else {
     $alias = change_alias($array['title']);
     $array['introtext'] = nv_nl2br($array['introtext'], '<br />');
     if ($row['user_id']) {
         $array['user_name'] = $row['user_name'];
     }
     if (!empty($array['fileupload2'])) {
开发者ID:ThinhNguyenVB,项目名称:module-download,代码行数:31,代码来源:filequeue.php


示例12: intval

$xtpl->assign('GLANG', $lang_global);
$is_read = intval($row['is_read']);
if (!$is_read) {
    $db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_send SET is_read=1 WHERE id=' . $id);
    $is_read = 1;
}
$admin_name = $admin_info['full_name'];
if (empty($admin_name)) {
    $admin_name = $admin_info['username'];
}
$mess_content = $error = '';
if ($nv_Request->get_int('save', 'post') == '1') {
    $mess_content = $nv_Request->get_editor('mess_content', '', NV_ALLOWED_HTML_TAGS);
    if (strip_tags($mess_content) != '') {
        $from = $db->query('SELECT email FROM ' . NV_PREFIXLANG . '_' . $module_data . '_department WHERE id=' . $row['cid'])->fetchColumn();
        if (nv_check_valid_email($from) != '') {
            $from = $admin_info['email'];
        }
        $from = array($admin_name, $from);
        $subject = 'Re: ' . $row['title'];
        if (nv_sendmail($from, $row['sender_email'], $subject, $mess_content)) {
            $sth = $db->prepare('INSERT INTO ' . NV_PREFIXLANG . '_' . $module_data . '_reply (id, reply_content, reply_time, reply_aid) VALUES (' . $id . ', :reply_content, ' . NV_CURRENTTIME . ', ' . $admin_info['admin_id'] . ')');
            $sth->bindParam(':reply_content', $mess_content, PDO::PARAM_STR, strlen($mess_content));
            $sth->execute();
            $db->query('UPDATE ' . NV_PREFIXLANG . '_' . $module_data . '_send SET is_reply=1 WHERE id=' . $id);
            Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=view&id=' . $id);
            die;
        } else {
            $error = $lang_global['error_sendmail_admin'];
        }
    }
开发者ID:lzhao18,项目名称:nukeviet,代码行数:31,代码来源:reply.php


示例13: array

     $array_config_global['site_keywords'] = array();
     if (!empty($site_keywords)) {
         foreach ($site_keywords as $keywords) {
             if (!empty($keywords) and !is_numeric($keywords)) {
                 $array_config_global['site_keywords'][] = $keywords;
             }
         }
     }
     $array_config_global['site_keywords'] = !empty($array_config_global['site_keywords']) ? implode(", ", $array_config_global['site_keywords']) : "";
 }
 $array_config_global['site_email'] = filter_text_input('site_email', 'post', '', 1, 255);
 if (nv_check_valid_email($array_config_global['site_email']) != '') {
     $array_config_global['site_email'] = $global_config['site_email'];
 }
 $array_config_global['error_send_email'] = filter_text_input('error_send_email', 'post', '', 1, 255);
 if (nv_check_valid_email($array_config_global['error_send_email']) != '') {
     $array_config_global['error_send_email'] = $global_config['error_send_email'];
 }
 $array_config_global['site_phone'] = filter_text_input('site_phone', 'post', '', 1, 255);
 $array_config_global['site_lang'] = filter_text_input('site_lang', 'post', '', 1, 255);
 if (!in_array($array_config_global['site_lang'], $allow_sitelangs)) {
     $array_config_global['site_lang'] = 'vi';
 }
 $array_config_global['site_timezone'] = filter_text_input('site_timezone', 'post', '', 1, 255);
 $array_config_global['date_pattern'] = filter_text_input('date_pattern', 'post', '', 1, 255);
 $array_config_global['time_pattern'] = filter_text_input('time_pattern', 'post', '', 1, 255);
 $array_config_global['my_domains'] = filter_text_input('my_domains', 'post', '', 1, 255);
 $my_domains = array(NV_SERVER_NAME);
 if (!empty($array_config_global['my_domains'])) {
     $array_config_global['my_domains'] = array_map("trim", explode(",", $array_config_global['my_domains']));
     foreach ($array_config_global['my_domains'] as $dm) {
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:31,代码来源:system.php


示例14: elseif

 } elseif ($row_f['field_type'] == 'date') {
     if (preg_match('/^([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{4})$/', $value, $m)) {
         $value = mktime(0, 0, 0, $m[2], $m[1], $m[3]);
         if ($row_f['min_length'] > 0 and ($value < $row_f['min_length'] or $value > $row_f['max_length'])) {
             die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_min_max_value'], $row_f['title'], date('d/m/Y', $row_f['min_length']), date('d/m/Y', $row_f['max_length'])))));
         }
     } else {
         die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_match_type_error'], $row_f['title']))));
     }
 } elseif ($row_f['field_type'] == 'textbox') {
     if ($row_f['match_type'] == 'alphanumeric') {
         if (!preg_match('/^[a-zA-Z0-9\\_]+$/', $value)) {
             die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_match_type_error'], $row_f['title']))));
         }
     } elseif ($row_f['match_type'] == 'email') {
         if (($error = nv_check_valid_email($value)) != '') {
             die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => $error)));
         }
     } elseif ($row_f['match_type'] == 'url') {
         if (!nv_is_url($value)) {
             die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_match_type_error'], $row_f['title']))));
         }
     } elseif ($row_f['match_type'] == 'regex') {
         if (!preg_match('/' . $row_f['match_regex'] . '/', $value)) {
             die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_match_type_error'], $row_f['title']))));
         }
     } elseif ($row_f['match_type'] == 'callback') {
         if (function_exists($row_f['func_callback'])) {
             if (!call_user_func($row_f['func_callback'], $value)) {
                 die(json_encode(array('status' => 'error', 'input' => 'custom_fields[' . $row_f['field'] . ']', 'mess' => sprintf($lang_module['field_match_type_error'], $row_f['title']))));
             }
开发者ID:nukeviet,项目名称:nukeviet,代码行数:31,代码来源:fields.check.php


示例15: elseif

if (defined('NV_IS_USER')) {
    $userid = $user_info['userid'];
    $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 ($setting['comment_' . $type] 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 " . $scatid . " allowed_comm FROM `" . NV_PREFIXLANG . "_" . $module_data . "_" . $type . "` WHERE `" . $wid . "` = " . $id);
        $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'))) {
            $row['catid'] = 0;
            $content = nv_nl2br($content, '<br />');
            $sql = "INSERT INTO `" . NV_PREFIXLANG . "_" . $module_data . "_comment_" . $type . "` (`cid`, `level`, `cmcount`, `id`, `content`, `like`, `user_like`, `user_dislike`, `dislike`, `post_time`, `userid`, `post_name`, `post_email`, `post_ip`, `status`) VALUES (NULL, " . $db->dbescape($level) . ", 0, " . $id . "," . $db->dbescape($content) . ",  0, '', '', 0, UNIX_TIMESTAMP(), " . $userid . ",  " . $db->dbescape($name) . ", " . $db->dbescape($email) . ", " . $db->dbescape(NV_CLIENT_IP) . ", " . $status . ")";
            $result = $db->sql_query($sql);
            if ($result) {
                $query = "UPDATE `" . NV_PREFIXLANG . "_" . $module_data . "_comment_" . $type . "` SET `cmcount`=`cmcount`+1 WHERE `level`=" . $db->dbescape($plevel);
                $db->sql_query($query);
                $page = 0;
开发者ID:hoangvtien,项目名称:nphoto,代码行数:31,代码来源:sendcomment.php


示例16: die

     $post['group_type'] = $nv_Request->get_int('group_type', 'post', 0);
     if (!in_array($post['group_type'], array(0, 1, 2))) {
         $post['group_type'] = 0;
     }
     $post['siteus'] = $nv_Request->get_int('siteus', 'post', 0);
     if ($post['siteus'] != 1) {
         $post['siteus'] = 0;
     }
     $post['is_default'] = $nv_Request->get_int('is_default', 'post', 0);
     if ($post['is_default'] != 1) {
         $post['is_default'] = 0;
     }
 }
 if (empty($post['id']) or $post['id'] > 9 or $post['id'] == 1 or $post['id'] == 2 or $post['id'] == 3 or $post['id'] == 4 or $post['id'] == 7) {
     $post['email'] = $nv_Request->get_title('email', 'post', '', 1);
     if (!empty($post['email']) and ($error_xemail = nv_check_valid_email($post['email'])) != '') {
         die($error_xemail);
     }
 } else {
     $post['email'] = '';
 }
 if (empty($post['id']) or $post['id'] > 9 or $post['id'] == 0 or $post['id'] == 1 or $post['id'] == 2 or $post['id'] == 3) {
     //lấy thông tin cấu hình phân quyền
     $post['config']['access_groups_add'] = $nv_Request->get_int('access_groups_add', 'post', 0);
     $post['config']['access_groups_del'] = $nv_Request->get_int('access_groups_del', 'post', 0);
     $post['config']['access_addus'] = $nv_Request->get_int('access_addus', 'post', 0);
     $post['config']['access_waiting'] = $nv_Request->get_int('access_waiting', 'post', 0);
     $post['config']['access_editus'] = $nv_Request->get_int('access_editus', 'post', 0);
     $post['config']['access_delus'] = $nv_Request->get_int('access_delus', 'post', 0);
     $post['config']['access_passus'] = $nv_Request->get_int('access_passus', 'post', 0);
     $post['config'] = serialize($post['config']);
开发者ID:nukeviet,项目名称:nukeviet,代码行数:31,代码来源:groups.php


示例17: 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);
//.........这里部分代码省略.........
开发者ID:syphuonglam,项目名称:creative-portal,代码行数:101,代码来源:login.php


示例18: LightOpenID

 include_once NV_ROOTDIR . "/includes/class/openid.class.php";
 $openid_class = new LightOpenID();
 if ($nv_Request->isset_request('openid_mode', 'get')) {
     $openid_mode = $nv_Request->get 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP nv_check_valid_login函数代码示例发布时间:2022-05-15
下一篇:
PHP nv_check_path_upload函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap