|
|
发表于 2013-7-16 22:09:59
|陕西|
显示全部楼层
$email = trim($_POST['email']);( _1 M% y( y6 u, E* I. Q
$pwd = trim($_POST['pwd']);' i/ @. p1 V, k6 W6 `
$cktime = $_POST['cktime'];
0 `7 R; h! `4 t
7 H2 b7 Q$ j6 I$ G if($email=='' || $pwd=='') qiMsg("所有输入项都不能为空^_^");
2 p$ R( @+ {+ l/ x' t
. N9 v5 m" q$ `+ d) D $countAdmin = $db->once_fetch_assoc("select count(*) from ".dbprefix."user where `email`='$email'");
( s! X# l0 H6 P% |( s 3 J; n3 I* z, v/ Y+ x! M3 ~0 H
if($countAdmin['count(*)'] == 0) qiMsg('用户Email不存在!');
! F0 T% {9 t# |' q
7 r% q, M* K5 q6 V1 N; [0 o $strAdmin = $db->once_fetch_assoc("select * from ".dbprefix."user where `email`='$email'");
; M8 ], [" `: Z/ ^. Z
. z* r6 |7 W( W% ^7 o if(md5($strAdmin['salt'].$pwd)!==$strAdmin['pwd']) tsNotice('用户密码错误!');
. ~/ K3 x- b" |4 t6 `9 y8 m : D7 a; Q( m) y( c
$strAdminInfo = $db->once_fetch_assoc("select userid,username,isadmin from ".dbprefix."user_info where email='$email'");
! P. T- K& \/ g4 @5 n ! l2 o, O& ^( @
if($strAdminInfo['isadmin'] != 1) qiMsg("你无权登录后台管理!");; _' `! q7 q* T* D. O; H4 }$ P
7 N* w! ^) y8 J9 r; n- @& q $_SESSION['tsadmin'] = $strAdminInfo;
) U6 N- L% C& H
. i- w' ~2 R+ P, }: D header("Location: ".SITE_URL."index.php?app=system");4 N. D, o6 H2 C X; E
0 S% J" |/ E% r( N5 C% e6 }4 m
|
|