ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Authentication\Form\ApacheAuthSettingsForm Class Reference
+ Collaboration diagram for ILIAS\Authentication\Form\ApacheAuthSettingsForm:

Public Member Functions

 __construct (private int $ref_id, private object $parentObject, private string $show_command, private string $save_command, private array $values=[], ?UIFactory $ui_factory=null, ?ilLanguage $lng=null, ?ilRbacSystem $rbac_system=null, ?ilRbacReview $rbac_review=null, ?ilCtrlInterface $ctrl=null)
 
 buildForm ()
 

Private Member Functions

 buildEnableAuthInput ()
 
 buildLdapEnableInput ()
 
 buildAuthEnableOverrideLoginPageInput ()
 
 buildAuthUsernameConfigTypeInput ()
 
 checkGroupEnabled (string $post_var)
 

Private Attributes

UIFactory $ui_factory
 
ilLanguage $lng
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilCtrlInterface $ctrl
 
FieldFactory $ui_field
 

Detailed Description

Definition at line 37 of file ApacheAuthSettingsForm.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Authentication\Form\ApacheAuthSettingsForm::__construct ( private int  $ref_id,
private object  $parentObject,
private string  $show_command,
private string  $save_command,
private array  $values = [],
?UIFactory  $ui_factory = null,
?ilLanguage  $lng = null,
?ilRbacSystem  $rbac_system = null,
?ilRbacReview  $rbac_review = null,
?ilCtrlInterface  $ctrl = null 
)
Parameters
array<string,mixed>$values

Definition at line 49 of file ApacheAuthSettingsForm.php.

60 {
61 global $DIC;
62
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();
68
69 $this->ui_field = $this->ui_factory->input()->field();
70
71 $this->lng->loadLanguageModule('auth');
72 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Authentication\Form\ApacheAuthSettingsForm\$rbac_review, ILIAS\Authentication\Form\ApacheAuthSettingsForm\$rbac_system, ILIAS\Authentication\Form\ApacheAuthSettingsForm\$ui_factory, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildAuthEnableOverrideLoginPageInput()

ILIAS\Authentication\Form\ApacheAuthSettingsForm::buildAuthEnableOverrideLoginPageInput ( )
private

Definition at line 177 of file ApacheAuthSettingsForm.php.

177 : OptionalGroup
178 {
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'))
181 ->withRequired(true)
182 ], $this->lng->txt('apache_auth_enable_override_login'))
183 ->withValue(
184 $this->checkGroupEnabled('apache_auth_enable_override_login_page')
185 ? [
186 'apache_auth_target_override_login_page' => $this->values['apache_auth_target_override_login_page'] ?? ''
187 ]
188 : null
189 );
190 }

References ILIAS\Authentication\Form\ApacheAuthSettingsForm\checkGroupEnabled(), and ILIAS\UI\Component\Input\Input\withValue().

+ Here is the call graph for this function:

◆ buildAuthUsernameConfigTypeInput()

ILIAS\Authentication\Form\ApacheAuthSettingsForm::buildAuthUsernameConfigTypeInput ( )
private

Definition at line 192 of file ApacheAuthSettingsForm.php.

192 : SwitchableGroup
193 {
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');
204 }

References ILIAS\UI\Component\Input\Input\withValue().

+ Here is the call graph for this function:

◆ buildEnableAuthInput()

ILIAS\Authentication\Form\ApacheAuthSettingsForm::buildEnableAuthInput ( )
private

Definition at line 113 of file ApacheAuthSettingsForm.php.

113 : OptionalGroup
114 {
115 $roleOptions = [];
116 foreach ($this->rbac_review->getGlobalRolesArray() as $role) {
117 $roleOptions[$role['obj_id']] = ilObject::_lookupTitle($role['obj_id']);
118 }
119
120 $apache_default_role = $this->ui_field->select(
121 $this->lng->txt('apache_default_role'),
122 $roleOptions
123 );
124
125 $apache_local_autocreate = $this->ui_field->optionalGroup([
126 'apache_default_role' => $apache_default_role
127 ], $this->lng->txt('apache_autocreate'));
128
129 return $this->ui_field->optionalGroup([
130 'apache_local_autocreate' => $apache_local_autocreate
131 ], $this->lng->txt('apache_enable_auth'))
132 ->withValue(
133 $this->checkGroupEnabled('apache_enable_auth')
134 ? [
135 'apache_local_autocreate' => $this->checkGroupEnabled('apache_local_autocreate')
136 ? [
137 'apache_default_role' => $this->values['apache_default_role'] ?? 4
138 ]
139 : null
140 ]
141 : null
142 );
143 }
static _lookupTitle(int $obj_id)

