mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Fix #2145 rename $is_admin to more descriptive variable name in some controller actions
This commit is contained in:
parent
71e4118bd5
commit
26f923d64b
3 changed files with 18 additions and 18 deletions
|
|
@ -920,11 +920,11 @@ class CommentController extends Comment
|
|||
/**
|
||||
* Fix the comment
|
||||
* @param object $obj
|
||||
* @param bool $is_admin
|
||||
* @param bool $skip_grant_check
|
||||
* @param bool $manual_updated
|
||||
* @return object
|
||||
*/
|
||||
function updateComment($obj, $is_admin = FALSE, $manual_updated = FALSE)
|
||||
function updateComment($obj, $skip_grant_check = FALSE, $manual_updated = FALSE)
|
||||
{
|
||||
if(!$manual_updated && !checkCSRF())
|
||||
{
|
||||
|
|
@ -971,7 +971,7 @@ class CommentController extends Comment
|
|||
}
|
||||
|
||||
// check if permission is granted
|
||||
if(!$is_admin && !$source_obj->isGranted())
|
||||
if(!$skip_grant_check && !$source_obj->isGranted())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
|
@ -1058,10 +1058,10 @@ class CommentController extends Comment
|
|||
/**
|
||||
* Fix comment the delete comment message
|
||||
* @param object $obj
|
||||
* @param bool $is_admin
|
||||
* @param bool $skip_grant_check
|
||||
* @return object
|
||||
*/
|
||||
function updateCommentByDelete($obj, $is_admin = FALSE)
|
||||
function updateCommentByDelete($obj, $skip_grant_check = FALSE)
|
||||
{
|
||||
if (!$obj->comment_srl)
|
||||
{
|
||||
|
|
@ -1074,7 +1074,7 @@ class CommentController extends Comment
|
|||
{
|
||||
return new BaseObject(-1, 'msg_not_founded');
|
||||
}
|
||||
if(!$is_admin && !$comment->isGranted())
|
||||
if(!$skip_grant_check && !$comment->isGranted())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
|
@ -1087,7 +1087,7 @@ class CommentController extends Comment
|
|||
}
|
||||
|
||||
// If the case manager to delete comments, it indicated that the administrator deleted.
|
||||
if($is_admin === true && $obj->member_srl !== $this->user->member_srl)
|
||||
if($obj->member_srl !== $this->user->member_srl && $this->user->member_srl)
|
||||
{
|
||||
$obj->content = lang('msg_admin_deleted_comment');
|
||||
$obj->status = RX_STATUS_DELETED_BY_ADMIN;
|
||||
|
|
|
|||
|
|
@ -1236,12 +1236,12 @@ class DocumentController extends Document
|
|||
/**
|
||||
* Deleting Documents
|
||||
* @param int $document_srl
|
||||
* @param bool $is_admin
|
||||
* @param bool $skip_grant_check
|
||||
* @param bool $isEmptyTrash
|
||||
* @param documentItem $oDocument
|
||||
* @return object
|
||||
*/
|
||||
function deleteDocument($document_srl, $is_admin = false, $isEmptyTrash = false, $oDocument = null)
|
||||
function deleteDocument($document_srl, $skip_grant_check = false, $isEmptyTrash = false, $oDocument = null)
|
||||
{
|
||||
// Call a trigger (before)
|
||||
$trigger_obj = new stdClass();
|
||||
|
|
@ -1253,7 +1253,7 @@ class DocumentController extends Document
|
|||
// Check if the document exists
|
||||
if(!$isEmptyTrash)
|
||||
{
|
||||
$oDocument = DocumentModel::getDocument($document_srl, $is_admin);
|
||||
$oDocument = DocumentModel::getDocument($document_srl);
|
||||
}
|
||||
else if($isEmptyTrash && $oDocument == null)
|
||||
{
|
||||
|
|
@ -1265,7 +1265,7 @@ class DocumentController extends Document
|
|||
{
|
||||
return new BaseObject(-1, 'msg_invalid_document');
|
||||
}
|
||||
if(!$oDocument->isGranted())
|
||||
if(!$skip_grant_check && !$oDocument->isGranted())
|
||||
{
|
||||
return new BaseObject(-1, 'msg_not_permitted');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2883,9 +2883,9 @@ class MemberController extends Member
|
|||
/**
|
||||
* Modify member information
|
||||
*
|
||||
* @param bool $is_admin , modified 2013-11-22
|
||||
* @param bool $deprecated_allow_update_other
|
||||
*/
|
||||
function updateMember($args, $is_admin = FALSE)
|
||||
function updateMember($args, $deprecated_allow_update_other = FALSE)
|
||||
{
|
||||
// Call a trigger (before)
|
||||
$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
|
||||
|
|
@ -2912,14 +2912,14 @@ class MemberController extends Member
|
|||
unset($args->is_admin);
|
||||
unset($args->limit_date);
|
||||
unset($args->description);
|
||||
if($is_admin == false)
|
||||
if (!$deprecated_allow_update_other)
|
||||
{
|
||||
unset($args->denied);
|
||||
unset($args->status);
|
||||
}
|
||||
if($logged_info->member_srl != $args->member_srl && $is_admin == false)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
if ($logged_info->member_srl != $args->member_srl)
|
||||
{
|
||||
return new BaseObject(-1, 'msg_invalid_request');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue