ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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, string $show_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 1127 of file class.ilObjAuthSettingsGUI.php.

1127 : void
1128 {
1129 $this->tabs_gui->setTabActive('apache_auth_settings');
1130
1131 if (!$form) {
1132 $settings = new ilSetting('apache_auth');
1133 $settingsMap = $settings->getAll();
1134
1135 $path = ILIAS_DATA_DIR . '/' . CLIENT_ID . '/apache_auth_allowed_domains.txt';
1136 if (file_exists($path) && is_readable($path)) {
1137 $settingsMap['apache_auth_domains'] = file_get_contents($path);
1138 }
1139
1140 $form = (new ApacheAuthSettingsForm(
1141 $this->ref_id,
1142 $this,
1143 self::CMD_SHOW_APACHE_SETTINGS,
1144 self::CMD_SAVE_APACHE_SETTINGS,
1145 $settingsMap
1146 ))->buildForm();
1147
1148 }
1149
1150 $this->tpl->setContent($this->ui_renderer->render([
1151 $this->ui_factory->item()->standard($this->lng->txt('apache_settings')),
1152 $form
1153 ]));
1154 }
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 $access = $this->rbac_system->checkAccess('write', $this->object->getRefId());
119 foreach ($auth_modes as $mode => $mode_name) {
120 if (!in_array($mode, $valid_modes, true) && !ilLDAPServer::isAuthModeLDAP(
121 (string) $mode
122 ) && !ilSamlIdp::isAuthModeSaml((string) $mode)) {
123 continue;
124 }
125
126 $generalSettingsTpl->setCurrentBlock('auth_mode');
127
128 if (ilLDAPServer::isAuthModeLDAP((string) $mode)) {
130 $generalSettingsTpl->setVariable('AUTH_NAME', $server->getName());
131 $generalSettingsTpl->setVariable('AUTH_ACTIVE', $server->isActive() ? $icon_ok : $icon_not_ok);
132 } elseif (ilSamlIdp::isAuthModeSaml((string) $mode)) {
134 $generalSettingsTpl->setVariable('AUTH_NAME', $idp->getEntityId());
135 $generalSettingsTpl->setVariable('AUTH_ACTIVE', $idp->isActive() ? $icon_ok : $icon_not_ok);
136 } elseif ($mode === ilAuthUtils::AUTH_OPENID_CONNECT) {
137 $generalSettingsTpl->setVariable('AUTH_NAME', $this->lng->txt('auth_' . $mode_name));
138 $generalSettingsTpl->setVariable(
139 'AUTH_ACTIVE',
140 ilOpenIdConnectSettings::getInstance()->getActive() ? $icon_ok : $icon_not_ok
141 );
142 } else {
143 $generalSettingsTpl->setVariable('AUTH_NAME', $this->lng->txt('auth_' . $mode_name));
144 $generalSettingsTpl->setVariable(
145 'AUTH_ACTIVE',
146 $this->ilias->getSetting(
147 $mode_name . '_active'
148 ) || (int) $mode === ilAuthUtils::AUTH_LOCAL ? $icon_ok : $icon_not_ok
149 );
150 }
151
152 $auth_cnt_mode = $auth_cnt[$mode_name] ?? 0;
153 if ($this->settings->get('auth_mode') === (string) $mode) {
154 $generalSettingsTpl->setVariable('AUTH_CHECKED', 'checked="checked"');
155 $auth_cnt_default = $auth_cnt['default'] ?? 0;
156 $generalSettingsTpl->setVariable(
157 'AUTH_USER_NUM',
158 ((int) $auth_cnt_mode + $auth_cnt_default) . ' (' . $this->lng->txt('auth_per_default') .
159 ': ' . $auth_cnt_default . ')'
160 );
161 } else {
162 $generalSettingsTpl->setVariable(
163 'AUTH_USER_NUM',
164 (int) $auth_cnt_mode
165 );
166 }
167 $generalSettingsTpl->setVariable('AUTH_ID', $mode_name);
168 $generalSettingsTpl->setVariable('AUTH_VAL', $mode);
169
170 if (!$access) {
171 $generalSettingsTpl->touchBlock('DISABLED');
172 }
173 $generalSettingsTpl->setCurrentBlock('auth_mode');
174 $generalSettingsTpl->parseCurrentBlock();
175 }
176
177 $generalSettingsTpl->setVariable('TXT_CONFIGURE', $this->lng->txt('auth_configure'));
178
179 if ($this->rbac_system->checkAccess('write', $this->object->getRefId())) {
180 $generalSettingsTpl->setVariable('TXT_AUTH_REMARK', $this->lng->txt('auth_remark_non_local_auth'));
181 $generalSettingsTpl->setCurrentBlock('auth_mode_submit');
182 $generalSettingsTpl->setVariable('TXT_SUBMIT', $this->lng->txt('save'));
183 $generalSettingsTpl->setVariable('CMD_SUBMIT', 'setAuthMode');
184 $generalSettingsTpl->parseCurrentBlock();
185 }
186
187 $page_content = [
188 $this->ui_factory->panel()->standard(
189 $this->lng->txt('auth_select'),
190 $this->ui_factory->legacy()->content(implode('', [
191 $this->ui_renderer->render($this->ui_factory->messageBox()->info(
192 $this->lng->txt('auth_mode_default_change_info')
193 )),
194 $generalSettingsTpl->get()
195 ])),
196 )
197 ];
198
199 $auth_mode_determination_form = $auth_mode_determination_form ?? $this->buildAuthModeDeterminationForm();
200 if ($auth_mode_determination_form !== null) {
201 $page_content[] = $this->ui_factory->panel()->standard(
202 $this->lng->txt('auth_auth_mode_determination'),
203 $auth_mode_determination_form
204 );
205 }
206
207 $page_content[] = $this->ui_factory->panel()->standard(
208 $this->lng->txt('auth_active_roles'),
209 $registration_role_mapping_form ?? $this->buildRegistrationRoleMappingForm()
210 );
211
212 $this->tpl->setContent(
213 $this->ui_renderer->render($page_content)
214 );
215 }
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
ilAccessHandler $access
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)
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)
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 341 of file class.ilObjAuthSettingsGUI.php.

342 {
344 if ($det->getCountActiveAuthModes() <= 1) {
345 return null;
346 }
347
348 $access = $this->rbac_system->checkAccess('write', $this->object->getRefId());
349
350 $automatic_options = [];
351 $counter = 1;
352 $auth_sequenced = $det->getAuthModeSequence();
353 foreach ($auth_sequenced as $auth_mode) {
354 $text = '';
355 switch ($auth_mode) {
356 case ilLDAPServer::isAuthModeLDAP((string) $auth_mode):
357 $auth_id = ilLDAPServer::getServerIdByAuthMode($auth_mode);
359 $text = $server->getName();
360 break;
362 $text = $this->lng->txt('auth_local');
363 break;
365 $text = $this->lng->txt('auth_soap');
366 break;
368 $text = $this->lng->txt('auth_apache');
369 break;
370 default:
371 foreach (ilAuthUtils::getAuthPlugins() as $pl) {
372 $option = $pl->getMultipleAuthModeOptions($auth_mode);
373 $text = $option[$auth_mode]['txt'];
374 }
375 break;
376 }
377
378 $automatic_options['m' . $auth_mode] = $this->ui_factory
379 ->input()
380 ->field()
381 ->numeric($text)
382 ->withDedicatedName('m' . $auth_mode)
383 ->withValue($counter++)
384 ->withDisabled(!$access);
385 }
386
387 $options = [
388 (string) ilAuthModeDetermination::TYPE_MANUAL => $this->ui_factory
389 ->input()
390 ->field()
391 ->group(
392 [],
393 $this->lng->txt('auth_by_user')
394 )
395 ->withDedicatedName((string) ilAuthModeDetermination::TYPE_MANUAL)
396 ->withDisabled(!$access),
397 (string) ilAuthModeDetermination::TYPE_AUTOMATIC => $this->ui_factory
398 ->input()
399 ->field()
400 ->group(
401 $automatic_options,
402 $this->lng->txt('auth_automatic')
403 )
404 ->withDedicatedName((string) ilAuthModeDetermination::TYPE_AUTOMATIC)
405 ->withDisabled(!$access)
406 ];
407
408 $sections = [
409 self::PROP_AUTH_MODE_KIND => $this->ui_factory
410 ->input()
411 ->field()
412 ->switchableGroup(
413 $options,
414 $this->lng->txt('auth_kind_determination'),
415 $this->lng->txt('auth_mode_determination_info')
416 )
417 ->withDedicatedName(self::PROP_AUTH_MODE_KIND)
418 ->withValue((string) $det->getKind())
419 ->withDisabled(!$access)
420 ->withRequired(true)
421 ];
422
423 $form = $this->ui_factory
424 ->input()
425 ->container()
426 ->form()
427 ->standard(
428 $access ?
429 $this->ctrl->getFormAction($this, 'updateAuthModeDetermination') :
430 $this->ctrl->getFormAction($this, 'authSettings'),
431 $sections
432 )
433 ->withDedicatedName('auth_mode_determination')
434 ->withAdditionalTransformation(
435 $this->refinery->custom()->transformation(function ($value): array {
436 $auth_mode_kind = (int) ($value[self::PROP_AUTH_MODE_KIND][0] ?? ilAuthModeDetermination::TYPE_MANUAL);
437 $sequence = [];
438 if ($auth_mode_kind === ilAuthModeDetermination::TYPE_AUTOMATIC) {
439 $sequence = (array) ($value[self::PROP_AUTH_MODE_KIND][1] ?? []);
440 }
441
442 $merged_values = array_merge(
443 [
444 self::PROP_AUTH_MODE_KIND => $auth_mode_kind,
445 ],
446 [
447 self::PROP_AUTH_MODE_SEQUENCE => $sequence
448 ]
449 );
450
451 return $merged_values;
452 })
453 );
454
455 if (!$access) {
456 $form = $form->withSubmitLabel($this->lng->txt('refresh'));
457 }
458
459 return $form;
460 }
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 217 of file class.ilObjAuthSettingsGUI.php.

218 {
219 $access = $this->rbac_system->checkAccess('write', $this->object->getRefId());
220
221 $fields = [];
223
224 $excluded_auth_names = ['default', 'saml', 'shibboleth', 'ldap', 'lti', 'apache', 'ecs', 'oidc'];
225 // do not list auth modes with external login screen
226 // even not default, because it can easily be set to
227 // a non-working auth mode
228 $active_auth_modes = array_filter(
230 static function (string $auth_name) use ($excluded_auth_names): bool {
231 foreach ($excluded_auth_names as $excluded_auth_name) {
232 if ($auth_name === $excluded_auth_name) {
233 return false;
234 }
235
236 if (str_starts_with($auth_name, $excluded_auth_name)) {
237 return false;
238 }
239 }
240 return true;
241 },
242 ARRAY_FILTER_USE_KEY
243 );
244
245 foreach ($reg_roles as $role) {
246 $options = [];
247 $value = null;
248 foreach ($active_auth_modes as $auth_name => $auth_key) {
249 if ($auth_name === 'default') {
250 $name = $this->lng->txt('auth_' . $auth_name) . ' (' . $this->lng->txt(
251 'auth_' . ilAuthUtils::_getAuthModeName($auth_key)
252 ) . ')';
253 } else {
254 $name = $this->lng->txt('auth_' . $auth_name);
255 }
256
257 $options[$auth_name] = $name;
258
259 if ($role['auth_mode'] === $auth_name) {
260 $value = $auth_name;
261 }
262 }
263
264 if ($options === []) {
265 continue;
266 }
267
269
270 $fields['r_' . $role['id']] = $this->ui_factory
271 ->input()
272 ->field()
273 ->select(
274 $role['title'],
275 $options,
276 $this->lng->txt('auth_role_auth_mode')
277 )
278 ->withRequired(true)
279 ->withValue($value)
280 ->withDedicatedName('r_' . $role['id'])
281 ->withDisabled(!$access);
282 }
283
284 $form = $this->ui_factory
285 ->input()
286 ->container()
287 ->form()
288 ->standard(
289 $access ?
290 $this->ctrl->getFormAction($this, 'updateRegistrationRoleMapping') :
291 $this->ctrl->getFormAction($this, 'authSettings'),
292 $fields
293 )
294 ->withDedicatedName('registration_role_mapping');
295
296 if (!$access) {
297 $form = $form->withSubmitLabel($this->lng->txt('refresh'));
298 }
299
300 return $form;
301 }
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,
string  $show_action 
)
private

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

596 $role_list = $this->rbac_review->getRolesByFilter(2, $this->object->getId());
597 $roles = [];
598
599 foreach ($role_list as $role) {
600 $roles[$role['obj_id']] = $role['title'];
601 }
602
603 $active = $this->ui_factory
604 ->input()
605 ->field()
606 ->checkbox($this->lng->txt('active'))
607 ->withValue((bool) $this->settings->get('soap_auth_active', ''));
608
609 $server = $this->ui_factory
610 ->input()
611 ->field()
612 ->text(
613 $this->lng->txt('server'),
614 $this->lng->txt('auth_soap_server_desc')
615 )
616 ->withMaxLength(256)
617 ->withRequired(true)
618 ->withValue($this->settings->get('soap_auth_server', ''));
619
620 $port = $this->ui_factory
621 ->input()
622 ->field()
623 ->numeric(
624 $this->lng->txt('port'),
625 $this->lng->txt('auth_soap_port_desc')
626 )
627 ->withAdditionalTransformation($this->refinery->int()->isGreaterThan(0))
628 ->withAdditionalTransformation(
629 $this->refinery->int()->isLessThan(65536)
630 )
631 ->withValue((int) $this->settings->get('soap_auth_port', '0'));
632
633 $use_https = $this->ui_factory
634 ->input()
635 ->field()
636 ->checkbox($this->lng->txt('auth_soap_use_https'))
637 ->withValue((bool) $this->settings->get('soap_auth_use_https', ''));
638
639 $uri = $this->ui_factory
640 ->input()
641 ->field()
642 ->text(
643 $this->lng->txt('uri'),
644 $this->lng->txt('auth_soap_uri_desc')
645 )
646 ->withMaxLength(256)
647 ->withValue($this->settings->get('soap_auth_uri', ''));
648
649 $namespace = $this->ui_factory
650 ->input()
651 ->field()
652 ->text(
653 $this->lng->txt('auth_soap_namespace'),
654 $this->lng->txt('auth_soap_namespace_desc')
655 )
656 ->withMaxLength(256)
657 ->withValue($this->settings->get('soap_auth_namespace', ''));
658
659 $dotnet = $this->ui_factory
660 ->input()
661 ->field()
662 ->checkbox($this->lng->txt('auth_soap_use_dotnet'))
663 ->withValue((bool) $this->settings->get('soap_auth_use_dotnet', ''));
664
665 $createuser = $this->ui_factory
666 ->input()
667 ->field()
668 ->checkbox(
669 $this->lng->txt('auth_create_users'),
670 $this->lng->txt('auth_soap_create_users_desc')
671 )
672 ->withValue((bool) $this->settings->get('soap_auth_create_users', ''));
673
674 $sendmail = $this->ui_factory
675 ->input()
676 ->field()
677 ->checkbox(
678 $this->lng->txt('user_send_new_account_mail'),
679 $this->lng->txt('auth_new_account_mail_desc')
680 )
681 ->withValue((bool) $this->settings->get('soap_auth_account_mail', ''));
682
683 $defaultrole = $this->ui_factory
684 ->input()
685 ->field()
686 ->select(
687 $this->lng->txt('auth_user_default_role'),
688 $roles,
689 $this->lng->txt('auth_soap_user_default_role_desc')
690 )
691 ->withValue($this->settings->get('soap_auth_user_default_role', '4'))
692 ->withAdditionalTransformation($this->refinery->int()->isGreaterThan(0));
693
694 $allowlocal = $this->ui_factory
695 ->input()
696 ->field()
697 ->checkbox(
698 $this->lng->txt('auth_allow_local'),
699 $this->lng->txt('auth_soap_allow_local_desc')
700 )
701 ->withValue((bool) $this->settings->get('soap_auth_user_default_role', ''));
702
703 $access = $this->rbac_system->checkAccess('write', $this->object->getRefId());
704 $inputs = [
705 'active' => $active,
706 'server' => $server,
707 'port' => $port,
708 'use_https' => $use_https,
709 'uri' => $uri,
710 'namespace' => $namespace,
711 'dotnet' => $dotnet,
712 'createuser' => $createuser,
713 'sendmail' => $sendmail,
714 'defaultrole' => $defaultrole,
715 'allowlocal' => $allowlocal
716 ];
717
718 if (!$access) {
719 foreach ($inputs as $key => $input) {
720 $inputs[$key] = $input->withDisabled(true);
721 }
722 }
723
724 $form = $this->ui_factory->input()->container()->form()->standard(
725 $access ? $submit_action : $show_action,
726 $inputs
727 );
728
729 if (!$access) {
730 $form = $form->withSubmitLabel($this->lng->txt('refresh'));
731 }
732
733 return $form;
734 }
if($err=$client->getError()) $namespace

◆ buildSOAPTestForm()

ilObjAuthSettingsGUI::buildSOAPTestForm ( string  $submit_action)
private

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

739 $ext_uid = $this->ui_factory->input()->field()->text(
740 'ext_uid'
741 );
742 $soap_pw = $this->ui_factory->input()->field()->text(
743 'soap_pw'
744 );
745 $new_user = $this->ui_factory->input()->field()
746 ->checkbox('new_user');
747 return $this->ui_factory->input()->container()->form()->standard(
748 $submit_action,
749 [
750 'ext_uid' => $ext_uid,
751 'soap_pw' => $soap_pw,
752 'new_user' => $new_user
753 ]
754 )->withSubmitLabel($this->lng->txt('send'));
755 }
$soap_pw
$ext_uid
$new_user

◆ cancelObject()

ilObjAuthSettingsGUI::cancelObject ( )

cancel action and go back to previous page

Reimplemented from ilObjectGUI.

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

517 : void
518 {
519 $this->ctrl->redirect($this, 'authSettings');
520 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ editScriptObject()

ilObjAuthSettingsGUI::editScriptObject ( )

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

844 : void
845 {
846 if (!$this->rbac_system->checkAccess('write', $this->object->getRefId())) {
847 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
848 }
849
850 if ($_SESSION['error_post_vars']) {
851 $this->tpl->setVariable('AUTH_SCRIPT_NAME', $_SESSION['error_post_vars']['auth_script']['name']);
852 } else {
853 $settings = $this->ilias->getAllSettings();
854
855 $this->tpl->setVariable('AUTH_SCRIPT_NAME', $settings['auth_script_name']);
856 }
857
858 $this->tabs_gui->setTabActive('auth_script');
859
860 $this->tpl->addBlockFile(
861 'ADM_CONTENT',
862 'adm_content',
863 'tpl.auth_script.html',
864 'components/ILIAS/Authentication'
865 );
866
867 $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
868 $this->tpl->setVariable('COLSPAN', 3);
869 $this->tpl->setVariable('TXT_AUTH_SCRIPT_TITLE', $this->lng->txt('auth_script_configure'));
870 $this->tpl->setVariable('TXT_OPTIONS', $this->lng->txt('options'));
871 $this->tpl->setVariable('TXT_AUTH_SCRIPT_NAME', $this->lng->txt('auth_script_name'));
872
873 $this->tpl->setVariable('TXT_REQUIRED_FLD', $this->lng->txt('required_field'));
874 $this->tpl->setVariable('TXT_CANCEL', $this->lng->txt('cancel'));
875 $this->tpl->setVariable('TXT_SUBMIT', $this->lng->txt('save'));
876 $this->tpl->setVariable('CMD_SUBMIT', 'saveScript');
877 }

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

+ Here is the call graph for this function:

◆ editSOAPObject()

ilObjAuthSettingsGUI::editSOAPObject ( )

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

757 : void
758 {
759 if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
760 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
761 }
762
763 $soap_form = $this->buildSOAPForm(
764 $this->ctrl->getFormAction($this, 'saveSOAP'),
765 $this->ctrl->getFormAction($this, 'editSOAP')
766 );
767 $test_form = $this->buildSOAPTestForm(
768 $this->ctrl->getFormAction($this, 'testSoapAuthConnection'),
769 );
770
771 $this->tabs_gui->setTabActive('auth_soap');
772 $panel = $this->ui_factory->panel()->standard('SOAP', [$soap_form, $test_form]);
773 $this->tpl->setContent($this->ui_renderer->render($panel));
774 }
buildSOAPTestForm(string $submit_action)
buildSOAPForm(string $submit_action, string $show_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 909 of file class.ilObjAuthSettingsGUI.php.

909 : void
910 {
911 $next_class = $this->ctrl->getNextClass($this) ?? '';
912 $cmd = $this->ctrl->getCmd() ?? '';
913 $this->prepareOutput();
914
915 if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
916 $this->error->raiseError($this->lng->txt('msg_no_perm_read'), $this->error->WARNING);
917 }
918
919 switch ($next_class) {
920 case 'ilopenidconnectsettingsgui':
921 $this->tabs_gui->activateTab('auth_oidconnect');
922
923 $oid = new ilOpenIdConnectSettingsGUI($this->object->getRefId());
924 $this->ctrl->forwardCommand($oid);
925 break;
926
927 case 'ilsamlsettingsgui':
928 $this->tabs_gui->setTabActive('auth_saml');
929
930 $os = new ilSamlSettingsGUI($this->object->getRefId());
931 $this->ctrl->forwardCommand($os);
932 break;
933
934 case 'ilregistrationsettingsgui':
935 $this->tabs_gui->setTabActive('registration_settings');
936
937 $registration_gui = new ilRegistrationSettingsGUI();
938 $this->ctrl->forwardCommand($registration_gui);
939 break;
940
941 case 'ilpermissiongui':
942 $this->tabs_gui->setTabActive('perm_settings');
943
944 $perm_gui = new ilPermissionGUI($this);
945 $this->ctrl->forwardCommand($perm_gui);
946 break;
947
948 case 'illdapsettingsgui':
949 $this->tabs_gui->setTabActive('auth_ldap');
950
951 $ldap_settings_gui = new ilLDAPSettingsGUI($this->object->getRefId());
952 $this->ctrl->forwardCommand($ldap_settings_gui);
953 break;
954
955 case 'ilauthshibbolethsettingsgui':
956 $this->tabs_gui->setTabActive('auth_shib');
957
958 $shib_settings_gui = new ilAuthShibbolethSettingsGUI($this->object->getRefId());
959 $this->ctrl->forwardCommand($shib_settings_gui);
960 break;
961
962 case strtolower(ilAuthPageEditorGUI::class):
963 $this->setSubTabs('authSettings');
964 $this->tabs_gui->setTabActive('authentication_settings');
965 $this->tabs_gui->setSubTabActive('auth_login_editor');
966
967 $lpe = new ilAuthPageEditorGUI($this->object->getRefId());
968 $this->ctrl->forwardCommand($lpe);
969 break;
970
971 case strtolower(ilObjectContentStyleSettingsGUI::class):
972 $this->setTitleAndDescription();
973 $this->setSubTabs('authSettings');
974 $this->tabs_gui->activateTab('authentication_settings');
975 $this->tabs_gui->activateSubTab('style');
976
977 $settings_gui = $this->content_style_gui
978 ->objectSettingsGUIForRefId(
979 null,
980 $this->object->getRefId()
981 );
982 $this->ctrl->forwardCommand($settings_gui);
983 break;
984
985 case strtolower(ilAuthLogoutBehaviourGUI::class):
986 $this->setSubTabs('authSettings');
987 $this->tabs_gui->setTabActive('authentication_settings');
988 $this->tabs_gui->setSubTabActive('logout_behaviour');
989
990 $gui = new ilAuthLogoutBehaviourGUI($this->object->getRefId());
991 $this->ctrl->forwardCommand($gui);
992 break;
993
994 default:
995 if (!$cmd) {
996 $cmd = 'authSettings';
997 }
998 $cmd .= 'Object';
999 $this->$cmd();
1000
1001 break;
1002 }
1003 }
error(string $a_errmsg)
@ilCtrl_isCalledBy ilAuthLogoutBehaviourGUI: ilObjAuthSettingsGUI @ilCtrl_Calls ilAuthLogoutBehaviour...
@ilCtrl_isCalledBy ilAuthPageEditorGUI: ilObjAuthSettingsGUI @ilCtrl_Calls ilAuthPageEditorGUI: ilLog...
Class ilAuthShibbolethSettingsGUI.
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 1005 of file class.ilObjAuthSettingsGUI.php.

1005 : void
1006 {
1007 $this->getTabs();
1008 }
getTabs()
@abstract overwrite in derived GUI class of your object type

◆ getAuthModeTitle()

ilObjAuthSettingsGUI::getAuthModeTitle ( )
private

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

896 : string
897 {
898 return match ((int) $this->ilias->getSetting('auth_mode')) {
899 ilAuthUtils::AUTH_LOCAL => $this->lng->txt('auth_local'),
900 ilAuthUtils::AUTH_LDAP => $this->lng->txt('auth_ldap'),
901 ilAuthUtils::AUTH_SHIBBOLETH => $this->lng->txt('auth_shib'),
902 ilAuthUtils::AUTH_SAML => $this->lng->txt('auth_saml'),
903 ilAuthUtils::AUTH_SCRIPT => $this->lng->txt('auth_script'),
904 ilAuthUtils::AUTH_APACHE => $this->lng->txt('auth_apache'),
905 default => $this->lng->txt('unknown'),
906 };
907 }
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 1010 of file class.ilObjAuthSettingsGUI.php.

1010 : void
1011 {
1012 $this->ctrl->setParameter($this, 'ref_id', $this->object->getRefId());
1013
1014 if ($this->rbac_system->checkAccess('read', $this->object->getRefId())) {
1015 $this->tabs_gui->addTarget(
1016 'authentication_settings',
1017 $this->ctrl->getLinkTarget($this, 'authSettings'),
1018 '',
1019 '',
1020 ''
1021 );
1022
1023 $this->tabs_gui->addTarget(
1024 'registration_settings',
1025 $this->ctrl->getLinkTargetByClass('ilregistrationsettingsgui', 'view')
1026 );
1027
1028 $this->tabs_gui->addTarget(
1029 'auth_ldap',
1030 $this->ctrl->getLinkTargetByClass('illdapsettingsgui', 'serverList'),
1031 '',
1032 '',
1033 ''
1034 );
1035
1036 $this->tabs_gui->addTarget(
1037 'auth_shib',
1038 $this->ctrl->getLinkTargetByClass('ilauthshibbolethsettingsgui', 'settings')
1039 );
1040
1041 $this->tabs_gui->addTarget(
1042 'auth_soap',
1043 $this->ctrl->getLinkTarget($this, 'editSOAP'),
1044 '',
1045 '',
1046 ''
1047 );
1048
1049 $this->tabs_gui->addTarget(
1050 'apache_auth_settings',
1051 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_APACHE_SETTINGS),
1052 '',
1053 '',
1054 ''
1055 );
1056
1057 $this->tabs_gui->addTarget(
1058 'auth_saml',
1059 $this->ctrl->getLinkTargetByClass('ilsamlsettingsgui', ilSamlSettingsGUI::DEFAULT_CMD),
1060 '',
1061 '',
1062 ''
1063 );
1064
1065 $this->tabs_gui->addTab(
1066 'auth_oidconnect',
1067 $this->lng->txt('auth_oidconnect'),
1068 $this->ctrl->getLinkTargetByClass('ilopenidconnectsettingsgui')
1069 );
1070 }
1071
1072 if ($this->rbac_system->checkAccess('edit_permission', $this->object->getRefId())) {
1073 $this->tabs_gui->addTarget(
1074 'perm_settings',
1075 $this->ctrl->getLinkTargetByClass([get_class($this), 'ilpermissiongui'], 'perm'),
1076 ['perm', 'info', 'owner'],
1077 'ilpermissiongui'
1078 );
1079 }
1080 }

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 1236 of file class.ilObjAuthSettingsGUI.php.

