修复更新第三方互联登陆中的问题[文件下载+文件修改]
1、下载文件,覆盖替换(自己有修改的注意对比文件)
链接: http://pan.baidu.com/s/1eQm8eIY 密码: 369f
2、lyecs_style/css/UserCenter.lyecs.css最后面回车加以下代码(有些客户已有的不要重复加):
.body-regist {background: #61c3dd url("../images/user/regist-bj.jpg") no-repeat scroll center center;height: auto;padding-top: 80px;padding-bottom: 80px;}
.oauth_reg #footer{margin-top: 0}
.oauth_reg_box{background-color: #fff;border-bottom: 4px solid #7ec3d5;border-radius: 4px;height: auto;margin: 0 auto;overflow: hidden;width: 600px;padding: 10px 40px 10px;}
.oauth_reg #reg-box{border-right: 0;margin-left: 0;width: 600px;padding-right: 0}
.oauth_reg #reg-box h2{text-indent: 0;background: none;color: #666;font-size: 22px}
3、文件user.php,找到
elseif($action == 'act_oauth_login')
{
……………(省略的代码可能有区别,所以不细列)
}
/* 验证用户注册邮件 */
elseif ($action == 'validate_email')
{
替换为:
elseif($action == 'act_oauth_login')
{
include_once(ROOT_PATH . 'includes/login/functions.php');
$type = empty($_REQUEST['type']) ? '' : $_REQUEST['type'];
$type_arr=array('qq','sina','alipay','taobao','weixin');
if(!in_array($type, $type_arr)){
die('错误!');
}
$info=get_oauth_info($type);
if(!empty($info['error']))
{
show_message('登录出错,错误码'.$info['error'], $_CFG['url'] , '' , false);
}
if(!$info['user_id'] || !$info['user_name']){
show_message('登录出错,数据异常!', $_CFG['url'] , '' , false);
}
$aite_id = $type .'_'.$info['user_id'];
$sql = 'SELECT user_name,password,aite_id FROM '.$ecs->table('users')." WHERE aite_id = '$aite_id'";
$user_info = $db->getRow($sql);
if(!$user_info){ // 没有当前数据
if ((!isset($back_act)||empty($back_act)) && isset($GLOBALS['_SERVER']['HTTP_REFERER']))
{
$back_act = strpos($GLOBALS['_SERVER']['HTTP_REFERER'], 'user.php') ? './index.php' : $GLOBALS['_SERVER']['HTTP_REFERER'];
}
/* 取出注册扩展字段 */
$sql = 'SELECT * FROM ' . $ecs->table('reg_fields') . ' WHERE type < 2 AND display = 1 AND id != 5 AND id != 6 ORDER BY dis_order, id';
$extend_info_list = $db->getAll($sql);
$smarty->assign('extend_info_list', $extend_info_list);
//$reg_config['regist_show_email']=$_LYCFG['regist_show_email'] ;
$reg_config['regist_need_email']=$_LYCFG['regist_need_email'] ;
$reg_config['regist_email_is_username']=$_LYCFG['regist_email_is_username'] ;
$reg_config['regist_email_need_send']=$_LYCFG['regist_email_need_send'] ;
$reg_config['regist_need_mobile']=$_LYCFG['regist_need_mobile'] ;
$reg_config['regist_mobile_is_username']=$_LYCFG['regist_mobile_is_username'] ;
$reg_config['is_show_username']=true;
$reg_config['is_show_captcha']=true;
if($reg_config['regist_email_is_username']){
$reg_config['is_show_username']=false;
}
if($reg_config['regist_need_mobile']){
if($reg_config['regist_mobile_is_username']){
$reg_config['is_show_username']=false;
}
$reg_config['is_show_captcha']=false;
}
$smarty->assign('reg_config', $reg_config);
/* 验证码相关设置 */
if (((intval($_CFG['captcha']) & CAPTCHA_REGISTER) && gd_version() > 0) && !$reg_config['regist_need_mobile'])
{
$smarty->assign('enabled_captcha', 1);
$smarty->assign('rand', mt_rand());
}
/* 密码提示问题 */
$smarty->assign('passwd_questions', $_LANG['passwd_questions']);
/* 增加是否关闭注册 */
$smarty->assign('shop_reg_closed', $_CFG['shop_reg_closed']);
$smarty->assign('reg_info', $info);
$smarty->assign('aite_type', $type);
$smarty->display('user_oauth_reg.dwt');
exit;
}else{
$user->set_session($user_info['user_name']);
$user->set_cookie($user_info['user_name']);
update_user_info();
recalculate_price();
die('
}
}
/* 验证用户注册邮件 */
elseif ($action == 'validate_email')
{
4、同样是user.php文件
找到:
/*
* 注册送红包,可以批量赠送。完善版!
* 老杨:www.lyecs.com;
* QQ:359199843
*/
替换为:
//第三方登陆完善
$nickname = empty($_POST['nickname']) ? '' : compile_str($_POST['nickname']);
$aite_id = empty($_POST['aite_id']) ? '' : compile_str($_POST['aite_id']);
$aite_type = empty($_POST['aite_type']) ? '' : compile_str($_POST['aite_type']);
if (!empty($nickname) && !empty($aite_id))
{
$aite_id=$aite_type.'_'.$aite_id;
$sql = 'UPDATE ' . $ecs->table('users') . " SET `nickname`='$nickname', `aite_id`='$aite_id' WHERE `user_id`='" . $_SESSION['user_id'] . "'";
$db->query($sql);
}
/*
* 注册送红包,可以批量赠送。完善版!
* 老杨:www.lyecs.com;
* QQ:359199843
*/