mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Fix #1513 while taking advantage of session cache
This commit is contained in:
parent
3e7f2e291c
commit
5fa290aaf1
2 changed files with 8 additions and 5 deletions
|
|
@ -1651,8 +1651,8 @@ class documentController extends document
|
|||
*/
|
||||
function declaredDocument($document_srl, $declare_message = '')
|
||||
{
|
||||
// Fail if session information already has a reported document
|
||||
if($_SESSION['declared_document'][$document_srl])
|
||||
// Fail if session already tried to report the document
|
||||
if(isset($_SESSION['declared_document'][$document_srl]))
|
||||
{
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
|
@ -1687,6 +1687,7 @@ class documentController extends document
|
|||
// Pass if the author's IP address is as same as visitor's.
|
||||
if($oDocument->get('ipaddress') == \RX_CLIENT_IP)
|
||||
{
|
||||
$_SESSION['declared_document'][$document_srl] = false;
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
|
|
@ -1699,6 +1700,7 @@ class documentController extends document
|
|||
// Pass after registering a session if author's information is same as the currently logged-in user's.
|
||||
if($member_srl && $member_srl == abs($oDocument->get('member_srl')))
|
||||
{
|
||||
$_SESSION['declared_document'][$document_srl] = false;
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
}
|
||||
|
|
@ -1717,6 +1719,7 @@ class documentController extends document
|
|||
$output = executeQuery('document.getDocumentDeclaredLogInfo', $args);
|
||||
if($output->data->count)
|
||||
{
|
||||
$_SESSION['declared_document'][$document_srl] = false;
|
||||
return new BaseObject(-1, 'failed_declared');
|
||||
}
|
||||
|
||||
|
|
@ -1832,7 +1835,7 @@ class documentController extends document
|
|||
|
||||
if($output->data->count <= 0 || !isset($output->data->count))
|
||||
{
|
||||
$_SESSION['declared_document'][$document_srl] = false;
|
||||
unset($_SESSION['declared_document'][$document_srl]);
|
||||
return new BaseObject(-1, 'failed_declared_cancel');
|
||||
}
|
||||
|
||||
|
|
@ -1908,7 +1911,7 @@ class documentController extends document
|
|||
$trigger_obj->declared_count = $declared_count - 1;
|
||||
ModuleHandler::triggerCall('document.declaredDocumentCancel', 'after', $trigger_obj);
|
||||
|
||||
$_SESSION['declared_document'][$document_srl] = false;
|
||||
unset($_SESSION['declared_document'][$document_srl]);
|
||||
|
||||
$this->setMessage('success_declared_cancel');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ class documentItem extends BaseObject
|
|||
return $_SESSION['declared_document'][$this->document_srl] = $declaredCount;
|
||||
}
|
||||
|
||||
return $_SESSION['declared_document'][$this->document_srl] = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function getTitle($cut_size = 0, $tail = '...')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue