git-svn-id: http://xe-core.googlecode.com/svn/trunk@1638 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-06-18 04:25:01 +00:00
parent 6cb227b8cf
commit 248fb7b786
2 changed files with 15 additions and 17 deletions

View file

@ -186,6 +186,7 @@
function procBoardVerificationPassword() {
// 비밀번호와 문서 번호를 받음
$password = md5(Context::get('password'));
$document_srl = Context::get('document_srl');
$comment_srl = Context::get('comment_srl');
@ -194,26 +195,23 @@
// 문서번호에 해당하는 글이 있는지 확인
$oCommentModel = &getModel('comment');
$data = $oCommentModel->getComment($comment_srl);
// comment_srl이 없으면 문서가 대상
} else {
// 문서번호에 해당하는 글이 있는지 확인
$oDocumentModel = &getModel('document');
$data = $oDocumentModel->getDocument($document_srl);
}
if(!$data) return new Object(-1, 'msg_invalid_request');
// 글이 없을 경우 에러
if(!$data) return new Object(-1, 'msg_invalid_request');
// 문서의 비밀번호와 입력한 비밀번호의 비교
if($data->password != $password) return new Object(-1, 'msg_invalid_password');
// 문서의 비밀번호와 입력한 비밀번호의 비교
if($data->password != $password) return new Object(-1, 'msg_invalid_password');
// 해당 글에 대한 권한 부여
if($comment_srl) {
$oCommentController = &getController('comment');
$oCommentController->addGrant($comment_srl);
} else {
$oDocumentController = &getController('document');
$oDocumentController->addGrant($document_srl);
// 문서번호에 해당하는 글이 있는지 확인
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
if(!$oDocument->isExists()) return new Object(-1, 'msg_invalid_request');
// 문서의 비밀번호와 입력한 비밀번호의 비교
if($oDocument->get('password') != $password) return new Object(-1, 'msg_invalid_password');
$oDocument->setGrant();
}
}

View file

@ -50,7 +50,7 @@
}
function isGranted() {
if($_SESSION['own_attribute'][$this->document_srl]) return true;
if($_SESSION['own_document'][$this->document_srl]) return true;
if(!Context::get('is_logged')) return false;
@ -64,7 +64,7 @@
}
function setGrant() {
$_SESSION['own_attribute'][$this->document_srl] = true;
$_SESSION['own_document'][$this->document_srl] = true;
}
function allowComment() {