ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilObjAuthSettingsGUI Class Reference

@ilCtrl_Calls ilObjAuthSettingsGUI: ilPermissionGUI, ilRegistrationSettingsGUI, ilLDAPSettingsGUI @ilCtrl_Calls ilObjAuthSettingsGUI: ilAuthShibbolethSettingsGUI, ilCASSettingsGUI @ilCtrl_Calls ilObjAuthSettingsGUI: ilSamlSettingsGUI, ilOpenIdConnectSettingsGUI @ilCtrl_Calls ilObjAuthSettingsGUI: ilObjectContentStyleSettingsGUI More...

+ Inheritance diagram for ilObjAuthSettingsGUI:
+ Collaboration diagram for ilObjAuthSettingsGUI:

Public Member Functions

 __construct ($a_data, int $a_id, bool $a_call_by_reference, bool $a_prepare_output=true)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 setAuthModeObject ()
 
 editSOAPObject ()
 
 testSoapAuthConnectionObject ()
 
 saveSOAPObject ()
 
 editScriptObject ()
 
 saveScriptObject ()
 
 executeCommand ()
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 setSubTabs (string $a_tab)
 
 apacheAuthSettingsObject (?StandardForm $form=null)
 
 saveApacheSettingsObject ()
 
 registrationSettingsObject ()
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Private Member Functions

 authSettingsObject (?ILIAS\UI\Component\Input\Container\Form\Form $auth_mode_determination_form=null, ?ILIAS\UI\Component\Input\Container\Form\Form $registration_role_mapping_form=null)
 
 buildRegistrationRoleMappingForm ()
 
 updateRegistrationRoleMappingObject ()
 
 buildAuthModeDeterminationForm ()
 
 updateAuthModeDeterminationObject ()
 
 buildSOAPForm (string $submit_action)
 
 buildSOAPTestForm (string $submit_action)
 
 getAuthModeTitle ()
 
 validateApacheAuthAllowedDomains (string $text)
 

Private Attributes

const string CMD_SHOW_APACHE_SETTINGS = 'apacheAuthSettings'
 
const string CMD_SAVE_APACHE_SETTINGS = 'saveApacheSettings'
 
const string PROP_AUTH_MODE_KIND = 'kind'
 
const string PROP_AUTH_MODE_SEQUENCE = 'sequence'
 
ilLogger $logger
 
GUIService $content_style_gui
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjAuthSettingsGUI::__construct (   $a_data,
int  $a_id,
bool  $a_call_by_reference,
bool  $a_prepare_output = true 
)

Definition at line 44 of file class.ilObjAuthSettingsGUI.php.

45 {
46 $this->type = 'auth';
47 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
48
49 global $DIC;
50 $this->logger = $DIC->logger()->auth();
51
52 $this->lng->loadLanguageModule('administration');
53 $this->lng->loadLanguageModule('registration');
54 $this->lng->loadLanguageModule('auth');
55 $this->lng->loadLanguageModule('content');
56 $this->content_style_gui = $DIC->contentStyle()->gui();
57 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\lng(), and ILIAS\Repository\logger().

+ Here is the call graph for this function:

Member Function Documentation

◆ apacheAuthSettingsObject()

ilObjAuthSettingsGUI::apacheAuthSettingsObject ( ?StandardForm  $form = null)

Definition at line 1070 of file class.ilObjAuthSettingsGUI.php.

1070 : void
1071 {
1072 $this->tabs_gui->setTabActive('apache_auth_settings');
1073
1074 if (!$form) {
1075 $settings = new ilSetting('apache_auth');
1076 $settingsMap = $settings->getAll();
1077
1078 $path = ILIAS_DATA_DIR . '/' . CLIENT_ID . '/apache_auth_allowed_domains.txt';
1079 if (file_exists($path) && is_readable($path)) {
1080 $settingsMap['apache_auth_domains'] = file_get_contents($path);
1081 }
1082
1083 $form = (new ApacheAuthSettingsForm(
1084 $this->ref_id,
1085 $this,
1086 self::CMD_SHOW_APACHE_SETTINGS,
1087 self::CMD_SAVE_APACHE_SETTINGS,
1088 $settingsMap
1089 ))->buildForm();
1090
1091 }
1092
1093 $this->tpl->setContent($this->ui_renderer->render([
1094 $this->ui_factory->item()->standard($this->lng->txt('apache_settings')),
1095 $form
1096 ]));
1097 }
ilSetting $settings
ILIAS Setting Class.
const CLIENT_ID
Definition: constants.php:41
const ILIAS_DATA_DIR
Definition: constants.php:44
$path
Definition: ltiservices.php:30

References $path, CLIENT_ID, and ILIAS_DATA_DIR.

◆ authSettingsObject()

ilObjAuthSettingsGUI::authSettingsObject ( ?ILIAS\UI\Component\Input\Container\Form\Form  $auth_mode_determination_form = null,
?ILIAS\UI\Component\Input\Container\Form\Form  $registration_role_mapping_form = null 
)
private

Definition at line 64 of file class.ilObjAuthSettingsGUI.php.

67 : void {
68 if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
69 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
70 }
71
72 $this->tabs_gui->setTabActive('authentication_settings');
73 $this->setSubTabs('authSettings');
74 $this->tabs_gui->setSubTabActive('auth_settings');
75
76 $generalSettingsTpl = new ilTemplate('tpl.auth_general.html', true, true, 'components/ILIAS/Authentication');
77
78 $generalSettingsTpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
79
80 $generalSettingsTpl->setVariable('TXT_AUTH_MODE', $this->lng->txt('auth_mode'));
81 $generalSettingsTpl->setVariable('TXT_AUTH_DEFAULT', $this->lng->txt('default'));
82 $generalSettingsTpl->setVariable('TXT_AUTH_ACTIVE', $this->lng->txt('active'));
83 $generalSettingsTpl->setVariable('TXT_AUTH_NUM_USERS', $this->lng->txt('num_users'));
84
85 $generalSettingsTpl->setVariable('TXT_LOCAL', $this->lng->txt('auth_local'));
86 $generalSettingsTpl->setVariable('TXT_LDAP', $this->lng->txt('auth_ldap'));
87 $generalSettingsTpl->setVariable('TXT_SHIB', $this->lng->txt('auth_shib'));
88
89 $generalSettingsTpl->setVariable('TXT_SCRIPT', $this->lng->txt('auth_script'));
90
91 $generalSettingsTpl->setVariable('TXT_APACHE', $this->lng->txt('auth_apache'));
92
94 $auth_modes = ilAuthUtils::_getAllAuthModes();
95 $valid_modes = [
102 ];
103
104 $icon_ok = $this->ui_renderer->render(
105 $this->ui_factory->symbol()->icon()->custom(
106 ilUtil::getImagePath('standard/icon_ok.svg'),
107 $this->lng->txt('enabled')
108 )
109 );
110 $icon_not_ok = $this->ui_renderer->render(
111 $this->ui_factory->symbol()->icon()->custom(
112 ilUtil::getImagePath('standard/icon_not_ok.svg'),
113 $this->lng->txt('disabled')
114 )
115 );
116
117 $this->logger->debug(print_r($auth_modes, true));
118 foreach ($auth_modes as $mode => $mode_name) {
119 if (!in_array($mode, $valid_modes, true) && !ilLDAPServer::isAuthModeLDAP(
120 (string) $mode
121 ) && !ilSamlIdp::isAuthModeSaml((string) $mode)) {
122 continue;
123 }
124
125 $generalSettingsTpl->setCurrentBlock('auth_mode');
126
127 if (ilLDAPServer::isAuthModeLDAP((string) $mode)) {
129 $generalSettingsTpl->setVariable('AUTH_NAME', $server->getName());
130 $generalSettingsTpl->setVariable('AUTH_ACTIVE', $server->isActive() ? $icon_ok : $icon_not_ok);
131 } elseif (ilSamlIdp::isAuthModeSaml((string) $mode)) {
133 $generalSettingsTpl->setVariable('AUTH_NAME', $idp->getEntityId());
134 $generalSettingsTpl->setVariable('AUTH_ACTIVE', $idp->isActive() ? $icon_ok : $icon_not_ok);
135 } elseif ($mode === ilAuthUtils::AUTH_OPENID_CONNECT) {
136 $generalSettingsTpl->setVariable('AUTH_NAME', $this->lng->txt('auth_' . $mode_name));
137 $generalSettingsTpl->setVariable(
138 'AUTH_ACTIVE',
139 ilOpenIdConnectSettings::getInstance()->getActive() ? $icon_ok : $icon_not_ok
140 );
141 } else {
142 $generalSettingsTpl->setVariable('AUTH_NAME', $this->lng->txt('auth_' . $mode_name));
143 $generalSettingsTpl->setVariable(
144 'AUTH_ACTIVE',
145 $this->ilias->getSetting(
146 $mode_name . '_active'
147 ) || (int) $mode === ilAuthUtils::AUTH_LOCAL ? $icon_ok : $icon_not_ok
148 );
149 }
150
151 $auth_cnt_mode = $auth_cnt[$mode_name] ?? 0;
152 if ($this->settings->get('auth_mode') === (string) $mode) {
153 $generalSettingsTpl->setVariable('AUTH_CHECKED', 'checked="checked"');
154 $auth_cnt_default = $auth_cnt['default'] ?? 0;
155 $generalSettingsTpl->setVariable(
156 'AUTH_USER_NUM',
157 ((int) $auth_cnt_mode + $auth_cnt_default) . ' (' . $this->lng->txt('auth_per_default') .
158 ': ' . $auth_cnt_default . ')'
159 );
160 } else {
161 $generalSettingsTpl->setVariable(
162 'AUTH_USER_NUM',
163 (int) $auth_cnt_mode
164 );
165 }
166 $generalSettingsTpl->setVariable('AUTH_ID', $mode_name);
167 $generalSettingsTpl->setVariable('AUTH_VAL', $mode);
168 $generalSettingsTpl->parseCurrentBlock();
169 }
170
171 $generalSettingsTpl->setVariable('TXT_CONFIGURE', $this->lng->txt('auth_configure'));
172
173 if ($this->rbac_system->checkAccess('write', $this->object->getRefId())) {
174 $generalSettingsTpl->setVariable('TXT_AUTH_REMARK', $this->lng->txt('auth_remark_non_local_auth'));
175 $generalSettingsTpl->setCurrentBlock('auth_mode_submit');
176 $generalSettingsTpl->setVariable('TXT_SUBMIT', $this->lng->txt('save'));
177 $generalSettingsTpl->setVariable('CMD_SUBMIT', 'setAuthMode');
178 $generalSettingsTpl->parseCurrentBlock();
179 }
180
181 $page_content = [
182 $this->ui_factory->panel()->standard(
183 $this->lng->txt('auth_select'),
184 $this->ui_factory->legacy()->content(implode('', [
185 $this->ui_renderer->render($this->ui_factory->messageBox()->info(
186 $this->lng->txt('auth_mode_default_change_info')
187 )),
188 $generalSettingsTpl->get()
189 ])),
190 )
191 ];
192
193 $auth_mode_determination_form = $auth_mode_determination_form ?? $this->buildAuthModeDeterminationForm();
194 if ($auth_mode_determination_form !== null) {
195 $page_content[] = $this->ui_factory->panel()->standard(
196 $this->lng->txt('auth_auth_mode_determination'),
197 $auth_mode_determination_form
198 );
199 }
200
201 $page_content[] = $this->ui_factory->panel()->standard(
202 $this->lng->txt('auth_active_roles'),
203 $registration_role_mapping_form ?? $this->buildRegistrationRoleMappingForm()
204 );
205
206 $this->tpl->setContent(
207 $this->ui_renderer->render($page_content)
208 );
209 }
const int AUTH_SHIBBOLETH
const int AUTH_LOCAL
const int AUTH_LDAP
const int AUTH_SAML
const int AUTH_APACHE
const int AUTH_OPENID_CONNECT
static _getAllAuthModes()
static getInstanceByServerId(int $a_server_id)
Get instance by server id.
static getServerIdByAuthMode(string $a_auth_mode)
Get auth id by auth mode.
static isAuthModeLDAP(string $a_auth_mode)
Check if user auth mode is LDAP.
static _getNumberOfUsersPerAuthMode()
get number of users per auth mode
static getIdpIdByAuthMode(string $a_auth_mode)
static isAuthModeSaml(string $a_auth_mode)
static getInstanceByIdpId(int $a_idp_id)
special template class to simplify handling of ITX/PEAR
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Class ilObjForumAdministration.
$server
Definition: shib_login.php:28

References ILIAS\Repository\lng().

Referenced by viewObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildAuthModeDeterminationForm()

ilObjAuthSettingsGUI::buildAuthModeDeterminationForm ( )
private

Definition at line 324 of file class.ilObjAuthSettingsGUI.php.

325 {
327 if ($det->getCountActiveAuthModes() <= 1) {
328 return null;
329 }
330
331 $disabled_fields = !$this->rbac_system->checkAccess('write', $this->object->getRefId());
332
333 $automatic_options = [];
334 $counter = 1;
335 $auth_sequenced = $det->getAuthModeSequence();
336 foreach ($auth_sequenced as $auth_mode) {
337 $text = '';
338 switch ($auth_mode) {
339 case ilLDAPServer::isAuthModeLDAP((string) $auth_mode):
340 $auth_id = ilLDAPServer::getServerIdByAuthMode($auth_mode);
342 $text = $server->getName();
343 break;
345 $text = $this->lng->txt('auth_local');
346 break;
348 $text = $this->lng->txt('auth_soap');
349 break;
351 $text = $this->lng->txt('auth_apache');
352 break;
353 default:
354 foreach (ilAuthUtils::getAuthPlugins() as $pl) {
355 $option = $pl->getMultipleAuthModeOptions($auth_mode);
356 $text = $option[$auth_mode]['txt'];
357 }
358 break;
359 }
360
361 $automatic_options['m' . $auth_mode] = $this->ui_factory
362 ->input()
363 ->field()
364 ->numeric($text)
365 ->withDedicatedName('m' . $auth_mode)
366 ->withValue($counter++)
367 ->withDisabled($disabled_fields);
368 }
369
370 $options = [
371 (string) ilAuthModeDetermination::TYPE_MANUAL => $this->ui_factory
372 ->input()
373 ->field()
374 ->group(
375 [],
376 $this->lng->txt('auth_by_user')
377 )
378 ->withDedicatedName((string) ilAuthModeDetermination::TYPE_MANUAL)
379 ->withDisabled($disabled_fields),
380 (string) ilAuthModeDetermination::TYPE_AUTOMATIC => $this->ui_factory
381 ->input()
382 ->field()
383 ->group(
384 $automatic_options,
385 $this->lng->txt('auth_automatic')
386 )
387 ->withDedicatedName((string) ilAuthModeDetermination::TYPE_AUTOMATIC)
388 ->withDisabled($disabled_fields)
389 ];
390
391 $sections = [
392 self::PROP_AUTH_MODE_KIND => $this->ui_factory
393 ->input()
394 ->field()
395 ->switchableGroup(
396 $options,
397 $this->lng->txt('auth_kind_determination'),
398 $this->lng->txt('auth_mode_determination_info')
399 )
400 ->withDedicatedName(self::PROP_AUTH_MODE_KIND)
401 ->withValue((string) $det->getKind())
402 ->withDisabled($disabled_fields)
403 ->withRequired(true)
404 ];
405
406 return $this->ui_factory
407 ->input()
408 ->container()
409 ->form()
410 ->standard($this->ctrl->getFormAction($this, 'updateAuthModeDetermination'), $sections)
411 ->withDedicatedName('auth_mode_determination')
412 ->withAdditionalTransformation(
413 $this->refinery->custom()->transformation(function ($value): array {
414 $auth_mode_kind = (int) ($value[self::PROP_AUTH_MODE_KIND][0] ?? ilAuthModeDetermination::TYPE_MANUAL);
415 $sequence = [];
416 if ($auth_mode_kind === ilAuthModeDetermination::TYPE_AUTOMATIC) {
417 $sequence = (array) ($value[self::PROP_AUTH_MODE_KIND][1] ?? []);
418 }
419
420 $merged_values = array_merge(
421 [
422 self::PROP_AUTH_MODE_KIND => $auth_mode_kind,
423 ],
424 [
425 self::PROP_AUTH_MODE_SEQUENCE => $sequence
426 ]
427 );
428
429 return $merged_values;
430 })
431 );
432 }
static getAuthPlugins()
const int AUTH_SOAP
This describes commonalities between all forms.
Definition: Form.php:34
$counter
$text
Definition: xapiexit.php:21

References $counter, ILIAS\UI\Implementation\Component\Input\Field\$options, $server, $text, ilAuthModeDetermination\_getInstance(), ilAuthUtils\AUTH_APACHE, ilAuthUtils\AUTH_LOCAL, ilAuthUtils\AUTH_SOAP, ILIAS\Repository\ctrl(), ilAuthUtils\getAuthPlugins(), ilLDAPServer\getInstanceByServerId(), ilLDAPServer\getServerIdByAuthMode(), ILIAS\Repository\int(), ilLDAPServer\isAuthModeLDAP(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\refinery(), ilAuthModeDetermination\TYPE_AUTOMATIC, and ilAuthModeDetermination\TYPE_MANUAL.

+ Here is the call graph for this function:

◆ buildRegistrationRoleMappingForm()

ilObjAuthSettingsGUI::buildRegistrationRoleMappingForm ( )
private

Definition at line 211 of file class.ilObjAuthSettingsGUI.php.

212 {
213 $disabled_fields = !$this->rbac_system->checkAccess('write', $this->object->getRefId());
214
215 $fields = [];
217
218 $excluded_auth_names = ['default', 'saml', 'shibboleth', 'ldap', 'lti', 'apache', 'ecs', 'oidc'];
219 // do not list auth modes with external login screen
220 // even not default, because it can easily be set to
221 // a non-working auth mode
222 $active_auth_modes = array_filter(
224 static function (string $auth_name) use ($excluded_auth_names): bool {
225 foreach ($excluded_auth_names as $excluded_auth_name) {
226 if ($auth_name === $excluded_auth_name) {
227 return false;
228 }
229
230 if (str_starts_with($auth_name, $excluded_auth_name)) {
231 return false;
232 }
233 }
234 return true;
235 },
236 ARRAY_FILTER_USE_KEY
237 );
238
239 foreach ($reg_roles as $role) {
240 $options = [];
241 $value = null;
242 foreach ($active_auth_modes as $auth_name => $auth_key) {
243 if ($auth_name === 'default') {
244 $name = $this->lng->txt('auth_' . $auth_name) . ' (' . $this->lng->txt(
245 'auth_' . ilAuthUtils::_getAuthModeName($auth_key)
246 ) . ')';
247 } else {
248 $name = $this->lng->txt('auth_' . $auth_name);
249 }
250
251 $options[$auth_name] = $name;
252
253 if ($role['auth_mode'] === $auth_name) {
254 $value = $auth_name;
255 }
256 }
257
258 if ($options === []) {
259 continue;
260 }
261
263
264 $fields['r_' . $role['id']] = $this->ui_factory
265 ->input()
266 ->field()
267 ->select(
268 $role['title'],
269 $options,
270 $this->lng->txt('auth_role_auth_mode')
271 )
272 ->withRequired(true)
273 ->withValue($value)
274 ->withDedicatedName('r_' . $role['id'])
275 ->withDisabled($disabled_fields);
276 }
277
278 return $this->ui_factory
279 ->input()
280 ->container()
281 ->form()
282 ->standard($this->ctrl->getFormAction($this, 'updateRegistrationRoleMapping'), $fields)
283 ->withDedicatedName('registration_role_mapping');
284 }
static _getActiveAuthModes()
static _getAuthModeName($a_auth_key)
static _lookupRegisterAllowed()
get all roles that are activated in user registration

References ILIAS\UI\Implementation\Component\Input\Field\$options, ilAuthUtils\_getActiveAuthModes(), ilAuthUtils\_getAuthModeName(), ilObjRole\_lookupRegisterAllowed(), ilAuthUtils\AUTH_LOCAL, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ buildSOAPForm()

ilObjAuthSettingsGUI::buildSOAPForm ( string  $submit_action)
private

Definition at line 564 of file class.ilObjAuthSettingsGUI.php.

567 $role_list = $this->rbac_review->getRolesByFilter(2, $this->object->getId());
568 $roles = [];
569
570 foreach ($role_list as $role) {
571 $roles[$role['obj_id']] = $role['title'];
572 }
573
574 $active = $this->ui_factory
575 ->input()
576 ->field()
577 ->checkbox($this->lng->txt('active'))
578 ->withValue((bool) $this->settings->get('soap_auth_active', ''));
579
580 $server = $this->ui_factory
581 ->input()
582 ->field()
583 ->text(
584 $this->lng->txt('server'),
585 $this->lng->txt('auth_soap_server_desc')
586 )
587 ->withMaxLength(256)
588 ->withRequired(true)
589 ->withValue($this->settings->get('soap_auth_server', ''));
590
591 $port = $this->ui_factory
592 ->input()
593 ->field()
594 ->numeric(
595 $this->lng->txt('port'),
596 $this->lng->txt('auth_soap_port_desc')
597 )
598 ->withAdditionalTransformation($this->refinery->int()->isGreaterThan(0))
599 ->withAdditionalTransformation(
600 $this->refinery->int()->isLessThan(65536)
601 )
602 ->withValue((int) $this->settings->get('soap_auth_port', '0'));
603
604 $use_https = $this->ui_factory
605 ->input()
606 ->field()
607 ->checkbox($this->lng->txt('auth_soap_use_https'))
608 ->withValue((bool) $this->settings->get('soap_auth_use_https', ''));
609
610 $uri = $this->ui_factory
611 ->input()
612 ->field()
613 ->text(
614 $this->lng->txt('uri'),
615 $this->lng->txt('auth_soap_uri_desc')
616 )
617 ->withMaxLength(256)
618 ->withValue($this->settings->get('soap_auth_uri', ''));
619
620 $namespace = $this->ui_factory
621 ->input()
622 ->field()
623 ->text(
624 $this->lng->txt('auth_soap_namespace'),
625 $this->lng->txt('auth_soap_namespace_desc')
626 )
627 ->withMaxLength(256)
628 ->withValue($this->settings->get('soap_auth_namespace', ''));
629
630 $dotnet = $this->ui_factory
631 ->input()
632 ->field()
633 ->checkbox($this->lng->txt('auth_soap_use_dotnet'))
634 ->withValue((bool) $this->settings->get('soap_auth_use_dotnet', ''));
635
636 $createuser = $this->ui_factory
637 ->input()
638 ->field()
639 ->checkbox(
640 $this->lng->txt('auth_create_users'),
641 $this->lng->txt('auth_soap_create_users_desc')
642 )
643 ->withValue((bool) $this->settings->get('soap_auth_create_users', ''));
644
645 $sendmail = $this->ui_factory
646 ->input()
647 ->field()
648 ->checkbox(
649 $this->lng->txt('user_send_new_account_mail'),
650 $this->lng->txt('auth_new_account_mail_desc')
651 )
652 ->withValue((bool) $this->settings->get('soap_auth_account_mail', ''));
653
654 $defaultrole = $this->ui_factory
655 ->input()
656 ->field()
657 ->select(
658 $this->lng->txt('auth_user_default_role'),
659 $roles,
660 $this->lng->txt('auth_soap_user_default_role_desc')
661 )
662 ->withValue($this->settings->get('soap_auth_user_default_role', '4'))
663 ->withAdditionalTransformation($this->refinery->int()->isGreaterThan(0));
664
665 $allowlocal = $this->ui_factory
666 ->input()
667 ->field()
668 ->checkbox(
669 $this->lng->txt('auth_allow_local'),
670 $this->lng->txt('auth_soap_allow_local_desc')
671 )
672 ->withValue((bool) $this->settings->get('soap_auth_user_default_role', ''));
673
674 $form = $this->ui_factory->input()->container()->form()->standard(
675 $submit_action,
676 [
677 'active' => $active,
678 'server' => $server,
679 'port' => $port,
680 'use_https' => $use_https,
681 'uri' => $uri,
682 'namespace' => $namespace,
683 'dotnet' => $dotnet,
684 'createuser' => $createuser,
685 'sendmail' => $sendmail,
686 'defaultrole' => $defaultrole,
687 'allowlocal' => $allowlocal
688 ]
689 );
690 return $form;
691 }
if($err=$client->getError()) $namespace

◆ buildSOAPTestForm()

ilObjAuthSettingsGUI::buildSOAPTestForm ( string  $submit_action)
private

Definition at line 693 of file class.ilObjAuthSettingsGUI.php.

696 $ext_uid = $this->ui_factory->input()->field()->text(
697 'ext_uid'
698 );
699 $soap_pw = $this->ui_factory->input()->field()->text(
700 'soap_pw'
701 );
702 $new_user = $this->ui_factory->input()->field()
703 ->checkbox('new_user');
704 return $this->ui_factory->input()->container()->form()->standard(
705 $submit_action,
706 [
707 'ext_uid' => $ext_uid,
708 'soap_pw' => $soap_pw,
709 'new_user' => $new_user
710 ]
711 )->withSubmitLabel('Send');
712 }
$soap_pw
$ext_uid
$new_user

◆ cancelObject()

ilObjAuthSettingsGUI::cancelObject ( )

cancel action and go back to previous page

Reimplemented from ilObjectGUI.

Definition at line 489 of file class.ilObjAuthSettingsGUI.php.

489 : void
490 {
491 $this->ctrl->redirect($this, 'authSettings');
492 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ editScriptObject()

ilObjAuthSettingsGUI::editScriptObject ( )

Definition at line 786 of file class.ilObjAuthSettingsGUI.php.

786 : void
787 {
788 if (!$this->rbac_system->checkAccess('write', $this->object->getRefId())) {
789 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
790 }
791
792 if ($_SESSION['error_post_vars']) {
793 $this->tpl->setVariable('AUTH_SCRIPT_NAME', $_SESSION['error_post_vars']['auth_script']['name']);
794 } else {
795 $settings = $this->ilias->getAllSettings();
796
797 $this->tpl->setVariable('AUTH_SCRIPT_NAME', $settings['auth_script_name']);
798 }
799
800 $this->tabs_gui->setTabActive('auth_script');
801
802 $this->tpl->addBlockFile(
803 'ADM_CONTENT',
804 'adm_content',
805 'tpl.auth_script.html',
806 'components/ILIAS/Authentication'
807 );
808
809 $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
810 $this->tpl->setVariable('COLSPAN', 3);
811 $this->tpl->setVariable('TXT_AUTH_SCRIPT_TITLE', $this->lng->txt('auth_script_configure'));
812 $this->tpl->setVariable('TXT_OPTIONS', $this->lng->txt('options'));
813 $this->tpl->setVariable('TXT_AUTH_SCRIPT_NAME', $this->lng->txt('auth_script_name'));
814
815 $this->tpl->setVariable('TXT_REQUIRED_FLD', $this->lng->txt('required_field'));
816 $this->tpl->setVariable('TXT_CANCEL', $this->lng->txt('cancel'));
817 $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('save'));
818 $this->tpl->setVariable('CMD_SUBMIT', 'saveScript');
819 }

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

+ Here is the call graph for this function:

◆ editSOAPObject()

ilObjAuthSettingsGUI::editSOAPObject ( )

Definition at line 714 of file class.ilObjAuthSettingsGUI.php.

714 : void
715 {
716 if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
717 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
718 }
719
720 $soap_form = $this->buildSOAPForm($this->ctrl->getFormAction($this, 'saveSOAP'));
721 $test_form = $this->buildSOAPTestForm($this->ctrl->getFormAction($this, 'testSoapAuthConnection'));
722
723 $this->tabs_gui->setTabActive('auth_soap');
724 $panel = $this->ui_factory->panel()->standard('SOAP', [$soap_form, $test_form]);
725 $this->tpl->setContent($this->ui_renderer->render($panel));
726 }
buildSOAPTestForm(string $submit_action)
buildSOAPForm(string $submit_action)

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

+ Here is the call graph for this function:

◆ executeCommand()

ilObjAuthSettingsGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

Definition at line 851 of file class.ilObjAuthSettingsGUI.php.

851 : void
852 {
853 $next_class = $this->ctrl->getNextClass($this) ?? '';
854 $cmd = $this->ctrl->getCmd() ?? '';
855 $this->prepareOutput();
856
857 if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
858 $this->error->raiseError($this->lng->txt('msg_no_perm_read'), $this->error->WARNING);
859 }
860
861 switch ($next_class) {
862 case 'ilopenidconnectsettingsgui':
863 $this->tabs_gui->activateTab('auth_oidconnect');
864
865 $oid = new ilOpenIdConnectSettingsGUI($this->object->getRefId());
866 $this->ctrl->forwardCommand($oid);
867 break;
868
869 case 'ilsamlsettingsgui':
870 $this->tabs_gui->setTabActive('auth_saml');
871
872 $os = new ilSamlSettingsGUI($this->object->getRefId());
873 $this->ctrl->forwardCommand($os);
874 break;
875
876 case 'ilregistrationsettingsgui':
877 $this->tabs_gui->setTabActive('registration_settings');
878
879 $registration_gui = new ilRegistrationSettingsGUI();
880 $this->ctrl->forwardCommand($registration_gui);
881 break;
882
883 case 'ilpermissiongui':
884 $this->tabs_gui->setTabActive('perm_settings');
885
886 $perm_gui = new ilPermissionGUI($this);
887 $this->ctrl->forwardCommand($perm_gui);
888 break;
889
890 case 'illdapsettingsgui':
891 $this->tabs_gui->setTabActive('auth_ldap');
892
893 $ldap_settings_gui = new ilLDAPSettingsGUI($this->object->getRefId());
894 $this->ctrl->forwardCommand($ldap_settings_gui);
895 break;
896
897 case 'ilauthshibbolethsettingsgui':
898 $this->tabs_gui->setTabActive('auth_shib');
899
900 $shib_settings_gui = new ilAuthShibbolethSettingsGUI($this->object->getRefId());
901 $this->ctrl->forwardCommand($shib_settings_gui);
902 break;
903
904 case strtolower(ilAuthPageEditorGUI::class):
905 $this->setSubTabs('authSettings');
906 $this->tabs_gui->setTabActive('authentication_settings');
907 $this->tabs_gui->setSubTabActive('auth_login_editor');
908
909 $lpe = new ilAuthPageEditorGUI($this->object->getRefId());
910 $this->ctrl->forwardCommand($lpe);
911 break;
912
913 case strtolower(ilObjectContentStyleSettingsGUI::class):
914 $this->checkPermission('write');
915 $this->setTitleAndDescription();
916 $this->setSubTabs('authSettings');
917 $this->tabs_gui->activateTab('authentication_settings');
918 $this->tabs_gui->activateSubTab('style');
919
920 $settings_gui = $this->content_style_gui
921 ->objectSettingsGUIForRefId(
922 null,
923 $this->object->getRefId()
924 );
925 $this->ctrl->forwardCommand($settings_gui);
926 break;
927
928 case strtolower(ilAuthLogoutBehaviourGUI::class):
929 $this->setSubTabs('authSettings');
930 $this->tabs_gui->setTabActive('authentication_settings');
931 $this->tabs_gui->setSubTabActive('logout_behaviour');
932
933 $gui = new ilAuthLogoutBehaviourGUI();
934 $this->ctrl->forwardCommand($gui);
935 break;
936
937 default:
938 if (!$cmd) {
939 $cmd = 'authSettings';
940 }
941 $cmd .= 'Object';
942 $this->$cmd();
943
944 break;
945 }
946 }
error(string $a_errmsg)
@ilCtrl_isCalledBy ilAuthLogoutBehaviourGUI: ilObjAuthSettingsGUI @ilCtrl_Calls ilAuthLogoutBehaviour...
@ilCtrl_isCalledBy ilAuthPageEditorGUI: ilObjAuthSettingsGUI @ilCtrl_Calls ilAuthPageEditorGUI: ilLog...
Class ilAuthShibbolethSettingsGUI.
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
prepareOutput(bool $show_sub_objects=true)
Class ilRegistrationSettingsGUI.

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

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjAuthSettingsGUI::getAdminTabs ( )

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 948 of file class.ilObjAuthSettingsGUI.php.

948 : void
949 {
950 $this->getTabs();
951 }
getTabs()
@abstract overwrite in derived GUI class of your object type

◆ getAuthModeTitle()

ilObjAuthSettingsGUI::getAuthModeTitle ( )
private

Definition at line 838 of file class.ilObjAuthSettingsGUI.php.

838 : string
839 {
840 return match ((int) $this->ilias->getSetting('auth_mode')) {
841 ilAuthUtils::AUTH_LOCAL => $this->lng->txt('auth_local'),
842 ilAuthUtils::AUTH_LDAP => $this->lng->txt('auth_ldap'),
843 ilAuthUtils::AUTH_SHIBBOLETH => $this->lng->txt('auth_shib'),
844 ilAuthUtils::AUTH_SAML => $this->lng->txt('auth_saml'),
845 ilAuthUtils::AUTH_SCRIPT => $this->lng->txt('auth_script'),
846 ilAuthUtils::AUTH_APACHE => $this->lng->txt('auth_apache'),
847 default => $this->lng->txt('unknown'),
848 };
849 }
const int AUTH_SCRIPT

References ilAuthUtils\AUTH_LOCAL, ilAuthUtils\AUTH_SCRIPT, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getTabs()

ilObjAuthSettingsGUI::getTabs ( )
protected

@abstract overwrite in derived GUI class of your object type

Reimplemented from ilObjectGUI.

Definition at line 953 of file class.ilObjAuthSettingsGUI.php.

953 : void
954 {
955 $this->ctrl->setParameter($this, 'ref_id', $this->object->getRefId());
956
957 if ($this->rbac_system->checkAccess('read', $this->object->getRefId())) {
958 $this->tabs_gui->addTarget(
959 'authentication_settings',
960 $this->ctrl->getLinkTarget($this, 'authSettings'),
961 '',
962 '',
963 ''
964 );
965
966 $this->tabs_gui->addTarget(
967 'registration_settings',
968 $this->ctrl->getLinkTargetByClass('ilregistrationsettingsgui', 'view')
969 );
970
971 $this->tabs_gui->addTarget(
972 'auth_ldap',
973 $this->ctrl->getLinkTargetByClass('illdapsettingsgui', 'serverList'),
974 '',
975 '',
976 ''
977 );
978
979 $this->tabs_gui->addTarget(
980 'auth_shib',
981 $this->ctrl->getLinkTargetByClass('ilauthshibbolethsettingsgui', 'settings')
982 );
983
984 $this->tabs_gui->addTarget(
985 'auth_soap',
986 $this->ctrl->getLinkTarget($this, 'editSOAP'),
987 '',
988 '',
989 ''
990 );
991
992 $this->tabs_gui->addTarget(
993 'apache_auth_settings',
994 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_APACHE_SETTINGS),
995 '',
996 '',
997 ''
998 );
999
1000 $this->tabs_gui->addTarget(
1001 'auth_saml',
1002 $this->ctrl->getLinkTargetByClass('ilsamlsettingsgui', ilSamlSettingsGUI::DEFAULT_CMD),
1003 '',
1004 '',
1005 ''
1006 );
1007
1008 $this->tabs_gui->addTab(
1009 'auth_oidconnect',
1010 $this->lng->txt('auth_oidconnect'),
1011 $this->ctrl->getLinkTargetByClass('ilopenidconnectsettingsgui')
1012 );
1013 }
1014
1015 if ($this->rbac_system->checkAccess('edit_permission', $this->object->getRefId())) {
1016 $this->tabs_gui->addTarget(
1017 'perm_settings',
1018 $this->ctrl->getLinkTargetByClass([get_class($this), 'ilpermissiongui'], 'perm'),
1019 ['perm', 'info', 'owner'],
1020 'ilpermissiongui'
1021 );
1022 }
1023 }

References ILIAS\Repository\ctrl(), ilSamlSettingsGUI\DEFAULT_CMD, ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ registrationSettingsObject()

ilObjAuthSettingsGUI::registrationSettingsObject ( )

Definition at line 1179 of file class.ilObjAuthSettingsGUI.php.

1179 : void
1180 {
1181 $registration_gui = new ilRegistrationSettingsGUI();
1182 $this->ctrl->redirect($registration_gui);
1183 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveApacheSettingsObject()

ilObjAuthSettingsGUI::saveApacheSettingsObject ( )

Definition at line 1099 of file class.ilObjAuthSettingsGUI.php.

1099 : void
1100 {
1101 $form = (new ApacheAuthSettingsForm(
1102 $this->ref_id,
1103 $this,
1104 self::CMD_SHOW_APACHE_SETTINGS,
1105 self::CMD_SAVE_APACHE_SETTINGS
1106 ))->buildForm()->withRequest($this->http->request());
1107 if (!$form->getError()) {
1108 $data = $form->getData();
1109
1110 $settings = new ilSetting('apache_auth');
1111
1112 $fields = [
1113 'apache_auth_indicator_name',
1114 'apache_auth_indicator_value',
1115 'apache_enable_auth',
1116 'apache_enable_local',
1117 'apache_local_autocreate',
1118 'apache_enable_ldap',
1119 'apache_auth_username_config_type',
1120 'apache_auth_username_direct_mapping_fieldname',
1121 'apache_default_role',
1122 'apache_auth_target_override_login_page',
1123 'apache_auth_enable_override_login_page',
1124 'apache_auth_authenticate_on_login_page',
1125 'apache_ldap_sid'
1126 ];
1127
1128 foreach ($fields as $field) {
1129 $value = match ($field) {
1130 'apache_enable_auth',
1131 'apache_auth_enable_override_login_page',
1132 'apache_auth_username_config',
1133 'apache_auth_security',
1134 'apache_enable_ldap' => (bool) ($data[$field] ?? false),
1135 'apache_auth_username_config_type' => $data['apache_auth_username_config'][$field][0] ?? 1,
1136 'apache_auth_target_override_login_page' => $data['apache_auth_enable_override_login_page'][$field] ?? '',
1137 'apache_auth_username_direct_mapping_fieldname' => $data['apache_auth_username_config']['apache_auth_username_config_type'][1][$field] ?? '',
1138 'apache_auth_domains' => $data['apache_auth_security'][$field] ?? '',
1139 'apache_local_autocreate' => (bool) ($data['apache_enable_auth'][$field] ?? false),
1140 'apache_default_role' => $data['apache_enable_auth']['apache_local_autocreate'][$field] ?? 4,
1141 'apache_ldap_sid' => $data['apache_enable_ldap'][$field] ?? '',
1142 default => $data[$field],
1143 };
1144
1145 $settings->set(
1146 $field,
1147 ilUtil::stripSlashes(trim((string) ($value === false ? '0' : $value)))
1148 );
1149 }
1150
1151 if ($data[$field] ?? false) {
1152 $this->ilias->setSetting('apache_active', '1');
1153 } else {
1154 $this->ilias->setSetting('apache_active', '0');
1155 if ($this->ilias->getSetting('auth_mode', '0') === ilAuthUtils::AUTH_APACHE) {
1156 $this->ilias->setSetting('auth_mode', (string) ilAuthUtils::AUTH_LOCAL);
1157 }
1158 }
1159
1160 $allowed_domains = $this->validateApacheAuthAllowedDomains($data['apache_auth_security']['apache_auth_domains'] ?? '');
1161 file_put_contents(ILIAS_DATA_DIR . '/' . CLIENT_ID . '/apache_auth_allowed_domains.txt', $allowed_domains);
1162
1163 $this->tpl->setOnScreenMessage(
1164 $this->tpl::MESSAGE_TYPE_SUCCESS,
1165 $this->lng->txt('apache_settings_changed_success'),
1166 true
1167 );
1168 $this->ctrl->redirect($this, self::CMD_SHOW_APACHE_SETTINGS);
1169 }
1170
1171 $this->ctrl->redirect($this, self::CMD_SHOW_APACHE_SETTINGS);
1172 }
set(string $a_key, string $a_val)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
static http()
Fetches the global http state from ILIAS.

References $data, ilAuthUtils\AUTH_APACHE, ilAuthUtils\AUTH_LOCAL, CLIENT_ID, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS_DATA_DIR, ILIAS\Repository\lng(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ saveScriptObject()

ilObjAuthSettingsGUI::saveScriptObject ( )

Definition at line 821 of file class.ilObjAuthSettingsGUI.php.

821 : void
822 {
823 if (!$_POST['auth_script']['name']) {
824 $this->ilias->raiseError($this->lng->txt('fill_out_all_required_fields'), $this->ilias->error_obj->MESSAGE);
825 }
826
827 $this->ilias->setSetting('auth_script_name', $_POST['auth_script']['name']);
828 $this->ilias->setSetting('auth_mode', (string) ilAuthUtils::AUTH_SCRIPT);
829
830 $this->tpl->setOnScreenMessage(
831 'success',
832 $this->lng->txt('auth_mode_changed_to') . ' ' . $this->getAuthModeTitle(),
833 true
834 );
835 $this->ctrl->redirect($this, 'editScript');
836 }
$_POST['cmd']
Definition: lti.php:27

References $_POST, ilAuthUtils\AUTH_SCRIPT, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ saveSOAPObject()

ilObjAuthSettingsGUI::saveSOAPObject ( )

Definition at line 751 of file class.ilObjAuthSettingsGUI.php.

751 : void
752 {
753 if (!$this->rbac_system->checkAccess('write', $this->object->getRefId())) {
754 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
755 }
756
757 $soap_form = $this->buildSOAPForm($this->ctrl->getFormAction($this, 'saveSOAP'));
758 $test_form = $this->buildSOAPTestForm($this->ctrl->getFormAction($this, 'testSoapAuthConnection'));
759 if ($this->request->getMethod() === 'POST') {
760 $soap_form = $soap_form->withRequest($this->request);
761 $result = $soap_form->getData();
762 if ($result !== null) {
763 $this->settings->set('soap_auth_active', (string) $result['active']);
764 $this->settings->set('soap_auth_server', $result['server']);
765 $this->settings->set('soap_auth_port', (string) $result['port']);
766 $this->settings->set('soap_auth_use_https', (string) $result['use_https']);
767 $this->settings->set('soap_auth_uri', $result['uri']);
768 $this->settings->set('soap_auth_namespace', $result['namespace']);
769 $this->settings->set('soap_auth_use_dotnet', (string) $result['dotnet']);
770 $this->settings->set('soap_auth_create_users', (string) $result['createuser']);
771 $this->settings->set('soap_auth_account_mail', (string) $result['sendmail']);
772 $this->settings->set('soap_auth_user_default_role', (string) $result['defaultrole']);
773 $this->settings->set('soap_auth_allow_local', (string) $result['allowlocal']);
774
775 $this->tpl->setOnScreenMessage('success', $this->lng->txt('auth_soap_settings_saved'), true);
776 $this->logger->info('data' . print_r($result, true));
777 $this->ctrl->redirect($this, 'editSOAP');
778 }
779 }
780
781 $this->tabs_gui->setTabActive('auth_soap');
782 $panel = $this->ui_factory->panel()->standard('SOAP', [$soap_form, $test_form]);
783 $this->tpl->setContent($this->ui_renderer->render($panel));
784 }

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

+ Here is the call graph for this function:

◆ setAuthModeObject()

ilObjAuthSettingsGUI::setAuthModeObject ( )

Definition at line 494 of file class.ilObjAuthSettingsGUI.php.

494 : void
495 {
496 if (!$this->rbac_system->checkAccess('write', $this->object->getRefId())) {
497 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
498 }
499 $this->logger->debug('auth mode available:' . $this->request_wrapper->has('auth_mode'));
500
501 if (!$this->http->wrapper()->post()->has('auth_mode')) {
502 $this->ilias->raiseError($this->lng->txt('auth_err_no_mode_selected'), $this->ilias->error_obj->MESSAGE);
503 }
504 $new_auth_mode = $this->http->wrapper()->post()->retrieve('auth_mode', $this->refinery->to()->string());
505 $this->logger->debug('auth mode:' . $new_auth_mode);
506 $current_auth_mode = $this->settings->get('auth_mode', '');
507 if ($new_auth_mode === $current_auth_mode) {
508 $this->tpl->setOnScreenMessage(
509 'info',
510 $this->lng->txt('auth_mode') . ': ' . $this->getAuthModeTitle() . ' ' . $this->lng->txt(
511 'auth_mode_not_changed'
512 ),
513 true
514 );
515 $this->ctrl->redirect($this, 'authSettings');
516 }
517
518 switch ((int) $new_auth_mode) {
520 break;
521
522 // @fix changed from AUTH_SHIB > is not defined
524 if ($this->object->checkAuthSHIB() !== true) {
525 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('auth_shib_not_configured'), true);
527 $this->getReturnLocation(
528 'authSettings',
529 $this->ctrl->getLinkTargetByClass(
530 ilAuthShibbolethSettingsGUI::class,
531 'settings',
532 '',
533 false,
534 false
535 )
536 )
537 );
538 }
539 break;
540
542 if ($this->object->checkAuthScript() !== true) {
543 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('auth_script_not_configured'), true);
545 $this->getReturnLocation(
546 'authSettings',
547 $this->ctrl->getLinkTarget($this, 'editScript', '', false, false)
548 )
549 );
550 }
551 break;
552 }
553
554 $this->ilias->setSetting('auth_mode', $new_auth_mode);
555
556 $this->tpl->setOnScreenMessage(
557 'success',
558 $this->lng->txt('auth_default_mode_changed_to') . ' ' . $this->getAuthModeTitle(),
559 true
560 );
561 $this->ctrl->redirect($this, 'authSettings');
562 }
getReturnLocation(string $cmd, string $default_location="")
Get return location for command (command is method name without "Object", e.g.
static redirect(string $a_script)

References ilAuthUtils\AUTH_SAML, ilAuthUtils\AUTH_SCRIPT, ilAuthUtils\AUTH_SHIBBOLETH, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\object(), ilUtil\redirect(), ILIAS\Repository\refinery(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ setSubTabs()

ilObjAuthSettingsGUI::setSubTabs ( string  $a_tab)

Definition at line 1025 of file class.ilObjAuthSettingsGUI.php.

1025 : void
1026 {
1027 $this->lng->loadLanguageModule('auth');
1028
1029 if ($a_tab === 'authSettings' && $this->access->checkAccess('write', '', $this->object->getRefId())) {
1030 $this->tabs_gui->addSubTabTarget(
1031 'auth_settings',
1032 $this->ctrl->getLinkTarget($this, 'authSettings'),
1033 ''
1034 );
1035
1036 foreach (AuthPageEditorContext::cases() as $auth_ipe_context) {
1037 $this->ctrl->setParameterByClass(
1038 ilAuthPageEditorGUI::class,
1040 $auth_ipe_context->value
1041 );
1042 $this->tabs_gui->addSubTabTarget(
1043 $auth_ipe_context->tabIdentifier(),
1044 $this->ctrl->getLinkTargetByClass(
1045 ilAuthPageEditorGUI::class,
1047 )
1048 );
1049 $this->ctrl->setParameterByClass(
1050 ilAuthPageEditorGUI::class,
1052 null
1053 );
1054 }
1055
1056 $this->tabs_gui->addSubTabTarget(
1057 'logout_behaviour',
1058 $this->ctrl->getLinkTargetByClass(ilAuthLogoutBehaviourGUI::class, ''),
1059 ''
1060 );
1061
1062 $this->tabs_gui->addSubTab(
1063 'style',
1064 $this->lng->txt('cont_style'),
1065 $this->ctrl->getLinkTargetByClass(ilObjectContentStyleSettingsGUI::class)
1066 );
1067 }
1068 }
final const string CONTEXT_HTTP_PARAM
final const string DEFAULT_COMMAND

References ILIAS\Repository\access(), ilAuthPageEditorGUI\CONTEXT_HTTP_PARAM, ILIAS\Repository\ctrl(), ilAuthPageEditorGUI\DEFAULT_COMMAND, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ testSoapAuthConnectionObject()

ilObjAuthSettingsGUI::testSoapAuthConnectionObject ( )

Definition at line 728 of file class.ilObjAuthSettingsGUI.php.

728 : void
729 {
730 if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
731 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
732 }
733
734 $soap_form = $this->buildSOAPForm($this->ctrl->getFormAction($this, 'saveSOAP'));
735 $test_form = $this->buildSOAPTestForm($this->ctrl->getFormAction($this, 'testSoapAuthConnection'));
736 $panel_content = [$soap_form, $test_form];
737 if ($this->request->getMethod() === 'POST') {
738 $test_form = $test_form->withRequest($this->request);
739 $result = $test_form->getData();
740 if ($result !== null) {
741 $panel_content[] = $this->ui_factory->legacy()->content(
742 ilSOAPAuth::testConnection($result['ext_uid'], $result['soap_pw'], $result['new_user'])
743 );
744 }
745 }
746 $this->tabs_gui->setTabActive('auth_soap');
747 $panel = $this->ui_factory->panel()->standard('SOAP', $panel_content);
748 $this->tpl->setContent($this->ui_renderer->render($panel));
749 }

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

+ Here is the call graph for this function:

◆ updateAuthModeDeterminationObject()

ilObjAuthSettingsGUI::updateAuthModeDeterminationObject ( )
private

Definition at line 434 of file class.ilObjAuthSettingsGUI.php.

434 : void
435 {
436 if (!$this->rbac_system->checkAccess('write', $this->object->getRefId())) {
437 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
438 }
439
440 $form = $this->buildAuthModeDeterminationForm();
441 if ($form === null) {
442 $this->authSettingsObject();
443 return;
444 }
445
446 $form_valid = false;
447 $form_data = null;
448 if ($this->http->request()->getMethod() === 'POST') {
449 $form = $form->withRequest($this->http->request());
450 $form_data = $form->getData();
451 $form_valid = $form_data !== null;
452 }
453
454 if (!$form_valid) {
455 $this->tpl->setOnScreenMessage(
456 $this->tpl::MESSAGE_TYPE_FAILURE,
457 $this->lng->txt('err_wrong_login')
458 );
459 $this->authSettingsObject($form);
460 return;
461 }
462
464 $kind = (int) $form_data[self::PROP_AUTH_MODE_KIND];
465 $det->setKind($kind);
467 $sequence = $form_data[self::PROP_AUTH_MODE_SEQUENCE];
468 $this->logger->debug('pos mode:' . print_r($sequence, true));
469 asort($sequence, SORT_NUMERIC);
470 $this->logger->debug('pos mode:' . print_r($sequence, true));
471 $counter = 0;
472 $position = [];
473 foreach (array_keys($sequence) as $auth_mode) {
474 $position[$counter++] = substr($auth_mode, 1);
475 }
476 $this->logger->debug('position mode:' . print_r($position, true));
477 $det->setAuthModeSequence($position);
478 }
479 $det->save();
480
481 $this->tpl->setOnScreenMessage(
482 $this->tpl::MESSAGE_TYPE_SUCCESS,
483 $this->lng->txt('settings_saved'),
484 true
485 );
486 $this->ctrl->redirect($this, 'authSettings');
487 }
authSettingsObject(?ILIAS\UI\Component\Input\Container\Form\Form $auth_mode_determination_form=null, ?ILIAS\UI\Component\Input\Container\Form\Form $registration_role_mapping_form=null)

