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);
338 $form->addCommandButton(
'save_security',$this->lng->txt(
'save'));
339 $this->tpl->setContent($form->getHTML());
352 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
354 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
357 if((
int)
$_POST[
'rbac_log_age'] > 24)
359 $_POST[
'rbac_log_age'] = 24;
361 else if((
int)
$_POST[
'rbac_log_age'] < 1)
363 $_POST[
'rbac_log_age'] = 1;
366 $_POST[
'profile_protection'] = isset(
$_POST[
'profile_protection']) ?
$_POST[
'profile_protection'] : array();
369 $privacy->enableCourseExport((
int) in_array(
'export_course',
$_POST[
'profile_protection']));
370 $privacy->enableGroupExport((
int) in_array(
'export_group',
$_POST[
'profile_protection']));
371 $privacy->setCourseConfirmationRequired((
int) in_array(
'export_confirm_course',
$_POST[
'profile_protection']));
372 $privacy->setGroupConfirmationRequired((
int) in_array(
'export_confirm_group',
$_POST[
'profile_protection']));
373 $privacy->showGroupAccessTimes((
int) in_array(
'grp_access_times',
$_POST[
'profile_protection']));
374 $privacy->showCourseAccessTimes((
int) in_array(
'crs_access_times',
$_POST[
'profile_protection']));
375 $privacy->enableForaStatistics ((
int)
$_POST[
'fora_statistics']);
376 $privacy->enableAnonymousFora ((
int) $_POST[
'anonymous_fora']);
377 $privacy->enableRbacLog((
int) $_POST[
'rbac_log']);
378 $privacy->setRbacLogAge((
int) $_POST[
'rbac_log_age']);
381 $code = $privacy->validate();
392 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
410 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
412 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
419 $security->setAutomaticHTTPSEnabled((
int)
$_POST[
"auto_https_detect_enabled"]);
420 $security->setAutomaticHTTPSHeaderName(
ilUtil::stripSlashes($_POST[
"auto_https_detect_header_name"]));
421 $security->setAutomaticHTTPSHeaderValue(
ilUtil::stripSlashes($_POST[
"auto_https_detect_header_value"]));
424 $security->setPreventionOfSimultaneousLogins((
bool)$_POST[
'ps_prevent_simultaneous_logins']);
427 $security->setHTTPSEnabled($_POST[
"https_enabled"]);
430 $security->setAccountSecurityMode((
int) $_POST[
"account_security_mode"]);
431 $security->setPasswordCharsAndNumbersEnabled((
bool) $_POST[
"password_chars_and_numbers_enabled"]);
432 $security->setPasswordSpecialCharsEnabled((
bool) $_POST[
"password_special_chars_enabled"]);
433 $security->setPasswordMinLength((
int) $_POST[
"password_min_length"]);
434 $security->setPasswordMaxLength((
int) $_POST[
"password_max_length"]);
435 $security->setPasswordMaxAge((
int) $_POST[
"password_max_age"]);
436 $security->setLoginMaxAttempts((
int) $_POST[
"login_max_attempts"]);
439 $security->setPasswordChangeOnFirstLoginEnabled((
bool) $_POST[
'password_change_on_first_login_enabled']);
442 $ilSetting->set(
"suffix_repl_additional", $_POST[
"suffix_repl_additional"]);
445 $code = $security->validate();