Commit a7c58670 authored by zhangjun's avatar zhangjun

修改

parent 42916212
......@@ -388,11 +388,13 @@ define('GB_SEND_SMS_URL','http://user.house365.com/');
// 提交忘记密码接口地址
define('GB_FORGET_SMS_URL','http://user.house365.com/');
// 修改手机页面地址
define('GB_EDIT_PHONE_URL','http://newrent.house365.com/user-center/edit-phone');
define('GB_EDIT_PHONE_URL','http://newrenttest.house365.com/user-center/edit-phone');
// 修改密码页面地址
define('GB_EDIT_PWD_URL','http://newrent.house365.com/user-center/edit-pwd');
define('GB_EDIT_PWD_URL','http://newrenttest.house365.com/user-center/edit-pwd');
// 基于个人用户ID获取用户数据
define('GB_GET_USER_INFO_BY_USER_ID_URL', 'http://newrenttest.house365.com/api/tf-app/get-user-info-by-personal-id');
// 基于sso_token获取用户数据
define('GB_GET_USER_INFO_BY_SSO_URL', 'http://ucentertest.house365.com/index/user/info');
if($_SERVER['SERVER_ADDR'] == '192.168.105.106')
......
This diff is collapsed.
......@@ -9,7 +9,7 @@
$ci->load->model('user_model');
getLoginInfoBySSO();
getLoginInfoBySSOUcenter();
if(!empty($_COOKIE['esfuserid']) && !empty($_COOKIE['esfpassword']))
{
......@@ -67,6 +67,35 @@
return $info;
}
function getLoginInfoBySSOUcenter(){
if(empty($_COOKIE['sso_token'])){
return false;
}
$ci = & get_instance();
if(empty($_COOKIE['esfuserid']) || empty($_COOKIE['esfpassword'])){
$url = GB_GET_USER_INFO_BY_SSO_URL;
$cookieStr = "sso_token=" . $_COOKIE['sso_token'];
$info = curl_get_contents_new($url, '', $cookieStr);
if(is_array($info) && !empty($info)){
if (isset($info['data']['id']) && $info['data']['id']) {
$passport_uid = $info['data']['id'];
$ci->load->model('user_model');
$user = $ci->user_model->get_data(array('form_name' => 'personal_user','where'=>array('passport_uid'=>$passport_uid),'select'=>array('id','telno','password')),'dbuser');
if($user){
$esfuserid = $user[0]['id'];
$esfpassword = $user[0]['password'];
setcookie('esfuserid',$esfuserid,time() + 3600 * 24 * 7,'/','.house365.com');
setcookie('esfpassword',$esfpassword,time() + 3600 * 24 * 7,'/','.house365.com');
}
}
}else{
return false;
}
}
return $info;
}
function getmesnumbyuidwd()
{
......
......@@ -26,7 +26,7 @@ class User_class
if($telno=='')
{
$temp = $CI->user_model->getuserdetail($result);
$temp = $CI->user_model->getuserdetailUcenter($result);
$telno = $temp['telno'];
}
$password_encrypt = passport_encrypt($password);
......@@ -71,7 +71,7 @@ class User_class
$CI->load->model('user_model');
//查询上次登录时间
$last_logintime = $CI->user_model->getuserdetail($result);
$last_logintime = $CI->user_model->getuserdetailUcenter($result);
if(date("Y-m-d",$last_logintime['lastlogintime']) != date("Y-m-d"))
{
......
......@@ -557,7 +557,7 @@ class User_model extends MY_Model
if( $check_login > 0 )
{
$_SESSION['esfuserid']=$check_login;
$user = $this->getuserdetail($check_login);
$user = $this->getuserdetailUcenter($check_login);
//赋值SESSION
$array = array( 'esfuserid'=>$user['id'] , 'esfpassword'=>$user['password'] ,'esfusername'=>$user['username'] , 'esfusertelno'=>$user['telno'] ,'esfusercity'=>GB_CITY,'esfshowname'=>$_COOKIE['esfshowname']);
......@@ -795,6 +795,24 @@ class User_model extends MY_Model
}
}
/**
* 验证是否该用户已注册过手机号
* @param type $uid
* @return string
*/
function getuserdetailUcenter($uid)
{
$url = GB_GET_USER_INFO_BY_USER_ID_URL . '?uid=' . $uid;
$userRes = curl_get_contents( $url );
$userInfo = !empty( $userRes ) ? json_decode( $userRes, 1 ) : array();
if(isset($userInfo['data']) && !empty($userInfo['data']))
{
return $userInfo['data'];
}else{
return array();
}
}
/**
* 获取所有的房源特色标签
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment