33 protected \ILIAS\UI\Factory
$ui;
37 protected \Psr\Http\Message\RequestInterface
$request;
47 $this->
ui = $DIC->ui()->factory();
48 $this->renderer = $DIC->ui()->renderer();
49 $this->request = $DIC->http()->request();
50 $this->
ctrl = $DIC->ctrl();
51 $this->
lng = $DIC->language();
58 protected function txt(
string $var): string
60 return $this->
lng->txt($var);
63 protected function infoTxt(
string $var): string
65 return $this->
txt($var .
'_info');
70 return $this->renderer->render($this->
form);
75 $field = $this->
ui->input()->field();
76 $custom_trafo = fn (callable
$c) => $this->
refinery->custom()->transformation($c);
78 $read_me_link =
"./Services/AuthShibboleth/README.SHIBBOLETH.txt";
79 $active = $field->checkbox($this->
txt(
'shib_active'), $this->
lng->txt(
"auth_shib_instructions"))
82 $this->
settings->setActive((
bool) $v);
85 $auth_allow_local = $field->checkbox($this->
txt(
'auth_allow_local'))
86 ->withValue($this->
settings->isLocalAuthAllowed())
88 $this->
settings->setAllowLocalAuth((
bool) $v);
91 $admin_must_activate = $field->checkbox(
92 $this->
txt(
'shib_activate_new'),
93 $this->
lng->txt(
"shib_activate_new_info")
96 $custom_trafo(
function ($v):
void {
97 $this->
settings->setAdminMustActivate((
bool) $v);
101 $default_user_role = $field->select($this->
txt(
'shib_user_default_role'), $this->
getRoles())
103 ->withValue($this->
settings->getDefaultRole())
105 $this->
settings->setDefaultRole((
int) $v);
108 $basic_section = $field->section([
111 $admin_must_activate,
113 ], $this->
txt(
'shib'));
116 $federation_name = $field->text($this->
txt(
'shib_federation_name'))
118 ->withValue($this->
settings->getFederationName())
120 $this->
settings->setFederationName((
string) $v);
123 $login_type = $field->switchableGroup([
124 'internal_wayf' => $field->group([
125 $field->textarea(
'', $this->txt(
'shib_idp_list'))
128 $this->
settings->setIdPList((
string) $v);
130 ], $this->
txt(
'shib_login_internal_wayf')),
131 'external_wayf' => $field->group([
132 $field->text(
'', $this->txt(
'shib_login_button'))
135 $this->
settings->setLoginButton((
string) $v);
137 ], $this->
txt(
'shib_login_external_wayf')),
138 'embedded_wayf' => $field->group([], $this->txt(
'shib_login_embedded_wayf'))
139 ->withByline($this->
txt(
'shib_login_embedded_wayf_description')),
140 ], $this->
txt(
'shib_login_type'))
142 ->withValue($this->
settings->getOrganisationSelectionType())
144 $this->
settings->setOrganisationSelectionType($v[0]);
147 $instructions = $field->textarea($this->
txt(
'auth_login_instructions'))
148 ->withValue($this->
settings->get(
'login_instructions',
''))
150 $this->
settings->set(
'login_instructions', (
string) $v);
153 $data_manipulation = $field->text($this->
txt(
'shib_data_conv'))
154 ->withValue($this->
settings->get(
'data_conv'))
156 $this->
settings->set(
'data_conv', (
string) $v);
159 $federation_section = $field->section([
168 $fields[] = $field->text($this->
txt(
'shib_login'))
169 ->withValue($this->
settings->get(
'shib_login'))
171 ->withAdditionalTransformation($custom_trafo(
function ($v):
void {
172 $this->
settings->set(
'shib_login', (
string) $v);
174 foreach ($this->
settings->getUserFields() as $field_name => $required) {
175 $fields[] = $field->text($this->
txt($field_name))
176 ->withValue($this->
settings->get($field_name))
177 ->withRequired($required)
178 ->withAdditionalTransformation($custom_trafo(
function ($v) use ($field_name):
void {
179 $this->
settings->set($field_name, (
string) $v);
181 $fields[] = $field->checkbox($this->
txt(
'shib_update'))
182 ->withValue((
bool) $this->
settings->get(
'update_' . $field_name))
184 $this->
settings->set(
'update_' . $field_name, (
string) $v);
188 $user_fields = $field->section(
195 $this->
form = $this->
ui->input()->container()->form()->standard(
202 )->withAdditionalTransformation($this->
refinery->custom()->transformation(
function ($v) {
209 $this->
form = $this->
form->withRequest($this->request);
214 return $this->
form->getData() ===
true;
233 foreach ($DIC->rbac()->review()->getRolesByFilter($filter) as $role) {
234 $opt[$role[
'obj_id']] = $role[
'title'] .
' (' . $role[
'obj_id'] .
')';
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
form( $class_path, string $cmd)
__construct(Container $dic, ilPlugin $plugin)
Class ilShibbolethSettings.