|
|
发表于 2013-7-16 22:09:59
|陕西|
显示全部楼层
$email = trim($_POST['email']);
+ X2 h5 {7 ~+ D- f) { $pwd = trim($_POST['pwd']);
1 i, o& w. |9 [& S9 O1 N# m $cktime = $_POST['cktime'];6 S+ I, w6 l) V) Z0 _! p
1 N) B2 N% S- B1 ^8 l1 d if($email=='' || $pwd=='') qiMsg("所有输入项都不能为空^_^");
, K1 c, ^% d4 z: h
6 J3 l/ i$ X X$ ]' [ $countAdmin = $db->once_fetch_assoc("select count(*) from ".dbprefix."user where `email`='$email'");
1 v1 k- `- t% \" L: \# q& s) t8 P ) K2 B6 H" M% _- s3 ?
if($countAdmin['count(*)'] == 0) qiMsg('用户Email不存在!');9 j" `5 p) L n! Z2 B
' y! \. ?' o- E) G0 h3 _$ R
$strAdmin = $db->once_fetch_assoc("select * from ".dbprefix."user where `email`='$email'");9 ^" p0 B# g/ @" P. M7 V
" U& N$ o' W8 R% h if(md5($strAdmin['salt'].$pwd)!==$strAdmin['pwd']) tsNotice('用户密码错误!'); ! u- {* g( D! }2 R3 ?0 Y) T
: e( P8 n- m8 J$ x' U $strAdminInfo = $db->once_fetch_assoc("select userid,username,isadmin from ".dbprefix."user_info where email='$email'");( i- `6 R7 S. J' B! x3 m' o, W
0 ]! Z. g! g2 ^2 V8 j! G) u if($strAdminInfo['isadmin'] != 1) qiMsg("你无权登录后台管理!");$ { S: m3 u) ^ {/ ]) ~
{; J) r* H' {2 q3 ? $_SESSION['tsadmin'] = $strAdminInfo;
, P! e" J- C) A- l) I
0 z' O# G' u1 L header("Location: ".SITE_URL."index.php?app=system");
; A2 e) T4 V+ @! V
. k2 ~; Z$ J9 N- y2 l& O u/ x: K { |
|