ILIAS  release_8 Revision v8.24
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
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 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] don't belong to the current 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 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)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 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 ()
 
 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...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 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...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. 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...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Static Private Attributes

static array $ERROR_MESSAGE = []
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
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
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
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 353 of file class.ilObjPrivacySecurityGUI.php.

353 : array
354 {
355 switch ($a_form_id) {
357
359
360 $subitems = array(
361 'ps_export_course' => array($privacy->enabledCourseExport(),
363 ),
364 'ps_export_confirm' => array($privacy->courseConfirmationRequired(),
366 ),
367 'ps_show_crs_access' => array($privacy->enabledCourseAccessTimes(),
369 ),
370 'ps_participants_list_courses' => [$privacy->participantsListInCoursesEnabled(),
372 ]
373 );
374 $fields = [
375 'ps_profile_export' => [null, null, $subitems]
376 ];
377 return array(array("showPrivacy", $fields));
378
380
382
383 $subitems = array(
384 'ps_export_groups' => array($privacy->enabledGroupExport(),
386 ),
387 'ps_export_confirm_group' => array($privacy->groupConfirmationRequired(),
389 ),
390 'ps_show_grp_access' => array($privacy->enabledGroupAccessTimes(),
392 )
393 );
394 $fields = array(
395 'ps_profile_export' => array(null, null, $subitems)
396 );
397 return [["showPrivacy", $fields]];
398 }
399 return [];
400 }

References ilAdministrationSettingsFormHandler\FORM_COURSE, ilAdministrationSettingsFormHandler\FORM_GROUP, 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)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.

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 344 of file class.ilObjPrivacySecurityGUI.php.

