ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm Class Reference
+ Collaboration diagram for ILIAS\UI\Implementation\Component\Input\Container\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\UI\Implementation\Component\Input\Container\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.

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

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
+ Here is the call graph for this function:

Member Function Documentation

◆ buildAuthEnableOverrideLoginPageInput()

ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::buildAuthEnableOverrideLoginPageInput ( )
private

Definition at line 177 of file ApacheAuthSettingsForm.php.

References ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm\checkGroupEnabled(), ILIAS\Repository\lng(), null, and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm\buildForm().

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildAuthUsernameConfigTypeInput()

ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::buildAuthUsernameConfigTypeInput ( )
private

Definition at line 192 of file ApacheAuthSettingsForm.php.

References ILIAS\Repository\lng(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm\buildForm().

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  }
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildEnableAuthInput()

ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::buildEnableAuthInput ( )
private

Definition at line 113 of file ApacheAuthSettingsForm.php.

References ilObject\_lookupTitle(), ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm\checkGroupEnabled(), ILIAS\Repository\lng(), null, and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm\buildForm().

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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _lookupTitle(int $obj_id)
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildForm()

ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::buildForm ( )

Definition at line 74 of file ApacheAuthSettingsForm.php.

References ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm\buildAuthEnableOverrideLoginPageInput(), ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm\buildAuthUsernameConfigTypeInput(), ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm\buildEnableAuthInput(), ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm\buildLdapEnableInput(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\UI\Implementation\Component\Input\withValue().

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  }
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:

◆ buildLdapEnableInput()

ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::buildLdapEnableInput ( )
private

Definition at line 145 of file ApacheAuthSettingsForm.php.

References ilAuthUtils\AUTH_APACHE, ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm\checkGroupEnabled(), ilLDAPServer\getDataSource(), ilLDAPServer\getServerIds(), ILIAS\Repository\lng(), null, and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm\buildForm().

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  }
static getDataSource(int $a_auth_mode)
const int AUTH_APACHE
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getServerIds()
Get all server ids.
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkGroupEnabled()

ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::checkGroupEnabled ( string  $post_var)
private

Field Documentation

◆ $ctrl

ilCtrlInterface ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::$ctrl
private

Definition at line 43 of file ApacheAuthSettingsForm.php.

◆ $lng

ilLanguage ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::$lng
private

Definition at line 40 of file ApacheAuthSettingsForm.php.

◆ $rbac_review

ilRbacReview ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::$rbac_review
private

Definition at line 42 of file ApacheAuthSettingsForm.php.

◆ $rbac_system

ilRbacSystem ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::$rbac_system
private

Definition at line 41 of file ApacheAuthSettingsForm.php.

◆ $ui_factory

UIFactory ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::$ui_factory
private

Definition at line 39 of file ApacheAuthSettingsForm.php.

◆ $ui_field

FieldFactory ILIAS\UI\Implementation\Component\Input\Container\Form\ApacheAuthSettingsForm::$ui_field
private

Definition at line 44 of file ApacheAuthSettingsForm.php.


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