|
|
发表于 2013-7-16 22:09:59
|
显示全部楼层
$email = trim($_POST['email']);( V2 r/ A* c3 }+ x2 l0 r$ g$ W) h
$pwd = trim($_POST['pwd']);3 h" Y2 {# v) |( O
$cktime = $_POST['cktime'];
* g: V5 U. _. m
: N3 p) j" R# e! h/ O+ ~ if($email=='' || $pwd=='') qiMsg("所有输入项都不能为空^_^");% J% U; i2 C3 k$ M G# K8 \+ M" ]8 j
2 l: \4 B/ \! l- M& @3 G $countAdmin = $db->once_fetch_assoc("select count(*) from ".dbprefix."user where `email`='$email'");- D/ f e* ^1 S1 J
- X. \* y$ |% w. U9 d2 D( a
if($countAdmin['count(*)'] == 0) qiMsg('用户Email不存在!');
" ~! ^* F# E6 B, ^3 s5 I& r
; W/ t7 v. ]# }6 r6 I $strAdmin = $db->once_fetch_assoc("select * from ".dbprefix."user where `email`='$email'");
; U! e( p. w/ t( s3 w$ K9 d- B 0 z( w# t" G! E3 Q7 D0 ?1 _
if(md5($strAdmin['salt'].$pwd)!==$strAdmin['pwd']) tsNotice('用户密码错误!');
, N# ?: ^% ~$ Z: o/ ~ 3 J0 }3 U# L# I- T( O
$strAdminInfo = $db->once_fetch_assoc("select userid,username,isadmin from ".dbprefix."user_info where email='$email'");8 D& _3 K, {* g2 U: Z0 x, E# U* I5 o
: g' c. g9 [; ?4 o. ?- U3 a if($strAdminInfo['isadmin'] != 1) qiMsg("你无权登录后台管理!");
8 R9 T* Q$ a3 S! Z- z# g. X( ] ) x) M4 |; j r; z* p
$_SESSION['tsadmin'] = $strAdminInfo;
! T0 {# J3 x( o; ?2 Q & D9 H: {* X3 k& r
header("Location: ".SITE_URL."index.php?app=system");7 d5 p! h4 g g+ j
3 `6 S3 C! S& v& B( j% S) z |
|