19 $avatarId = $this->
getAction()->getArguments()[
'avatarId'];
20 $avatarResult = \CFile::GetByID($avatarId);
21 $avatar = (isset($avatarResult) && $avatarResult) ? $avatarResult->Fetch() :
null;
22 $info = (
new Image($_SERVER[
"DOCUMENT_ROOT"] . $avatar[
'SRC']))->getInfo();
29 return new EventResult(EventResult::ERROR,
null,
null, $this);
32 $currentUser = $this->
getAction()->getCurrentUser();
33 $userId = isset($currentUser) ? $currentUser->getId() :
null;
34 $securityContext =
new DiskSecurityContext((
int)$userId);
36 'filter' => [
'FILE_ID' => $avatarId],
37 'with' => [
'CREATE_USER']
39 $parameters = Driver::getInstance()->getRightsManager()->addRightsCheck($securityContext, $parameters, [
'ID',
'CREATED_BY']);
41 $fileCollection = File::getModelList($parameters);
45 'File is not accessible',
48 return new EventResult(EventResult::ERROR,
null,
null, $this);