AdminEtc.php
1.02 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
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminBase.php" ;?>
<?
/*
* Admin process
* add by dev.lee
* */
if(!class_exists("AdminEtc")){
class AdminEtc extends AdminBase {
function __construct($req)
{
parent::__construct($req);
}
// 관리자 비밀번호 변경
function chageAdminPWD()
{
$no = $this->admUser["no"];
$nowPWD = $this->req["nowPWD"];
$newPWD = $this->req["newPWD"];
$sql = "
SELECT *
FROM tbl_admin
WHERE `no` = '{$no}'
LIMIT 1
";
$result = $this->getRow($sql);
if($result == null)
{
$_REQUEST["msg"] = "재 로그인 후 다시 시도해주세요.";
return false;
}
if($result["admin_pwd"] != MD5($nowPWD))
{
$_REQUEST["msg"] = "현재 비밀번호가 일치하지 않습니다.";
return false;
}
$sql = "
UPDATE tbl_admin
SET admin_pwd = MD5('{$newPWD}')
, admin_pwd_enc = HEX('{$newPWD}')
WHERE `no` = '{$no}'
";
$this->update($sql);
}
} // class end
}
?>