19 declare(strict_types=1);
44 public const ID =
'dpro';
54 public function id(): string
61 $blocks =
new Blocks($this->
id(), $this->container, $provide);
62 $default = $blocks->defaultMappings();
63 $global_settings =
new Settings($blocks->selectSettingsFrom($blocks->readOnlyStore($blocks->globalStore())));
64 $is_active = $global_settings->enabled()->value();
66 $blocks->selectSettingsFrom($blocks->userStore($user))
68 $public_api =
new PublicApi($is_active, $build_user);
69 $slot = $slot->
hasDocuments($default->contentAsComponent(), $default->conditionDefinitions())
71 ->hasPublicApi($public_api);
74 return $slot->
hasPublicPage($blocks->notAvailable(...), self::GOTO_NAME);
77 $user = $build_user($this->container->user());
81 $agreement = $blocks->slot()->agreement($user);
82 $constraint = $this->container->refinery()->custom()->constraint(...);
84 if ($global_settings->noAcceptance()->value()) {
86 ->hasPublicPage($agreement->showAgreement(...), self::GOTO_NAME);
88 $slot = $slot->canWithdraw($blocks->slot()->withdrawProcess($user, $global_settings, $this->
userHasWithdrawn(...)))
89 ->hasAgreement($agreement, self::GOTO_NAME)
90 ->showInFooter($blocks->slot()->modifyFooter($user, self::GOTO_NAME))
91 ->onSelfRegistration($blocks->slot()->selfRegistration($user, $build_user))
92 ->hasOnlineStatusFilter($blocks->slot()->onlineStatusFilter($this->
usersWhoDidntAgree($this->container->database())))
93 ->hasUserManagementFields($blocks->userManagementAgreeDateField($build_user,
'dpro_agree_date',
'dpro'))
94 ->canReadInternalMails($blocks->slot()->canReadInternalMails($build_user))
95 ->canUseSoapApi($constraint(fn($u) => !$public_api->needsToAgree($u),
'Data Protection not agreed.'));
103 return function (
Closure $footer) use ($user, $ui, $legal_documents) {
104 $in_footer = fn($v) => $footer(
'usr_agreement', $ui->
txt(
'usr_agreement'), $v);
106 return $in_footer(
new URI(ilLink::_getLink(
null,
'usr', [], self::GOTO_NAME)));
114 [$legal_documents->
document()->contentAsComponent($document->
content())]
119 ->except(fn() =>
new Ok($footer))->value();
125 $this->container[
'ilAppEventHandler']->raise(
126 'components/ILIAS/DataProtection',
128 [
'event' => $this->container->user()]
134 return function (array $users) use ($database): array {
136 $result = $database->
query(
137 'SELECT usr_id FROM usr_pref WHERE keyword = "dpro_agree_date" AND (value IS NULL OR value = "false" OR value = "") AND ' . $users
140 return array_map(intval(...), array_column($database->
fetchAll($result),
'usr_id'));
uses(UseSlot $slot, LazyProvide $provide)
A
fetchAll(ilDBStatement $statement, int $fetch_mode=ilDBConstants::FETCHMODE_ASSOC)
Customizing of pimple-DIC for ILIAS.
showMatchingDocument(User $user, UI $ui, Provide $legal_documents)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
readonly Container $container
A result encapsulates a value or an error and simplifies the handling of those.
query(string $query)
Run a (read-only) Query on the database.
in(string $field, array $values, bool $negate=false, string $type="")
showOnLoginPage(callable $show)
hasPublicPage(callable $public_page, ?string $goto_name=null)
usersWhoDidntAgree(ilDBInterface $database)
__construct(?Container $container=null)
hasDocuments(array $content_as_component=[], ?SelectionMap $available_conditions=null)