本文整理汇总了PHP中send_pwd_email函数的典型用法代码示例。如果您正苦于以下问题:PHP send_pwd_email函数的具体用法?PHP send_pwd_email怎么用?PHP send_pwd_email使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_pwd_email函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_send_pwd_email
function action_send_pwd_email()
{
// 获取全局变量
$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/lib_passport.php';
/* 初始化会员用户名和邮件地址 */
$user_name = !empty($_POST['user_name']) ? trim($_POST['user_name']) : '';
$email = !empty($_POST['email']) ? trim($_POST['email']) : '';
// 用户名和邮件地址是否匹配
$user_info = $user->get_user_info($user_name);
if ($user_info && $user_info['email'] == $email) {
// 生成code
// $code = md5($user_info[0] . $user_info[1]);
$code = md5($user_info['user_id'] . $_CFG['hash_code'] . $user_info['reg_time']);
// 发送邮件的函数
if (send_pwd_email($user_info['user_id'], $user_name, $email, $code)) {
show_message($_LANG['send_success'] . $email, $_LANG['back_home_lnk'], './', 'info');
} else {
// 发送邮件出错
show_message($_LANG['fail_send_password'], $_LANG['back_page_up'], './', 'info');
}
} else {
// 用户名与邮件地址不匹配
show_message($_LANG['username_no_email'], $_LANG['back_page_up'], '', 'info');
}
}
示例2: elseif
//显示用户名和email表单
$smarty->display('user_passport.dwt');
}
} elseif ($action == 'send_pwd_email') {
include_once ROOT_PATH . 'includes/lib_passport.php';
/* 初始化会员用户名和邮件地址 */
$user_name = !empty($_POST['user_name']) ? trim($_POST['user_name']) : '';
$email = !empty($_POST['email']) ? trim($_POST['email']) : '';
//用户名和邮件地址是否匹配
$user_info = $user->get_user_info($user_name);
if ($user_info && $user_info['email'] == $email) {
//生成code
//$code = md5($user_info[0] . $user_info[1]);
$code = md5($user_info['user_id'] . $_CFG['hash_code'] . $user_info['reg_time']);
//发送邮件的函数
if (send_pwd_email($user_info['user_id'], $user_name, $email, $code)) {
show_message($_LANG['send_success'] . $email, $_LANG['back_home_lnk'], './', 'info');
} else {
//发送邮件出错
show_message($_LANG['fail_send_password'], $_LANG['back_page_up'], './', 'info');
}
} else {
//用户名与邮件地址不匹配
show_message($_LANG['username_no_email'], $_LANG['back_page_up'], '', 'info');
}
} elseif ($action == 'reset_password') {
//显示重置密码的表单
$smarty->display('user_passport.dwt');
} elseif ($action == 'act_edit_password') {
include_once ROOT_PATH . 'includes/lib_passport.php';
$old_password = isset($_POST['old_password']) ? trim($_POST['old_password']) : '';
示例3: send_pwd_email
/**
* 发送密码修改确认邮件
*/
public function send_pwd_email()
{
$captcha = intval(C('captcha'));
if ($captcha & CAPTCHA_LOGIN && (!($captcha & CAPTCHA_LOGIN_FAIL) || $captcha & CAPTCHA_LOGIN_FAIL && $_SESSION['login_fail'] > 2)) {
if (empty($_POST['captcha'])) {
show_message(L('invalid_captcha'), L('back_page_up'), url('get_password_email'), 'error');
}
// 检查验证码
if ($_SESSION['ectouch_verify'] !== strtoupper($_POST['captcha'])) {
show_message(L('invalid_captcha'), L('back_page_up'), url('get_password_email'), 'error');
}
}
// 初始化会员用户名和邮件地址
$user_name = !empty($_POST['user_name']) ? in($_POST['user_name']) : '';
$email = !empty($_POST['email']) ? in($_POST['email']) : '';
// 用户信息
$user_info = self::$user->get_user_info($user_name);
if ($user_info && $user_info['email'] == $email) {
// 生成code
$code = md5($user_info['user_id'] . C('hash_code') . $user_info['reg_time']);
// 发送邮件的函数
if (send_pwd_email($user_info['user_id'], $user_name, $email, $code)) {
show_message(L('send_success') . $email, L('relogin_lnk'), url('login'), 'info');
} else {
// 发送邮件出错
show_message(L('fail_send_password'), L('back_page_up'), url('get_password_email'), 'info');
}
} else {
// 用户名与邮件地址不匹配
show_message(L('username_no_email'), L('back_page_up'), url('get_password_email'), 'info');
}
}