References $counter, ilAuthModeDetermination\_getInstance(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), and ilAuthModeDetermination\TYPE_AUTOMATIC.

+ Here is the call graph for this function:

◆ updateRegistrationRoleMappingObject()

ilObjAuthSettingsGUI::updateRegistrationRoleMappingObject ( )
private

Definition at line 286 of file class.ilObjAuthSettingsGUI.php.

286 : void
287 {
288 if (!$this->rbac_system->checkAccess('write', $this->object->getRefId())) {
289 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
290 }
291
292 $form = $this->buildRegistrationRoleMappingForm();
293 $form_valid = false;
294 $form_data = null;
295 if ($this->http->request()->getMethod() === 'POST') {
296 $form = $form->withRequest($this->http->request());
297 $form_data = $form->getData();
298 $form_valid = $form_data !== null;
299 }
300
301 if (!$form_valid) {
302 $this->tpl->setOnScreenMessage(
303 $this->tpl::MESSAGE_TYPE_FAILURE,
304 $this->lng->txt('err_wrong_login')
305 );
306 $this->authSettingsObject(null, $form);
307 return;
308 }
309
310 $f_object = [];
311 foreach ($form_data as $role_id => $auth_mode) {
312 $f_object[substr($role_id, 2)] = $auth_mode;
313 }
315
316 $this->tpl->setOnScreenMessage(
317 $this->tpl::MESSAGE_TYPE_SUCCESS,
318 $this->lng->txt('auth_mode_roles_changed'),
319 true
320 );
321 $this->ctrl->redirect($this, 'authSettings');
322 }
static _updateAuthMode(array $a_roles)

References ilObjRole\_updateAuthMode(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ validateApacheAuthAllowedDomains()

ilObjAuthSettingsGUI::validateApacheAuthAllowedDomains ( string  $text)
private

Definition at line 1174 of file class.ilObjAuthSettingsGUI.php.

1174 : string
1175 {
1176 return implode("\n", preg_split("/[\r\n]+/", $text));
1177 }

References $text.

◆ viewObject()

ilObjAuthSettingsGUI::viewObject ( )

viewObject container presentation for "administration -> repository, trash, permissions"

Reimplemented from ilObjectGUI.

Definition at line 59 of file class.ilObjAuthSettingsGUI.php.

59 : void
60 {
61 $this->authSettingsObject();
62 }

References authSettingsObject().

+ Here is the call graph for this function:

Field Documentation

◆ $content_style_gui

GUIService ilObjAuthSettingsGUI::$content_style_gui
private

Definition at line 42 of file class.ilObjAuthSettingsGUI.php.

◆ $logger

ilLogger ilObjAuthSettingsGUI::$logger
private

Definition at line 40 of file class.ilObjAuthSettingsGUI.php.

◆ CMD_SAVE_APACHE_SETTINGS

const string ilObjAuthSettingsGUI::CMD_SAVE_APACHE_SETTINGS = 'saveApacheSettings'
private

Definition at line 36 of file class.ilObjAuthSettingsGUI.php.

◆ CMD_SHOW_APACHE_SETTINGS

const string ilObjAuthSettingsGUI::CMD_SHOW_APACHE_SETTINGS = 'apacheAuthSettings'
private

Definition at line 35 of file class.ilObjAuthSettingsGUI.php.

◆ PROP_AUTH_MODE_KIND

const string ilObjAuthSettingsGUI::PROP_AUTH_MODE_KIND = 'kind'
private

Definition at line 37 of file class.ilObjAuthSettingsGUI.php.

◆ PROP_AUTH_MODE_SEQUENCE

const string ilObjAuthSettingsGUI::PROP_AUTH_MODE_SEQUENCE = 'sequence'
private

Definition at line 38 of file class.ilObjAuthSettingsGUI.php.


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