Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/db/db_event_handler.php
Show First 20 Lines • Show All 552 Lines • ▼ Show 20 Line(s) | |||||
$skip_autoload = $event->getEventParam('skip_autoload'); | $skip_autoload = $event->getEventParam('skip_autoload'); | ||||
if ( $auto_load && !$skip_autoload ) { | if ( $auto_load && !$skip_autoload ) { | ||||
$perm_status = true; | $perm_status = true; | ||||
$user_id = $this->Application->InitDone ? $this->Application->RecallVar('user_id') : USER_ROOT; | $user_id = $this->Application->InitDone ? $this->Application->RecallVar('user_id') : USER_ROOT; | ||||
$event->setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix, true)); | $event->setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix, true)); | ||||
$status_checked = false; | $status_checked = false; | ||||
if ( $user_id == USER_ROOT || $this->CheckPermission($event) ) { | if ( $this->Application->permissionCheckingDisabled($user_id) || $this->CheckPermission($event) ) { | ||||
// don't autoload item, when user doesn't have view permission | // Don't autoload item, when user doesn't have view permission. | ||||
$this->LoadItem($event); | $this->LoadItem($event); | ||||
$status_checked = true; | $status_checked = true; | ||||
$editing_mode = defined('EDITING_MODE') ? EDITING_MODE : false; | $editing_mode = defined('EDITING_MODE') ? EDITING_MODE : false; | ||||
$id_from_request = $event->getEventParam(kEvent::FLAG_ID_FROM_REQUEST); | $id_from_request = $event->getEventParam(kEvent::FLAG_ID_FROM_REQUEST); | ||||
if ( $user_id != USER_ROOT | if ( !$this->Application->permissionCheckingDisabled($user_id) | ||||
&& !$this->Application->isAdmin | && !$this->Application->isAdmin | ||||
&& !($editing_mode || ($id_from_request ? $this->checkItemStatus($event) : true)) | && !($editing_mode || ($id_from_request ? $this->checkItemStatus($event) : true)) | ||||
) { | ) { | ||||
// non-root user AND on front-end AND (not editing mode || incorrect status) | // Permissions are being checked AND on Front-End AND (not editing mode || incorrect status). | ||||
$perm_status = false; | $perm_status = false; | ||||
} | } | ||||
} | } | ||||
else { | else { | ||||
$perm_status = false; | $perm_status = false; | ||||
} | } | ||||
if ( !$perm_status ) { | if ( !$perm_status ) { | ||||
▲ Show 20 Lines • Show All 2899 Lines • Show Last 20 Lines |