uawdijnntqw1x1x1
IP : 216.73.216.180
Hostname : xhost1.intravision.ru
Kernel : Linux xhost1.intravision.ru 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
files
/
need-2-delete
/
.
/
mini-borishof.ru1
/
bitrix
/
modules
/
forum
/
lib
/
comments
/
taskentity.php
/
/
<?php namespace Bitrix\Forum\Comments; use Bitrix\Main\Config\Option; use Bitrix\Main\Loader; final class TaskEntity extends Entity { const ENTITY_TYPE = 'tk'; const MODULE_ID = 'tasks'; const XML_ID_PREFIX = 'TASK_'; private $taskPostData; private $hasAccess; protected static $permissions = array(); /** * @var integer $userId User Id. * @return bool */ public function canRead($userId) { // you are not allowed to view the task, so you can not read messages if(!$this->checkHasAccess($userId)) { return false; } return true; } /** * @var integer $userId User Id. * @return bool */ public function canAdd($userId) { // you are not allowed to view the task, so you can not add new messages if(!$this->checkHasAccess($userId)) { return false; } return true; } /** * @var integer $userId User Id. * @return bool */ public function canEditOwn($userId) { //!!! // in case of canEdit($userId) returns FALSE, canEditOwn($userId) may override this // if you are not an admin, you must obey "tasks" module settings if(!static::checkEditOptionIsOn()) { return false; } // if you are not an admin AND you are not allowed to view the task, you cant edit even your own comments if(!$this->checkHasAccess($userId)) { return false; } return true; } /** * @var integer $userId User Id. * @return bool */ public function canEdit($userId) { // admin is always able to edit\remove comments if ( Loader::includeModule("tasks") && ( \CTasksTools::isAdmin($userId) || \CTasksTools::isPortalB24Admin($userId) ) ) { return true; } return false; } /** * @return $this */ public function dropCache() { $this->taskPostData = null; $this->hasAccess = null; return $this; } /** * @param integer $userId User id. * @return bool */ private function checkHasAccess($userId) { if($this->hasAccess === null) { try { if (Loader::includeModule("tasks")) { $task = new \CTaskItem($this->getId(), $userId); $this->hasAccess = $task->checkCanRead(); } else { return false; } } catch(\TasksException $e) { return false; } } return $this->hasAccess; } private static function checkEditOptionIsOn() { $value = Option::get("tasks", "task_comment_allow_edit"); return $value == 'Y' || $value == '1'; } /** * Event before indexing message. * @param integer $id Message ID. * @param array $message Message data. * @param array &$index Search index array. * @return boolean */ public static function onMessageIsIndexed($id, array $message, array &$index) { if (!empty($message["PARAM1"]) || !empty($message["PARAM2"])) return false; if ( preg_match("/".self::getXmlIdPrefix()."(\\d+)/", $message["XML_ID"], $matches) && ($taskId = intval($matches[1])) && $taskId > 0 ) { if (!array_key_exists($taskId, self::$permissions)) { $task = \CTasks::GetList(array(), array("ID" => $taskId))->fetch(); self::$permissions[$taskId] = \CTasks::__GetSearchPermissions($task); } $index["PERMISSIONS"] = self::$permissions[$taskId]; } return true; } }
/var/files/need-2-delete/./mini-borishof.ru1/bitrix/modules/forum/lib/comments/taskentity.php