Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions classes/class.ilMultiVcConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,15 @@ public static function removeUnsafeChars(string $value): string
return trim($value);
}

public static function hasConnectionType(string $showcontent): bool
{
global $DIC;
$ilDB = $DIC->database();

$result = $ilDB->query("SELECT showcontent FROM rep_robj_xmvc_conn where showcontent = " . $ilDB->quote($showcontent, 'text'));
$row = $ilDB->fetchAssoc($result);
return !(null === $row);
}



Expand Down
5 changes: 5 additions & 0 deletions classes/class.ilMultiVcPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ public function handleEvent(string $a_component, string $a_event, array $a_param
{
global $DIC;

if (!ilMultiVcConfig::hasConnectionType('teams')) { return ; }

$logger = $DIC->logger()->root();
$tree = $DIC->repositoryTree();

switch ($a_component) {
case "Modules/Course":
Expand All @@ -78,6 +81,8 @@ public function handleEvent(string $a_component, string $a_event, array $a_param

foreach ($ref_ids as $ref_id) {
$logger->debug('MultiVc: ' . $a_event . ' for RefId = ' . $ref_id . ' and UserId = ' . $a_parameter['usr_id']);
if ($tree->isDeleted($ref_id)) { continue; }

//todo cache?
$xmvc_ref_ids = $DIC->repositoryTree()->getSubTree(
$DIC->repositoryTree()->getNodeData($ref_id),
Expand Down