protected function FetchByKey($bo_no) { $retult = $this->Sql('fetch_key', $bo_no); if (!$this->board[$retult['bo_id']]) { $this->board[$retult['bo_id']] = $retult; } if (!$this->board[$retult['bo_id']]) { Dialog::Alert('게시판 번호가 잘못 됐습니다.'); } return $this->board[$retult['bo_id']]; }
if($_POST['ca1']) $clear['wr_category'][] = $_POST['ca1']; if($_POST['ca2']) $clear['wr_category'][] = $_POST['ca2']; $clear['wr_category'] = implode('|',$clear['wr_category']); // 회원이면 자신의 회원번호를 입력함 if($this->Config('mb','login')) $clear['mb_no'] = $this->Config('mb','no'); // 기본 정보들 자동입력 $clear['wr_datetime'] = 'NOW()'; $clear['wr_update'] = 'NOW()'; $clear['wr_ip'] = "INET_ATON('".Util::GetRealIPAddr()."')"; $clear['bo_no'] = $bo_no; $key = DB::Get()->InsertEx($tbn, $clear, array('wr_ip','wr_datetime','wr_update')); if(!$key) Dialog::Alert('정확한 정보를 입력하세요.'); // 태그 입력 $tags = $_POST['tags']; if($tags) { Tag::Inst()->Action('insert', $bo_no, $key, array_unique(array_filter(explode(',', $tags)))); } // 파일 업로드 File::Inst()->Action('upload', $key); $url = $this->Link('view', $key); if($clear['wr_is_secret']) $url = $this->Link('list'); Url::GoReplace($url);
<?php if (!defined("__MAGIC__")) { exit; } $m = $this->Sql('fetch', GV::Number($this->KN())); if (Config::Inst()->admin == $m['mb_id']) { Dialog::Alert("최고관리자는 질문 답변으로 비밀번호를 찾을수 없습니다."); } if ($m['mb_answer'] != $_POST['mb_answer']) { Dialog::Alert('답변이 틀렸습니다.'); } else { $new_passwd = ''; for ($i = 0; $i <= 7; $i++) { $new_passwd .= substr('23456789abcdef', rand(0, 13), 1); } $this->Sql('change_password', $m['mb_no'], $new_passwd); // 비밀번호 바꾸고 바뀐 비밀번호 알려주기 Dialog::alertNReplace("임시 비밀번호는 {$new_passwd} 입니다.\n개인정보에서 꼭 비밀번호를 변경하세요.", $this->Link('login')); }
<?php if (!defined("__MAGIC__")) { exit; } $key = GV::Number($this->KN()); $file = $this->Sql('fetch', $key); $path = Path::Group($file['file_path']); // 무단 링크 검사 // 무단링크시에는 hotlink.gif이미지를 뿌려준다. $check_hotlink = GV::String(File::hotlink); if (!$check_hotlink || $_SESSION[File::hotlink] != $check_hotlink) { $path = Path::img('hotlink.gif'); } if (file_exists($path)) { header("content-type: {$file['file_type']}"); header("content-length: " . filesize($path)); header("pragma: no-cache"); header("expires: 0"); flush(); $fp = fopen($path, "rb"); while (!feof($fp)) { echo fread($fp, 100 * 1024); flush(); } fclose($fp); flush(); } else { Dialog::Alert("파일을 찾을 수 없습니다."); } exit;
if (!defined("__MAGIC__")) { exit; } // 게시판 생성 if ($_POST['bo_no'] == '') { $data['bo_subject'] = GV::String('bo_subject'); $_POST['bo_no'] = Board::Inst()->Action('insert_record', $data); unset($_POST['bo_subject']); } if (!$_POST['list_view']) { $_POST['list_view'] = 0; } if (!$_POST['show_notice']) { $_POST['show_notice'] = 0; } if (!$_POST['use_comment']) { $_POST['use_comment'] = 0; } $data = Widget::Inst()->Action('data_implode', $_POST); $key = DB::Get()->InsertEx($this->TBN(), $data); if (!$key) { Dialog::Alert('정확한 정보를 입력하세요.'); } Widget::Inst()->Action('add_widget', $key); ?> <script> window.opener.location.reload(); window.close(); </script> <?php exit;
<?php if (!defined("__MAGIC__")) { exit; } $mb_id = GV::Id('mb_id', 'POST'); if (Config::Inst('config.php')->admin == $mb_id) { Dialog::Alert("최고관리자는 질문 답변으로 비밀번호를 찾을수 없습니다."); } $ret = $this->Sql('fetch_by_id', $mb_id); if (!$ret['mb_question']) { Dialog::alert("비밀번호 찾기 질문을 등록하지 않았습니다.\n질문 답변으로 비밀번호를 찾을수 없습니다.\n관리자에게 문의하세요.", Path::Group()); }
<?php if (!defined("__MAGIC__")) { exit; } $tbn = $this->TBN(); // 테이블명 $clear = $this->Clear(); $r = GV::String('r'); $id1 = GV::String('id1'); $id2 = GV::String('id2'); $clear['bo_admin_path'] = Url::Get(array('r' => $r, 'id1' => $id1, 'id2' => $id2, 'bo_no' => $clear['bo_no'], $this->Mode('name') => 'write')); $this->Action('insert_record', $clear); Dialog::Alert("게시판 추가 완료!", $this->Link('list'));
<?php if (!defined("__MAGIC__")) { exit; } /* * action파일 * action.*.php 파일은 Alert을 호출하지 않고 단순한 하나의 행동을하고 * 결과 값을 알려준다. * $result에 결과값을 저장해 줌 * -------------------------- */ include_once $this->path_view('zmSpamFree.php'); if (!zsfCheck($_POST['zsfCode'])) { Dialog::Alert('스팸차단코드가 틀렸습니다.'); } $result = true;
<?php if (!defined("__MAGIC__")) { exit; } $tbn = $this->TBN(); $key = GV::Number($this->KN()); $tbn_write = Write::Inst()->TBN(); // 게시판의 모든 게시글의 첨부파일 삭제 $sql = "\n\tSELECT wr_no\n\tFROM `{$tbn_write}`\n\tWHERE bo_no='{$key}'\n"; $write_list = DB::Get()->sql_query_list($sql); if (is_array($write_list)) { foreach ($write_list as $k => $v) { // TODO File 클래스의 Board 사용 //$file = new File($board, $v['wr_no']); //$file->DeleteAll(); } } // 게시글 모두 삭제 $sql = "\n\tDELETE FROM `{$tbn_write}` \n\tWHERE bo_no='{$key}'\n"; DB::Get()->sql_query($sql); Dialog::Alert("게시판의 모든 게시글/파일 삭제 완료!", $this->Link('list'));
<?php if (!defined("__MAGIC__")) { exit; } if (!Member::Inst()->Action('is_admin')) { Dialog::Alert("관리자만 접속 가능합니다."); }
if (!defined("__MAGIC__")) { exit; } $wr_no = GV::Number('wr_no'); $cmt_no = GV::Number($this->KN()); $is_admin = $this->Config('mb', 'admin'); if (!$this->Can('delete', $cmt_no)) { Dialog::Alert('삭제 권한이 없습니다.'); } /* * 댓글의 댓글 검사 */ $children = $this->Sql('list_children', $wr_no, $cmt_no); if (sizeof($children) != 0) { Dialog::Alert('댓글이 있어서 삭제할수 없습니다.'); } /* * 비회원 글일경우 * 비밀번호 비교 후 제거 */ $data = $this->Sql('fetch', $cmt_no); if (!$is_admin && $data['mb_no'] == 0) { $password = GV::Password('password', 'post'); if ($password) { $password = $this->Sql('password', $password); } if ($password != $data['cmt_password']) { $this->state = 'password'; } }
* 로그인이 되어 있지 않을때 * 회원가입, 비밀번호찾기, 로그인 */ if (!$this->Action('is_login')) { // 회원가입 if ($mode == 'regist') { // 회원약관 동의 확인 if (!$_POST['terms'] || !$_POST['privacy']) { $state = 'agreement'; // 회원 약관 동의값이 없을시 가입약관 출력 } } /* * 로그인이 되어 있을때 * 회원정보보기, 정보수정, 비번수정, 회원탈퇴, 로그아웃, 비밀번호 체크 */ } else { $m = $this; // 회원정보 보기와 로그아웃이 아닌 로그인 후의 모든 동작은 비밀번호 체크 과정을 거친다. if ($mode != 'view' && $mode != 'logout') { // 회원 비밀번호 체크 $passwd = $this->Sql('password', $_POST['passwd']); if (!$passwd) { $state = 'check'; } else { if ($m->mb_passwd != $passwd) { Dialog::Alert("비밀번호를 잘못 입력 하셨습니다."); } } } }