3 include_once(
"./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');
127 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.show_privacy.html',
'Services/PrivacySecurity');
129 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
132 $this->tpl->setCurrentBlock(
'warning_modify');
133 $this->tpl->setVariable(
'TXT_WARNING',$this->lng->txt(
'ps_warning_modify'));
134 $this->tpl->parseCurrentBlock();
137 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
138 $this->tpl->setVariable(
'TXT_PRIVACY_PROTECTION',$this->lng->txt(
'ps_privacy_protection'));
139 $this->tpl->setVariable(
'TXT_PROFILE_EXPORT',$this->lng->txt(
'ps_profile_export'));
140 $this->tpl->setVariable(
'TXT_EXPORT_COURSE',$this->lng->txt(
'ps_export_course'));
141 $this->tpl->setVariable(
'TXT_EXPORT_CONFIRM',$this->lng->txt(
'ps_export_confirm'));
142 $this->tpl->setVariable(
'TXT_GRP_ACCESS',$this->lng->txt(
'ps_show_grp_access'));
143 $this->tpl->setVariable(
'TXT_CRS_ACCESS',$this->lng->txt(
'ps_show_crs_access'));
146 $this->tpl->setVariable(
'CHECK_EXPORT_COURSE',
ilUtil::formCheckbox($privacy->enabledExport() ? 1 : 0,
'export_course',1));
147 $this->tpl->setVariable(
'CHECK_EXPORT_CONFIRM',
ilUtil::formCheckbox($privacy->confirmationRequired() ? 1 : 0,
'export_confirm',1));
148 $this->tpl->setVariable(
'CHECK_GRP_ACCESS',
ilUtil::formCheckbox($privacy->enabledGroupAccessTimes() ? 1 : 0,
'grp_access_times',1));
149 $this->tpl->setVariable(
'CHECK_CRS_ACCESS',
ilUtil::formCheckbox($privacy->enabledCourseAccessTimes() ? 1 : 0,
'crs_access_times',1));
152 $this->tpl->setVariable(
'TXT_STATISTICS',$this->lng->txt(
'enable_fora_statistics'));
153 $this->tpl->setVariable(
'TXT_FORA_STATISTICS',$this->lng->txt(
'enable_fora_statistics_desc'));
154 $this->tpl->setVariable(
'CHECK_FORA_STATISTICS',
ilUtil::formCheckbox($privacy->enabledForaStatistics() ? 1 : 0,
'fora_statistics',1));
157 $this->tpl->setVariable(
'TXT_ANONYMITY',$this->lng->txt(
'disable_anonymous_fora'));
158 $this->tpl->setVariable(
'TXT_ANONYMOUS_FORA',$this->lng->txt(
'disable_anonymous_fora_desc'));
159 $this->tpl->setVariable(
'CHECK_ANONYMOUS_FORA',
ilUtil::formCheckbox($privacy->disabledAnonymousFora() ? 1 : 0,
'anonymous_fora',1));
162 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
175 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
178 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.show_security.html',
'Services/PrivacySecurity');
180 $this->tabs_gui->setTabActive(
'show_security');
183 $form->setFormAction($this->ctrl->getFormAction($this));
184 $form->setTitle($this->lng->txt(
'ps_security_protection'));
187 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_auto_https'),
'auto_https_detect_enabled');
188 $check->
setOptionTitle($this->lng->txt(
'ps_auto_https_description'));
189 $check->setChecked($security->isAutomaticHTTPSEnabled() ? 1 : 0);
192 $text =
new ilTextInputGUI($this->lng->txt(
'ps_auto_https_header_name'),
'auto_https_detect_header_name');
193 $text->
setValue($security->getAutomaticHTTPSHeaderName());
195 $text->setMaxLength(64);
196 $check->addSubItem($text);
198 $text =
new ilTextInputGUI($this->lng->txt(
'ps_auto_https_header_value'),
'auto_https_detect_header_value');
199 $text->
setValue($security->getAutomaticHTTPSHeaderValue());
201 $text->setMaxLength(64);
202 $check->addSubItem($text);
204 $form->addItem($check);
207 $check2->
setChecked($security->isHTTPSEnabled() ? 1 : 0);
208 $check2->setValue(1);
209 $form->addItem($check2);
211 $radio_group =
new ilRadioGroupInputGUI($this->lng->txt(
'ps_account_security_mode'),
'account_security_mode' );
212 $radio_group->
setValue($security->getAccountSecurityMode());
215 $radio_group->addOption($radio_opt);
219 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_chars_and_numbers_enabled'),
'password_chars_and_numbers_enabled');
220 $check->setChecked( $security->isPasswordCharsAndNumbersEnabled() ? 1 : 0 );
222 $check->
setInfo($this->lng->txt(
'ps_password_chars_and_numbers_enabled_info'));
223 $radio_opt->addSubItem($check);
225 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_special_chars_enabled'),
'password_special_chars_enabled');
226 $check->setChecked( $security->isPasswordSpecialCharsEnabled() ? 1 : 0 );
228 $check->
setInfo($this->lng->txt(
'ps_password_special_chars_enabled_info'));
229 $radio_opt->addSubItem($check);
231 $text =
new ilTextInputGUI($this->lng->txt(
'ps_password_min_length'),
'password_min_length');
232 $text->
setInfo($this->lng->txt(
'ps_password_min_length_info'));
233 $text->setValue( $security->getPasswordMinLength() );
235 $text->setMaxLength(2);
236 $radio_opt->addSubItem($text);
238 $text =
new ilTextInputGUI($this->lng->txt(
'ps_password_max_length'),
'password_max_length');
239 $text->
setInfo($this->lng->txt(
'ps_password_max_length_info'));
240 $text->setValue( $security->getPasswordMaxLength() );
242 $text->setMaxLength(3);
243 $radio_opt->addSubItem($text);
245 $text =
new ilTextInputGUI($this->lng->txt(
'ps_password_max_age'),
'password_max_age');
246 $text->
setInfo($this->lng->txt(
'ps_password_max_age_info'));
247 $text->setValue( $security->getPasswordMaxAge() );
249 $text->setMaxLength(3);
250 $radio_opt->addSubItem($text);
252 $text =
new ilTextInputGUI($this->lng->txt(
'ps_login_max_attempts'),
'login_max_attempts');
253 $text->
setInfo($this->lng->txt(
'ps_login_max_attempts_info'));
254 $text->setValue( $security->getLoginMaxAttempts() );
256 $text->setMaxLength(2);
257 $radio_opt->addSubItem($text);
259 $radio_group->addOption($radio_opt);
260 $form->addItem($radio_group);
262 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_change_on_first_login_enabled'),
'password_change_on_first_login_enabled');
263 $check->
setInfo($this->lng->txt(
'ps_password_change_on_first_login_enabled_info'));
264 $check->setChecked( $security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0 );
265 $form->addItem($check);
268 $ti =
new ilTextInputGUI($this->lng->txt(
"file_suffix_repl"),
"suffix_repl_additional");
271 $ti->setInfo($this->lng->txt(
"file_suffix_repl_info").
" ".SUFFIX_REPL_DEFAULT);
272 $ti->setValue($ilSetting->get(
"suffix_repl_additional"));
276 $objCb =
new ilCheckboxInputGUI($this->lng->txt(
'ps_prevent_simultaneous_logins'),
'ps_prevent_simultaneous_logins');
277 $objCb->
setChecked((
int)$security->isPreventionOfSimultaneousLoginsEnabled());
279 $objCb->setOptionTitle($this->lng->txt(
'ps_prevent_simultaneous_logins_info'));
280 $form->addItem($objCb);
283 $form->addCommandButton(
'save_security',$this->lng->txt(
'save'));
284 $this->tpl->setVariable(
'NEW_FORM',$form->getHTML());
297 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
299 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
304 $privacy->enableExport((
int)
$_POST[
'export_course']);
305 $privacy->setConfirmationRequired((
int) $_POST[
'export_confirm']);
306 $privacy->enableForaStatistics ((
int) $_POST[
'fora_statistics']);
307 $privacy->disableAnonymousFora ((
int) $_POST[
'anonymous_fora']);
308 $privacy->showGroupAccessTimes((
int) $_POST[
'grp_access_times']);
309 $privacy->showCourseAccessTimes((
int) $_POST[
'crs_access_times']);
312 $code = $privacy->validate();
323 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
341 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
343 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
350 $security->setAutomaticHTTPSEnabled((
int)
$_POST[
"auto_https_detect_enabled"]);
351 $security->setAutomaticHTTPSHeaderName(
ilUtil::stripSlashes($_POST[
"auto_https_detect_header_name"]));
352 $security->setAutomaticHTTPSHeaderValue(
ilUtil::stripSlashes($_POST[
"auto_https_detect_header_value"]));
355 $security->setPreventionOfSimultaneousLogins((
bool)$_POST[
'ps_prevent_simultaneous_logins']);
358 $security->setHTTPSEnabled($_POST[
"https_enabled"]);
361 $security->setAccountSecurityMode((
int) $_POST[
"account_security_mode"]);
362 $security->setPasswordCharsAndNumbersEnabled((
bool) $_POST[
"password_chars_and_numbers_enabled"]);
363 $security->setPasswordSpecialCharsEnabled((
bool) $_POST[
"password_special_chars_enabled"]);
364 $security->setPasswordMinLength((
int) $_POST[
"password_min_length"]);
365 $security->setPasswordMaxLength((
int) $_POST[
"password_max_length"]);
366 $security->setPasswordMaxAge((
int) $_POST[
"password_max_age"]);
367 $security->setLoginMaxAttempts((
int) $_POST[
"login_max_attempts"]);
370 $security->setPasswordChangeOnFirstLoginEnabled((
bool) $_POST[
'password_change_on_first_login_enabled']);
373 $ilSetting->set(
"suffix_repl_additional", $_POST[
"suffix_repl_additional"]);
376 $code = $security->validate();