3 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
 
    4 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
 
    5 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
 
   26         public function __construct($a_data, $a_id, $a_call_by_reference = 
true, $a_prepare_output = 
true)
 
   31                 $this->lng->loadLanguageModule(
'ps');
 
   55                 global $rbacsystem,
$ilErr,$ilAccess;
 
   57                 $next_class = $this->ctrl->getNextClass($this);
 
   58                 $cmd = $this->ctrl->getCmd();
 
   62                 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
 
   64                         $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
 
   69                         case 'ilpermissiongui':
 
   70                                 $this->tabs_gui->setTabActive(
'perm_settings');
 
   71                                 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
   73                                 $ret =& $this->ctrl->forwardCommand($perm_gui);
 
   98                 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
 
  100                         $this->tabs_gui->addTarget(
"show_privacy",
 
  101                                 $this->ctrl->getLinkTarget($this, 
"showPrivacy"),
 
  103             $this->tabs_gui->addTarget(
"show_security",
 
  104                                 $this->ctrl->getLinkTarget($this, 
"showSecurity"),
 
  109                 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
 
  111                         $this->tabs_gui->addTarget(
"perm_settings",
 
  112                                 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
 
  113                                 array(),
'ilpermissiongui');
 
  126                 $this->tabs_gui->setTabActive(
'show_privacy');
 
  128                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  130                 $form->setFormAction($this->ctrl->getFormAction($this));
 
  131                 $form->setTitle($this->lng->txt(
'ps_privacy_protection'));
 
  133                 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
 
  137                         $html->setValue($this->lng->txt(
'ps_warning_modify'));
 
  138                         $form->addItem($html);
 
  142                 if($privacy->enabledCourseExport())
 
  144                         $value[] = 
"export_course";
 
  146                 if($privacy->enabledGroupExport())
 
  148                         $value[] = 
"export_group";
 
  150                 if($privacy->courseConfirmationRequired())
 
  152                         $value[] = 
"export_confirm_course";
 
  154                 if($privacy->groupConfirmationRequired())
 
  156                         $value[] = 
"export_confirm_group";
 
  158                 if($privacy->enabledGroupAccessTimes())
 
  160                         $value[] = 
"grp_access_times";
 
  162                 if($privacy->enabledCourseAccessTimes())
 
  164                         $value[] = 
"crs_access_times";
 
  169                 $check->setTitle($this->lng->txt(
'ps_export_course'));
 
  170                 $check->setValue(
'export_course');
 
  171                 $group->addOption($check);
 
  173                 $check->setTitle($this->lng->txt(
'ps_export_groups'));
 
  174                 $check->setValue(
'export_group');
 
  175                 $group->addOption($check);
 
  177                 $check->setTitle($this->lng->txt(
'ps_export_confirm'));
 
  178                 $check->setValue(
'export_confirm_course');
 
  179                 $group->addOption($check);
 
  181                 $check->setTitle($this->lng->txt(
'ps_export_confirm_group'));
 
  182                 $check->setValue(
'export_confirm_group');
 
  183                 $group->addOption($check);
 
  185                 $check->setTitle($this->lng->txt(
'ps_show_grp_access'));
 
  186                 $check->setValue(
'grp_access_times');
 
  187                 $group->addOption($check);
 
  189                 $check->setTitle($this->lng->txt(
'ps_show_crs_access'));
 
  190                 $check->setValue(
'crs_access_times');
 
  191                 $group->addOption($check);
 
  192                 $form->addItem($group);
 
  194                 $check = 
new ilCheckboxInputGui($this->lng->txt(
'enable_fora_statistics'), 
'fora_statistics');
 
  195                 $check->setInfo($this->lng->txt(
'enable_fora_statistics_desc'));
 
  196                 $check->setChecked($privacy->enabledForaStatistics());
 
  197                 $form->addItem($check);
 
  199                 $check = 
new ilCheckboxInputGui($this->lng->txt(
'enable_anonymous_fora'), 
'anonymous_fora');
 
  200                 $check->setInfo($this->lng->txt(
'enable_anonymous_fora_desc'));
 
  201                 $check->setChecked($privacy->enabledAnonymousFora());
 
  202                 $form->addItem($check);
 
  204                 $check = 
new ilCheckboxInputGui($this->lng->txt(
'enable_sahs_protocol_data'), 
'enable_sahs_pd');
 
  205                 $check->setInfo($this->lng->txt(
'enable_sahs_protocol_data_desc'));
 
  206                 $check->setChecked($privacy->enabledSahsProtocolData());
 
  207                 $form->addItem($check);
 
  209                 $check = 
new ilCheckboxInputGui($this->lng->txt(
'rbac_log'), 
'rbac_log');
 
  210                 $check->setInfo($this->lng->txt(
'rbac_log_info'));
 
  211                 $check->setChecked($privacy->enabledRbacLog());
 
  212                 $form->addItem($check);
 
  214                 $age = 
new ilNumberInputGUI($this->lng->txt(
'rbac_log_age'),
'rbac_log_age');
 
  215                 $age->
setInfo($this->lng->txt(
'rbac_log_age_info'));
 
  216             $age->setValue($privacy->getRbacLogAge());
 
  217                 $age->setMinValue(1);
 
  218                 $age->setMaxValue(24);
 
  220                 $age->setMaxLength(2);
 
  221                 $check->addSubItem($age);
 
  223                 $form->addCommandButton(
'save_privacy',$this->lng->txt(
'save'));
 
  224                 $this->tpl->setContent($form->getHTML());
 
  236                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
  240                 $this->tabs_gui->setTabActive(
'show_security');
 
  243                 $form->setFormAction($this->ctrl->getFormAction($this));
 
  244                 $form->setTitle($this->lng->txt(
'ps_security_protection'));
 
  247                 $check = 
new ilCheckboxInputGUI($this->lng->txt(
'ps_auto_https'),
'auto_https_detect_enabled');
 
  248                 $check->
setOptionTitle($this->lng->txt(
'ps_auto_https_description'));
 
  249                 $check->setChecked($security->isAutomaticHTTPSEnabled() ? 1 : 0);
 
  252                         $text = 
new ilTextInputGUI($this->lng->txt(
'ps_auto_https_header_name'),
'auto_https_detect_header_name');
 
  253                         $text->
setValue($security->getAutomaticHTTPSHeaderName());
 
  255                         $text->setMaxLength(64);
 
  256                 $check->addSubItem($text);
 
  258                         $text = 
new ilTextInputGUI($this->lng->txt(
'ps_auto_https_header_value'),
'auto_https_detect_header_value');
 
  259                         $text->
setValue($security->getAutomaticHTTPSHeaderValue());
 
  261                         $text->setMaxLength(64);
 
  262                 $check->addSubItem($text);
 
  264                 $form->addItem($check);
 
  267                 $check2->
setChecked($security->isHTTPSEnabled() ? 1 : 0);
 
  268                 $check2->setValue(1);
 
  269                 $form->addItem($check2);
 
  271                 $radio_group = 
new ilRadioGroupInputGUI($this->lng->txt(
'ps_account_security_mode'), 
'account_security_mode' );
 
  272                 $radio_group->
setValue($security->getAccountSecurityMode());
 
  275                 $radio_group->addOption($radio_opt);
 
  279                                 $check = 
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_chars_and_numbers_enabled'),
'password_chars_and_numbers_enabled');
 
  280                                 $check->setChecked( $security->isPasswordCharsAndNumbersEnabled() ? 1 : 0 );
 
  282                                 $check->
setInfo($this->lng->txt(
'ps_password_chars_and_numbers_enabled_info'));
 
  283                         $radio_opt->addSubItem($check);
 
  285                                 $check = 
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_special_chars_enabled'),
'password_special_chars_enabled');
 
  286                                 $check->setChecked( $security->isPasswordSpecialCharsEnabled() ? 1 : 0 );
 
  288                                 $check->
setInfo($this->lng->txt(
'ps_password_special_chars_enabled_info'));
 
  289                         $radio_opt->addSubItem($check);
 
  291                                 $text = 
new ilTextInputGUI($this->lng->txt(
'ps_password_min_length'),
'password_min_length');
 
  292                                 $text->
setInfo($this->lng->txt(
'ps_password_min_length_info'));
 
  293                                 $text->setValue( $security->getPasswordMinLength() );
 
  295                                 $text->setMaxLength(2);
 
  296                         $radio_opt->addSubItem($text);
 
  298                                 $text = 
new ilTextInputGUI($this->lng->txt(
'ps_password_max_length'),
'password_max_length');
 
  299                                 $text->
setInfo($this->lng->txt(
'ps_password_max_length_info'));
 
  300                                 $text->setValue( $security->getPasswordMaxLength() );
 
  302                                 $text->setMaxLength(3);
 
  303                         $radio_opt->addSubItem($text);
 
  305                                 $text = 
new ilTextInputGUI($this->lng->txt(
'ps_password_max_age'),
'password_max_age');
 
  306                                 $text->
setInfo($this->lng->txt(
'ps_password_max_age_info'));
 
  307                                 $text->setValue( $security->getPasswordMaxAge() );
 
  309                                 $text->setMaxLength(3);
 
  310                         $radio_opt->addSubItem($text);
 
  312                                 $text = 
new ilTextInputGUI($this->lng->txt(
'ps_login_max_attempts'),
'login_max_attempts');
 
  313                                 $text->
setInfo($this->lng->txt(
'ps_login_max_attempts_info'));
 
  314                                 $text->setValue( $security->getLoginMaxAttempts() );
 
  316                                 $text->setMaxLength(2);
 
  317                         $radio_opt->addSubItem($text);
 
  319                 $radio_group->addOption($radio_opt);
 
  320                 $form->addItem($radio_group);
 
  322                 $check = 
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_change_on_first_login_enabled'),
'password_change_on_first_login_enabled');
 
  323                 $check->
setInfo($this->lng->txt(
'ps_password_change_on_first_login_enabled_info'));
 
  324                 $check->setChecked( $security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0 );
 
  325                 $form->addItem($check);
 
  328                 $ti = 
new ilTextInputGUI($this->lng->txt(
"file_suffix_repl"), 
"suffix_repl_additional");
 
  331                 $ti->setInfo($this->lng->txt(
"file_suffix_repl_info").
" ".SUFFIX_REPL_DEFAULT);
 
  332                 $ti->setValue($ilSetting->get(
"suffix_repl_additional"));
 
  336                 $objCb = 
new ilCheckboxInputGUI($this->lng->txt(
'ps_prevent_simultaneous_logins'), 
'ps_prevent_simultaneous_logins');
 
  337                 $objCb->
setChecked((
int)$security->isPreventionOfSimultaneousLoginsEnabled());
 
  339                 $objCb->setOptionTitle($this->lng->txt(
'ps_prevent_simultaneous_logins_info'));
 
  340                 $form->addItem($objCb);
 
  344                 $admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID));
 
  345                 $admin->setInfo(
$GLOBALS[
'lng']->txt(
'adm_adm_role_protect_info'));
 
  346                 $admin->setChecked((
int) $security->isAdminRoleProtected());
 
  348                 $form->addItem($admin);
 
  350                 $form->addCommandButton(
'save_security',$this->lng->txt(
'save'));
 
  351                 $this->tpl->setContent($form->getHTML());
 
  364                 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
 
  366                         $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
 
  369                 if((
int) 
$_POST[
'rbac_log_age'] > 24)
 
  371                         $_POST[
'rbac_log_age'] = 24;
 
  373                 else if((
int) 
$_POST[
'rbac_log_age'] < 1)
 
  375                         $_POST[
'rbac_log_age'] = 1;
 
  378                 $_POST[
'profile_protection'] = isset(
$_POST[
'profile_protection']) ? 
$_POST[
'profile_protection'] : array();
 
  381                 $privacy->enableCourseExport((
int) in_array(
'export_course', 
$_POST[
'profile_protection']));
 
  382                 $privacy->enableGroupExport((
int) in_array(
'export_group', 
$_POST[
'profile_protection']));
 
  383                 $privacy->setCourseConfirmationRequired((
int) in_array(
'export_confirm_course', 
$_POST[
'profile_protection']));
 
  384                 $privacy->setGroupConfirmationRequired((
int) in_array(
'export_confirm_group', 
$_POST[
'profile_protection']));
 
  385                 $privacy->showGroupAccessTimes((
int) in_array(
'grp_access_times', 
$_POST[
'profile_protection']));
 
  386                 $privacy->showCourseAccessTimes((
int) in_array(
'crs_access_times', 
$_POST[
'profile_protection']));
 
  387                 $privacy->enableForaStatistics ((
int) 
$_POST[
'fora_statistics']);
 
  388                 $privacy->enableAnonymousFora ((
int) $_POST[
'anonymous_fora']);
 
  389                 $privacy->enableRbacLog((
int) $_POST[
'rbac_log']);
 
  390                 $privacy->setRbacLogAge((
int) $_POST[
'rbac_log_age']);
 
  391                 $privacy->enableSahsProtocolData((
int) $_POST[
'enable_sahs_pd']);
 
  394         $code = $privacy->validate();
 
  405                     include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
 
  423                 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
 
  425                         $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
 
  432         $security->setAutomaticHTTPSEnabled((
int) 
$_POST[
"auto_https_detect_enabled"]);
 
  433         $security->setAutomaticHTTPSHeaderName(
ilUtil::stripSlashes($_POST[
"auto_https_detect_header_name"]));
 
  434         $security->setAutomaticHTTPSHeaderValue(
ilUtil::stripSlashes($_POST[
"auto_https_detect_header_value"]));
 
  437         $security->setPreventionOfSimultaneousLogins((
bool)$_POST[
'ps_prevent_simultaneous_logins']);
 
  440         $security->setHTTPSEnabled($_POST[
"https_enabled"]);
 
  443                 $security->setAccountSecurityMode((
int) $_POST[
"account_security_mode"]);
 
  444                 $security->setPasswordCharsAndNumbersEnabled((
bool) $_POST[
"password_chars_and_numbers_enabled"]);
 
  445                 $security->setPasswordSpecialCharsEnabled((
bool) $_POST[
"password_special_chars_enabled"]);
 
  446                 $security->setPasswordMinLength((
int) $_POST[
"password_min_length"]);
 
  447                 $security->setPasswordMaxLength((
int) $_POST[
"password_max_length"]);
 
  448                 $security->setPasswordMaxAge((
int) $_POST[
"password_max_age"]);
 
  449                 $security->setLoginMaxAttempts((
int) $_POST[
"login_max_attempts"]);
 
  452                 $security->setPasswordChangeOnFirstLoginEnabled((
bool) $_POST[
'password_change_on_first_login_enabled']);
 
  455                 $ilSetting->set(
"suffix_repl_additional", $_POST[
"suffix_repl_additional"]);
 
  458                 if($rbacreview->isAssigned($ilUser->getId(),SYSTEM_ROLE_ID))
 
  460                         $security->protectedAdminRole((
int) $_POST[
'admin_role']);
 
  463         $code = $security->validate();