|
|
发表于 2013-7-16 22:09:59
|
显示全部楼层
$email = trim($_POST['email']);
: I' j# U& ?" X: g' ^. x $pwd = trim($_POST['pwd']);0 `, H. v r/ v: a
$cktime = $_POST['cktime'];
2 Z! G, p3 x# V, E3 B$ F1 S ! r+ N- @/ t' g+ }
if($email=='' || $pwd=='') qiMsg("所有输入项都不能为空^_^");
6 u3 x+ y$ t% N; \4 H. W2 J
+ L5 b' p( n5 A7 G $countAdmin = $db->once_fetch_assoc("select count(*) from ".dbprefix."user where `email`='$email'");/ q5 o$ j* N, r* S* G. @
5 W3 X' B; d9 y% F- z1 s+ g3 B; q
if($countAdmin['count(*)'] == 0) qiMsg('用户Email不存在!');6 }7 L+ L% S$ D( a9 J
& _0 M4 I: w6 V* m8 `' j8 K $strAdmin = $db->once_fetch_assoc("select * from ".dbprefix."user where `email`='$email'");8 f0 l6 y `* N$ }" P5 e
: i: y6 o; x. W9 u6 x2 U
if(md5($strAdmin['salt'].$pwd)!==$strAdmin['pwd']) tsNotice('用户密码错误!');
" z# q5 a! ^9 K1 n) X, f1 x' P8 I | ! ]" u; u) @! O! o& P
$strAdminInfo = $db->once_fetch_assoc("select userid,username,isadmin from ".dbprefix."user_info where email='$email'"); ^) D% ]3 q2 J1 `* U$ j1 d* n
5 U; W/ W) A- q% {& w if($strAdminInfo['isadmin'] != 1) qiMsg("你无权登录后台管理!");9 v( m9 m3 O; C) U% _, n
2 H( `" A1 V+ A5 p7 T( v$ K
$_SESSION['tsadmin'] = $strAdminInfo;
l7 i1 D( s# o) K7 W. Z% Z8 p% f
7 t$ w; k7 o2 j: j7 o: G" Y header("Location: ".SITE_URL."index.php?app=system");
+ x; f, q$ J2 {# f1 P* |
1 X+ L7 v+ c% e- ^# a* _4 n9 P4 Z |
|