19 declare(strict_types=1);
51 private object $parentObject,
52 private string $show_command,
53 private string $save_command,
54 private array $values = [],
63 $this->ui_factory = $ui_factory ?? $DIC->ui()->factory();
64 $this->
lng = $lng ?? $DIC->language();
65 $this->rbac_system = $rbac_system ?? $DIC->rbac()->system();
66 $this->rbac_review = $rbac_review ?? $DIC->rbac()->review();
67 $this->
ctrl = $ctrl ?? $DIC->ctrl();
69 $this->ui_field = $this->ui_factory->input()->field();
71 $this->
lng->loadLanguageModule(
'auth');
76 $access = $this->rbac_system->checkAccess(
'write', $this->ref_id);
78 $form = $this->ui_factory->input()->container()->form()->standard(
79 $this->
ctrl->getFormAction($this->parentObject, $access ? $this->save_command : $this->show_command),
82 'apache_enable_local' => $this->ui_field->checkbox($this->
lng->txt(
'apache_enable_local'))
83 ->
withValue((
bool) ($this->values[
'apache_enable_local'] ??
true)),
85 'apache_auth_indicator_name' => $this->ui_field->text($this->
lng->txt(
'apache_auth_indicator_name'))
87 ->withValue($this->values[
'apache_auth_indicator_name'] ??
''),
88 'apache_auth_indicator_value' => $this->ui_field->text($this->
lng->txt(
'apache_auth_indicator_value'))
90 ->withValue($this->values[
'apache_auth_indicator_value'] ??
''),
92 'apache_auth_authenticate_on_login_page' => $this->ui_field->checkbox($this->
lng->txt(
'apache_auth_authenticate_on_login_page'))
93 ->
withValue((
bool) ($this->values[
'apache_auth_authenticate_on_login_page'] ??
true)),
94 'apache_auth_username_config' => $this->ui_field->section([
96 ], $this->
lng->txt(
'apache_auth_username_config')),
97 'apache_auth_security' => $this->ui_field->section([
98 'apache_auth_domains' => $this->ui_field->textarea(
99 $this->lng->txt(
'apache_auth_domains'),
100 $this->
lng->txt(
'apache_auth_domains_description')
101 )->
withValue($this->values[
'apache_auth_domains'] ??
'')
102 ], $this->
lng->txt(
'apache_auth_security'))
107 $form = $form->withSubmitLabel($this->
lng->txt(
'refresh'));
116 foreach ($this->rbac_review->getGlobalRolesArray() as $role) {
120 $apache_default_role = $this->ui_field->select(
121 $this->
lng->txt(
'apache_default_role'),
125 $apache_local_autocreate = $this->ui_field->optionalGroup([
126 'apache_default_role' => $apache_default_role
127 ], $this->
lng->txt(
'apache_autocreate'));
129 return $this->ui_field->optionalGroup([
130 'apache_local_autocreate' => $apache_local_autocreate
131 ], $this->
lng->txt(
'apache_enable_auth'))
137 'apache_default_role' => $this->values[
'apache_default_role'] ?? 4
149 if ($servers !== []) {
150 $options[0] = $this->
lng->txt(
'select_one');
151 foreach ($servers as $server_id) {
153 $options[$server_id] = $ldap_server->getName();
156 $apache_enable_ldap = $this->ui_field->optionalGroup([
157 'apache_ldap_sid' => $this->ui_field->select($this->lng->txt(
'auth_ldap_server_ds'), $options)
159 ], $this->
lng->txt(
'apache_enable_ldap'), $this->
lng->txt(
'apache_ldap_hint_ldap_must_be_configured'))
168 $apache_enable_ldap = $this->ui_field->checkbox(
169 $this->
lng->txt(
'apache_enable_ldap'),
170 $this->
lng->txt(
'apache_ldap_hint_ldap_must_be_configured')
171 )->
withValue((
bool) ($this->values[
'apache_enable_ldap'] ??
true));
174 return $apache_enable_ldap;
179 return $this->ui_field->optionalGroup([
180 'apache_auth_target_override_login_page' => $this->ui_field->text($this->lng->txt(
'apache_auth_target_override_login'))
182 ], $this->
lng->txt(
'apache_auth_enable_override_login'))
186 'apache_auth_target_override_login_page' => $this->values[
'apache_auth_target_override_login_page'] ??
'' 194 return $this->ui_field->switchableGroup([
195 '1' => $this->ui_field->group([
196 'apache_auth_username_direct_mapping_fieldname' => $this->ui_field->text(
197 $this->lng->txt(
'apache_auth_username_direct_mapping_fieldname')
198 )->
withValue($this->values[
'apache_auth_username_direct_mapping_fieldname'] ??
'')
199 ], $this->
lng->txt(
'apache_auth_username_direct_mapping')),
200 '2' => $this->ui_field->group([], $this->lng->txt(
'apache_auth_username_extended_mapping'))->withDisabled(
true),
201 '3' => $this->ui_field->group([], $this->
lng->txt(
'apache_auth_username_by_function')),
202 ], $this->
lng->txt(
'apache_auth_username_config_type'))
203 ->
withValue($this->values[
'apache_auth_username_config_type'] ??
'1');
208 return isset($this->values[$post_var]) && $this->values[$post_var];
static getDataSource(int $a_auth_mode)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getServerIds()
Get all server ids.
static _lookupTitle(int $obj_id)