References ilObject\_lookupTitle(), ILIAS\Authentication\Form\ApacheAuthSettingsForm\checkGroupEnabled(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildForm()

ILIAS\Authentication\Form\ApacheAuthSettingsForm::buildForm ( )

Definition at line 74 of file ApacheAuthSettingsForm.php.

74 : StandardForm
75 {
76 $access = $this->rbac_system->checkAccess('write', $this->ref_id);
77
78 $form = $this->ui_factory->input()->container()->form()->standard(
79 $this->ctrl->getFormAction($this->parentObject, $access ? $this->save_command : $this->show_command),
80 [
81 'apache_enable_auth' => $this->buildEnableAuthInput(),
82 'apache_enable_local' => $this->ui_field->checkbox($this->lng->txt('apache_enable_local'))
83 ->withValue((bool) ($this->values['apache_enable_local'] ?? true)),
84 'apache_enable_ldap' => $this->buildLdapEnableInput(),
85 'apache_auth_indicator_name' => $this->ui_field->text($this->lng->txt('apache_auth_indicator_name'))
86 ->withRequired(true)
87 ->withValue($this->values['apache_auth_indicator_name'] ?? ''),
88 'apache_auth_indicator_value' => $this->ui_field->text($this->lng->txt('apache_auth_indicator_value'))
89 ->withRequired(true)
90 ->withValue($this->values['apache_auth_indicator_value'] ?? ''),
91 'apache_auth_enable_override_login_page' => $this->buildAuthEnableOverrideLoginPageInput(),
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([
95 'apache_auth_username_config_type' => $this->buildAuthUsernameConfigTypeInput()
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'))
103 ]
104 );
105
106 if (!$access) {
107 $form = $form->withSubmitLabel($this->lng->txt('refresh'));
108 }
109
110 return $form;
111 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ buildLdapEnableInput()

ILIAS\Authentication\Form\ApacheAuthSettingsForm::buildLdapEnableInput ( )
private

Definition at line 145 of file ApacheAuthSettingsForm.php.

145 : Checkbox|OptionalGroup
146 {
147 $servers = ilLDAPServer::getServerIds();
148
149 if ($servers !== []) {
150 $options[0] = $this->lng->txt('select_one');
151 foreach ($servers as $server_id) {
152 $ldap_server = new ilLDAPServer($server_id);
153 $options[$server_id] = $ldap_server->getName();
154 }
155
156 $apache_enable_ldap = $this->ui_field->optionalGroup([
157 'apache_ldap_sid' => $this->ui_field->select($this->lng->txt('auth_ldap_server_ds'), $options)
158 ->withRequired(true)
159 ], $this->lng->txt('apache_enable_ldap'), $this->lng->txt('apache_ldap_hint_ldap_must_be_configured'))
160 ->withValue(
161 $this->checkGroupEnabled('apache_enable_ldap')
162 ? [
163 'apache_ldap_sid' => $this->values['apache_ldap_sid'] ?? ilLDAPServer::getDataSource(ilAuthUtils::AUTH_APACHE)
164 ]
165 : null
166 );
167 } else {
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));
172 }
173
174 return $apache_enable_ldap;
175 }
const int AUTH_APACHE
static getDataSource(int $a_auth_mode)
static getServerIds()
Get all server ids.

References ilAuthUtils\AUTH_APACHE, ILIAS\Authentication\Form\ApacheAuthSettingsForm\checkGroupEnabled(), ilLDAPServer\getDataSource(), ilLDAPServer\getServerIds(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ checkGroupEnabled()

ILIAS\Authentication\Form\ApacheAuthSettingsForm::checkGroupEnabled ( string  $post_var)
private

Definition at line 206 of file ApacheAuthSettingsForm.php.

206 : bool
207 {
208 return isset($this->values[$post_var]) && $this->values[$post_var];
209 }

Referenced by ILIAS\Authentication\Form\ApacheAuthSettingsForm\buildAuthEnableOverrideLoginPageInput(), ILIAS\Authentication\Form\ApacheAuthSettingsForm\buildEnableAuthInput(), and ILIAS\Authentication\Form\ApacheAuthSettingsForm\buildLdapEnableInput().

+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrlInterface ILIAS\Authentication\Form\ApacheAuthSettingsForm::$ctrl
private

Definition at line 43 of file ApacheAuthSettingsForm.php.

◆ $lng

ilLanguage ILIAS\Authentication\Form\ApacheAuthSettingsForm::$lng
private

Definition at line 40 of file ApacheAuthSettingsForm.php.

◆ $rbac_review

ilRbacReview ILIAS\Authentication\Form\ApacheAuthSettingsForm::$rbac_review
private

◆ $rbac_system

ilRbacSystem ILIAS\Authentication\Form\ApacheAuthSettingsForm::$rbac_system
private

◆ $ui_factory

UIFactory ILIAS\Authentication\Form\ApacheAuthSettingsForm::$ui_factory
private

◆ $ui_field

FieldFactory ILIAS\Authentication\Form\ApacheAuthSettingsForm::$ui_field
private

Definition at line 44 of file ApacheAuthSettingsForm.php.


The documentation for this class was generated from the following file: