本文整理汇总了PHP中send_regiter_hash函数的典型用法代码示例。如果您正苦于以下问题:PHP send_regiter_hash函数的具体用法?PHP send_regiter_hash怎么用?PHP send_regiter_hash使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_regiter_hash函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show_message
$info = $_LANG['email_not_alive'];
}
show_message($info, $_LANG['back_home_lnk'], 'index.php');
}
} elseif ($action == 'send_hash_mail') {
include_once ROOT_PATH . 'includes/cls_json.php';
include_once ROOT_PATH . 'includes/lib_passport.php';
$json = new JSON();
$result = array('error' => 0, 'message' => '', 'content' => '');
if ($user_id == 0) {
/* 用户没有登录 */
$result['error'] = 1;
$result['message'] = $_LANG['login_please'];
die($json->encode($result));
}
if (send_regiter_hash($user_id)) {
/* 用户没有登录 */
$result['message'] = $_LANG['validate_mail_ok'];
die($json->encode($result));
} else {
$result['error'] = 1;
$result['message'] = $GLOBALS['err']->last_message();
}
die($json->encode($result));
} else {
if ($action == 'track_packages') {
include_once ROOT_PATH . 'includes/lib_transaction.php';
include_once ROOT_PATH . 'includes/lib_order.php';
$page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
$orders = array();
$sql = "SELECT order_id,order_sn,invoice_no,shipping_id FROM " . $ecs->table('order_info') . " WHERE user_id = '{$user_id}' AND shipping_status = '" . SS_SHIPPED . "'";
示例2: action_send_hash_mail
function action_send_hash_mail()
{
$user = $GLOBALS['user'];
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$user_id = $_SESSION['user_id'];
include_once ROOT_PATH . 'includes/cls_json.php';
include_once ROOT_PATH . 'includes/lib_passport.php';
$json = new JSON();
$result = array('error' => 0, 'message' => '', 'content' => '');
if ($user_id == 0) {
/* 用户没有登录 */
$result['error'] = 1;
$result['message'] = $_LANG['login_please'];
die($json->encode($result));
}
if (send_regiter_hash($user_id)) {
$result['message'] = $_LANG['validate_mail_ok'];
die($json->encode($result));
} else {
$result['error'] = 1;
$result['message'] = $GLOBALS['err']->last_message();
}
die($json->encode($result));
}
示例3: action_register
/**
* 注册会员的处理
*/
function action_register()
{
// 获取全局变量
$_CFG = $GLOBALS['_CFG'];
$_LANG = $GLOBALS['_LANG'];
$smarty = $GLOBALS['smarty'];
$db = $GLOBALS['db'];
$ecs = $GLOBALS['ecs'];
$err = $GLOBALS['err'];
include_once 'includes/cls_json.php';
$json = new JSON();
$res = array('err_msg' => '', 'result' => '');
/* 增加是否关闭注册 */
if ($_CFG['shop_reg_closed']) {
$smarty->assign('action', 'register');
$smarty->assign('shop_reg_closed', $_CFG['shop_reg_closed']);
$smarty->display('user_passport.dwt');
} else {
include_once ROOT_PATH . 'includes/lib_passport.php';
$username = isset($_POST['username']) ? trim($_POST['username']) : '';
$password = isset($_POST['password']) ? trim($_POST['password']) : '';
$email = isset($_POST['email']) ? trim($_POST['email']) : '';
$other['msn'] = isset($_POST['extend_field1']) ? $_POST['extend_field1'] : '';
$other['qq'] = isset($_POST['extend_field2']) ? $_POST['extend_field2'] : '';
$other['office_phone'] = isset($_POST['extend_field3']) ? $_POST['extend_field3'] : '';
$other['home_phone'] = isset($_POST['extend_field4']) ? $_POST['extend_field4'] : '';
$other['mobile_phone'] = isset($_POST['extend_field5']) ? $_POST['extend_field5'] : '';
$sel_question = empty($_POST['sel_question']) ? '' : compile_str($_POST['sel_question']);
$passwd_answer = isset($_POST['passwd_answer']) ? compile_str(trim($_POST['passwd_answer'])) : '';
// 注册类型:email、mobile
$register_type = isset($_POST['register_type']) ? trim($_POST['register_type']) : '';
$back_act = isset($_POST['back_act']) ? trim($_POST['back_act']) : '';
if (empty($_POST['agreement'])) {
$res['err_msg'] = $_LANG['passport_js']['agreement'];
$res['err_no'] = 1;
die($json->encode($res));
}
if (strlen($username) < 3) {
$res['err_msg'] = $_LANG['passport_js']['username_shorter'];
$res['err_no'] = 1;
die($json->encode($res));
}
if (strlen($password) < 6) {
$res['err_msg'] = $_LANG['passport_js']['password_shorter'];
$res['err_no'] = 1;
die($json->encode($res));
}
if (strpos($password, ' ') > 0) {
$res['err_msg'] = $_LANG['passwd_balnk'];
$res['err_no'] = 1;
die($json->encode($res));
}
/* 验证码检查 */
if (intval($_CFG['captcha']) & CAPTCHA_REGISTER && gd_version() > 0) {
if (empty($_POST['captcha'])) {
$res['err_msg'] = $_LANG['invalid_captcha'];
$res['err_no'] = 1;
die($json->encode($res));
}
/* 检查验证码 */
include_once 'includes/cls_captcha.php';
$validator = new captcha();
if (!$validator->check_word($_POST['captcha'])) {
$res['err_msg'] = $_LANG['invalid_captcha'];
$res['err_no'] = 1;
die($json->encode($res));
}
}
if (register($username, $password, $email, $other) !== false) {
/*把新注册用户的扩展信息插入数据库*/
$sql = 'SELECT id FROM ' . $ecs->table('reg_fields') . ' WHERE type = 0 AND display = 1 ORDER BY dis_order, id';
//读出所有自定义扩展字段的id
$fields_arr = $db->getAll($sql);
$extend_field_str = '';
//生成扩展字段的内容字符串
foreach ($fields_arr as $val) {
$extend_field_index = 'extend_field' . $val['id'];
if (!empty($_POST[$extend_field_index])) {
$temp_field_content = strlen($_POST[$extend_field_index]) > 100 ? mb_substr($_POST[$extend_field_index], 0, 99) : $_POST[$extend_field_index];
$extend_field_str .= " ('" . $_SESSION['user_id'] . "', '" . $val['id'] . "', '" . compile_str($temp_field_content) . "'),";
}
}
$extend_field_str = substr($extend_field_str, 0, -1);
if ($extend_field_str) {
$sql = 'INSERT INTO ' . $ecs->table('reg_extend_info') . ' (`user_id`, `reg_field_id`, `content`) VALUES' . $extend_field_str;
$db->query($sql);
}
/* 写入密码提示问题和答案 */
if (!empty($passwd_answer) && !empty($sel_question)) {
$sql = 'UPDATE ' . $ecs->table('users') . " SET `passwd_question`='{$sel_question}', `passwd_answer`='{$passwd_answer}' WHERE `user_id`='" . $_SESSION['user_id'] . "'";
$db->query($sql);
}
/* 判断是否需要自动发送注册邮件 */
if ($GLOBALS['_CFG']['member_email_validate'] && $GLOBALS['_CFG']['send_verify_email']) {
send_regiter_hash($_SESSION['user_id']);
}
$ucdata = empty($user->ucdata) ? "" : $user->ucdata;
//.........这里部分代码省略.........
示例4: action_register
//.........这里部分代码省略.........
}
} else {
/* 无效的注册类型 */
show_message($_LANG['register_type_invalid'], $_LANG['sign_up'], 'register.php', 'error');
}
}
/* 随进生成用户名 */
// $username = generate_username();
if ($result) {
/* 把新注册用户的扩展信息插入数据库 */
$sql = 'SELECT id FROM ' . $ecs->table('reg_fields') . ' WHERE type = 0 AND display = 1 ORDER BY dis_order, id';
// 读出所有自定义扩展字段的id
$fields_arr = $db->getAll($sql);
$extend_field_str = '';
// 生成扩展字段的内容字符串
foreach ($fields_arr as $val) {
$extend_field_index = 'extend_field' . $val['id'];
if (!empty($_POST[$extend_field_index])) {
$temp_field_content = strlen($_POST[$extend_field_index]) > 100 ? mb_substr($_POST[$extend_field_index], 0, 99) : $_POST[$extend_field_index];
$extend_field_str .= " ('" . $_SESSION['user_id'] . "', '" . $val['id'] . "', '" . compile_str($temp_field_content) . "'),";
}
}
$extend_field_str = substr($extend_field_str, 0, -1);
if ($extend_field_str) {
$sql = 'INSERT INTO ' . $ecs->table('reg_extend_info') . ' (`user_id`, `reg_field_id`, `content`) VALUES' . $extend_field_str;
$db->query($sql);
}
/* 代码增加2014-12-23 by www.68ecshop.com _star */
// if($_SESSION['tag'] > 0)
// {
// $sql = "update " . $GLOBALS['ecs']->table('users') . " set
// is_validated = 1 where user_id = '" . $_SESSION['user_id'] . "'";
// $GLOBALS['db']->query($sql);
// }
// if($other['mobile_phone'] != '')
// {
// if($_CFG['sms_register'] == 1)
// {
// $sql = "update " . $GLOBALS['ecs']->table('users') . " set
// validated = 1 where user_id = '" . $_SESSION['user_id'] . "'";
// $GLOBALS['db']->query($sql);
// }
// }
/* 代码增加2014-12-23 by www.68ecshop.com _end */
/*
* 代码增加_start By www.68ecshop.com
* include_once(ROOT_PATH . '/includes/cls_image.php');
* $image = new cls_image($_CFG['bgcolor']);
* $headimg_original =
* $GLOBALS['image']->upload_image($_FILES['headimg'], 'headimg/'.
* date('Ym'));
*
* $thumb_path=DATA_DIR. '/headimg/' . date('Ym').'/' ;
* $headimg_thumb = $GLOBALS['image']->make_thumb($headimg_original,
* '80', '50', $thumb_path);
* $headimg_thumb = $headimg_thumb ? $headimg_thumb :
* $headimg_original;
* if ($headimg_thumb)
* {
* $sql = 'UPDATE ' . $ecs->table('users') . " SET
* `headimg`='$headimg_thumb' WHERE `user_id`='" .
* $_SESSION['user_id'] . "'";
* $db->query($sql);
* }
* 代码增加_end By www.68ecshop.com
*/
/* 写入密码提示问题和答案 */
if (!empty($passwd_answer) && !empty($sel_question)) {
$sql = 'UPDATE ' . $ecs->table('users') . " SET `passwd_question`='{$sel_question}', `passwd_answer`='{$passwd_answer}' WHERE `user_id`='" . $_SESSION['user_id'] . "'";
$db->query($sql);
}
/* 代码增加_start By www.68ecshop.com */
$now = gmtime();
if ($_CFG['bonus_reg_rand']) {
$sql_bonus_ext = " order by rand() limit 0,1";
}
$sql_b = "SELECT type_id FROM " . $ecs->table("bonus_type") . " WHERE send_type='" . SEND_BY_REGISTER . "' AND send_start_date<=" . $now . " AND send_end_date>=" . $now . $sql_bonus_ext;
$res_bonus = $db->query($sql_b);
$kkk_bonus = 0;
while ($row_bonus = $db->fetchRow($res_bonus)) {
$sql = "INSERT INTO " . $ecs->table('user_bonus') . "(bonus_type_id, bonus_sn, user_id, used_time, order_id, emailed)" . " VALUES('" . $row_bonus['type_id'] . "', 0, '" . $_SESSION['user_id'] . "', 0, 0, 0)";
$db->query($sql);
$kkk_bonus = $kkk_bonus + 1;
}
if ($kkk_bonus) {
$_LANG['register_success'] = '用户名 %s 注册成功,并获得官方赠送的红包礼品';
}
/* 代码增加_end By www.68ecshop.com */
/* 判断是否需要自动发送注册邮件 */
if ($GLOBALS['_CFG']['member_email_validate'] && $GLOBALS['_CFG']['send_verify_email']) {
send_regiter_hash($_SESSION['user_id']);
}
$ucdata = empty($user->ucdata) ? "" : $user->ucdata;
show_message(sprintf($_LANG['register_success'], $username . $ucdata), array($_LANG['back_up_page'], $_LANG['profile_lnk']), array($back_act, 'user.php'), 'info');
} else {
$GLOBALS['err']->show($_LANG['sign_up'], 'register.php');
}
}
/* 代码增加2014-12-23 by www.68ecshop.com _star */
}
示例5: die
if ($user_id == 0) {
/* 用户没有登录 */
$result['error'] = 1;
$result['message'] = $_LANG['login_please'];
die($json->encode($result));
}
$validate = $_REQUEST['is_validate'];
$type = "register";
if ($validate == 0) {
$type = "disbind";
} else {
if ($validate == 'emailUser_register_email') {
$type = 'emailUser_register_email';
}
}
if (send_regiter_hash($user_id, $type)) {
$result['message'] = $_LANG['validate_mail_ok'];
die($json->encode($result));
} else {
$result['error'] = 1;
$result['message'] = $GLOBALS['err']->last_message();
}
die($json->encode($result));
} else {
if ($action == 'track_packages') {
include_once ROOT_PATH . 'includes/lib_transaction.php';
include_once ROOT_PATH . 'includes/lib_order.php';
$page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
$orders = array();
$sql = "SELECT order_id,order_sn,invoice_no,shipping_id FROM " . $ecs->table('order_info') . " WHERE user_id = '{$user_id}' AND shipping_status = '" . SS_SHIPPED . "'";
$res = $db->query($sql);
示例6: captcha
/* 检查验证码 */
include_once 'includes/cls_captcha.php';
$validator = new captcha();
if (!$validator->check_word($_POST['captcha'])) {
show_api_message($_LANG['invalid_captcha'], $_LANG['sign_up'], $api_url . '/intefrace.php?act=qq_bind_user', 'error');
}
}
if (register($username, $password, $email, array()) !== false) {
$sql = 'UPDATE ' . $ecs->table('users') . " SET `qq_openid`='{$qq_user_info['qq_openid']}', `nick_name`='{$qq_user_info['nick_name']}', `sex`='{$qq_user_info['sex']}', user_rank='{$qq_user_info['user_rank']}' WHERE `user_id`='" . $_SESSION['user_id'] . "'";
/* 通过插件来删除用户 */
$users =& init_users();
$users->remove_user($qq_user_info['user_name']);
//已经删除用户所有数据
/* 判断是否需要自动发送注册邮件 */
if ($GLOBALS['_CFG']['member_email_validate'] && $GLOBALS['_CFG']['send_verify_email']) {
send_regiter_hash($_SESSION['user_id']);
}
$ucdata = empty($user->ucdata) ? "" : $user->ucdata;
show_api_message(sprintf($_LANG['register_success'], $username . $ucdata), array('回到网站首页', $_LANG['profile_lnk']), array($site_url, $site_url . '/user.php'), 'info');
} else {
show_api_message('注册失败', '重新注册绑定', $api_url . '/intefrace.php?act=qq_bind_user', 'error');
}
}
if (empty($qq_user_info) || empty($qq_user_info['qq_openid'])) {
show_api_message('用户信息错误或非qq登录会员', '回到网站首页', $site_url, 'error');
}
$smarty->assign('template_dir', $_CFG['template']);
$smarty->assign('lang', $_LANG);
die($smarty->fetch($api_tpl));
} else {
if (empty($api_config['qq_appid']) || empty($api_config['qq_appkey'])) {