48 $this->
ctrl = $DIC->ctrl();
49 $this->
lng = $DIC->language();
50 $this->rbac_review = $DIC->rbac()->review();
52 $this->renderer = $DIC->ui()->renderer();
53 $this->request = $DIC->http()->request();
55 $this->
ui = $DIC->ui()->factory();
60 protected function txt(
string $var): string
62 return $this->
lng->txt($var);
65 protected function infoTxt(
string $var): string
67 return $this->
txt($var .
'_info');
72 return $this->renderer->render($this->
form);
77 $field = $this->
ui->input()->field();
78 $custom_trafo = fn(callable
$c) => $this->
refinery->custom()->transformation($c);
80 $active = $field->checkbox($this->
txt(
'shib_active'), $this->
lng->txt(
"auth_shib_instructions"))
83 $this->
settings->setActive((
bool) $v);
86 $auth_allow_local = $field->checkbox($this->
txt(
'auth_allow_local'))
87 ->withValue($this->
settings->isLocalAuthAllowed())
89 $this->
settings->setAllowLocalAuth((
bool) $v);
92 $account_creation = $field->switchableGroup(
96 $this->lng->txt(
"shib_account_creation_enabled"),
97 $this->
lng->txt(
"shib_account_creation_enabled_info")
101 $this->lng->txt(
"shib_account_creation_with_approval"),
102 $this->
lng->txt(
"shib_account_creation_with_approval_info")
106 $this->lng->txt(
"shib_account_creation_disabled"),
107 $this->
lng->txt(
"shib_account_creation_disabled_info")
110 $this->
lng->txt(
"shib_account_creation"),
111 $this->
lng->txt(
"shib_account_creation_info")
113 $this->
settings->getAccountCreation()
116 )->withAdditionalTransformation($custom_trafo(
function ($v):
void {
117 $this->
settings->setAccountCreation((
string) $v[0]);
120 $default_user_role = $field->select($this->
txt(
'shib_user_default_role'), $this->
getRoles())
122 ->withValue($this->
settings->getDefaultRole())
124 $this->
settings->setDefaultRole((
int) $v);
127 $basic_section = $field->section([
132 ], $this->
txt(
'shib'));
135 $federation_name = $field->text($this->
txt(
'shib_federation_name'))
137 ->withValue($this->
settings->getFederationName())
139 $this->
settings->setFederationName((
string) $v);
142 $login_type = $field->switchableGroup([
143 'internal_wayf' => $field->group([
144 $field->textarea(
'', $this->txt(
'shib_idp_list'))
147 $this->
settings->setIdPList((
string) $v);
149 ], $this->
txt(
'shib_login_internal_wayf')),
150 'external_wayf' => $field->group([
151 $field->text(
'', $this->txt(
'shib_login_button'))
154 $this->
settings->setLoginButton((
string) $v);
156 ], $this->
txt(
'shib_login_external_wayf')),
157 'embedded_wayf' => $field->group([], $this->txt(
'shib_login_embedded_wayf'))
158 ->withByline($this->
txt(
'shib_login_embedded_wayf_description')),
159 ], $this->
txt(
'shib_login_type'))
161 ->withValue($this->
settings->getOrganisationSelectionType())
163 $this->
settings->setOrganisationSelectionType($v[0]);
166 $instructions = $field->textarea($this->
txt(
'auth_login_instructions'))
167 ->withValue($this->
settings->get(
'login_instructions',
''))
169 $this->
settings->set(
'login_instructions', htmlspecialchars_decode($v));
172 $data_manipulation = $field->text($this->
txt(
'shib_data_conv'))
173 ->withValue($this->
settings->get(
'data_conv'))
175 $this->
settings->set(
'data_conv', (
string) $v);
178 $federation_section = $field->section([
187 $fields[] = $field->text($this->
txt(
'shib_login'))
188 ->withValue($this->
settings->get(
'shib_login'))
190 ->withAdditionalTransformation($custom_trafo(
function ($v):
void {
191 $this->
settings->set(
'shib_login', (
string) $v);
193 foreach ($this->
settings->getUserFields() as $field_name => $required) {
194 $fields[] = $field->text($this->
txt($field_name))
195 ->withValue($this->
settings->get($field_name))
196 ->withRequired($required)
197 ->withAdditionalTransformation($custom_trafo(
function ($v) use ($field_name):
void {
198 $this->
settings->set($field_name, (
string) $v);
200 $fields[] = $field->checkbox($this->
txt(
'shib_update'))
201 ->withValue((
bool) $this->
settings->get(
'update_' . $field_name))
203 $this->
settings->set(
'update_' . $field_name, (
string) $v);
207 $user_fields = $field->section(
214 $this->
form = $this->
ui->input()->container()->form()->standard(
226 $request = $this->request->withParsedBody(
array_map(
'htmlspecialchars', $this->request->getParsedBody()));
227 $this->
form = $this->
form->withRequest($request);
232 return $this->
form->getData() !== null;
250 foreach ($this->rbac_review->getRolesByFilter($filter) as $role) {
251 $opt[$role[
'obj_id']] = $role[
'title'] .
' (' . $role[
'obj_id'] .
')';
const ACCOUNT_CREATION_WITH_APPROVAL
const ACCOUNT_CREATION_DISABLED
const ACCOUNT_CREATION_ENABLED
form( $class_path, string $cmd, string $submit_caption="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...