// ÀÛ¼ºÀÚ : ÃÖ»ó¹Î // ¼öÁ¤ÀÏ : 2002³â 3¿ù 3ÀÏ // ÆÄÀϸí : boardEdit.html // °Ô½ÃÆÇ ±Û ¼öÁ¤ include ("../inc/header.html"); // Çì´õ include ("../common/dbConnect.php"); // Ä¿³Ø¼Ç Æ÷ÇÔ include("boardInfo.php"); // °Ô½ÃÆÇ Á¤º¸ Æ÷ÇÔ include("../common/pageSkip.php"); // ÆäÀÌÁö ½ºÅµ°ü·Ã Æ÷ÇÔ include("../common/common.php"); // °øÅëÇÔ¼ö Æ÷ÇÔ include("./inc/header.html"); // °Ô½ÃÆÇ°ªÀÌ ¾øÀ»°æ¿ì ±âº»°Ô½ÃÆÇÀ» °¡Á®¿Â´Ù. ±×°Íµµ ¾øÀ½..¿¡·¯Áö ¸ð if($boardID == "") $boardID = "freeboard"; if($no == "") alert("¼öÁ¤ÇÒ °Ô½Ã¹° ¹øÈ£°¡ ¾ø½À´Ï´Ù.", 2); // °Ô½ÃÆÇ Á¤º¸ ÃßÃâ $info = new boardInfo($boardID); // °Ô½ÃÆÇ °øÅëÇÔ¼ö Æ÷ÇÔ include("boardCommon.php"); // °Ô½ÃÆÇ Á¦ÇÑ boardPermission("W"); function modify() { global $mode, $memberID, $writer, $password, $subject, $email, $homepage, $content, $enableHtml, $readLock, $info, $boardID, $conn, $no, $oldFile, $file, $file_name, $file_size, $file_type, $fileType, $fileName, $fileSize, $memberLevel; if ($mode != "modify") return; if($no == "") { alert("¼öÁ¤ÇÒ °Ô½Ã¹° ¹øÈ£°¡ ¾ø½À´Ï´Ù.", 2); return; } if($writer == "") { alert("ÀÛ¼ºÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä", 1); return; } if($subject == "") { alert("Á¦¸ñÀ» ÀÔ·ÂÇϼ¼¿ä", 1); return; } if($content == "") { alert("³»¿ëÀ» ÀÔ·ÂÇϼ¼¿ä", 1); return; } $flag = true; // °ü¸®ÀÚ Ã¼Å© if($memberID != $info->getAdmin() && $memberLevel < 10) { if($password == "") { alert("ÆÐ½º¿öµå¸¦ ÀÔ·ÂÇϼ¼¿ä", 1); return; } // ȸ¿øÁ¦ ¿©ºÎ üũ switch($info->getLimitWrite()) { case "A": case "M": $password = md5($memberID); $query = "select count(no) from $boardID where mId='$memberID' and password='$password'"; $count = mysql_result($conn->runQuery($query), 0, 0); if($count == 0) { alert("º»ÀÎÀÇ ±Û¸¸ ¼öÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.", 1); $flag = false; } break; case "N": $password =md5($password); $query = "select count(no) from $boardID where no=$no and password='$password'"; $count = mysql_result($conn->runQuery($query), 0, 0); if($count == 0) { alert("ÆÐ½º¿öµå°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.", 1); $flag = false; } break; } } if($flag == true) { // ÆÄÀÏ÷ºÎ üũ if($info->getLimitAttach() == "Y" && $file != "none") { $fileSize = ""; $fileName = ""; $fileType = ""; fileUpload(); if($oldFile != "") fileDelete($oldFile); $query = "update $boardID set writer='$writer', email='$email', homepage='$homepage', subject='$subject', content='$content', "; $query .= "enableHtml='$enableHtml', readLock='$readLock', attachName= '$fileName', attachSize='$fileSize', attachType='$fileType' where no=$no"; } else { $query = "update $boardID set writer='$writer', email='$email', homepage='$homepage', subject='$subject', content='$content', "; $query .= "enableHtml='$enableHtml', readLock='$readLock' where no=$no"; } // Äõ¸® ½ÇÇà $conn->runQuery("lock tables $boardID update"); $conn->runQuery($query); $conn->runQuery("unlock tables"); echo ""; exit(); } } function printTable() { global $width, $align, $boardID, $no, $info, $conn, $secret, $memberID, $memberName, $memberEmail, $memberHomepage, $info; // °Ô½Ã¹° Á¤º¸ ÃßÃâ $query = "select * from $boardID where no=$no"; $result = $conn->runQuery($query); $rows = mysql_fetch_array($result); $subject = $rows[subject]; $content = $rows[content]; $writer = $rows[writer]; $email = $rows[email]; $homepage = $rows[homepage]; $enableHtml = $rows[enableHtml]; $attachName = $rows[attachName]; $readLock = $rows[readLock]; $readLock2 = "Y"; if($secret != "") { // ÆÐ½º¿öµå ºñ±³ $secret =md5($secret); $query = "select count(no) from $boardID where no=$no and password='$secret'"; $count = mysql_result($conn->runQuery($query), 0, 0); if($count == 0) alert("ÆÐ½º¿öµå°¡ ÀÏÄ¡ÇÏÁö ¾Ê½À´Ï´Ù.", 1); else $readLock2 = "N"; } switch($info->getLimitRead()) { case "A": case "M": if($mID != $memberID && $readLock == "Y") { alert("Àá°ÜÁø ±ÛÀÔ´Ï´Ù. ÀÛ¼ºÀÚ¿Í °ü¸®ÀÚ¿Ü¿¡´Â º¼ ¼ö ¾ø½À´Ï´Ù.", 2); } break; case "N": if($info->getLimitWrite() != "N" && $readLock == "Y") { if($mID != $memberID && !adminCheck($memberID)) alert("Àá°ÜÁø ±ÛÀÔ´Ï´Ù. ÀÛ¼ºÀÚ¿Í °ü¸®ÀÚ¿Ü¿¡´Â º¼ ¼ö ¾ø½À´Ï´Ù.", 2); } else if ($readLock == "Y" && $readLock2 == "Y") { echo "