19declare(strict_types=1);
51 private object $parentObject,
52 private string $show_command,
53 private string $save_command,
54 private array $values = [],
64 $this->
lng = $lng ??
$DIC->language();
69 $this->ui_field = $this->ui_factory->input()->field();
71 $this->
lng->loadLanguageModule(
'auth');
76 $access = $this->rbac_system->checkAccess(
'write', $this->ref_id);
79 'apache_enable_local' => $this->ui_field->checkbox($this->
lng->txt(
'apache_enable_local'))
80 ->withValue((
bool) ($this->values[
'apache_enable_local'] ??
true)),
82 'apache_auth_indicator_name' => $this->ui_field->text($this->
lng->txt(
'apache_auth_indicator_name'))
84 ->withValue($this->values[
'apache_auth_indicator_name'] ??
''),
85 'apache_auth_indicator_value' => $this->ui_field->text($this->
lng->txt(
'apache_auth_indicator_value'))
87 ->withValue($this->values[
'apache_auth_indicator_value'] ??
''),
89 'apache_auth_authenticate_on_login_page' => $this->ui_field->checkbox($this->
lng->txt(
'apache_auth_authenticate_on_login_page'))
90 ->withValue((
bool) ($this->values[
'apache_auth_authenticate_on_login_page'] ??
true)),
91 'apache_auth_username_config' => $this->ui_field->section([
93 ], $this->
lng->txt(
'apache_auth_username_config')),
94 'apache_auth_security' => $this->ui_field->section([
95 'apache_auth_domains' => $this->ui_field->textarea(
96 $this->lng->txt(
'apache_auth_domains'),
97 $this->lng->txt(
'apache_auth_domains_description')
98 )->withValue($this->values[
'apache_auth_domains'] ??
'')
99 ], $this->lng->txt(
'apache_auth_security'))
103 foreach (
$inputs as $key => $input) {
104 $inputs[$key] = $input->withDisabled(
true);
109 $form = $this->ui_factory->input()->container()->form()->standard(
110 $this->
ctrl->getFormAction($this->parentObject, $access ? $this->save_command : $this->show_command),
115 $form = $form->withSubmitLabel($this->
lng->txt(
'refresh'));
124 foreach ($this->rbac_review->getGlobalRolesArray() as $role) {
128 $apache_default_role = $this->ui_field->select(
129 $this->
lng->txt(
'apache_default_role'),
133 $apache_local_autocreate = $this->ui_field->optionalGroup([
134 'apache_default_role' => $apache_default_role
135 ], $this->
lng->txt(
'apache_autocreate'));
137 return $this->ui_field->optionalGroup([
138 'apache_local_autocreate' => $apache_local_autocreate
139 ], $this->
lng->txt(
'apache_enable_auth'))
145 'apache_default_role' => $this->values[
'apache_default_role'] ?? 4
157 if ($servers !== []) {
159 foreach ($servers as $server_id) {
161 $options[$server_id] = $ldap_server->getName();
164 $apache_enable_ldap = $this->ui_field->optionalGroup([
165 'apache_ldap_sid' => $this->ui_field->select($this->lng->txt(
'auth_ldap_server_ds'),
$options)
167 ], $this->lng->txt(
'apache_enable_ldap'), $this->lng->txt(
'apache_ldap_hint_ldap_must_be_configured'))
176 $apache_enable_ldap = $this->ui_field->checkbox(
177 $this->
lng->txt(
'apache_enable_ldap'),
178 $this->lng->txt(
'apache_ldap_hint_ldap_must_be_configured')
179 )->withValue((
bool) ($this->values[
'apache_enable_ldap'] ??
true));
182 return $apache_enable_ldap;
187 return $this->ui_field->optionalGroup([
188 'apache_auth_target_override_login_page' => $this->ui_field->text($this->lng->txt(
'apache_auth_target_override_login'))
190 ], $this->lng->txt(
'apache_auth_enable_override_login'))
194 'apache_auth_target_override_login_page' => $this->values[
'apache_auth_target_override_login_page'] ??
''
202 return $this->ui_field->switchableGroup([
203 '1' => $this->ui_field->group([
204 'apache_auth_username_direct_mapping_fieldname' => $this->ui_field->text(
205 $this->lng->txt(
'apache_auth_username_direct_mapping_fieldname')
206 )->withValue($this->values[
'apache_auth_username_direct_mapping_fieldname'] ??
'')
207 ], $this->lng->txt(
'apache_auth_username_direct_mapping')),
208 '2' => $this->ui_field->group([], $this->lng->txt(
'apache_auth_username_extended_mapping'))->withDisabled(
true),
209 '3' => $this->ui_field->group([], $this->lng->txt(
'apache_auth_username_by_function')),
210 ], $this->lng->txt(
'apache_auth_username_config_type'))
212 isset($this->values[
'apache_auth_username_config_type']) &&
213 $this->values[
'apache_auth_username_config_type'] !==
'' ?
214 $this->values[
'apache_auth_username_config_type'] :
221 return isset($this->values[$post_var]) && $this->values[$post_var];
Builds a Color from either hex- or rgb values.
static getDataSource(int $a_auth_mode)
static getServerIds()
Get all server ids.
Class ilObject Basic functions for all objects.
static _lookupTitle(int $obj_id)
class ilRbacReview Contains Review functions of core Rbac.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...