mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 03:52:15 +09:00
#615 게시물 등록시 srl 변경 시키는 문제 수정
This commit is contained in:
parent
11adcfb4fb
commit
36980e4d5f
4 changed files with 47 additions and 1 deletions
|
|
@ -236,7 +236,46 @@ function executeQueryArray($query_id, $args = NULL, $arg_columns = NULL)
|
||||||
function getNextSequence()
|
function getNextSequence()
|
||||||
{
|
{
|
||||||
$oDB = DB::getInstance();
|
$oDB = DB::getInstance();
|
||||||
return $oDB->getNextSequence();
|
$seq = $oDB->getNextSequence();
|
||||||
|
setUserSequence($seq);
|
||||||
|
return $seq;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set Sequence number to session
|
||||||
|
*
|
||||||
|
* @param int $seq sequence number
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function setUserSequence($seq)
|
||||||
|
{
|
||||||
|
$arr_seq = array();
|
||||||
|
if(isset($_SESSION['seq']))
|
||||||
|
{
|
||||||
|
$arr_seq = $_SESSION['seq'];
|
||||||
|
}
|
||||||
|
$arr_seq[] = $seq;
|
||||||
|
$_SESSION['seq'] = $arr_seq;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check Sequence number grant
|
||||||
|
*
|
||||||
|
* @param int $seq sequence number
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
function checkUserSequence($seq)
|
||||||
|
{
|
||||||
|
if(!isset($_SESSION['seq']))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if(!in_array($seq, $_SESSION['seq']))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -300,6 +300,10 @@ class commentController extends comment
|
||||||
{
|
{
|
||||||
$obj->comment_srl = getNextSequence();
|
$obj->comment_srl = getNextSequence();
|
||||||
}
|
}
|
||||||
|
elseif(!checkUserSequence($obj->comment_srl))
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_not_permitted');
|
||||||
|
}
|
||||||
|
|
||||||
// determine the order
|
// determine the order
|
||||||
$obj->list_order = getNextSequence() * -1;
|
$obj->list_order = getNextSequence() * -1;
|
||||||
|
|
|
||||||
|
|
@ -234,6 +234,7 @@ class documentController extends document
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
// Register it if no given document_srl exists
|
// Register it if no given document_srl exists
|
||||||
if(!$obj->document_srl) $obj->document_srl = getNextSequence();
|
if(!$obj->document_srl) $obj->document_srl = getNextSequence();
|
||||||
|
elseif(!checkUserSequence($obj->document_srl)) return new Object(-1, 'msg_not_permitted');
|
||||||
|
|
||||||
$oDocumentModel = getModel('document');
|
$oDocumentModel = getModel('document');
|
||||||
// Set to 0 if the category_srl doesn't exist
|
// Set to 0 if the category_srl doesn't exist
|
||||||
|
|
|
||||||
|
|
@ -493,6 +493,8 @@ class editorModel extends editor
|
||||||
$oEditorController->deleteSavedDoc(false);
|
$oEditorController->deleteSavedDoc(false);
|
||||||
$oEditorController->doSaveDoc($saved_doc);
|
$oEditorController->doSaveDoc($saved_doc);
|
||||||
|
|
||||||
|
setUserSequence($saved_doc->document_srl);
|
||||||
|
|
||||||
return $saved_doc;
|
return $saved_doc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue