Example #1
0
 function index()
 {
     $member =& $this->member;
     $board =& $this->board;
     $seg =& $this->seg;
     $type = $seg->get('type');
     switch ($type) {
         case 'image':
             $title = '이미지';
             break;
         case 'file':
             $title = '파일';
             break;
         case 'media':
             $title = '멀티미디어';
             break;
         default:
             alert_close('잘못된 접근입니다.');
             break;
     }
     if ($member['mb_level'] < $board['bo_upload_level']) {
         alert_close('업로드 권한이 없습니다.');
     }
     $head = array('title' => $title . ' 첨부');
     $data = array('upload_size' => $board['bo_upload_size'], 'upload_ext' => '*.' . str_replace('|', ';*.', $board['bo_upload_ext']));
     widget::run('head', $head);
     $this->load->view('board/editor_' . $type, $data);
     widget::run('tail');
 }
Example #2
0
 function memo_delete()
 {
     $me_no = $this->input->post('me_no');
     $flag = $this->input->post('flag');
     check_token('member/memo/lists/' . $flag);
     if (!IS_MEMBER) {
         alert_close("회원만 이용하실 수 있습니다.");
     }
     if (!($flag && $me_no)) {
         alert_close("잘못된 접근입니다.");
     }
     $member = unserialize(MEMBER);
     $this->load->model('Member_memo_model');
     if ($flag == 'R') {
         $result = $this->Member_memo_model->get_del_memo($me_no, $flag, $member['mb_id']);
         $cnt = 0;
         foreach ($result as $row) {
             if ($row['me_check'] == '0000-00-00 00:00:00') {
                 $cnt++;
             }
         }
         if ($cnt > 0) {
             $this->Member_memo_model->memo_count($member['mb_id'], $cnt);
         }
     }
     $this->Member_memo_model->memo_delete($me_no, $flag, $member['mb_id']);
     goto_url('member/memo/lists/' . $flag);
 }
Example #3
0
 function qry($mb_id)
 {
     if (!IS_MEMBER) {
         alert_close("회원만 이용하실 수 있습니다.");
     }
     $member = unserialize(MEMBER);
     if (!$member['mb_open'] && !SU_ADMIN && $member['mb_id'] != $mb_id) {
         alert_close("자신의 정보를 공개하지 않으면 다른분의 정보를 조회할 수 없습니다.\\n\\n정보공개 설정은 회원정보수정에서 하실 수 있습니다.");
     }
     $mb = $this->Basic_model->get_member($mb_id, "mb_id, mb_level, mb_point, mb_homepage, mb_open, mb_nick, mb_datetime, mb_today_login, mb_profile");
     if (!isset($mb['mb_id'])) {
         alert_close("회원정보가 존재하지 않습니다.\\n\\n탈퇴하였을 수 있습니다.");
     }
     if (!$mb['mb_open'] && !SU_ADMIN && $member['mb_id'] != $mb_id) {
         alert_close("정보공개를 하지 않았습니다.");
     }
     $name = $this->config->item('cf_use_nick') && $mb['mb_nick'] ? $mb['mb_nick'] : $mb['mb_name'];
     $name = get_sideview($mb['mb_id'], $name);
     // 회원가입후 몇일째인지? + 1 은 당일을 포함한다는 뜻
     $query = $this->db->query("select (TO_DAYS('" . TIME_YMDHIS . "') - TO_DAYS('" . $mb['mb_datetime'] . "') + 1) as days");
     $row = $query->row_array();
     $mb_reg_after = $row['days'];
     $mb_homepage = prep_url($mb['mb_homepage']);
     $mb_profile = $mb['mb_profile'] ? conv_content($mb['mb_profile'], FALSE) : "소개 내용이 없습니다.";
     $mb_join_date = $member['mb_level'] >= $mb['mb_level'] ? substr($mb['mb_datetime'], 0, 10) . " (" . $mb_reg_after . " 일)" : "알 수 없음";
     $mb_last_login = $member['mb_level'] >= $mb['mb_level'] ? $mb['mb_today_login'] : "******";
     $head = array('title' => $mb['mb_nick'] . "님의 자기소개");
     $data = array('name' => $name, 'profile' => $mb_profile, 'homepage' => $mb_homepage, 'point' => number_format($mb['mb_point']), 'join_date' => $mb_join_date, 'last_login' => $mb_last_login);
     widget::run('head', $head);
     $this->load->view('member/profile', $data);
     widget::run('tail');
 }
Example #4
0
 function index()
 {
     if (SU_ADMIN != ADMIN) {
         alert_close('최고관리자만 접근할 수 있습니다.');
         return false;
     }
     phpinfo();
 }
Example #5
0
 function _remap($pu_id)
 {
     $pu = $this->Popup_model->get($pu_id, 'pu_id, pu_name, pu_file');
     if (!isset($pu['pu_id'])) {
         alert_close('등록된 팝업이 아닙니다.');
     }
     if (SU_ADMIN && !file_exists(SKIN_PATH . 'popup/' . $pu['pu_file'] . '.html')) {
         alert_close('팝업 파일이 없습니다.');
     }
     $head = array('title' => $pu['pu_name']);
     $data = array('id' => 'popup' . $pu_id);
     widget::run('head', $head);
     $this->load->view('popup/' . $pu['pu_file'], $data);
     widget::run('tail');
 }
Example #6
0
 function index()
 {
     $seg =& $this->seg;
     $wr_id = $seg->get('wr_id');
     $no = $seg->get('no');
     // 쿠키에 저장된 ID값과 넘어온 ID값을 비교하여 같지 않을 경우 오류 발생
     // 다른곳에서 링크 거는것을 방지하기 위한 코드
     if (!$this->session->userdata('ss_view_' . BO_TABLE . '_' . $wr_id)) {
         alert('잘못된 접근입니다.');
     }
     $CI =& get_instance();
     $CI->load->model('Board_file_model');
     $file = $CI->Board_file_model->get_file(BO_TABLE, $wr_id, $no);
     if (!isset($file['bf_file'])) {
         alert_close('파일 정보가 존재하지 않습니다.');
     }
     $board =& $this->board;
     $member =& $this->member;
     if ($member['mb_level'] < $board['bo_download_level']) {
         $alert_msg = '다운로드 권한이 없습니다.';
         if (IS_MEMBER) {
             alert($alert_msg);
         } else {
             alert($alert_msg . "\\n\\n회원이라면 로그인 후 이용하세요.", 'member/login/qry/' . url_encode('board/' . BO_TABLE . '/view/wr_id/' . $wr_id));
         }
     }
     // 다운수 증가
     $ss_name = 'ss_down_' . BO_TABLE . '_' . $wr_id . '_' . $no;
     if (!$this->session->userdata($ss_name)) {
         // 다운로드 카운트 증가
         $CI->Board_file_model->file_down_update(BO_TABLE, $wr_id, $no);
         $this->session->set_userdata($ss_name, TRUE);
     }
     $filepath = addslashes(DATA_PATH . '/file/' . BO_TABLE . '/' . $file['bf_file']);
     if (file_exists($filepath)) {
         if (preg_match("/^utf/i", $this->config->item('charset'))) {
             $original = urlencode($file['bf_source']);
         } else {
             $original = $file['bf_source'];
         }
         $this->load->helper('download');
         if (!force_download($original, file_get_contents($filepath))) {
             alert('파일을 찾을 수 없습니다.');
         }
     } else {
         alert('파일을 찾을 수 없습니다.');
     }
 }
Example #7
0
 function index()
 {
     $bo_table = $this->input->post('bo_table');
     $wr_id = $this->input->post('wr_id');
     $sw = $this->input->post('sw');
     $board = $this->Basic_model->get_board($bo_table, 'bo_admin', TRUE);
     $member = unserialize(MEMBER);
     define('IS_ADMIN', is_admin($member, $board));
     // 게시판 관리자 이상 복사, 이동 가능
     if (!IS_ADMIN) {
         show_404();
     }
     if (!$wr_id) {
         alert_close('잘못된 접근입니다.');
     }
     switch ($sw) {
         case 'move':
             $act = '이동';
             break;
         case 'copy':
             $act = '복사';
             break;
         default:
             alert_close('잘못된 접근입니다.');
             break;
     }
     $result = $this->Board_mvcp_model->list_move_copy($bo_table, $member['mb_id']);
     $list = array();
     $save_gr_subject = '';
     foreach ($result as $i => $row) {
         $list[$i] = new stdClass();
         $list[$i]->bo_table = $row['bo_table'];
         $span = $save_gr_subject == $row['gr_subject'] ? "<span style='color:#cccccc;'>" : '<span>';
         $list[$i]->gr_subject = $span . $row['gr_subject'] . ' &gt; </span>';
         $list[$i]->bo_subject = $row['bo_subject'];
         $save_gr_subject = $row['gr_subject'];
     }
     $head = array('title' => '게시물 ' . $act);
     $data = array('sw' => $sw, 'bo_table' => $bo_table, 'wr_id' => serialize($wr_id), 'act' => $act, 'list' => $list);
     widget::run('head', $head);
     $this->load->view('board/movecopy', $data);
     widget::run('tail');
 }
Example #8
0
 function category()
 {
     $bo_table = $this->input->post('bo_table');
     if (!IS_MEMBER || !$bo_table) {
         show_404();
     }
     $bo = $this->Basic_model->get_board($bo_table, 'bo_table,bo_admin,bo_subject');
     if (!isset($bo['bo_table'])) {
         alert_close('존재하지 않는 게시판 입니다.');
     }
     $member = unserialize(MEMBER);
     if ($member['mb_id'] != $bo['bo_admin']) {
         show_404();
     }
     define('CSS_SKIN', 'category');
     $type = 'bo_' . $bo_table;
     $this->load->model('Categoryform_model');
     $bc = $this->Categoryform_model->list_result($type);
     $code_html = FALSE;
     if ($bc) {
         $t_code = $s_code = array();
         foreach ($bc as $row) {
             $code_exp = explode('-', $row['code']);
             if (!isset($code_exp[1])) {
                 $t_code[$code_exp[0]] = $row['ca_name'];
             } else {
                 $s_code[$code_exp[0]][$code_exp[1]] = $row['ca_name'];
             }
         }
         $this->load->helper('categoryform');
         $code_html = get_categoryform($t_code, $s_code);
     }
     $head = array('title' => $bo['bo_subject']);
     $data = array('bo_table' => $bo_table, 'type' => $type, 'code_html' => $code_html);
     widget::run('head', $head);
     $this->load->view('board/admin_category', $data);
     widget::run('tail');
 }
<?php

die("이 프로그램은 더 이상 사용하지 않습니다. 그누보드 4.32.09 를 참고하세요.");
include_once "./_common.php";
/*
$wr_key = trim($_POST[wr_key]);
if (!($wr_key && $wr_key == get_session('ss_norobot_key'))) {
    alert("정상적인 접근이 아닌것 같습니다.");
}
*/
$key = get_session("captcha_keystring");
if (!($key && $key == $_POST[wr_key])) {
    session_unregister("captcha_keystring");
    alert_close("정상적인 접근이 아닌것 같습니다.");
}
$sql = " select mb_id, mb_nick, mb_password_a, mb_email from {$g4['member_table']} where mb_id = '{$_POST['pass_mb_id']}' ";
$mb = sql_fetch($sql);
if (!$mb[mb_id]) {
    alert("존재하지 않는 회원입니다.");
} else {
    if ($mb_password_a !== $mb[mb_password_a]) {
        alert("패스워드 분실 시 답변이 틀립니다.");
    } else {
        if (is_admin($mb[mb_id])) {
            alert("관리자 아이디는 접근 불가합니다.");
        }
    }
}
$g4[title] = "패스워드 찾기 3단계";
include_once "{$g4['path']}/head.sub.php";
// 난수 발생
Example #10
0
<?php

include_once "./_common.php";
if (!$member[mb_id]) {
    alert_close("회원만 조회하실 수 있습니다.");
}
$g4[title] = $member[mb_nick] . "님의 스크랩";
$member_skin_path = "{$g4['path']}/skin/member/{$config['cf_member_skin']}";
include_once "{$g4['path']}/head.sub.php";
$list = array();
$sql_common = " from {$g4['scrap_table']} where mb_id = '{$member['mb_id']}' ";
$sql_order = " order by ms_id desc ";
$sql = " select count(*) as cnt {$sql_common} ";
$row = sql_fetch($sql);
$total_count = $row[cnt];
$rows = $config[cf_page_rows];
$total_page = ceil($total_count / $rows);
// 전체 페이지 계산
if (!$page) {
    $page = 1;
}
// 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows;
// 시작 열을 구함
$list = array();
$sql = " select *\n          {$sql_common}\n          {$sql_order}\n          limit {$from_record}, {$rows} ";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
    $list[$i] = $row;
    // 순차적인 번호 (순번)
    $num = $total_count - ($page - 1) * $rows - $i;
Example #11
0
<?php

include_once './_common.php';
if ($is_guest) {
    alert_close('회원만 이용하실 수 있습니다.');
}
$g5['title'] = '내 쪽지함';
include_once G5_PATH . '/head.sub.php';
// 설정일이 지난 메모 삭제
$sql = " delete from {$g5['memo_table']}\n            where me_recv_mb_id = '{$member['mb_id']}'\n            and me_send_datetime < '" . date("Y-m-d H:i:s", G5_SERVER_TIME - 86400 * $config['cf_memo_del']) . "' ";
sql_query($sql);
if (!$kind) {
    $kind = 'recv';
}
if ($kind == 'recv') {
    $unkind = 'send';
} else {
    if ($kind == 'send') {
        $unkind = 'recv';
    } else {
        alert('' . $kind . '값을 넘겨주세요.');
    }
}
$sql = " select count(*) as cnt from {$g5['memo_table']} where me_{$kind}_mb_id = '{$member['mb_id']}' ";
$row = sql_fetch($sql);
$total_count = number_format($row['cnt']);
if ($kind == 'recv') {
    $kind_title = '받은';
    $recv_img = 'on';
    $send_img = 'off';
} else {
Example #12
0
<?php

$sub_menu = "100290";
include_once './_common.php';
if ($is_admin != 'super') {
    alert_close('최고관리자만 접근 가능합니다.');
}
$g5['title'] = '메뉴 추가';
include_once G5_PATH . '/head.sub.php';
// 코드
if ($new == 'new' || !$code) {
    $code = base_convert(substr($code, 0, 2), 36, 10);
    $code += 36;
    $code = base_convert($code, 10, 36);
}
?>

<div id="menu_frm" class="new_win">
    <h1><?php 
echo $g5['title'];
?>
</h1>

    <form name="fmenuform" id="fmenuform">

    <div class="new_win_desc">
        <label for="me_type">대상선택</label>
        <select name="me_type" id="me_type">
            <option value="">직접입력</option>
            <option value="group">게시판그룹</option>
            <option value="board">게시판</option>
Example #13
0
    alert_close('상품정보가 존재하지 않습니다.');
}
if ($w == "") {
    $is_score = 5;
    // 사용후기 작성 설정에 따른 체크
    check_itemuse_write($it_id, $member['mb_id']);
} else {
    if ($w == "u") {
        $use = sql_fetch(" select * from {$g5['g5_shop_item_use_table']} where is_id = '{$is_id}' ");
        if (!$use) {
            alert_close("사용후기 정보가 없습니다.");
        }
        $it_id = $use['it_id'];
        $is_score = $use['is_score'];
        if (!$is_admin && $use['mb_id'] != $member['mb_id']) {
            alert_close("자신의 사용후기만 수정이 가능합니다.");
        }
    }
}
include_once G5_PATH . '/head.sub.php';
$is_dhtml_editor = false;
// 모바일에서는 DHTML 에디터 사용불가
if ($config['cf_editor'] && !G5_IS_MOBILE) {
    $is_dhtml_editor = true;
}
$editor_html = editor_html('is_content', get_text($use['is_content'], 0), $is_dhtml_editor);
$editor_js = '';
$editor_js .= get_editor_js('is_content', $is_dhtml_editor);
$editor_js .= chk_editor_js('is_content', $is_dhtml_editor);
$itemuseform_skin = G5_MSHOP_SKIN_PATH . '/itemuseform.skin.php';
if (!file_exists($itemuseform_skin)) {
Example #14
0
                }
            }
            set_session($ss_name, TRUE);
        }
    }
    // 한번 읽은글은 브라우저를 닫기전까지는 카운트를 증가시키지 않음
    $ss_name = "ss_view_{$bo_table}_{$wr_id}";
    if (!get_session($ss_name)) {
        sql_query(" update {$write_table} set wr_hit = wr_hit + 1 where wr_id = '{$wr_id}' ");
        // 자신의 글이면 통과
        if ($write[mb_id] && $write[mb_id] == $member[mb_id]) {
        } else {
            // 회원이상 글읽기가 가능하다면
            if ($board[bo_read_level] > 1) {
                if ($member[mb_point] + $board[bo_read_point] < 0) {
                    alert_close("보유하신 포인트(" . number_format($member[mb_point]) . ")가 없거나 모자라서 글읽기(" . number_format($board[bo_read_point]) . ")가 불가합니다.\\n\\n포인트를 모으신 후 다시 글읽기 해 주십시오.");
                }
                insert_point($member[mb_id], $board[bo_read_point], "{$board['bo_subject']} {$wr_id} 글읽기", $bo_table, $wr_id, '읽기');
            }
        }
        set_session($ss_name, TRUE);
    }
    $g4[title] = "{$group['gr_subject']} > {$board['bo_subject']} > " . strip_tags(conv_subject($write[wr_subject], 255));
}
include_once "{$g4['path']}/head.sub.php";
$width = $board[bo_table_width];
if ($width <= 100) {
    $width .= '%';
}
// IP보이기 사용 여부
$ip = "";
Example #15
0
<?php

include_once './_common.php';
if (!$is_member) {
    if ($move) {
        alert("회원만 작성이 가능합니다.");
    } else {
        alert_close("회원만 작성이 가능합니다.");
    }
}
$it_id = trim($_REQUEST['it_id']);
$is_subject = trim($_POST['is_subject']);
$is_content = trim($_POST['is_content']);
$is_name = trim($_POST['is_name']);
$is_password = trim($_POST['is_password']);
$is_score = (int) $_POST['is_score'] > 5 ? 0 : (int) $_POST['is_score'];
//APMS : 파트너 정보 등록 - 2014.07.21
$it = apms_it($it_id);
if ($it['pt_review_use']) {
    $default['de_item_use_write'] = '';
}
// 후기권한 재설정
// 사용후기 작성 설정에 따른 체크
check_itemuse_write($it_id, $member['mb_id']);
if ($w == "" || $w == "u") {
    $is_name = addslashes($member['mb_nick']);
    // 별명으로 변경
    $is_password = $member['mb_password'];
    if (!$is_subject) {
        alert("제목을 입력하여 주십시오.");
    }
Example #16
0
if (!$row['it_id']) {
    alert_close('상품정보가 존재하지 않습니다.');
}
$chk_secret = '';
if ($w == '') {
    $qa['iq_email'] = $member['mb_email'];
    $qa['iq_hp'] = $member['mb_hp'];
}
if ($w == "u") {
    $qa = sql_fetch(" select * from {$g5['g5_shop_item_qa_table']} where iq_id = '{$iq_id}' ");
    if (!$qa) {
        alert_close("상품문의 정보가 없습니다.");
    }
    $it_id = $qa['it_id'];
    if (!$iq_admin && $qa['mb_id'] != $member['mb_id']) {
        alert_close("자신의 상품문의만 수정이 가능합니다.");
    }
    if ($qa['iq_secret']) {
        $chk_secret = 'checked="checked"';
    }
}
include_once G5_PATH . '/head.sub.php';
$is_dhtml_editor = false;
// 모바일에서는 DHTML 에디터 사용불가
if ($config['cf_editor'] && (!is_mobile() || defined('G5_IS_MOBILE_DHTML_USE') && G5_IS_MOBILE_DHTML_USE)) {
    $is_dhtml_editor = true;
}
$editor_html = editor_html('iq_question', get_text($qa['iq_question'], 0), $is_dhtml_editor);
$editor_js = '';
$editor_js .= get_editor_js('iq_question', $is_dhtml_editor);
$editor_js .= chk_editor_js('iq_question', $is_dhtml_editor);
Example #17
0
        $is_purchaser = false;
        $is_remaintime = '';
        if ($is_admin != 'super' && !$is_auther) {
            $purchase = apms_it_payment($it['it_id']);
            $is_purchaser = $purchase['ct_qty'] > 0 ? true : false;
            if ($it['pt_day'] > 0) {
                //기간제 상품일 경우
                $is_remaintime = strtotime($purchase['pt_datetime']) + $it['pt_day'] * $purchase['ct_qty'] * 86400;
                $is_purchaser = $is_remaintime >= G5_SERVER_TIME ? true : false;
            }
        }
        if (!$is_purchaser) {
            if ($is_remaintime) {
                alert_close("이용기간(" . date("Y/m/d H:i", $is_remaintime) . ")이 만료되었습니다.\\n\\n재구매후 이용가능합니다.");
            } else {
                alert_close("구매가 완료된 회원만 이용가능합니다.");
            }
        }
        // 사용로그
        apms_it_used($it['it_id']);
    } else {
        // 비회원은 이용불가
        if (!$file['pf_guest_use'] && $is_guest) {
            alert("회원만 다운로드 가능합니다.");
        }
    }
    // 다운로드 카운트 증가
    sql_query(" update {$g5['apms_file']} set pf_download = pf_download + 1 where pf_id = '{$pf_id}' and pf_dir = '1' and pf_no = '{$no}' ");
}
//$original = urlencode($file['pf_source']);
$original = iconv('utf-8', 'euc-kr', $file['pf_source']);
    }
    $od_id = preg_replace('/[^0-9]/', '', $_POST['od_id']);
    if ($_POST['od_id']) {
        $sql = " select od_id from {$g5['g5_shop_order_table']} where od_id = '{$od_id}' ";
        $row = sql_fetch($sql);
        if (!$row['od_id']) {
            alert('입력하신 주문번호는 존재하지 않는 주문 자료입니다.');
        }
    }
    $sql_common = " pp_name             = '{$_POST['pp_name']}',\n                    pp_price            = '{$_POST['pp_price']}',\n                    od_id               = '{$od_id}',\n                    pp_content          = '{$_POST['pp_content']}',\n                    pp_receipt_price    = '{$_POST['pp_receipt_price']}',\n                    pp_settle_case      = '{$_POST['pp_settle_case']}',\n                    pp_receipt_time     = '{$_POST['pp_receipt_time']}',\n                    pp_shop_memo        = '{$_POST['pp_shop_memo']}',\n                    pp_use              = '{$_POST['pp_use']}' ";
}
if ($w == '') {
    $pp_id = get_uniqid();
    $sql = " insert into {$g5['g5_shop_personalpay_table']}\n                set pp_id = '{$pp_id}',\n                    {$sql_common} ,\n                    pp_ip   = '{$_SERVER['REMOTE_ADDR']}',\n                    pp_time = '" . G5_TIME_YMDHIS . "' ";
    sql_query($sql);
} else {
    if ($w == 'u') {
        $sql = " select pp_id from {$g5['g5_shop_personalpay_table']} where pp_id = '{$_POST['pp_id']}' ";
        $row = sql_fetch($sql);
        if (!$row['pp_id']) {
            alert('수정하시려는 자료가 존재하지 않습니다.');
        }
        $sql = " update {$g5['g5_shop_personalpay_table']}\n                set {$sql_common}\n                where pp_id = '{$_POST['pp_id']}' ";
        sql_query($sql);
    }
}
if ($popup == 'yes') {
    alert_close('개인결제가 추가됐습니다.');
} else {
    goto_url('./personalpayform.php?w=u&amp;pp_id=' . $pp_id . '&amp;' . $qstr);
}
Example #19
0
 /**
  * 게시물 카테고리 변경하기
  */
 public function post_change_category($post_id = '')
 {
     // 이벤트 라이브러리를 로딩합니다
     $eventname = 'event_helptool_post_change_category';
     $this->load->event($eventname);
     $is_admin = $this->member->is_admin();
     if ($is_admin === false) {
         alert('접근권한이 없습니다');
         return false;
     }
     $view = array();
     $view['view'] = array();
     // 이벤트가 존재하면 실행합니다
     $view['view']['event']['before'] = Events::trigger('before', $eventname);
     $this->load->model('Board_category_model');
     $post_id_list = '';
     if ($this->input->post('chk_post_id')) {
         $post_id_list = '';
         $chk_post_id = $this->input->post('chk_post_id');
         foreach ($chk_post_id as $val) {
             if (empty($post_id)) {
                 $post_id = $val;
             }
             $post_id_list .= $val . ',';
         }
     } elseif ($post_id) {
         $post_id_list = $post_id;
     }
     if ($this->input->post('post_id_list')) {
         $post_id_list = $this->input->post('post_id_list');
     }
     $view['view']['post_id_list'] = $post_id_list;
     $post = $this->Post_model->get_one($post_id);
     $board = $this->board->item_all(element('brd_id', $post));
     $view['view']['post'] = $post;
     $view['view']['board'] = $board;
     $config = array(array('field' => 'is_submit', 'label' => '체크', 'rules' => 'trim'));
     $this->load->library('form_validation');
     $this->form_validation->set_rules($config);
     $form_validation = $this->form_validation->run();
     /**
      * 유효성 검사를 하지 않는 경우, 또는 유효성 검사에 실패한 경우입니다.
      * 즉 글쓰기나 수정 페이지를 보고 있는 경우입니다
      */
     if ($form_validation === false or !$this->input->post('is_submit')) {
         // 이벤트가 존재하면 실행합니다
         $view['view']['event']['formrunfalse'] = Events::trigger('formrunfalse', $eventname);
         $view['view']['data'] = $this->Board_category_model->get_all_category(element('brd_id', $board));
         // 이벤트가 존재하면 실행합니다
         $view['view']['event']['before_layout'] = Events::trigger('before_layout', $eventname);
         /**
          * 레이아웃을 정의합니다
          */
         $page_title = element('brd_name', $board) . ' > 카테고리 변경';
         $layoutconfig = array('path' => 'helptool', 'layout' => 'layout_popup', 'skin' => 'post_change_category', 'layout_dir' => $this->cbconfig->item('layout_helptool'), 'mobile_layout_dir' => $this->cbconfig->item('mobile_layout_helptool'), 'skin_dir' => $this->cbconfig->item('skin_helptool'), 'mobile_skin_dir' => $this->cbconfig->item('mobile_skin_helptool'), 'page_title' => $page_title);
         $view['layout'] = $this->managelayout->front($layoutconfig, $this->cbconfig->get_device_view_type());
         $this->data = $view;
         $this->layout = element('layout_skin_file', element('layout', $view));
         $this->view = element('view_skin_file', element('layout', $view));
     } else {
         // 이벤트가 존재하면 실행합니다
         $view['view']['event']['formruntrue'] = Events::trigger('formruntrue', $eventname);
         if ($post_id_list) {
             $arr = explode(',', $post_id_list);
             if ($arr) {
                 $arrsize = count($arr);
                 for ($k = $arrsize - 1; $k >= 0; $k--) {
                     $post_id = element($k, $arr);
                     if (empty($post_id)) {
                         continue;
                     }
                     $post = $this->Post_model->get_one($post_id);
                     $board = $this->board->item_all(element('brd_id', $post));
                     $chk_post_category = $this->input->post('chk_post_category', null, '');
                     $postupdate = array('post_category' => $chk_post_category);
                     $this->Post_model->update($post_id, $postupdate);
                 }
             }
         }
         alert_close('카테고리가 변경되었습니다');
     }
 }
