19 declare(strict_types=1);
    34     public function __construct($a_data, $a_id, $a_call_by_reference = 
true, $a_prepare_output = 
true)
    38         self::initErrorMessages();
    45         $lng = $DIC->language();
    47         if (count(self::$ERROR_MESSAGE)) {
    68         $next_class = $this->
ctrl->getNextClass($this);
    69         $cmd = $this->
ctrl->getCmd();
    73         if (!$this->rbac_system->checkAccess(
'visible,read', $this->object->getRefId())) {
    74             $this->error->raiseError($this->
lng->txt(
'no_permission'), $this->error->WARNING);
    77         switch ($next_class) {
    78             case 'ilpermissiongui':
    79                 $this->tabs_gui->setTabActive(
'perm_settings');
    81                 $this->
ctrl->forwardCommand($perm_gui);
    85                 if (!$cmd || $cmd == 
'view') {
   100         if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
   101             $this->tabs_gui->addTarget(
   103                 $this->
ctrl->getLinkTarget($this, 
"showPrivacy"),
   106             $this->tabs_gui->addTarget(
   108                 $this->
ctrl->getLinkTarget($this, 
"showSecurity"),
   113         if ($this->rbac_system->checkAccess(
'edit_permission', $this->object->getRefId())) {
   114             $this->tabs_gui->addTarget(
   116                 $this->
ctrl->getLinkTargetByClass(
'ilpermissiongui', 
"perm"),
   127         $this->tabs_gui->setTabActive(
'show_privacy');
   130         $form->setFormAction($this->
ctrl->getFormAction($this));
   131         $form->setTitle($this->
lng->txt(
'ps_privacy_protection'));
   134             $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'ps_warning_modify'));
   138         if ($privacy->enabledCourseExport()) {
   139             $value[] = 
"export_course";
   141         if ($privacy->enabledGroupExport()) {
   142             $value[] = 
"export_group";
   144         if ($privacy->enabledPRGUserExport()) {
   145             $value[] = 
"export_prg";
   147         if ($privacy->courseConfirmationRequired()) {
   148             $value[] = 
"export_confirm_course";
   150         if ($privacy->groupConfirmationRequired()) {
   151             $value[] = 
"export_confirm_group";
   153         if ($privacy->enabledGroupAccessTimes()) {
   154             $value[] = 
"grp_access_times";
   156         if ($privacy->enabledCourseAccessTimes()) {
   157             $value[] = 
"crs_access_times";
   159         if ($privacy->enabledLearningSequenceAccessTimes()) {
   160             $value[] = 
"lso_access_times";
   162         if ($privacy->participantsListInCoursesEnabled()) {
   163             $value[] = 
'participants_list_courses';
   168         $check->setTitle($this->
lng->txt(
'ps_export_course'));
   169         $check->setValue(
'export_course');
   170         $group->addOption(
$check);
   172         $check->setTitle($this->
lng->txt(
'ps_export_groups'));
   173         $check->setValue(
'export_group');
   174         $group->addOption(
$check);
   176         $check->setTitle($this->
lng->txt(
'ps_export_prgs'));
   177         $check->setValue(
'export_prg');
   178         $group->addOption(
$check);
   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);
   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);
   190         $check->setTitle($this->
lng->txt(
'ps_show_grp_access'));
   191         $check->setValue(
'grp_access_times');
   192         $group->addOption(
$check);
   194         $check->setTitle($this->
lng->txt(
'ps_show_crs_access'));
   195         $check->setValue(
'crs_access_times');
   196         $group->addOption(
$check);
   198         $check->setTitle($this->
lng->txt(
'ps_show_lso_access'));
   199         $check->setValue(
'lso_access_times');
   200         $group->addOption(
$check);
   201         $form->addItem($group);
   203         $check->setTitle($this->
lng->txt(
'ps_participants_list_courses'));
   204         $check->setValue(
'participants_list_courses');
   205         $group->addOption(
$check);
   214             $form->addCommandButton(
'save_privacy', $this->
lng->txt(
'save'));
   228         $this->tpl->setContent($form->getHTML());
   238         $this->tabs_gui->setTabActive(
'show_security');
   241         $form->setFormAction($this->
ctrl->getFormAction($this));
   242         $form->setTitle($this->
lng->txt(
'ps_security_protection'));
   249         $this->tpl->setContent($form->getHTML());
   254         if (!$this->
access->checkAccess(
'write', 
'', $this->object->getRefId())) {
   255             $this->error->raiseError($this->
lng->txt(
'no_permission'), $this->error->WARNING);
   260         if (!$form->checkInput()) {
   264         $profile_protection = $form->getInput(
'profile_protection') ?? [];
   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()
   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));
   289         $privacy->enableParticipantsListInCourses(in_array(
'participants_list_courses', $profile_protection));
   292         $code = $privacy->validate();
   296             $this->tpl->setOnScreenMessage(
'failure', $msg);
   297             $form->setValuesByPost();
   301             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
   302             $form->setValuesByPost();
   309             if (!$old_settings[
'export_course'] && $privacy->enabledCourseExport()) {
   312             if (!$do_reset && !$old_settings[
'export_group'] && $privacy->enabledGroupExport()) {
   315             if (!$do_reset && !$old_settings[
'export_confirm_course'] && $privacy->courseConfirmationRequired()) {
   318             if (!$do_reset && !$old_settings[
'export_confirm_group'] && $privacy->groupConfirmationRequired()) {
   321             if (!$do_reset && !$old_settings[
'crs_access_times'] && $privacy->enabledCourseAccessTimes()) {
   324             if (!$do_reset && !$old_settings[
'grp_access_times'] && $privacy->enabledGroupAccessTimes()) {
   327             if (!$do_reset && !$old_settings[
'lso_access_times'] && $privacy->enabledLearningSequenceAccessTimes()) {
   333             $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'), 
true);
   335         $this->
ctrl->redirect($this, 
'showPrivacy');
   343         if (!$this->
access->checkAccess(
'write', 
'', $this->object->getRefId())) {
   344             $this->error->raiseError($this->
lng->txt(
'no_permission'), $this->error->WARNING);
   357         self::initErrorMessages();
   358         if (array_key_exists($code, self::$ERROR_MESSAGE)) {
   359             return self::$ERROR_MESSAGE[$code];
   366         switch ($a_form_id) {
   370                     'ps_export_course' => [
   371                         $privacy->enabledCourseExport(),
   374                     'ps_export_confirm' => [
   375                         $privacy->courseConfirmationRequired(),
   378                     'ps_show_crs_access' => [
   379                         $privacy->enabledCourseAccessTimes(),
   382                     'ps_participants_list_courses' => [
   383                         $privacy->participantsListInCoursesEnabled(),
   388                     'ps_profile_export' => [null, null, $subitems]
   390                 return [[
"showPrivacy", $fields]];
   395                     'ps_export_groups' => [
   396                         $privacy->enabledGroupExport(),
   399                     'ps_export_confirm_group' => [
   400                         $privacy->groupConfirmationRequired(),
   403                     'ps_show_grp_access' => [
   404                         $privacy->enabledGroupAccessTimes(),
   409                     'ps_profile_export' => [null, null, $subitems]
   411                 return [[
"showPrivacy", $fields]];
   416                     'ps_export_prgs' => [
   417                         $privacy->enabledPRGUserExport(),
   422                     'ps_profile_export' => [null, null, $subitems]
   424                 return [[
"showPrivacy", $fields]];
 
showSecurity()
Show Privacy settings. 
 
static array $ERROR_MESSAGE
 
static initErrorMessages()
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
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
 
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor  public. 
 
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_LENGTH
 
prepareOutput(bool $show_sub_objects=true)
 
showPrivacy(?ilPropertyFormGUI $form=null)
Show Privacy settings  public. 
 
loadLanguageModule(string $a_module)
Load language module. 
 
static int $SECURITY_SETTINGS_ERR_CODE_HTTP_NOT_AVAILABLE
 
static _reset()
Reset all. 
 
const SECURITY_SETTINGS_ERR_CODE_INVALID_PASSWORD_MAX_AGE
 
static int $SECURITY_SETTINGS_ERR_CODE_AUTO_HTTPS
 
static getErrorMessage(int $code)
return error message for error code 
 
Class ilObjectGUI Basic methods of all Output classes. 
 
save_security()
Save security settings. 
 
getAdminTabs()
Get tabs  public. 
 
static _hasAgreements()
Check if there is any user agreement. 
 
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
addToExternalSettingsForm(int $a_form_id)
 
const SECURITY_SETTINGS_ERR_CODE_PASSWORD_MIN_LENGTH_MIN3
 
__construct(Container $dic, ilPlugin $plugin)
 
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
 
static _getInstance()
Get instance of ilSecuritySettings.