19 declare(strict_types=1);
45 $this->
lng = $DIC->language();
46 $this->tpl = $DIC->ui()->mainTemplate();
47 $this->
ctrl = $DIC->ctrl();
48 $this->
tabs = $DIC->tabs();
49 $this->ui_factory = $DIC->ui()->factory();
50 $this->
toolbar = $DIC->toolbar();
53 $this->server_id = $a_server_id;
56 $this->
lng->loadLanguageModule(
'ecs');
82 $this->
ctrl->saveParameter($this,
'server_id');
83 $this->
ctrl->saveParameter($this,
'mid');
85 $next_class = $this->
ctrl->getNextClass($this);
86 $cmd = $this->
ctrl->getCmd(
'settings');
99 $this->
ctrl->returnToParent($this);
113 $this->tpl->setContent($form->getHTML());
122 if (!$consents->hasConsents()) {
126 $confirm = $this->ui_factory->modal()->interruptive(
127 $this->
lng->txt(
'ecs_consent_reset_confirm_title'),
128 $this->
lng->txt(
'ecs_consent_reset_confirm_title_info'),
129 $this->
ctrl->getLinkTarget($this,
'resetConsents')
131 $this->
toolbar->addComponent($confirm);
133 $confirmation_trigger = $this->ui_factory->button()->standard(
134 $this->
lng->txt(
'ecs_consent_reset_confirm_title'),
136 )->withOnClick($confirm->getShowSignal());
137 $this->
toolbar->addComponent($confirmation_trigger);
144 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'ecs_user_consents_deleted'),
true);
145 $this->
ctrl->redirect($this,
'settings');
154 if ($form->checkInput()) {
155 $this->
getParticipant()->enableToken((
bool) $form->getInput(
'token'));
156 $this->
getParticipant()->enableExport((
bool) $form->getInput(
'export'));
157 $this->
getParticipant()->setExportTypes($form->getInput(
'export_types'));
158 $this->
getParticipant()->enableImport((
bool) $form->getInput(
'import'));
159 $this->
getParticipant()->setImportTypes($form->getInput(
'import_types'));
160 $this->
getParticipant()->enableIncomingLocalAccounts((
bool) $form->getInput(
'incoming_local_accounts'));
161 $this->
getParticipant()->setIncomingAuthType((
int) $form->getInput(
'incoming_auth_type'));
162 $this->
getParticipant()->setOutgoingAuthModes((array) $form->getInput(
'outgoing_auth_modes'));
167 $placeholders[$authmode_name] = $form->getInput(
168 'username_placeholder_' . $authmode_name
171 $this->
getParticipant()->setOutgoingUsernamePlaceholders($placeholders);
175 switch ($error_code) {
177 $form->getItemByPostVar(
'outgoing_auth_modes')->setAlert(
178 $this->
lng->txt(
'ecs_username_place_holder_err_mssing_placeholder')
183 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
184 $this->
ctrl->redirect($this,
'settings');
187 $form->setValuesByPost();
188 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
198 $form->setFormAction($this->
ctrl->getFormAction($this));
199 $form->setTitle($this->
lng->txt(
'ecs_part_settings') .
' ' . $this->
getParticipant()->getTitle());
203 $token->setInfo($this->
lng->txt(
'ecs_token_mechanism_info'));
210 $export->setValue(
"1");
212 $form->addItem($export);
215 $this->
lng->txt(
'ecs_export_local_account'),
216 'incoming_local_accounts' 218 $auth_types->setInfo($this->
lng->txt(
'ecs_export_local_account_info'));
219 $auth_types->setChecked($this->
getParticipant()->areIncomingLocalAccountsSupported());
220 $export->addSubItem($auth_types);
224 $this->
lng->txt(
'ecs_export_auth_type'),
227 $external_auth_type->
setInfo($this->
lng->txt(
'ecs_export_auth_type_info'));
228 $external_auth_type->setValue(
231 $external_auth_type->addOption(
233 $this->
lng->txt(
'ecs_export_auth_type_ilias'),
238 $external_auth_type->addOption(
240 $this->
lng->txt(
'ecs_export_auth_type_shib'),
245 $external_auth_type->addOption(
247 $this->
lng->txt(
'ecs_export_auth_type_none'),
251 $export->addSubItem($external_auth_type);
261 $export->addSubItem($obj_types);
266 $import->setValue(
"1");
268 $form->addItem($import);
272 $this->
lng->txt(
'ecs_import_user_credentials_by_auth_mode'),
273 'outgoing_auth_modes' 275 $user_credentials->
setInfo($this->
lng->txt(
'ecs_import_user_credentials_by_auth_mode_info'));
276 $user_credentials->setValue($this->
getParticipant()->getOutgoingAuthModes());
277 $import->addSubItem($user_credentials);
280 $this->
lng->txt(
'ecs_import_auth_mode') .
' ' . $option_text,
283 $user_credentials->addOption($option);
285 $this->
lng->txt(
'ecs_outgoing_user_credentials'),
286 'username_placeholder_' . $option_name
288 $username_placeholder->setRequired(
false);
289 $username_placeholder->setInfo($this->
lng->txt(
'ecs_outgoing_user_credentials_info'));
290 $username_placeholder->setValue(
291 $this->
getParticipant()->getOutgoingUsernamePlaceholderByAuthMode(
295 $option->addSubItem($username_placeholder);
298 $this->
lng->txt(
'ecs_import_auth_type_default'),
301 $user_credentials->addOption($option);
311 $import->addSubItem($imp_types);
313 $form->addCommandButton(
'saveSettings', $this->
lng->txt(
'save'));
314 $form->addCommandButton(
'abort', $this->
lng->txt(
'cancel'));
322 $options[
'shibboleth'] = $this->
lng->txt(
'auth_shib');
333 return (
bool) $this->
settings->get(
'shib_active',
'0');
341 $this->
tabs->clearTargets();
342 $this->
tabs->setBackTarget(
343 $this->
lng->txt(
'back'),
344 $this->
ctrl->getParentReturnByClass(self::class)
This class represents an option in a radio group.
static getPossibleReleaseTypes(bool $a_with_captions=false)
Get all possible release object types.
This class represents an option in a checkbox group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByServerId(int $a_server_id)
Get instance by server id.
const INCOMING_AUTH_TYPE_LOGIN_PAGE
const ERR_MISSING_USERNAME_PLACEHOLDER
ilGlobalTemplateInterface $tpl
settings(?ilPropertyFormGUI $form=null)
Settings.
static getPossibleRemoteTypes(bool $a_with_captions=false)
Get all possible remote object types.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const INCOMING_AUTH_TYPE_INACTIVE
static getServerIds()
Get all server ids.
executeCommand()
Execute command.
ilECSParticipantSetting $participant
const INCOMING_AUTH_TYPE_SHIBBOLETH
parseAvailableAuthModes($a_mode_incoming=true)
__construct(int $a_server_id, int $a_mid)
saveSettings()
Save settings.
initFormSettings()
Init settings form.