Example #20
0
}
if ($_SESSION["ss_recommend_datetime"] >= G5_SERVER_TIME - 120) {
    alert("너무 빠른 시간내에 메일을 연속해서 보낼 수 없습니다.");
}
set_session("ss_recommend_datetime", G5_SERVER_TIME);
$recommendmail_count = (int) get_session('ss_recommendmail_count') + 1;
if ($recommendmail_count > 3) {
    alert_close('한번 접속후 일정수의 메일만 발송할 수 있습니다.\\n\\n계속해서 메일을 보내시려면 다시 로그인 또는 접속하여 주십시오.');
}
set_session('ss_recommendmail_count', $recommendmail_count);
// 세션에 저장된 토큰과 폼값으로 넘어온 토큰을 비교하여 틀리면 메일을 발송할 수 없다.
if ($_POST["token"] && get_session("ss_token") == $_POST["token"]) {
    // 맞으면 세션을 지워 다시 입력폼을 통해서 들어오도록 한다.
    set_session("ss_token", "");
} else {
    alert_close("메일 발송시 오류가 발생하였습니다.");
    exit;
}
// 상품
$sql = " select * from {$g5['g5_shop_item_table']} where it_id = '{$it_id}' ";
$it = sql_fetch($sql);
if (!$it['it_id']) {
    alert("등록된 상품이 아닙니다.");
}
$subject = stripslashes($subject);
$content = nl2br(stripslashes($content));
$from_name = get_text($member['mb_name']);
$from_email = $member['mb_email'];
$it_id = $it['it_id'];
$it_name = $it['it_name'];
$it_mimg = get_it_image($it_id, $default['de_mimg_width'], $default['de_mimg_height']);
Example #21
0
<?php

include_once './_common.php';
$g5['title'] = '상품 재입고 알림 (SMS)';
include_once G5_PATH . '/head.sub.php';
// 상품정보
$sql = " select it_id, it_name, it_soldout, it_stock_sms\n            from {$g5['g5_shop_item_table']}\n            where it_id = '{$it_id}' ";
$it = sql_fetch($sql);
if (!$it['it_id']) {
    alert_close('상품정보가 존재하지 않습니다.');
}
if (!$it['it_soldout'] || !$it['it_stock_sms']) {
    alert_close('재입고SMS 알림을 신청할 수 없는 상품입니다.');
}
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="' . G5_SHOP_SKIN_URL . '/style.css">', 0);
?>

<div id="sit_sms_new" class="new_win">
    <h1 id="win_title"><?php 
echo $g5['title'];
?>
</h1>

    <form name="fstocksms" method="post" action="<?php 
echo G5_HTTPS_SHOP_URL;
?>
/itemstocksmsupdate.php" onsubmit="return fstocksms_submit(this);"  autocomplete="off">
    <input type="hidden" name="it_id" value="<?php 
echo $it_id;
?>
Example #22
0
<?php

include_once "./_common.php";
$po = sql_fetch(" select * from {$g4['poll_table']} where po_id = '{$_POST['po_id']}' ");
if (!$po[po_id]) {
    alert_close("po_id 값이 제대로 넘어오지 않았습니다.");
}
if ($member[mb_level] < $po[po_level]) {
    alert_close("권한 {$po['po_level']} 이상 회원만 투표에 참여하실 수 있습니다.");
}
// 쿠키에 저장된 투표번호가 없다면
if (get_cookie("ck_po_id") != $po[po_id]) {
    // 투표했던 ip들 중에서 찾아본다
    $search_ip = false;
    $ips = explode("\n", trim($po[po_ips]));
    for ($i = 0; $i < count($ips); $i++) {
        if ($_SERVER[REMOTE_ADDR] == trim($ips[$i])) {
            $search_ip = true;
            break;
        }
    }
    // 투표했던 회원아이디들 중에서 찾아본다
    $search_mb_id = false;
    if ($is_member) {
        $ids = explode("\n", trim($po[mb_ids]));
        for ($i = 0; $i < count($ids); $i++) {
            if ($member[mb_id] == trim($ids[$i])) {
                $search_mb_id = true;
                break;
            }
        }
Example #23
0
<?php

if (!defined('_GNUBOARD_')) {
    exit;
}
// 게시판 관리자 이상 복사, 이동 가능
if ($is_admin != 'board' && $is_admin != 'group' && $is_admin != 'super') {
    alert_close('게시판 관리자 이상 접근이 가능합니다.');
}
if ($sw != 'move' && $sw != 'copy') {
    alert('sw 값이 제대로 넘어오지 않았습니다.');
}
if (!count($_POST['chk_bo_table'])) {
    alert('게시물을 ' . $act . '할 게시판을 한개 이상 선택해 주십시오.', $url);
}
// 원본 파일 디렉토리
$src_dir = G5_DATA_PATH . '/file/' . $bo_table;
$save = array();
$save_count_write = 0;
$save_count_comment = 0;
$cnt = 0;
$sql = " select distinct wr_num from {$write_table} where wr_id in ({$wr_id_list}) order by wr_id ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
    $wr_num = $row['wr_num'];
    for ($i = 0; $i < count($_POST['chk_bo_table']); $i++) {
        $move_bo_table = $_POST['chk_bo_table'][$i];
        $move_write_table = $g5['write_prefix'] . $move_bo_table;
        $src_dir = G5_DATA_PATH . '/file/' . $bo_table;
        // 원본 디렉토리
        $dst_dir = G5_DATA_PATH . '/file/' . $move_bo_table;
Example #24
0
<?php

include_once './_common.php';
if (!$is_member) {
    alert_close("상품문의는 회원만 작성이 가능합니다.");
}
$iq_id = trim($_REQUEST['iq_id']);
$iq_subject = trim($_POST['iq_subject']);
$iq_question = trim($_POST['iq_question']);
$iq_answer = trim($_POST['iq_answer']);
$hash = trim($_REQUEST['hash']);
if ($w == "" || $w == "u") {
    $iq_name = addslashes($member['mb_name']);
    $iq_password = $member['mb_password'];
    if (!$iq_subject) {
        alert("제목을 입력하여 주십시오.");
    }
    if (!$iq_question) {
        alert("질문을 입력하여 주십시오.");
    }
}
if ($is_mobile_shop) {
    $url = './iteminfo.php?it_id=' . $it_id . '&info=qa';
} else {
    $url = "./item.php?it_id={$it_id}&_=" . get_token() . "#sit_qa";
}
if ($w == "") {
    $sql = "insert {$g5['g5_shop_item_qa_table']}\n               set it_id = '{$it_id}',\n                   mb_id = '{$member['mb_id']}',\n                   iq_secret = '{$iq_secret}',\n                   iq_name  = '{$iq_name}',\n                   iq_email = '{$iq_email}',\n                   iq_hp = '{$iq_hp}',\n                   iq_password  = '******',\n                   iq_subject  = '{$iq_subject}',\n                   iq_question = '{$iq_question}',\n                   iq_time = '" . G5_TIME_YMDHIS . "',\n                   iq_ip = '{$REMOTE_ADDR}' ";
    sql_query($sql);
    $alert_msg = '상품문의가 등록 되었습니다.';
} else {
Example #25
0
<?php

include_once "./_common.php";
// 게시판 관리자 이상 복사, 이동 가능
if ($is_admin != 'board' && $is_admin != 'group' && $is_admin != 'super') {
    alert_close("게시판 관리자 이상 접근이 가능합니다.");
}
if ($sw != "move" && $sw != "copy") {
    alert("sw 값이 제대로 넘어오지 않았습니다.");
}
// 원본 파일 디렉토리
$src_dir = "{$g4['path']}/data/file/{$bo_table}";
$save = array();
$save_count_write = 0;
$save_count_comment = 0;
$cnt = 0;
// SQL Injection 으로 인한 코드 보완
//$sql = " select distinct wr_num from $write_table where wr_id in (" . stripslashes($wr_id_list) . ") order by wr_id ";
$sql = " select distinct wr_num from {$write_table} where wr_id in ({$wr_id_list}) order by wr_id ";
$result = sql_query($sql);
while ($row = sql_fetch_array($result)) {
    $wr_num = $row[wr_num];
    for ($i = 0; $i < count($_POST['chk_bo_table']); $i++) {
        $move_bo_table = $_POST['chk_bo_table'][$i];
        $move_write_table = $g4['write_prefix'] . $move_bo_table;
        $src_dir = "{$g4['path']}/data/file/{$bo_table}";
        // 원본 디렉토리
        $dst_dir = "{$g4['path']}/data/file/{$move_bo_table}";
        // 복사본 디렉토리
        $count_write = 0;
        $count_comment = 0;
Example #26
0
function check_itemuse_write($it_id, $mb_id, $close = true)
{
    global $g5, $default, $is_admin;
    if (!$is_admin && $default['de_item_use_write']) {
        $sql = " select count(*) as cnt\n                    from {$g5['g5_shop_cart_table']}\n                    where it_id = '{$it_id}'\n                      and mb_id = '{$mb_id}'\n                      and ct_status = '완료' ";
        $row = sql_fetch($sql);
        if ($row['cnt'] == 0) {
            if ($close) {
                alert_close('사용후기는 주문이 완료된 경우에만 작성하실 수 있습니다.');
            } else {
                alert('사용후기는 주문하신 상품의 상태가 완료인 경우에만 작성하실 수 있습니다.');
            }
        }
    }
}
Example #27
0
}
if (is_file($filepath)) {
    $size = @getimagesize($filepath);
    if (empty($size)) {
        alert_close('이미지 파일이 아닙니다.');
    }
    $width = $size[0];
    $height = $size[1];
    if ($editor_file) {
        $fileurl = G5_DATA_URL . '/' . $editor_file;
    } else {
        $fileurl = G5_DATA_URL . '/file/' . $bo_table . '/' . $filename;
    }
    $img = '<img src="' . $fileurl . '" alt="" width="' . $width . '" height="' . $height . '" class="draggable" style="position:relative;top:0;left:0;cursor:move;">';
} else {
    alert_close('파일이 존재하지 않습니다.');
}
?>

<div><?php 
echo $img;
?>
</div>

<script>
var win_w = <?php 
echo $width;
?>
;
var win_h = <?php 
echo $height;
Example #28
0
<?php

include_once "./_common.php";
@(include_once "{$board_skin_path}/download.head.skin.php");
// 쿠키에 저장된 ID값과 넘어온 ID값을 비교하여 같지 않을 경우 오류 발생
// 다른곳에서 링크 거는것을 방지하기 위한 코드
if (!get_session("ss_view_{$bo_table}_{$wr_id}")) {
    alert("잘못된 접근입니다.");
}
$sql = " select bf_source, bf_file from {$g4['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$no}' ";
$file = sql_fetch($sql);
if (!$file[bf_file]) {
    alert_close("파일 정보가 존재하지 않습니다.");
}
if ($member[mb_level] < $board[bo_download_level]) {
    $alert_msg = "다운로드 권한이 없습니다.";
    if ($member[mb_id]) {
        alert($alert_msg);
    } else {
        alert($alert_msg . "\\n\\n회원이시라면 로그인 후 이용해 보십시오.", "./login.php?wr_id={$wr_id}&{$qstr}&url=" . urlencode("{$g4['bbs_path']}/board.php?bo_table={$bo_table}&wr_id={$wr_id}"));
    }
}
$filepath = "{$g4['path']}/data/file/{$bo_table}/{$file['bf_file']}";
$filepath = addslashes($filepath);
if (!is_file($filepath) || !file_exists($filepath)) {
    alert("파일이 존재하지 않습니다.");
}
// 사용자 코드 실행
@(include_once "{$board_skin_path}/download.skin.php");
// 이미 다운로드 받은 파일인지를 검사한 후 게시물당 한번만 포인트를 차감하도록 수정
$ss_name = "ss_down_{$bo_table}_{$wr_id}";
Example #29
0
$sql = " select count(ad_id) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$rows = $config['cf_page_rows'];
$total_page = ceil($total_count / $rows);
// 전체 페이지 계산
if ($page < 1) {
    $page = 1;
}
// 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows;
// 시작 열을 구함
$sql = " select *\n            {$sql_common}\n            order by ad_default desc, ad_id desc\n            limit {$from_record}, {$rows}";
$result = sql_query($sql);
if (!sql_num_rows($result)) {
    alert_close('배송지 목록 자료가 없습니다.');
}
$list = array();
$sep = chr(30);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
    $list[$i] = $row;
    $list[$i]['addr'] = $row['ad_name'] . $sep . $row['ad_tel'] . $sep . $row['ad_hp'] . $sep . $row['ad_zip1'] . $sep . $row['ad_zip2'] . $sep . $row['ad_addr1'] . $sep . $row['ad_addr2'] . $sep . $row['ad_addr3'] . $sep . $row['ad_jibeon'] . $sep . $row['ad_subject'];
    $list[$i]['addr'] = get_text($list[$i]['addr']);
    $list[$i]['ad_name'] = get_text($list[$i]['ad_name']);
    $list[$i]['ad_subject'] = get_text($list[$i]['ad_subject']);
    $list[$i]['del_href'] = $_SERVER['SCRIPT_NAME'] . '?w=d&amp;ad_id=' . $row['ad_id'];
    $list[$i]['print_addr'] = print_address($row['ad_addr1'], $row['ad_addr2'], $row['ad_addr3'], $row['ad_jibeon']);
}
$action_url = G5_HTTPS_SHOP_URL . '/orderaddressupdate.php';
$write_pages = G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'];
$list_page = $_SERVER['SCRIPT_NAME'] . '?' . $qstr . '&amp;page=';
Example #30
0
        for ($i = 0; $row = sql_fetch_array($result); $i++) {
            $auth[$row['au_menu']] = $row['au_auth'];
        }
        if (!$i) {
            alert('최고관리자 또는 관리권한이 있는 회원만 접근 가능합니다.', G5_URL);
        }
    }
}
// 관리자의 아이피, 브라우저와 다르다면 세션을 끊고 관리자에게 메일을 보낸다.
$admin_key = md5($member['mb_datetime'] . $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']);
if (get_session('ss_mb_key') !== $admin_key) {
    session_destroy();
    include_once G5_LIB_PATH . '/mailer.lib.php';
    // 메일 알림
    mailer($member['mb_nick'], $member['mb_email'], $member['mb_email'], 'XSS 공격 알림', $_SERVER['REMOTE_ADDR'] . ' 아이피로 XSS 공격이 있었습니다.\\n\\n관리자 권한을 탈취하려는 접근이므로 주의하시기 바랍니다.\\n\\n해당 아이피는 차단하시고 의심되는 게시물이 있는지 확인하시기 바랍니다.\\n\\n' . G5_URL, 0);
    alert_close('정상적으로 로그인하여 접근하시기 바랍니다.');
}
@ksort($auth);
// 가변 메뉴
unset($auth_menu);
unset($menu);
unset($amenu);
$tmp = dir(G5_ADMIN_PATH);
while ($entry = $tmp->read()) {
    if (!preg_match('/^admin.menu([0-9]{3}).*\\.php$/', $entry, $m)) {
        continue;
    }
    // 파일명이 menu 으로 시작하지 않으면 무시한다.
    $amenu[$m[1]] = $entry;
    include_once G5_ADMIN_PATH . '/' . $entry;
}