23 include_once(
"./classes/class.ilObjectGUI.php");
24 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
25 include_once(
'./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
46 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
51 $this->lng->loadLanguageModule(
'ps');
75 global $rbacsystem,
$ilErr,$ilAccess;
77 $next_class = $this->ctrl->getNextClass($this);
78 $cmd = $this->ctrl->getCmd();
82 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
84 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
89 case 'ilpermissiongui':
90 $this->tabs_gui->setTabActive(
'perm_settings');
91 include_once(
"./classes/class.ilPermissionGUI.php");
93 $ret =& $this->ctrl->forwardCommand($perm_gui);
118 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
120 $this->tabs_gui->addTarget(
"show_privacy",
121 $this->ctrl->getLinkTarget($this,
"showPrivacy"),
123 $this->tabs_gui->addTarget(
"show_security",
124 $this->ctrl->getLinkTarget($this,
"showSecurity"),
129 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
131 $this->tabs_gui->addTarget(
"perm_settings",
132 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
133 array(),
'ilpermissiongui');
146 $this->tabs_gui->setTabActive(
'show_privacy');
147 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.show_privacy.html',
'Services/PrivacySecurity');
149 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
152 $this->tpl->setCurrentBlock(
'warning_modify');
153 $this->tpl->setVariable(
'TXT_WARNING',$this->lng->txt(
'ps_warning_modify'));
154 $this->tpl->parseCurrentBlock();
157 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
158 $this->tpl->setVariable(
'TXT_PRIVACY_PROTECTION',$this->lng->txt(
'ps_privacy_protection'));
159 $this->tpl->setVariable(
'TXT_PROFILE_EXPORT',$this->lng->txt(
'ps_profile_export'));
160 $this->tpl->setVariable(
'TXT_EXPORT_COURSE',$this->lng->txt(
'ps_export_course'));
161 $this->tpl->setVariable(
'TXT_EXPORT_CONFIRM',$this->lng->txt(
'ps_export_confirm'));
162 $this->tpl->setVariable(
'TXT_GRP_ACCESS',$this->lng->txt(
'ps_show_grp_access'));
163 $this->tpl->setVariable(
'TXT_CRS_ACCESS',$this->lng->txt(
'ps_show_crs_access'));
166 $this->tpl->setVariable(
'CHECK_EXPORT_COURSE',
ilUtil::formCheckbox($privacy->enabledExport() ? 1 : 0,
'export_course',1));
167 $this->tpl->setVariable(
'CHECK_EXPORT_CONFIRM',
ilUtil::formCheckbox($privacy->confirmationRequired() ? 1 : 0,
'export_confirm',1));
168 $this->tpl->setVariable(
'CHECK_GRP_ACCESS',
ilUtil::formCheckbox($privacy->enabledGroupAccessTimes() ? 1 : 0,
'grp_access_times',1));
169 $this->tpl->setVariable(
'CHECK_CRS_ACCESS',
ilUtil::formCheckbox($privacy->enabledCourseAccessTimes() ? 1 : 0,
'crs_access_times',1));
172 $this->tpl->setVariable(
'TXT_STATISTICS',$this->lng->txt(
'enable_fora_statistics'));
173 $this->tpl->setVariable(
'TXT_FORA_STATISTICS',$this->lng->txt(
'enable_fora_statistics_desc'));
174 $this->tpl->setVariable(
'CHECK_FORA_STATISTICS',
ilUtil::formCheckbox($privacy->enabledForaStatistics() ? 1 : 0,
'fora_statistics',1));
177 $this->tpl->setVariable(
'TXT_ANONYMITY',$this->lng->txt(
'disable_anonymous_fora'));
178 $this->tpl->setVariable(
'TXT_ANONYMOUS_FORA',$this->lng->txt(
'disable_anonymous_fora_desc'));
179 $this->tpl->setVariable(
'CHECK_ANONYMOUS_FORA',
ilUtil::formCheckbox($privacy->disabledAnonymousFora() ? 1 : 0,
'anonymous_fora',1));
182 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
194 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
197 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.show_security.html',
'Services/PrivacySecurity');
199 $this->tabs_gui->setTabActive(
'show_security');
202 $form->setFormAction($this->ctrl->getFormAction($this));
203 $form->setTitle($this->lng->txt(
'ps_security_protection'));
206 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_auto_https'),
'auto_https_detect_enabled');
207 $check->
setOptionTitle($this->lng->txt(
'ps_auto_https_description'));
208 $check->setChecked($security->isAutomaticHTTPSEnabled() ? 1 : 0);
211 $text =
new ilTextInputGUI($this->lng->txt(
'ps_auto_https_header_name'),
'auto_https_detect_header_name');
212 $text->
setValue($security->getAutomaticHTTPSHeaderName());
214 $text->setMaxLength(64);
215 $check->addSubItem($text);
217 $text =
new ilTextInputGUI($this->lng->txt(
'ps_auto_https_header_value'),
'auto_https_detect_header_value');
218 $text->
setValue($security->getAutomaticHTTPSHeaderValue());
220 $text->setMaxLength(64);
221 $check->addSubItem($text);
223 $form->addItem($check);
226 $check2->
setChecked($security->isHTTPSEnabled() ? 1 : 0);
227 $check2->setValue(1);
228 $form->addItem($check2);
230 $radio_group =
new ilRadioGroupInputGUI($this->lng->txt(
'ps_account_security_mode'),
'account_security_mode' );
231 $radio_group->
setValue($security->getAccountSecurityMode());
234 $radio_group->addOption($radio_opt);
238 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_chars_and_numbers_enabled'),
'password_chars_and_numbers_enabled');
239 $check->setChecked( $security->isPasswordCharsAndNumbersEnabled() ? 1 : 0 );
241 $check->
setInfo($this->lng->txt(
'ps_password_chars_and_numbers_enabled_info'));
242 $radio_opt->addSubItem($check);
244 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_special_chars_enabled'),
'password_special_chars_enabled');
245 $check->setChecked( $security->isPasswordSpecialCharsEnabled() ? 1 : 0 );
247 $check->
setInfo($this->lng->txt(
'ps_password_special_chars_enabled_info'));
248 $radio_opt->addSubItem($check);
250 $text =
new ilTextInputGUI($this->lng->txt(
'ps_password_min_length'),
'password_min_length');
251 $text->
setInfo($this->lng->txt(
'ps_password_min_length_info'));
252 $text->setValue( $security->getPasswordMinLength() );
254 $text->setMaxLength(2);
255 $radio_opt->addSubItem($text);
257 $text =
new ilTextInputGUI($this->lng->txt(
'ps_password_max_length'),
'password_max_length');
258 $text->
setInfo($this->lng->txt(
'ps_password_max_length_info'));
259 $text->setValue( $security->getPasswordMaxLength() );
261 $text->setMaxLength(2);
262 $radio_opt->addSubItem($text);
264 $text =
new ilTextInputGUI($this->lng->txt(
'ps_password_max_age'),
'password_max_age');
265 $text->
setInfo($this->lng->txt(
'ps_password_max_age_info'));
266 $text->setValue( $security->getPasswordMaxAge() );
268 $text->setMaxLength(2);
269 $radio_opt->addSubItem($text);
271 $text =
new ilTextInputGUI($this->lng->txt(
'ps_login_max_attempts'),
'login_max_attempts');
272 $text->
setInfo($this->lng->txt(
'ps_login_max_attempts_info'));
273 $text->setValue( $security->getLoginMaxAttempts() );
275 $text->setMaxLength(2);
276 $radio_opt->addSubItem($text);
278 $radio_group->addOption($radio_opt);
279 $form->addItem($radio_group);
281 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_change_on_first_login_enabled'),
'password_change_on_first_login_enabled');
282 $check->
setInfo($this->lng->txt(
'ps_password_change_on_first_login_enabled_info'));
283 $check->setChecked( $security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0 );
284 $form->addItem($check);
287 $form->addCommandButton(
'save_security',$this->lng->txt(
'save'));
288 $this->tpl->setVariable(
'NEW_FORM',$form->getHTML());
301 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
303 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
308 $privacy->enableExport((
int) $_POST[
'export_course']);
309 $privacy->setConfirmationRequired((
int) $_POST[
'export_confirm']);
310 $privacy->enableForaStatistics ((
int) $_POST[
'fora_statistics']);
311 $privacy->disableAnonymousFora ((
int) $_POST[
'anonymous_fora']);
312 $privacy->showGroupAccessTimes((
int) $_POST[
'grp_access_times']);
313 $privacy->showCourseAccessTimes((
int) $_POST[
'crs_access_times']);
316 $code = $privacy->validate();
327 include_once(
'Modules/Course/classes/class.ilCourseAgreement.php');
345 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
347 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
354 $security->setAutomaticHTTPSEnabled((
int) $_POST[
"auto_https_detect_enabled"]);
355 $security->setAutomaticHTTPSHeaderName($_POST[
"auto_https_detect_header_name"]);
356 $security->setAutomaticHTTPSHeaderValue($_POST[
"auto_https_detect_header_value"]);
359 $security->setHTTPSEnabled($_POST[
"https_enabled"]);
362 $security->setAccountSecurityMode((
int) $_POST[
"account_security_mode"]);
363 $security->setPasswordCharsAndNumbersEnabled((
bool) $_POST[
"password_chars_and_numbers_enabled"]);
364 $security->setPasswordSpecialCharsEnabled((
bool) $_POST[
"password_special_chars_enabled"]);
365 $security->setPasswordMinLength((
int) $_POST[
"password_min_length"]);
366 $security->setPasswordMaxLength((
int) $_POST[
"password_max_length"]);
367 $security->setPasswordMaxAge((
int) $_POST[
"password_max_age"]);
368 $security->setLoginMaxAttempts((
int) $_POST[
"login_max_attempts"]);
371 $security->setPasswordChangeOnFirstLoginEnabled((
bool) $_POST[
'password_change_on_first_login_enabled']);
375 $code = $security->validate();