344 : string
345 {
347 if (array_key_exists($code, self::$ERROR_MESSAGE)) {
348 return self::$ERROR_MESSAGE[$code];
349 }
350 return '';
351 }

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: feed.php:28

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->courseConfirmationRequired()) {
145 $value[] = "export_confirm_course";
146 }
147 if ($privacy->groupConfirmationRequired()) {
148 $value[] = "export_confirm_group";
149 }
150 if ($privacy->enabledGroupAccessTimes()) {
151 $value[] = "grp_access_times";
152 }
153 if ($privacy->enabledCourseAccessTimes()) {
154 $value[] = "crs_access_times";
155 }
156 if ($privacy->enabledLearningSequenceAccessTimes()) {
157 $value[] = "lso_access_times";
158 }
159 if ($privacy->participantsListInCoursesEnabled()) {
160 $value[] = 'participants_list_courses';
161 }
162 $group = new ilCheckboxGroupInputGUI($this->lng->txt('ps_profile_export'), 'profile_protection');
163 $group->setValue($value);
164 $check = new ilCheckboxOption();
165 $check->setTitle($this->lng->txt('ps_export_course'));
166 $check->setValue('export_course');
167 $group->addOption($check);
168 $check = new ilCheckboxOption();
169 $check->setTitle($this->lng->txt('ps_export_groups'));
170 $check->setValue('export_group');
171 $group->addOption($check);
172 $check = new ilCheckboxOption();
173 $check->setTitle($this->lng->txt('ps_export_confirm'));
174 $check->setValue('export_confirm_course');
175 $group->addOption($check);
176 $check = new ilCheckboxOption();
177 $check->setTitle($this->lng->txt('ps_export_confirm_group'));
178 $check->setValue('export_confirm_group');
179 $group->addOption($check);
180 $check = new ilCheckboxOption();
181 $check->setTitle($this->lng->txt('ps_show_grp_access'));
182 $check->setValue('grp_access_times');
183 $group->addOption($check);
184 $check = new ilCheckboxOption();
185 $check->setTitle($this->lng->txt('ps_show_crs_access'));
186 $check->setValue('crs_access_times');
187 $group->addOption($check);
188 $check = new ilCheckboxOption();
189 $check->setTitle($this->lng->txt('ps_show_lso_access'));
190 $check->setValue('lso_access_times');
191 $group->addOption($check);
192 $form->addItem($group);
193 $check = new ilCheckboxOption();
194 $check->setTitle($this->lng->txt('ps_participants_list_courses'));
195 $check->setValue('participants_list_courses');
196 $group->addOption($check);
197
200 $form,
201 $this
202 );
203
204 if ($this->checkPermissionBool("write")) {
205 $form->addCommandButton('save_privacy', $this->lng->txt('save'));
206 }
207 return $form;
208 }
$check
Definition: buildRTE.php:81
static addFieldsToForm(int $a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 243 of file class.ilObjPrivacySecurityGUI.php.

243 : void
244 {
245 if (!$this->access->checkAccess('write', '', $this->object->getRefId())) {
246 $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
247 }
248
249 $form = $this->initPrivacyForm();
250 $valid = true;
251 if (!$form->checkInput()) {
252 $valid = false;
253 }
254
255 $profile_protection = $form->getInput('profile_protection') ?? [];
257
258 // to determine if agreements need to be reset - see below
259 $old_settings = array(
260 'export_course' => $privacy->enabledCourseExport(),
261 'export_group' => $privacy->enabledGroupExport(),
262 'export_confirm_course' => $privacy->courseConfirmationRequired(),
263 'export_confirm_group' => $privacy->groupConfirmationRequired(),
264 'crs_access_times' => $privacy->enabledCourseAccessTimes(),
265 'grp_access_times' => $privacy->enabledGroupAccessTimes(),
266 'lso_access_times' => $privacy->enabledLearningSequenceAccessTimes(),
267 'participants_list_courses' => $privacy->participantsListInCoursesEnabled()
268 );
269
270 $privacy->enableCourseExport(in_array('export_course', $profile_protection));
271 $privacy->enableGroupExport(in_array('export_group', $profile_protection));
272 $privacy->setCourseConfirmationRequired(in_array('export_confirm_course', $profile_protection));
273 $privacy->setGroupConfirmationRequired(in_array('export_confirm_group', $profile_protection));
274 $privacy->showGroupAccessTimes(in_array('grp_access_times', $profile_protection));
275 $privacy->showCourseAccessTimes(in_array('crs_access_times', $profile_protection));
276 $privacy->showLearningSequenceAccessTimes(in_array('lso_access_times', $profile_protection));
277
278 $privacy->enableParticipantsListInCourses(in_array('participants_list_courses', $profile_protection));
279
280 // validate settings
281 $code = $privacy->validate();
282 // if error code != 0, display error and do not save
283 if ($code !== 0) {
284 $msg = self::getErrorMessage($code);
285 $this->tpl->setOnScreenMessage('failure', $msg);
286 $form->setValuesByPost();
287 $this->showPrivacy($form);
288 return;
289 } elseif (!$valid) {
290 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_check_input'));
291 $form->setValuesByPost();
292 $this->showPrivacy($form);
293 return;
294 } else {
295 $privacy->save();
296 // reset agreements?
297 $do_reset = false;
298 if (!$old_settings['export_course'] && $privacy->enabledCourseExport()) {
299 $do_reset = true;
300 }
301 if (!$do_reset && !$old_settings['export_group'] && $privacy->enabledGroupExport()) {
302 $do_reset = true;
303 }
304 if (!$do_reset && !$old_settings['export_confirm_course'] && $privacy->courseConfirmationRequired()) {
305 $do_reset = true;
306 }
307 if (!$do_reset && !$old_settings['export_confirm_group'] && $privacy->groupConfirmationRequired()) {
308 $do_reset = true;
309 }
310 if (!$do_reset && !$old_settings['crs_access_times'] && $privacy->enabledCourseAccessTimes()) {
311 $do_reset = true;
312 }
313 if (!$do_reset && !$old_settings['grp_access_times'] && $privacy->enabledGroupAccessTimes()) {
314 $do_reset = true;
315 }
316 if (!$do_reset && !$old_settings['lso_access_times'] && $privacy->enabledLearningSequenceAccessTimes()) {
317 $do_reset = true;
318 }
319 if ($do_reset) {
321 }
322 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
323 }
324 $this->ctrl->redirect($this, 'showPrivacy');
325 }
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 330 of file class.ilObjPrivacySecurityGUI.php.

330 : void
331 {
332 if (!$this->access->checkAccess('write', '', $this->object->getRefId())) {
333 $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
334 }
335 $this->showSecurity();
336 }

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 214 of file class.ilObjPrivacySecurityGUI.php.

214 : void
215 {
216 if (!$form instanceof ilPropertyFormGUI) {
217 $form = $this->initPrivacyForm();
218 }
219 $this->tpl->setContent($form->getHTML());
220 }

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 225 of file class.ilObjPrivacySecurityGUI.php.

225 : void
226 {
228
229 $this->tabs_gui->setTabActive('show_security');
230
231 $form = new ilPropertyFormGUI();
232 $form->setFormAction($this->ctrl->getFormAction($this));
233 $form->setTitle($this->lng->txt('ps_security_protection'));
234
237 $form,
238 $this
239 );
240 $this->tpl->setContent($form->getHTML());
241 }
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: