| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <?php
- if(empty($_SESSION['admin_cd_userid'])){
- if($_SERVER['HTTP_X_REQUESTED_WITH'] == "XMLHttpRequest") {
- if(strpos($_SERVER['HTTP_ACCEPT'], "application/json") === false) {
- ?>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- </head>
- <script>
- alert("본페이지는 관리자만 접근 가능합니다.");
- location.replace("<?=ADMIN_PATH?>index.php");
- </script>
- </head>
- </html>
- <?php
- exit;
- }else {
- $RES = array(
- 'CODE' => "4444"
- , "MSG" => "로그인세션이 만료되었습니다. 재로그인 후 이용하십시오"
- , "DATAS" => array(
- 'URL' => ADMIN_PATH."index.php"
- )
- );
- echo json_encode($RES);
- exit;
- }
- }else {
- ?>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- </head>
- <script>
- alert("본페이지는 관리자만 접근 가능합니다.");
- location.replace("<?=ADMIN_PATH?>index.php");
- </script>
- </head>
- </html>
- <?php
- }
- exit;
- ?>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- </head>
- <script>
- alert("본페이지는 관리자만 접근 가능합니다.");
- location.replace("<?=ADMIN_PATH?>index.php");
- </script>
- </head>
- </html>
- <?php
- }
- // echo str_replace("/manager/", "", $_SERVER['REQUEST_URI']);
- // echo "<br>";
- // echo substr(str_replace("/manager/", "", $_SERVER['REQUEST_URI']), 0, stripos(str_replace("/manager/", "", $_SERVER['REQUEST_URI']), "/"));
- $currAdminDir = substr(str_replace("/manager/", "", $_SERVER['REQUEST_URI']), 0, stripos(str_replace("/manager/", "", $_SERVER['REQUEST_URI']), "/"));
- switch($currAdminDir){
- case "admin":
- case "popup":
- $m = '1';
- break;
- case "class":
- case"model":
- case "car":
- $m = '2';
- break;
- case "consultant":
- $m = '3';
- break;
- case "simpleOrder":
- case "order":
- case "carReq":
- $m = '4';
- break;
- case "buyappr":
- $m = '5';
- break;
- case "sellappr":
- $m = '6';
- break;
- case "makeproduct":
- $m = '7';
- break;
- case "carbase":
- $m = '8';
- break;
- default:
- $m = '-1';
- }
- ?>
|