Userpwd.php
4.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?php
use Action\WebAction;
use WebPlugin\Helpers;
use Home\UserModel;
use Home\AddressModel;
use Home\ReturnsModel;
use LibModels\Web\Home\UserData;
use LibModels\Web\Home\AddressData;
/**
* 个人中心 修改密码
*/
class UserpwdController extends WebAction
{
/**
* 个人中心-设置新密码
*/
public function newpwdAction()
{
//判断是否登录
$this->auditJumpLogin();
//头部导航
$channel = Helpers::getChannelNameByCookie();
$this->setWebNavHeader($channel);
//面包屑-左侧导航
$path = UserModel::getCenterCrumb('账号安全');
$leftNav = UserModel::getCenterLeftNav('账号安全');
//用户信息
$data = array(
'path' => $path,
'homeNav' => $leftNav,
'subTitle' => '修改密码',
'enTitle' => 'CHANGE PASSWORD',
'progressCur' => 'progress2',
'progress' => array(
array(
'iscur' => false,
'progressName' => '1.验证身份'
),
array(
'iscur' => true,
'progressName' => '2.修改登录密码'
),
array(
'iscur' => false,
'progressName' => '3.完成'
)
),
'formInfo' => array(
'formAction' => '/home/userpwd/modpwd',
'formData' => array(
array(
'inputTxt' => '输入新密码',
'key' => 'password',
'type' => 'password',
'name' => 'password'
),
array(
'inputTxt' => '确认新密码',
'key' => 'confirm_password',
'type' => 'password',
'name' => 'confirm_password'
)
)
)
);
$this->_view->display('../../index/home/userpwd', array(
'userpwd' => $data,
'meValidatePage' => true
));
}
/**
* 个人中心 -邮箱验证结果返回
*/
public function modpwdAction()
{
//判断是否登录
$this->auditJumpLogin();
//头部导航
$channel = Helpers::getChannelNameByCookie();
$this->setWebNavHeader($channel);
//面包屑-左侧导航
$path = UserModel::getCenterCrumb('账号安全');
$leftNav = UserModel::getCenterLeftNav('账号安全');
//用户信息
$data = array(
'path' => $path,
'homeNav' => $leftNav,
'subTitle' => '修改密码',
'enTitle' => 'CHANGE EMAIL',
'progressCur' => 'progress3',
'progress' => array(
array(
'iscur' => false,
'progressName' => '1.验证身份'
),
array(
'iscur' => false,
'progressName' => '2.修改登录密码'
),
array(
'iscur' => true,
'progressName' => '3.完成'
)
),
'returnInfo' => true,
'complete' => array(
'resInfo' => '恭喜你,密码修改成功!'
)
);
$this->_view->display('../../index/home/email', array(
'email' => $data,
'meValidatePage' => true
));
}
/**
* 通过当前用户审判是否跳到登录
*
* @param int $useSession (true:从服务端session中检查, false:从客户端cookie中检查)
* @return void
*/
protected function auditJumpLogin($useSession = true)
{
$uid = $this->getUid($useSession);
if (!$uid) {
$this->go(Helpers::url('/signin.html', array('refer' => $this->server('HTTP_REFERER', SITE_MAIN))));
}
else {
return $uid;
}
}
}