Skip to content

Commit 25c7884

Browse files
committed
Merge pull request #237 from orvice/dev
Dev
2 parents eacee9f + 8527405 commit 25c7884

3 files changed

Lines changed: 34 additions & 28 deletions

File tree

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
ss-panel
22
========
33

4-
A simple front end of [Shadowsocks manyuser](https://github.com/mengskysama/shadowsocks/tree/manyuser
5-
)
6-
7-
[Demo](https://cattt.com) [中文安装文档](https://github.com/orvice/ss-panel/wiki/Install-Guide-zh_cn)
8-
9-
### Upgrade from 0.X
10-
11-
[Read this](https://github.com/orvice/ss-panel/blob/master/upgrade_to_v2.md)
12-
134
### Requirements
145
* PHP >= 5.4
156
* PDO Extension

user/_resetpwdtwo.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
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);
1618
if($ur->GetEmail() == $email){
@@ -21,28 +23,29 @@
2123
if(!$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
}
4351
echo json_encode($a);
44-
45-
46-
47-
48-

user/resetpwd_do.php

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,19 @@
3131
</div><!-- /.login-logo -->
3232
<div class="login-box-body">
3333
<p class="login-box-msg">重置密码</p>
34-
35-
<input type="hidden" id="code" name="code" class="form-control" value="<?php echo $code;?>" >
36-
<input type="hidden" id="uid" name="uid" class="form-control" value="<?php echo $uid;?>" >
3734

3835
<div class="form-group has-feedback">
3936
<input id="email" name="Email" type="text" class="form-control" placeholder="Email"/>
4037
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
4138
</div>
39+
<div class="form-group has-feedback">
40+
<input type="password" id="password" class="form-control" placeholder="密码"/>
41+
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
42+
</div>
43+
<div class="form-group has-feedback">
44+
<input type="password" id="repasswd" class="form-control" placeholder="重复密码"/>
45+
<span class="glyphicon glyphicon-log-in form-control-feedback"></span>
46+
</div>
4247

4348
<div class="form-group has-feedback">
4449
<button type="submit" id="reset" class="btn btn-primary btn-block btn-flat">确认重置</button>
@@ -81,9 +86,16 @@
8186
$(document).ready(function(){
8287
function reset(){
8388
$.ajax({
84-
type:"GET",
85-
url:"_resetpwdtwo.php?code="+$("#code").val()+"&uid="+$("#uid").val()+"&email="+$("#email").val(),
86-
dataType:"json",
89+
type:"POST",
90+
url:"_resetpwdtwo.php",
91+
dataType:"json",
92+
data:{
93+
uid: "<?php echo $uid ?>",
94+
code: "<?php echo $code ?>",
95+
email: $("#email").val(),
96+
password: $("#password").val(),
97+
repasswd: $("#repasswd").val(),
98+
},
8799
success:function(data){
88100
if(data.ok){
89101
$("#msg-error").hide(100);
@@ -122,4 +134,4 @@ function reset(){
122134

123135

124136
</body>
125-
</html>
137+
</html>

0 commit comments

Comments
 (0)