-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathpasswd.html
116 lines (106 loc) · 4.31 KB
/
passwd.html
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
|LF_STANDARD|
|?TREE=<a class=tree href="/HTM_PASSWD">`LANG_CHANGE_YOUR_PASS`</a>|
|?HELP_SECTION=`USER_HELPER`/gettingstarted.html#password|
|HTM_USER_TOP|
<script type="text/javascript">
$(document).ready(function(){
$(".randpass").click(function(){
$("input[name='passwd'],input[name='passwd2'],.visiblepass").val(randPass());
$('#passwdRating').css('color','orange');
$('#passwdRating').html('|LANG_MEDIUM|');
});
$("#passwd").keyup(function () {
if ($(this).val() != "") {
var strongRegex = new RegExp("^(?=.{12,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g");
var mediumRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g");
var enoughRegex = new RegExp("(?=.{6,}).*", "g");
if (false == enoughRegex.test($(this).val())) {
//密码小于六位的时候,密码强度图片都为灰色
$('#passwdRating').css('color','#666');
$('#passwdRating').html('|LANG_MORE|');
} else if (strongRegex.test($(this).val())) {
//强,密码为八位及以上并且字母数字特殊字符三项都包括
$('#passwdRating').css('color','green');
$('#passwdRating').html('|LANG_STRONG|');
} else if (mediumRegex.test($(this).val())) {
//中等,密码为七位及以上并且字母、数字、特殊字符三项中有两项,强度是中等
$('#passwdRating').css('color','orange');
$('#passwdRating').html('|LANG_MEDIUM|');
} else {
//弱,如果密码为6为及以下,就算字母、数字、特殊字符三项都包括,强度也是弱的
$('#passwdRating').css('color','red');
$('#passwdRating').html('|LANG_WEAK|');
}
}
});
});
function randPass(){
charsl="abcdefghijklmnopqrstuvwxyz";
charsu="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
nums="1234567890";
simb="!.-_@#$+/";
pass="";
i=Math.floor(Math.random()*26); pass += charsl.charAt(i);
i=Math.floor(Math.random()*26); pass += charsu.charAt(i);
i=Math.floor(Math.random()*26); pass += charsu.charAt(i);
i=Math.floor(Math.random()*10); pass += nums.charAt(i);
i=Math.floor(Math.random()*10); pass += nums.charAt(i);
i=Math.floor(Math.random()*9); pass += simb.charAt(i);
i=Math.floor(Math.random()*26); pass += charsl.charAt(i);
i=Math.floor(Math.random()*10); pass += nums.charAt(i);
return pass;
}
</script>
<div class="ui two column centered grid passwd">
<div class="eleven wide column passwdbox">
<h3 class="ui dividing header">|LANG_CHANGE_YOUR_PASS|</h3>
<form action="CMD_PASSWD" method="post" class="ui form">
<input type="hidden" name="options" value="yes">
<div class="inline field">
<label for="oldpass">|LANG_ENTER_OLD_PASS|</label>
<input type="password" name="oldpass" id="oldpass" placeholder="|LANG_ENTER_OLD_PASS|">
</div>
<div class="inline field">
<label for="passwd">|LANG_ENTER_OLD_PASS|</label>
<input type="password" name="passwd" id="passwd" placeholder="|LANG_ENTER_OLD_PASS|">
<input class="randpass" type="button" value="|LANG_RANDOM|">
<input type="text" class="visiblepass" value="" readonly />
</div>
<div class="inline field password">
<label for="passwd2">|LANG_ENTER_NEW_PASS|</label>
<input type="password" name="passwd2" id="passwd2" placeholder="|LANG_ENTER_NEW_PASS|">
<p id="passwdRating"></p>
</div>
<div class="inline passwdline">
<p>
<label for="system">
<input id="system" type="checkbox" name="system" value="yes" checked>
|LANG_CHANGE_CONTROL_PANEL|
</label>
</p>
<p>
<label for="ftp">
<input id="ftp" type="checkbox" name="ftp" value="yes" checked>
|LANG_CHANGE_MAIN_FTP|
</label>
</p>
<p>
<label for="database">
<input id="database" type="checkbox" name="database" value="yes">
|LANG_CHANGE_MAIN_DB|
</label>
</p>
</div>
<hr style="margin: 30px 0;" />
<p style="text-align: right;"><button type="submit" class="btn btn-green" data-loading-text="Loading...">|LANG_SUBMIT|</button></p>
<div class="clear"></div><!-- /clear -->
</form>
</div>
<div class="center aligned sixteen wide column">
|*if HAVE_SECURITY_QUESTIONS="yes"|
<a href="CMD_SECURITY_QUESTIONS">Manage Security Questions</a>
|*endif|
</div>
</div>
</center>
|HTM_USER_BOTTOM|