|
|
发表于 2013-7-16 22:09:59
|
显示全部楼层
$email = trim($_POST['email']);
0 m% @' k& r( M0 Z5 Y $pwd = trim($_POST['pwd']);
5 U W& Z- ?+ J5 N $cktime = $_POST['cktime'];
( `+ `, @* K1 m- O+ W) H3 r4 j
9 `+ H" K$ c* v) j4 W# i* } if($email=='' || $pwd=='') qiMsg("所有输入项都不能为空^_^");. t, s- {" Z3 }7 f
" `& \2 |7 R. f9 B7 ]5 r$ \! k
$countAdmin = $db->once_fetch_assoc("select count(*) from ".dbprefix."user where `email`='$email'");, O; W8 |- X8 A* V: j& z
. B3 P0 ^( k: C if($countAdmin['count(*)'] == 0) qiMsg('用户Email不存在!');% u) h9 d6 ?7 |1 i8 I
# z2 U8 s8 D4 W# I
$strAdmin = $db->once_fetch_assoc("select * from ".dbprefix."user where `email`='$email'");' }' v3 S6 h8 t8 h( B4 i
H$ i: } v3 Y0 i# g if(md5($strAdmin['salt'].$pwd)!==$strAdmin['pwd']) tsNotice('用户密码错误!');
@2 Z- Z% {% P5 Y8 L
' m: L: f8 i# V4 y* D U- Y $strAdminInfo = $db->once_fetch_assoc("select userid,username,isadmin from ".dbprefix."user_info where email='$email'");) K( i# N+ D0 o8 V$ y+ \; O
2 h" J: d1 V9 I1 W; o if($strAdminInfo['isadmin'] != 1) qiMsg("你无权登录后台管理!");: v$ e% _# @' @5 N6 w$ B: {
7 ^4 H2 Y' F8 L7 u8 \7 e$ s
$_SESSION['tsadmin'] = $strAdminInfo;5 I# K3 E( _7 h4 W. U. T- e
: ~- ^$ d" J6 r g1 X5 Y
header("Location: ".SITE_URL."index.php?app=system");( I# W7 o p* j3 e
/ S9 i' x7 i- f1 w8 H7 n8 x" z |
|