19 declare(strict_types=1);
49 private readonly
string $id,
50 private readonly
UI $ui,
51 private readonly
User $user,
52 private readonly
Provide $legal_documents,
53 private readonly
Closure $render,
54 private readonly
Closure $build_user,
57 $this->create_input = $create_input ?? fn(
string $class, ...$args) =>
new $class(...$args);
62 return $this->
user->matchingDocument()->map($this->
guis(...))->except(fn() =>
new Ok([]))->value();
67 if ($this->
user->matchingDocument()->isError()) {
68 $this->
ui->loadLanguageModule($this->
id);
69 $this->
ui->loadLanguageModule(
'ldoc');
70 $this->
ui->mainTemplate()->setOnScreenMessage(
'failure', sprintf(
71 $this->
ui->txt(
'account_reg_not_possible'),
77 if ($input && !$form->
getInput($this->checkboxVariableName())) {
78 $input->setAlert($this->
ui->txt(
'force_accept_usr_agreement'));
88 $user = ($this->build_user)($user);
90 $user->acceptMatchingDocument();
92 $user->acceptAnyDocument();
102 $header->setTitle($this->
ui->txt(
'usr_agreement'));
105 $document_content = ($this->render)($this->legal_documents->document()->contentAsComponent($document->
content()));
106 $doc->setHtml(sprintf(
'<div id="%s_agreement">%s</div>', htmlentities($this->
id), $document_content));
109 $checkbox->setRequired(
true);
110 $checkbox->setValue(
'1');
112 return [$header, $doc, $checkbox];
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
A result encapsulates a value or an error and simplifies the handling of those.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Signals that a result contains no value.