1236 : void
1237 {
1238 $registration_gui = new ilRegistrationSettingsGUI();
1239 $this->ctrl->redirect($registration_gui);
1240 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveApacheSettingsObject()

ilObjAuthSettingsGUI::saveApacheSettingsObject ( )

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

1156 : void
1157 {
1158 $form = (new ApacheAuthSettingsForm(
1159 $this->ref_id,
1160 $this,
1161 self::CMD_SHOW_APACHE_SETTINGS,
1162 self::CMD_SAVE_APACHE_SETTINGS
1163 ))->buildForm()->withRequest($this->http->request());
1164 if (!$form->getError()) {
1165 $data = $form->getData();
1166
1167 $settings = new ilSetting('apache_auth');
1168
1169 $fields = [
1170 'apache_auth_indicator_name',
1171 'apache_auth_indicator_value',
1172 'apache_enable_auth',
1173 'apache_enable_local',
1174 'apache_local_autocreate',
1175 'apache_enable_ldap',
1176 'apache_auth_username_config_type',
1177 'apache_auth_username_direct_mapping_fieldname',
1178 'apache_default_role',
1179 'apache_auth_target_override_login_page',
1180 'apache_auth_enable_override_login_page',
1181 'apache_auth_authenticate_on_login_page',
1182 'apache_ldap_sid'
1183 ];
1184
1185 foreach ($fields as $field) {
1186 $value = match ($field) {
1187 'apache_enable_auth',
1188 'apache_auth_enable_override_login_page',
1189 'apache_auth_username_config',
1190 'apache_auth_security',
1191 'apache_enable_ldap' => (bool) ($data[$field] ?? false),
1192 'apache_auth_username_config_type' => $data['apache_auth_username_config'][$field][0] ?? 1,
1193 'apache_auth_target_override_login_page' => $data['apache_auth_enable_override_login_page'][$field] ?? '',
1194 'apache_auth_username_direct_mapping_fieldname' => $data['apache_auth_username_config']['apache_auth_username_config_type'][1][$field] ?? '',
1195 'apache_auth_domains' => $data['apache_auth_security'][$field] ?? '',
1196 'apache_local_autocreate' => (bool) ($data['apache_enable_auth'][$field] ?? false),
1197 'apache_default_role' => $data['apache_enable_auth']['apache_local_autocreate'][$field] ?? 4,
1198 'apache_ldap_sid' => $data['apache_enable_ldap'][$field] ?? '',
1199 default => $data[$field],
1200 };
1201
1202 $settings->set(
1203 $field,
1204 ilUtil::stripSlashes(trim((string) ($value === false ? '0' : $value)))
1205 );
1206 }
1207
1208 if ($data[$field] ?? false) {
1209 $this->ilias->setSetting('apache_active', '1');
1210 } else {
1211 $this->ilias->setSetting('apache_active', '0');
1212 if ($this->ilias->getSetting('auth_mode', '0') === ilAuthUtils::AUTH_APACHE) {
1213 $this->ilias->setSetting('auth_mode', (string) ilAuthUtils::AUTH_LOCAL);
1214 }
1215 }
1216
1217 $allowed_domains = $this->validateApacheAuthAllowedDomains($data['apache_auth_security']['apache_auth_domains'] ?? '');
1218 file_put_contents(ILIAS_DATA_DIR . '/' . CLIENT_ID . '/apache_auth_allowed_domains.txt', $allowed_domains);
1219
1220 $this->tpl->setOnScreenMessage(
1221 $this->tpl::MESSAGE_TYPE_SUCCESS,
1222 $this->lng->txt('apache_settings_changed_success'),
1223 true
1224 );
1225 $this->ctrl->redirect($this, self::CMD_SHOW_APACHE_SETTINGS);
1226 }
1227
1228 $this->apacheAuthSettingsObject($form);
1229 }
apacheAuthSettingsObject(?StandardForm $form=null)
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 879 of file class.ilObjAuthSettingsGUI.php.

879 : void
880 {
881 if (!$_POST['auth_script']['name']) {
882 $this->ilias->raiseError($this->lng->txt('fill_out_all_required_fields'), $this->ilias->error_obj->MESSAGE);
883 }
884
885 $this->ilias->setSetting('auth_script_name', $_POST['auth_script']['name']);
886 $this->ilias->setSetting('auth_mode', (string) ilAuthUtils::AUTH_SCRIPT);
887
888 $this->tpl->setOnScreenMessage(
889 'success',
890 $this->lng->txt('auth_mode_changed_to') . ' ' . $this->getAuthModeTitle(),
891 true
892 );
893 $this->ctrl->redirect($this, 'editScript');
894 }
$_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 804 of file class.ilObjAuthSettingsGUI.php.

804 : void
805 {
806 if (!$this->rbac_system->checkAccess('write', $this->object->getRefId())) {
807 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
808 }
809
810 $soap_form = $this->buildSOAPForm(
811 $this->ctrl->getFormAction($this, 'saveSOAP'),
812 $this->ctrl->getFormAction($this, 'editSOAP')
813 );
814 $test_form = $this->buildSOAPTestForm(
815 $this->ctrl->getFormAction($this, 'testSoapAuthConnection'),
816 );
817 if ($this->request->getMethod() === 'POST') {
818 $soap_form = $soap_form->withRequest($this->request);
819 $result = $soap_form->getData();
820 if ($result !== null) {
821 $this->settings->set('soap_auth_active', (string) $result['active']);
822 $this->settings->set('soap_auth_server', $result['server']);
823 $this->settings->set('soap_auth_port', (string) $result['port']);
824 $this->settings->set('soap_auth_use_https', (string) $result['use_https']);
825 $this->settings->set('soap_auth_uri', $result['uri']);
826 $this->settings->set('soap_auth_namespace', $result['namespace']);
827 $this->settings->set('soap_auth_use_dotnet', (string) $result['dotnet']);
828 $this->settings->set('soap_auth_create_users', (string) $result['createuser']);
829 $this->settings->set('soap_auth_account_mail', (string) $result['sendmail']);
830 $this->settings->set('soap_auth_user_default_role', (string) $result['defaultrole']);
831 $this->settings->set('soap_auth_allow_local', (string) $result['allowlocal']);
832
833 $this->tpl->setOnScreenMessage('success', $this->lng->txt('auth_soap_settings_saved'), true);
834 $this->logger->info('data' . print_r($result, true));
835 $this->ctrl->redirect($this, 'editSOAP');
836 }
837 }
838
839 $this->tabs_gui->setTabActive('auth_soap');
840 $panel = $this->ui_factory->panel()->standard('SOAP', [$soap_form, $test_form]);
841 $this->tpl->setContent($this->ui_renderer->render($panel));
842 }

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 522 of file class.ilObjAuthSettingsGUI.php.

522 : void
523 {
524 if (!$this->rbac_system->checkAccess('write', $this->object->getRefId())) {
525 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
526 }
527 $this->logger->debug('auth mode available:' . $this->request_wrapper->has('auth_mode'));
528
529 if (!$this->http->wrapper()->post()->has('auth_mode')) {
530 $this->ilias->raiseError($this->lng->txt('auth_err_no_mode_selected'), $this->ilias->error_obj->MESSAGE);
531 }
532 $new_auth_mode = $this->http->wrapper()->post()->retrieve('auth_mode', $this->refinery->to()->string());
533 $this->logger->debug('auth mode:' . $new_auth_mode);
534 $current_auth_mode = $this->settings->get('auth_mode', '');
535 if ($new_auth_mode === $current_auth_mode) {
536 $this->tpl->setOnScreenMessage(
537 'info',
538 $this->lng->txt('auth_mode') . ': ' . $this->getAuthModeTitle() . ' ' . $this->lng->txt(
539 'auth_mode_not_changed'
540 ),
541 true
542 );
543 $this->ctrl->redirect($this, 'authSettings');
544 }
545
546 switch ((int) $new_auth_mode) {
548 break;
549
550 // @fix changed from AUTH_SHIB > is not defined
552 if ($this->object->checkAuthSHIB() !== true) {
553 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('auth_shib_not_configured'), true);
555 $this->getReturnLocation(
556 'authSettings',
557 $this->ctrl->getLinkTargetByClass(
558 ilAuthShibbolethSettingsGUI::class,
559 'settings',
560 '',
561 false,
562 false
563 )
564 )
565 );
566 }
567 break;
568
570 if ($this->object->checkAuthScript() !== true) {
571 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('auth_script_not_configured'), true);
573 $this->getReturnLocation(
574 'authSettings',
575 $this->ctrl->getLinkTarget($this, 'editScript', '', false, false)
576 )
577 );
578 }
579 break;
580 }
581
582 $this->ilias->setSetting('auth_mode', $new_auth_mode);
583
584 $this->tpl->setOnScreenMessage(
585 'success',
586 $this->lng->txt('auth_default_mode_changed_to') . ' ' . $this->getAuthModeTitle(),
587 true
588 );
589 $this->ctrl->redirect($this, 'authSettings');
590 }
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 1082 of file class.ilObjAuthSettingsGUI.php.

1082 : void
1083 {
1084 $this->lng->loadLanguageModule('auth');
1085
1086 if ($a_tab === 'authSettings' && $this->access->checkAccess('read', '', $this->object->getRefId())) {
1087 $this->tabs_gui->addSubTabTarget(
1088 'auth_settings',
1089 $this->ctrl->getLinkTarget($this, 'authSettings'),
1090 ''
1091 );
1092
1093 foreach (AuthPageEditorContext::cases() as $auth_ipe_context) {
1094 $this->ctrl->setParameterByClass(
1095 ilAuthPageEditorGUI::class,
1097 $auth_ipe_context->value
1098 );
1099 $this->tabs_gui->addSubTabTarget(
1100 $auth_ipe_context->tabIdentifier(),
1101 $this->ctrl->getLinkTargetByClass(
1102 ilAuthPageEditorGUI::class,
1104 )
1105 );
1106 $this->ctrl->setParameterByClass(
1107 ilAuthPageEditorGUI::class,
1109 null
1110 );
1111 }
1112
1113 $this->tabs_gui->addSubTabTarget(
1114 'logout_behaviour',
1115 $this->ctrl->getLinkTargetByClass(ilAuthLogoutBehaviourGUI::class, ''),
1116 ''
1117 );
1118
1119 $this->tabs_gui->addSubTab(
1120 'style',
1121 $this->lng->txt('cont_style'),
1122 $this->ctrl->getLinkTargetByClass(ilObjectContentStyleSettingsGUI::class)
1123 );
1124 }
1125 }
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 776 of file class.ilObjAuthSettingsGUI.php.

776 : void
777 {
778 if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
779 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
780 }
781
782 $soap_form = $this->buildSOAPForm(
783 $this->ctrl->getFormAction($this, 'saveSOAP'),
784 $this->ctrl->getFormAction($this, 'editSOAP')
785 );
786 $test_form = $this->buildSOAPTestForm(
787 $this->ctrl->getFormAction($this, 'testSoapAuthConnection')
788 );
789 $panel_content = [$soap_form, $test_form];
790 if ($this->request->getMethod() === 'POST') {
791 $test_form = $test_form->withRequest($this->request);
792 $result = $test_form->getData();
793 if ($result !== null) {
794 $panel_content[] = $this->ui_factory->legacy()->content(
795 ilAuthSOAP::testConnection($result['ext_uid'], $result['soap_pw'], $result['new_user'])
796 );
797 }
798 }
799 $this->tabs_gui->setTabActive('auth_soap');
800 $panel = $this->ui_factory->panel()->standard('SOAP', $panel_content);
801 $this->tpl->setContent($this->ui_renderer->render($panel));
802 }
static testConnection(string $a_ext_uid, string $a_soap_pw, bool $a_new_user)

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

+ Here is the call graph for this function:

◆ updateAuthModeDeterminationObject()

ilObjAuthSettingsGUI::updateAuthModeDeterminationObject ( )
private

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

462 : void
463 {
464 if (!$this->rbac_system->checkAccess('write', $this->object->getRefId())) {
465 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
466 }
467
468 $form = $this->buildAuthModeDeterminationForm();
469 if ($form === null) {
470 $this->authSettingsObject();
471 return;
472 }
473
474 $form_valid = false;
475 $form_data = null;
476 if ($this->http->request()->getMethod() === 'POST') {
477 $form = $form->withRequest($this->http->request());
478 $form_data = $form->getData();
479 $form_valid = $form_data !== null;
480 }
481
482 if (!$form_valid) {
483 $this->tpl->setOnScreenMessage(
484 $this->tpl::MESSAGE_TYPE_FAILURE,
485 $this->lng->txt('err_wrong_login')
486 );
487 $this->authSettingsObject($form);
488 return;
489 }
490
492 $kind = (int) $form_data[self::PROP_AUTH_MODE_KIND];
493 $det->setKind($kind);
495 $sequence = $form_data[self::PROP_AUTH_MODE_SEQUENCE];
496 $this->logger->debug('pos mode:' . print_r($sequence, true));
497 asort($sequence, SORT_NUMERIC);
498 $this->logger->debug('pos mode:' . print_r($sequence, true));
499 $counter = 0;
500 $position = [];
501 foreach (array_keys($sequence) as $auth_mode) {
502 $position[$counter++] = substr($auth_mode, 1);
503 }
504 $this->logger->debug('position mode:' . print_r($position, true));
505 $det->setAuthModeSequence($position);
506 }
507 $det->save();
508
509 $this->tpl->setOnScreenMessage(
510 $this->tpl::MESSAGE_TYPE_SUCCESS,
511 $this->lng->txt('settings_saved'),
512 true
513 );
514 $this->ctrl->redirect($this, 'authSettings');
515 }
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 303 of file class.ilObjAuthSettingsGUI.php.

303 : void
304 {
305 if (!$this->rbac_system->checkAccess('write', $this->object->getRefId())) {
306 $this->ilias->raiseError($this->lng->txt('permission_denied'), $this->ilias->error_obj->MESSAGE);
307 }
308
309 $form = $this->buildRegistrationRoleMappingForm();
310 $form_valid = false;
311 $form_data = null;
312 if ($this->http->request()->getMethod() === 'POST') {
313 $form = $form->withRequest($this->http->request());
314 $form_data = $form->getData();
315 $form_valid = $form_data !== null;
316 }
317
318 if (!$form_valid) {
319 $this->tpl->setOnScreenMessage(
320 $this->tpl::MESSAGE_TYPE_FAILURE,
321 $this->lng->txt('err_wrong_login')
322 );
323 $this->authSettingsObject(null, $form);
324 return;
325 }
326
327 $f_object = [];
328 foreach ($form_data as $role_id => $auth_mode) {
329 $f_object[substr($role_id, 2)] = $auth_mode;
330 }
332
333 $this->tpl->setOnScreenMessage(
334 $this->tpl::MESSAGE_TYPE_SUCCESS,
335 $this->lng->txt('auth_mode_roles_changed'),
336 true
337 );
338 $this->ctrl->redirect($this, 'authSettings');
339 }
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 1231 of file class.ilObjAuthSettingsGUI.php.

1231 : string
1232 {
1233 return implode("\n", preg_split("/[\r\n]+/", $text));
1234 }

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: