440 lines
16 KiB
HTML
Executable File
440 lines
16 KiB
HTML
Executable File
#!/bin/bash
|
||
while read kos
|
||
do
|
||
[ "${#kos}" -le "1" ]&&break;
|
||
koss="$kos
|
||
$koss"
|
||
done
|
||
|
||
[ "$conntyp" = "POST" ]&&{
|
||
swsw=$(echo "$koss"|awk '{IGNORECASE=1}/Content-Length:/{gsub("\r","",$2);print$2}')
|
||
[ "$swsw" -gt "64" ]&& exit 0
|
||
read -N$swsw hhhkkkk
|
||
myuser="${hhhkkkk%% *}"
|
||
mypassd="${hhhkkkk##* }"
|
||
sqlstart="SELECT userid,grups FROM user WHERE ckuser = '$myuser' AND passd = '$mypassd' AND isok = 0"
|
||
dada="$($MYSQLS -e "$sqlstart" 2>>$0.errlog)"
|
||
[ "$dada" ]&&{
|
||
sdata=($dada)
|
||
sqlstart="UPDATE user SET logintime='$dateddd',lip='$REMOTE_HOST' WHERE userid = '${sdata[0]}'"
|
||
dada="$($MYSQLS -e "$sqlstart" 2>>$0.errlog)"
|
||
echo -e "HTTP/1.1 200 ok
|
||
Connection: close
|
||
Pragma: no-cache
|
||
Cache-Control: no-cache
|
||
Cache-Control: no-store
|
||
Cache-Control: private
|
||
Server: kos-1.0
|
||
Set-Cookie: session=|$REMOTE_HOST $myuser ${sdata[0]} ${sdata[1]} $(echo -n "${REMOTE_HOST}0${sdata[1]}${sdata[0]}$mypassd${dateddd:0:6}"|md5sum|tr -dc [0-9]) $dateddd|
|
||
Content-Type: text/html;charset=utf-8
|
||
|
||
800"
|
||
}||echo "HTTP/1.1 200 ok
|
||
Connection: close
|
||
Pragma: no-cache
|
||
Cache-Control: no-cache
|
||
Cache-Control: no-store
|
||
Cache-Control: private
|
||
Server: kos-1.0
|
||
Content-Language:zh-CN,zh
|
||
Content-Type: text/html;charset=utf-8
|
||
|
||
00"
|
||
}||echo "HTTP/1.1 200 ok
|
||
Connection: close
|
||
Pragma: no-cache
|
||
Cache-Control: no-cache
|
||
Cache-Control: no-store
|
||
Cache-Control: private
|
||
Server: kos-1.0
|
||
Content-Language:zh-CN,zh
|
||
Content-Type: text/html;charset=utf-8
|
||
|
||
<!DOCTYPE html>
|
||
<html>
|
||
<style type=text/css>
|
||
html{width:100%;height:100%;overflow:hidden;font-style:sans-serif}body{width:100%;height:100%;font-family:'Open Sans',sans-serif;margin:0;background-color:#4a374a}#lg{position:absolute;top:50%;left:50%;margin:-150px 0 0 -150px;width:300px;height:300px}#lg h1{color:#fff;text-shadow:0 0 10px;letter-spacing:1px;text-align:center}h1{font-size:2em;margin:.67em 0}.myinput{width:278px;height:18px;margin-bottom:10px;outline:0;padding:10px;font-size:13px;color:#fff;text-shadow:1px 1px 1px;border-top:1px solid #312e3d;border-left:1px solid #312e3d;border-right:1px solid #312e3d;border-bottom:1px solid #56536a;border-radius:4px;background-color:#2d2d3f}.but{width:300px;min-height:20px;display:block;background-color:#4a77d4;border:1px solid #3762bc;color:#fff;padding:9px 14px;font-size:15px;line-height:normal;border-radius:5px;margin:0}
|
||
.butt{
|
||
width: 100px;
|
||
min-height: 20px;
|
||
|
||
background-color: #17170f;
|
||
border: 1px solid #37bc46;
|
||
color: #ece0e0;
|
||
|
||
font-size: 15px;
|
||
line-height: normal;
|
||
border-radius: 5px;
|
||
margin-top: 10px;
|
||
margin-left: 0px;
|
||
}
|
||
.buttt{
|
||
width: 100px;
|
||
min-height: 20px;
|
||
|
||
background-color: #17170f;
|
||
border: 1px solid #bcb637;
|
||
color: #ece0e0;
|
||
|
||
font-size: 15px;
|
||
line-height: normal;
|
||
border-radius: 5px;
|
||
margin-top: 10px;
|
||
margin-left: 100px;
|
||
}
|
||
.black_overlay{
|
||
display: none;
|
||
position: absolute;
|
||
top: 0%;
|
||
left: 0%;
|
||
width: 100%;
|
||
height: 100%;
|
||
background-color: black;
|
||
z-index:1001;
|
||
-moz-opacity: 0.8;
|
||
opacity:.80;
|
||
filter: alpha(opacity=88);
|
||
}
|
||
.white_content {
|
||
margin: auto;
|
||
display: none;
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
width: 300px;
|
||
height: 280px;
|
||
padding: 0px;
|
||
border: 1px solid orange;
|
||
background-color: white;
|
||
z-index:1002;
|
||
overflow: auto;
|
||
}
|
||
</style>
|
||
<head>
|
||
<title>身份验证$titles</title>
|
||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />
|
||
<meta name=\"viewport\" content=\"initial-scale=1.0, maximum-scale=1.0, user-scalable=no\">
|
||
<meta name=\"apple-mobile-web-app-capable\" content=\"yes\">
|
||
<meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black\">
|
||
<meta name=\"format-detection\" content=\"telephone=no\">
|
||
</head>
|
||
|
||
<body>
|
||
<div id=\"lg\">
|
||
<h1>身份验证</h1>
|
||
<input id=\"u\" class=\"myinput\" type=\"tel\" placeholder=\"用户名\" maxlength=\"11\" autocomplete=\"off\" onchange=\"value=value.replace(/[^\d]/g,'')\" onKeyUp=\"value=value.replace(/[^\d]/g,'')\" name=\"u\"></input>
|
||
<input id=\"p\" class=\"myinput\" type=\"password\" placeholder=\"密码\" onchange=\"value=value.replace(/[\W]/g,'')\" onKeyUp=\"value=value.replace(/[\W]/g,'')\" maxlength=\"16\" autocomplete=\"off\" name=\"p\" ></input>
|
||
<button class=\"but\" onclick=\"btok();\">登录</button>
|
||
<!-- <button class=\"butt\" onclick=\"stars('light','fade');\">注册</button><button class=\"buttt\" onclick=\"stars('lights','fades');\">密码找回</button> -->
|
||
</div>
|
||
|
||
<!-- 开户窗口开始 -->
|
||
<div id=\"light\" class=\"white_content\">
|
||
<div id='divclose' style=\"right:0;top:0;position:absolute;cursor: pointer;\" onclick =\"endstars('light','fade')\" >X</div>
|
||
新用户注册
|
||
<hr>
|
||
|
||
<form onSubmit=\"addok();return false\" id=\"dld-msg\">
|
||
<table style=\"word-break: keep-all;white-space:nowrap;\" >
|
||
<tr>
|
||
<td>登录账号</td>
|
||
<td>
|
||
<input placeholder=\"6至11位数字组成!\" type=\"tel\" required=\"required\" minlength=\"6\" maxlength=\"11\" onchange=\"value=value.replace(/[^\d]/g,'')\" onKeyUp=\"value=value.replace(/[^\d]/g,'')\" oninput=\"value.length<6?this.setCustomValidity('长度不能小于6'):this.setCustomValidity('')\" autocomplete=\"off\" id=\"zhanghao\" />
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>姓名</td>
|
||
<td>
|
||
<input placeholder=\"姓名,只支持中文\" type=\"text\" required=\"required\" minlength=\"2\" maxlength=\"5\" autocomplete=\"off\" id=\"xingming\" />
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>密码</td>
|
||
<td>
|
||
<input placeholder=\"密码\" type=\"password\" required=\"required\" minlength=\"6\" maxlength=\"16\" onchange=\"value=value.replace(/[\W]/g,'')\" onKeyUp=\"value=value.replace(/[\W]/g,'')\" oninput=\"value.length<6?this.setCustomValidity('长度不能小于6'):this.setCustomValidity('')\" autocomplete=\"off\" id=\"pasd\" />
|
||
</td>
|
||
<tr>
|
||
<td>确认密码</td>
|
||
<td>
|
||
<input placeholder=\"确认密码\" type=\"password\" required=\"required\" minlength=\"6\" maxlength=\"16\" onchange=\"value=value.replace(/[\W]/g,'')\" onKeyUp=\"value=value.replace(/[\W]/g,'')\" oninput=\"value.length<6?this.setCustomValidity('长度不能小于6'):this.setCustomValidity('')\" autocomplete=\"off\" id=\"pasds\" />
|
||
</td>
|
||
<tr>
|
||
<td>手机号</td>
|
||
<td>
|
||
<input placeholder=\"手机号,11位\" type=\"tel\" required=\"required\" minlength=\"11\" maxlength=\"11\" autocomplete=\"off\" id=\"shoujihao\" />
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>手机验证码</td>
|
||
<td style=\"width:65%;\" >
|
||
<input placeholder=\"验证码\" type=\"tel\" style=\"width:25%;\" required=\"required\" minlength=\"1\" maxlength=\"5\" autocomplete=\"off\" id=\"yanzhenm\" />
|
||
<input type=\"button\" style=\"cursor: pointer;\" onclick=\"mailes('y','shoujihao',this)\" value=\"获取验证码\" /></tb></tr>
|
||
|
||
</table>
|
||
<input id=\"shoujihaobt\" type=\"submit\" style=\"right:15px;bottom:5px;position:absolute;cursor: pointer;\" disabled value=\"提交\" />
|
||
</form>
|
||
|
||
|
||
</div>
|
||
<div id=\"fade\" class=\"black_overlay\">
|
||
</div>
|
||
<!-- 开户窗口结束 -->
|
||
<!-- 密码找回窗口开始 -->
|
||
<div id=\"lights\" class=\"white_content\">
|
||
<div id='divclose' style=\"right:0;top:0;position:absolute;cursor: pointer;\" onclick =\"endstars('lights','fades')\" >X</div>
|
||
密码找回
|
||
<hr>
|
||
|
||
<form onSubmit=\"zhaohuimm();return false\" id=\"dld-msgs\">
|
||
<table style=\"word-break: keep-all;white-space:nowrap;\" >
|
||
<tr>
|
||
<td>登录账号</td>
|
||
<td>
|
||
<input placeholder=\"登录账号,6-11位数字组成\" type=\"tel\" required=\"required\" minlength=\"6\" maxlength=\"11\" onchange=\"value=value.replace(/[^\d]/g,'')\" onKeyUp=\"value=value.replace(/[^\d]/g,'')\" oninput=\"value.length<6?this.setCustomValidity('长度不能小于6'):this.setCustomValidity('')\" autocomplete=\"off\" id=\"zhaohuimail\" />
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<td>手机验证码</td>
|
||
<td style=\"width:65%;\" >
|
||
<input placeholder=\"验证码\" type=\"tel\" style=\"width:25%;\" required=\"required\" minlength=\"1\" maxlength=\"5\" autocomplete=\"off\" id=\"yanzhenms\" />
|
||
<input type=\"button\" style=\"cursor: pointer;\" onclick=\"mailes('n','zhaohuimail',this)\" value=\"获取验证码\" /></tb></tr>
|
||
<tr>
|
||
<td>密码</td>
|
||
<td>
|
||
<input placeholder=\"密码\" type=\"password\" required=\"required\" minlength=\"6\" maxlength=\"16\" onchange=\"value=value.replace(/[\W]/g,'')\" onKeyUp=\"value=value.replace(/[\W]/g,'')\" oninput=\"value.length<6?this.setCustomValidity('长度不能小于6'):this.setCustomValidity('')\" autocomplete=\"off\" id=\"newspasd\" />
|
||
</td>
|
||
<tr>
|
||
<td>确认密码</td>
|
||
<td>
|
||
<input placeholder=\"确认密码\" type=\"password\" required=\"required\" minlength=\"6\" maxlength=\"16\" onchange=\"value=value.replace(/[\W]/g,'')\" onKeyUp=\"value=value.replace(/[\W]/g,'')\" oninput=\"value.length<6?this.setCustomValidity('长度不能小于6'):this.setCustomValidity('')\" autocomplete=\"off\" id=\"newspasds\" />
|
||
</td>
|
||
|
||
</table>
|
||
|
||
<input id=\"zhaohuimailbt\" type=\"submit\" style=\"right:15px;bottom:5px;position:absolute;cursor: pointer;\" disabled value=\"提交\" />
|
||
</form>
|
||
|
||
|
||
</div>
|
||
<div id=\"fades\" class=\"black_overlay\">
|
||
</div>
|
||
<!-- 密码找回窗口结束 -->
|
||
|
||
$div_foot
|
||
</body>
|
||
<script type=\"text/javascript\" src=\"/base64.js\"></script>
|
||
<script type=\"text/javascript\">
|
||
var b = new Base64();
|
||
function btok() {
|
||
var xmlhttp = new XMLHttpRequest();
|
||
var u=document.getElementById(\"u\");
|
||
var p=document.getElementById(\"p\");
|
||
if (u.value == \"\" || p.value == \"\"){
|
||
alert(\"账号或密码不能为空!\");
|
||
return;
|
||
}
|
||
xmlhttp.onreadystatechange = function () {
|
||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||
if(xmlhttp.responseText == 800){
|
||
window.location.href= \"/head.html\";
|
||
}else{
|
||
alert(\"验证失败:\n帐号或密码错误!\");
|
||
document.getElementById(\"p\").value=\"\";
|
||
}
|
||
}else{
|
||
if (xmlhttp.readyState == 4 && xmlhttp.status != 200)
|
||
alert(\"网络错误!\"+xmlhttp.readyState+\"|\"+xmlhttp.status);
|
||
}
|
||
};
|
||
xmlhttp.open(\"POST\", document.location.href,false);
|
||
xmlhttp.send(b.encode(u.value)+\" \"+b.encode(p.value));
|
||
}
|
||
function addok(){
|
||
var xmlhttpp=new XMLHttpRequest();
|
||
var zhanghao=document.getElementById(\"zhanghao\");
|
||
var pasd=document.getElementById(\"pasd\");
|
||
var pasds=document.getElementById(\"pasds\");
|
||
//var zhuceemail=document.getElementById(\"zhuceemail\");
|
||
var yanzhenm=document.getElementById(\"yanzhenm\");
|
||
var xingming=document.getElementById(\"xingming\");
|
||
var shoujihao=document.getElementById(\"shoujihao\");
|
||
if (shoujihao.value.length!=11){
|
||
alert('手机号格式不对!');
|
||
return;
|
||
}
|
||
if (zhanghao.value.length < 6 || zhanghao.value.length > 11 ){
|
||
alert(\"账号长度6—11位\");
|
||
return;
|
||
}
|
||
if (pasd.value.length < 6 || pasd.value.length > 16 ){
|
||
alert(\"密码长度6—16位\");
|
||
return;
|
||
}
|
||
if (pasd.value == zhanghao.value){
|
||
alert(\"密码不能与账号相同!\");
|
||
return;
|
||
}
|
||
if (yanzhenm.value.length < 1 || yanzhenm.value.length > 5 ){
|
||
alert(\"验证码格式不对。\");
|
||
return;
|
||
}
|
||
|
||
if (xingming.value.replace(/[^\u4E00-\u9FA5]/g,'') != xingming.value){
|
||
alert(\"姓名必须是汉字!\");
|
||
return;
|
||
if (xingming.value.replace(/[^\u4E00-\u9FA5]/g,'').length < 2 || xingming.value.replace(/[^\u4E00-\u9FA5]/g,'').length > 5 ){
|
||
alert(\"姓名长度为2-5个汉字\");
|
||
return;
|
||
}
|
||
}
|
||
|
||
if (pasds.value != pasd.value){
|
||
alert(\"两次密码输入不一致!\");
|
||
return;
|
||
}
|
||
|
||
xmlhttpp.onreadystatechange = function () {
|
||
if (xmlhttpp.readyState == 4 && xmlhttpp.status == 200) {
|
||
if(xmlhttpp.responseText == 800){
|
||
alert(\"注册成功!\");
|
||
endstars('light','fade');
|
||
zhanghao.value='';
|
||
pasd.value='';
|
||
pasds.value='';
|
||
yanzhenm.value='';
|
||
xingming.value='';
|
||
shoujihao.value='';
|
||
}else{
|
||
alert(\"验证失败:\n\"+xmlhttpp.responseText);
|
||
}
|
||
}else{
|
||
if (xmlhttpp.readyState == 4 && xmlhttpp.status != 200)
|
||
alert(\"网络错误!\"+xmlhttpp.readyState+\"|\"+xmlhttpp.status);
|
||
}
|
||
};
|
||
xmlhttpp.open(\"POST\",\"adduser.xjs\",false);
|
||
xmlhttpp.send(b.encode(zhanghao.value)+\" \"+b.encode(pasd.value)+\" \"+yanzhenm.value+\" \"+b.encode(xingming.value)+\" \"+shoujihao.value);
|
||
|
||
}
|
||
function zhaohuimm(){
|
||
var xmlhttpps=new XMLHttpRequest();
|
||
|
||
var newspasd=document.getElementById(\"newspasd\");
|
||
var newspasds=document.getElementById(\"newspasds\");
|
||
var zhaohuimail=document.getElementById(\"zhaohuimail\");
|
||
var yanzhenms=document.getElementById(\"yanzhenms\");
|
||
|
||
if (newspasd.value.length < 6 || newspasd.value.length > 16 ){
|
||
alert(\"密码长度6—16位\");
|
||
return;
|
||
}
|
||
if (yanzhenms.value.length < 1 || yanzhenms.value.length > 5 ){
|
||
alert(\"验证码格式不对。\");
|
||
return;
|
||
}
|
||
|
||
if (newspasd.value != newspasds.value){
|
||
alert(\"两次密码输入不一致!\");
|
||
return;
|
||
}
|
||
|
||
xmlhttpps.onreadystatechange = function () {
|
||
if (xmlhttpps.readyState == 4 && xmlhttpps.status == 200) {
|
||
if(xmlhttpps.responseText == 800){
|
||
alert(\"找回密码成功!\");
|
||
endstars('lights','fades');
|
||
newspasd.value='';
|
||
newspasds.value='';
|
||
zhaohuimail.value='';
|
||
yanzhenms.value='';
|
||
|
||
}else{
|
||
alert(\"验证失败:\n\"+xmlhttpps.responseText);
|
||
}
|
||
}else{
|
||
if (xmlhttpps.readyState == 4 && xmlhttpps.status != 200)
|
||
alert(\"网络错误!\"+xmlhttpps.readyState+\"|\"+xmlhttpps.status);
|
||
}
|
||
};
|
||
xmlhttpps.open(\"POST\",\"zhaohuiuser.xjs\",false);
|
||
xmlhttpps.send(b.encode(zhaohuimail.value)+\" \"+yanzhenms.value+\" \"+b.encode(newspasd.value));
|
||
|
||
}
|
||
function stars(mstar,mstars) {
|
||
//window.location.href= \"snssdk1128://user/profile/67557880163\"
|
||
document.getElementById(mstar).style.display='block';
|
||
document.getElementById(mstars).style.display='block';
|
||
}
|
||
function endstars(estar,estars) {
|
||
document.getElementById(estar).style.display='none';
|
||
document.getElementById(estars).style.display='none';
|
||
}
|
||
|
||
function mailes(olki,ook,val) {
|
||
var eemail=document.getElementById(ook).value;
|
||
var obbt=document.getElementById(ook+'bt');
|
||
if ( olki == 'y' ){
|
||
if (eemail.length!=11){
|
||
alert('手机号格式不对!');
|
||
return;
|
||
}
|
||
}
|
||
|
||
if ( olki == 'n' ){
|
||
|
||
if (eemail.length < 6 || eemail.length > 11 ){
|
||
alert(\"账号长度6—11位\");
|
||
return;
|
||
}
|
||
|
||
eemail=b.encode(eemail);
|
||
}
|
||
//倒计时获取验证码开始
|
||
function starInterval(){
|
||
var countdown=59;
|
||
val.setAttribute(\"disabled\", true);
|
||
val.value=\"重新获取(60)\";
|
||
setint=window.setInterval(function(){
|
||
if (countdown == 0) {
|
||
val.removeAttribute(\"disabled\");
|
||
val.value=\"获取验证码\";
|
||
window.clearInterval(setint);
|
||
} else {
|
||
val.setAttribute(\"disabled\", true);
|
||
val.value=\"重新获取(\" + countdown + \")\";
|
||
countdown--;
|
||
} }, 1000);
|
||
}
|
||
//倒计时获取验证码结束
|
||
var xmlhttps = new XMLHttpRequest();
|
||
xmlhttps.onreadystatechange = function () {
|
||
if (xmlhttps.readyState == 4 && xmlhttps.status == 200) {
|
||
if(xmlhttps.responseText == 800){
|
||
starInterval();
|
||
obbt.removeAttribute(\"disabled\");
|
||
}else{
|
||
alert(\"获取验证码失败!\n\"+xmlhttps.responseText);
|
||
document.getElementById(\"p\").value=\"\";
|
||
}
|
||
}else{
|
||
if (xmlhttps.readyState == 4 && xmlhttps.status != 200)
|
||
alert(\"网络错误!\"+xmlhttps.readyState+\"|\"+xmlhttps.status);
|
||
}
|
||
};
|
||
xmlhttps.open(\"POST\", 'sendsms.xjs',false);
|
||
xmlhttps.send(ook+\" \"+eemail);
|
||
|
||
}
|
||
|
||
document.onkeydown=keyListener;
|
||
function keyListener(e){
|
||
if(e.keyCode == 13){
|
||
btok();
|
||
}
|
||
}
|
||
</script>
|
||
</html>
|
||
"
|
||
exit 0 |