File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88$ mg = new Mailgun ($ mailgun_key );
99$ domain = $ mailgun_domain ;
1010//
11- $ code = $ _GET ['code ' ];
12- $ email = $ _GET ['email ' ];
13- $ uid = $ _GET ['uid ' ];
11+ $ code = $ _POST ['code ' ];
12+ $ email = $ _POST ['email ' ];
13+ $ uid = $ _POST ['uid ' ];
14+ $ password = $ _POST ['password ' ];
15+ $ repasswd = $ _POST ['repasswd ' ];
1416//
1517$ ur = new \Ss \User \UserInfo ($ uid );
1618if ($ ur ->GetEmail () == $ email ){
2123if (!$ rs ){
2224 $ a ['code ' ] = '0 ' ;
2325 $ a ['msg ' ] = "邮箱错误 " ;
26+ }elseif ($ repasswd != $ password ){
27+ $ a ['code ' ] = '0 ' ;
28+ $ a ['msg ' ] = "两次密码输入不符 " ;
29+ }elseif (strlen ($ password )<8 ){
30+ $ a ['code ' ] = '0 ' ;
31+ $ a ['msg ' ] = "密码太短 " ;
2432}else {
2533 $ rst = new \Ss \User \ResetPwd ($ uid );
2634 $ u = new \Ss \User \User ($ uid );
2735 if ($ rst ->IsCharOK ($ code ,$ uid )){
28- $ NewPwd = md5 ( time (). $ uid . $ email ) ;
36+ $ NewPwd = $ password ;
2937 $ mg ->sendMessage ($ domain , array ('from ' => "no-reply@ " .$ mailgun_domain ,
3038 'to ' => $ email ,
31- 'subject ' => $ site_name ."您的新密码 " ,
32- 'text ' => "您的新密码为: " . $ NewPwd ));
39+ 'subject ' => $ site_name ." 提示:您的新密码重置成功! " ,
40+ 'text ' => "您在 " . date ( " Y-m-d H:i:s " ). " 重置了密码。 " ));
3341 $ u ->UpdatePWd ($ NewPwd );
3442 $ rst ->Del ($ code ,$ uid );
3543 $ a ['code ' ] = '1 ' ;
3644 $ a ['ok ' ] = '1 ' ;
37- $ a ['msg ' ] = "新密码已经发送到您的邮箱 " ;
45+ $ a ['msg ' ] = "您的新密码重置成功! " ;
3846 }else {
3947 $ a ['code ' ] = '0 ' ;
4048 $ a ['msg ' ] = "链接无效 " ;
4149 }
4250}
4351echo json_encode ($ a );
44-
45-
46-
47-
48-
You can’t perform that action at this time.
0 commit comments