Admin.php
1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBase.php" ;?>
<?
/*
* Admin process
* add by dev.lee
* */
if(!class_exists("Admin")){
class Admin extends AdminBase {
function __construct($req)
{
parent::__construct($req);
}
function wrapParam()
{
$this->req['page'] = ($this->req['page'] == "") ? 1 : $this->req['page'] ;
}
function getAddQuery()
{
$addQuery = "" ;
$addQuery .= $this->getSearchQuery() ;
return $addQuery ;
}
function login()
{
$id = $this->req[adm_id];
$pass = MD5($this->req[adm_pw]);
$sql = "
SELECT adm.*
FROM tblAdmin adm
WHERE adm.adminID = '{$id}' AND adm.adminPwd = '{$pass}' AND adm.status = 1
LIMIT 0, 1
";
$retVal = $this->getRow($sql);
if($retVal == null)
{
$_REQUEST[msg] = "로그인 정보가 일치하지 않습니다. 확인해주세요.";
return;
}
else
{
LoginUtil::doAdminLogin($retVal);
$_REQUEST[rurl] = bin2hex("/admin/userManage/userList.php");
}
}
//계정 정보 조회
function getAdminInfo()
{
$no = $this->admUser["adminNo"];
$sql = "
SELECT adm.*
FROM tblAdmin adm
WHERE adm.adminNo = '{$no}' AND adm.status = 1
LIMIT 0, 1
";
$result = $this->getRow($sql);
return $result;
}
function checkLogin(){
if(LoginUtil::isAdminLogin() == false){
$rurl = bin2hex($_SERVER[REQUEST_URI]) ;
if(stristr($_SERVER[REQUEST_URI],"pop"))
echo "<script>alert('관리자로 로그인 후 이용할 수 있습니다.') ; opener.location.href = 'index.php'; self.close();</script>" ;
else
echo "<script>alert('관리자로 로그인 후 이용할 수 있습니다.') ; location.href = 'index.php' ;</script>" ;
}
}
function logout(){
LoginUtil::doAdminLogout();
$_REQUEST[rurl] = bin2hex("/admin/index.php");
}
}
}
?>