ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 public. More...
 
 executeCommand ()
 
 getAdminTabs ()
 Get tabs public. More...
 
 showPrivacy (?ilPropertyFormGUI $form=null)
 Show Privacy settings 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 ()
 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
 
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
 
ilObjectCustomIconFactory $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 public.

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

References ILIAS\GlobalScreen\Provider\__construct().

35  {
36  $this->type = 'ps';
37  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
38  self::initErrorMessages();
39  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjPrivacySecurityGUI::addToExternalSettingsForm ( int  $a_form_id)

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

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

362  : array
363  {
364  switch ($a_form_id) {
366  $privacy = ilPrivacySettings::getInstance();
367  $subitems = [
368  'ps_export_course' => [
369  $privacy->enabledCourseExport(),
371  ],
372  'ps_export_confirm' => [
373  $privacy->courseConfirmationRequired(),
375  ],
376  'ps_show_crs_access' => [
377  $privacy->enabledCourseAccessTimes(),
379  ],
380  'ps_participants_list_courses' => [
381  $privacy->participantsListInCoursesEnabled(),
383  ]
384  ];
385  $fields = [
386  'ps_profile_export' => [null, null, $subitems]
387  ];
388  return [["showPrivacy", $fields]];
389 
391  $privacy = ilPrivacySettings::getInstance();
392  $subitems = [
393  'ps_export_groups' => [
394  $privacy->enabledGroupExport(),
396  ],
397  'ps_export_confirm_group' => [
398  $privacy->groupConfirmationRequired(),
400  ],
401  'ps_show_grp_access' => [
402  $privacy->enabledGroupAccessTimes(),
404  ]
405  ];
406  $fields = [
407  'ps_profile_export' => [null, null, $subitems]
408  ];
409  return [["showPrivacy", $fields]];
410 
412  $privacy = ilPrivacySettings::getInstance();
413  $subitems = [
414  'ps_export_prgs' => [
415  $privacy->enabledPRGUserExport(),
417  ]
418  ];
419  $fields = [
420  'ps_profile_export' => [null, null, $subitems]
421  ];
422  return [["showPrivacy", $fields]];
423  }
424  return [];
425  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ executeCommand()

ilObjPrivacySecurityGUI::executeCommand ( )

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

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

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  }
prepareOutput(bool $show_sub_objects=true)
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjPrivacySecurityGUI::getAdminTabs ( )

Get tabs public.

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

References ILIAS\Repository\ctrl().

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  }
+ 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 353 of file class.ilObjPrivacySecurityGUI.php.

Referenced by ilSecuritySettings\validate().

353  : string
354  {
355  self::initErrorMessages();
356  if (array_key_exists($code, self::$ERROR_MESSAGE)) {
357  return self::$ERROR_MESSAGE[$code];
358  }
359  return '';
360  }
+ Here is the caller graph for this function:

◆ initErrorMessages()

static ilObjPrivacySecurityGUI::initErrorMessages ( )
static

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

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

41  : void
42  {
43  global $DIC;
44 
45  $lng = $DIC->language();
46 
47  if (count(self::$ERROR_MESSAGE)) {
48  return;
49  }
50  $lng->loadLanguageModule('ps');
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  }
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN2
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...
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MIN_LENGTH
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_LENGTH
loadLanguageModule(string $a_module)
Load language module.
static int $SECURITY_SETTINGS_ERR_CODE_HTTP_NOT_AVAILABLE
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_AGE
static int $SECURITY_SETTINGS_ERR_CODE_AUTO_HTTPS
ilLanguage $lng
global $DIC
Definition: shib_login.php:22
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN3
static int $SECURITY_SETTINGS_ERR_CODE_HTTPS_NOT_AVAILABLE
const SECURITY_SETTINGS_ERR_CODE_INVALID_LOGIN_MAX_ATTEMPTS
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN1
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MAX_LENGTH_LESS_MIN_LENGTH
+ Here is the call graph for this function:

◆ initPrivacyForm()

ilObjPrivacySecurityGUI::initPrivacyForm ( )
protected

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

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

Referenced by save_privacy(), and showPrivacy().

124  {
125  $privacy = ilPrivacySettings::getInstance();
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->setValue('export_confirm_course');
182  $group->addOption($check);
183  $check = new ilCheckboxOption();
184  $check->setTitle($this->lng->txt('ps_export_confirm_group'));
185  $check->setValue('export_confirm_group');
186  $group->addOption($check);
187  $check = new ilCheckboxOption();
188  $check->setTitle($this->lng->txt('ps_show_grp_access'));
189  $check->setValue('grp_access_times');
190  $group->addOption($check);
191  $check = new ilCheckboxOption();
192  $check->setTitle($this->lng->txt('ps_show_crs_access'));
193  $check->setValue('crs_access_times');
194  $group->addOption($check);
195  $check = new ilCheckboxOption();
196  $check->setTitle($this->lng->txt('ps_show_lso_access'));
197  $check->setValue('lso_access_times');
198  $group->addOption($check);
199  $form->addItem($group);
200  $check = new ilCheckboxOption();
201  $check->setTitle($this->lng->txt('ps_participants_list_courses'));
202  $check->setValue('participants_list_courses');
203  $group->addOption($check);
204 
207  $form,
208  $this
209  );
210 
211  if ($this->checkPermissionBool("write")) {
212  $form->addCommandButton('save_privacy', $this->lng->txt('save'));
213  }
214  return $form;
215  }
This class represents an option in a checkbox group.
This class represents a property in a property form.
static _hasAgreements()
Check if there is any user agreement.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
static addFieldsToForm(int $a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
$check
Definition: buildRTE.php:81
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save_privacy()

ilObjPrivacySecurityGUI::save_privacy ( )

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

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

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

◆ save_security()

ilObjPrivacySecurityGUI::save_security ( )

Save security settings.

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

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

339  : void
340  {
341  if (!$this->access->checkAccess('write', '', $this->object->getRefId())) {
342  $this->error->raiseError($this->lng->txt('no_permission'), $this->error->WARNING);
343  }
344  $this->showSecurity();
345  }
showSecurity()
Show Privacy settings.
+ Here is the call graph for this function:

◆ showPrivacy()

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

Show Privacy settings public.

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

References initPrivacyForm().

Referenced by save_privacy().

221  : void
222  {
223  if (!$form instanceof ilPropertyFormGUI) {
224  $form = $this->initPrivacyForm();
225  }
226  $this->tpl->setContent($form->getHTML());
227  }
+ 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 232 of file class.ilObjPrivacySecurityGUI.php.

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

Referenced by save_security().

232  : void
233  {
234  $security = ilSecuritySettings::_getInstance();
235 
236  $this->tabs_gui->setTabActive('show_security');
237 
238  $form = new ilPropertyFormGUI();
239  $form->setFormAction($this->ctrl->getFormAction($this));
240  $form->setTitle($this->lng->txt('ps_security_protection'));
241 
244  $form,
245  $this
246  );
247  $this->tpl->setContent($form->getHTML());
248  }
static addFieldsToForm(int $a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
static _getInstance()
Get instance of ilSecuritySettings.
+ 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: