#17154543 : restrict users to write an article if the user does not have enough point

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5170 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2008-12-23 16:23:25 +00:00
parent 3b4eb75c2d
commit df36ec4ccd
9 changed files with 39 additions and 10 deletions

View file

@ -328,6 +328,25 @@
// 글을 수정하려고 할 경우 권한이 없는 경우 비밀번호 입력화면으로
if($oDocument->isExists()&&!$oDocument->isGranted()) return $this->setTemplateFile('input_password_form');
if(!$oDocument->isExists())
{
$oModuleModel = &getModel('module');
$point_config = $oModuleModel->getModulePartConfig('point',$this->module_srl);
$logged_info = Context::get('logged_info');
$oPointModel = &getModel('point');
$pointForInsert = $point_config["insert_document"];
if($pointForInsert < 0)
{
if( !$logged_info )
{
return $this->dispBoardMessage('msg_not_permitted');
}
else if (($oPointModel->getPoint($logged_info->member_srl) + $pointForInsert )< 0 )
{
return $this->dispBoardMessage('msg_not_enough_point');
}
}
}
Context::set('document_srl',$document_srl);
Context::set('oDocument', $oDocument);