Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
U
User
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangjun
User
Commits
6032c623
Commit
6032c623
authored
Jul 11, 2022
by
zhangjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
f293329a
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
217 additions
and
56 deletions
+217
-56
deployment.xml
.idea/deployment.xml
+1
-1
webServers.xml
.idea/webServers.xml
+2
-2
findpasswordUcenter.php
center/controllers/findpasswordUcenter.php
+137
-0
register.php
center/controllers/register.php
+0
-1
user.php
center/controllers/user.php
+1
-0
code.js
center/js/code.js
+51
-0
findpassword.php
center/views/findpassword.php
+4
-48
constants.php
esf_core/config/constants.php
+5
-2
user_model.php
esf_core/models/user_model.php
+16
-2
No files found.
.idea/deployment.xml
View file @
6032c623
...
...
@@ -2,7 +2,7 @@
<project
version=
"4"
>
<component
name=
"PublishConfigData"
>
<serverData>
<paths
name=
"
202.102.74.66
"
>
<paths
name=
"
192.168.105.107
"
>
<serverdata>
<mappings>
<mapping
deploy=
"/"
local=
"$PROJECT_DIR$"
web=
"/"
/>
...
...
.idea/webServers.xml
View file @
6032c623
...
...
@@ -2,8 +2,8 @@
<project
version=
"4"
>
<component
name=
"WebServers"
>
<option
name=
"servers"
>
<webServer
id=
"eac85357-7eee-4562-adfc-dfca1681c7d3"
name=
"
202.102.74.66"
url=
"http://202.102.74.66
"
>
<fileTransfer
rootFolder=
"/
144_center"
host=
"202.102.74.66"
port=
"21
"
>
<webServer
id=
"eac85357-7eee-4562-adfc-dfca1681c7d3"
name=
"
192.168.105.107"
url=
"http://192.168.105.107
"
>
<fileTransfer
rootFolder=
"/
www/webroot/user"
accessType=
"SFTP"
host=
"192.168.105.107"
port=
"22"
sshConfigId=
"24754225-6ff1-470c-a3ce-730207f2b80b"
sshConfig=
"root@192.168.105.107:22 password
"
>
<advancedOptions>
<advancedOptions
dataProtectionLevel=
"Private"
passiveMode=
"true"
shareSSLContext=
"true"
/>
</advancedOptions>
...
...
center/controllers/findpasswordUcenter.php
0 → 100644
View file @
6032c623
<?php
if
(
!
defined
(
'BASEPATH'
))
exit
(
'No direct script access allowed'
);
class
FindpasswordUcenter
extends
MY_Controller
{
function
__construct
()
{
parent
::
__construct
();
$this
->
load
->
model
(
"user_model"
);
$this
->
load
->
library
(
"user_class"
);
$this
->
load
->
helper
(
"template_helper"
);
}
/**
* 找回密码
* @author cxf
*/
public
function
index
()
{
$_SESSION
[
'token'
]
=
md5
(
$this
->
user_id
);
$data
[
'title'
]
=
'用户找回密码'
;
if
(
$_POST
)
{
if
(
$_POST
[
'token'
]
!=
$_SESSION
[
'token'
])
{
//echo 2;exit();
//echo $_POST['token']."<br/>";
//echo $_SESSION['token']."<br/>";
}
$telno
=
$this
->
input
->
post
(
'telno'
);
$password
=
$this
->
input
->
post
(
'setNewPassword'
);
$againpassword
=
$this
->
input
->
post
(
'repetPassword'
);
$validcode
=
$this
->
input
->
post
(
'validcode'
);
$kind
=
$this
->
input
->
post
(
'kind'
);
//防止暴力破解,增加校验规则
$keyphone
=
"findpassword_"
.
$telno
;
$checkCount
=
$this
->
memcached_class
->
get
(
$keyphone
);
if
(
empty
(
$checkCount
))
$checkCount
=
0
;
$checkCount
=
(
int
)
$checkCount
;
if
(
$checkCount
>=
5
){
//次数过多,等待
echo
10
;
exit
();
}
$this
->
memcached_class
->
delete
(
$keyphone
);
$this
->
memcached_class
->
add
(
$keyphone
,
$checkCount
+
1
,
60
);
if
(
$password
==
$againpassword
)
{
//验证二手房有无此号码
$result2
=
$this
->
user_model
->
yztelno
(
$telno
);
//全站个人会员中心和二手房都有此用户
if
(
$result2
>
0
)
{
$ucenterReturn
=
$this
->
user_model
->
forgetpwdUcenter
(
$telno
,
$password
,
$validcode
,
$this
->
userid
);
if
(
$ucenterReturn
[
'result'
]
==
1
)
{
//登录个人会员中心
$ucenter_result
=
$this
->
user_model
->
phoneLoginUcenter
(
$telno
,
$password
);
echo
1
;
exit
();
}
else
{
//修改密码失败
echo
3
;
exit
();
}
//全站有此用户,二手房没有
}
elseif
(
$result2
==
0
)
{
$ucenterReturn
=
$this
->
user_model
->
ucenterForgetpwd
(
$telno
,
md5
(
$password
),
$validcode
);
if
(
$ucenterReturn
[
'result'
]
==
1
)
{
//插入二手房数据
$passport_uid
=
$ucenterReturn
[
'data'
][
'passport_uid'
];
$password
=
md5
(
$password2
);
$telno
=
$telno
;
$city
=
$ucenterReturn
[
'data'
][
'city'
];
$email
=
$ucenterReturn
[
'data'
][
'email'
];
$username
=
$ucenterReturn
[
'data'
][
'username'
];
$nickname
=
$ucenterReturn
[
'data'
][
'nickname'
];
$avatar
=
$ucenterReturn
[
'data'
][
'avatar'
];
$ip
=
$ucenterReturn
[
'data'
][
'ip'
];
$insert_return
=
$this
->
user_model
->
addUserFromUcenter
(
$passport_uid
,
md5
(
$password
),
$telno
,
$city
,
$email
,
$username
,
$nickname
,
$avatar
,
$ip
);
if
(
$insert_return
>
0
)
{
//登录个人会员中心
$ucenter_result
=
$this
->
user_model
->
ucenterLogin
(
$telno
,
md5
(
$password2
));
//登录二手房
$this
->
user_class
->
user_login
(
$result2
,
md5
(
$password
),
$telno
);
echo
1
;
exit
();
}
}
else
{
//修改密码失败
echo
3
;
exit
();
}
}
elseif
(
$result2
>
0
){
//modify xue 2015-03-11
//验证手机验证码
$result
=
$this
->
user_model
->
yzusersms
(
$validcode
,
$telno
,
$kind
);
if
(
$result
>
0
)
{
$result_pass
=
$this
->
user_model
->
updatepassowrd
(
$telno
,
$password
);
if
(
$result_pass
>
0
)
{
$this
->
user_class
->
user_login
(
$result2
,
md5
(
$password
),
$telno
);
echo
1
;
exit
;
}
else
{
//更新密码失败
echo
3
;
exit
;
}
}
else
{
//短信验证不通过
echo
2
;
exit
;
}
//(个人会员中心无此号码,二手房有这个号码)记录日志
//$msg = date('Y-m-d H:i:s').":".$telno." \n";
//@file_put_contents('./forgetpasswrod_err',$msg,FILE_APPEND);
echo
4
;
exit
();
}
elseif
(
$result2
==
0
){
echo
4
;
exit
();
}
}
}
$this
->
load
->
view
(
'findpassword'
,
$data
);
}
}
?>
center/controllers/register.php
View file @
6032c623
...
...
@@ -691,7 +691,6 @@ class Register extends MY_Controller {
*/
public
function
forget_getyzm_ucenter
()
{
//验证是否已经通过验证
$validcode
=
random
(
6
);
$tt
=
array
();
...
...
center/controllers/user.php
View file @
6032c623
...
...
@@ -660,6 +660,7 @@ class User extends MY_Controller
setcookie
(
"sessionid"
,
null
,
time
()
-
1000
,
"/"
,
"house365.com"
);
setcookie
(
"newrent_yii2-session"
,
null
,
time
()
-
1000
,
"/"
,
"house365.com"
);
jumpto
(
GB_UCENTER_LOGIN_URL
);
exit
();
if
(
isset
(
$_SERVER
[
'HTTP_REFERER'
]))
{
$url
=
substr
(
$_SERVER
[
'HTTP_REFERER'
],
0
,
35
);
...
...
center/js/code.js
View file @
6032c623
...
...
@@ -52,4 +52,55 @@
}
})
}
$
.
fn
.
getVnumUcenter
=
function
(){
var
self
=
$
(
this
);
var
time
=
0
;
self
.
bind
(
"click"
,
function
(){
var
kind
=
$
(
"#kind"
).
val
();
var
telno
=
$
(
"#telno"
).
val
();
var
yztelno
=
$
(
"#yztelno"
).
val
();
var
security_key_2
=
$
(
"#security_key_2"
).
val
();
var
security_num
=
$
(
"#security_num"
).
val
();
var
security_key
=
$
(
"#security_key"
).
val
();
//alert(security_key_2);
if
(
time
==
0
)
{
var
partten
=
/^1
[
0-9
]{10}
$/
;
//手机号码
if
(
partten
.
test
(
telno
))
{
$
.
post
(
'http://user.house365.com/register/forget_getyzm_ucenter'
,{
act
:
'getyzm'
,
telno
:
telno
,
kind
:
kind
,
yztelno
:
yztelno
,
security_key
:
security_key_2
},
function
(
data
){
if
(
data
==
'1'
){
time
=
60
;
var
oTime
=
null
;
self
.
val
(
'重新获取('
+
time
+
')'
);
self
.
css
({
"color"
:
"#999"
});
oTime
=
setInterval
(
function
(){
if
(
time
>
0
){
time
--
;
self
.
val
(
'重新获取('
+
time
+
')'
);}
else
{
clearInterval
(
oTime
);
self
.
val
(
'获取验证码'
);
self
.
css
({
"color"
:
"#000"
});
$
(
'#sendingnote'
).
hide
();}}
,
1000
);
}
else
if
(
data
==
'2'
){
$
(
'#orderhouse_validcode'
).
html
(
'验证码获取失败,请刷新页面重新获取。'
).
show
();
}
else
if
(
data
==
'4'
){
$
(
'#orderhouse_validcode'
).
html
(
"今日操作已超过4次,请明日再来。"
).
show
();
}
else
if
(
data
==
'6'
){
$
(
"#js_errorBox1"
).
removeClass
(
"Validform_checktip Validform_right"
).
addClass
(
"Validform_checktip Validform_wrong"
)
$
(
"#js_errorBox1"
).
html
(
"您的手机号码未注册过,请直接注册。"
);
}
else
if
(
data
==
'7'
){
$
(
"#js_errorBox1"
).
removeClass
(
"Validform_checktip Validform_right"
).
addClass
(
"Validform_checktip Validform_wrong"
)
$
(
"#js_errorBox1"
).
html
(
"您的操作过于频繁,请稍后再试"
);
}
else
if
(
data
==
'400'
){
$
(
"#js_errorBox1"
).
removeClass
(
"Validform_checktip Validform_right"
).
addClass
(
"Validform_checktip Validform_wrong"
)
$
(
"#js_errorBox1"
).
html
(
"页面参数错误,请刷新后再试"
);
}
}
);
}
else
{
$
(
"#js_errorBox1"
).
empty
();
$
(
"#js_errorBox1"
).
removeClass
(
"Validform_checktip Validform_right"
).
addClass
(
"Validform_checktip Validform_wrong"
)
$
(
"#js_errorBox1"
).
html
(
"请输入正确的手机号码。"
);
}
}
})
}
})(
jQuery
);
center/views/findpassword.php
View file @
6032c623
...
...
@@ -39,7 +39,8 @@ $(function(){
<!--logo结束-->
<div
class=
"w904 innerBg"
>
<form
class=
"form"
action=
"
<?php
echo
USER_CENTER
;
?>
findpassword"
method=
"post"
>
<!-- <form class="form" action="-->
<?php
//echo USER_CENTER;?><!--findpassword" method="post">-->
<
form
class
="
form
" action="
<?
php
echo
USER_CENTER
;
?>
FindpasswordUcenter" method="post">
<table
border=
"0"
cellspacing=
"0"
cellpadding=
"0"
class=
"r-table"
>
<tr>
<th
width=
"120"
>
手机号:
</th>
...
...
@@ -81,53 +82,8 @@ $(function(){
<script>
//发送验证码
$
(
'#getcode'
).
click
(
function
()
{
var
time
=
0
;
var
kind
=
$
(
"#kind"
).
val
();
var
telno
=
$
(
"#telno"
).
val
();
var
yztelno
=
$
(
"#yztelno"
).
val
();
var
security_key_2
=
$
(
"#security_key_2"
).
val
();
var
security_num
=
$
(
"#security_num"
).
val
();
var
security_key
=
$
(
"#security_key"
).
val
();
//alert(security_key_2);
if
(
time
==
0
)
{
var
partten
=
/^1
[
0-9
]{10}
$/
;
//手机号码
if
(
partten
.
test
(
telno
))
{
$
.
post
(
'http://user.house365.com/register/forget_getyzm_ucenter'
,{
act
:
'getyzm'
,
telno
:
telno
,
kind
:
kind
,
yztelno
:
yztelno
,
security_key
:
security_key_2
},
function
(
data
){
if
(
data
==
'1'
){
time
=
60
;
var
oTime
=
null
;
self
.
val
(
'重新获取('
+
time
+
')'
);
self
.
css
({
"color"
:
"#999"
});
oTime
=
setInterval
(
function
(){
if
(
time
>
0
){
time
--
;
self
.
val
(
'重新获取('
+
time
+
')'
);}
else
{
clearInterval
(
oTime
);
self
.
val
(
'获取验证码'
);
self
.
css
({
"color"
:
"#000"
});
$
(
'#sendingnote'
).
hide
();}}
,
1000
);
}
else
if
(
data
==
'2'
){
$
(
'#orderhouse_validcode'
).
html
(
'验证码获取失败,请刷新页面重新获取。'
).
show
();
}
else
if
(
data
==
'4'
){
$
(
'#orderhouse_validcode'
).
html
(
"今日操作已超过4次,请明日再来。"
).
show
();
}
else
if
(
data
==
'6'
){
$
(
"#js_errorBox1"
).
removeClass
(
"Validform_checktip Validform_right"
).
addClass
(
"Validform_checktip Validform_wrong"
)
$
(
"#js_errorBox1"
).
html
(
"您的手机号码未注册过,请直接注册。"
);
}
else
if
(
data
==
'7'
){
$
(
"#js_errorBox1"
).
removeClass
(
"Validform_checktip Validform_right"
).
addClass
(
"Validform_checktip Validform_wrong"
)
$
(
"#js_errorBox1"
).
html
(
"您的操作过于频繁,请稍后再试"
);
}
else
if
(
data
==
'400'
){
$
(
"#js_errorBox1"
).
removeClass
(
"Validform_checktip Validform_right"
).
addClass
(
"Validform_checktip Validform_wrong"
)
$
(
"#js_errorBox1"
).
html
(
"页面参数错误,请刷新后再试"
);
}
}
);
}
else
{
$
(
"#js_errorBox1"
).
empty
();
$
(
"#js_errorBox1"
).
removeClass
(
"Validform_checktip Validform_right"
).
addClass
(
"Validform_checktip Validform_wrong"
)
$
(
"#js_errorBox1"
).
html
(
"请输入正确的手机号码。"
);
}
}
});
// $('#getcode').getVnum();
$
(
'#getcode'
).
getVnumUcenter
();
function
yz
(){
...
...
esf_core/config/constants.php
View file @
6032c623
...
...
@@ -387,6 +387,8 @@ define('USER_CENTER','http://user.house365.com/');
define
(
'GB_SEND_SMS_URL'
,
'http://newrenttest.house365.com/api/tf-app/send-auth-sms'
);
// 提交忘记密码接口地址
define
(
'GB_FORGET_PWD_URL'
,
'http://newrenttest.house365.com/api/tf-app/forget-pwd'
);
// 手机登录
define
(
'GB_PHONE_LOGIN_URL'
,
'http://newrenttest.house365.com/api/tf-app/phone-login'
);
// 修改手机页面地址
define
(
'GB_EDIT_PHONE_URL'
,
'http://newrenttest.house365.com/user-center/edit-phone'
);
// 修改密码页面地址
...
...
@@ -398,8 +400,9 @@ define('GB_GET_USER_INFO_BY_SSO_URL', 'http://ucentertest.house365.com/index/use
// 基于个人用户ID更新用户数据接口地址
define
(
'GB_UPDATE_USER_INFO_BY_USER_ID_URL'
,
'http://newrenttest.house365.com/api/tf-app/update-personal-info'
);
// 基于手机号获取用户数据接口地址
define
(
'GB_GET_USER_INFO_BY_PHONE_URL'
,
'http://newrent.house365.com/api/tf-app/get-user-info-by-phone'
);
define
(
'GB_GET_USER_INFO_BY_PHONE_URL'
,
'http://newrenttest.house365.com/api/tf-app/get-user-info-by-phone'
);
// 用户中心登录接口
define
(
'GB_UCENTER_LOGIN_URL'
,
'https://ucentertest.house365.com/index/login'
);
if
(
$_SERVER
[
'SERVER_ADDR'
]
==
'192.168.105.106'
)
{
...
...
esf_core/models/user_model.php
View file @
6032c623
...
...
@@ -670,7 +670,7 @@ class User_model extends MY_Model
$userInfo
=
isset
(
$userRes
[
'data'
]
)
?
$userRes
[
'data'
]
:
array
();
if
(
isset
(
$userInfo
[
'id'
])
&&
!
empty
(
$userInfo
[
'id'
]))
{
return
$userInfo
[
'id'
];
return
$userInfo
[
'id'
]
;
}
else
{
return
0
;
}
...
...
@@ -714,7 +714,7 @@ class User_model extends MY_Model
* @param int $uid
* @return string
*/
function
forget
Pwd
(
$telno
,
$pwd
,
$code
,
$uid
)
function
forget
pwdUcenter
(
$telno
,
$pwd
,
$code
,
$uid
)
{
$url
=
GB_FORGET_PWD_URL
.
'?phone='
.
$telno
.
'&pwd='
.
$pwd
.
'&uid='
.
$uid
.
'&code='
.
$code
;
$userRes
=
curl_get_contents
(
$url
);
...
...
@@ -723,6 +723,20 @@ class User_model extends MY_Model
return
$userRes
;
}
/**
* 验证是否该用户已注册过手机号
* @param int $uid
* @return string
*/
function
phoneLoginUcenter
(
$telno
,
$pwd
)
{
$url
=
GB_PHONE_LOGIN_URL
.
'?telno='
.
$telno
.
'&password='
.
$pwd
;
$userRes
=
curl_get_contents
(
$url
);
$userRes
=
!
empty
(
$userRes
)
?
json_decode
(
$userRes
,
1
)
:
array
();
$userRes
[
'result'
]
=
isset
(
$userRes
[
'result'
]
)
?
isset
(
$userRes
[
'result'
]
)
:
0
;
return
$userRes
;
}
// /**
// * 验证是否该用户已注册过手机号,论坛用户绑定手机专用
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment