69 lines
1.5 KiB
Bash
Executable File
69 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
while read kos
|
|
do
|
|
[ "${#kos}" -le "1" ]&&break;
|
|
koss="$kos
|
|
$koss"
|
|
done
|
|
|
|
ck=($(echo "$koss"|awk -F'[|:]' '{IGNORECASE=1}$1=="Cookie"{print $3}'))
|
|
sqlstart="SELECT passd,grups,isok,feilv,ckuser,ckname,ckkey FROM user WHERE userid = '${ck[2]}'"
|
|
dada="$($MYSQLS -e "$sqlstart" 2>>$0.errlog)"
|
|
sdata=($dada)
|
|
cksec=${ck[4]}
|
|
yunse=$(echo -n "$REMOTE_HOST${sdata[2]}${sdata[1]}${ck[2]}${sdata[0]}${dateddd:0:6}"|md5sum|tr -dc [0-9])
|
|
|
|
[ "$yunse" = "$cksec" ]||{
|
|
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
|
|
Access-Control-Expose-Headers: ztm
|
|
ztm: noes
|
|
Content-Language:zh-CN,zh
|
|
Content-Type: text/plain;charset=utf-8
|
|
|
|
noes"
|
|
exit 0
|
|
}
|
|
dada=""
|
|
case "${ck[3]}" in
|
|
0)
|
|
sqlstart="SELECT * FROM geren"
|
|
dada="$($MYSQLS -e "$sqlstart" 2>>$0.errlog)"
|
|
;;
|
|
1)
|
|
sqlstart="SELECT * FROM geren WHERE userid = '${ck[2]}'"
|
|
dada="$($MYSQLS -e "$sqlstart" 2>>$0.errlog)"
|
|
;;
|
|
esac
|
|
|
|
|
|
[ "$dada" ]&&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
|
|
Access-Control-Expose-Headers: ztm
|
|
ztm: okay
|
|
Content-Language:zh-CN,zh
|
|
Content-Type: text/plain;charset=utf-8
|
|
|
|
$dada"||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
|
|
Access-Control-Expose-Headers: ztm
|
|
ztm: okey
|
|
Content-Language:zh-CN,zh
|
|
Content-Type: text/plain;charset=utf-8
|
|
" |