mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Show proper 404 page when trying to access a document that is not public #2659
This commit is contained in:
parent
70a25057f0
commit
15f9f6a7bd
1 changed files with 10 additions and 13 deletions
|
|
@ -313,37 +313,34 @@ class BoardView extends Board
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the consultation function is enabled, and the document is not a notice
|
// if the consultation function is enabled, only the author can read the document.
|
||||||
if($this->consultation && !$oDocument->isNotice())
|
if($this->consultation && !$oDocument->isNotice())
|
||||||
{
|
{
|
||||||
$logged_info = Context::get('logged_info');
|
if (abs($oDocument->get('member_srl')) != $this->user->member_srl)
|
||||||
if(abs($oDocument->get('member_srl')) != $logged_info->member_srl)
|
|
||||||
{
|
{
|
||||||
$oDocument = DocumentModel::getDocument(0);
|
Context::set('document_srl', null, true);
|
||||||
|
$this->dispBoardMessage('msg_not_founded', 404);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the document is TEMP saved, check Grant
|
// if the document is TEMP saved, pretend that it doesn't exist.
|
||||||
if($oDocument->getStatus() == 'TEMP')
|
if($oDocument->getStatus() == 'TEMP')
|
||||||
{
|
{
|
||||||
if(!$oDocument->isGranted())
|
Context::set('document_srl', null, true);
|
||||||
{
|
$this->dispBoardMessage('msg_not_founded', 404);
|
||||||
$oDocument = DocumentModel::getDocument(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// if the document is not existed, then alert a warning message
|
// if the document does not exist, then display a warning message.
|
||||||
Context::set('document_srl', null, true);
|
Context::set('document_srl', null, true);
|
||||||
$this->dispBoardMessage('msg_not_founded', 404);
|
$this->dispBoardMessage('msg_not_founded', 404);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* if the document is not existed, get an empty document
|
* if the document is not existed, get an empty document
|
||||||
*/
|
*/
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$oDocument = DocumentModel::getDocument(0);
|
$oDocument = DocumentModel::getDocument(0);
|
||||||
|
|
@ -351,7 +348,7 @@ class BoardView extends Board
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*check the document view grant
|
* Check the document view grant
|
||||||
*/
|
*/
|
||||||
if($oDocument->isExists())
|
if($oDocument->isExists())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue