25 if (strpos($ilWACPath->
getPath(),
'..') !==
false) {
29 if (!preg_match(
'@ilBadge\/(\d+\/)*?badge(tmpl)?_(\d+)\/@ui', $ilWACPath->
getPath())) {
39 $has_global_badge_administration_access = (
41 $DIC->rbac()->system()->checkAccessOfUser($DIC->user()->getId(),
'read', $admin_ref_id)
44 if (preg_match(
'@\/badgetmpl_(\d+)\/@ui', $ilWACPath->
getPath())) {
46 return $has_global_badge_administration_access;
49 if (preg_match(
'@\/badge_(\d+)\/@ui', $ilWACPath->
getPath(), $matches)) {
50 if ($has_global_badge_administration_access) {
54 $badge_id = (
int) $matches[1];
69 bool $has_global_badge_administration_access
72 $badge =
new ilBadge($badge_id);
73 if ($badge->getParentId() > 0) {
78 if (!$badge_handler->isObjectActive((
int) $badge->getParentId())) {
83 if (!($context_ref_id > 0)) {
87 $context_ref_id = (
int) $context_ref_id;
88 if ($DIC->repositoryTree()->isGrandChild((
int)
SYSTEM_FOLDER_ID, $context_ref_id)) {
89 $has_access = $has_global_badge_administration_access;
91 $has_access = $DIC->access()->checkAccessOfUser(
92 $DIC->user()->getId(),
106 foreach ($badges_of_user as $user_badge) {
107 if ((
int) $user_badge->getBadgeId() === $badge_id) {
119 foreach ($assignments as $assignment) {
120 if (!$assignment->getPosition()) {
129 $profile_visibility = $user->getPref(
'public_profile');
130 if ($profile_visibility ===
'g' || ($profile_visibility ===
'y' && !$DIC->user()->isAnonymous())) {
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getObjectsByType(string $obj_type="", ?int $owner=null)
static getInstancesByUserId(int $a_user_id)
Interface Observer Contains several chained tasks and infos about them.
static _getAllReferences(int $id)
get all reference ids for object ID
hasAccessToBadgeParentIdNode(\ILIAS\DI\Container $DIC, int $badge_id, bool $has_global_badge_administration_access)
isAssignedBadge(\ILIAS\DI\Container $DIC, int $badge_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
isAssignedBadgeOfPublishedUserProfile(\ILIAS\DI\Container $DIC, int $badge_id)
static getInstancesByBadgeId(int $a_badge_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
canBeDelivered(ilWACPath $ilWACPath)