45 $this->
ctrl = $DIC->ctrl();
46 $this->
lng = $DIC->language();
47 $this->rbac_review = $DIC->rbac()->review();
49 $this->
renderer = $DIC->ui()->renderer();
50 $this->request = $DIC->http()->request();
51 $this->
ui = $DIC->ui()->factory();
56 protected function txt(
string $var): string
58 return $this->
lng->txt($var);
61 protected function infoTxt(
string $var): string
63 return $this->
txt($var .
'_info');
73 $field = $this->
ui->input()->field();
76 $active = $field->checkbox($this->
txt(
'shib_active'), $this->
lng->txt(
"auth_shib_instructions"))
79 $this->
settings->setActive((
bool) $v);
82 $auth_allow_local = $field->checkbox($this->
txt(
'auth_allow_local'))
83 ->withValue($this->
settings->isLocalAuthAllowed())
85 $this->
settings->setAllowLocalAuth((
bool) $v);
88 $account_creation = $field->switchableGroup(
92 $this->lng->txt(
"shib_account_creation_enabled"),
93 $this->
lng->txt(
"shib_account_creation_enabled_info")
97 $this->lng->txt(
"shib_account_creation_with_approval"),
98 $this->
lng->txt(
"shib_account_creation_with_approval_info")
102 $this->lng->txt(
"shib_account_creation_disabled"),
103 $this->
lng->txt(
"shib_account_creation_disabled_info")
106 $this->
lng->txt(
"shib_account_creation"),
107 $this->
lng->txt(
"shib_account_creation_info")
109 $this->
settings->getAccountCreation()
112 )->withAdditionalTransformation($custom_trafo(
function ($v):
void {
113 $this->
settings->setAccountCreation((
string) $v[0]);
116 $default_user_role = $field->select($this->
txt(
'shib_user_default_role'), $this->
getRoles())
118 ->withValue($this->
settings->getDefaultRole())
120 $this->
settings->setDefaultRole((
int) $v);
123 $basic_section = $field->section([
128 ], $this->
txt(
'shib'));
131 $federation_name = $field->text($this->
txt(
'shib_federation_name'))
133 ->withValue($this->
settings->getFederationName())
135 $this->
settings->setFederationName((
string) $v);
138 $login_type = $field->switchableGroup([
139 'internal_wayf' => $field->group([
140 $field->textarea(
'', $this->txt(
'shib_idp_list'))
143 $this->
settings->setIdPList((
string) $v);
145 ], $this->
txt(
'shib_login_internal_wayf')),
146 'external_wayf' => $field->group([
147 $field->text(
'', $this->txt(
'shib_login_button'))
150 $this->
settings->setLoginButton((
string) $v);
152 ], $this->
txt(
'shib_login_external_wayf')),
153 'embedded_wayf' => $field->group([], $this->txt(
'shib_login_embedded_wayf'))
154 ->withByline($this->
txt(
'shib_login_embedded_wayf_description')),
155 ], $this->
txt(
'shib_login_type'))
157 ->withValue($this->
settings->getOrganisationSelectionType())
159 $this->
settings->setOrganisationSelectionType($v[0]);
162 $instructions = $field->textarea($this->
txt(
'auth_login_instructions'))
163 ->withValue($this->
settings->get(
'login_instructions',
''))
165 $this->
settings->set(
'login_instructions', htmlspecialchars_decode($v));
168 $data_manipulation = $field->text($this->
txt(
'shib_data_conv'))
169 ->withValue($this->
settings->get(
'data_conv'))
171 $this->
settings->set(
'data_conv', (
string) $v);
174 $federation_section = $field->section([
183 $fields[] = $field->text($this->
txt(
'shib_login'))
184 ->withValue($this->
settings->get(
'shib_login'))
186 ->withAdditionalTransformation($custom_trafo(
function ($v):
void {
187 $this->
settings->set(
'shib_login', (
string) $v);
189 foreach ($this->
settings->getUserFields() as $field_name => $required) {
190 $fields[] = $field->text($this->
txt($field_name))
191 ->withValue($this->
settings->get($field_name))
192 ->withRequired($required)
193 ->withAdditionalTransformation($custom_trafo(
function ($v) use ($field_name):
void {
194 $this->
settings->set($field_name, (
string) $v);
196 $fields[] = $field->checkbox($this->
txt(
'shib_update'))
197 ->withValue((
bool) $this->
settings->get(
'update_' . $field_name))
199 $this->
settings->set(
'update_' . $field_name, (
string) $v);
203 $user_fields = $field->section(
210 $this->
form = $this->
ui->input()->container()->form()->standard(
222 $request = $this->request->withParsedBody(
array_map(
'htmlspecialchars', $this->request->getParsedBody()));
223 $this->
form = $this->
form->withRequest($request);
228 return $this->
form->getData() !==
null;
246 foreach ($this->rbac_review->getRolesByFilter($filter) as $role) {
247 $opt[$role[
'obj_id']] = $role[
'title'] .
' (' . $role[
'obj_id'] .
')';
const ACCOUNT_CREATION_WITH_APPROVAL
const ACCOUNT_CREATION_DISABLED
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const ACCOUNT_CREATION_ENABLED
form( $class_path, string $cmd, string $submit_caption="")
Class ilShibbolethSettings.