if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
//==============================================================================
// LMS 필수 실행코드 모음 시작
//==============================================================================
/*
if($_SERVER['REMOTE_ADDR']!='119.192.27.88'){
include_once($g4['path']."/coway_notice2.php");
die();
}
*/
$g4['lms'] = 'lms';
$g4['lms_path'] = $g4['path'] . "/" . $g4['lms'];
$g4['lms_auth_table'] = "kk_auth";
$g4['lms_member_table'] = "kk_lms_member";
include_once $g4['lms_path'] . "/config.php";
$_lms = array();
$sql = "select * from {$g4['module_table']} where mo_table = 'H05'";
$lms_module = sql_fetch($sql);
$sql = "select * from {$g4['lms_prefix']}H05 limit 1";
$row = sql_fetch($sql);
$_lms = get_module_view($row, $lms_module, "", 255);
unset($row);
unset($lms_module);
$hosts = $_SERVER['HTTP_HOST'];
$hosts = explode(".", $hosts);
$in_host = explode(".", $_lms['wr_18']);
$lms_method = "";
if($hosts[0] != "admin" && $hosts[0] != "tutor") {
$lms_method = "user";
if($hosts[0] == $in_host[0] || $hosts[0] == $in_host[1] || $hosts[0] == "localhost:81" || $hosts[0] == "localhost") {
$_office = $_lms;
$_office['is_office'] = "false";
} else {
$sql = "select * from {$g4['module_table']} where mo_table = 'D07'";
$lms_module = sql_fetch($sql);
$sql = "select * from {$g4['lms_prefix']}D07 where wr_22 = '{$hosts[0]}' limit 1";
$row = sql_fetch($sql);
$_office = get_module_view($row, $lms_module, "", 255);
unset($row);
unset($lms_module);
$_office['is_office'] = "true";
}
} else {
$lms_method = $hosts[0];
$_office = $_lms;
$_office['is_office'] = "false";
if($member['mb_id'] == "" && ($lms_method = "admin" || $lms_method = "tutor")) {
if($_SERVER['PHP_SELF'] != "/lms/plugin/login/index.php" && $_SERVER['PHP_SELF'] != "/bbs/login_check.php") {
goto_url("{$g4['lms_plug_path']}/login/");
}
//getReport($_SERVER,TRUE);
}
}
$_auth = array();
$_auth_tostring = array();
$sql = "select wr_subject as auth_name, wr_1 as auth_level, wr_2 as auth_code from {$g4['lms_prefix']}D05 where wr_is_comment=0 order by cast(wr_1 as unsigned) desc";
$result = sql_query($sql);
while($row = sql_fetch_array($result)) {
$_auth[$row['auth_level']] = $row;
$_auth_tostring[$row['auth_code']] = $row['auth_level'];
}
function is_auth_list($mo_table, $mb_level) {
global $g4;
$sql = "select au_list from {$g4['lms_auth_table']} where mo_table='{$mo_table}' and mb_level='{$mb_level}' order by au_id desc limit 1";
$rs = sql_fetch($sql);
if($rs['au_list'] == "y") {
return TRUE;
} else {
return FALSE;
}
}
function is_auth_write($mo_table, $mb_level) {
global $g4;
$sql = "select au_write from {$g4['lms_auth_table']} where mo_table='{$mo_table}' and mb_level='{$mb_level}' order by au_id desc limit 1";
$rs = sql_fetch($sql);
if($rs['au_write'] == "y") {
return TRUE;
} else {
return FALSE;
}
}
function is_auth_view($mo_table, $mb_level) {
global $g4;
$sql = "select au_view from {$g4['lms_auth_table']} where mo_table='{$mo_table}' and mb_level='{$mb_level}' order by au_id desc limit 1";
$rs = sql_fetch($sql);
if($rs['au_view'] == "y") {
return TRUE;
} else {
return FALSE;
}
}
function is_auth_update($mo_table, $mb_level) {
global $g4;
$sql = "select au_update from {$g4['lms_auth_table']} where mo_table='{$mo_table}' and mb_level='{$mb_level}' order by au_id desc limit 1";
$rs = sql_fetch($sql);
if($rs['au_update'] == "y") {
return TRUE;
} else {
return FALSE;
}
}
function is_auth_delete($mo_table, $mb_level) {
global $g4;
$sql = "select au_delete from {$g4['lms_auth_table']} where mo_table='{$mo_table}' and mb_level='{$mb_level}' order by au_id desc limit 1";
$rs = sql_fetch($sql);
if($rs['au_delete'] == "y") {
return TRUE;
} else {
return FALSE;
}
}
$is_dev = FALSE;
if($_SERVER['REMOTE_ADDR'] == '121.129.245.115' || $_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
$is_dev = TRUE;
}
$is_exec_id = false;
if($is_member){
$is_exec_id = is_exec_id($member['mb_id']);
}
?>