ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjPrivacySecurityGUI Class Reference
+ Inheritance diagram for ilObjPrivacySecurityGUI:
+ Collaboration diagram for ilObjPrivacySecurityGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor @access public. More...
 
 executeCommand ()
 
 getAdminTabs ()
 Get tabs @access public. More...
 
 showPrivacy (?ilPropertyFormGUI $form=null)
 Show Privacy settings @access public. More...
 
 showSecurity ()
 Show Privacy settings. More...
 
 save_privacy ()
 
 save_security ()
 Save security settings. More...
 
 addToExternalSettingsForm (int $a_form_id)
 
- 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)
 

Static Public Member Functions

static initErrorMessages ()
 
static getErrorMessage (int $code)
 return error message for error code More...
 
- 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)
 

Protected Member Functions

 initPrivacyForm ()
 
- 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)
 

Static Private Attributes

static array $ERROR_MESSAGE = []
 

Additional Inherited Members

- 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()

ilObjPrivacySecurityGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Contructor @access public.

Definition at line 34 of file class.ilObjPrivacySecurityGUI.php.

35 {
36 $this->type = 'ps';
37 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
39 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), and initErrorMessages().

+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjPrivacySecurityGUI::addToExternalSettingsForm ( int  $a_form_id)

Definition at line 364 of file class.ilObjPrivacySecurityGUI.php.

364 : array
365 {
366 switch ($a_form_id) {
369 $subitems = [
370 'ps_export_course' => [
371 $privacy->enabledCourseExport(),
373 ],
374 'ps_export_confirm' => [
375 $privacy->courseConfirmationRequired(),
377 ],
378 'ps_show_crs_access' => [
379 $privacy->enabledCourseAccessTimes(),
381 ],
382 'ps_participants_list_courses' => [
383 $privacy->participantsListInCoursesEnabled(),
385 ]
386 ];
387 $fields = [
388 'ps_profile_export' => [null, null, $subitems]
389 ];
390 return [["showPrivacy", $fields]];
391
394 $subitems = [
395 'ps_export_groups' => [
396 $privacy->enabledGroupExport(),
398 ],
399 'ps_export_confirm_group' => [
400 $privacy->groupConfirmationRequired(),
402 ],
403 'ps_show_grp_access' => [
404 $privacy->enabledGroupAccessTimes(),
406 ]
407 ];
408 $fields = [
409 'ps_profile_export' => [null, null, $subitems]
410 ];
411 return [["showPrivacy", $fields]];
412
415 $subitems = [
416 'ps_export_prgs' => [
417 $privacy->enabledPRGUserExport(),
419 ]
420 ];
421 $fields = [
422 'ps_profile_export' => [null, null, $subitems]
423 ];
424 return [["showPrivacy", $fields]];
425 }
426 return [];
427 }

References ilAdministrationSettingsFormHandler\FORM_COURSE, ilAdministrationSettingsFormHandler\FORM_GROUP, ilAdministrationSettingsFormHandler\FORM_PRG, ilPrivacySettings\getInstance(), and ilAdministrationSettingsFormHandler\VALUE_BOOL.

+ Here is the call graph for this function:

◆ executeCommand()

ilObjPrivacySecurityGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

Definition at line 66 of file class.ilObjPrivacySecurityGUI.php.

66 : void
67 {
68 $next_class = $this->ctrl->getNextClass($this);
69 $cmd = $this->ctrl->getCmd();
70
71 $this->prepareOutput();
72
73 if (!$this->rbac_system->checkAccess('visible,read', $this->object->getRefId())) {
74 $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
75 }
76
77 switch ($next_class) {
78 case 'ilpermissiongui':
79 $this->tabs_gui->setTabActive('perm_settings');
80 $perm_gui = new ilPermissionGUI($this);
81 $this->ctrl->forwardCommand($perm_gui);
82 break;
83
84 default:
85 if (!$cmd || $cmd == 'view') {
86 $cmd = "showPrivacy";
87 }
88
89 $this->$cmd();
90 break;
91 }
92 }
error(string $a_errmsg)
prepareOutput(bool $show_sub_objects=true)

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

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjPrivacySecurityGUI::getAdminTabs ( )

Get tabs @access public.

Reimplemented from ilObjectGUI.

Definition at line 98 of file class.ilObjPrivacySecurityGUI.php.

98 : void
99 {
100 if ($this->rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
101 $this->tabs_gui->addTarget(
102 "show_privacy",
103 $this->ctrl->getLinkTarget($this, "showPrivacy"),
104 'showPrivacy'
105 );
106 $this->tabs_gui->addTarget(
107 "show_security",
108 $this->ctrl->getLinkTarget($this, "showSecurity"),
109 'showSecurity'
110 );
111 }
112
113 if ($this->rbac_system->checkAccess('edit_permission', $this->object->getRefId())) {
114 $this->tabs_gui->addTarget(
115 "perm_settings",
116 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm"),
117 array(),
118 'ilpermissiongui'
119 );
120 }
121 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getErrorMessage()

static ilObjPrivacySecurityGUI::getErrorMessage ( int  $code)
static

return error message for error code

Parameters
int$code
Returns
string

Definition at line 355 of file class.ilObjPrivacySecurityGUI.php.

355 : string
356 {
358 if (array_key_exists($code, self::$ERROR_MESSAGE)) {
359 return self::$ERROR_MESSAGE[$code];
360 }
361 return '';
362 }

References initErrorMessages().

Referenced by save_privacy(), and ilSecuritySettings\validate().

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

◆ initErrorMessages()

static ilObjPrivacySecurityGUI::initErrorMessages ( )
static

Definition at line 41 of file class.ilObjPrivacySecurityGUI.php.

41 : void
42 {
43 global $DIC;
44
45 $lng = $DIC->language();
46
47 if (count(self::$ERROR_MESSAGE)) {
48 return;
49 }
52 ilSecuritySettings::$SECURITY_SETTINGS_ERR_CODE_AUTO_HTTPS => $lng->txt("ps_error_message_https_header_missing"),
55 ilSecuritySettings::SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MIN_LENGTH => $lng->txt('ps_error_message_invalid_password_min_length'),
56 ilSecuritySettings::SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_LENGTH => $lng->txt('ps_error_message_invalid_password_max_length'),
57 ilSecuritySettings::SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_AGE => $lng->txt('ps_error_message_invalid_password_max_age'),
58 ilSecuritySettings::SECURITY_SETTINGS_ERR_CODE_INVALID_LOGIN_MAX_ATTEMPTS => $lng->txt('ps_error_message_invalid_login_max_attempts'),
59 ilSecuritySettings::SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN1 => $lng->txt('ps_error_message_password_min1_because_chars'),
60 ilSecuritySettings::SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN2 => $lng->txt('ps_error_message_password_min2_because_chars_numbers'),
61 ilSecuritySettings::SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN3 => $lng->txt('ps_error_message_password_min3_because_chars_numbers_sc'),
63 ];
64 }
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ilLanguage $lng
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN2
static int $SECURITY_SETTINGS_ERR_CODE_HTTP_NOT_AVAILABLE
const SECURITY_SETTINGS_ERR_CODE_INVALID_LOGIN_MAX_ATTEMPTS
static int $SECURITY_SETTINGS_ERR_CODE_HTTPS_NOT_AVAILABLE
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_LENGTH
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN3
static int $SECURITY_SETTINGS_ERR_CODE_AUTO_HTTPS
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_AGE
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MAX_LENGTH_LESS_MIN_LENGTH
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN1
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MIN_LENGTH
global $DIC
Definition: shib_login.php:26

References $DIC, $ERROR_MESSAGE, ilObjectGUI\$lng, ilSecuritySettings\$SECURITY_SETTINGS_ERR_CODE_AUTO_HTTPS, ilSecuritySettings\$SECURITY_SETTINGS_ERR_CODE_HTTP_NOT_AVAILABLE, ilSecuritySettings\$SECURITY_SETTINGS_ERR_CODE_HTTPS_NOT_AVAILABLE, ilLanguage\loadLanguageModule(), ilSecuritySettings\SECURITY_SETTINGS_ERR_CODE_INVALID_LOGIN_MAX_ATTEMPTS, ilSecuritySettings\SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_AGE, ilSecuritySettings\SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_LENGTH, ilSecuritySettings\SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MIN_LENGTH, ilSecuritySettings\SECURITY_SETTINGS_ERR_CODE_PASSWORD_MAX_LENGTH_LESS_MIN_LENGTH, ilSecuritySettings\SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN1, ilSecuritySettings\SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN2, ilSecuritySettings\SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN3, and ilLanguage\txt().

Referenced by __construct(), and getErrorMessage().

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

◆ initPrivacyForm()

ilObjPrivacySecurityGUI::initPrivacyForm ( )
protected

Definition at line 123 of file class.ilObjPrivacySecurityGUI.php.

124 {
126
127 $this->tabs_gui->setTabActive('show_privacy');
128
129 $form = new ilPropertyFormGUI();
130 $form->setFormAction($this->ctrl->getFormAction($this));
131 $form->setTitle($this->lng->txt('ps_privacy_protection'));
132
134 $this->tpl->setOnScreenMessage('info', $this->lng->txt('ps_warning_modify'));
135 }
136
137 $value = [];
138 if ($privacy->enabledCourseExport()) {
139 $value[] = "export_course";
140 }
141 if ($privacy->enabledGroupExport()) {
142 $value[] = "export_group";
143 }
144 if ($privacy->enabledPRGUserExport()) {
145 $value[] = "export_prg";
146 }
147 if ($privacy->courseConfirmationRequired()) {
148 $value[] = "export_confirm_course";
149 }
150 if ($privacy->groupConfirmationRequired()) {
151 $value[] = "export_confirm_group";
152 }
153 if ($privacy->enabledGroupAccessTimes()) {
154 $value[] = "grp_access_times";
155 }
156 if ($privacy->enabledCourseAccessTimes()) {
157 $value[] = "crs_access_times";
158 }
159 if ($privacy->enabledLearningSequenceAccessTimes()) {
160 $value[] = "lso_access_times";
161 }
162 if ($privacy->participantsListInCoursesEnabled()) {
163 $value[] = 'participants_list_courses';
164 }
165 $group = new ilCheckboxGroupInputGUI($this->lng->txt('ps_profile_export'), 'profile_protection');
166 $group->setValue($value);
167 $check = new ilCheckboxOption();
168 $check->setTitle($this->lng->txt('ps_export_course'));
169 $check->setValue('export_course');
170 $group->addOption($check);
171 $check = new ilCheckboxOption();
172 $check->setTitle($this->lng->txt('ps_export_groups'));
173 $check->setValue('export_group');
174 $group->addOption($check);
175 $check = new ilCheckboxOption();
176 $check->setTitle($this->lng->txt('ps_export_prgs'));
177 $check->setValue('export_prg');
178 $group->addOption($check);
179 $check = new ilCheckboxOption();
180 $check->setTitle($this->lng->txt('ps_export_confirm'));
181 $check->setInfo($this->lng->txt('ps_export_confirm_info'));
182 $check->setValue('export_confirm_course');
183 $group->addOption($check);
184 $check = new ilCheckboxOption();
185 $check->setTitle($this->lng->txt('ps_export_confirm_group'));
186 $check->setInfo($this->lng->txt('ps_export_confirm_group_info'));
187 $check->setValue('export_confirm_group');
188 $group->addOption($check);
189 $check = new ilCheckboxOption();
190 $check->setTitle($this->lng->txt('ps_show_grp_access'));
191 $check->setValue('grp_access_times');
192 $group->addOption($check);
193 $check = new ilCheckboxOption();
194 $check->setTitle($this->lng->txt('ps_show_crs_access'));
195 $check->setValue('crs_access_times');
196 $group->addOption($check);
197 $check = new ilCheckboxOption();
198 $check->setTitle($this->lng->txt('ps_show_lso_access'));
199 $check->setValue('lso_access_times');
200 $group->addOption($check);
201 $form->addItem($group);
202 $check = new ilCheckboxOption();
203 $check->setTitle($this->lng->txt('ps_participants_list_courses'));
204 $check->setValue('participants_list_courses');
205 $group->addOption($check);
206
209 $form,
210 $this
211 );
212
213 if ($this->checkPermissionBool("write")) {
214 $form->addCommandButton('save_privacy', $this->lng->txt('save'));
215 }
216 return $form;
217 }
$check
Definition: buildRTE.php:81
static addFieldsToForm(int $a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
This class represents a property in a property form.
This class represents an option in a checkbox group.
static _hasAgreements()
Check if there is any user agreement.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
This class represents a property form user interface.

References $check, ilMemberAgreement\_hasAgreements(), ilAdministrationSettingsFormHandler\addFieldsToForm(), ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ilAdministrationSettingsFormHandler\FORM_PRIVACY, ilPrivacySettings\getInstance(), and ILIAS\Repository\lng().

Referenced by save_privacy(), and showPrivacy().

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

◆ save_privacy()

ilObjPrivacySecurityGUI::save_privacy ( )

Definition at line 252 of file class.ilObjPrivacySecurityGUI.php.

252 : void
253 {
254 if (!$this->access->checkAccess('write', '', $this->object->getRefId())) {
255 $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
256 }
257
258 $form = $this->initPrivacyForm();
259 $valid = true;
260 if (!$form->checkInput()) {
261 $valid = false;
262 }
263
264 $profile_protection = $form->getInput('profile_protection') ?? [];
266
267 // to determine if agreements need to be reset - see below
268 $old_settings = array(
269 'export_course' => $privacy->enabledCourseExport(),
270 'export_group' => $privacy->enabledGroupExport(),
271 'export_prg' => $privacy->enabledPRGUserExport(),
272 'export_confirm_course' => $privacy->courseConfirmationRequired(),
273 'export_confirm_group' => $privacy->groupConfirmationRequired(),
274 'crs_access_times' => $privacy->enabledCourseAccessTimes(),
275 'grp_access_times' => $privacy->enabledGroupAccessTimes(),
276 'lso_access_times' => $privacy->enabledLearningSequenceAccessTimes(),
277 'participants_list_courses' => $privacy->participantsListInCoursesEnabled()
278 );
279
280 $privacy->enableCourseExport(in_array('export_course', $profile_protection));
281 $privacy->enableGroupExport(in_array('export_group', $profile_protection));
282 $privacy->enablePRGUserExport((bool) in_array('export_prg', $profile_protection));
283 $privacy->setCourseConfirmationRequired(in_array('export_confirm_course', $profile_protection));
284 $privacy->setGroupConfirmationRequired(in_array('export_confirm_group', $profile_protection));
285 $privacy->showGroupAccessTimes(in_array('grp_access_times', $profile_protection));
286 $privacy->showCourseAccessTimes(in_array('crs_access_times', $profile_protection));
287 $privacy->showLearningSequenceAccessTimes(in_array('lso_access_times', $profile_protection));
288
289 $privacy->enableParticipantsListInCourses(in_array('participants_list_courses', $profile_protection));
290
291 // validate settings
292 $code = $privacy->validate();
293 // if error code != 0, display error and do not save
294 if ($code !== 0) {
295 $msg = self::getErrorMessage($code);
296 $this->tpl->setOnScreenMessage('failure', $msg);
297 $form->setValuesByPost();
298 $this->showPrivacy($form);
299 return;
300 } elseif (!$valid) {
301 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
302 $form->setValuesByPost();
303 $this->showPrivacy($form);
304 return;
305 } else {
306 $privacy->save();
307 // reset agreements?
308 $do_reset = false;
309 if (!$old_settings['export_course'] && $privacy->enabledCourseExport()) {
310 $do_reset = true;
311 }
312 if (!$do_reset && !$old_settings['export_group'] && $privacy->enabledGroupExport()) {
313 $do_reset = true;
314 }
315 if (!$do_reset && !$old_settings['export_confirm_course'] && $privacy->courseConfirmationRequired()) {
316 $do_reset = true;
317 }
318 if (!$do_reset && !$old_settings['export_confirm_group'] && $privacy->groupConfirmationRequired()) {
319 $do_reset = true;
320 }
321 if (!$do_reset && !$old_settings['crs_access_times'] && $privacy->enabledCourseAccessTimes()) {
322 $do_reset = true;
323 }
324 if (!$do_reset && !$old_settings['grp_access_times'] && $privacy->enabledGroupAccessTimes()) {
325 $do_reset = true;
326 }
327 if (!$do_reset && !$old_settings['lso_access_times'] && $privacy->enabledLearningSequenceAccessTimes()) {
328 $do_reset = true;
329 }
330 if ($do_reset) {
332 }
333 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
334 }
335 $this->ctrl->redirect($this, 'showPrivacy');
336 }
static _reset()
Reset all.
showPrivacy(?ilPropertyFormGUI $form=null)
Show Privacy settings @access public.
static getErrorMessage(int $code)
return error message for error code
$valid

References $valid, ilMemberAgreement\_reset(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), error(), getErrorMessage(), ilPrivacySettings\getInstance(), initPrivacyForm(), ILIAS\Repository\lng(), and showPrivacy().

+ Here is the call graph for this function:

◆ save_security()

ilObjPrivacySecurityGUI::save_security ( )

Save security settings.

Definition at line 341 of file class.ilObjPrivacySecurityGUI.php.

341 : void
342 {
343 if (!$this->access->checkAccess('write', '', $this->object->getRefId())) {
344 $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
345 }
346 $this->showSecurity();
347 }

References ILIAS\Repository\access(), error(), ILIAS\Repository\lng(), and showSecurity().

+ Here is the call graph for this function:

◆ showPrivacy()

ilObjPrivacySecurityGUI::showPrivacy ( ?ilPropertyFormGUI  $form = null)

Show Privacy settings @access public.

Definition at line 223 of file class.ilObjPrivacySecurityGUI.php.

223 : void
224 {
225 if (!$form instanceof ilPropertyFormGUI) {
226 $form = $this->initPrivacyForm();
227 }
228 $this->tpl->setContent($form->getHTML());
229 }

References initPrivacyForm().

Referenced by save_privacy().

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

◆ showSecurity()

ilObjPrivacySecurityGUI::showSecurity ( )

Show Privacy settings.

Definition at line 234 of file class.ilObjPrivacySecurityGUI.php.

234 : void
235 {
237
238 $this->tabs_gui->setTabActive('show_security');
239
240 $form = new ilPropertyFormGUI();
241 $form->setFormAction($this->ctrl->getFormAction($this));
242 $form->setTitle($this->lng->txt('ps_security_protection'));
243
246 $form,
247 $this
248 );
249 $this->tpl->setContent($form->getHTML());
250 }
static _getInstance()
Get instance of ilSecuritySettings.

References ilSecuritySettings\_getInstance(), ilAdministrationSettingsFormHandler\addFieldsToForm(), ILIAS\Repository\ctrl(), ilAdministrationSettingsFormHandler\FORM_SECURITY, and ILIAS\Repository\lng().

Referenced by save_security().

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

Field Documentation

◆ $ERROR_MESSAGE

array ilObjPrivacySecurityGUI::$ERROR_MESSAGE = []
staticprivate

Definition at line 28 of file class.ilObjPrivacySecurityGUI.php.

Referenced by initErrorMessages().


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