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
2 changes: 2 additions & 0 deletions components/ILIAS/Forum/Forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ public function init(
new Component\Resource\ComponentJS($this, "autosave_forum.js");
$contribute[Component\Resource\PublicAsset::class] = fn() =>
new Component\Resource\ComponentCSS($this, "forum_table.css");
$contribute[\ILIAS\Notifications\Interfaces\PushProviderInterface::class] = static fn() =>
new \ilForumPushProvider();
}
}
3 changes: 2 additions & 1 deletion components/ILIAS/Forum/PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ If an **entire forum** is deleted and the ILIAS "Trash" is active, all personal
## Data being exported

If a **notification about new or changed posts** is set, it will be sent via the ILIAS mail system. For users who have set forwarding to an external e-mail address, the notification will be forwarded to this address. The notification contains the date, title and content of the post, as well as the username or pseudonym of the creator. Depending on the setting, file attachments are also forwarded.
- If push notifcations are active and enabled for the forum a push notification is send instead of a mail. The Notification contains the title of the forum, thread and (if part of the context) post and a link to the thread or post. If the push notification couldnt be delivered a mail is send instead.

New posts can be subscribed to via an **RSS feed** in suitable programs. In the forum, you can set whether this feed is password-protected or public. A public feed contains the title of the forum, the **title, content, creation date** and a link to the post in ILIAS for each post. If the forum itself is not public, you will be taken to the ILIAS login page when you use the link.

To support the **full-text search**, a separate server with the Apache Lucene search engine can be operated for ILIAS. When creating the full-text index for a forum, the content of a manually created start page as well as the title, content and author ID of all topics and posts are retrieved by this server and stored in the index.

ILIAS users can create a **print view** in a forum topic and print it out via the browser. The personal data contained on it corresponds to the normal browser view of the forum topic. ILIAS users with the "Edit Settings" permission for a forum can export an **HTML page** with the content of all forum topics. The personal data contained in it corresponds to the normal browser views of the forum topics.

A forum can be exported from ILIAS in **XML format** by users with the "Edit Settings" permission. This creates a ZIP archive that can then be downloaded and imported into another ILIAS platform. The archive contains all content of the forum, the user IDs of the moderators and authors of posts, as well as the usernames or pseudonyms of the authors.
A forum can be exported from ILIAS in **XML format** by users with the "Edit Settings" permission. This creates a ZIP archive that can then be downloaded and imported into another ILIAS platform. The archive contains all content of the forum, the user IDs of the moderators and authors of posts, as well as the usernames or pseudonyms of the authors.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

declare(strict_types=1);

use ILIAS\BackgroundTasks\Implementation\Bucket\BasicBucket;
use ILIAS\BackgroundTasks\Task\TaskFactory;
use ILIAS\BackgroundTasks\TaskManager;

readonly class ilForumNotificationTaskProcessor
{
private TaskManager $task_manager;
private TaskFactory $task_factory;
private ilLanguage $lng;
private ilLogger $logger;
private ilObjUser $user;

public function __construct(ilLogger $logger)
{
global $DIC;
$this->task_manager = $DIC->backgroundTasks()->taskManager();
$this->task_factory = $DIC->backgroundTasks()->taskFactory();
$this->lng = $DIC->language();
$this->user = $DIC->user();
$this->logger = $logger ;
}

/**
* @param int[] $recipients
*/
public function run(
ilForumNotificationMailData $provider,
int $notification_type,
array $recipients,
): void {
if ($recipients === []) {
return;
}

$push_job = $this->task_factory->createTask(ilForumPushNotificationJob::class, [
json_encode([
'post_id' => $provider->getPostId(),
'ref_id' => $provider->getRefId(),
'notification_type' => $notification_type,
'recipients' => array_values($recipients),
], JSON_THROW_ON_ERROR),
]);
$interaction = $this->task_factory->createTask(
ilMailDeliveryJobUserInteraction::class,
[$push_job, $this->user->getId()],
);

$bucket = new BasicBucket();
$bucket->setUserId($this->user->getId());
$bucket->setTask($interaction);
$this->lng->loadLanguageModule('forum');
$bucket->setTitle($this->lng->txt('frm_notification_bg_task_title'));

$this->logger->info('Delegated forum notification delivery to background task.');
$this->task_manager->run($bucket);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

/**
* This file is part of ILIAS, a powerful learning management system
* published by ILIAS open source e-Learning e.V.
*
* ILIAS is licensed with the GPL-3.0,
* see https://www.gnu.org/licenses/gpl-3.0.en.html
* You should have received a copy of said license along with the
* source code, too.
*
* If this is not the case or you just want to try ILIAS, you'll find
* us at:
* https://www.ilias.de
* https://github.com/ILIAS-eLearning
*
*********************************************************************/

declare(strict_types=1);

use ILIAS\BackgroundTasks\Implementation\Tasks\AbstractJob;
use ILIAS\BackgroundTasks\Implementation\Values\ScalarValues\BooleanValue;
use ILIAS\BackgroundTasks\Implementation\Values\ScalarValues\IntegerValue;
use ILIAS\BackgroundTasks\Implementation\Values\ScalarValues\StringValue;
use ILIAS\BackgroundTasks\Observer;
use ILIAS\BackgroundTasks\Types\SingleType;
use ILIAS\BackgroundTasks\Types\Type;
use ILIAS\BackgroundTasks\Value;

class ilForumPushNotificationJob extends AbstractJob
{
public function run(array $input, Observer $observer): Value
{
global $DIC;

$data = json_decode((string) $input[0]->getValue(), true, 512, JSON_THROW_ON_ERROR);

$provider = new ilForumNotificationDataProvider(
new ilForumPost((int) $data['post_id']),
(int) $data['ref_id'],
new ilForumNotificationCache()
);

$push_provider = new ilForumPushProvider();
$mail_recipients = $push_provider->filterMailRecipients(
$data['recipients'],
$provider,
(int) $data['notification_type'],
$DIC->logger()->forComponent('forum')
);

$output = new BooleanValue();
$output->setValue(true);

if ($mail_recipients !== []) {
$mail_notification = new ilForumMailEventNotificationSender($provider, $DIC->logger()->forComponent('forum'));
$mail_notification->setType((int) $data['notification_type']);
$mail_notification->setRecipients($mail_recipients);
$mail_notification->send();
}

return $output;
}

public function getInputTypes(): array
{
return [
new SingleType(StringValue::class),
];
}

public function getOutputType(): Type
{
return new SingleType(BooleanValue::class);
}

public function isStateless(): bool
{
return true;
}

public function getExpectedTimeOfTaskInSeconds(): int
{
return 30;
}
}
Loading
Loading