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');
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(
'rbac_log'),
'rbac_log');
205 $check->setInfo($this->lng->txt(
'rbac_log_info'));
206 $check->setChecked($privacy->enabledRbacLog());
207 $form->addItem($check);
209 $age =
new ilNumberInputGUI($this->lng->txt(
'rbac_log_age'),
'rbac_log_age');
210 $age->
setInfo($this->lng->txt(
'rbac_log_age_info'));
211 $age->setValue($privacy->getRbacLogAge());
212 $age->setMinValue(1);
213 $age->setMaxValue(24);
215 $age->setMaxLength(2);
216 $check->addSubItem($age);
218 $form->addCommandButton(
'save_privacy',$this->lng->txt(
'save'));
219 $this->tpl->setContent($form->getHTML());
231 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
235 $this->tabs_gui->setTabActive(
'show_security');
238 $form->setFormAction($this->ctrl->getFormAction($this));
239 $form->setTitle($this->lng->txt(
'ps_security_protection'));
242 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_auto_https'),
'auto_https_detect_enabled');
243 $check->
setOptionTitle($this->lng->txt(
'ps_auto_https_description'));
244 $check->setChecked($security->isAutomaticHTTPSEnabled() ? 1 : 0);
247 $text =
new ilTextInputGUI($this->lng->txt(
'ps_auto_https_header_name'),
'auto_https_detect_header_name');
248 $text->
setValue($security->getAutomaticHTTPSHeaderName());
250 $text->setMaxLength(64);
251 $check->addSubItem($text);
253 $text =
new ilTextInputGUI($this->lng->txt(
'ps_auto_https_header_value'),
'auto_https_detect_header_value');
254 $text->
setValue($security->getAutomaticHTTPSHeaderValue());
256 $text->setMaxLength(64);
257 $check->addSubItem($text);
259 $form->addItem($check);
262 $check2->
setChecked($security->isHTTPSEnabled() ? 1 : 0);
263 $check2->setValue(1);
264 $form->addItem($check2);
266 $radio_group =
new ilRadioGroupInputGUI($this->lng->txt(
'ps_account_security_mode'),
'account_security_mode' );
267 $radio_group->
setValue($security->getAccountSecurityMode());
270 $radio_group->addOption($radio_opt);
274 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_chars_and_numbers_enabled'),
'password_chars_and_numbers_enabled');
275 $check->setChecked( $security->isPasswordCharsAndNumbersEnabled() ? 1 : 0 );
277 $check->
setInfo($this->lng->txt(
'ps_password_chars_and_numbers_enabled_info'));
278 $radio_opt->addSubItem($check);
280 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_special_chars_enabled'),
'password_special_chars_enabled');
281 $check->setChecked( $security->isPasswordSpecialCharsEnabled() ? 1 : 0 );
283 $check->
setInfo($this->lng->txt(
'ps_password_special_chars_enabled_info'));
284 $radio_opt->addSubItem($check);
286 $text =
new ilTextInputGUI($this->lng->txt(
'ps_password_min_length'),
'password_min_length');
287 $text->
setInfo($this->lng->txt(
'ps_password_min_length_info'));
288 $text->setValue( $security->getPasswordMinLength() );
290 $text->setMaxLength(2);
291 $radio_opt->addSubItem($text);
293 $text =
new ilTextInputGUI($this->lng->txt(
'ps_password_max_length'),
'password_max_length');
294 $text->
setInfo($this->lng->txt(
'ps_password_max_length_info'));
295 $text->setValue( $security->getPasswordMaxLength() );
297 $text->setMaxLength(3);
298 $radio_opt->addSubItem($text);
300 $text =
new ilTextInputGUI($this->lng->txt(
'ps_password_max_age'),
'password_max_age');
301 $text->
setInfo($this->lng->txt(
'ps_password_max_age_info'));
302 $text->setValue( $security->getPasswordMaxAge() );
304 $text->setMaxLength(3);
305 $radio_opt->addSubItem($text);
307 $text =
new ilTextInputGUI($this->lng->txt(
'ps_login_max_attempts'),
'login_max_attempts');
308 $text->
setInfo($this->lng->txt(
'ps_login_max_attempts_info'));
309 $text->setValue( $security->getLoginMaxAttempts() );
311 $text->setMaxLength(2);
312 $radio_opt->addSubItem($text);
314 $radio_group->addOption($radio_opt);
315 $form->addItem($radio_group);
317 $check =
new ilCheckboxInputGUI($this->lng->txt(
'ps_password_change_on_first_login_enabled'),
'password_change_on_first_login_enabled');
318 $check->
setInfo($this->lng->txt(
'ps_password_change_on_first_login_enabled_info'));
319 $check->setChecked( $security->isPasswordChangeOnFirstLoginEnabled() ? 1 : 0 );
320 $form->addItem($check);
323 $ti =
new ilTextInputGUI($this->lng->txt(
"file_suffix_repl"),
"suffix_repl_additional");
326 $ti->setInfo($this->lng->txt(
"file_suffix_repl_info").
" ".SUFFIX_REPL_DEFAULT);
327 $ti->setValue($ilSetting->get(
"suffix_repl_additional"));
331 $objCb =
new ilCheckboxInputGUI($this->lng->txt(
'ps_prevent_simultaneous_logins'),
'ps_prevent_simultaneous_logins');
332 $objCb->
setChecked((
int)$security->isPreventionOfSimultaneousLoginsEnabled());
334 $objCb->setOptionTitle($this->lng->txt(
'ps_prevent_simultaneous_logins_info'));
335 $form->addItem($objCb);
344 $sh->setTitle($this->lng->txt(
"exam_browser_settings"));
347 $ti2 =
new ilTextInputGUI($this->lng->txt(
"exam_user_agent"),
"exam_user_agent");
350 $ti2->setInfo($this->lng->txt(
"exam_user_agent_info"));
351 $ti2->setValue($security->getExamUserAgent());
352 $form->addItem($ti2);
354 $ti3 =
new ilTextInputGUI($this->lng->txt(
"exam_skin"),
"exam_skin");
357 $ti3->setInfo($this->lng->txt(
"exam_skin_info"));
358 $ti3->setValue($security->getExamSkin());
359 $form->addItem($ti3);
361 $ti4 =
new ilTextInputGUI($this->lng->txt(
"exam_role_id"),
"exam_role_id");
364 $ti4->setInfo($this->lng->txt(
"exam_role_id_info"));
365 $ti4->setValue($security->getExamRoleId());
366 $form->addItem($ti4);
368 $form->addCommandButton(
'save_security',$this->lng->txt(
'save'));
369 $this->tpl->setContent($form->getHTML());
382 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
384 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
387 if((
int)
$_POST[
'rbac_log_age'] > 24)
389 $_POST[
'rbac_log_age'] = 24;
391 else if((
int)
$_POST[
'rbac_log_age'] < 1)
393 $_POST[
'rbac_log_age'] = 1;
396 $_POST[
'profile_protection'] = isset(
$_POST[
'profile_protection']) ?
$_POST[
'profile_protection'] : array();
399 $privacy->enableCourseExport((
int) in_array(
'export_course',
$_POST[
'profile_protection']));
400 $privacy->enableGroupExport((
int) in_array(
'export_group',
$_POST[
'profile_protection']));
401 $privacy->setCourseConfirmationRequired((
int) in_array(
'export_confirm_course',
$_POST[
'profile_protection']));
402 $privacy->setGroupConfirmationRequired((
int) in_array(
'export_confirm_group',
$_POST[
'profile_protection']));
403 $privacy->showGroupAccessTimes((
int) in_array(
'grp_access_times',
$_POST[
'profile_protection']));
404 $privacy->showCourseAccessTimes((
int) in_array(
'crs_access_times',
$_POST[
'profile_protection']));
405 $privacy->enableForaStatistics ((
int)
$_POST[
'fora_statistics']);
406 $privacy->enableAnonymousFora ((
int) $_POST[
'anonymous_fora']);
407 $privacy->enableRbacLog((
int) $_POST[
'rbac_log']);
408 $privacy->setRbacLogAge((
int) $_POST[
'rbac_log_age']);
411 $code = $privacy->validate();
422 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
440 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
442 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
449 $security->setAutomaticHTTPSEnabled((
int)
$_POST[
"auto_https_detect_enabled"]);
450 $security->setAutomaticHTTPSHeaderName(
ilUtil::stripSlashes($_POST[
"auto_https_detect_header_name"]));
451 $security->setAutomaticHTTPSHeaderValue(
ilUtil::stripSlashes($_POST[
"auto_https_detect_header_value"]));
454 $security->setPreventionOfSimultaneousLogins((
bool)$_POST[
'ps_prevent_simultaneous_logins']);
457 $security->setHTTPSEnabled($_POST[
"https_enabled"]);
460 $security->setAccountSecurityMode((
int) $_POST[
"account_security_mode"]);
461 $security->setPasswordCharsAndNumbersEnabled((
bool) $_POST[
"password_chars_and_numbers_enabled"]);
462 $security->setPasswordSpecialCharsEnabled((
bool) $_POST[
"password_special_chars_enabled"]);
463 $security->setPasswordMinLength((
int) $_POST[
"password_min_length"]);
464 $security->setPasswordMaxLength((
int) $_POST[
"password_max_length"]);
465 $security->setPasswordMaxAge((
int) $_POST[
"password_max_age"]);
466 $security->setLoginMaxAttempts((
int) $_POST[
"login_max_attempts"]);
469 $security->setPasswordChangeOnFirstLoginEnabled((
bool) $_POST[
'password_change_on_first_login_enabled']);
472 $ilSetting->set(
"suffix_repl_additional", $_POST[
"suffix_repl_additional"]);
475 $security->setExamUserAgent($_POST[
"exam_user_agent"]);
476 $security->setExamSkin($_POST[
"exam_skin"]);
477 $security->setExamRoleId($_POST[
"exam_role_id"]);
480 $code = $security->validate();