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)
38 if(is_array(self::$ERROR_MESSAGE))
43 $lng->loadLanguageModule(
'ps');
68 global $rbacsystem,
$ilErr,$ilAccess;
70 $next_class = $this->ctrl->getNextClass($this);
71 $cmd = $this->ctrl->getCmd();
75 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
77 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
82 case 'ilpermissiongui':
83 $this->tabs_gui->setTabActive(
'perm_settings');
84 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
86 $ret =& $this->ctrl->forwardCommand($perm_gui);
111 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
113 $this->tabs_gui->addTarget(
"show_privacy",
114 $this->ctrl->getLinkTarget($this,
"showPrivacy"),
116 $this->tabs_gui->addTarget(
"show_security",
117 $this->ctrl->getLinkTarget($this,
"showSecurity"),
122 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
124 $this->tabs_gui->addTarget(
"perm_settings",
125 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"),
126 array(),
'ilpermissiongui');
139 $this->tabs_gui->setTabActive(
'show_privacy');
141 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
143 $form->setFormAction($this->ctrl->getFormAction($this));
144 $form->setTitle($this->lng->txt(
'ps_privacy_protection'));
146 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
150 $html->setValue($this->lng->txt(
'ps_warning_modify'));
151 $form->addItem($html);
155 if($privacy->enabledCourseExport())
157 $value[] =
"export_course";
159 if($privacy->enabledGroupExport())
161 $value[] =
"export_group";
163 if($privacy->courseConfirmationRequired())
165 $value[] =
"export_confirm_course";
167 if($privacy->groupConfirmationRequired())
169 $value[] =
"export_confirm_group";
171 if($privacy->enabledGroupAccessTimes())
173 $value[] =
"grp_access_times";
175 if($privacy->enabledCourseAccessTimes())
177 $value[] =
"crs_access_times";
182 $check->setTitle($this->lng->txt(
'ps_export_course'));
183 $check->setValue(
'export_course');
184 $group->addOption($check);
186 $check->setTitle($this->lng->txt(
'ps_export_groups'));
187 $check->setValue(
'export_group');
188 $group->addOption($check);
190 $check->setTitle($this->lng->txt(
'ps_export_confirm'));
191 $check->setValue(
'export_confirm_course');
192 $group->addOption($check);
194 $check->setTitle($this->lng->txt(
'ps_export_confirm_group'));
195 $check->setValue(
'export_confirm_group');
196 $group->addOption($check);
198 $check->setTitle($this->lng->txt(
'ps_show_grp_access'));
199 $check->setValue(
'grp_access_times');
200 $group->addOption($check);
202 $check->setTitle($this->lng->txt(
'ps_show_crs_access'));
203 $check->setValue(
'crs_access_times');
204 $group->addOption($check);
205 $form->addItem($group);
207 include_once
"Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
214 $form->addCommandButton(
'save_privacy',$this->lng->txt(
'save'));
215 $this->tpl->setContent($form->getHTML());
227 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
231 $this->tabs_gui->setTabActive(
'show_security');
234 $form->setFormAction($this->ctrl->getFormAction($this));
235 $form->setTitle($this->lng->txt(
'ps_security_protection'));
237 include_once
"Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
245 $this->tpl->setContent($form->getHTML());
258 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
260 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
263 if((
int)
$_POST[
'rbac_log_age'] > 24)
265 $_POST[
'rbac_log_age'] = 24;
267 else if((
int)
$_POST[
'rbac_log_age'] < 1)
269 $_POST[
'rbac_log_age'] = 1;
272 $_POST[
'profile_protection'] = isset(
$_POST[
'profile_protection']) ?
$_POST[
'profile_protection'] : array();
277 $old_settings = array(
278 'export_course' => $privacy->enabledCourseExport(),
279 'export_group' => $privacy->enabledGroupExport(),
280 'export_confirm_course' => $privacy->courseConfirmationRequired(),
281 'export_confirm_group' => $privacy->groupConfirmationRequired(),
282 'crs_access_times' => $privacy->enabledCourseAccessTimes(),
283 'grp_access_times' => $privacy->enabledGroupAccessTimes()
286 $privacy->enableCourseExport((
int) in_array(
'export_course',
$_POST[
'profile_protection']));
287 $privacy->enableGroupExport((
int) in_array(
'export_group',
$_POST[
'profile_protection']));
288 $privacy->setCourseConfirmationRequired((
int) in_array(
'export_confirm_course',
$_POST[
'profile_protection']));
289 $privacy->setGroupConfirmationRequired((
int) in_array(
'export_confirm_group',
$_POST[
'profile_protection']));
290 $privacy->showGroupAccessTimes((
int) in_array(
'grp_access_times',
$_POST[
'profile_protection']));
291 $privacy->showCourseAccessTimes((
int) in_array(
'crs_access_times',
$_POST[
'profile_protection']));
294 $code = $privacy->validate();
308 if(!$old_settings[
'export_course'] && $privacy->enabledCourseExport())
312 if(!$do_reset && !$old_settings[
'export_group'] && $privacy->enabledGroupExport())
316 if(!$do_reset && !$old_settings[
'export_confirm_course'] && $privacy->courseConfirmationRequired())
320 if(!$do_reset && !$old_settings[
'export_confirm_group'] && $privacy->groupConfirmationRequired())
324 if(!$do_reset && !$old_settings[
'crs_access_times'] && $privacy->enabledCourseAccessTimes())
328 if(!$do_reset && !$old_settings[
'grp_access_times'] && $privacy->enabledGroupAccessTimes())
334 include_once(
'Services/Membership/classes/class.ilMemberAgreement.php');
353 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
355 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
406 'ps_profile_export' => array(null, null, $subitems)
408 return array(array(
"showPrivacy", $fields));
420 'ps_profile_export' => array(null, null, $subitems)
422 return array(array(
"showPrivacy", $fields));