|
@@ -4,6 +4,7 @@ use LibModels\Web\Passport\RegData; |
|
@@ -4,6 +4,7 @@ use LibModels\Web\Passport\RegData; |
4
|
use Passport\PassportModel;
|
4
|
use Passport\PassportModel;
|
5
|
use Plugin\Helpers;
|
5
|
use Plugin\Helpers;
|
6
|
use LibModels\Wap\Passport\BackData;
|
6
|
use LibModels\Wap\Passport\BackData;
|
|
|
7
|
+use Plugin\AuthCode;
|
7
|
|
8
|
|
8
|
class BackController extends WebAction
|
9
|
class BackController extends WebAction
|
9
|
{
|
10
|
{
|
|
@@ -42,19 +43,36 @@ class BackController extends WebAction |
|
@@ -42,19 +43,36 @@ class BackController extends WebAction |
42
|
$captcha = $this->post('captcha','');
|
43
|
$captcha = $this->post('captcha','');
|
43
|
if(Helpers::verifyEmail($phoneNum)){ //验证邮箱
|
44
|
if(Helpers::verifyEmail($phoneNum)){ //验证邮箱
|
44
|
$email = $phoneNum;
|
45
|
$email = $phoneNum;
|
45
|
- BackData::sendCodeToEmail($email);
|
46
|
+ $data = BackData::sendCodeToEmail($email);
|
|
|
47
|
+ $this->setSession('phoneNum', $phoneNum);
|
|
|
48
|
+ if($data['code'] == 200) {
|
46
|
$this->redirect('sendemail');
|
49
|
$this->redirect('sendemail');
|
|
|
50
|
+ }
|
|
|
51
|
+ else {
|
|
|
52
|
+ $this->redirect('index');
|
|
|
53
|
+ }
|
47
|
} else if(Helpers::verifyMobile($phoneNum)) {//验证手机号
|
54
|
} else if(Helpers::verifyMobile($phoneNum)) {//验证手机号
|
48
|
$mobile = $phoneNum;
|
55
|
$mobile = $phoneNum;
|
49
|
- BackData::sendCodeToMobile($mobile);
|
56
|
+ $data = BackData::sendCodeToMobile($mobile);
|
|
|
57
|
+ $this->setSession('phoneNum', $phoneNum);
|
|
|
58
|
+ if($data['code'] == 200) {
|
50
|
$this->redirect('verification');
|
59
|
$this->redirect('verification');
|
51
|
}
|
60
|
}
|
|
|
61
|
+ else {
|
|
|
62
|
+ $this->redirect('index');
|
|
|
63
|
+ }
|
|
|
64
|
+ }
|
52
|
}
|
65
|
}
|
53
|
|
66
|
|
54
|
/**
|
67
|
/**
|
55
|
* 发送邮件
|
68
|
* 发送邮件
|
56
|
*/
|
69
|
*/
|
57
|
public function sendemailAction() {
|
70
|
public function sendemailAction() {
|
|
|
71
|
+ $phoneNum = $this->getSession('phoneNum');
|
|
|
72
|
+ if(empty($phoneNum)) {
|
|
|
73
|
+ $this->redirect('index');
|
|
|
74
|
+ }
|
|
|
75
|
+ $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
|
58
|
$simpleHeader = array(
|
76
|
$simpleHeader = array(
|
59
|
'logo' => array(
|
77
|
'logo' => array(
|
60
|
'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
|
78
|
'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
|
|
@@ -73,10 +91,10 @@ class BackController extends WebAction |
|
@@ -73,10 +91,10 @@ class BackController extends WebAction |
73
|
)
|
91
|
)
|
74
|
);
|
92
|
);
|
75
|
$data = array(
|
93
|
$data = array(
|
76
|
- 'simpleHeader' => $simpleHeader,
|
94
|
+ 'simpleHeader' => PassportModel::getSimpleHeader(false),
|
77
|
'sendEmail' => array(
|
95
|
'sendEmail' => array(
|
78
|
- 'coverHref' => '/passport',
|
|
|
79
|
- 'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
|
96
|
+ 'coverHref' => $banner['url'],
|
|
|
97
|
+ 'coverImg' => $banner['img'],
|
80
|
'countrys' => array()
|
98
|
'countrys' => array()
|
81
|
)
|
99
|
)
|
82
|
);
|
100
|
);
|
|
@@ -86,85 +104,63 @@ class BackController extends WebAction |
|
@@ -86,85 +104,63 @@ class BackController extends WebAction |
86
|
/**
|
104
|
/**
|
87
|
* 重置密码
|
105
|
* 重置密码
|
88
|
*/
|
106
|
*/
|
89
|
- public function resetPwdAction() {
|
|
|
90
|
- $simpleHeader = array(
|
|
|
91
|
- 'logo' => array(
|
|
|
92
|
- 'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
|
|
|
93
|
- 'url' => 'http://www.yohobuy.com'
|
|
|
94
|
- ),
|
|
|
95
|
- 'tool' => array(
|
|
|
96
|
- 'user' => '2586703@qq.com',
|
|
|
97
|
- 'userCenter' => '',
|
|
|
98
|
- 'loginHref' => '',
|
|
|
99
|
- 'logoutHref' => '',
|
|
|
100
|
- 'registerHref' => '',
|
|
|
101
|
- 'favoriteHref' => '',
|
|
|
102
|
- 'couponHref' => '',
|
|
|
103
|
- 'orderHref' => '',
|
|
|
104
|
- 'helpHref' => ''
|
|
|
105
|
- )
|
|
|
106
|
- );
|
107
|
+ public function backcodeAction() {
|
|
|
108
|
+ $code = $this->get('code');
|
|
|
109
|
+ $info = $this->checkCode($code);
|
|
|
110
|
+ if(empty($info)) {
|
|
|
111
|
+ $this->redirect('index');
|
|
|
112
|
+ }
|
|
|
113
|
+ $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
|
107
|
$data = array(
|
114
|
$data = array(
|
108
|
- 'simpleHeader' => $simpleHeader,
|
115
|
+ 'simpleHeader' => PassportModel::getSimpleHeader(false),
|
109
|
'resetPage' => true,
|
116
|
'resetPage' => true,
|
110
|
'resetPwd' => array(
|
117
|
'resetPwd' => array(
|
111
|
- 'coverHref' => '/passport',
|
|
|
112
|
- 'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
|
118
|
+ 'coverHref' => $banner['url'],
|
|
|
119
|
+ 'coverImg' => $banner['img'],
|
113
|
'countrys' => array()
|
120
|
'countrys' => array()
|
114
|
)
|
121
|
)
|
115
|
);
|
122
|
);
|
116
|
$this->_view->display('reset-pwd', $data);
|
123
|
$this->_view->display('reset-pwd', $data);
|
117
|
}
|
124
|
}
|
118
|
|
125
|
|
|
|
126
|
+ /**
|
|
|
127
|
+ * 更新密码
|
|
|
128
|
+ *
|
|
|
129
|
+ */
|
|
|
130
|
+ public function updateAction()
|
|
|
131
|
+ {
|
|
|
132
|
+ $code = $this->post('code');
|
|
|
133
|
+ $password = $this->post('pwd');
|
|
|
134
|
+ $info = $this->checkCode($code);
|
|
|
135
|
+ if(Helpers::verifyPassword($password) && !empty($info)) {
|
|
|
136
|
+ $uid = $info['uid'];
|
|
|
137
|
+ //修改密码
|
|
|
138
|
+ }
|
|
|
139
|
+
|
|
|
140
|
+ }
|
|
|
141
|
+
|
|
|
142
|
+ /**
|
|
|
143
|
+ * 重置密码成功
|
|
|
144
|
+ */
|
119
|
public function resetSuccessAction() {
|
145
|
public function resetSuccessAction() {
|
120
|
- $simpleHeader = array(
|
|
|
121
|
- 'logo' => array(
|
|
|
122
|
- 'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
|
|
|
123
|
- 'url' => 'http://www.yohobuy.com'
|
|
|
124
|
- ),
|
|
|
125
|
- 'tool' => array(
|
|
|
126
|
- 'user' => '2586703@qq.com',
|
|
|
127
|
- 'userCenter' => '',
|
|
|
128
|
- 'loginHref' => '',
|
|
|
129
|
- 'logoutHref' => '',
|
|
|
130
|
- 'registerHref' => '',
|
|
|
131
|
- 'favoriteHref' => '',
|
|
|
132
|
- 'couponHref' => '',
|
|
|
133
|
- 'orderHref' => '',
|
|
|
134
|
- 'helpHref' => ''
|
|
|
135
|
- )
|
|
|
136
|
- );
|
146
|
+ $banner = PassportModel::getLeftBanner(PassportModel::BACK_LFFT_BANNER_CODE);
|
137
|
$data = array(
|
147
|
$data = array(
|
138
|
- 'simpleHeader' => $simpleHeader,
|
148
|
+ 'simpleHeader' => PassportModel::getSimpleHeader(false),
|
139
|
'resetSuccess' => array(
|
149
|
'resetSuccess' => array(
|
140
|
- 'coverHref' => '/passport',
|
|
|
141
|
- 'coverImg' => 'http://img12.static.yhbimg.com/yhb-img01/2015/12/01/07/020a0b6e7ff908d0c2bc4045b4fef42b9f.png?imageView/2/w/252/h/190',
|
150
|
+ 'coverHref' => $banner['url'],
|
|
|
151
|
+ 'coverImg' => $banner['img'],
|
142
|
'countrys' => array()
|
152
|
'countrys' => array()
|
143
|
)
|
153
|
)
|
144
|
);
|
154
|
);
|
145
|
$this->_view->display('reset-success', $data);
|
155
|
$this->_view->display('reset-success', $data);
|
146
|
}
|
156
|
}
|
147
|
|
157
|
|
|
|
158
|
+ /**
|
|
|
159
|
+ * 手机验证
|
|
|
160
|
+ */
|
148
|
public function verificationAction() {
|
161
|
public function verificationAction() {
|
149
|
- $simpleHeader = array(
|
|
|
150
|
- 'logo' => array(
|
|
|
151
|
- 'img' => 'http://static.yohobuy.com/newheader/img/logo_e.png',
|
|
|
152
|
- 'url' => 'http://www.yohobuy.com'
|
|
|
153
|
- ),
|
|
|
154
|
- 'tool' => array(
|
|
|
155
|
- 'user' => '2586703@qq.com',
|
|
|
156
|
- 'userCenter' => '',
|
|
|
157
|
- 'loginHref' => '',
|
|
|
158
|
- 'logoutHref' => '',
|
|
|
159
|
- 'registerHref' => '',
|
|
|
160
|
- 'favoriteHref' => '',
|
|
|
161
|
- 'couponHref' => '',
|
|
|
162
|
- 'orderHref' => '',
|
|
|
163
|
- 'helpHref' => ''
|
|
|
164
|
- )
|
|
|
165
|
- );
|
|
|
166
|
$data = array(
|
162
|
$data = array(
|
167
|
- 'simpleHeader' => $simpleHeader,
|
163
|
+ 'simpleHeader' => PassportModel::getSimpleHeader(false),
|
168
|
'vertificationPage' => true,
|
164
|
'vertificationPage' => true,
|
169
|
'verification' => array(
|
165
|
'verification' => array(
|
170
|
'coverHref' => '/passport',
|
166
|
'coverHref' => '/passport',
|
|
@@ -174,4 +170,21 @@ class BackController extends WebAction |
|
@@ -174,4 +170,21 @@ class BackController extends WebAction |
174
|
);
|
170
|
);
|
175
|
$this->_view->display('verification', $data);
|
171
|
$this->_view->display('verification', $data);
|
176
|
}
|
172
|
}
|
|
|
173
|
+
|
|
|
174
|
+ /**
|
|
|
175
|
+ * 检查code
|
|
|
176
|
+ *
|
|
|
177
|
+ * @param string $code
|
|
|
178
|
+ * @return boolean
|
|
|
179
|
+ */
|
|
|
180
|
+ private function checkCode($code)
|
|
|
181
|
+ {
|
|
|
182
|
+ $key = '_+@#$%^';
|
|
|
183
|
+ $code = base64_decode($code);
|
|
|
184
|
+ $info = json_decode(AuthCode::decode($code, $key), true);
|
|
|
185
|
+ if ($info['create_time'] < 1 || (time() - $info['create_time']) > 86400) {
|
|
|
186
|
+ return array();
|
|
|
187
|
+ }
|
|
|
188
|
+ return $info;
|
|
|
189
|
+ }
|
177
|
} |
190
|
} |